From 01655061f334fc44ad2659a70ba8843e8a005fb7 Mon Sep 17 00:00:00 2001 From: John Cardinal Date: Tue, 23 Mar 2021 17:06:05 +0000 Subject: [PATCH] rename all variants of naming that hold an AyaType value to "aType" (parameter) / "AType" (not parameter) everywhere front and back; "ayType", "objectType", "oType" all are used in various areas --- ayanova/devdocs/rando-todo.txt | 2 +- ayanova/devdocs/todo.txt | 9 ++---- ayanova/src/api/authorizationroles.js | 18 +++++------ ayanova/src/api/gzapi.js | 6 ++-- ayanova/src/api/gzmenu.js | 4 +-- ayanova/src/components/data-table.vue | 2 +- .../components/extension-delete-control.vue | 6 ++-- .../components/extension-export-control.vue | 5 ++- .../src/components/extension-tags-control.vue | 6 ++-- ayanova/src/components/extensions-control.vue | 2 +- .../components/report-selector-control.vue | 8 ++--- ayanova/src/main.js | 7 ++-- ayanova/src/router.js | 8 ++--- ayanova/src/views/acc-service-bank.vue | 24 +++++++------- ayanova/src/views/acc-service-banks.vue | 25 +++++++-------- ayanova/src/views/acc-service-rate.vue | 2 +- ayanova/src/views/acc-service-rates.vue | 4 +-- ayanova/src/views/acc-tax-code.vue | 2 +- ayanova/src/views/acc-tax-codes.vue | 4 +-- ayanova/src/views/acc-travel-rate.vue | 2 +- ayanova/src/views/acc-travel-rates.vue | 4 +-- ayanova/src/views/adm-attachments.vue | 2 +- ayanova/src/views/adm-user.vue | 2 +- ayanova/src/views/adm-users.vue | 4 +-- ayanova/src/views/ay-history.vue | 23 ++++++------- ayanova/src/views/ay-report-edit.vue | 12 +++---- ayanova/src/views/cust-customer-note.vue | 2 +- ayanova/src/views/cust-customer-notes.vue | 4 +-- ayanova/src/views/cust-customer.vue | 4 +-- ayanova/src/views/cust-customers.vue | 4 +-- ayanova/src/views/cust-head-office.vue | 4 +-- ayanova/src/views/cust-head-offices.vue | 4 +-- ayanova/src/views/cust-user.vue | 2 +- ayanova/src/views/cust-users.vue | 4 +-- ayanova/src/views/home-memo.vue | 2 +- ayanova/src/views/home-memos.vue | 4 +-- ayanova/src/views/home-reminder.vue | 2 +- ayanova/src/views/home-reminders.vue | 4 +-- ayanova/src/views/home-review.vue | 26 +++++++-------- ayanova/src/views/home-reviews.vue | 27 +++++++--------- ayanova/src/views/home-search.vue | 17 ++++------ ayanova/src/views/home-security.vue | 4 +-- ayanova/src/views/inv-part-assemblies.vue | 4 +-- ayanova/src/views/inv-part-assembly.vue | 2 +- .../views/inv-part-inventory-transactions.vue | 5 ++- ayanova/src/views/inv-part-inventory.vue | 4 +-- ayanova/src/views/inv-part-warehouse.vue | 2 +- ayanova/src/views/inv-part-warehouses.vue | 4 +-- ayanova/src/views/inv-part.vue | 2 +- ayanova/src/views/inv-parts.vue | 4 +-- ayanova/src/views/inv-purchase-order.vue | 2 +- ayanova/src/views/inv-purchase-orders.vue | 4 +-- ayanova/src/views/svc-contract.vue | 2 +- ayanova/src/views/svc-contracts.vue | 4 +-- ayanova/src/views/svc-csr.vue | 2 +- ayanova/src/views/svc-csrs.vue | 4 +-- ayanova/src/views/svc-loaner.vue | 2 +- ayanova/src/views/svc-loaners.vue | 4 +-- ayanova/src/views/svc-project.vue | 2 +- ayanova/src/views/svc-projects.vue | 4 +-- ayanova/src/views/svc-unit-model.vue | 2 +- ayanova/src/views/svc-unit-models.vue | 4 +-- ayanova/src/views/svc-unit.vue | 6 ++-- ayanova/src/views/svc-units.vue | 4 +-- ayanova/src/views/vendor.vue | 2 +- ayanova/src/views/vendors.vue | 4 +-- ayanova/src/views/widget.vue | 2 +- ayanova/src/views/widgets.vue | 4 +-- ayanova/tests/e2e/specs/smoke.js | 32 +++++-------------- 69 files changed, 196 insertions(+), 228 deletions(-) diff --git a/ayanova/devdocs/rando-todo.txt b/ayanova/devdocs/rando-todo.txt index 96f638fc..1855188f 100644 --- a/ayanova/devdocs/rando-todo.txt +++ b/ayanova/devdocs/rando-todo.txt @@ -50,7 +50,7 @@ possible implementation: { TKey = "WidgetName", FieldKey = "widgetname", - AyaObjectType = (int)AyaType.Widget, + AType = (int)AyaType.Widget, UiFieldDataType = (int)UiFieldDataType.Text, SqlIdColumnName = "awidget.id", SqlValueColumnName = "awidget.name", diff --git a/ayanova/devdocs/todo.txt b/ayanova/devdocs/todo.txt index 64bae0f4..dedc2f45 100644 --- a/ayanova/devdocs/todo.txt +++ b/ayanova/devdocs/todo.txt @@ -58,16 +58,13 @@ todo: v8 migrate additions ## CLIENT MISC ITEMS +todo: select list templates under global is offering types that don't6 have select lists like memo etc - +todo: adm-translations, adm-report templates data tables are skewed to the left due to lack of selection box column making filter icon partially gone off page + if has extension then should have selection box otherwise figure out what the dealio is ................................................................................................................................................................... -todo: rename all variants of naming that hold an AyaType value to "aType" (parameter) / "AType" (not parameter) everywhere front and back - "ayType", "objectType", "oType" all are used in various areas - Search for all references to AyaType and then work back from there - SQL Criteria as well - todo: reportClientMetaData in gzapi has DefaultLocale property in it which is just part of the language, can it be removed? it might be buggy if there is no dash in the language? Is that a thing? check at server how it's used diff --git a/ayanova/src/api/authorizationroles.js b/ayanova/src/api/authorizationroles.js index d01eb5c8..428283eb 100644 --- a/ayanova/src/api/authorizationroles.js +++ b/ayanova/src/api/authorizationroles.js @@ -96,9 +96,9 @@ export default { }; }, ///////////////////////////////// - // oType is the name of the object type as defined in ayatype.js + // aType is the name of the object type as defined in ayatype.js // - getRights(oType) { + getRights(aType) { //from bizroles.cs: //HOW THIS WORKS / WHATS EXPECTED //Change = CREATE, RETRIEVE, UPDATE, DELETE - Full rights @@ -113,13 +113,13 @@ export default { //Get the type name from the type enum value //de-lodash // let typeName = window.$gz. _.findKey(window.$gz.type, function(o) { - // return o == oType; + // return o == aType; // }); //my _.findKey replacement: let typeName = undefined; for (const [key, value] of Object.entries(window.$gz.type)) { - if (value == oType) { + if (value == aType) { typeName = key; break; } @@ -129,7 +129,7 @@ export default { let objectRoleRights = this.ROLE_RIGHTS[typeName]; if (!objectRoleRights) { throw new Error( - `authorizationroles::getRights type ${oType} not found in roles collection` + `authorizationroles::getRights type ${aType} not found in roles collection` ); } @@ -163,8 +163,8 @@ export default { // convenience method for forms that deal with multiple object types // (i.e. grids, history etc, initialization of main menu etc) // - canOpen(oType) { - let r = this.getRights(oType); + canOpen(aType) { + let r = this.getRights(aType); //convention is change might be defined but not read so canOpen is true eitehr way return r.change == true || r.read == true; }, @@ -172,8 +172,8 @@ export default { // convenience method for forms that deal with multiple object types // (i.e. grids, history etc, initialization of main menu etc) // - canChange(oType) { - let r = this.getRights(oType); + canChange(aType) { + let r = this.getRights(aType); return r.change == true; } }; diff --git a/ayanova/src/api/gzapi.js b/ayanova/src/api/gzapi.js index 96afa386..b2b88687 100644 --- a/ayanova/src/api/gzapi.js +++ b/ayanova/src/api/gzapi.js @@ -556,7 +556,7 @@ export default { }, /////////////////////////////////// // POST FILE ATTACHMENTS - // @param {ayaId:objectid, ayaType:objectType, files:[array of files]} + // @param {ayaId:objectid, ayaType:aType, files:[array of files]} // async uploadAttachment(at) { let that = this; @@ -567,7 +567,7 @@ export default { data.append(files[i].name, files[i]); } - data.append("AttachToObjectType", at.ayaType); + data.append("AttachToAType", at.ayaType); data.append("AttachToObjectId", at.ayaId); data.append("Notes", at.notes); data.append("FileData", at.fileData); @@ -606,7 +606,7 @@ export default { data.append(files[i].name, files[i]); } if (at.ayaType) { - data.append("ObjectType", at.ayaType); + data.append("AType", at.ayaType); } if (at.ayaId) { data.append("ObjectId", at.ayaId); diff --git a/ayanova/src/api/gzmenu.js b/ayanova/src/api/gzmenu.js index 03d468a1..9eb7cb8c 100644 --- a/ayanova/src/api/gzmenu.js +++ b/ayanova/src/api/gzmenu.js @@ -314,12 +314,12 @@ export default { // break; case "review": //go to list - // path: "/home-reviews/:objectType?/:objectId?", + // path: "/home-reviews/:aType?/:objectId?", vm.$router.push({ name: "home-reviews", params: { - objectType: window.$gz.util.stringToIntOrNull(item.data.ayaType), + aType: window.$gz.util.stringToIntOrNull(item.data.ayaType), objectId: window.$gz.util.stringToIntOrNull(item.data.recordId), name: item.data.recordName } diff --git a/ayanova/src/components/data-table.vue b/ayanova/src/components/data-table.vue index d83b879f..500a41c1 100644 --- a/ayanova/src/components/data-table.vue +++ b/ayanova/src/components/data-table.vue @@ -695,7 +695,7 @@ export default { selectedRowIds.reverse(); } return { - ObjectType: ayaType, + AType: ayaType, selectedRowIds: selectedRowIds, dataListKey: vm.dataListKey, filterId: vm.activeFilterId, diff --git a/ayanova/src/components/extension-delete-control.vue b/ayanova/src/components/extension-delete-control.vue index 76ead0b3..6e4712b1 100644 --- a/ayanova/src/components/extension-delete-control.vue +++ b/ayanova/src/components/extension-delete-control.vue @@ -29,10 +29,10 @@ export default { await fetchTranslatedText(vm); //NOTE: if extension doesn't support a particular object add it here to the NoType default if ( - vm.dataListSelection.ObjectType != 0 && - vm.dataListSelection.ObjectType != window.$gz.type.PartInventoryRestock + vm.dataListSelection.AType != 0 && + vm.dataListSelection.AType != window.$gz.type.PartInventoryRestock ) { - vm.rights = window.$gz.role.getRights(vm.dataListSelection.ObjectType); + vm.rights = window.$gz.role.getRights(vm.dataListSelection.AType); } vm.available = vm.rights.change; }, diff --git a/ayanova/src/components/extension-export-control.vue b/ayanova/src/components/extension-export-control.vue index 27aeac5e..19f00443 100644 --- a/ayanova/src/components/extension-export-control.vue +++ b/ayanova/src/components/extension-export-control.vue @@ -27,9 +27,8 @@ export default { methods: { available() { return ( - this.dataListSelection.ObjectType != 0 && - this.dataListSelection.ObjectType != - window.$gz.type.PartInventoryRestock + this.dataListSelection.AType != 0 && + this.dataListSelection.AType != window.$gz.type.PartInventoryRestock ); }, goHelp() { diff --git a/ayanova/src/components/extension-tags-control.vue b/ayanova/src/components/extension-tags-control.vue index a69a9a08..43ebccf8 100644 --- a/ayanova/src/components/extension-tags-control.vue +++ b/ayanova/src/components/extension-tags-control.vue @@ -46,10 +46,10 @@ export default { let vm = this; if ( - vm.dataListSelection.ObjectType != 0 && - vm.dataListSelection.ObjectType != window.$gz.type.PartInventoryRestock + vm.dataListSelection.AType != 0 && + vm.dataListSelection.AType != window.$gz.type.PartInventoryRestock ) { - vm.rights = window.$gz.role.getRights(vm.dataListSelection.ObjectType); + vm.rights = window.$gz.role.getRights(vm.dataListSelection.AType); } vm.available = vm.rights.change; }, diff --git a/ayanova/src/components/extensions-control.vue b/ayanova/src/components/extensions-control.vue index 6e0b180e..66221500 100644 --- a/ayanova/src/components/extensions-control.vue +++ b/ayanova/src/components/extensions-control.vue @@ -58,7 +58,7 @@ export default { resolve: null, reject: null, dataListSelection: { - ObjectType: 0, + AType: 0, selectedRowIds: [], dataListKey: null }, diff --git a/ayanova/src/components/report-selector-control.vue b/ayanova/src/components/report-selector-control.vue index 9c1a828e..26c9e186 100644 --- a/ayanova/src/components/report-selector-control.vue +++ b/ayanova/src/components/report-selector-control.vue @@ -122,16 +122,14 @@ export default { if (reportDataOptions == null) { throw new Error("report-selector:Open missing reportDataOptions"); } - if (reportDataOptions.ObjectType == null) { - throw new Error( - "report-selector:Open - ObjectType is missing or empty" - ); + if (reportDataOptions.AType == null) { + throw new Error("report-selector:Open - AType is missing or empty"); } this.reportDataOptions = reportDataOptions; //get report list from server let res = await window.$gz.api.get( - `report/list/${reportDataOptions.ObjectType}` + `report/list/${reportDataOptions.AType}` ); if (res.error) { // throw new Error(res.error); diff --git a/ayanova/src/main.js b/ayanova/src/main.js index fa68ecde..7c94e654 100644 --- a/ayanova/src/main.js +++ b/ayanova/src/main.js @@ -28,7 +28,7 @@ import gzapi from "./api/gzapi"; import gzform from "./api/gzform"; import gzformcustomtemplate from "./api/form-custom-template"; import authorizationroles from "./api/authorizationroles"; -import gztype from "./api/ayatype"; +import ayatype from "./api/ayatype"; import gzenums from "./api/enums"; import "@/assets/css/main.css"; @@ -82,7 +82,7 @@ window.$gz = { translation: translation, locale: locale, formCustomTemplate: gzformcustomtemplate, - type: gztype, + type: ayatype, role: authorizationroles, enums: gzenums, eventBus: gzeventbus, @@ -252,6 +252,9 @@ Vue.prototype.$ay = { }, util: function() { return gzutil; + }, + ayt: function() { + return ayatype; } }; //disable the devtools nag diff --git a/ayanova/src/router.js b/ayanova/src/router.js index 8582b230..8706f868 100644 --- a/ayanova/src/router.js +++ b/ayanova/src/router.js @@ -175,13 +175,13 @@ export default new Router({ import(/* webpackChunkName: "ay-common" */ "./views/home-reminder.vue") }, { - path: "/home-reviews/:objectType?/:objectId?", + path: "/home-reviews/:aType?/:objectId?", name: "home-reviews", component: () => import(/* webpackChunkName: "ay-common" */ "./views/home-reviews.vue") }, { - path: "/home-reviews/:recordid/:objectType?/:objectId?", + path: "/home-reviews/:recordid/:aType?/:objectId?", name: "review-edit", component: () => import(/* webpackChunkName: "ay-common" */ "./views/home-review.vue") @@ -544,13 +544,13 @@ export default new Router({ import(/* webpackChunkName: "acc" */ "./views/acc-tax-code.vue") }, { - path: "/acc-service-banks/:objectType?/:objectId?", + path: "/acc-service-banks/:aType?/:objectId?", name: "service-banks", component: () => import(/* webpackChunkName: "acc" */ "./views/acc-service-banks.vue") }, { - path: "/acc-service-banks/:recordid/:objectType?/:objectId?", + path: "/acc-service-banks/:recordid/:aType?/:objectId?", name: "service-bank-edit", component: () => import(/* webpackChunkName: "acc" */ "./views/acc-service-bank.vue") diff --git a/ayanova/src/views/acc-service-bank.vue b/ayanova/src/views/acc-service-bank.vue index 1e1ad8b6..f67334d3 100644 --- a/ayanova/src/views/acc-service-bank.vue +++ b/ayanova/src/views/acc-service-bank.vue @@ -4,7 +4,7 @@
-
+
{{ iconForType }} {{ name }}
@@ -131,16 +131,16 @@ export default { await vm.getDataFromApi(vm.$route.params.recordid); //let getdata handle loading } else { //New record so there has to be a object type and objectId in route - // path: "/home-service-banks/:recordid/:objectType?/:objectId?", + // path: "/home-service-banks/:recordid/:aType?/:objectId?", vm.obj.objectId = window.$gz.util.stringToIntOrNull( vm.$route.params.objectId ); - vm.obj.objectType = window.$gz.util.stringToIntOrNull( - vm.$route.params.objectType + vm.obj.aType = window.$gz.util.stringToIntOrNull( + vm.$route.params.aType ); - if (!vm.obj.objectId || !vm.obj.objectType) { - throw "ObjectType and ObjectId are required to create a service bank entry"; + if (!vm.obj.objectId || !vm.obj.aType) { + throw "AType and ObjectId are required to create a service bank entry"; } vm.name = vm.$route.params.name; @@ -152,7 +152,7 @@ export default { if (!vm.name) { vm.name = await window.$gz.api.fetchBizObjectName( - vm.obj.objectType, + vm.obj.aType, vm.obj.objectId ); } @@ -192,7 +192,7 @@ export default { //I.E. Serial, usertype fields, ACTIVE //Also, if it's a non-nullable Enum backed field then it should have a valid selection i.e. not zero if there is no zero /* - {"data":{"id":1,"concurrency":1387706,"name":"Prepaid for $500 labor","entryDate":"2005-11-27T19:04:00Z","lastEntryDate":null,"objectId":1,"objectType":8, + {"data":{"id":1,"concurrency":1387706,"name":"Prepaid for $500 labor","entryDate":"2005-11-27T19:04:00Z","lastEntryDate":null,"objectId":1,"aType":8, "sourceId":0,"sourceType":55,"incidents":0.0000,"incidentsBalance":0.0000,"lastIncidentsBalance":null, "currency":500.0000,"currencyBalance":500.0000,"lastCurrencyBalance":null, "hours":0.0000,"hoursBalance":0.0000,"lastHoursBalance":null}} @@ -203,7 +203,7 @@ export default { concurrency: 0, name: null, objectId: null, - objectType: null, + aType: null, sourceId: 0, //default for manual entries sourceType: window.$gz.type.ServiceBank, incidents: 0, @@ -260,13 +260,13 @@ export default { }, computed: { iconForType() { - return window.$gz.util.iconForType(this.obj.objectType); + return window.$gz.util.iconForType(this.obj.aType); } }, methods: { navToTarget: function() { window.$gz.eventBus.$emit("openobject", { - type: this.obj.objectType, + type: this.obj.aType, id: this.obj.objectId }); }, @@ -394,7 +394,7 @@ async function clickHandler(menuItem) { //general report selector chosen let res = await m.vm.$refs.reportSelector.open({ - ObjectType: window.$gz.type.ServiceBank, + AType: window.$gz.type.ServiceBank, selectedRowIds: [m.vm.obj.id] }); diff --git a/ayanova/src/views/acc-service-banks.vue b/ayanova/src/views/acc-service-banks.vue index 048d0c07..302898ce 100644 --- a/ayanova/src/views/acc-service-banks.vue +++ b/ayanova/src/views/acc-service-banks.vue @@ -1,6 +1,6 @@