From 3ddbdfd2a457ef9a1991ad81aa2b3c9cef907a56 Mon Sep 17 00:00:00 2001 From: John Cardinal Date: Thu, 2 Apr 2020 23:36:39 +0000 Subject: [PATCH] hide license info in about from non staff users --- ayanova/src/views/ay-about.vue | 94 ++++++++++++-------- ayanova/tests/e2e/specs/translation-about.js | 32 ++++++- 2 files changed, 88 insertions(+), 38 deletions(-) diff --git a/ayanova/src/views/ay-about.vue b/ayanova/src/views/ay-about.vue index ff26aae8..00d50711 100644 --- a/ayanova/src/views/ay-about.vue +++ b/ayanova/src/views/ay-about.vue @@ -77,45 +77,50 @@ {{ t("TimeZone") }}: {{ serverInfo.serverTimeZone }} +
+ + {{ t("HelpLicense") }} +
+ {{ t("RegisteredUser") }}: + {{ + serverInfo.license.license.licensedTo + }} +
+
+ {{ t("DatabaseID") }}: + {{ serverInfo.license.license.dbId }} +
+
+ {{ t("LicenseSerial") }}: + {{ + serverInfo.license.license.keySerial + }} +
+
+ {{ t("LicenseExpiration") }}: + {{ + serverInfo.license.license.licenseExpiration + }} +
+
+ {{ t("SupportedUntil") }}: + {{ + serverInfo.license.license.maintenanceExpiration + }} +
- - {{ t("HelpLicense") }} -
- {{ t("RegisteredUser") }}: - {{ - serverInfo.license.license.licensedTo - }} -
-
- {{ t("DatabaseID") }}: - {{ serverInfo.license.license.dbId }} -
-
- {{ t("LicenseSerial") }}: - {{ serverInfo.license.license.keySerial }} -
-
- {{ t("LicenseExpiration") }}: - {{ - serverInfo.license.license.licenseExpiration - }} -
-
- {{ t("SupportedUntil") }}: - {{ - serverInfo.license.license.maintenanceExpiration - }} -
+ + {{ t("LicensedOptions") }} - - {{ t("LicensedOptions") }} - -
- {{ item.Feature }} - {{ item.Count ? ": " + item.Count : "" }} +
+ {{ item.Feature }} + {{ + item.Count ? ": " + item.Count : "" + }} +
@@ -174,6 +179,21 @@ export default { }, locale() { return window.$gz.locale; + }, + canViewLicenseInfo() { + /* + Administrator = 1, + Schedulable = 2, + NonSchedulable = 3, + Customer = 4, + HeadOffice = 5, + Utility = 6, + Subcontractor = 7 */ + return ( + window.$gz.store.state.userType == 1 || + window.$gz.store.state.userType == 2 || + window.$gz.store.state.userType == 3 + ); } } }; diff --git a/ayanova/tests/e2e/specs/translation-about.js b/ayanova/tests/e2e/specs/translation-about.js index afd4463e..a627eda0 100644 --- a/ayanova/tests/e2e/specs/translation-about.js +++ b/ayanova/tests/e2e/specs/translation-about.js @@ -94,6 +94,36 @@ describe("Login", () => { cy.get("[data-cy='app:logout']").click(); cy.url().should("include", "/login"); - //------------------------- + //----------------------------------------------------- + //ENGLISH - CustomerLimited + cy.get("input[name=username]") + .clear() + .type("CustomerLimited"); + + // {enter} causes the form to submit + cy.get("input[name=password]") + .clear() + .type("CustomerLimited{enter}"); + + // we should be redirected to /customer-csr-list + cy.url().should("include", "/customer-csr-list"); + + //nav to about form + cy.get("[data-cy=contextmenu]").click(); + cy.get('[data-cy="app:nav:abt"]').click(); + + //ensure there is translated text on the form + //title + cy.contains("About AyaNova"); + //client user should *NOT* see the licensed to bit or licensed options + cy.contains("Licensed to").should("not.exist"); + + + //LOGOUT + cy.get("[data-cy=contextmenu]").click(); + cy.get("[data-cy='app:logout']").click(); + cy.url().should("include", "/login"); + + //----------------------------------------------------- }); });