This commit is contained in:
2019-05-02 20:54:07 +00:00
parent 006fba9d29
commit 9d40b832d7
6 changed files with 67 additions and 97 deletions

View File

@@ -5,7 +5,7 @@
// utils and handlers
//
export default {
///////////////////////////////////
///////////////////////////////////
// WIRE UP DIALOG EVENTS
//
// called once from app.vue only
@@ -52,6 +52,29 @@ export default {
timeout: 5000
});
});
},
////////////////////////////
//
//
confirmDelete(vm) {
//https://github.com/yariksav/vuetify-dialog#readme
return vm.$dialog.warning({
text: vm.$gzlocale.get("DeletePrompt"),
title: vm.$gzlocale.get("Delete"),
icon: "fa-exclamation-triangle",
actions: [
{
text: vm.$gzlocale.get("Cancel"),
key: false
},
{
text: vm.$gzlocale.get("Delete"),
color: "red",
key: true
}
]
});
}
//new functions above here
};

View File

@@ -502,27 +502,5 @@ export default {
newState.vm.formState.readOnly = newState.readOnly;
}
});
},
////////////////////////////
//
//
confirmDelete(vm) {
//https://github.com/yariksav/vuetify-dialog#readme
return vm.$dialog.warning({
text: vm.$gzlocale.get("DeletePrompt"),
title: vm.$gzlocale.get("Delete"),
icon: "fa-exclamation-triangle",
actions: [
{
text: vm.$gzlocale.get("Cancel"),
key: false
},
{
text: vm.$gzlocale.get("Delete"),
color: "red",
key: true
}
]
});
}
};

View File

@@ -185,48 +185,6 @@ export default {
vm.$gzevent.$on("menu-click", function handleMenuClick(menuitem) {
self.handleAppClick(vm, menuitem);
});
//Notifications: pops up and slowly disappears
///////////
//ERROR
vm.$gzevent.$on("notify-error", function handleNotifyWarn(msg) {
vm.$dialog.notify.info(msg, {
position: "top-right",
icon: "fa-exclamation-triangle",
timeout: 8000
});
});
///////////
//WARNING
vm.$gzevent.$on("notify-warning", function handleNotifyWarn(msg) {
vm.$dialog.notify.warning(msg, {
position: "top-right",
icon: "fa-exclamation",
timeout: 7000
});
});
///////////
//INFO
vm.$gzevent.$on("notify-info", function handleNotifyWarn(msg) {
vm.$dialog.notify.info(msg, {
position: "top-right",
icon: "fa-info-circle",
timeout: 6000
});
});
///////////
//SUCCESS
vm.$gzevent.$on("notify-success", function handleNotifyWarn(msg) {
vm.$dialog.notify.success(msg, {
position: "top-right",
icon: "fa-check-circle ",
timeout: 5000
});
});
}
//new functions above here
};

View File

@@ -1,5 +1,5 @@
<template>
<v-layout row>
<v-layout row v-if="this.formState.ready">
<v-flex>
<v-card>
<!-- <v-toolbar>
@@ -204,6 +204,7 @@ import aboutInfo from "../api/aboutinfo";
export default {
beforeCreate() {
var vm = this;
this.$gzlocale.fetch([
"HelpAboutAyaNova",
"ClientApp",
@@ -221,7 +222,11 @@ export default {
"SupportedUntil",
"LicensedOptions",
"Log"
]);
]).then(() => (vm.formState.ready = true))
.catch(err => {
vm.formState.ready = true;
vm.$gzHandleFormError(err);
});
},
created() {
this.$gzevent.$emit("menu-change", {
@@ -256,7 +261,14 @@ export default {
data() {
return {
serverInfo: { license: { license: {} } },
clientInfo: {}
clientInfo: {},
formState: {
ready: false,
loading: true,
errorBoxMessage: null,
appError: null,
serverError: {}
}
};
}
};

View File

@@ -260,10 +260,7 @@ export default {
];
var vm = this;
this.$gzlocale
.fetch(ltKeysRequired)
// .then(function() {
// generateMenu(vm, );
// })
.fetch(ltKeysRequired)
.then(() => (vm.formState.ready = true))
.catch(err => {
vm.formState.ready = true;
@@ -406,7 +403,7 @@ export default {
remove() {
var vm = this;
//Prompt:
vm.$gzform.confirmDelete(vm).then(dialogResult => {
vm.$gzdialog.confirmDelete(vm).then(dialogResult => {
if (dialogResult == true) {
//do the delete
vm.formState.loading = true;