diff --git a/ayanova/src/api/gzapi.js b/ayanova/src/api/gzapi.js
index dd728cc1..a6a5faa2 100644
--- a/ayanova/src/api/gzapi.js
+++ b/ayanova/src/api/gzapi.js
@@ -57,7 +57,11 @@ function handleError(action, error, route, reject) {
window.$gz.translation.get("ErrorUserNotAuthorized")
);
router.push(window.$gz.store.state.homePage);
- return reject("[ErrorUserNotAuthorized]");
+ if (reject) {
+ return reject("[ErrorUserNotAuthorized]");
+ } else {
+ throw "[ErrorUserNotAuthorized]";
+ }
}
//Handle 401 not authenticated
@@ -72,7 +76,11 @@ function handleError(action, error, route, reject) {
);
auth.logout();
router.push("/login");
- return reject("[ErrorUserNotAuthenticated]");
+ if (reject) {
+ return reject("[ErrorUserNotAuthenticated]");
+ } else {
+ throw "[ErrorUserNotAuthenticated]";
+ }
}
//is it a network error?
@@ -96,7 +104,12 @@ function handleError(action, error, route, reject) {
window.$gz.eventBus.$emit("notify-error", msg);
//note: using translation key in square brackets
- return reject(msg);
+
+ if (reject) {
+ return reject(msg);
+ } else {
+ throw msg;
+ }
//throw "Error: unable to contact server";
}
}
@@ -460,7 +473,7 @@ export default {
r = await that.extractBodyEx(r);
return r;
} catch (error) {
- handleError("UPSERT", error, route, reject);
+ handleError("UPSERT", error, route);
}
},
upsert(route, data) {
diff --git a/ayanova/src/views/adm-license.vue b/ayanova/src/views/adm-license.vue
index d3412ddd..93f64bfb 100644
--- a/ayanova/src/views/adm-license.vue
+++ b/ayanova/src/views/adm-license.vue
@@ -8,11 +8,16 @@
Revoked license ui
-
+
{{ $ay.t("NoLicenseTitle") }}
-
+
{{
$ay.t("StartEvaluation")
}}
@@ -71,8 +76,9 @@
>
- {{ sendRequestDisabled() }}
- $ay.t('SendRequest')
@@ -159,9 +165,9 @@ export default {
},
licenseState: 0,
request: {
- Email: null,
- Company: null,
- Contact: null
+ Email: "cardjohn@ayanova.com",
+ Company: "Super TestCo",
+ Contact: "Test Testerson"
},
obj: {},
formState: {
@@ -215,9 +221,14 @@ export default {
}
*/
let licenseState = window.$gz.store.state.globalSettings.licenseStatus;
- //LICENSE STATUS: NONE, EXPIREDTRIAL, EXPIREDPURCHASE
- if (licenseState == 0 || licenseState == 2 || licenseState == 4) {
- return "need";
+ //LICENSE STATUS: NONE, EXPIREDTRIAL
+ if (licenseState == 0 || licenseState == 2) {
+ return "needcantrial";
+ }
+
+ //LICENSE STATUS: EXPIREDPURCHASE
+ if (licenseState == 4) {
+ return "neednotrial";
}
//LICENSE STATE: REVOKED
if (licenseState == 5) {
@@ -240,6 +251,32 @@ export default {
"requestemail"
]);
},
+ async sendRequest() {
+ let vm = this;
+ try {
+ //Only no key or expired trial are here, not expired purchase
+ //so safe to erase
+ let dialogResult = await window.$gz.dialog.confirmGeneric(
+ "AdminEraseDatabaseWarning"
+ );
+ if (dialogResult == false) {
+ return;
+ }
+ //call erase
+ let r = await window.$gz.api.upsertEx(
+ "license/permanently-erase-all-data",
+ "I understand"
+ );
+
+ //send request
+ r = await window.$gz.api.upsertEx("license/trialRequest", vm.request);
+
+ console.log(r);
+ //then another message box saying watch your email to verify
+ } catch (error) {
+ window.$gz.errorHandler.handleFormError(error, vm);
+ }
+ },
translation() {
return window.$gz.translation;
},
@@ -463,7 +500,8 @@ function fetchTranslatedText(vm) {
"LicenseContactName",
"LicenseEmail",
"RequestEvaluationLicense",
- "LicenseEmailVerficationHint"
+ "LicenseEmailVerficationHint",
+ "AdminEraseDatabaseWarning" //preexisting
]);
}