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) {
<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)">
<i-bs name="trash"></i-bs>&nbsp;<ng-container i18n>Delete</ng-container>
</button>
<pngx-confirm-button
label="Delete"
i18n-label
(confirm)="removeTrigger(i)"
buttonClasses="btn-link text-danger ms-2"
iconName="trash">
</pngx-confirm-button>
</button>
</div>
<div ngbAccordionCollapse>
@ -76,9 +80,13 @@
@if(action.id > -1) {
<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)">
<i-bs name="trash"></i-bs>&nbsp;<ng-container i18n>Delete</ng-container>
</button>
<pngx-confirm-button
label="Delete"
i18n-label
(confirm)="removeAction(i)"
buttonClasses="btn-link text-danger ms-2"
iconName="trash">
</pngx-confirm-button>
</button>
</div>
<div ngbAccordionCollapse>

View File

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