From 781a9045833e0641549123e6156bfcc7e6f08335 Mon Sep 17 00:00:00 2001 From: Fiz <34069775+Hafizzle@users.noreply.github.com> Date: Tue, 6 Jan 2026 15:19:30 -0600 Subject: [PATCH] Replace browser confirmations with confirmation modals (#15544) * Set and check rebirth confirmation modal from localstorage Set and check rebirth confirmation modal from localstorage after window reload * Don't show orb of rebirth confirmation modal until page reloads * Confirmation prompts (replace browser confirmation prompts) * lint * lint * Fix confirmation modal not showing for items w/gems * Updated delete and confirmation modals * lint * Fix top bar on color on confirmation prompt clipping * Show currency amount on purchase confirmation modals * confirmation modals using existing components * lint * Broken task confirmation modal * Replace class change confirmation with modal * fix(style): correct indentation * Replace warning svg w/ existing alert svg, and reset language strings * fix(json): json doesn't like comma dangles --------- Co-authored-by: Kalista Payne Co-authored-by: Kalista Payne --- .../src/components/header/banners/privacy.vue | 4 +- .../client/src/components/shops/buyModal.vue | 28 +- .../components/shops/purchaseConfirmModal.vue | 207 ++++++++++++++ .../components/shops/quests/buyQuestModal.vue | 8 +- .../client/src/components/static/privacy.vue | 12 +- .../src/components/static/staticWrapper.vue | 7 +- .../client/src/components/static/terms.vue | 2 +- .../src/components/tasks/brokenTaskModal.vue | 264 ++++++++++++++---- .../client/src/components/tasks/column.vue | 2 +- .../tasks/deleteTaskConfirmModal.vue | 223 +++++++++++++++ website/client/src/components/tasks/task.vue | 11 +- .../client/src/components/tasks/taskModal.vue | 21 +- .../client/src/components/ui/toggleSwitch.vue | 2 +- website/client/src/mixins/buy.js | 10 +- .../settings/settingRows/classSetting.vue | 14 +- .../siteDataRows/privacyPreferencesRow.vue | 16 +- website/client/src/pages/user-main.vue | 6 + website/common/locales/bg/challenge.json | 1 - website/common/locales/cs/challenge.json | 1 - website/common/locales/cs/tasks.json | 1 - website/common/locales/da/challenge.json | 1 - website/common/locales/de/challenge.json | 1 - website/common/locales/de/tasks.json | 1 - website/common/locales/en/challenge.json | 9 +- website/common/locales/en/generic.json | 3 +- website/common/locales/en/tasks.json | 9 +- website/common/locales/en_GB/challenge.json | 1 - website/common/locales/en_GB/tasks.json | 1 - website/common/locales/es/challenge.json | 1 - website/common/locales/es/tasks.json | 1 - website/common/locales/es_419/challenge.json | 1 - website/common/locales/es_419/tasks.json | 1 - website/common/locales/fr/challenge.json | 1 - website/common/locales/fr/tasks.json | 1 - website/common/locales/he/challenge.json | 1 - website/common/locales/he/tasks.json | 1 - website/common/locales/hr/challenge.json | 1 - website/common/locales/hr/tasks.json | 1 - website/common/locales/hu/challenge.json | 1 - website/common/locales/hu/tasks.json | 1 - website/common/locales/id/challenge.json | 1 - website/common/locales/id/tasks.json | 1 - website/common/locales/it/challenge.json | 1 - website/common/locales/it/tasks.json | 1 - website/common/locales/ja/challenge.json | 1 - website/common/locales/ja/tasks.json | 1 - website/common/locales/ko/challenge.json | 1 - website/common/locales/ko/tasks.json | 1 - website/common/locales/nl/challenge.json | 1 - website/common/locales/nl/tasks.json | 1 - website/common/locales/pl/challenge.json | 1 - website/common/locales/pl/tasks.json | 1 - website/common/locales/pt/challenge.json | 1 - website/common/locales/pt/tasks.json | 1 - website/common/locales/pt_BR/challenge.json | 1 - website/common/locales/pt_BR/tasks.json | 1 - website/common/locales/ro/challenge.json | 1 - website/common/locales/ro/tasks.json | 1 - website/common/locales/ru/challenge.json | 1 - website/common/locales/ru/tasks.json | 1 - website/common/locales/sk/challenge.json | 1 - website/common/locales/sk/tasks.json | 1 - website/common/locales/sr/challenge.json | 1 - website/common/locales/sr/tasks.json | 3 +- website/common/locales/sv/challenge.json | 1 - website/common/locales/sv/tasks.json | 1 - website/common/locales/tr/challenge.json | 1 - website/common/locales/tr/tasks.json | 1 - website/common/locales/uk/challenge.json | 1 - website/common/locales/uk/tasks.json | 1 - website/common/locales/zh/challenge.json | 1 - website/common/locales/zh/tasks.json | 1 - website/common/locales/zh_TW/challenge.json | 1 - website/common/locales/zh_TW/tasks.json | 1 - 74 files changed, 762 insertions(+), 152 deletions(-) create mode 100644 website/client/src/components/shops/purchaseConfirmModal.vue create mode 100644 website/client/src/components/tasks/deleteTaskConfirmModal.vue diff --git a/website/client/src/components/header/banners/privacy.vue b/website/client/src/components/header/banners/privacy.vue index 2e1faf0ac4..6a08194bdc 100644 --- a/website/client/src/components/header/banners/privacy.vue +++ b/website/client/src/components/header/banners/privacy.vue @@ -1,8 +1,8 @@ - + + diff --git a/website/client/src/components/tasks/task.vue b/website/client/src/components/tasks/task.vue index 055c6d87b3..cb31c03c6f 100644 --- a/website/client/src/components/tasks/task.vue +++ b/website/client/src/components/tasks/task.vue @@ -1177,9 +1177,16 @@ export default { moveToBottom () { this.$emit('moveTo', this.task, 'bottom'); }, - destroy () { + async destroy () { const type = this.$t(this.task.type); - if (!window.confirm(this.$t('sureDeleteType', { type }))) return; // eslint-disable-line no-alert + const confirmed = await new Promise(resolve => { + this.$root.$emit('habitica:delete-task-confirm', { + message: this.$t('sureDeleteType', { type }), + taskType: type, + resolve, + }); + }); + if (!confirmed) return; this.destroyTask(this.task); this.$emit('taskDestroyed', this.task); }, diff --git a/website/client/src/components/tasks/taskModal.vue b/website/client/src/components/tasks/taskModal.vue index ac45efe07c..dcfba2c094 100644 --- a/website/client/src/components/tasks/taskModal.vue +++ b/website/client/src/components/tasks/taskModal.vue @@ -150,14 +150,14 @@