This commit is contained in:
@@ -46,23 +46,38 @@ function initNavPanel() {
|
|||||||
//Set homePage in store to customer csr for this user type
|
//Set homePage in store to customer csr for this user type
|
||||||
let CustomerHomePageSet = false;
|
let CustomerHomePageSet = false;
|
||||||
|
|
||||||
//USER SETTINGS
|
//$store.state.customerRights
|
||||||
sub.push({
|
//{ "csr": true, "wo": true, "wowiki": true, "userSettings": true, "notifyServiceImminent": true, "notifyCSRAccepted": true, "notifyCSRRejected": true, "notifyWOCreated": true }
|
||||||
title: "UserSettings",
|
|
||||||
icon: "$ayiUserCog",
|
|
||||||
route: "/home-user-settings",
|
|
||||||
key: key++
|
|
||||||
});
|
|
||||||
|
|
||||||
sub.push({
|
//USER SETTINGS
|
||||||
title: "NotifySubscriptionList",
|
if (window.$gz.store.state.customerRights.userSettings == true) {
|
||||||
icon: "$ayiBullhorn",
|
sub.push({
|
||||||
route: "/home-notify-subscriptions",
|
title: "UserSettings",
|
||||||
key: key++
|
icon: "$ayiUserCog",
|
||||||
});
|
route: "/home-user-settings",
|
||||||
|
key: key++
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
if (
|
||||||
|
window.$gz.store.state.customerRights.notifyServiceImminent == true ||
|
||||||
|
window.$gz.store.state.customerRights.notifyCSRAccepted == true ||
|
||||||
|
window.$gz.store.state.customerRights.notifyCSRRejected == true ||
|
||||||
|
window.$gz.store.state.customerRights.notifyWOCreated == true
|
||||||
|
) {
|
||||||
|
sub.push({
|
||||||
|
title: "NotifySubscriptionList",
|
||||||
|
icon: "$ayiBullhorn",
|
||||||
|
route: "/home-notify-subscriptions",
|
||||||
|
key: key++
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
//CSR LIST subitem
|
//CSR LIST subitem
|
||||||
if (window.$gz.role.canOpen(window.$gz.type.CustomerServiceRequest)) {
|
if (
|
||||||
|
window.$gz.role.canOpen(window.$gz.type.CustomerServiceRequest) &&
|
||||||
|
window.$gz.store.state.customerRights.csr == true
|
||||||
|
) {
|
||||||
sub.push({
|
sub.push({
|
||||||
title: "CustomerServiceRequestList",
|
title: "CustomerServiceRequestList",
|
||||||
icon: "$ayiConciergeBell",
|
icon: "$ayiConciergeBell",
|
||||||
@@ -75,21 +90,24 @@ function initNavPanel() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
//WORKORDERS subitem
|
//WORKORDERS subitem
|
||||||
if (window.$gz.role.canOpen(window.$gz.type.WorkOrder)) {
|
if (window.$gz.store.state.customerRights.userSettings == true) {
|
||||||
sub.push({
|
if (window.$gz.role.canOpen(window.$gz.type.WorkOrder)) {
|
||||||
title: "WorkOrderList",
|
sub.push({
|
||||||
icon: "$ayiTools",
|
title: "WorkOrderList",
|
||||||
route: "/customer-workorders",
|
icon: "$ayiTools",
|
||||||
key: key++
|
route: "/customer-workorders",
|
||||||
});
|
key: key++
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//** CUSTOMER LOGIN HOME (TOP)
|
//** CUSTOMER LOGIN HOME (TOP)
|
||||||
addNavItem("Home", "$ayiHome", undefined, sub, key++, "homecustomer");
|
addNavItem("Home", "$ayiHome", undefined, sub, key++, "homecustomer");
|
||||||
|
|
||||||
//last resort home page if user has no roles set
|
//last resort home page if user has no roles set
|
||||||
|
//TODO: Needs to be no rights page, not user settings
|
||||||
if (!CustomerHomePageSet) {
|
if (!CustomerHomePageSet) {
|
||||||
window.$gz.store.commit("setHomePage", "/home-user-settings");
|
window.$gz.store.commit("setHomePage", "/no-rights");
|
||||||
}
|
}
|
||||||
|
|
||||||
return;
|
return;
|
||||||
|
|||||||
@@ -856,6 +856,15 @@ export default new Router({
|
|||||||
component: () =>
|
component: () =>
|
||||||
import(/* webpackChunkName: "evaluate" */ "./views/ay-evaluate.vue")
|
import(/* webpackChunkName: "evaluate" */ "./views/ay-evaluate.vue")
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
//No rights - happens when customer user logs in without access to anything at all due to configuration not allowing it
|
||||||
|
path: "/no-features-available",
|
||||||
|
name: "no-features-available",
|
||||||
|
component: () =>
|
||||||
|
import(
|
||||||
|
/* webpackChunkName: "ay-common" */ "./views/nofeaturesavailable.vue"
|
||||||
|
)
|
||||||
|
},
|
||||||
{
|
{
|
||||||
//404 404 404 404 404 404 404 404 404 404 404 404 404 404 404 404 404 404 404 404 404 404 404 404
|
//404 404 404 404 404 404 404 404 404 404 404 404 404 404 404 404 404 404 404 404 404 404 404 404
|
||||||
path: "*",
|
path: "*",
|
||||||
|
|||||||
49
ayanova/src/views/nofeaturesavailable.vue
Normal file
49
ayanova/src/views/nofeaturesavailable.vue
Normal file
@@ -0,0 +1,49 @@
|
|||||||
|
<template>
|
||||||
|
<v-row justify-center>
|
||||||
|
<v-col cols="12">
|
||||||
|
<div class="text-center">
|
||||||
|
<v-icon color="red" size="100">$ayiDragon</v-icon>
|
||||||
|
<div class="text-h5 mt-8" v-if="ready">
|
||||||
|
{{ $ay.t("NoFeaturesAvailable") }}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</v-col>
|
||||||
|
</v-row>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
export default {
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
ready: false
|
||||||
|
};
|
||||||
|
},
|
||||||
|
async created() {
|
||||||
|
await window.$gz.translation.cacheTranslations(["NoFeaturesAvailable"]);
|
||||||
|
this.ready = true;
|
||||||
|
// let badPath = this.$router.history.current.path;
|
||||||
|
// //If this happens too early then it might not have all the setup stuff available which would trigger an infinite loop
|
||||||
|
// if (
|
||||||
|
// !window ||
|
||||||
|
// !window.$gz ||
|
||||||
|
// !window.$gz.eventBus ||
|
||||||
|
// !window.$gz.translation ||
|
||||||
|
// !window.$gz.store
|
||||||
|
// ) {
|
||||||
|
// this.msg = '404 - NOT FOUND: "' + badPath + '"';
|
||||||
|
// } else {
|
||||||
|
// let notFoundTranslated = this.$ay.t("ErrorAPI2010");
|
||||||
|
// //format the message
|
||||||
|
// this.msg = "404 - " + notFoundTranslated + ': "' + badPath + '"';
|
||||||
|
// //log it in case we need to see it in tech support
|
||||||
|
// window.$gz.store.commit("logItem", this.msg);
|
||||||
|
// //set the title of the window
|
||||||
|
// window.$gz.eventBus.$emit("menu-change", {
|
||||||
|
// isMain: true,
|
||||||
|
// icon: "$ayiDragon",
|
||||||
|
// title: "404 - " + notFoundTranslated
|
||||||
|
// });
|
||||||
|
// }
|
||||||
|
}
|
||||||
|
};
|
||||||
|
</script>
|
||||||
Reference in New Issue
Block a user