瀏覽代碼

fix button message defaults, allow sortable actions

tags/v0.5.0
Jonathan Cobb 5 年之前
父節點
當前提交
f4cc37732b
共有 4 個文件被更改,包括 36 次插入24 次删除
  1. +2
    -1
      bubble-server/src/main/java/bubble/model/app/config/AppConfigAction.java
  2. +8
    -5
      bubble-server/src/main/java/bubble/service/message/AppMessageService.java
  3. +25
    -17
      bubble-server/src/main/resources/models/apps/bubble_block/bubbleApp_bubbleBlock.json
  4. +1
    -1
      bubble-web

+ 2
- 1
bubble-server/src/main/java/bubble/model/app/config/AppConfigAction.java 查看文件

@@ -11,8 +11,9 @@ public class AppConfigAction {
@Getter @Setter private AppConfigScope scope = AppConfigScope.item; @Getter @Setter private AppConfigScope scope = AppConfigScope.item;
@Getter @Setter private String when; @Getter @Setter private String when;
@Getter @Setter private String view; @Getter @Setter private String view;
@Getter @Setter private Integer index = 0;


@Getter @Setter private AppDataField[] params;
@Getter @Setter private String[] params;
public boolean hasParams () { return !empty(params); } public boolean hasParams () { return !empty(params); }


@Getter @Setter private String button; @Getter @Setter private String button;


+ 8
- 5
bubble-server/src/main/java/bubble/service/message/AppMessageService.java 查看文件

@@ -100,17 +100,20 @@ public class AppMessageService {


if (configView.hasActions()) { if (configView.hasActions()) {
for (AppConfigAction action : configView.getActions()) { for (AppConfigAction action : configView.getActions()) {
final String actionKey = cfgKeyPrefix + MSG_SUFFIX_ACTION + action.getName();
if (!props.containsKey(actionKey)) props.setProperty(actionKey, action.getName());
final String actionName = action.getName();
final String actionKey = cfgKeyPrefix + MSG_SUFFIX_ACTION + actionName;
if (!props.containsKey(actionKey)) props.setProperty(actionKey, actionName);


final String buttonKey = cfgKeyPrefix + MSG_SUFFIX_BUTTON + actionName;
if (action.hasButton()) { if (action.hasButton()) {
final String buttonKey = cfgKeyPrefix + MSG_SUFFIX_BUTTON + action.getName();
if (!props.containsKey(buttonKey)) props.setProperty(buttonKey, action.getButton()); if (!props.containsKey(buttonKey)) props.setProperty(buttonKey, action.getButton());
} else {
props.setProperty(buttonKey, props.getProperty(cfgKeyPrefix+MSG_SUFFIX_ACTION+ actionName));
} }


if (action.hasParams()) { if (action.hasParams()) {
for (AppDataField param : action.getParams()) {
ensureFieldNameAndDescription(props, cfgKeyPrefix, param.getName());
for (String param : action.getParams()) {
ensureFieldNameAndDescription(props, cfgKeyPrefix, param);
} }
} }
} }


+ 25
- 17
bubble-server/src/main/resources/models/apps/bubble_block/bubbleApp_bubbleBlock.json 查看文件

@@ -28,6 +28,7 @@
{"name": "name"}, {"name": "name"},
{"name": "description", "control": "textarea"}, {"name": "description", "control": "textarea"},
{"name": "url", "type": "http_url"}, {"name": "url", "type": "http_url"},
{"name": "testUrl", "type": "http_url"},
{"name": "tags"}, {"name": "tags"},
{"name": "enabled", "type": "flag"}, {"name": "enabled", "type": "flag"},
{"name": "rule"} {"name": "rule"}
@@ -38,14 +39,19 @@
"root": "true", "root": "true",
"fields": ["name", "description", "url", "enabled", "tagString"], "fields": ["name", "description", "url", "enabled", "tagString"],
"actions": [ "actions": [
{"name": "enableList", "when": "!item.enabled"},
{"name": "disableList", "when": "item.enabled"},
{"name": "manageList", "view": "manageList"},
{"name": "removeList"},
{"name": "enableList", "when": "!item.enabled", "index": 10},
{"name": "disableList", "when": "item.enabled", "index": 20},
{"name": "manageList", "view": "manageList", "index": 30},
{"name": "removeList", "index": 40},
{ {
"name": "createList", "scope": "app", "view": "manageList",
"params": [{"name": "url", "type": "http_url"}],
"name": "createList", "scope": "app", "view": "manageList", "index": 10,
"params": ["url"],
"button": "createList" "button": "createList"
},
{
"name": "testUrl", "scope": "app", "index": 20,
"params": ["testUrl"],
"button": "testUrl"
} }
] ]
}, { }, {
@@ -53,26 +59,26 @@
"scope": "item", "scope": "item",
"fields": ["name", "description", "url", "tags", "enabled"], "fields": ["name", "description", "url", "tags", "enabled"],
"actions": [ "actions": [
{"name": "enableList", "when": "!item.enabled"},
{"name": "disableList", "when": "item.enabled"},
{"name": "removeList"},
{"name": "updateList"},
{"name": "manageListRules"}
{"name": "updateList", "index": 10},
{"name": "enableList", "when": "!item.enabled", "index": 20},
{"name": "disableList", "when": "item.enabled", "index": 30},
{"name": "manageListRules", "view": "manageRules", "index": 40},
{"name": "removeList", "index": 50}
] ]
}, { }, {
"name": "manageRules", "name": "manageRules",
"scope": "item", "scope": "item",
"fields": ["rule"], "fields": ["rule"],
"actions": [ "actions": [
{"name": "removeRule"},
{"name": "removeRule", "index": 10},
{ {
"name": "createRule",
"params": [{"name": "url", "type": "http_url"}],
"name": "createRule", "scope": "app", "index": 10,
"params": ["url"],
"button": "createRule" "button": "createRule"
}, },
{ {
"name": "testUrl",
"params": [{"name": "url", "type": "http_url"}],
"name": "testUrl", "scope": "app", "index": 20,
"params": ["testUrl"],
"button": "testUrl" "button": "testUrl"
} }
] ]
@@ -143,9 +149,11 @@
{"name": "config.field.url.description", "value": "URL of the Filter List"}, {"name": "config.field.url.description", "value": "URL of the Filter List"},
{"name": "config.field.tagString", "value": "Tags"}, {"name": "config.field.tagString", "value": "Tags"},
{"name": "config.field.tags", "value": "Tags"}, {"name": "config.field.tags", "value": "Tags"},
{"name": "config.field.tags.description", "value": "A comma-separated list of tags: "},
{"name": "config.field.tags.description", "value": "A comma-separated list of tags"},
{"name": "config.field.enabled", "value": "Enabled"}, {"name": "config.field.enabled", "value": "Enabled"},
{"name": "config.field.rule", "value": "Rule"}, {"name": "config.field.rule", "value": "Rule"},
{"name": "config.field.testUrl", "value": "Test URL"},
{"name": "config.field.testUrl.description", "value": "URL to check against filters"},


{"name": "config.action.enableList", "value": "Enable"}, {"name": "config.action.enableList", "value": "Enable"},
{"name": "config.action.disableList", "value": "Disable"}, {"name": "config.action.disableList", "value": "Disable"},


+ 1
- 1
bubble-web

@@ -1 +1 @@
Subproject commit 3244ea3346f1ab804d9f8cfcca045dbfbc93f575
Subproject commit 88b12bd4be622c1c839550686b944ff6dff3be26

Loading…
取消
儲存