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

View File

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