This commit is contained in:
2019-11-08 21:37:56 +00:00
parent 4bc52914f4
commit e7e0c94c16
3 changed files with 59 additions and 32 deletions

View File

@@ -1,7 +1,7 @@
import reportChooser from "../components/report-chooser.vue";
/* Xeslint-disable */
var VM_LOCAL = null;
/////////////////////////////////
// Dialog, toast, notification
// utils and handlers
@@ -65,29 +65,40 @@ TODO:
window.$gz.eventBus.$on("notify-success", function handleNotifyWarn(msg) {
vm.$root.$gznotify({ message: msg, type: "success", timeout: 2000 });
});
VM_LOCAL = vm;
},
/////////////////////////////////////
// Are you sure you want to delete?
//
confirmDelete(vm) {
//https://github.com/yariksav/vuetify-dialog#readme
return vm.$dialog.warning({
text: window.$gz.locale.get("DeletePrompt"),
// confirmDelete(vm) {
// //https://github.com/yariksav/vuetify-dialog#readme
// return vm.$dialog.warning({
// text: window.$gz.locale.get("DeletePrompt"),
// title: window.$gz.locale.get("Delete"),
// icon: "fa-exclamation-triangle",
// actions: [
// {
// text: window.$gz.locale.get("Cancel"),
// key: false
// },
// {
// text: window.$gz.locale.get("Delete"),
// color: "red",
// key: true
// }
// ]
// });
// },
confirmDelete() {
return VM_LOCAL.$root.$gzconfirm({
title: window.$gz.locale.get("Delete"),
icon: "fa-exclamation-triangle",
actions: [
{
text: window.$gz.locale.get("Cancel"),
key: false
},
{
text: window.$gz.locale.get("Delete"),
color: "red",
key: true
}
]
message: window.$gz.locale.get("DeletePrompt"),
yesButtonText: window.$gz.locale.get("Delete"),
noButtonText: window.$gz.locale.get("Cancel")
});
}, /////////////////////////////////////
},
/////////////////////////////////////
// Are you sure you want to delete?
//
confirmLeaveUnsaved(vm) {

View File

@@ -155,6 +155,15 @@ export default function initialize() {
);
}
// eslint-disable-next-line no-debugger
// debugger;
window.$gz.dialog.confirmDelete().then(dialogResult => {
window.$gz.eventBus.$emit(
"notify-info",
"You chose: " + dialogResult
);
});
//Store offset in locale data
//TODO: also need the other locale settings such as number and date formats etc to be added at server
window.$gz.store.commit("setLocale", {