Browse Source

Rename edge Default rule chain to Auto-assign

pull/3957/head
Artem Babak 6 years ago
parent
commit
a083719de4
  1. 14
      ui/src/app/locale/locale.constant-en_US.json
  2. 2
      ui/src/app/rulechain/rulechain-card.tpl.html
  3. 6
      ui/src/app/rulechain/rulechain-fieldset.tpl.html
  4. 4
      ui/src/app/rulechain/rulechain.directive.js
  5. 26
      ui/src/app/rulechain/rulechains.controller.js
  6. 4
      ui/src/app/rulechain/rulechains.tpl.html

14
ui/src/app/locale/locale.constant-en_US.json

@ -1587,7 +1587,7 @@
"assign-rulechains": "Assign rulechains",
"assign-new-rulechain": "Assign new rulechain",
"delete-rulechains": "Delete rulechains",
"default": "Default",
"auto-assign-to-edge": "Auto-assign to edge(s)",
"unassign-rulechain": "Unassign rulechain",
"unassign-rulechains": "Unassign rulechains",
"unassign-rulechain-title": "Are you sure you want to unassign the rulechain '{{ruleChainTitle}}'?",
@ -1601,12 +1601,12 @@
"set-default-root-edge-rulechain-title": "Are you sure you want to make the rule chain '{{ruleChainName}}' default edge root?",
"set-default-root-edge-rulechain-text": "After the confirmation the rule chain will become default edge root and will handle all incoming transport messages.",
"invalid-rulechain-type-error": "Unable to import rule chain: Invalid rule chain type. Expected type is {{expectedRuleChainType}}.",
"set-default-edge": "Make rule chain default",
"set-default-edge-title": "Are you sure you want to make the edge rule chain '{{ruleChainName}}' default?",
"set-default-edge-text": "After the confirmation the edge rule chain will be added to default list and assigned to newly created edge(s).",
"remove-default-edge": "Remove rule chain from defaults",
"remove-default-edge-title": "Are you sure you want to remove the edge rule chain '{{ruleChainName}}' from default list?",
"remove-default-edge-text": "After the confirmation the edge rule chain will not be assigned for a newly created edges."
"set-auto-assign-to-edge": "Auto-assign rule chain to edge(s) on creation",
"set-auto-assign-to-edge-title": "Are you sure you want to auto-assign the edge rule chain '{{ruleChainName}}' to edge(s) on creation?",
"set-auto-assign-to-edge-text": "After the confirmation the edge rule chain will be automatically assigned to edge(s) on creation.",
"remove-auto-assign-to-edge": "Do not assign rule chain to edge(s) on creation",
"remove-auto-assign-to-edge-title": "Are you sure you do not want to auto-assign the edge rule chain '{{ruleChainName}}' to edge(s) on creation?",
"remove-auto-assign-to-edge-text": "After the confirmation the edge rule chain won't be automatically assigned to edge(s) on creation."
},
"rulenode": {
"details": "Details",

2
ui/src/app/rulechain/rulechain-card.tpl.html

@ -20,4 +20,4 @@
<div ng-if="vm.parentCtl.ruleChainsScope === 'edges' && vm.parentCtl.isRootRuleChain(item)" translate>rulechain.default-root</div>
<div ng-if="(vm.parentCtl.ruleChainsScope === 'edges' && vm.parentCtl.isDefaultEdgeRuleChain(item))" translate>rulechain.default</div>
<div ng-if="(vm.parentCtl.ruleChainsScope === 'edges' && vm.parentCtl.isDefaultEdgeRuleChain(item))" translate>rulechain.auto-assign-to-edge</div>

6
ui/src/app/rulechain/rulechain-fieldset.tpl.html

@ -26,12 +26,12 @@
<md-button ng-click="onSetRootRuleChain({event: $event})"
ng-show="!isEdit && !ruleChain.root && ruleChainsScope == 'edges'"
class="md-raised md-primary">{{ 'rulechain.set-default-root-edge' | translate }}</md-button>
<md-button ng-click="onSetDefaultEdgeRuleChain({event: $event})"
<md-button ng-click="onSetAutoAssignToEdgeRuleChain({event: $event})"
ng-show="!isEdit && !ruleChain.root && !ruleChain.isDefault && ruleChainsScope == 'edges'"
class="md-raised md-primary">{{ 'rulechain.set-default-edge' | translate }}</md-button>
class="md-raised md-primary">{{ 'rulechain.set-auto-assign-to-edge' | translate }}</md-button>
<md-button ng-click="onRemoveDefaultEdgeRuleChain({event: $event})"
ng-show="!isEdit && !ruleChain.root && ruleChain.isDefault && ruleChainsScope == 'edges'"
class="md-raised md-primary">{{ 'rulechain.remove-default-edge' | translate }}</md-button>
class="md-raised md-primary">{{ 'rulechain.remove-auto-assign-to-edge' | translate }}</md-button>
<md-button ng-click="onSetRootRuleChain({event: $event})"
ng-show="!isEdit && ruleChainsScope == 'edge' && edge.rootRuleChainId.id !== ruleChain.id.id"

4
ui/src/app/rulechain/rulechain.directive.js

@ -42,8 +42,8 @@ export default function RuleChainDirective($compile, $templateCache, $mdDialog,
theForm: '=',
ruleChainsScope: '=',
edge: '=',
onSetDefaultEdgeRuleChain: '&',
onRemoveDefaultEdgeRuleChain: '&',
onSetAutoAssignToEdgeRuleChain: '&',
onRemoveAutoAssignToEdgeRuleChain: '&',
onSetRootRuleChain: '&',
onExportRuleChain: '&',
onDeleteRuleChain: '&'

26
ui/src/app/rulechain/rulechains.controller.js

@ -97,7 +97,7 @@ export default function RuleChainsController(ruleChainService, userService, impo
vm.exportRuleChain = exportRuleChain;
vm.setRootRuleChain = setRootRuleChain;
vm.setDefaultEdgeRuleChain = setDefaultEdgeRuleChain;
vm.setAutoAssignToEdgeRuleChain = setAutoAssignToEdgeRuleChain;
vm.removeDefaultEdgeRuleChain = removeDefaultEdgeRuleChain;
initController();
@ -185,10 +185,10 @@ export default function RuleChainsController(ruleChainService, userService, impo
ruleChainActionsList.push({
onAction: function ($event, item) {
setDefaultEdgeRuleChain($event, item);
setAutoAssignToEdgeRuleChain($event, item);
},
name: function() { return $translate.instant('rulechain.set-default-edge') },
details: function() { return $translate.instant('rulechain.set-default-edge') },
name: function() { return $translate.instant('rulechain.set-auto-assign-to-edge') },
details: function() { return $translate.instant('rulechain.set-auto-assign-to-edge') },
icon: "bookmark_outline",
isEnabled: isNonDefaultEdgeRuleChain
});
@ -197,8 +197,8 @@ export default function RuleChainsController(ruleChainService, userService, impo
onAction: function ($event, item) {
removeDefaultEdgeRuleChain($event, item);
},
name: function() { return $translate.instant('rulechain.remove-default-edge') },
details: function() { return $translate.instant('rulechain.remove-default-edge') },
name: function() { return $translate.instant('rulechain.remove-auto-assign-to-edge') },
details: function() { return $translate.instant('rulechain.remove-auto-assign-to-edge') },
icon: "bookmark",
isEnabled: isDefaultEdgeRuleChain
});
@ -471,13 +471,13 @@ export default function RuleChainsController(ruleChainService, userService, impo
});
}
function setDefaultEdgeRuleChain($event, ruleChain) {
function setAutoAssignToEdgeRuleChain($event, ruleChain) {
$event.stopPropagation();
var confirm = $mdDialog.confirm()
.targetEvent($event)
.title($translate.instant('rulechain.set-default-edge-title', {ruleChainName: ruleChain.name}))
.htmlContent($translate.instant('rulechain.set-default-edge-text'))
.ariaLabel($translate.instant('rulechain.set-default-edge'))
.title($translate.instant('rulechain.set-auto-assign-to-edge-title', {ruleChainName: ruleChain.name}))
.htmlContent($translate.instant('rulechain.set-auto-assign-to-edge-text'))
.ariaLabel($translate.instant('rulechain.set-auto-assign-to-edge'))
.cancel($translate.instant('action.no'))
.ok($translate.instant('action.yes'));
$mdDialog.show(confirm).then(function () {
@ -493,9 +493,9 @@ export default function RuleChainsController(ruleChainService, userService, impo
$event.stopPropagation();
var confirm = $mdDialog.confirm()
.targetEvent($event)
.title($translate.instant('rulechain.remove-default-edge-title', {ruleChainName: ruleChain.name}))
.htmlContent($translate.instant('rulechain.remove-default-edge-text'))
.ariaLabel($translate.instant('rulechain.remove-default-edge'))
.title($translate.instant('rulechain.remove-auto-assign-to-edge-title', {ruleChainName: ruleChain.name}))
.htmlContent($translate.instant('rulechain.remove-auto-assign-to-edge-text'))
.ariaLabel($translate.instant('rulechain.remove-auto-assign-to-edge'))
.cancel($translate.instant('action.no'))
.ok($translate.instant('action.yes'));
$mdDialog.show(confirm).then(function () {

4
ui/src/app/rulechain/rulechains.tpl.html

@ -28,8 +28,8 @@
the-form="vm.grid.detailsForm"
rule-chains-scope="vm.ruleChainsScope"
edge="vm.edge"
on-set-default-edge-rule-chain="vm.setDefaultEdgeRuleChain(event, vm.grid.detailsConfig.currentItem)"
on-remove-default-edge-rule-chain="vm.removeDefaultEdgeRuleChain(event, vm.grid.detailsConfig.currentItem)"
on-set-auto-assign-to-edge-rule-chain="vm.setAutoAssignToEdgeRuleChain(event, vm.grid.detailsConfig.currentItem)"
on-remove-auto-assign-to-edge-rule-chain="vm.removeAutoAssignToEdgeRuleChain(event, vm.grid.detailsConfig.currentItem)"
on-set-root-rule-chain="vm.setRootRuleChain(event, vm.grid.detailsConfig.currentItem)"
on-export-rule-chain="vm.exportRuleChain(event, vm.grid.detailsConfig.currentItem)"
on-delete-rule-chain="vm.grid.deleteItem(event, vm.grid.detailsConfig.currentItem)">

Loading…
Cancel
Save