diff --git a/public/js/apps/Dashboard/Admin.js b/public/js/apps/Dashboard/Admin.js index 426a2fce4..ad4c2cf63 100755 --- a/public/js/apps/Dashboard/Admin.js +++ b/public/js/apps/Dashboard/Admin.js @@ -1,5 +1,7 @@ import {CoreNavigationCmpt} from '../../components/navigation/Navigation.js'; import DashboardAdmin from '../../components/Dashboard/Admin.js'; +import Phrasen from "../../plugin/Phrasen.js" +import FhcAlert from "../../plugin/FhcAlert.js" const app = Vue.createApp({ data: () => ({ @@ -11,4 +13,5 @@ const app = Vue.createApp({ } }); app.config.unwrapInjectedRef = true; +app.use(Phrasen).use(FhcAlert); app.mount('#main'); diff --git a/public/js/apps/Dashboard/Fhc.js b/public/js/apps/Dashboard/Fhc.js index 98f06f329..824f03bd2 100755 --- a/public/js/apps/Dashboard/Fhc.js +++ b/public/js/apps/Dashboard/Fhc.js @@ -1,5 +1,6 @@ import FhcDashboard from '../../components/Dashboard/Dashboard.js'; import Phrasen from "../../plugin/Phrasen.js" +import FhcAlert from "../../plugin/FhcAlert.js" const app = Vue.createApp({ data: () => ({ @@ -10,5 +11,5 @@ const app = Vue.createApp({ } }); app.config.unwrapInjectedRef = true; -app.use(Phrasen); +app.use(Phrasen).use(FhcAlert); app.mount('#content'); diff --git a/public/js/components/DashboardWidget/Ampel.js b/public/js/components/DashboardWidget/Ampel.js index fdf7752c7..1b4efa022 100755 --- a/public/js/components/DashboardWidget/Ampel.js +++ b/public/js/components/DashboardWidget/Ampel.js @@ -96,14 +96,12 @@ export default { }); }, async confirm(ampelId){ - this.$fhcApi.factory.ampeln.confirmAmpel(ampelId).then(res =>{ - // response of the enpoint when confirming an ampel (true if confirmed and false if not confirmed) - if(res.data){ - console.log("ampel was successfully confirmed"); - }else{ - console.error("ampel was not successfully confirmed"); - } - }); + this.$fhcApi.factory.ampeln.confirmAmpel(ampelId) + .then(res => res.data) + .then(result => { + this.$fhcAlert.alertSuccess(this.$p.t('ampeln','ampelBestaetigt')); + }) + .catch(this.$fhcAlert.handleSystemError); // update the ampeln by refetching them this.fetchNonConfirmedActiveAmpeln(); diff --git a/system/phrasesupdate.php b/system/phrasesupdate.php index d9c72a29a..b34a1ade1 100755 --- a/system/phrasesupdate.php +++ b/system/phrasesupdate.php @@ -27651,6 +27651,26 @@ array( ) ) ), + array( + 'app' => 'core', + 'category' => 'ampeln', + 'phrase' => 'ampelBestaetigt', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => 'Ampel bestÃĪtigt', + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => 'Ampel confirmed', + 'description' => '', + 'insertvon' => 'system' + ) + ) + ), );