From 739216d32558896e8141d6004c9f223867a3f87e Mon Sep 17 00:00:00 2001 From: John Cardinal Date: Sat, 13 Jun 2020 19:23:39 +0000 Subject: [PATCH] --- ayanova/src/api/gzdialog.js | 16 +++++++++++++++- ayanova/src/views/adm-license.vue | 21 ++++++++++++++++++--- 2 files changed, 33 insertions(+), 4 deletions(-) diff --git a/ayanova/src/api/gzdialog.js b/ayanova/src/api/gzdialog.js index 278e5dfa..17de482d 100644 --- a/ayanova/src/api/gzdialog.js +++ b/ayanova/src/api/gzdialog.js @@ -113,7 +113,21 @@ export default { type: "error" }); }, - + ///////////////////////////////////// + // Display LT message with wait for ok + // + displayLTModalNotificationMessage( + tKeyText, + tKeyTitle = undefined, + ttype = "info" + ) { + return VM_LOCAL.$root.$gzconfirm({ + message: tKeyText ? window.$gz.translation.get(tKeyText) : "", + title: tKeyTitle ? window.$gz.translation.get(tKeyTitle) : "", + yesButtonText: window.$gz.translation.get("OK"), + type: ttype + }); + }, ///////////////////////////////////// // Custom confirmation // diff --git a/ayanova/src/views/adm-license.vue b/ayanova/src/views/adm-license.vue index ad850111..dd295158 100644 --- a/ayanova/src/views/adm-license.vue +++ b/ayanova/src/views/adm-license.vue @@ -293,8 +293,21 @@ export default { if (r.startsWith("E1")) { throw r; } - //this should be the only place hit if everything goes well and key was fetched - window.$gz.eventBus.$emit("notify-success", r); + //If here, there is no technical error + //key might not exist or be not found but no error so r contains the deets + + if (r == "ok") { + //all ok, new key installed time to logout and back in + await window.$gz.dialog.displayLTModalNotificationMessage( + vm.$ay.t("NewLicenseInstalled") + ); + vm.$router.push("/login"); + } else { + if (r == "notfound") { + r = vm.$ay.t("NewLicenseNotFound"); + } + window.$gz.eventBus.$emit("notify-info", r); + } } catch (error) { window.$gz.errorHandler.handleFormError(error, vm); } @@ -407,7 +420,9 @@ function fetchTranslatedText(vm) { "LicenseEmail", "RequestEvaluationLicense", "LicenseEmailVerficationHint", - "AdminEraseDatabaseWarning" //preexisting + "AdminEraseDatabaseWarning", //preexisting + "NewLicenseInstalled", + "NewLicenseNotFound" ]); }