This commit is contained in:
2021-02-10 18:48:47 +00:00
parent b28e1a10eb
commit 9575376d3a
3 changed files with 53 additions and 18 deletions

View File

@@ -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)

View File

@@ -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<Search.SearchIndexProcessObjectParameters> 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

View File

@@ -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