From c0dd56b90ad51b31b814b6ecf47f7785e9d76d34 Mon Sep 17 00:00:00 2001 From: John Cardinal Date: Wed, 2 Dec 2020 17:41:49 +0000 Subject: [PATCH] refinement to readonly mode: banner now gray and removed disabled for controls as they were too faded to read properly and some controls with action buttons didn't work (email, phone etc) --- ayanova/devdocs/todo.txt | 2 - ayanova/src/App.vue | 9 +- ayanova/src/api/gzmenu.js | 12 ++ ayanova/src/components/gz-data-table.vue | 173 +++++++++--------- ayanova/src/plugins/vuetify.js | 6 +- ayanova/src/views/adm-translation.vue | 2 - ayanova/src/views/adm-user.vue | 14 -- ayanova/src/views/ay-customize.vue | 1 - ayanova/src/views/ay-data-list-view.vue | 1 - ayanova/src/views/ay-evaluate.vue | 5 +- ayanova/src/views/ay-report-edit.vue | 16 -- ayanova/src/views/cust-customer-note.vue | 3 - ayanova/src/views/cust-customer.vue | 37 +--- ayanova/src/views/cust-user.vue | 11 -- .../src/views/home-notify-subscription.vue | 7 - ayanova/src/views/home-user-settings.vue | 3 - ayanova/src/views/ops-backup.vue | 4 - .../src/views/ops-notification-settings.vue | 8 - ayanova/src/views/ops-server-state.vue | 2 - ayanova/src/views/widget.vue | 14 -- 20 files changed, 109 insertions(+), 221 deletions(-) diff --git a/ayanova/devdocs/todo.txt b/ayanova/devdocs/todo.txt index 69cfae56..091b207d 100644 --- a/ayanova/devdocs/todo.txt +++ b/ayanova/devdocs/todo.txt @@ -6,8 +6,6 @@ MISC ITEMS THAT CAME UP -todo: Customer read only user (biz admin ltd) is able to add a NEW contact record! - todo: if list view not found / deleted when grid list form is opened rather than erroring with object/object it should handle more elegantly: possibly show proper error but for sure select the no filter option automatically diff --git a/ayanova/src/App.vue b/ayanova/src/App.vue index e05be700..10d40f90 100644 --- a/ayanova/src/App.vue +++ b/ayanova/src/App.vue @@ -137,13 +137,8 @@ - + + MAX_TEXT_COLUMN_LENGTH) { - display = display.substring(0, MAX_TEXT_COLUMN_LENGTH) + "..."; - } - break; - case 7: //decimal - display = window.$gz.locale.decimalLocalized(display, languageName); - break; - case 8: //currency - display = window.$gz.locale.currencyLocalized( - display, - languageName, - currencyName - ); - break; - case 9: //tags - if (display && display.length > 0) { - display = display.join(", "); - } else { - display = ""; - } - - break; - case 10: //enum - display = window.$gz.enums.get( - columndefinitions[iColumn].et, - display - ); - //is it an AyaType openable type column like in the EventDataList AyaType column? - if ( - columndefinitions[iColumn].et == "AyaType" && - column.i != null && - column.i != 0 - ) { - //yes so provide the ot (openable type) info needed for the grid to make this openable - // console.log("Openable type:", column); - switch (column.v) { - //Not openable types - case 18: //DataListView - break; - default: - openableAyaType = column.v; - break; + if (display != null) { + switch (dataType) { + case 1: //datetime format to shortdatetime + display = window.$gz.locale.utcDateToShortDateAndTimeLocalized( + display, + timeZoneName, + languageName, + hour12 + ); + break; + case 2: //date only + display = window.$gz.locale.utcDateToShortDateLocalized( + display, + timeZoneName, + languageName + ); + break; + case 3: //time only + display = window.$gz.locale.utcDateToShortTimeLocalized( + display, + timeZoneName, + languageName, + hour12 + ); + break; + case 4: //text + if (display.length > MAX_TEXT_COLUMN_LENGTH) { + display = display.substring(0, MAX_TEXT_COLUMN_LENGTH) + "..."; } - } - // console.log("gz-data-table:buildRecords:enumtype column is ", column); - // //v contains the type number and i contains the id of the record if it's an aytype enum openable - // console.log( - // "gz-data-table:buildRecords:enumtype column devfinition is ", - // columndefinitions[iColumn] - // ); - break; - case 14: //MemorySize (file size) - display = window.$gz.locale.humanFileSize( - display, - languageName, - false, - 2 - ); - break; - default: - //do nothing, allow it to stay as is (checkbox, plain text etc) + break; + case 7: //decimal + display = window.$gz.locale.decimalLocalized(display, languageName); + break; + case 8: //currency + display = window.$gz.locale.currencyLocalized( + display, + languageName, + currencyName + ); + break; + case 9: //tags + if (display && display.length > 0) { + display = display.join(", "); + } else { + display = ""; + } + + break; + case 10: //enum + display = window.$gz.enums.get( + columndefinitions[iColumn].et, + display + ); + //is it an AyaType openable type column like in the EventDataList AyaType column? + if ( + columndefinitions[iColumn].et == "AyaType" && + column.i != null && + column.i != 0 + ) { + //yes so provide the ot (openable type) info needed for the grid to make this openable + // console.log("Openable type:", column); + switch (column.v) { + //Not openable types + case 18: //DataListView + break; + default: + openableAyaType = column.v; + break; + } + } + // console.log("gz-data-table:buildRecords:enumtype column is ", column); + // //v contains the type number and i contains the id of the record if it's an aytype enum openable + // console.log( + // "gz-data-table:buildRecords:enumtype column devfinition is ", + // columndefinitions[iColumn] + // ); + break; + case 14: //MemorySize (file size) + display = window.$gz.locale.humanFileSize( + display, + languageName, + false, + 2 + ); + break; + default: + //do nothing, allow it to stay as is (checkbox, plain text etc) + } } //build the row column object vm will be used by the datatable let columnObject = { diff --git a/ayanova/src/plugins/vuetify.js b/ayanova/src/plugins/vuetify.js index dab26104..082e29a0 100644 --- a/ayanova/src/plugins/vuetify.js +++ b/ayanova/src/plugins/vuetify.js @@ -1328,7 +1328,8 @@ export default new Vuetify({ secondary: "#00843D", //canucks green accent: "#db7022", //lighter orangey red, more friendly looking though not as much clarity it seems error: "#ff5252", //lighter red, have to see if it's good for all screens and sizes as it's a bit light but it stands out as an error condition better - disabled: "#c7c7c7" + disabled: "#c7c7c7", + readonlybanner: "#808080" }, dark: { //here you will define primary secondary stuff for dark theme @@ -1337,7 +1338,8 @@ export default new Vuetify({ secondary: "#006B24", //canucks green DARKENED 10% accent: "#db7022", //lighter orangey red, more friendly looking though not as much clarity it seems error: "#ff5252", //lighter red, have to see if it's good for all screens and sizes as it's a bit light but it stands out as an error condition better - disabled: "#c7c7c7" + disabled: "#c7c7c7", + readonlybanner: "#808080" } }, options: { variations: false } diff --git a/ayanova/src/views/adm-translation.vue b/ayanova/src/views/adm-translation.vue index d4ddfcfb..e47a0262 100644 --- a/ayanova/src/views/adm-translation.vue +++ b/ayanova/src/views/adm-translation.vue @@ -59,7 +59,6 @@ @@ -221,7 +211,6 @@ > @@ -36,7 +35,6 @@ {{ $ay.t("StartJob") }}{{ $ay.t("StartJob") }} diff --git a/ayanova/src/views/ay-report-edit.vue b/ayanova/src/views/ay-report-edit.vue index 9337f8bb..0693aa4f 100644 --- a/ayanova/src/views/ay-report-edit.vue +++ b/ayanova/src/views/ay-report-edit.vue @@ -59,7 +59,6 @@ @@ -419,7 +397,6 @@ > $ayiPlus @@ -1436,6 +1402,7 @@ async function clickHandler(menuItem) { function generateMenu(vm) { let menuOptions = { isMain: false, + readOnly: vm.formState.readOnly, icon: "$ayiAddressCard", title: "Customer", helpUrl: "form-customer", diff --git a/ayanova/src/views/cust-user.vue b/ayanova/src/views/cust-user.vue index 478e4c05..120dd1d5 100644 --- a/ayanova/src/views/cust-user.vue +++ b/ayanova/src/views/cust-user.vue @@ -63,7 +63,6 @@ @@ -208,7 +201,6 @@ > @@ -35,7 +33,6 @@ @@ -45,7 +43,6 @@ @@ -230,7 +217,6 @@ >