re-factor / cleanup
This commit is contained in:
@@ -7,8 +7,8 @@
|
||||
text
|
||||
:small="isXS"
|
||||
:large="issmAndUp"
|
||||
@click="setToday"
|
||||
data-cy="btnTodaySvcSchedule"
|
||||
@click="setToday"
|
||||
>
|
||||
{{ $ay.t("DateRangeToday") }}
|
||||
</v-btn>
|
||||
@@ -32,13 +32,13 @@
|
||||
<v-spacer v-if="issmAndUp"></v-spacer>
|
||||
<template v-if="issmAndUp">
|
||||
<gz-tag-picker
|
||||
v-model="tags"
|
||||
class="mr-3"
|
||||
:place-holder="$ay.t('FilterUsers')"
|
||||
prepend-inner-icon="$ayiFilter"
|
||||
clearable
|
||||
no-label
|
||||
select-only
|
||||
v-model="tags"
|
||||
@input="refresh"
|
||||
></gz-tag-picker>
|
||||
</template>
|
||||
@@ -94,8 +94,8 @@
|
||||
<v-sheet :height="calendarHeight">
|
||||
<v-calendar
|
||||
ref="calendar"
|
||||
data-cy="calendar"
|
||||
v-model="focus"
|
||||
data-cy="calendar"
|
||||
color="primary"
|
||||
:events="events"
|
||||
:event-color="getEventColor"
|
||||
@@ -104,6 +104,11 @@
|
||||
:event-more-text="$ay.t('More')"
|
||||
:first-time="formUserOptions.firstTime"
|
||||
:weekdays="weekdays"
|
||||
event-overlap-mode="column"
|
||||
category-show-all
|
||||
:categories="categories"
|
||||
category-text="name"
|
||||
category-for-invalid="NOT VALID"
|
||||
@click:more="viewDay"
|
||||
@click:date="viewDay"
|
||||
@change="fetchEvents"
|
||||
@@ -118,14 +123,9 @@
|
||||
@mouseup:time="endDragExtend"
|
||||
@mouseup:time-category="endDragExtend"
|
||||
@mouseleave.native="cancelDrag"
|
||||
event-overlap-mode="column"
|
||||
category-show-all
|
||||
:categories="categories"
|
||||
category-text="name"
|
||||
category-for-invalid="NOT VALID"
|
||||
>
|
||||
<template v-slot:category="{ category }">
|
||||
<div @click="openUserSchedule(category)" class="text-center">
|
||||
<div class="text-center" @click="openUserSchedule(category)">
|
||||
<v-btn text class="text-none">{{ category.name }}</v-btn>
|
||||
</div>
|
||||
</template>
|
||||
@@ -154,7 +154,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>
|
||||
@@ -169,7 +169,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>
|
||||
@@ -180,7 +180,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()">
|
||||
@@ -241,14 +241,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
|
||||
>
|
||||
@@ -301,7 +301,7 @@
|
||||
<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>
|
||||
@@ -309,27 +309,27 @@
|
||||
<template v-if="isXS">
|
||||
<v-col cols="12">
|
||||
<gz-tag-picker
|
||||
v-model="tags"
|
||||
:label="$ay.t('FilterUsers')"
|
||||
prepend-inner-icon="$ayiFilter"
|
||||
clearable
|
||||
select-only
|
||||
v-model="tags"
|
||||
@input="refresh"
|
||||
></gz-tag-picker>
|
||||
</v-col>
|
||||
</template>
|
||||
<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>
|
||||
|
||||
@@ -358,15 +358,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>
|
||||
@@ -383,23 +383,6 @@ export default {
|
||||
components: {
|
||||
GZDaysOfWeek
|
||||
},
|
||||
async created() {
|
||||
const vm = this;
|
||||
try {
|
||||
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: "",
|
||||
@@ -440,6 +423,36 @@ export default {
|
||||
lastEnd: null
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
weekdays() {
|
||||
return window.$gz.util.DaysOfWeekToWeekdays(
|
||||
this.formUserOptions.excludeDaysOfWeek
|
||||
);
|
||||
},
|
||||
isXS() {
|
||||
return this.$vuetify.breakpoint.xs;
|
||||
},
|
||||
issmAndUp() {
|
||||
return this.$vuetify.breakpoint.smAndUp;
|
||||
}
|
||||
},
|
||||
async created() {
|
||||
const vm = this;
|
||||
try {
|
||||
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 });
|
||||
@@ -588,7 +601,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);
|
||||
@@ -907,19 +919,6 @@ export default {
|
||||
await this.refresh();
|
||||
}
|
||||
//eom
|
||||
},
|
||||
computed: {
|
||||
weekdays() {
|
||||
return window.$gz.util.DaysOfWeekToWeekdays(
|
||||
this.formUserOptions.excludeDaysOfWeek
|
||||
);
|
||||
},
|
||||
isXS() {
|
||||
return this.$vuetify.breakpoint.xs;
|
||||
},
|
||||
issmAndUp() {
|
||||
return this.$vuetify.breakpoint.smAndUp;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user