From 0963b665606cd7272a04d74b549490911f14f457 Mon Sep 17 00:00:00 2001 From: alexm Date: Wed, 23 Mar 2022 13:06:17 +0100 Subject: [PATCH 1/3] fix(worker_calendar): absence in holiday day --- modules/worker/front/calendar/index.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/modules/worker/front/calendar/index.js b/modules/worker/front/calendar/index.js index 92bad1f0f..9072f5149 100644 --- a/modules/worker/front/calendar/index.js +++ b/modules/worker/front/calendar/index.js @@ -198,7 +198,7 @@ class Controller extends Section { const event = this.events[stamp]; const calendar = $event.target.closest('vn-calendar').$ctrl; - if (event) { + if (event && event.absenceId) { if (event.type == this.absenceType.code) this.delete(calendar, day, event); else @@ -228,6 +228,7 @@ class Controller extends Section { this.repaintCanceller(() => this.refresh() .then(calendar.repaint()) + .then(() => this.repaint()) .then(() => this.getContractHolidays()) .then(() => this.getYearHolidays()) ); @@ -264,6 +265,7 @@ class Controller extends Section { this.repaintCanceller(() => this.refresh() .then(calendar.repaint()) + .then(() => this.repaint()) .then(() => this.getContractHolidays()) .then(() => this.getYearHolidays()) ); -- 2.40.1 From 254fee50364b7727720c96106def6eea86391bac Mon Sep 17 00:00:00 2001 From: alexm Date: Wed, 23 Mar 2022 14:02:48 +0100 Subject: [PATCH 2/3] feat(worker_calendar): repaint, fix front test and add fixtures --- db/dump/fixtures.sql | 12 ++++++++++++ modules/worker/front/calendar/index.js | 4 ++-- modules/worker/front/calendar/index.spec.js | 6 ++++-- 3 files changed, 18 insertions(+), 4 deletions(-) diff --git a/db/dump/fixtures.sql b/db/dump/fixtures.sql index 90ac5d69c..59fd4c235 100644 --- a/db/dump/fixtures.sql +++ b/db/dump/fixtures.sql @@ -2503,3 +2503,15 @@ INSERT INTO `vn`.`docuware` (`code`, `fileCabinetName`, `dialogName` , `find`) INSERT INTO `vn`.`docuwareConfig` (`url`) VALUES ('https://verdnatura.docuware.cloud/docuware/platform'); + +INSERT INTO `vn`.`calendarHolidaysName` (`id`, `name`) + VALUES + (1, 'dayOfIT'); + +INSERT INTO `vn`.`calendarHolidaysType` (`id`, `name`, `hexColour`) + VALUES + (1, 'test', 'E9AA01'); + +INSERT INTO `vn`.`calendarHolidays` (`id`, `calendarHolidaysTypeFk`, `dated`, `calendarHolidaysNameFk`, `workCenterFk`) + VALUES + (1, 1, CONCAT(YEAR(CURDATE()), '-12-09'), 1, 1); \ No newline at end of file diff --git a/modules/worker/front/calendar/index.js b/modules/worker/front/calendar/index.js index 9072f5149..95e1fc134 100644 --- a/modules/worker/front/calendar/index.js +++ b/modules/worker/front/calendar/index.js @@ -228,9 +228,9 @@ class Controller extends Section { this.repaintCanceller(() => this.refresh() .then(calendar.repaint()) - .then(() => this.repaint()) .then(() => this.getContractHolidays()) .then(() => this.getYearHolidays()) + .then(() => this.repaint()) ); }); } @@ -265,9 +265,9 @@ class Controller extends Section { this.repaintCanceller(() => this.refresh() .then(calendar.repaint()) - .then(() => this.repaint()) .then(() => this.getContractHolidays()) .then(() => this.getYearHolidays()) + .then(() => this.repaint()) ); }); } diff --git a/modules/worker/front/calendar/index.spec.js b/modules/worker/front/calendar/index.spec.js index 3d5775663..1da4066d9 100644 --- a/modules/worker/front/calendar/index.spec.js +++ b/modules/worker/front/calendar/index.spec.js @@ -191,7 +191,8 @@ describe('Worker', () => { const selectedDay = new Date(); const expectedEvent = { dated: selectedDay, - type: 'holiday' + type: 'holiday', + absenceId: 1 }; const $event = { target: { @@ -214,7 +215,8 @@ describe('Worker', () => { const selectedDay = new Date(); const expectedEvent = { dated: selectedDay, - type: 'leaveOfAbsence' + type: 'leaveOfAbsence', + absenceId: 1 }; const $event = { target: { -- 2.40.1 From f853696d03ba8b67c8f4b831fd287298d4ad6d0d Mon Sep 17 00:00:00 2001 From: alexm Date: Mon, 28 Mar 2022 13:59:39 +0200 Subject: [PATCH 3/3] change fixture name --- db/dump/fixtures.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/db/dump/fixtures.sql b/db/dump/fixtures.sql index dd1b76622..bc40658f2 100644 --- a/db/dump/fixtures.sql +++ b/db/dump/fixtures.sql @@ -2510,7 +2510,7 @@ INSERT INTO `vn`.`calendarHolidaysName` (`id`, `name`) INSERT INTO `vn`.`calendarHolidaysType` (`id`, `name`, `hexColour`) VALUES - (1, 'test', 'E9AA01'); + (1, 'National', '#4169E1'); INSERT INTO `vn`.`calendarHolidays` (`id`, `calendarHolidaysTypeFk`, `dated`, `calendarHolidaysNameFk`, `workCenterFk`) VALUES -- 2.40.1