From 9fe0df3327a90a72d29395348d374242aa4aa4bc Mon Sep 17 00:00:00 2001 From: Jonathan Cobb Date: Thu, 23 Jan 2020 13:25:22 -0500 Subject: [PATCH] fix updating for AppRule. adjust HN userblocker config --- bubble-server/src/main/java/bubble/model/app/AppRule.java | 6 +++--- .../models/apps/user_block/hn/bubbleApp_userBlock_hn.json | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/bubble-server/src/main/java/bubble/model/app/AppRule.java b/bubble-server/src/main/java/bubble/model/app/AppRule.java index 6b993f2d..d840d4e1 100644 --- a/bubble-server/src/main/java/bubble/model/app/AppRule.java +++ b/bubble-server/src/main/java/bubble/model/app/AppRule.java @@ -43,8 +43,8 @@ import static org.cobbzilla.wizard.model.crypto.EncryptedTypes.ENC_PAD; }) public class AppRule extends IdentifiableBaseParentEntity implements AppTemplateEntity, HasPriority { - public static final String[] VALUE_FIELDS = {"driver", "configJson", "template", "enabled"}; - public static final String[] CREATE_FIELDS = ArrayUtil.append(VALUE_FIELDS, "name"); + public static final String[] UPDATE_FIELDS = {"configJson", "template", "enabled"}; + public static final String[] CREATE_FIELDS = ArrayUtil.append(UPDATE_FIELDS, "driver", "app", "name"); @ECSearchable(filter=true) @ECField(index=10) @HasValue(message="err.name.required") @@ -107,7 +107,7 @@ public class AppRule extends IdentifiableBaseParentEntity implements AppTemplate setUuid(null); } - @Override public Identifiable update(Identifiable other) { copy(this, other, VALUE_FIELDS); return this; } + @Override public Identifiable update(Identifiable other) { copy(this, other, UPDATE_FIELDS); return this; } @Transient public JsonNode getConfig () { return json(configJson, JsonNode.class); } public AppRule setConfig(JsonNode config) { return setConfigJson(json(config)); } diff --git a/bubble-server/src/main/resources/models/apps/user_block/hn/bubbleApp_userBlock_hn.json b/bubble-server/src/main/resources/models/apps/user_block/hn/bubbleApp_userBlock_hn.json index 6a3b8919..c2cfb683 100644 --- a/bubble-server/src/main/resources/models/apps/user_block/hn/bubbleApp_userBlock_hn.json +++ b/bubble-server/src/main/resources/models/apps/user_block/hn/bubbleApp_userBlock_hn.json @@ -22,7 +22,7 @@ ], "commentDecorator": { "regex": "class=\"age\"\\s*>.+?", - "insert": "BLOCK" + "insert": " [X] " } } }]