diff --git a/ayanova/devdocs/todo.txt b/ayanova/devdocs/todo.txt index 9367125c..fa95c150 100644 --- a/ayanova/devdocs/todo.txt +++ b/ayanova/devdocs/todo.txt @@ -10,17 +10,15 @@ PRIORITY - ALWAYS Lowest level stuff first, i.e. TODO at server, api route chang MODIFY USERS LIST FORM PER BELOW MODIFY USER EDIT FORM PER BELOW +Copy and replicate to Customer users centric UI (list and edit form) within customers area of UI + todo: USER redux - Eliminate UserType Administrator - Change any usage of Adminstrator type to non-scheduleable - Modify v8Migrate to import any Administrator type user as a Non-Scheduleable user - Eliminate Utility type user - V8Migrate Don't import utility type users + # EXISTING USERS UI to be staff / contractor centric, no customer users Change current Users list data-table to use the regular data-table Add a User controller List route to get all non customer Users - Modify User edit form to restric the types of Users so you can't pick customer or head office, they will be separate + Modify User edit form to restrict the types of Users so you can't pick customer or head office, they will be separate #Add customer centric users in customer tree area Copy from regular users and modify the list and edit form diff --git a/ayanova/src/api/open-object-handler.js b/ayanova/src/api/open-object-handler.js index 68f78b38..b3c831fc 100644 --- a/ayanova/src/api/open-object-handler.js +++ b/ayanova/src/api/open-object-handler.js @@ -20,10 +20,39 @@ export default { }); break; case ayatype.User: - vm.$router.push({ - name: "adm-user", - params: { recordid: tid.id } - }); + //Is it an "Inside" user (staff or subcontractor) + //or an "outside" user (customer or headoffice) + //if key doesn't provide this then need to directly find out first before determining which form to redirect to + if (tid.inside == undefined && tid.id != 0) { + //lookup which one to open from server + (async () => { + try { + let res = await window.$gz.api.get( + "user/inside-type/" + tid.id + ); + + if (res.error) { + throw res.error; + } + if (res.data) { + tid.inside = res.data; + } + } catch (e) { + throw e; + } + })(); + } + if (tid.inside == true) { + vm.$router.push({ + name: "adm-user", + params: { recordid: tid.id } + }); + } else { + vm.$router.push({ + name: "customer-user", + params: { recordid: tid.id } + }); + } break; case ayatype.NotifySubscription: vm.$router.push({ @@ -38,7 +67,7 @@ export default { (async () => { try { let res = await window.$gz.api.get("attachment/parent/" + tid.id); - console.log("res is", res); + if (res.error) { throw res.error; } diff --git a/ayanova/src/views/adm-users.vue b/ayanova/src/views/adm-users.vue index 0e5b3474..cbd3e4e8 100644 --- a/ayanova/src/views/adm-users.vue +++ b/ayanova/src/views/adm-users.vue @@ -65,7 +65,8 @@ export default { rowClick(item) { window.$gz.eventBus.$emit("openobject", { type: window.$gz.type.User, - id: item.id + id: item.id, + inside: true }); }, rolesDisplayFromRoles(roles) {