From f59237e3eacd3e02eaf49fea7a97bb4f7de7fd56 Mon Sep 17 00:00:00 2001 From: Mathis Mensing Date: Wed, 31 Jan 2024 22:37:00 +0100 Subject: [PATCH 1/2] feat: improve confirmation messages Signed-off-by: Mathis Mensing --- src/components/settings/auth/AuthSettings.vue | 2 +- src/components/widgets/bedmesh/BedMeshControls.vue | 4 ++-- src/components/widgets/status/StatusControls.vue | 2 +- src/locales/en.yaml | 5 +++++ src/mixins/state.ts | 2 +- 5 files changed, 10 insertions(+), 5 deletions(-) diff --git a/src/components/settings/auth/AuthSettings.vue b/src/components/settings/auth/AuthSettings.vue index 704ceaa6ae..1819550671 100644 --- a/src/components/settings/auth/AuthSettings.vue +++ b/src/components/settings/auth/AuthSettings.vue @@ -151,7 +151,7 @@ export default class AuthSettings extends Vue { async handleRemoveUser (user: AppUser) { const result = await this.$confirm( - this.$tc('app.general.simple_form.msg.confirm'), + this.$t('app.general.simple_form.msg.confirm_remove_user', { username: user.username }).toString(), { title: this.$tc('app.general.label.confirm'), color: 'card-heading', icon: '$error' } ) diff --git a/src/components/widgets/bedmesh/BedMeshControls.vue b/src/components/widgets/bedmesh/BedMeshControls.vue index 1b430b8fef..88ef384422 100644 --- a/src/components/widgets/bedmesh/BedMeshControls.vue +++ b/src/components/widgets/bedmesh/BedMeshControls.vue @@ -371,7 +371,7 @@ export default class BedMesh extends Mixins(StateMixin, ToolheadMixin) { const result = ( !this.printerPrinting || await this.$confirm( - this.$tc('app.general.simple_form.msg.confirm'), + this.$t('app.general.simple_form.msg.confirm_load_profile', { name }).toString(), { title: this.$tc('app.general.label.confirm'), color: 'card-heading', icon: '$error' } ) ) @@ -384,7 +384,7 @@ export default class BedMesh extends Mixins(StateMixin, ToolheadMixin) { const result = ( !this.printerPrinting || await this.$confirm( - this.$tc('app.general.simple_form.msg.confirm'), + this.$tc('app.general.simple_form.msg.confirm_clear_mesh'), { title: this.$tc('app.general.label.confirm'), color: 'card-heading', icon: '$error' } ) ) diff --git a/src/components/widgets/status/StatusControls.vue b/src/components/widgets/status/StatusControls.vue index 3a883de95a..5e76dea8b1 100644 --- a/src/components/widgets/status/StatusControls.vue +++ b/src/components/widgets/status/StatusControls.vue @@ -125,7 +125,7 @@ export default class StatusControls extends Mixins(StateMixin) { async cancelPrint () { const result = await this.$confirm( - this.$tc('app.general.simple_form.msg.confirm'), + this.$tc('app.general.simple_form.msg.confirm_cancel_print'), { title: this.$tc('app.general.label.confirm'), color: 'card-heading', icon: '$error' } ) diff --git a/src/locales/en.yaml b/src/locales/en.yaml index 927a6dbfda..9a8be77815 100644 --- a/src/locales/en.yaml +++ b/src/locales/en.yaml @@ -365,10 +365,15 @@ app: invalid_aspect: Invalid Aspect Ratio msg: confirm: Are you sure? + confirm_cancel_print: Are you sure you want to cancel the current print? + confirm_clear_mesh: The printer is currently busy. Are you sure you want to clear the bed mesh? confirm_delete: Are you sure? This will delete the selected item. | Are you sure? This will delete the {count} selected items. + confirm_emergency_stop: Are you sure you want to emergency stop the printer? confirm_exclude_object: Are you sure you want to exclude this object from printing? confirm_forcemove_toggle: Are you sure? This can damage the printer. + confirm_load_profile: The printer is currently busy. Are you sure you want to load profile %{name}? confirm_reboot_host: Are you sure? This will reboot your host system. + confirm_remove_user: Are you sure you want to remove user %{username}? confirm_shutdown_host: Are you sure? This will shutdown your host system. confirm_service_start: Are you sure you want to start the %{name} service? confirm_service_restart: Are you sure you want to restart the %{name} service? diff --git a/src/mixins/state.ts b/src/mixins/state.ts index a68d479ebc..923011f107 100644 --- a/src/mixins/state.ts +++ b/src/mixins/state.ts @@ -112,7 +112,7 @@ export default class StateMixin extends Vue { const result = ( !confirmOnEstop || await this.$confirm( - this.$tc('app.general.simple_form.msg.confirm'), + this.$tc('app.general.simple_form.msg.confirm_emergency_stop'), { title: this.$tc('app.general.label.confirm'), color: 'card-heading', icon: '$error' } ) ) From 4e96c6b3d1b82604ae794bbec02c8ca1f7c548bd Mon Sep 17 00:00:00 2001 From: Mathis Mensing Date: Wed, 31 Jan 2024 22:38:06 +0100 Subject: [PATCH 2/2] feat: improve confirmation messages Signed-off-by: Mathis Mensing --- src/components/widgets/bedmesh/BedMeshControls.vue | 2 +- src/locales/en.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/widgets/bedmesh/BedMeshControls.vue b/src/components/widgets/bedmesh/BedMeshControls.vue index 24e071ee75..37ab590caa 100644 --- a/src/components/widgets/bedmesh/BedMeshControls.vue +++ b/src/components/widgets/bedmesh/BedMeshControls.vue @@ -379,7 +379,7 @@ export default class BedMesh extends Mixins(StateMixin, ToolheadMixin) { const result = ( !this.printerPrinting || await this.$confirm( - this.$t('app.general.simple_form.msg.confirm_load_profile', { name }).toString(), + this.$t('app.general.simple_form.msg.confirm_load_bedmesh_profile', { name }).toString(), { title: this.$tc('app.general.label.confirm'), color: 'card-heading', icon: '$error' } ) ) diff --git a/src/locales/en.yaml b/src/locales/en.yaml index 7cd6e3d6c0..1a6f8fb5c9 100644 --- a/src/locales/en.yaml +++ b/src/locales/en.yaml @@ -372,7 +372,7 @@ app: confirm_emergency_stop: Are you sure you want to emergency stop the printer? confirm_exclude_object: Are you sure you want to exclude this object from printing? confirm_forcemove_toggle: Are you sure? This can damage the printer. - confirm_load_profile: The printer is currently busy. Are you sure you want to load profile %{name}? + confirm_load_bedmesh_profile: The printer is currently busy. Are you sure you want to load profile %{name}? confirm_reboot_host: Are you sure? This will reboot your host system. confirm_remove_user: Are you sure you want to remove user %{username}? confirm_shutdown_host: Are you sure? This will shutdown your host system.