mirror of
https://github.com/FH-Complete/FHC-Core.git
synced 2026-06-01 20:29:29 +00:00
adds fhcalert when confirming an ampel
This commit is contained in:
@@ -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');
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -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'
|
||||
)
|
||||
)
|
||||
),
|
||||
|
||||
);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user