From 7bb4e5dff2ddced1b4f25bd5020b06ff2942e98f Mon Sep 17 00:00:00 2001 From: John Cardinal Date: Tue, 18 Feb 2020 20:27:22 +0000 Subject: [PATCH] --- ayanova/src/components/gz-data-table.vue | 3 +- ayanova/src/router.js | 2 +- ayanova/src/views/ay-data-list-view.vue | 42 +++++++++++++++++++++--- 3 files changed, 41 insertions(+), 6 deletions(-) diff --git a/ayanova/src/components/gz-data-table.vue b/ayanova/src/components/gz-data-table.vue index bdd11bff..8bf2a9ca 100644 --- a/ayanova/src/components/gz-data-table.vue +++ b/ayanova/src/components/gz-data-table.vue @@ -372,7 +372,8 @@ export default { name: "ay-data-list-view", params: { listViewId: this.listViewId, - dataListKey: this.dataListKey + dataListKey: this.dataListKey, + formKey: this.formKey } }); }, diff --git a/ayanova/src/router.js b/ayanova/src/router.js index 17aff44b..199e3c7c 100644 --- a/ayanova/src/router.js +++ b/ayanova/src/router.js @@ -401,7 +401,7 @@ export default new Router({ import(/* webpackChunkName: "ay" */ "./views/ay-customize.vue") }, { - path: "/ay-data-list-view/:listViewId/:dataListKey", + path: "/ay-data-list-view/:listViewId/:dataListKey/:formKey", name: "ay-data-list-view", component: () => import(/* webpackChunkName: "ay" */ "./views/ay-data-list-view.vue") diff --git a/ayanova/src/views/ay-data-list-view.vue b/ayanova/src/views/ay-data-list-view.vue index bd927170..1975d941 100644 --- a/ayanova/src/views/ay-data-list-view.vue +++ b/ayanova/src/views/ay-data-list-view.vue @@ -106,6 +106,7 @@ export default { //set route values in data object so init form can handle vm.dataListKey = this.$route.params.dataListKey; vm.listViewId = this.$route.params.listViewId; + vm.formKey = this.$route.params.formKey; initForm(vm) .then(() => { @@ -127,9 +128,11 @@ export default { data() { return { obj: [], //working copy driving UI - listViewId: null, - dataListKey: null, + listViewId: undefined, + dataListKey: undefined, + formKey: undefined, fieldDefinitions: [], + effectiveListView: undefined, concurrencyToken: undefined, pickLists: {}, formState: { @@ -138,8 +141,8 @@ export default { valid: true, readOnly: false, loading: true, - errorBoxMessage: null, - appError: null, + errorBoxMessage: undefined, + appError: undefined, serverError: {} }, rights: window.$gz.role.getRights(window.$gz.type.DataListView) @@ -338,6 +341,37 @@ function fetchLocalizedFieldNames(vm) { }); } +///////////////////////////////// +// +// +function setEffectiveListView(vm) { + //return Promise.resolve(); + /* + effectiveListView + - Second get the ListView that is currently in use so can setup the page view + - If listviewid is zero then that's starting with the default list view so need to fetch it and then init the form + - If listviewid is -1 then that's starting with an unsaved listview so get that from the saved form store + - If listviewid is greater than 0 then it's a saved listview and there sb a cached version of it but ideally maybe fetch it from + + */ + + if (vm.listViewId == null) { + throw "ay-data-list::setEffectiveListView - listViewId is not set"; + } + + var formSettings = window.$gz.form.getFormSettings(vm.formKey); + + if (vm.listViewId == -1) { + if (formSettings.saved.dataTable.editedListView != null) { + vm.effectiveListView = formSettings.saved.dataTable.editedListView; + } + } else if (vm.listViewId == 0) { + //get default list view + } else { + //check if cached, if not then fetch, cache and set + } +} + //////////////////// // function initDataObject(vm) {