This commit is contained in:
2020-02-28 00:43:46 +00:00
parent fbb45da1ba
commit fe3e0117bf
8 changed files with 71 additions and 28 deletions

View File

@@ -42,8 +42,6 @@ CURRENT ROADMAP
CURRENT TODOs CURRENT TODOs
=-=-=-=-=-=-= =-=-=-=-=-=-=
todo: about link is showing on about form
TODO: No way to make a new widget now!!! TODO: No way to make a new widget now!!!
TODO: save (post) of new record at client triggers renavigation to that page again which also triggers fetch TODO: save (post) of new record at client triggers renavigation to that page again which also triggers fetch
- So what's the point of returning the full record on post? - So what's the point of returning the full record on post?
@@ -51,6 +49,10 @@ TODO: save (post) of new record at client triggers renavigation to that page aga
- On the other hand, is the data still kept in the view or is create called again fresh and all that?? - On the other hand, is the data still kept in the view or is create called again fresh and all that??
TODO: Switch control has issues in mobile view throws error "touch is undefined" TODO: Switch control has issues in mobile view throws error "touch is undefined"
- Update and see if fixes or else switch to some other component - Update and see if fixes or else switch to some other component
todo: clean browser open widget list doesn't fetch anything, seems to sit endlessly, only fix is to select a filter, unselect and force full refresh multiple times
- No error at server
- Maybe there is an issue with OLD stored list settings because completely wiping them fixes it.
- HMMM...maybe we need to wipe the stored settings when the version changes or something, maybe this will be more of an issue later in dev process
TODO: HELP link on listVieweditor not working TODO: HELP link on listVieweditor not working
TODO: Add test for *NULL* and not *NULL* in datalistfilter tests as there currently aren't any TODO: Add test for *NULL* and not *NULL* in datalistfilter tests as there currently aren't any
TODO: ay-data-list-view initform code shows proper way to initialize and await each step TODO: ay-data-list-view initform code shows proper way to initialize and await each step

View File

@@ -134,10 +134,10 @@
<v-toolbar-items> <v-toolbar-items>
<template v-for="item in appBar.menuItems"> <template v-for="item in appBar.menuItems">
<v-btn <v-btn
:key="item.key"
class="hidden-xs-only" class="hidden-xs-only"
icon icon
v-if="item.surface" v-if="item.surface"
:key="item.key"
:disabled="item.disabled" :disabled="item.disabled"
@click="clickMenuItem(item)" @click="clickMenuItem(item)"
> >

View File

@@ -104,7 +104,7 @@ export default {
"Logout", "Logout",
//form required options //form required options
"Active", "Active",
"Add", "New",
"Cancel", "Cancel",
"Close", "Close",
"Save", "Save",

View File

@@ -15,7 +15,7 @@ export default {
case ayatype.Widget: case ayatype.Widget:
vm.$router.push({ vm.$router.push({
name: "inventory-widget-edit", name: "inventory-widget-edit",
params: { id: tid.id } params: { recordid: tid.id }
}); });
break; break;

View File

@@ -80,7 +80,7 @@
class="subtitle-1" class="subtitle-1"
@click="gridCellButtonClick(c.key, c.i)" @click="gridCellButtonClick(c.key, c.i)"
> >
<a href="#"> {{ c.v }}</a> <a href="javascript:"> {{ c.v }}</a>
</div> </div>
<!-- <v-btn <!-- <v-btn
depressed depressed
@@ -231,7 +231,7 @@
class="subtitle-1" class="subtitle-1"
@click="gridCellButtonClick(c.key, c.i)" @click="gridCellButtonClick(c.key, c.i)"
> >
<a href="#"> {{ c.v }}</a> <a href="javascript:"> {{ c.v }}</a>
</div> </div>
<!-- <span <!-- <span
@click="gridCellButtonClick(c.key, c.i)" @click="gridCellButtonClick(c.key, c.i)"

View File

@@ -442,7 +442,7 @@ export default new Router({
{ {
//TEST WIDGET EDIT FORM //TEST WIDGET EDIT FORM
path: "/inventory/widget/edit/:id", path: "/inventory/widget/edit/:recordid",
name: "inventory-widget-edit", name: "inventory-widget-edit",
component: () => component: () =>
import( import(

View File

@@ -288,8 +288,8 @@ export default {
window.$gz.eventBus.$on("menu-click", clickHandler); window.$gz.eventBus.$on("menu-click", clickHandler);
//id 0 means create a new record don't load one //id 0 means create a new record don't load one
if (this.$route.params.id != 0) { if (this.$route.params.recordid != 0) {
this.getDataFromApi(this.$route.params.id); this.getDataFromApi(this.$route.params.recordid);
} else { } else {
//setup for new record //setup for new record
var readOnly = !this.rights.change; var readOnly = !this.rights.change;
@@ -313,8 +313,8 @@ export default {
}, },
beforeRouteUpdate(to, from, next) { beforeRouteUpdate(to, from, next) {
//fetch the data for the record as if it's a new record //fetch the data for the record as if it's a new record
if (to.params.id != 0) { if (to.params.recordid != 0) {
this.getDataFromApi(to.params.id); this.getDataFromApi(to.params.recordid);
} }
next(); next();
// react to route changes... // react to route changes...
@@ -485,7 +485,7 @@ export default {
if (this.canSave) { if (this.canSave) {
this.formState.loading = true; this.formState.loading = true;
var vm = this; var vm = this;
var url = API_BASE_URL + this.$route.params.id; var url = API_BASE_URL + this.$route.params.recordid;
//clear any errors vm might be around from previous submit //clear any errors vm might be around from previous submit
window.$gz.form.deleteAllErrorBoxErrors(this); window.$gz.form.deleteAllErrorBoxErrors(this);
@@ -531,13 +531,13 @@ export default {
//do the delete //do the delete
vm.formState.loading = true; vm.formState.loading = true;
//No need to delete a new record, just abandon it... //No need to delete a new record, just abandon it...
if (this.$route.params.id == 0) { if (this.$route.params.recordid == 0) {
//this should not get offered for delete but to be safe and clear just in case: //this should not get offered for delete but to be safe and clear just in case:
JUST_DELETED = true; JUST_DELETED = true;
// navigate backwards // navigate backwards
vm.$router.go(-1); vm.$router.go(-1);
} else { } else {
var url = API_BASE_URL + vm.$route.params.id; var url = API_BASE_URL + vm.$route.params.recordid;
window.$gz.form.deleteAllErrorBoxErrors(vm); window.$gz.form.deleteAllErrorBoxErrors(vm);
window.$gz.api window.$gz.api
@@ -567,10 +567,10 @@ export default {
}); });
}, },
duplicate() { duplicate() {
if (this.canDuplicate && this.$route.params.id != 0) { if (this.canDuplicate && this.$route.params.recordid != 0) {
this.formState.loading = true; this.formState.loading = true;
var vm = this; var vm = this;
var url = API_BASE_URL + "duplicate/" + this.$route.params.id; var url = API_BASE_URL + "duplicate/" + this.$route.params.recordid;
//clear any errors vm might be around from previous submit //clear any errors vm might be around from previous submit
window.$gz.form.deleteAllErrorBoxErrors(this); window.$gz.form.deleteAllErrorBoxErrors(this);
@@ -659,7 +659,7 @@ function generateMenu(vm) {
formData: { formData: {
formKey: FORM_KEY, formKey: FORM_KEY,
ayaType: window.$gz.type.Widget, ayaType: window.$gz.type.Widget,
recordId: vm.$route.params.id, recordId: vm.$route.params.recordid,
formCustomTemplateKey: FORM_CUSTOM_TEMPLATE_KEY formCustomTemplateKey: FORM_CUSTOM_TEMPLATE_KEY
}, },
menuItems: [] menuItems: []

View File

@@ -18,17 +18,10 @@ export default {
components: { components: {
GzDataTable GzDataTable
}, },
beforeCreate() {
window.$gz.eventBus.$emit("menu-change", {
isMain: true,
icon: "vial",
title: window.$gz.locale.get("WidgetList"),
helpUrl: "form-ay-data-list-view",
menuItems: []
});
},
created() { created() {
this.rights = window.$gz.role.getRights(window.$gz.type.Widget);
window.$gz.eventBus.$on("menu-click", clickHandler); window.$gz.eventBus.$on("menu-click", clickHandler);
generateMenu(this);
}, },
beforeDestroy() { beforeDestroy() {
window.$gz.eventBus.$off("menu-click", clickHandler); window.$gz.eventBus.$off("menu-click", clickHandler);
@@ -38,7 +31,8 @@ export default {
currentListViewId: 1, currentListViewId: 1,
dataListKey: "TestWidgetDataList", dataListKey: "TestWidgetDataList",
dataListFilter: "", dataListFilter: "",
dataListSort: "" dataListSort: "",
rights: window.$gz.role.defaultRightsObject()
}; };
}, },
methods: { methods: {
@@ -58,6 +52,12 @@ function clickHandler(menuItem) {
var m = window.$gz.menu.parseMenuItem(menuItem); var m = window.$gz.menu.parseMenuItem(menuItem);
if (m.owner == FORM_KEY && !m.disabled) { if (m.owner == FORM_KEY && !m.disabled) {
switch (m.key) { switch (m.key) {
case "new":
m.vm.$router.push({
name: "inventory-widget-edit",
params: { recordid: 0 }
});
break;
default: default:
window.$gz.eventBus.$emit( window.$gz.eventBus.$emit(
"notify-warning", "notify-warning",
@@ -66,4 +66,45 @@ function clickHandler(menuItem) {
} }
} }
} }
//////////////////////
//
//
function generateMenu(vm) {
var menuOptions = {
isMain: true,
icon: "vial",
title: window.$gz.locale.get("WidgetList"),
helpUrl: "form-ay-data-list-view",
menuItems: []
};
if (vm.rights.change) {
menuOptions.menuItems.push({
title: window.$gz.locale.get("New"),
icon: "plus",
surface: true,
key: FORM_KEY + ":new",
vm: vm
});
}
//STUB REPORTS
//Report not Print, print is a further option
menuOptions.menuItems.push({
title: window.$gz.locale.get("Report"),
icon: "file-alt",
key: FORM_KEY + ":report",
vm: vm
});
menuOptions.menuItems.push({
title: "stub: Last report used",
icon: "file-alt",
key: FORM_KEY + ":report:STUBlastusedreportid",
vm: vm
});
window.$gz.eventBus.$emit("menu-change", menuOptions);
}
</script> </script>