diff --git a/ayanova/devdocs/todo.txt b/ayanova/devdocs/todo.txt index 142db640..c9b7a741 100644 --- a/ayanova/devdocs/todo.txt +++ b/ayanova/devdocs/todo.txt @@ -430,6 +430,7 @@ todo: show all, for most lists showing Work orders and the work order icon seems What if I used the work order icon for each but put differing text as needed if more than one sub item? todo 2: Implement "Show All" feature for workorder lists as follows: + Use the work order icon but use the scheduled user or labor text unless they have unique icons separate from User in which case use them WorkORderItemScheduledUserDataList WorkOrderItemLaborDataList labor and scheduled user records available from several places: Dashboard menu, schedule menu, also under Administration->Users for the benefit of users with rights to that diff --git a/ayanova/src/store.js b/ayanova/src/store.js index 46559368..923b8a7a 100644 --- a/ayanova/src/store.js +++ b/ayanova/src/store.js @@ -29,6 +29,7 @@ export default new Vuex.Store({ notifyAvailable: true, isCustomerUser: false, isSubContractorUser: false, + isScheduleableUser: false, customerRights: {}, userId: 0, userName: "NOT AUTHENTICATED", @@ -74,6 +75,7 @@ export default new Vuex.Store({ state.userType = data.userType; state.isSubContractorUser = data.userType == 5; state.isCustomerUser = data.userType == 3 || data.userType == 4; + state.isScheduleableUser = data.userType == 1 || data.userType == 5; state.downloadToken = data.dlt; state.tfaEnabled = data.tfaEnabled; if (data.customerRights) { @@ -101,6 +103,7 @@ export default new Vuex.Store({ state.notifyAvailable = true; state.isCustomerUser = false; state.isSubContractorUser = false; + state.isScheduleableUser = false; state.homePage = undefined; state.navItems = []; state.translationText = {}; diff --git a/ayanova/src/views/adm-user.vue b/ayanova/src/views/adm-user.vue index b6179e39..9a7f6a80 100644 --- a/ayanova/src/views/adm-user.vue +++ b/ayanova/src/views/adm-user.vue @@ -1014,6 +1014,26 @@ async function clickHandler(menuItem) { case "disable2fa": m.vm.disableTfa(); break; + case "WorkOrderItemScheduledUserList": + m.vm.$router.push({ + name: "svc-workorder-item-scheduled-users", + params: { + aType: m.vm.ayaType, + objectId: m.vm.obj.id, + name: m.vm.obj.name + } + }); + break; + case "WorkOrderItemLaborList": + m.vm.$router.push({ + name: "svc-workorder-item-labors", + params: { + aType: m.vm.ayaType, + objectId: m.vm.obj.id, + name: m.vm.obj.name + } + }); + break; default: window.$gz.eventBus.$emit( "notify-warning", @@ -1124,6 +1144,21 @@ function generateMenu(vm) { vm: vm }); } + + if (vm.obj.userType == 1 || vm.obj.userType == 5) { + menuOptions.menuItems.push({ + title: "WorkOrderItemScheduledUserList", + icon: "$ayiUserClock", + key: FORM_KEY + ":WorkOrderItemScheduledUserList", + vm: vm + }); + menuOptions.menuItems.push({ + title: "WorkOrderItemLaborList", + icon: "$ayiHammer", + key: FORM_KEY + ":WorkOrderItemLaborList", + vm: vm + }); + } } } @@ -1191,7 +1226,9 @@ async function fetchTranslatedText(vm) { "UserPageAddress", "SendPasswordResetCode", "AuthDisableTwoFactor", - "AuthTwoFactorDisabled" + "AuthTwoFactorDisabled", + "WorkOrderItemScheduledUserList", + "WorkOrderItemLaborList" ]); } diff --git a/ayanova/src/views/svc-workorder-item-labors.vue b/ayanova/src/views/svc-workorder-item-labors.vue index 9d6b1038..04cd696a 100644 --- a/ayanova/src/views/svc-workorder-item-labors.vue +++ b/ayanova/src/views/svc-workorder-item-labors.vue @@ -15,6 +15,9 @@ :reload="reload" @selection-change="handleSelected" data-cy="WorkOrderItemLaborsTable" + :client-criteria="clientCriteria" + :pre-filter-mode="preFilterMode" + @clear-pre-filter="clearPreFilter" > @@ -26,6 +29,26 @@ export default { created() { this.rights = window.$gz.role.getRights(window.$gz.type.WorkOrder); window.$gz.eventBus.$on("menu-click", clickHandler); + //------ Show all ---- + //OPTIONAL "Show All" FILTER + this.objectId = window.$gz.util.stringToIntOrNull( + this.$route.params.objectId + ); + this.aForType = window.$gz.util.stringToIntOrNull(this.$route.params.aType); + + if (this.objectId && this.objectId != 0 && this.aForType) { + //OBJECTID,AYATYPE + this.clientCriteria = `${this.objectId},${this.aForType}`; + + this.preFilterMode = { + icon: window.$gz.util.iconForType(this.aForType), + id: this.objectId, + ayatype: this.aForType, + viz: this.$route.params.name, + clearable: true + }; + } + //------ /show all ---- generateMenu(this); }, beforeDestroy() { @@ -36,12 +59,22 @@ export default { rights: window.$gz.role.defaultRightsObject(), aType: window.$gz.type.WorkOrderItemLabor, selectedItems: [], - reload: false + reload: false, + clientCriteria: undefined, + preFilterMode: null, + objectId: null, + aForType: null, + name: null }; }, methods: { handleSelected(selected) { this.selectedItems = selected; + }, + clearPreFilter() { + this.clientCriteria = null; + this.preFilterMode = null; + this.reload = !this.reload; } } }; diff --git a/ayanova/src/views/svc-workorder-item-scheduled-users.vue b/ayanova/src/views/svc-workorder-item-scheduled-users.vue index 7c4240ff..a4aeaf1f 100644 --- a/ayanova/src/views/svc-workorder-item-scheduled-users.vue +++ b/ayanova/src/views/svc-workorder-item-scheduled-users.vue @@ -15,6 +15,9 @@ :reload="reload" @selection-change="handleSelected" data-cy="WorkOrderItemScheduledUsersTable" + :client-criteria="clientCriteria" + :pre-filter-mode="preFilterMode" + @clear-pre-filter="clearPreFilter" > @@ -26,6 +29,26 @@ export default { created() { this.rights = window.$gz.role.getRights(window.$gz.type.WorkOrder); window.$gz.eventBus.$on("menu-click", clickHandler); + //------ Show all ---- + //OPTIONAL "Show All" FILTER + this.objectId = window.$gz.util.stringToIntOrNull( + this.$route.params.objectId + ); + this.aForType = window.$gz.util.stringToIntOrNull(this.$route.params.aType); + + if (this.objectId && this.objectId != 0 && this.aForType) { + //OBJECTID,AYATYPE + this.clientCriteria = `${this.objectId},${this.aForType}`; + + this.preFilterMode = { + icon: window.$gz.util.iconForType(this.aForType), + id: this.objectId, + ayatype: this.aForType, + viz: this.$route.params.name, + clearable: true + }; + } + //------ /show all ---- generateMenu(this); }, beforeDestroy() { @@ -36,12 +59,22 @@ export default { rights: window.$gz.role.defaultRightsObject(), aType: window.$gz.type.WorkOrderItemScheduledUser, selectedItems: [], - reload: false + reload: false, + clientCriteria: undefined, + preFilterMode: null, + objectId: null, + aForType: null, + name: null }; }, methods: { handleSelected(selected) { this.selectedItems = selected; + }, + clearPreFilter() { + this.clientCriteria = null; + this.preFilterMode = null; + this.reload = !this.reload; } } };