This commit is contained in:
2019-05-01 19:08:51 +00:00
parent 9a51e8c4e8
commit 3ebf647d53
3 changed files with 106 additions and 56 deletions

View File

@@ -74,7 +74,7 @@ All platforms and browsers
- Wire up delete menu item
- api code is stubbed out for delete, need to write that as well
- DONE TODO navigating through menu doesn't "back" properly when clicking back on browser controls
= TODO: widget form now not localized title at menu top
- Widget list, refresh page causes items per page to reset back to 5 from custom setting, it should cache that shit at least for a session anyway

View File

@@ -13,6 +13,7 @@ export default {
handleMenuChange(vm, ctx) {
vm.appBar.isMain = ctx.isMain;
vm.appBar.icon = ctx.icon;
vm.appBar.title = ctx.title;
//set the help url if presented or default to the top of the index
vm.appBar.helpUrl = ctx.helpUrl ? ctx.helpUrl : "index.html";

View File

@@ -23,7 +23,10 @@
@click:clear="onChange('name')"
:counter="255"
:label="this.$gzlocale.get('WidgetName')"
:rules="[this.$gzform.max255(this,'name'),this.$gzform.required(this,'name')]"
:rules="[
this.$gzform.max255(this, 'name'),
this.$gzform.required(this, 'name')
]"
:error-messages="this.$gzform.serverErrors(this, 'name')"
ref="name"
@change="onChange('name')"
@@ -52,7 +55,10 @@
:counter="10"
:label="this.$gzlocale.get('WidgetCount')"
ref="count"
:rules="[this.$gzform.integerValid(this,'count'),this.$gzform.required(this,'count')]"
:rules="[
this.$gzform.integerValid(this, 'count'),
this.$gzform.required(this, 'count')
]"
:error-messages="this.$gzform.serverErrors(this, 'count')"
required
@change="onChange('count')"
@@ -68,7 +74,10 @@
:label="this.$gzlocale.get('WidgetDollarAmount')"
ref="dollarAmount"
required
:rules="[this.$gzform.decimalValid(this,'dollarAmount'),this.$gzform.required(this,'dollarAmount')]"
:rules="[
this.$gzform.decimalValid(this, 'dollarAmount'),
this.$gzform.required(this, 'dollarAmount')
]"
:error-messages="this.$gzform.serverErrors(this, 'dollarAmount')"
@change="onChange('dollarAmount')"
type="number"
@@ -89,7 +98,9 @@
<v-flex xs12 sm6 lg4 xl3 px-2>
<gz-date-time-picker
:label="this.$gzlocale.get('WidgetEndDate')"
:rules="[this.$gzform.datePrecedence(this,'startDate','endDate')]"
:rules="[
this.$gzform.datePrecedence(this, 'startDate', 'endDate')
]"
:error-messages="this.$gzform.serverErrors(this, 'endDate')"
v-model="obj.endDate"
:readonly="this.formState.readOnly"
@@ -114,7 +125,10 @@
:readonly="this.formState.readOnly"
:label="this.$gzlocale.get('WidgetRoles')"
ref="roles"
:rules="[this.$gzform.integerValid(this,'roles'),this.$gzform.required(this,'roles')]"
:rules="[
this.$gzform.integerValid(this, 'roles'),
this.$gzform.required(this, 'roles')
]"
:error-messages="this.$gzform.serverErrors(this, 'roles')"
required
@change="onChange('roles')"
@@ -154,7 +168,7 @@
</template>
<script>
/* Xeslint-disable */
/* eslint-disable */
//import ayatype from "../api/ayatype";
function clickHandler(menuItem) {
@@ -207,6 +221,7 @@ export default {
// // has access to `this` component instance.
// },
beforeCreate() {
console.log("BEFORE CREATE CALLED");
//Cache all required lt keys
var ltKeysRequired = [
"Widget",
@@ -236,45 +251,80 @@ export default {
"WidgetCustom16"
];
var vm = this;
//console.log("B4CREATE FETCHING KEYS NOW");
this.$gzlocale
.fetch(ltKeysRequired)
.then(() => (this.formState.ready = true))
.catch(err => {
this.formState.ready = true;
vm.$gzHandleFormError(err);
});
},
created() {
this.$gzevent.$emit("menu-change", {
//.then(() => console.log("KEYS FETCHED"))
.then(function() {
vm.$gzevent.$emit("menu-change", {
isMain: false,
icon: "fa-splotch",
title: this.$gzlocale.get("Widget"),
title: vm.$gzlocale.get("Widget"),
helpUrl: "intro/#searching",
menuItems: [
{
title: this.$gzlocale.get("Save"),
title: vm.$gzlocale.get("Save"),
icon: "save",
surface: true,
key: "inventory-widget-edit:save",
vm: this
vm: vm
},
{
title: this.$gzlocale.get("Delete"),
title: vm.$gzlocale.get("Delete"),
icon: "trash-alt",
surface: true,
key: "inventory-widget-edit:delete",
vm: this
vm: vm
},
{ divider: true, inset: false },
{
title: this.$gzlocale.get("Duplicate"),
title: vm.$gzlocale.get("Duplicate"),
icon: "clone",
key: "inventory-widget-edit:duplicate",
vm: this
vm: vm
}
]
});
})
.then(() => (vm.formState.ready = true))
.catch(err => {
vm.formState.ready = true;
vm.$gzHandleFormError(err);
});
},
created() {
//console.log("CREATED CALLED");
// this.$gzevent.$emit("menu-change", {
// isMain: false,
// icon: "fa-splotch",
// title: this.$gzlocale.get("Widget"),
// helpUrl: "intro/#searching",
// menuItems: [
// {
// title: this.$gzlocale.get("Save"),
// icon: "save",
// surface: true,
// key: "inventory-widget-edit:save",
// vm: this
// },
// {
// title: this.$gzlocale.get("Delete"),
// icon: "trash-alt",
// surface: true,
// key: "inventory-widget-edit:delete",
// vm: this
// },
// { divider: true, inset: false },
// {
// title: this.$gzlocale.get("Duplicate"),
// icon: "clone",
// key: "inventory-widget-edit:duplicate",
// vm: this
// }
// ]
// });
this.$gzevent.$on("menu-click", clickHandler);
this.getDataFromApi();
@@ -436,8 +486,7 @@ export default {
};
</script>
<style>
</style>
<style></style>
/*
Sample widget record api v8