EOD FRIDAY!

This commit is contained in:
2019-11-08 22:02:23 +00:00
parent b5d2a72f65
commit 9d6619c2e0
7 changed files with 38 additions and 133 deletions

View File

@@ -1,4 +1,4 @@
import reportChooser from "../components/report-chooser.vue";
//import reportChooser from "../components/report-chooser.vue";
/* Xeslint-disable */
var VM_LOCAL = null;
@@ -15,33 +15,6 @@ export default {
wireUpEventHandlers(vm) {
//Notifications: pops up and slowly disappears
/*
This (and in form error boxes) all needs to be replaced with the stock v-alert, v-dialog and v-snackbar
The v-alert component is used to convey important information to the user through the use contextual types icons and color. These default types come in in 4 variations: success, info, warning, and error. Default icons are assigned which help represent different actions each type portrays
The v-snackbar component is used to display a quick message to a user. Snackbars support positioning, removal delay, and callbacks.
The v-dialog component inform users about a specific task and may contain critical information, require decisions, or involve multiple tasks. Use dialogs sparingly because they are interruptive.
TODO:
- NOTIFICATION SNACKBAR - used for temp notifications, create as a component
- put it in the App.vue just above the router view
- Make it respond to event bus messages and popup
- Should be able to show more than one sequentially
- Always auto-times out? (or...)
- DIALOG - used for are you sure prompts etc
- Modal
- callable from anywhere (sits in App.vue?)Like this: https://gist.github.com/eolant/ba0f8a5c9135d1a146e1db575276177d
- can return data via callback (I think)
- Has suitable types of icons
- ERRORBOX: Create a custom component for the top of form error box, it uses a v-alert and is consistently the same so make one re-usable component for that and us in edit forms as now but replacing the v-alert block
- This actually is not a current requirement but as soon as there is more than one edit form it will be so...
*/
//Valid values for notify type are: success, info, warning, and error
///////////
//ERROR
window.$gz.eventBus.$on("notify-error", function handleNotifyWarn(msg) {
@@ -71,25 +44,6 @@ TODO:
/////////////////////////////////////
// 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"),
// 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({
message: window.$gz.locale.get("DeletePrompt"),
@@ -98,7 +52,7 @@ TODO:
});
},
/////////////////////////////////////
// Are you sure you want to delete?
// Are you sure you want to leave unsaved?
//
confirmLeaveUnsaved() {
return VM_LOCAL.$root.$gzconfirm({
@@ -106,52 +60,30 @@ TODO:
yesButtonText: window.$gz.locale.get("Leave"),
noButtonText: window.$gz.locale.get("Cancel")
});
// return vm.$dialog.warning({
// text: window.$gz.locale.get("AreYouSureUnsavedChanges"),
// title: window.$gz.locale.get("Leave"),
// icon: "fa-exclamation-triangle",
// actions: [
// {
// text: window.$gz.locale.get("Cancel"),
// key: false
// },
// {
// text: window.$gz.locale.get("Leave"),
// color: "red",
// key: true
// }
// ]
// });
},
/////////////////////////////////////
// Display LT message with wait for ok
//
displayLTErrorMessage(vm, ltKeyText, ltKeyTitle = undefined) {
//https://github.com/yariksav/vuetify-dialog#readme
return vm.$dialog.error({
text: ltKeyText ? window.$gz.locale.get(ltKeyText) : "",
displayLTErrorMessage(ltKeyText, ltKeyTitle = undefined) {
return VM_LOCAL.$root.$gzconfirm({
message: ltKeyText ? window.$gz.locale.get(ltKeyText) : "",
title: ltKeyTitle ? window.$gz.locale.get(ltKeyTitle) : "",
icon: "fa-exclamation-triangle",
actions: [
{
text: window.$gz.locale.get("OK"),
key: true
}
]
yesButtonText: window.$gz.locale.get("OK")
});
}, /////////////////////////////////////
// Show a report list
//
async getReportChoice(vm, reports, preselected) {
const result = await vm.$dialog.showAndWait(reportChooser, {
reports: reports,
title: window.$gz.locale.get("Report"),
oktext: window.$gz.locale.get("Print"),
canceltext: window.$gz.locale.get("Cancel"),
selectedvalue: preselected
});
return result;
}
//TODO: Implement the following as it's own re-usable component instead of here
/////////////////////////////////////
// // Show a report list
// //
// async getReportChoice(vm, reports, preselected) {
// const result = await vm.$dialog.showAndWait(reportChooser, {
// reports: reports,
// title: window.$gz.locale.get("Report"),
// oktext: window.$gz.locale.get("Print"),
// canceltext: window.$gz.locale.get("Cancel"),
// selectedvalue: preselected
// });
// return result;
// }
//new functions above here
};

View File

@@ -155,15 +155,6 @@ 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", {