This commit is contained in:
2021-06-16 18:40:38 +00:00
parent 9e00b07be4
commit f4248e592e
3 changed files with 26 additions and 12 deletions

View File

@@ -55,11 +55,11 @@ export default new Vuex.Store({
knownPassword: false,
newNotificationCount: 0
},
getters: {
isOutsideUser: state => {
return state.userType == 3 || state.userType == 4;
}
},
// getters: {
// isOutsideUser: state => {
// return state.userType == 3 || state.userType == 4;
// }
// },
mutations: {
setLastClientVersion(state, data) {
state.lastClientVersion = data;

View File

@@ -764,10 +764,27 @@ async function populateSelectionLists(vm) {
//ensure the pick lists required are pre-fetched
await window.$gz.enums.fetchEnumList("NotifyEventType");
const tempEventTypes = window.$gz.enums.getSelectionList("NotifyEventType");
if (window.$gz.store.getters.isOutsideUser) {
vm.selectLists.eventTypes = tempEventTypes.filter(
z => z.id == 6 || z.id == 7 || z.id == 21 || z.id == 30 || z.id == 31
);
if (window.$gz.store.state.isCustomerUser) {
vm.selectLists.eventTypes = tempEventTypes.filter(z => {
//return true if it's a type allowed by customer *and* they have customerRights to it
switch (z.id) {
case 6:
return window.$gz.store.state.customerRights.notifyCSRAccepted;
case 7:
return window.$gz.store.state.customerRights.notifyCSRRejected;
case 21:
return window.$gz.store.state.customerRights.notifyCSRAccepted;
// case 30://was workorder completed, removed due to thinking it's covered elsewhere but not really for customer who shouldn't see any other status available
//this is still up in the air and may need to be re-enabled here and at server
// //return window.$gz.store.state.customerRights.notifyCSRAccepted;
// return false;
case 31:
return window.$gz.store.state.customerRights.notifyWOCreated;
default:
return false;
}
});
} else {
vm.selectLists.eventTypes = tempEventTypes.filter(
z => z.id != 6 && z.id != 7 && z.id != 21 && z.id != 31