Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FOUR-17058: A confirmation message should appear before deleting a calcs #1643

Merged
merged 1 commit into from
Jul 11, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions src/components/computed-properties.vue
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,8 @@ import Validator from "@chantouchsek/validatorjs";
import FocusErrors from "../mixins/focusErrors";
import Sortable from './sortable/Sortable.vue';

const globalObject = typeof window === 'undefined' ? global : window;

export default {
components: {
FormInput,
Expand Down Expand Up @@ -403,6 +405,16 @@ export default {
this.displayList = false;
},
deleteProperty(item) {
globalObject.ProcessMaker.confirmModal(
this.$t('Are you sure you want to delete the calc ?'),
this.$t('If you do, you wont be able to recover the calc configuration.'),
'',
() => {
this.remove(item);
}
);
},
remove(item) {
this.current = this.current.filter((val) => {
return val.id !== item.id;
});
Expand Down
Loading