hide license info in about from non staff users

This commit is contained in:
2020-04-02 23:36:39 +00:00
parent 3420182a51
commit 3ddbdfd2a4
2 changed files with 88 additions and 38 deletions

View File

@@ -77,45 +77,50 @@
<span class="ml-6 body-1">{{ t("TimeZone") }}: </span>
<span class="body-2">{{ serverInfo.serverTimeZone }}</span>
</div>
<div v-if="canViewLicenseInfo()">
<v-divider class="mt-6"></v-divider>
<v-subheader>{{ t("HelpLicense") }}</v-subheader>
<div>
<span class="ml-6 body-1">{{ t("RegisteredUser") }}: </span>
<span class="body-2">{{
serverInfo.license.license.licensedTo
}}</span>
</div>
<div>
<span class="ml-6 body-1">{{ t("DatabaseID") }}: </span>
<span class="body-2">{{ serverInfo.license.license.dbId }}</span>
</div>
<div>
<span class="ml-6 body-1">{{ t("LicenseSerial") }}: </span>
<span class="body-2">{{
serverInfo.license.license.keySerial
}}</span>
</div>
<div>
<span class="ml-6 body-1">{{ t("LicenseExpiration") }}: </span>
<span class="body-2">{{
serverInfo.license.license.licenseExpiration
}}</span>
</div>
<div>
<span class="ml-6 body-1">{{ t("SupportedUntil") }}: </span>
<span class="body-2">{{
serverInfo.license.license.maintenanceExpiration
}}</span>
</div>
<v-divider class="mt-6"></v-divider>
<v-subheader>{{ t("HelpLicense") }}</v-subheader>
<div>
<span class="ml-6 body-1">{{ t("RegisteredUser") }}: </span>
<span class="body-2">{{
serverInfo.license.license.licensedTo
}}</span>
</div>
<div>
<span class="ml-6 body-1">{{ t("DatabaseID") }}: </span>
<span class="body-2">{{ serverInfo.license.license.dbId }}</span>
</div>
<div>
<span class="ml-6 body-1">{{ t("LicenseSerial") }}: </span>
<span class="body-2">{{ serverInfo.license.license.keySerial }}</span>
</div>
<div>
<span class="ml-6 body-1">{{ t("LicenseExpiration") }}: </span>
<span class="body-2">{{
serverInfo.license.license.licenseExpiration
}}</span>
</div>
<div>
<span class="ml-6 body-1">{{ t("SupportedUntil") }}: </span>
<span class="body-2">{{
serverInfo.license.license.maintenanceExpiration
}}</span>
</div>
<v-divider class="mt-6"></v-divider>
<v-subheader>{{ t("LicensedOptions") }}</v-subheader>
<v-divider class="mt-6"></v-divider>
<v-subheader>{{ t("LicensedOptions") }}</v-subheader>
<div
v-for="item in serverInfo.license.license.features"
:key="item.Feature"
>
<span class="ml-6 body-1">{{ item.Feature }}</span>
<span class="body-2">{{ item.Count ? ": " + item.Count : "" }}</span>
<div
v-for="item in serverInfo.license.license.features"
:key="item.Feature"
>
<span class="ml-6 body-1">{{ item.Feature }}</span>
<span class="body-2">{{
item.Count ? ": " + item.Count : ""
}}</span>
</div>
</div>
<v-divider class="mt-6"></v-divider>
@@ -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
);
}
}
};

View File

@@ -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");
//-----------------------------------------------------
});
});