Skip to content

Commit a8e0d1b

Browse files
author
hb
committed
Added confirm dialog for removing custom form field
1 parent 9df5ce1 commit a8e0d1b

File tree

4 files changed

+7
-4
lines changed

4 files changed

+7
-4
lines changed

app/components/forms/wizard/attendee-step.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,4 +24,5 @@ export default Component.extend(FormMixin, EventWizardMixin, {
2424
this.data.customForms.removeObject(field);
2525
}
2626
}
27-
});
27+
});
28+

app/components/forms/wizard/custom-forms/table.hbs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@
7171
<button class="ui compact icon positive circular button" data-tooltip="{{t 'Edit'}}" {{action @updateField field}}>
7272
<i class="pencil icon"></i>
7373
</button>
74-
<button class="ui compact icon negative circular button" data-tooltip="{{t 'Delete'}}" {{action @removeField field}}>
74+
<button class="ui compact icon negative circular button" data-tooltip="{{t 'Delete'}}" {{action (confirm (t "Are you sure you want to delete this?") (action @removeField field))}}>
7575
<i class="trash icon"></i>
7676
</button>
7777
{{/if}}

app/components/forms/wizard/custom-forms/table.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,9 @@ import Component from '@glimmer/component';
33
interface CustomForm { isComplex: boolean }
44

55
interface Args {
6-
fields: CustomForm[]
6+
fields: CustomForm[],
7+
removeField: (field: any) => void,
8+
updateField: (field: any) => void
79
}
810

911
export default class CustomFormTable extends Component<Args> {

app/templates/components/forms/wizard/attendee-step.hbs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@
4949
<div class="column">
5050
<Forms::Wizard::CustomForms::Table
5151
@fields={{this.editableFields}}
52-
@removeField={{action 'removeField'}}
52+
@removeField={{action "removeField"}}
5353
@updateField={{action (mut this.field)}}
5454
/>
5555
</div>

0 commit comments

Comments
 (0)