exclude days added to home-schedule now to port to svc-schedule

This commit is contained in:
2021-10-05 00:47:17 +00:00
parent 23167cf6dc
commit 5fe758cebe
3 changed files with 96 additions and 32 deletions

View File

@@ -13,41 +13,28 @@
# Schedule form # Schedule form
SVC-SCHEDULE SVC-SCHEDULE OUTSTANDING ITEMS
Needs backing route
present techs desired and order to fetch Forgot to add hide days option in settings and support in view
show each in own category need for home schedule AND svc schedule, do this one first before anything else
categories filled in from user setttings
display as name but backed by id in case name changes need tech selection setting control
category key in return data == user id / name vertical in table in settings
show all techs in table with prior selections in order at the top and non selected at the end in alpha order
each row has up down control and checkbox to show so "Name|^|v|show"
Remove day view options and replace by category view I think, but keep code and see how it goes may be switch back in again if demanded or makes sense
instead of new translation key, just use the day name but use it with the category view
need ability to drag to another tech in category view
3697 - arbitrarily order schedule by user instead of built in by lastname 3697 - arbitrarily order schedule by user instead of built in by lastname
schedule settings keyed by form re-use schedule settings keyed by form re-use
3698 - hide unassigned tech slot (or case 3697 above would take care of that too) 3698 - hide unassigned tech slot (or case 3697 above would take care of that too)
Issues in svc-schedule View schedule by user so can click through user to schedule for *that* user alone, (brings up home-schedule maybe or I guess a copy would be easiest)
day or category view once moreinfo then subsequent drags or extend causes moreinfo again, something isn't being cleared out on moreinfo I think this will solve issue when people say "Why can't I view month but for one user instead?"
click event and drag stepping on each other probably easiest from both the User edit form for admin and from the svc-schedule form (maybe a link on their names at top?? Opens same view currently selected but for that *one* user)
potential solution:
dont' use event click at all, use enddrag extend which fires on mouse up of event
this can check and then do moreinfo as it's already handling dragging
see if it detects non vs drag and do accordingly?
Start drag and end drag should handle it all
TODO:
Layer on the functionality, start with drag and move to extend, new and more info
the fewer events used the easier can cleaner it will be
on event mousedown capture time or mouse coords
on event mouseup check if too little time or too short distance occured to be a drag and process as showmore else it's a drag
On mouse up or down outside event then it's a new event
Attempt is not saving anything, but does point to solution so modify prior code
don't use event click, use the mouseup event instead
dont' use the timer, port the isitaclick stuff instead
Use dialog for moreinfo
should there be a day view at all in svc sched?
3766 - view schedule filtered by customer so can see at a glance all past and future for a single customer (more data table filter similarity) 3766 - view schedule filtered by customer so can see at a glance all past and future for a single customer (more data table filter similarity)

View File

@@ -911,6 +911,60 @@ export default {
`gzutil->calendarViewtoAyaNovaEnum - Unknown view type '${view}'` `gzutil->calendarViewtoAyaNovaEnum - Unknown view type '${view}'`
); );
} }
},
///////////////////////////////////////////////
// GZDaysOfWeek to VCalendar weekdays
//
//
DaysOfWeekToWeekdays: function(dow) {
/*
AyaDaysOfWeek
Monday = 1,
Tuesday = 2,
Wednesday = 4,
Thursday = 8,
Friday = 16,
Saturday = 32,
Sunday = 64
vCalendar [
0,//sunday
1,
2,
3,
4,
5,
6//saturday
]
*/
if (dow == null || dow == 0) {
return [0, 1, 2, 3, 4, 5, 6]; //all the days
}
const ret = [];
//turn EXCLUDE selected gzDaysOfWeek into INCLUDE selected days for vCalendar
if (!!!(dow & 64)) {
ret.push(0);
}
if (!!!(dow & 1)) {
ret.push(1);
}
if (!!!(dow & 2)) {
ret.push(2);
}
if (!!!(dow & 4)) {
ret.push(3);
}
if (!!!(dow & 8)) {
ret.push(4);
}
if (!!!(dow & 16)) {
ret.push(5);
}
if (!!!(dow & 32)) {
ret.push(6);
}
return ret;
} }
/** /**

View File

@@ -67,6 +67,7 @@
:locale="languageName" :locale="languageName"
:event-more-text="$ay.t('More')" :event-more-text="$ay.t('More')"
:first-time="formUserOptions.firstTime" :first-time="formUserOptions.firstTime"
:weekdays="weekdays"
@click:more="viewDay" @click:more="viewDay"
@click:date="viewDay" @click:date="viewDay"
@change="fetchEvents" @change="fetchEvents"
@@ -333,6 +334,7 @@
</template> </template>
</v-sheet> </v-sheet>
<template> <template>
<!-- SETTINGS DIALOG -->
<v-row justify="center"> <v-row justify="center">
<v-dialog max-width="600px" v-model="settingsDialog"> <v-dialog max-width="600px" v-model="settingsDialog">
<v-card> <v-card>
@@ -345,6 +347,14 @@
v-model="tempFirstTime" v-model="tempFirstTime"
></gz-time-picker> ></gz-time-picker>
</v-col> </v-col>
<v-col cols="12">
<GZDaysOfWeek
:label="$ay.t('ExcludeDaysOfWeek')"
v-model="formUserOptions.excludeDaysOfWeek"
ref="daysofweek"
></GZDaysOfWeek>
</v-col>
<span class="text-h6 mt-3">{{ <span class="text-h6 mt-3">{{
$ay.t("ScheduleShowTypes") $ay.t("ScheduleShowTypes")
}}</span> }}</span>
@@ -411,7 +421,11 @@
</template> </template>
<script> <script>
const FORM_KEY = "home-schedule"; const FORM_KEY = "home-schedule";
import GZDaysOfWeek from "../components/days-of-week-control.vue";
export default { export default {
components: {
GZDaysOfWeek
},
async created() { async created() {
const vm = this; const vm = this;
try { try {
@@ -851,6 +865,13 @@ export default {
window.location.reload(); window.location.reload();
} }
//eom //eom
},
computed: {
weekdays() {
return window.$gz.util.DaysOfWeekToWeekdays(
this.formUserOptions.excludeDaysOfWeek
);
}
} }
}; };
@@ -1029,6 +1050,7 @@ async function getFormUserOptions(vm) {
//make a default //make a default
vm.formUserOptions = { vm.formUserOptions = {
firstTime: "00:00", firstTime: "00:00",
excludeDaysOfWeek: 0,
wisuColorSource: "2", wisuColorSource: "2",
wisu: true, wisu: true,
reviews: true, reviews: true,
@@ -1079,6 +1101,7 @@ async function saveFormUserOptions(vm) {
async function fetchTranslatedText(vm) { async function fetchTranslatedText(vm) {
await window.$gz.translation.cacheTranslations([ await window.$gz.translation.cacheTranslations([
"DateRangeToday", "DateRangeToday",
"ExcludeDaysOfWeek",
"ScheduleMonth", "ScheduleMonth",
"ScheduleDay", "ScheduleDay",
"ScheduleWeek", "ScheduleWeek",