mirror of
https://github.com/FH-Complete/FHC-Core.git
synced 2026-07-24 10:22:18 +00:00
add FhcAlert
This commit is contained in:
@@ -20,6 +20,8 @@ import fhcapifactory from "./api/fhcapifactory.js";
|
||||
|
||||
import PvConfig from "../../../index.ci.php/public/js/components/primevue/config/config.esm.min.js";
|
||||
|
||||
import FhcAlert from "../plugin/FhcAlert.js";
|
||||
|
||||
Vue.$fhcapi = fhcapifactory;
|
||||
|
||||
const ciPath = FHC_JS_DATA_STORAGE_OBJECT.app_root.replace(/(https:|)(^|\/\/)(.*?\/)/g, '') + FHC_JS_DATA_STORAGE_OBJECT.ci_router;
|
||||
@@ -39,5 +41,6 @@ const app = Vue.createApp();
|
||||
app
|
||||
.use(router)
|
||||
.use(PvConfig)
|
||||
.use(FhcAlert)
|
||||
.mount('#main');
|
||||
|
||||
|
||||
@@ -123,16 +123,17 @@ export default {
|
||||
this.gebDatumIsValid = true;
|
||||
|
||||
// TODO(chris): phrase
|
||||
this.addToast('Gespeichert', '', 'success');
|
||||
this.$fhcAlert.alertSuccess('Gespeichert');
|
||||
//this.addToast('Gespeichert', '', 'success');
|
||||
|
||||
this.original = {...this.data};
|
||||
this.changed = {};
|
||||
}
|
||||
})
|
||||
.catch(err => {
|
||||
.catch(this.$fhcAlert.handleSystemError/*err => {
|
||||
// TODO(chris): phrase
|
||||
this.addToast('Error', err?.response?.data || err?.message, 'error');
|
||||
})
|
||||
}*/);
|
||||
},
|
||||
resetErrors() {
|
||||
Array.from(this.$refs.form.getElementsByClassName('is-valid')).forEach(el => el.classList.remove('is-valid'));
|
||||
@@ -156,14 +157,14 @@ export default {
|
||||
feedback.classList.add('invalid-feedback');
|
||||
feedback.innerHTML = msg;
|
||||
input.after(feedback);
|
||||
},
|
||||
/*},
|
||||
addToast(header, msg, severity) {
|
||||
this.$refs.responseToast.add({
|
||||
severity: severity,
|
||||
summary: header,
|
||||
detail: msg,
|
||||
life: 3000
|
||||
})
|
||||
})*/
|
||||
}
|
||||
},
|
||||
created() {
|
||||
|
||||
Reference in New Issue
Block a user