From 9575376d3a4351002982c4022cfa182e1dcefdfd Mon Sep 17 00:00:00 2001 From: John Cardinal Date: Wed, 10 Feb 2021 18:48:47 +0000 Subject: [PATCH] --- ayanova/devdocs/rando-todo.txt | 4 +++ ayanova/devdocs/todo.txt | 18 ++-------- ayanova/src/views/acc-service-bank.vue | 49 ++++++++++++++++++++++++-- 3 files changed, 53 insertions(+), 18 deletions(-) diff --git a/ayanova/devdocs/rando-todo.txt b/ayanova/devdocs/rando-todo.txt index 4009dcd0..96f638fc 100644 --- a/ayanova/devdocs/rando-todo.txt +++ b/ayanova/devdocs/rando-todo.txt @@ -11,6 +11,10 @@ todo: validation errors not expanded in errorbox, or, maybe it's ok as is? +todo: Attachments button should indicate attachments: + Flags hasattachments status visually, do it! + (Says add attachment when none) + todo: going to need some default views for certain lists that come with AyaNova automatically (even if migrating) diff --git a/ayanova/devdocs/todo.txt b/ayanova/devdocs/todo.txt index bfbdf197..bd941226 100644 --- a/ayanova/devdocs/todo.txt +++ b/ayanova/devdocs/todo.txt @@ -9,12 +9,7 @@ MISC ITEMS THAT CAME UP ## CLIENT MISC ITEMS -todo: search form object list add service bank - should open to data-table list of that item - -todo: Attachments button should indicate attachments: - Flags hasattachments status visually, do it! - (Says add attachment when none) + todo: WHEN HAVE WORKORDER FORM customer popup notes need to pop pop pop, forgot to code for that before @@ -24,16 +19,7 @@ todo: WHEN HAVE WORKORDER FORM customer popup notes need to pop pop pop, forgot ## SERVER MISC ITEMS -todo: all the GetSearchResultSummary functions need to use the getasync or at least no tracking: - public async Task GetSearchResultSummary(long id) - { - var obj = await ct.ServiceBank.SingleOrDefaultAsync(z => z.Id == id); - var SearchParams = new Search.SearchIndexProcessObjectParameters(); - DigestSearchText(obj, SearchParams); - return SearchParams; - } -todo: all picklists of objects htat have tags should by default include tags as the last field - this is to support choosing by tag as the feature isn't very useful if you can't see the tags that come back + todo: userbiz validate can delete has funky error todo: bugbug filter on a phone number field results in error at server as unsupported type make sure all types are supported diff --git a/ayanova/src/views/acc-service-bank.vue b/ayanova/src/views/acc-service-bank.vue index 423ca52f..969db32b 100644 --- a/ayanova/src/views/acc-service-bank.vue +++ b/ayanova/src/views/acc-service-bank.vue @@ -126,8 +126,9 @@ export default { //id 0 means create a new record don't load one if (vm.$route.params.recordid != 0) { - // navigate backwards there's nothing here to see - vm.$router.go(-1); + //Ok, we're here to *view* an existing record + //so we must fetch the deets now + 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?", @@ -318,6 +319,50 @@ export default { loading: false }); } + }, + async getDataFromApi(recordId) { + let vm = this; + window.$gz.form.setFormState({ + vm: vm, + loading: true + }); + if (!recordId) { + throw new Error(FORM_KEY + "::getDataFromApi -> Missing recordID!"); + } + let url = API_BASE_URL + recordId; + try { + window.$gz.form.deleteAllErrorBoxErrors(vm); + + let res = await window.$gz.api.get(url); + + if (res.error) { + //Not found? + if (res.error.code == "2010") { + window.$gz.form.handleObjectNotFound(vm); + } + vm.formState.serverError = res.error; + window.$gz.form.setErrorBoxErrors(vm); + } else { + vm.obj = res.data; + //modify the menu as necessary + generateMenu(vm); + //Update the form status + window.$gz.form.setFormState({ + vm: vm, + dirty: false, + valid: true, + readOnly: true, //service banks are always read only after they are saved + loading: false + }); + } + } catch (error) { + window.$gz.errorHandler.handleFormError(error, vm); + } finally { + window.$gz.form.setFormState({ + vm: vm, + loading: false + }); + } } //end methods