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

feat: improve confirmation messages #1339

Merged
merged 4 commits into from
Feb 1, 2024
Merged
Show file tree
Hide file tree
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
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.$t('app.general.simple_form.msg.confirm_load_bedmesh_profile', { name }).toString(),
{ 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.$tc('app.general.simple_form.msg.confirm_clear_mesh'),
{ 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_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.
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