Skip to content

Commit

Permalink
feat: improve confirmation messages
Browse files Browse the repository at this point in the history
Signed-off-by: Mathis Mensing <[email protected]>
  • Loading branch information
matmen committed Jan 31, 2024
1 parent c568ed8 commit f6c42b5
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/components/settings/auth/AuthSettings.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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' }
)
Expand Down
4 changes: 2 additions & 2 deletions src/components/widgets/bedmesh/BedMeshControls.vue
Original file line number Diff line number Diff line change
Expand Up @@ -379,7 +379,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' }
)
)
Expand All @@ -392,7 +392,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' }
)
)
Expand Down
2 changes: 1 addition & 1 deletion src/components/widgets/status/StatusControls.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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' }
)
Expand Down
5 changes: 5 additions & 0 deletions src/locales/en.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -366,10 +366,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?
Expand Down
2 changes: 1 addition & 1 deletion src/mixins/state.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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' }
)
)
Expand Down

0 comments on commit f6c42b5

Please sign in to comment.