From f376187418325930268a40e812116cd8376523e9 Mon Sep 17 00:00:00 2001 From: John Cardinal Date: Thu, 29 Apr 2021 22:54:04 +0000 Subject: [PATCH] --- ayanova/src/App.vue | 29 +++++++++--- ayanova/src/api/gzmenu.js | 17 +++++++- ayanova/src/components/work-order-header.vue | 46 +++++++++----------- ayanova/src/views/inv-purchase-order.vue | 2 +- ayanova/src/views/login.vue | 13 +++--- ayanova/src/views/svc-workorder.vue | 2 +- 6 files changed, 68 insertions(+), 41 deletions(-) diff --git a/ayanova/src/App.vue b/ayanova/src/App.vue index 2be67470..4b26302b 100644 --- a/ayanova/src/App.vue +++ b/ayanova/src/App.vue @@ -137,16 +137,19 @@ - + - - {{ appBar.icon }}  - {{ $ay.t(appBar.title) }} + + {{ appBar.icon }} + {{ appBar.title }} @@ -383,6 +386,22 @@ export default { source: { type: String, default: null } }, methods: { + titleDisplay() { + //Allow for extra info in title + if (this.appBar.title == null) { + return null; + } + + if (this.appBar.title.includes(":")) { + const t = this.appBar.title.split(":"); + // if (this.$vuetify.breakpoint.smAndUp) { + // return this.$ay.t(t[0]) + " " + t[1]; + // } else { + return t[1] + " " + this.$ay.t(t[0]); + //} + } + return this.$ay.t(this.appBar.title); + }, afterLeave() { this.$root.$emit("triggerScroll"); }, diff --git a/ayanova/src/api/gzmenu.js b/ayanova/src/api/gzmenu.js index 29f9f458..66c19f46 100644 --- a/ayanova/src/api/gzmenu.js +++ b/ayanova/src/api/gzmenu.js @@ -1,5 +1,7 @@ /* xxxeslint-disable */ +import { VMain } from "vuetify/lib"; + ///////////////////////////////// // Menu utils and handlers // @@ -44,7 +46,8 @@ export default { vm.appBar.isMain = ctx.isMain; vm.appBar.icon = ctx.icon; - vm.appBar.title = ctx.title; + + vm.appBar.title = ""; //this prevents fou[translated]c vm.appBar.readOnly = ctx.readOnly; if (ctx.readOnly === true) { @@ -52,20 +55,30 @@ export default { } else { vm.appBar.color = ctx.isMain ? "primary" : "secondary"; } - let recordName = ""; + //ctx.title if set is a Translation key + //ctx.formData.recordName is the object name or serial number or whatever identifies it uniquely + let recordName = ""; if (ctx && ctx.formData && ctx.formData.recordName) { recordName = ctx.formData.recordName; } let hasRecordName = recordName != ""; if (ctx.title) { + //it has a title translation key if (hasRecordName) { + //recordname takes all precedence in AppBar in order to conserve space (narrow view etc) + //also it just looks cleaner, the icon is already there to indicate where the user is at + //vm.appBar.title = `${ctx.title}:${recordName}`; + vm.appBar.title = recordName; document.title = `${recordName} - ${vm.$ay.t(ctx.title)} AyaNova `; } else { + vm.appBar.title = ctx.title; document.title = `${vm.$ay.t(ctx.title)} ${recordName}`; } } else { if (hasRecordName) { + //not title but has record name + vm.appBar.title = recordName; document.title = `${recordName} AyaNova`; } else { document.title = "AyaNova"; diff --git a/ayanova/src/components/work-order-header.vue b/ayanova/src/components/work-order-header.vue index 345d06aa..e3554fa7 100644 --- a/ayanova/src/components/work-order-header.vue +++ b/ayanova/src/components/work-order-header.vue @@ -1,32 +1,26 @@