From f1e2848001e7ac0721349981992b3e9bf3807110 Mon Sep 17 00:00:00 2001 From: Rodrigo Quelca Date: Thu, 11 Jul 2024 14:30:18 -0400 Subject: [PATCH] FOUR-17058: A confirmation message should appear before deleting a calcs --- src/components/computed-properties.vue | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/components/computed-properties.vue b/src/components/computed-properties.vue index 01d4a7c1a..2b62937ff 100644 --- a/src/components/computed-properties.vue +++ b/src/components/computed-properties.vue @@ -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, @@ -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; });