diff --git a/ayanova/src/api/dash-registry.js b/ayanova/src/api/dash-registry.js index 23272b20..f0a28a61 100644 --- a/ayanova/src/api/dash-registry.js +++ b/ayanova/src/api/dash-registry.js @@ -2,17 +2,12 @@ import authorizationroles from "./authorizationroles"; const role = authorizationroles.AUTHORIZATION_ROLES; export default { registry: [ - // { - // id: "TestListWidgetsPriciest", - // roles: [ - // role.BizAdmin, - // role.BizAdminRestricted, - // role.Sales, - // role.SalesRestricted - // ], - // title: "Priciest widgets (all time) ", - // type: "GzDashTestListWidgetsPriciest" - // }, + { + id: "dash-today-reminders-wo", + roles: [role.Tech, role.TechRestricted], + title: "ReminderList", + type: "GzDashTodayReminders" + }, { id: "dash-today-scheduled-wo", roles: [role.Tech, role.TechRestricted], @@ -20,6 +15,7 @@ export default { type: "GzDashTodayScheduledWo", scheduleableUserOnly: true }, + { id: "TestBarWidgetCountByUserType", roles: [ diff --git a/ayanova/src/components/dash-base.vue b/ayanova/src/components/dash-base.vue index ec10bd64..67917e9e 100644 --- a/ayanova/src/components/dash-base.vue +++ b/ayanova/src/components/dash-base.vue @@ -181,7 +181,7 @@ export default { } }, created() { - this.refresh(); + //this.refresh(); if (this.updateFrequency > 0) { this.timer = setInterval(() => { this.refresh(); diff --git a/ayanova/src/components/dash-today-reminders.vue b/ayanova/src/components/dash-today-reminders.vue new file mode 100644 index 00000000..d1e6355a --- /dev/null +++ b/ayanova/src/components/dash-today-reminders.vue @@ -0,0 +1,150 @@ + + diff --git a/ayanova/src/components/dash-today-scheduled-wo.vue b/ayanova/src/components/dash-today-scheduled-wo.vue index 610f92f8..62f34266 100644 --- a/ayanova/src/components/dash-today-scheduled-wo.vue +++ b/ayanova/src/components/dash-today-scheduled-wo.vue @@ -50,8 +50,6 @@ export default { }, data() { return { - obj: [], - initialized: false, events: [], errorMessage: null, timeZoneName: window.$gz.locale.getResolvedTimeZoneName(), @@ -64,6 +62,9 @@ export default { }; }, computed: {}, + async mounted() { + await this.getDataFromApi(); + }, methods: { getEventColor(event) { return event.color; @@ -78,14 +79,7 @@ export default { }, async getDataFromApi() { - //because dash base calls refresh before created can fire here - //need to init this way instead - if (!this.initialized) { - await initialize(this); - } - let now = new Date(); - //set now for the calendar to trigger a refresh //if this doesn't work then need to trigger the change event: https://vuetifyjs.com/en/api/v-calendar/#events this.now = now.toLocaleString("sv-SE", { @@ -107,7 +101,6 @@ export default { hours: -24 }), end: window.$gz.locale.addDurationToUTC8601String(now, { hours: 24 }), - wisuColorSource: this.formUserOptions.wisuColorSource, wisu: true, //workorder item scheduled user records reviews: false, reminders: false @@ -152,36 +145,4 @@ export default { } } }; - -async function initialize(vm) { - await fetchTranslatedText(); - await getFormUserOptions(vm); - vm.initialized = true; -} - -async function getFormUserOptions(vm) { - const res = await window.$gz.api.get(`form-user-options/home-schedule`); - if (res.error) { - vm.formState.serverError = res.error; - window.$gz.form.setErrorBoxErrors(vm); - } else { - if (res.data == null) { - //make a default - vm.formUserOptions = { - firstTime: "00:00", - excludeDaysOfWeek: 0, - wisuColorSource: "2", - wisu: true, - reviews: true, - reminders: true - }; - } else { - vm.formUserOptions = JSON.parse(res.data.options); - } - } -} - -async function fetchTranslatedText() { - await window.$gz.translation.cacheTranslations(["DashboardScheduled"]); -} diff --git a/ayanova/src/views/home-dashboard.vue b/ayanova/src/views/home-dashboard.vue index dba11efe..9c5336d8 100644 --- a/ayanova/src/views/home-dashboard.vue +++ b/ayanova/src/views/home-dashboard.vue @@ -80,13 +80,16 @@ import GzDashTestBarWidgetCountByUserType from "../components/dash-test-bar-widg import GzDashTestLineWidgetMonthlyTotalPrice from "../components/dash-test-line-widget-monthly-total-price.vue"; import GzDashTestDayCalendarWidget from "../components/dash-test-day-calendar-widget.vue"; import GzDashTodayScheduledWo from "../components/dash-today-scheduled-wo.vue"; +import GzDashTodayReminders from "../components/dash-today-reminders.vue"; + export default { components: { //GzDashTestListWidgetsPriciest, GzDashTestBarWidgetCountByUserType, GzDashTestLineWidgetMonthlyTotalPrice, GzDashTestDayCalendarWidget, - GzDashTodayScheduledWo + GzDashTodayScheduledWo, + GzDashTodayReminders }, data() { return {