Use confirm button for workflow edit dialog delete trigger / action

This commit is contained in:
shamoon 2024-02-06 21:35:41 -08:00
parent f6dd27aa7e
commit f709d12f1c
2 changed files with 16 additions and 6 deletions

View File

@ -38,9 +38,13 @@
@if(trigger.id > -1) { @if(trigger.id > -1) {
<span class="badge bg-primary text-primary-text-contrast ms-2">ID: {{trigger.id}}</span> <span class="badge bg-primary text-primary-text-contrast ms-2">ID: {{trigger.id}}</span>
} }
<button type="button" class="btn btn-link text-danger ms-2" (click)="removeTrigger(i)"> <pngx-confirm-button
<i-bs name="trash"></i-bs>&nbsp;<ng-container i18n>Delete</ng-container> label="Delete"
</button> i18n-label
(confirm)="removeTrigger(i)"
buttonClasses="btn-link text-danger ms-2"
iconName="trash">
</pngx-confirm-button>
</button> </button>
</div> </div>
<div ngbAccordionCollapse> <div ngbAccordionCollapse>
@ -76,9 +80,13 @@
@if(action.id > -1) { @if(action.id > -1) {
<span class="badge bg-primary text-primary-text-contrast ms-2">ID: {{action.id}}</span> <span class="badge bg-primary text-primary-text-contrast ms-2">ID: {{action.id}}</span>
} }
<button type="button" class="btn btn-link text-danger ms-2" (click)="removeAction(i)"> <pngx-confirm-button
<i-bs name="trash"></i-bs>&nbsp;<ng-container i18n>Delete</ng-container> label="Delete"
</button> i18n-label
(confirm)="removeAction(i)"
buttonClasses="btn-link text-danger ms-2"
iconName="trash">
</pngx-confirm-button>
</button> </button>
</div> </div>
<div ngbAccordionCollapse> <div ngbAccordionCollapse>

View File

@ -38,6 +38,7 @@ import {
WorkflowActionType, WorkflowActionType,
} from 'src/app/data/workflow-action' } from 'src/app/data/workflow-action'
import { MATCHING_ALGORITHMS, MATCH_AUTO } from 'src/app/data/matching-model' import { MATCHING_ALGORITHMS, MATCH_AUTO } from 'src/app/data/matching-model'
import { ConfirmButtonComponent } from '../../confirm-button/confirm-button.component'
const workflow: Workflow = { const workflow: Workflow = {
name: 'Workflow 1', name: 'Workflow 1',
@ -85,6 +86,7 @@ describe('WorkflowEditDialogComponent', () => {
PermissionsUserComponent, PermissionsUserComponent,
PermissionsGroupComponent, PermissionsGroupComponent,
SafeHtmlPipe, SafeHtmlPipe,
ConfirmButtonComponent,
], ],
providers: [ providers: [
NgbActiveModal, NgbActiveModal,