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

@@ -13,7 +13,7 @@
transition="scale-transition"
class="multi-line"
outline
>{{formState.errorBoxMessage}}</v-alert>
>{{ formState.errorBoxMessage }}</v-alert>
</v-flex>
<v-flex xs12 sm6 lg4 xl3 px-2>
<v-text-field
@@ -23,8 +23,11 @@
@click:clear="onChange('name')"
:counter="255"
:label="this.$gzlocale.get('WidgetName')"
:rules="[this.$gzform.max255(this,'name'),this.$gzform.required(this,'name')]"
:error-messages="this.$gzform.serverErrors(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')"
></v-text-field>
@@ -37,8 +40,8 @@
@click:clear="onChange('serial')"
:counter="10"
:label="this.$gzlocale.get('WidgetSerial')"
:rules="[this.$gzform.maxLength(this,'serial',10)]"
:error-messages="this.$gzform.serverErrors(this,'serial')"
:rules="[this.$gzform.maxLength(this, 'serial', 10)]"
:error-messages="this.$gzform.serverErrors(this, 'serial')"
ref="serial"
@change="onChange('serial')"
></v-text-field>
@@ -52,8 +55,11 @@
:counter="10"
:label="this.$gzlocale.get('WidgetCount')"
ref="count"
:rules="[this.$gzform.integerValid(this,'count'),this.$gzform.required(this,'count')]"
:error-messages="this.$gzform.serverErrors(this,'count')"
:rules="[
this.$gzform.integerValid(this, 'count'),
this.$gzform.required(this, 'count')
]"
:error-messages="this.$gzform.serverErrors(this, 'count')"
required
@change="onChange('count')"
type="number"
@@ -68,8 +74,11 @@
:label="this.$gzlocale.get('WidgetDollarAmount')"
ref="dollarAmount"
required
:rules="[this.$gzform.decimalValid(this,'dollarAmount'),this.$gzform.required(this,'dollarAmount')]"
:error-messages="this.$gzform.serverErrors(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"
></v-text-field>
@@ -81,16 +90,18 @@
v-model="obj.startDate"
:readonly="this.formState.readOnly"
ref="startDate"
:error-messages="this.$gzform.serverErrors(this,'startDate')"
:error-messages="this.$gzform.serverErrors(this, 'startDate')"
@change="onChange('startDate')"
></gz-date-time-picker>
</v-flex>
<v-flex xs12 sm6 lg4 xl3 px-2>
<gz-date-time-picker
<gz-date-time-picker
:label="this.$gzlocale.get('WidgetEndDate')"
:rules="[this.$gzform.datePrecedence(this,'startDate','endDate')]"
:error-messages="this.$gzform.serverErrors(this,'endDate')"
:rules="[
this.$gzform.datePrecedence(this, 'startDate', 'endDate')
]"
:error-messages="this.$gzform.serverErrors(this, 'endDate')"
v-model="obj.endDate"
:readonly="this.formState.readOnly"
ref="endDate"
@@ -103,7 +114,7 @@
:readonly="this.formState.readOnly"
:label="this.$gzlocale.get('Active')"
ref="active"
:error-messages="this.$gzform.serverErrors(this,'active')"
:error-messages="this.$gzform.serverErrors(this, 'active')"
required
@change="onChange('active')"
></v-checkbox>
@@ -114,8 +125,11 @@
:readonly="this.formState.readOnly"
:label="this.$gzlocale.get('WidgetRoles')"
ref="roles"
:rules="[this.$gzform.integerValid(this,'roles'),this.$gzform.required(this,'roles')]"
:error-messages="this.$gzform.serverErrors(this,'roles')"
:rules="[
this.$gzform.integerValid(this, 'roles'),
this.$gzform.required(this, 'roles')
]"
:error-messages="this.$gzform.serverErrors(this, 'roles')"
required
@change="onChange('roles')"
type="number"
@@ -125,15 +139,15 @@
<v-layout align-left justify-center row wrap mt-5>
<v-flex xs6 sm4>
READY: {{formState.ready}}
READY: {{ formState.ready }}
<br>
LOADING: {{formState.loading}}
LOADING: {{ formState.loading }}
<br>
DIRTY: {{formState.dirty}}
DIRTY: {{ formState.dirty }}
<br>
VALID: {{formState.valid}}
VALID: {{ formState.valid }}
<br>
READONLY: {{formState.readOnly}}
READONLY: {{ formState.readOnly }}
<br>
</v-flex>
</v-layout>
@@ -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))
//.then(() => console.log("KEYS FETCHED"))
.then(function() {
vm.$gzevent.$emit("menu-change", {
isMain: false,
icon: "fa-splotch",
title: vm.$gzlocale.get("Widget"),
helpUrl: "intro/#searching",
menuItems: [
{
title: vm.$gzlocale.get("Save"),
icon: "save",
surface: true,
key: "inventory-widget-edit:save",
vm: vm
},
{
title: vm.$gzlocale.get("Delete"),
icon: "trash-alt",
surface: true,
key: "inventory-widget-edit:delete",
vm: vm
},
{ divider: true, inset: false },
{
title: vm.$gzlocale.get("Duplicate"),
icon: "clone",
key: "inventory-widget-edit:duplicate",
vm: vm
}
]
});
})
.then(() => (vm.formState.ready = true))
.catch(err => {
this.formState.ready = true;
vm.formState.ready = true;
vm.$gzHandleFormError(err);
});
},
created() {
this.$gzevent.$emit("menu-change", {
isMain: false,
icon: "fa-splotch",
title: this.$gzlocale.get("Widget"),
helpUrl: "intro/#searching",
//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
}
]
});
// 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