re-factor / cleanup

This commit is contained in:
2022-01-11 22:08:38 +00:00
parent e871708b20
commit e0be8a7cfe
251 changed files with 14680 additions and 15693 deletions

View File

@@ -79,6 +79,7 @@
:event-more-text="$ay.t('More')"
:first-time="formUserOptions.firstTime"
:weekdays="weekdays"
event-overlap-mode="column"
@click:more="viewDay"
@click:date="viewDay"
@change="fetchEvents"
@@ -89,7 +90,6 @@
@mouseup:day="endDragExtend"
@mouseup:time="endDragExtend"
@mouseleave.native="cancelDrag"
event-overlap-mode="column"
>
<template v-slot:event="{ event, timed, eventSummary }">
<div class="v-event-draggable">
@@ -119,7 +119,7 @@
<!-- NEW ITEM DIALOG -->
<template>
<v-row justify="center">
<v-dialog max-width="360px" persistent v-model="newItemDialog">
<v-dialog v-model="newItemDialog" max-width="360px" persistent>
<v-card>
<v-card-title>{{ $ay.t("New") }}</v-card-title>
<v-card-text>
@@ -140,7 +140,7 @@
</v-col> -->
</v-card-text>
<v-card-actions>
<v-btn text @click="cancelAddNew" color="primary">{{
<v-btn text color="primary" @click="cancelAddNew">{{
$ay.t("Cancel")
}}</v-btn>
</v-card-actions>
@@ -151,7 +151,7 @@
<!-- MORE INFO DIALOG -->
<template>
<v-row justify="center">
<v-dialog max-width="600px" v-model="moreInfoDialog">
<v-dialog v-model="moreInfoDialog" max-width="600px">
<v-card>
<v-toolbar>
<v-btn icon @click="openScheduledItem()">
@@ -214,14 +214,14 @@
>$ayiFlag</v-icon
>
<v-icon
color="primary"
v-if="evInfo.wostatuslocked"
color="primary"
class="ml-4"
>$ayiLock</v-icon
>
<v-icon
color="primary"
v-if="evInfo.wostatuscompleted"
color="primary"
class="ml-4"
>$ayiCheckCircle</v-icon
>
@@ -277,23 +277,23 @@
<template>
<!-- ############## SETTINGS DIALOG #################-->
<v-row justify="center">
<v-dialog max-width="600px" v-model="settingsDialog">
<v-dialog v-model="settingsDialog" max-width="600px">
<v-card>
<v-card-title>{{ $ay.t("ScheduleOptions") }} </v-card-title>
<v-card-text>
<v-row no-gutters>
<v-col cols="12" class="mt-2">
<gz-time-picker
:label="$ay.t('ScheduleFirstHour')"
v-model="tempFirstTime"
:label="$ay.t('ScheduleFirstHour')"
></gz-time-picker>
</v-col>
<v-col cols="12">
<GZDaysOfWeek
:label="$ay.t('ExcludeDaysOfWeek')"
v-model="formUserOptions.excludeDaysOfWeek"
ref="daysofweek"
v-model="formUserOptions.excludeDaysOfWeek"
:label="$ay.t('ExcludeDaysOfWeek')"
></GZDaysOfWeek>
</v-col>
@@ -343,15 +343,15 @@
</v-row>
</v-card-text>
<v-card-actions>
<v-btn text @click="settingsDialog = false" color="primary">{{
<v-btn text color="primary" @click="settingsDialog = false">{{
$ay.t("Cancel")
}}</v-btn>
<v-spacer v-if="issmAndUp"></v-spacer>
<v-btn
color="primary"
text
@click="saveUserOptions()"
class="ml-4"
@click="saveUserOptions()"
>{{ $ay.t("Save") }}</v-btn
>
</v-card-actions>
@@ -368,25 +368,6 @@ export default {
components: {
GZDaysOfWeek
},
async created() {
const vm = this;
try {
this.userId = vm.$route.params.recordid;
this.userName = vm.$route.params.name;
await initForm(vm);
window.$gz.eventBus.$on("menu-click", clickHandler);
//----------------------------
generateMenu(vm);
} catch (error) {
window.$gz.errorHandler.handleFormError(error, vm);
} finally {
vm.formState.ready = true;
}
},
beforeDestroy() {
saveFormSettings(this);
window.$gz.eventBus.$off("menu-click", clickHandler);
},
data() {
return {
focus: "",
@@ -427,6 +408,39 @@ export default {
userName: null
};
},
computed: {
weekdays() {
return window.$gz.util.DaysOfWeekToWeekdays(
this.formUserOptions.excludeDaysOfWeek
);
},
isXS() {
//console.log(this.$vuetify.breakpoint);
return this.$vuetify.breakpoint.xs;
},
issmAndUp() {
return this.$vuetify.breakpoint.smAndUp;
}
},
async created() {
const vm = this;
try {
this.userId = vm.$route.params.recordid;
this.userName = vm.$route.params.name;
await initForm(vm);
window.$gz.eventBus.$on("menu-click", clickHandler);
//----------------------------
generateMenu(vm);
} catch (error) {
window.$gz.errorHandler.handleFormError(error, vm);
} finally {
vm.formState.ready = true;
}
},
beforeDestroy() {
saveFormSettings(this);
window.$gz.eventBus.$off("menu-click", clickHandler);
},
methods: {
async refresh() {
await this.fetchEvents({ start: null, end: null });
@@ -539,7 +553,6 @@ export default {
if (res.error) {
this.formState.serverError = res.error;
window.$gz.form.setErrorBoxErrors(this);
} else {
}
} catch (error) {
window.$gz.errorHandler.handleFormError(error, this);
@@ -829,20 +842,6 @@ export default {
await this.refresh();
}
//eom
},
computed: {
weekdays() {
return window.$gz.util.DaysOfWeekToWeekdays(
this.formUserOptions.excludeDaysOfWeek
);
},
isXS() {
//console.log(this.$vuetify.breakpoint);
return this.$vuetify.breakpoint.xs;
},
issmAndUp() {
return this.$vuetify.breakpoint.smAndUp;
}
}
};
@@ -989,7 +988,7 @@ function generateMenu(vm) {
//
//
async function initForm(vm) {
await fetchTranslatedText(vm);
await fetchTranslatedText();
getFormSettings(vm);
await getFormUserOptions(vm);
}
@@ -1074,7 +1073,7 @@ async function saveFormUserOptions(vm) {
//
// Ensures UI translated text is available
//
async function fetchTranslatedText(vm) {
async function fetchTranslatedText() {
await window.$gz.translation.cacheTranslations([
"DateRangeToday",
"ExcludeDaysOfWeek",