diff --git a/ayanova/src/api/dash-registry.js b/ayanova/src/api/dash-registry.js index 9eebe3f6..bee0d97a 100644 --- a/ayanova/src/api/dash-registry.js +++ b/ayanova/src/api/dash-registry.js @@ -16,7 +16,7 @@ export default { { id: "NextSchedItems", roles: [role.Tech, role.TechRestricted], - title: "TEST sched user widget", + title: "DashboardScheduled", type: "NextSchedItems", scheduleableUserOnly: true }, @@ -74,5 +74,9 @@ export default { } } return ret; + }, + async cacheTranslationsForAvailableItems() { + const items = this.availableItems(); + await window.$gz.translation.cacheTranslations(items.map(z => z.title)); } }; diff --git a/ayanova/src/api/locale.js b/ayanova/src/api/locale.js index ef9f22eb..7c171fe0 100644 --- a/ayanova/src/api/locale.js +++ b/ayanova/src/api/locale.js @@ -414,7 +414,12 @@ export default { //https://moment.github.io/luxon/api-docs/index.html#datetimeplus // addDurationToUTC8601String(val, duration) { - if (!val || val == "" || duration == null || !this.isObject(duration)) { + if ( + !val || + val == "" || + duration == null || + !typeof duration === "object" + ) { return val; } //instantiate a luxon date object from val which is assumed to be an iso string diff --git a/ayanova/src/components/dash-scheduser-next-wo.vue b/ayanova/src/components/dash-scheduser-next-wo.vue index 6d43e2e6..513448e9 100644 --- a/ayanova/src/components/dash-scheduser-next-wo.vue +++ b/ayanova/src/components/dash-scheduser-next-wo.vue @@ -1,33 +1,48 @@ diff --git a/ayanova/src/views/home-dashboard.vue b/ayanova/src/views/home-dashboard.vue index 247d622a..f5a759d2 100644 --- a/ayanova/src/views/home-dashboard.vue +++ b/ayanova/src/views/home-dashboard.vue @@ -24,7 +24,7 @@ :key="item.id" @click="addItem(item)" > - {{ item.title }} + {{ $ay.t(item.title) }} @@ -114,27 +114,10 @@ export default { }, async created() { const vm = this; - //------------------ - //Test ui feedback mechanisms here: - //this.formState.errorBoxMessage = "This is a test crlf\r\nOnly a test lf\nEot"; - // await window.$gz.dialog.displayLTModalNotificationMessage( - // "ViewServerConfiguration", - // "Dashboard", - // "success", - // "https://www.ayanova.com/subscriptionexpired.htm" - // ); - - // window.$gz.eventBus.$emit( - // "notify-error", - // "This is a test crlf\r\nOnly a test lf\nEot", - // "https://www.ayanova.com/subscriptionexpired.htm" - // ); - //------------------------ try { - //keeping in case need later for some localized text or something - // await initForm(vm); - + console.log("abouty to cache"); + await DashRegistry.cacheTranslationsForAvailableItems(); //users have full rights to their dashboard config vm.rights = window.$gz.role.fullRightsObject(); vm.formState.readOnly = false;