adds fhcalert when confirming an ampel

This commit is contained in:
SimonGschnell
2024-07-30 12:37:05 +02:00
parent 02cf36c17c
commit 198b866268
4 changed files with 31 additions and 9 deletions
+3
View File
@@ -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');
+2 -1
View File
@@ -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');
@@ -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();
+20
View File
@@ -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'
)
)
),
);