case 4518, also added override of timeout to all notify variants

This commit is contained in:
2023-04-26 00:07:38 +00:00
parent 31edcb0790
commit 2181ffab80
2 changed files with 14 additions and 7 deletions

View File

@@ -27,7 +27,8 @@ export default {
//ERROR //ERROR
window.$gz.eventBus.$on("notify-error", function handleNotifyWarn( window.$gz.eventBus.$on("notify-error", function handleNotifyWarn(
msg, msg,
helpUrl helpUrl,
overrideTimeout
) { ) {
//log full message //log full message
window.$gz.store.commit("logItem", "notify-error: " + msg); window.$gz.store.commit("logItem", "notify-error: " + msg);
@@ -36,7 +37,7 @@ export default {
vm.$root.$gznotify({ vm.$root.$gznotify({
message: msg, message: msg,
type: "error", type: "error",
timeout: CalculateDelay(msg), timeout: overrideTimeout ?? CalculateDelay(msg),
helpUrl: helpUrl helpUrl: helpUrl
}); });
}); });
@@ -62,14 +63,15 @@ export default {
//INFO //INFO
window.$gz.eventBus.$on("notify-info", function handleNotifyInfo( window.$gz.eventBus.$on("notify-info", function handleNotifyInfo(
msg, msg,
helpUrl helpUrl,
overrideTimeout
) { ) {
window.$gz.store.commit("logItem", "notify-info: " + msg); window.$gz.store.commit("logItem", "notify-info: " + msg);
msg = msg.substring(0, 600); msg = msg.substring(0, 600);
vm.$root.$gznotify({ vm.$root.$gznotify({
message: msg, message: msg,
type: "info", type: "info",
timeout: CalculateDelay(msg), timeout: overrideTimeout ?? CalculateDelay(msg),
helpUrl: helpUrl helpUrl: helpUrl
}); });
}); });
@@ -78,13 +80,15 @@ export default {
//SUCCESS //SUCCESS
window.$gz.eventBus.$on("notify-success", function handleNotifySuccess( window.$gz.eventBus.$on("notify-success", function handleNotifySuccess(
msg, msg,
helpUrl helpUrl,
overrideTimeout
) { ) {
vm.$root.$gznotify({ vm.$root.$gznotify({
message: msg, message: msg,
type: "success", type: "success",
timeout: CalculateDelay(msg), timeout: overrideTimeout ?? CalculateDelay(msg),
helpUrl: helpUrl helpUrl: helpUrl,
overrideTimeout
}); });
}); });

View File

@@ -4,6 +4,7 @@
:value="isVisible" :value="isVisible"
:color="currentNotification.type" :color="currentNotification.type"
multi-line multi-line
:timeout="currentNotification.timeout"
> >
<v-alert :type="currentNotification.type" mode="out-in"> <v-alert :type="currentNotification.type" mode="out-in">
{{ currentNotification.message }} {{ currentNotification.message }}
@@ -35,6 +36,7 @@ export default {
}), }),
methods: { methods: {
addNotification(options) { addNotification(options) {
console.log("Add notification options:", options);
if (!options.message) { if (!options.message) {
return; return;
} }
@@ -61,6 +63,7 @@ export default {
this.isVisible = true; this.isVisible = true;
}); });
//Show it for the designated time before moving on to the next //Show it for the designated time before moving on to the next
setTimeout(() => { setTimeout(() => {
this.isVisible = false; this.isVisible = false;
//recurse //recurse