From f9ea4715d7f0af6af5c44c5f3e4248dace16cccf Mon Sep 17 00:00:00 2001 From: "Torsten Schulz (local)" Date: Sat, 20 Dec 2025 22:14:39 +0100 Subject: [PATCH] Refactor BranchView component to replace JavaScript alerts with a message dialog for success and error notifications. This improves user experience by providing a more integrated feedback mechanism within the UI. --- frontend/src/views/falukant/BranchView.vue | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/frontend/src/views/falukant/BranchView.vue b/frontend/src/views/falukant/BranchView.vue index 5ccae65..5542cd8 100644 --- a/frontend/src/views/falukant/BranchView.vue +++ b/frontend/src/views/falukant/BranchView.vue @@ -1014,12 +1014,15 @@ export default { }); await this.loadVehicles(); this.closeRepairAllVehiclesDialog(); - alert(this.$t('falukant.branch.transport.repairAllSuccess')); + // Statt JS-alert: Dialog schließen und MessageDialog anzeigen + this.$root.$refs.messageDialog?.open('tr:falukant.branch.transport.repairAllSuccess'); this.$refs.statusBar?.fetchStatus(); } catch (error) { console.error('Error repairing all vehicles:', error); const errorMessage = error.response?.data?.message || this.$t('falukant.branch.transport.repairAllError'); - alert(errorMessage); + // Bestätigungsdialog ebenfalls schließen und Fehler im MessageDialog anzeigen + this.closeRepairAllVehiclesDialog(); + this.$root.$refs.messageDialog?.open(String(errorMessage), this.$t('error.title')); } }, @@ -1076,12 +1079,15 @@ export default { await apiClient.post(`/api/falukant/vehicles/${this.repairVehicleDialog.vehicle.id}/repair`); await this.loadVehicles(); this.closeRepairVehicleDialog(); - alert(this.$t('falukant.branch.transport.repairSuccess')); + // Statt JS-alert: Dialog schließen und MessageDialog anzeigen + this.$root.$refs.messageDialog?.open('tr:falukant.branch.transport.repairSuccess'); this.$refs.statusBar?.fetchStatus(); } catch (error) { console.error('Error repairing vehicle:', error); const errorMessage = error.response?.data?.message || this.$t('falukant.branch.transport.repairError'); - alert(errorMessage); + // Bestätigungsdialog ebenfalls schließen und Fehler im MessageDialog anzeigen + this.closeRepairVehicleDialog(); + this.$root.$refs.messageDialog?.open(String(errorMessage), this.$t('error.title')); } }, },