From db8eafb1c0d14c84c08ce2cf172b3158b62510e7 Mon Sep 17 00:00:00 2001 From: John Cardinal Date: Tue, 7 Sep 2021 14:33:48 +0000 Subject: [PATCH] Final (?) de-widgetification --- ayanova/devdocs/test protocol.txt | 6 +- ayanova/devdocs/todo.txt | 2 +- ayanova/src/api/ayatype.js | 2 +- ayanova/src/api/biz-role-rights.js | 1 - ayanova/src/api/gzform.js | 9 - ayanova/src/api/gzutil.js | 2 - ayanova/src/api/initialize.js | 5 - ayanova/src/api/open-object-handler.js | 7 +- ayanova/src/api/translation.js | 1 - .../components/data-table-filter-control.vue | 1 - ayanova/src/components/data-table.vue | 1 - ayanova/src/router.js | 16 - .../src/views/ay-data-list-column-view.vue | 1 - ayanova/src/views/cust-customer-notes.vue | 1 - ayanova/src/views/widget.vue | 798 ------------------ ayanova/src/views/widgets.vue | 165 ---- ayanova/tests/e2e/OLD/customize-form.js | 26 +- ayanova/tests/e2e/OLD/gz-data-table.js | 22 +- .../tests/e2e/OLD/select-list-templates.js | 8 +- ayanova/tests/e2e/specs/search-form.js | 2 +- ayanova/tests/e2e/specs/smoke.js | 12 - ayanova/tests/e2e/specs/widget-crud.js | 18 +- 22 files changed, 44 insertions(+), 1062 deletions(-) delete mode 100644 ayanova/src/views/widget.vue delete mode 100644 ayanova/src/views/widgets.vue diff --git a/ayanova/devdocs/test protocol.txt b/ayanova/devdocs/test protocol.txt index ab8ce9c1..aee28b9c 100644 --- a/ayanova/devdocs/test protocol.txt +++ b/ayanova/devdocs/test protocol.txt @@ -22,7 +22,7 @@ Test protocol for latest build: - RESULTS: I would say leave all in as they each will display somethign useful on different platforms. - TIME INPUT UTC HONOURED? Date time input fucked: - - Selected 420 in the widget edit form but it shows as 11:20 on the main list, translation time issue + - Selected 420 in the customer edit form but it shows as 11:20 on the main list, translation time issue - Retest on desktop, probably a general date time conversion bug - 404 WORKS ON ALL DEVICES DISPLAYS PROPERLY @@ -63,13 +63,13 @@ EDGE desktop - Broken rules work - Navigate via menu then press back goes back to last form properly? - About then back to form or main inventory home etc -- Widget form +- customer form - translation showing properly on form - Numeric inputs show numeric keyboard on mobile - Calendar selects date and time or is that still fucky on some platforms? - Rights work properly - Test as manager - - Test widget form under full, edit own and readonly and no rights, confirm it works + - Test customer form under full, edit own and readonly and no rights, confirm it works - Roles: Change = AuthorizationRoles.BizAdmin | AuthorizationRoles.Inventory, EditOwn = AuthorizationRoles.Tech, ReadRecord = AuthorizationRoles.BizAdminRestricted | AuthorizationRoles.InventoryRestricted - 401 redirect to login - 403 should redirect to prior form (no rights SubContractorRestricted) diff --git a/ayanova/devdocs/todo.txt b/ayanova/devdocs/todo.txt index 53eec38c..36212f13 100644 --- a/ayanova/devdocs/todo.txt +++ b/ayanova/devdocs/todo.txt @@ -68,7 +68,7 @@ todo:1 grid position not preserved when open a record then track back this is very important that it work correctly I *did* code this so it should actually be working, not sure why it isn't but the code is probably all there. - +todo: test bulk ops on wo/quote/pm tagging or something, had widget code in it that I just switched to wo/quote/pm diff --git a/ayanova/src/api/ayatype.js b/ayanova/src/api/ayatype.js index 6dc21191..810e7f98 100644 --- a/ayanova/src/api/ayatype.js +++ b/ayanova/src/api/ayatype.js @@ -2,7 +2,7 @@ export default { NoType: 0, Global: 1, //corebizobject - Widget: 2, + UNUSED_2: 2, //corebizobject User: 3, ServerState: 4, diff --git a/ayanova/src/api/biz-role-rights.js b/ayanova/src/api/biz-role-rights.js index 09de094c..2bf0f66d 100644 --- a/ayanova/src/api/biz-role-rights.js +++ b/ayanova/src/api/biz-role-rights.js @@ -98,7 +98,6 @@ export default { GlobalOps: { Change: 16384, ReadFullRecord: 8192, Select: 0 }, User: { Change: 2, ReadFullRecord: 1, Select: 131071 }, UserOptions: { Change: 2, ReadFullRecord: 1, Select: 0 }, - Widget: { Change: 34, ReadFullRecord: 17, Select: 131071 }, ServerState: { Change: 16384, ReadFullRecord: 131071, Select: 0 }, License: { Change: 2, ReadFullRecord: 1, Select: 0 }, TrialSeeder: { Change: 16386, ReadFullRecord: 8193, Select: 0 }, diff --git a/ayanova/src/api/gzform.js b/ayanova/src/api/gzform.js index d6b1105d..d7aa1896 100644 --- a/ayanova/src/api/gzform.js +++ b/ayanova/src/api/gzform.js @@ -487,7 +487,6 @@ export default { /////////////////////////////// // USER REQUIRED FIELDS // (Fields defined by AyaNova users as required on form that are not stock required already) - // (was using this in testing on widget form notes field but not sure where else it's applicable) userRequiredFields(vm, ref, formCustomTemplateFieldName) { if (vm.formState.loading) { return true; @@ -542,14 +541,6 @@ export default { // For now the only rule is that they can be required or not // customFieldsCheck(vm, templateItem, subvm, fieldName) { - //templateItem sample - // dataKey: "c2" - // fld: "WidgetCustom2" - // hide: "false" - // required: true - // type: "text" - // debugger; - if (vm.formState.loading) { return true; } diff --git a/ayanova/src/api/gzutil.js b/ayanova/src/api/gzutil.js index 41897447..0e782b40 100644 --- a/ayanova/src/api/gzutil.js +++ b/ayanova/src/api/gzutil.js @@ -419,8 +419,6 @@ export default { return "$ayiGenderless"; case window.$gz.type.Global: return "$ayiGlobe"; - case window.$gz.type.Widget: - return "$ayiVial"; case window.$gz.type.User: return "$ayiUser"; case window.$gz.type.ServerState: diff --git a/ayanova/src/api/initialize.js b/ayanova/src/api/initialize.js index 987ec38c..07f18eba 100644 --- a/ayanova/src/api/initialize.js +++ b/ayanova/src/api/initialize.js @@ -727,11 +727,6 @@ function initNavPanel() { addNavItem("Operations", "$ayiServer", undefined, sub, key++, "operations"); } - // //############ WIDGETS (TOP GROUP) - // if (window.$gz.role.canOpen(window.$gz.type.Widget)) { - // addNavItem("WidgetList", "$ayiVial", "/widgets", [], key++, "widgets"); - // } - //*** EVALUATION active trial license should always go to evaluation as home page //as long as they are a normal User type and not a subcontractor type if ( diff --git a/ayanova/src/api/open-object-handler.js b/ayanova/src/api/open-object-handler.js index e49dc963..d854f353 100644 --- a/ayanova/src/api/open-object-handler.js +++ b/ayanova/src/api/open-object-handler.js @@ -219,12 +219,7 @@ export default { params: { recordid: tid.id } }); break; - case ayatype.Widget: - vm.$router.push({ - name: "widget-edit", - params: { recordid: tid.id } - }); - break; + case ayatype.User: //Is it an "Inside" user (staff or subcontractor) //or an "outside" user (customer or headoffice) diff --git a/ayanova/src/api/translation.js b/ayanova/src/api/translation.js index c9379ea5..87b61292 100644 --- a/ayanova/src/api/translation.js +++ b/ayanova/src/api/translation.js @@ -169,7 +169,6 @@ export default { "PartInventoryTransactionList", "PartWarehouseList", "PurchaseOrderUIRestockList", - "WidgetList", "VendorList", "AdministrationGlobalSettings", "HelpLicense", diff --git a/ayanova/src/components/data-table-filter-control.vue b/ayanova/src/components/data-table-filter-control.vue index 9a14b789..15411d37 100644 --- a/ayanova/src/components/data-table-filter-control.vue +++ b/ayanova/src/components/data-table-filter-control.vue @@ -600,7 +600,6 @@ async function populateFieldDefinitions(vm) { vm.fieldDefinitions = JSON.parse(ss); return; } else { - //http://localhost:7575/api/v8/data-list/listfields?DataListKey=TestWidgetDataList let res = await window.$gz.api.get( "data-list/listfields?DataListKey=" + vm.dataListKey ); diff --git a/ayanova/src/components/data-table.vue b/ayanova/src/components/data-table.vue index e1760e03..0591e755 100644 --- a/ayanova/src/components/data-table.vue +++ b/ayanova/src/components/data-table.vue @@ -1272,7 +1272,6 @@ async function initForm(vm) { //////////////////// // async function fetchSavedFilterList(vm) { - //http://localhost:7575/api/v8/data-list-filter/list?ListKey=TestWidgetDataList let res = await window.$gz.api.get( "data-list-filter/list?ListKey=" + vm.dataListKey ); diff --git a/ayanova/src/router.js b/ayanova/src/router.js index 4d96265b..4a0204d1 100644 --- a/ayanova/src/router.js +++ b/ayanova/src/router.js @@ -1083,22 +1083,6 @@ export default new Router({ } }, - //TEST TEST TEST TEST TEST - // { - // //NEW TEST GZ DATA TABLE - // path: "/widgets", - // name: "widget-list", - // component: () => - // import(/* webpackChunkName: "widget" */ "./views/widgets.vue") - // }, - - // { - // //TEST WIDGET EDIT FORM - // path: "/widgets/:recordid", - // name: "widget-edit", - // component: () => - // import(/* webpackChunkName: "widget" */ "./views/widget.vue") - // }, { path: "/ay-evaluate", name: "ay-evaluate", diff --git a/ayanova/src/views/ay-data-list-column-view.vue b/ayanova/src/views/ay-data-list-column-view.vue index 83d1c907..4a807016 100644 --- a/ayanova/src/views/ay-data-list-column-view.vue +++ b/ayanova/src/views/ay-data-list-column-view.vue @@ -384,7 +384,6 @@ async function fetchTranslatedText(vm) { //////////////////// // async function populateFieldDefinitions(vm) { - //http://localhost:7575/api/v8/data-list/listfields?DataListKey=TestWidgetDataList let res = await window.$gz.api.get( "data-list/listfields?DataListKey=" + vm.dataListKey ); diff --git a/ayanova/src/views/cust-customer-notes.vue b/ayanova/src/views/cust-customer-notes.vue index 3c7687e0..0c39427a 100644 --- a/ayanova/src/views/cust-customer-notes.vue +++ b/ayanova/src/views/cust-customer-notes.vue @@ -69,7 +69,6 @@ export default { } } }; -//"[{\"fld\": \"widgetname\",\"filter\": {\"any\":false,\"items\": [{\"op\": \"%-\",\"value\": \"Awesome\"}]}},{\"fld\":\"widgetserial\"},{\"fld\":\"widgetdollaramount\"},{\"fld\":\"widgetusertype\"},{\"fld\":\"widgetstartdate\"},{\"fld\":\"widgetactive\"},{\"fld\":\"username\"},{\"fld\":\"widgettags\"},{\"fld\":\"widgetcustom1\"},{\"fld\":\"widgetcustom2\"}]" ///////////////////////////// // // diff --git a/ayanova/src/views/widget.vue b/ayanova/src/views/widget.vue deleted file mode 100644 index 346cbef6..00000000 --- a/ayanova/src/views/widget.vue +++ /dev/null @@ -1,798 +0,0 @@ - - - - - diff --git a/ayanova/src/views/widgets.vue b/ayanova/src/views/widgets.vue deleted file mode 100644 index 5a8cc66e..00000000 --- a/ayanova/src/views/widgets.vue +++ /dev/null @@ -1,165 +0,0 @@ - - - diff --git a/ayanova/tests/e2e/OLD/customize-form.js b/ayanova/tests/e2e/OLD/customize-form.js index 8ddf2038..565baa68 100644 --- a/ayanova/tests/e2e/OLD/customize-form.js +++ b/ayanova/tests/e2e/OLD/customize-form.js @@ -16,25 +16,25 @@ // .clear() // .type(`${Cypress.env("adminpassword")}{enter}`); -// cy.visit("/widgets/1"); -// cy.url().should("include", "/widgets/1"); +// cy.visit("/customers/1"); +// cy.url().should("include", "/customers/1"); // //check serial field is present, then hide it and check it's gone then re-show it again // cy.get("[data-cy=serial]").should("exist"); -// cy.get("[data-cy=WidgetCustom8]").should("not.exist"); +// cy.get("[data-cy=customerCustom8]").should("not.exist"); // cy.wait(100); // cy.get("[data-cy=contextmenu]").click(); // cy.get('[data-cy="app:customize"]').click(); -// cy.url().should("include", "/customize/Widget"); +// cy.url().should("include", "/customize/customer"); // //hide serial // cy.get("[data-cy=SerialVisible]").uncheck({ force: true }); // cy.wait(10); -// //show widget 8 and set it to a type -// cy.get("[data-cy=WidgetCustom8]").scrollIntoView(); -// cy.get("[data-cy=WidgetCustom8Visible]").check({ force: true }); -// cy.get("[data-cy=WidgetCustom8SelectType]").type("tr{enter}", { +// //show customer 8 and set it to a type +// cy.get("[data-cy=customerCustom8]").scrollIntoView(); +// cy.get("[data-cy=customerCustom8Visible]").check({ force: true }); +// cy.get("[data-cy=customerCustom8SelectType]").type("tr{enter}", { // force: true // }); @@ -43,22 +43,22 @@ // cy.go("back"); // //check customize worked // cy.get("[data-cy=serial]").should("not.exist"); -// cy.get("[data-cy=WidgetCustom8]").should("exist"); +// cy.get("[data-cy=customerCustom8]").should("exist"); // //reverse // cy.wait(100); // cy.get("[data-cy=contextmenu]").click(); // cy.get('[data-cy="app:customize"]').click(); -// cy.url().should("include", "/customize/Widget"); +// cy.url().should("include", "/customize/customer"); // cy.get("[data-cy=SerialVisible]").check({ force: true }); -// cy.get("[data-cy=WidgetCustom8Visible]").uncheck({ force: true }); -// cy.get("[data-cy=WidgetCustom8SelectType]").type("te{enter}", { +// cy.get("[data-cy=customerCustom8Visible]").uncheck({ force: true }); +// cy.get("[data-cy=customerCustom8SelectType]").type("te{enter}", { // force: true // }); // cy.get('[data-cy="customize:save"] > .v-btn__content > .v-icon').click(); // cy.go("back"); // cy.get("[data-cy=serial]").should("exist"); -// cy.get("[data-cy=WidgetCustom8]").should("not.exist"); +// cy.get("[data-cy=customerCustom8]").should("not.exist"); // //----- // }); // }); diff --git a/ayanova/tests/e2e/OLD/gz-data-table.js b/ayanova/tests/e2e/OLD/gz-data-table.js index 2a3afa84..76c77313 100644 --- a/ayanova/tests/e2e/OLD/gz-data-table.js +++ b/ayanova/tests/e2e/OLD/gz-data-table.js @@ -11,11 +11,11 @@ describe("GZ-DATA-TABLE", () => { .clear() .type("BizAdmin{enter}"); //cy.url().should("include", "/home-dashboard"); - cy.visit("/widgets"); - cy.url().should("include", "/widgets"); + cy.visit("/customers"); + cy.url().should("include", "/customers"); cy.contains("Rows per page"); - //select default widget list view + //select default customer list view cy.get("[data-cy=selectlistview]").type("-{enter}", { force: true }); //confirm we see the data expected cy.contains("Name"); @@ -24,7 +24,7 @@ describe("GZ-DATA-TABLE", () => { //refresh cy.get("[data-cy=refresh]").click(); - //confirm the first column is the widget name + //confirm the first column is the customer name cy.get("thead > tr > th:nth-child(1) > span").contains("Name"); // cy.get('[aria-label="Next page"] > .v-btn__content > .v-icon').click(); @@ -53,7 +53,7 @@ describe("GZ-DATA-TABLE", () => { '[data-cy="columncard:username"] > .v-card__text > .d-flex > :nth-child(1) > .v-btn__content > [data-cy=movestart]' ).click(); - //go back to widgetlist + //go back to customerlist cy.go("back"); //confirm the first column is now the username @@ -62,20 +62,20 @@ describe("GZ-DATA-TABLE", () => { //switch back to default filter cy.get("[data-cy=selectlistview]").type("-{enter}{esc}", { force: true }); - //open a widget record + //open a customer record cy.wait(100); cy.get("tbody > :nth-child(1) > :nth-child(1)").click(); //cy.get(":nth-child(1) > :nth-child(1) > .subtitle-1 > a").click(); - //confirm on widget edit form - cy.get('[data-cy="widget-edit:delete"]'); + //confirm on customer edit form + cy.get('[data-cy="customer-edit:delete"]'); - //go back to widgetlist + //go back to customerlist cy.go("back"); //new - cy.get("[data-cy='widget-list:new']").click(); - cy.url().should("include", "/widgets/0"); + cy.get("[data-cy='customer-list:new']").click(); + cy.url().should("include", "/customers/0"); //cy.get("thead > tr > th:nth-child(1)").contains("User"); diff --git a/ayanova/tests/e2e/OLD/select-list-templates.js b/ayanova/tests/e2e/OLD/select-list-templates.js index 963eb79d..a2f4fe52 100644 --- a/ayanova/tests/e2e/OLD/select-list-templates.js +++ b/ayanova/tests/e2e/OLD/select-list-templates.js @@ -28,8 +28,8 @@ describe("PICK LIST TEMPLATE", () => { cy.get( '[data-cy="adm-global-select-templates:save"] > .v-btn__content > .v-icon' ).click({ force: true }); - cy.visit("/widgets/0"); - cy.url().should("include", "/widgets/0"); + cy.visit("/customers/0"); + cy.url().should("include", "/customers/0"); //select a user with a zone set cy.get("[data-cy=userid] > .v-input") .type("..zone") @@ -50,8 +50,8 @@ describe("PICK LIST TEMPLATE", () => { cy.get( '[data-cy="adm-global-select-templates:save"] > .v-btn__content > .v-icon' ).click({ force: true }); - cy.visit("/widgets/0"); - cy.url().should("include", "/widgets/0"); + cy.visit("/customers/0"); + cy.url().should("include", "/customers/0"); //select a user with a zone set cy.get("[data-cy=userid] > .v-input") .type("..zone") diff --git a/ayanova/tests/e2e/specs/search-form.js b/ayanova/tests/e2e/specs/search-form.js index 6cb27593..e6850341 100644 --- a/ayanova/tests/e2e/specs/search-form.js +++ b/ayanova/tests/e2e/specs/search-form.js @@ -46,7 +46,7 @@ describe("SEARCH", () => { sub = t; //nave to first result form cy.get("[data-cy=btnopenitem1]").click(); - cy.url().should("include", "/widget"); + cy.url().should("include", "/customer"); //name field should contain whatever was shown in search results list cy.contains(sub).should("exist"); }); diff --git a/ayanova/tests/e2e/specs/smoke.js b/ayanova/tests/e2e/specs/smoke.js index 2395c9bb..3a42ded4 100644 --- a/ayanova/tests/e2e/specs/smoke.js +++ b/ayanova/tests/e2e/specs/smoke.js @@ -430,18 +430,6 @@ describe("SMOKE", () => { cy.url({ timeout: 10000 }).should("include", "/cust-customers/1"); cy.get("[data-cy=name]"); - // cy.visit("/viewreport?oid=1&rid=1"); - // cy.url({ timeout: 10000 }).should("include", "/cust-customers/1"); - // cy.get("[data-cy=name]"); - - // cy.visit("/widgets"); - // cy.url({ timeout: 10000 }).should("include", "/widgets"); - // cy.get("[data-cy=widgetsTable]"); - - // cy.visit("/widgets/0"); - // cy.url({ timeout: 10000 }).should("include", "/widgets/0"); - // cy.get("[data-cy=name]"); - cy.visit("/NOTFOUND"); cy.contains("404"); diff --git a/ayanova/tests/e2e/specs/widget-crud.js b/ayanova/tests/e2e/specs/widget-crud.js index f7dc086f..7b00ee4c 100644 --- a/ayanova/tests/e2e/specs/widget-crud.js +++ b/ayanova/tests/e2e/specs/widget-crud.js @@ -3,8 +3,8 @@ // const { WatchIgnorePlugin } = require("webpack"); //https://docs.cypress.io/guides/references/assertions.html#BDD-Assertions -describe("WIDGET FORM", () => { - it("Performs all crud ops on widget successfully", () => { +describe("customer FORM", () => { + it("Performs all crud ops on customer successfully", () => { let unique = new Date().getTime(); cy.visit("/login"); cy.get("input[name=username]") @@ -19,8 +19,8 @@ describe("WIDGET FORM", () => { cy.url().should("include", "/ay-evaluate"); //POST - cy.visit("/widgets/0"); - cy.url().should("include", "/widgets/0"); + cy.visit("/customers/0"); + cy.url().should("include", "/customers/0"); //cy.wait(5000); //save the start url for later @@ -69,20 +69,20 @@ describe("WIDGET FORM", () => { force: true }); //esc necessary to close tags control cy.get( - "[data-cy=WidgetCustom2]" + "[data-cy=customerCustom2]" ).type("Custom text field testing a...b...c...{enter}EOT", { force: true }); //GET ROUTE //SAve the record and ensure it's different - cy.get('[data-cy="widget-edit:save"]').click(); - cy.url().should("include", "/widgets"); + cy.get('[data-cy="customer-edit:save"]').click(); + cy.url().should("include", "/customers"); cy.get("[data-cy=serial]").should("not.have.value", 0); //server sets new value on save //PUT cy.get("[data-cy=count]").type("321", { force: true }); - cy.get('[data-cy="widget-edit:save"]').click({ force: true }); + cy.get('[data-cy="customer-edit:save"]').click({ force: true }); //now get it back again and confirm settings @@ -91,7 +91,7 @@ describe("WIDGET FORM", () => { //delete the record cy.get("[data-cy=contextmenu]").click(); - cy.get('[data-cy="widget-edit:delete"]').click(); + cy.get('[data-cy="customer-edit:delete"]').click(); cy.get('[data-cy="gzconfirm:yesbutton"]').click(); // //LOGOUT