Browse Source

Enable/disable rule over context menu.

pull/749/head
Sebastian 4 years ago
parent
commit
2191eec975
  1. 2
      backend/i18n/frontend_en.json
  2. 2
      backend/i18n/frontend_it.json
  3. 2
      backend/i18n/frontend_nl.json
  4. 2
      backend/i18n/frontend_zh.json
  5. 2
      backend/i18n/source/frontend_en.json
  6. 10
      frontend/app/features/rules/pages/rules/rule.component.html
  7. 8
      frontend/app/features/rules/pages/rules/rule.component.ts

2
backend/i18n/frontend_en.json

@ -251,11 +251,13 @@
"common.delete": "Delete", "common.delete": "Delete",
"common.description": "Description", "common.description": "Description",
"common.designer": "Designer", "common.designer": "Designer",
"common.disable": "Disable",
"common.disabled": "Disabled", "common.disabled": "Disabled",
"common.displayName": "Display Name", "common.displayName": "Display Name",
"common.edit": "Edit", "common.edit": "Edit",
"common.editing": "Editing", "common.editing": "Editing",
"common.email": "Email", "common.email": "Email",
"common.enable": "Enable",
"common.enabled": "Enabled", "common.enabled": "Enabled",
"common.error": "Error", "common.error": "Error",
"common.errorBack": "Back to previous page.", "common.errorBack": "Back to previous page.",

2
backend/i18n/frontend_it.json

@ -251,11 +251,13 @@
"common.delete": "Cancella", "common.delete": "Cancella",
"common.description": "Descrizione", "common.description": "Descrizione",
"common.designer": "Designer", "common.designer": "Designer",
"common.disable": "Disable",
"common.disabled": "Disabled", "common.disabled": "Disabled",
"common.displayName": "Nome visualizzato", "common.displayName": "Nome visualizzato",
"common.edit": "Modifica", "common.edit": "Modifica",
"common.editing": "Editing", "common.editing": "Editing",
"common.email": "Email", "common.email": "Email",
"common.enable": "Enable",
"common.enabled": "Enabled", "common.enabled": "Enabled",
"common.error": "Errore", "common.error": "Errore",
"common.errorBack": "Torna alla pagina precedente.", "common.errorBack": "Torna alla pagina precedente.",

2
backend/i18n/frontend_nl.json

@ -251,11 +251,13 @@
"common.delete": "Verwijderen", "common.delete": "Verwijderen",
"common.description": "Beschrijving", "common.description": "Beschrijving",
"common.designer": "Designer", "common.designer": "Designer",
"common.disable": "Disable",
"common.disabled": "Disabled", "common.disabled": "Disabled",
"common.displayName": "Weergavenaam", "common.displayName": "Weergavenaam",
"common.edit": "Bewerken", "common.edit": "Bewerken",
"common.editing": "Editing", "common.editing": "Editing",
"common.email": "E-mail", "common.email": "E-mail",
"common.enable": "Enable",
"common.enabled": "Enabled", "common.enabled": "Enabled",
"common.error": "Fout", "common.error": "Fout",
"common.errorBack": "Terug naar de vorige pagina.", "common.errorBack": "Terug naar de vorige pagina.",

2
backend/i18n/frontend_zh.json

@ -251,11 +251,13 @@
"common.delete": "删除", "common.delete": "删除",
"common.description": "说明", "common.description": "说明",
"common.designer": "设计师", "common.designer": "设计师",
"common.disable": "Disable",
"common.disabled": "已禁用", "common.disabled": "已禁用",
"common.displayName": "显示名称", "common.displayName": "显示名称",
"common.edit": "编辑", "common.edit": "编辑",
"common.editing": "Editing", "common.editing": "Editing",
"common.email": "电子邮件", "common.email": "电子邮件",
"common.enable": "Enable",
"common.enabled": "已启用", "common.enabled": "已启用",
"common.error": "错误", "common.error": "错误",
"common.errorBack": "返回上一页。", "common.errorBack": "返回上一页。",

2
backend/i18n/source/frontend_en.json

@ -251,11 +251,13 @@
"common.delete": "Delete", "common.delete": "Delete",
"common.description": "Description", "common.description": "Description",
"common.designer": "Designer", "common.designer": "Designer",
"common.disable": "Disable",
"common.disabled": "Disabled", "common.disabled": "Disabled",
"common.displayName": "Display Name", "common.displayName": "Display Name",
"common.edit": "Edit", "common.edit": "Edit",
"common.editing": "Editing", "common.editing": "Editing",
"common.email": "Email", "common.email": "Email",
"common.enable": "Enable",
"common.enabled": "Enabled", "common.enabled": "Enabled",
"common.error": "Error", "common.error": "Error",
"common.errorBack": "Back to previous page.", "common.errorBack": "Back to previous page.",

10
frontend/app/features/rules/pages/rules/rule.component.html

@ -17,13 +17,19 @@
<ng-container *sqxModal="dropdown;closeAlways:true"> <ng-container *sqxModal="dropdown;closeAlways:true">
<div class="dropdown-menu" [sqxAnchoredTo]="buttonOptions" position="bottom-right" @fade> <div class="dropdown-menu" [sqxAnchoredTo]="buttonOptions" position="bottom-right" @fade>
<ng-container *ngIf="rule.canUpdate">
<a class="dropdown-item" *ngIf="rule.canUpdate" [routerLink]="rule.id"> <a class="dropdown-item" *ngIf="rule.canUpdate" [routerLink]="rule.id">
{{ 'common.edit' | sqxTranslate }} {{ 'common.edit' | sqxTranslate }}
</a> </a>
<a class="dropdown-item" *ngIf="rule.canEnable" (click)="enable()">
{{ 'common.enable' | sqxTranslate }}
</a>
<a class="dropdown-item" *ngIf="rule.canDisable" (click)="disable()">
{{ 'common.disable' | sqxTranslate }}
</a>
<div class="dropdown-divider"></div> <div class="dropdown-divider"></div>
</ng-container>
<ng-container *ngIf="rule.canRun || rule.canRunFromSnapshots"> <ng-container *ngIf="rule.canRun || rule.canRunFromSnapshots">
<a class="dropdown-item" *ngIf="rule.canRun" <a class="dropdown-item" *ngIf="rule.canRun"

8
frontend/app/features/rules/pages/rules/rule.component.ts

@ -54,6 +54,14 @@ export class RuleComponent {
this.rulesState.update(this.rule, { name }); this.rulesState.update(this.rule, { name });
} }
public disable() {
this.rulesState.update(this.rule, { isEnabled: false });
}
public enable() {
this.rulesState.update(this.rule, { isEnabled: true });
}
public toggle() { public toggle() {
this.rulesState.update(this.rule, { isEnabled: !this.rule.isEnabled }); this.rulesState.update(this.rule, { isEnabled: !this.rule.isEnabled });
} }

Loading…
Cancel
Save