This commit is contained in:
2019-11-07 00:18:51 +00:00
parent 7d4f24ecac
commit 94efe2aa7a
4 changed files with 30 additions and 87 deletions

View File

@@ -46,20 +46,16 @@ https://blog.anoff.io/2019-10-migrating-vuetify-1-to-2/
=============== UPGRADING NOTES =================
** NOTE: can start dev server, go to *it's* client to see a working older version of ayanova client for comparision!
http://localhost:7575/login
http://localhost:8080/login
CURRENT WORK: Replace dialog, confirm etc with my own implementations as stock as possible
Grid not taking 25, 99 etc, stuck at 5 initial value for rows per page and that's what fetches off the server as well
- Currently gznotify component is working but needs to support a queue and show each one after the other times out as per specs that say only one snackbar / toast at a time
- more info here and some code people made to do this https://github.com/vuetifyjs/vuetify/issues/2384
Vuetify dialog changes - https://github.com/yariksav/vuetify-dialog/issues/46
DIALOG - Rethinking the dialog component I'm using, it appears to be buggy with the new vuetify version and it's a 3rd party black box of confusion at times. Vuetify has a built in dialog, not as specialized and windows-y (alert, danger, info etc) but it could be made to work and then I'm not reliant on one more thing
OTHER 3rd PARTY - examine any other 3rd party client stuff being used and see if can replace it with anything in Vuetify or Vue itself, less dependencies the better!
=================================================

View File

@@ -40,65 +40,30 @@ TODO:
*/
//Valid values for notify type are: success, info, warning, and error
///////////
//ERROR
window.$gz.eventBus.$on("notify-error", function handleNotifyWarn(msg) {
vm.$dialog.notify.info(msg, {
position: "bottom-right",
icon: "fa-exclamation-triangle",
timeout: 8000
});
vm.$root.$gznotify(msg, { type: "error", timeout: 7000 });
});
///////////
//WARNING
window.$gz.eventBus.$on("notify-warning", function handleNotifyWarn(msg) {
vm.$dialog.notify.warning(msg, {
position: "bottom-right",
icon: "fa-exclamation",
timeout: 7000
});
vm.$root.$gznotify(msg, { type: "warning", timeout: 7000 });
});
///////////
//INFO
window.$gz.eventBus.$on("notify-info", function handleNotifyWarn(msg) {
// // eslint-disable-next-line no-debugger
// debugger;
// eslint-disable-next-line no-console
//console.log(msg);
vm.$root.$gznotify(msg, { color: "info", timeout: 10000 });
// if (vm.$root.$gznoitfy(msg, "Are you sure?", { color: "red" })) {
// alert("YES");
// } else {
// alert("CANCEL");
// }
// vm.$dialog.notify.info(msg, {
// position: "bottom-right",
// icon: "fa-info-circle",
// timeout: 3000,
// actions: [
// {
// text: window.$gz.locale.get("Cancel"),
// key: false
// },
// {
// text: window.$gz.locale.get("Delete"),
// color: "red",
// key: true
// }
// ]
// });
vm.$root.$gznotify(msg, { type: "info", timeout: 5000 });
});
///////////
//SUCCESS
window.$gz.eventBus.$on("notify-success", function handleNotifyWarn(msg) {
vm.$dialog.notify.success(msg, {
position: "bottom-right",
icon: "fa-check-circle ",
timeout: 3000
});
vm.$root.$gznotify(msg, { type: "info", timeout: 3000 });
});
},
/////////////////////////////////////

View File

@@ -144,7 +144,7 @@ export default function initialize() {
if (res.data.timeZoneOffset != localOffset) {
//TODO: localize message and also actually have a fix for it here
//so this should be a confirm prompt but for now will just show it
//for now just show the message
window.$gz.eventBus.$emit(
"notify-info",
@@ -154,6 +154,19 @@ export default function initialize() {
localOffset +
". You might want to adjust that under user settings"
);
window.$gz.eventBus.$emit(
"notify-warning",
"this is a warning test"
);
window.$gz.eventBus.$emit(
"notify-error",
"this is an error test"
);
window.$gz.eventBus.$emit(
"notify-success",
"this is a success test"
);
}
//Store offset in locale data

View File

@@ -1,44 +1,13 @@
<template>
<!-- <v-dialog
v-model="dialog"
:max-width="options.width"
:style="{ zIndex: options.zIndex }"
@keydown.esc="cancel"
>
<v-card>
<v-toolbar dark :color="options.color" dense flat>
<v-toolbar-title class="white--text">{{ title }}</v-toolbar-title>
</v-toolbar>
<v-card-text v-show="!!message" class="pa-4">{{ message }}</v-card-text>
<v-card-actions class="pt-0">
<v-spacer></v-spacer>
<v-btn color="primary darken-1" text @click.native="agree">Yes</v-btn>
<v-btn color="grey" text @click.native="cancel">Cancel</v-btn>
</v-card-actions>
</v-card>
</v-dialog> -->
<!-- <v-snackbar
:color="options.color"
:value="snackbar"
:timeout="options.timeout"
>
<v-icon color="white">fa-info-circle</v-icon>
<div>
{{ message }}
</div>
<v-btn icon @click="snackbar = false">
<v-icon color="white">fa-times-circle</v-icon>
</v-btn>
</v-snackbar> -->
<v-snackbar
:value="snackbar"
:color="options.color"
:value="isVisible"
:color="options.type"
:timeout="options.timeout"
>
<v-alert type="info">
<v-alert :type="options.type">
{{ message }}
</v-alert>
<v-btn icon @click="snackbar = false">
<v-btn icon @click="isVisible = false">
<v-icon color="white">fa-times-circle</v-icon>
</v-btn>
</v-snackbar>
@@ -47,17 +16,17 @@
<script>
export default {
data: () => ({
snackbar: false,
isVisible: false,
message: null,
options: {
color: "primary",
type: "info", //one of success, info, warning, and error, see v-alert docs for more info
timeout: 3000
}
}),
methods: {
open(message, options) {
this.snackbar = true;
this.isVisible = true;
this.message = message;
this.options = Object.assign(this.options, options);
}