From 5fe758cebe09ba24dd18b0c2985b44d0f6304bb5 Mon Sep 17 00:00:00 2001 From: John Cardinal Date: Tue, 5 Oct 2021 00:47:17 +0000 Subject: [PATCH] exclude days added to home-schedule now to port to svc-schedule --- ayanova/devdocs/todo.txt | 51 ++++++++++----------------- ayanova/src/api/gzutil.js | 54 +++++++++++++++++++++++++++++ ayanova/src/views/home-schedule.vue | 23 ++++++++++++ 3 files changed, 96 insertions(+), 32 deletions(-) diff --git a/ayanova/devdocs/todo.txt b/ayanova/devdocs/todo.txt index c31b0a91..5e0e6ab5 100644 --- a/ayanova/devdocs/todo.txt +++ b/ayanova/devdocs/todo.txt @@ -13,42 +13,29 @@ # Schedule form - SVC-SCHEDULE - Needs backing route - present techs desired and order to fetch - show each in own category - categories filled in from user setttings - display as name but backed by id in case name changes - category key in return data == user id / name + SVC-SCHEDULE OUTSTANDING ITEMS + + Forgot to add hide days option in settings and support in view + need for home schedule AND svc schedule, do this one first before anything else + + need tech selection setting control + 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 schedule settings keyed by form re-use 3698 - hide unassigned tech slot (or case 3697 above would take care of that too) - Issues in svc-schedule - day or category view once moreinfo then subsequent drags or extend causes moreinfo again, something isn't being cleared out on moreinfo I think - click event and drag stepping on each other - 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? - - + 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) + this will solve issue when people say "Why can't I view month but for one user instead?" + 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) + 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) "show all " but on a schedule to view that way instead of a data table diff --git a/ayanova/src/api/gzutil.js b/ayanova/src/api/gzutil.js index 229bac4c..9f69c9af 100644 --- a/ayanova/src/api/gzutil.js +++ b/ayanova/src/api/gzutil.js @@ -911,6 +911,60 @@ export default { `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; } /** diff --git a/ayanova/src/views/home-schedule.vue b/ayanova/src/views/home-schedule.vue index 3e248cc5..cdbb1ce6 100644 --- a/ayanova/src/views/home-schedule.vue +++ b/ayanova/src/views/home-schedule.vue @@ -67,6 +67,7 @@ :locale="languageName" :event-more-text="$ay.t('More')" :first-time="formUserOptions.firstTime" + :weekdays="weekdays" @click:more="viewDay" @click:date="viewDay" @change="fetchEvents" @@ -333,6 +334,7 @@