|
|
|
@ -19,58 +19,56 @@ |
|
|
|
</ng-container> |
|
|
|
|
|
|
|
<ng-container content> |
|
|
|
<ng-container *ngIf="rulesState.rules | async; let rules"> |
|
|
|
<ng-container *ngIf="ruleActions && ruleTriggers"> |
|
|
|
<div class="table-items-row table-items-row-empty" *ngIf="rules.length === 0"> |
|
|
|
No Rule created yet. |
|
|
|
<ng-container *ngIf="ruleActions && ruleTriggers && (rulesState.isLoaded | async) && (rulesState.rules | async); let rules"> |
|
|
|
<div class="table-items-row table-items-row-empty" *ngIf="rules.length === 0"> |
|
|
|
No rule created yet. |
|
|
|
|
|
|
|
<button type="button" class="btn btn-success btn-sm ml-2" (click)="createNew()"> |
|
|
|
<i class="icon icon-plus"></i> Add Rule |
|
|
|
</button> |
|
|
|
</div> |
|
|
|
<button type="button" class="btn btn-success btn-sm ml-2" (click)="createNew()"> |
|
|
|
<i class="icon icon-plus"></i> Add Rule |
|
|
|
</button> |
|
|
|
</div> |
|
|
|
|
|
|
|
<table class="table table-items table-fixed" *ngIf="rules.length > 0"> |
|
|
|
<tbody *ngFor="let rule of rules; trackBy: trackByRule"> |
|
|
|
<tr> |
|
|
|
<td class="cell-separator"> |
|
|
|
<h3>If</h3> |
|
|
|
</td> |
|
|
|
<td class="cell-auto"> |
|
|
|
<span (click)="editTrigger(rule)"> |
|
|
|
<sqx-rule-element [type]="rule.triggerType" [element]="ruleTriggers[rule.triggerType]"></sqx-rule-element> |
|
|
|
</span> |
|
|
|
</td> |
|
|
|
<td class="cell-separator"> |
|
|
|
<h3>then</h3> |
|
|
|
</td> |
|
|
|
<td class="cell-auto"> |
|
|
|
<span (click)="editAction(rule)"> |
|
|
|
<sqx-rule-element [type]="rule.actionType" [element]="ruleActions[rule.actionType]"></sqx-rule-element> |
|
|
|
</span> |
|
|
|
</td> |
|
|
|
<td class="cell-actions"> |
|
|
|
<sqx-toggle [ngModel]="rule.isEnabled" (ngModelChange)="toggle(rule)"></sqx-toggle> |
|
|
|
</td> |
|
|
|
<td class="cell-actions"> |
|
|
|
<button type="button" class="btn btn-text-danger" |
|
|
|
(sqxConfirmClick)="delete(rule)" |
|
|
|
confirmTitle="Delete rule" |
|
|
|
confirmText="Do you really want to delete the rule?"> |
|
|
|
<i class="icon-bin2"></i> |
|
|
|
</button> |
|
|
|
</td> |
|
|
|
</tr> |
|
|
|
<tr class="spacer"></tr> |
|
|
|
</tbody> |
|
|
|
</table> |
|
|
|
<table class="table table-items table-fixed"> |
|
|
|
<tbody *ngFor="let rule of rules; trackBy: trackByRule"> |
|
|
|
<tr> |
|
|
|
<td class="cell-separator"> |
|
|
|
<h3>If</h3> |
|
|
|
</td> |
|
|
|
<td class="cell-auto"> |
|
|
|
<span (click)="editTrigger(rule)"> |
|
|
|
<sqx-rule-element [type]="rule.triggerType" [element]="ruleTriggers[rule.triggerType]"></sqx-rule-element> |
|
|
|
</span> |
|
|
|
</td> |
|
|
|
<td class="cell-separator"> |
|
|
|
<h3>then</h3> |
|
|
|
</td> |
|
|
|
<td class="cell-auto"> |
|
|
|
<span (click)="editAction(rule)"> |
|
|
|
<sqx-rule-element [type]="rule.actionType" [element]="ruleActions[rule.actionType]"></sqx-rule-element> |
|
|
|
</span> |
|
|
|
</td> |
|
|
|
<td class="cell-actions"> |
|
|
|
<sqx-toggle [ngModel]="rule.isEnabled" (ngModelChange)="toggle(rule)"></sqx-toggle> |
|
|
|
</td> |
|
|
|
<td class="cell-actions"> |
|
|
|
<button type="button" class="btn btn-text-danger" |
|
|
|
(sqxConfirmClick)="delete(rule)" |
|
|
|
confirmTitle="Delete rule" |
|
|
|
confirmText="Do you really want to delete the rule?"> |
|
|
|
<i class="icon-bin2"></i> |
|
|
|
</button> |
|
|
|
</td> |
|
|
|
</tr> |
|
|
|
<tr class="spacer"></tr> |
|
|
|
</tbody> |
|
|
|
</table> |
|
|
|
|
|
|
|
<ng-container *sqxModalView="addRuleDialog;onRoot:true;closeAuto:false"> |
|
|
|
<sqx-rule-wizard [schemas]="schemasState.schemas | async" [rule]="wizardRule" [mode]="wizardMode" |
|
|
|
[ruleActions]="ruleActions" |
|
|
|
[ruleTriggers]="ruleTriggers" |
|
|
|
(completed)="addRuleDialog.hide()"> |
|
|
|
</sqx-rule-wizard> |
|
|
|
</ng-container> |
|
|
|
<ng-container *sqxModalView="addRuleDialog;onRoot:true;closeAuto:false"> |
|
|
|
<sqx-rule-wizard [schemas]="schemasState.schemas | async" [rule]="wizardRule" [mode]="wizardMode" |
|
|
|
[ruleActions]="ruleActions" |
|
|
|
[ruleTriggers]="ruleTriggers" |
|
|
|
(completed)="addRuleDialog.hide()"> |
|
|
|
</sqx-rule-wizard> |
|
|
|
</ng-container> |
|
|
|
</ng-container> |
|
|
|
</ng-container> |
|
|
|
|