From cda7a6e3fd6d83664aa45333bffe64bc171b09f6 Mon Sep 17 00:00:00 2001 From: vicent Date: Tue, 7 Feb 2023 15:01:33 +0100 Subject: [PATCH 01/23] fix: no mostraba los numeros de la semana al inicio --- front/core/components/calendar/index.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/front/core/components/calendar/index.js b/front/core/components/calendar/index.js index 17ccbf041..12d1757ae 100644 --- a/front/core/components/calendar/index.js +++ b/front/core/components/calendar/index.js @@ -15,9 +15,9 @@ export default class Calendar extends FormInput { constructor($element, $scope, vnWeekDays, moment) { super($element, $scope); this.weekDays = vnWeekDays.locales; - this.defaultDate = Date.vnNew(); this.displayControls = true; this.moment = moment; + this.defaultDate = Date.vnNew(); } /** @@ -38,6 +38,7 @@ export default class Calendar extends FormInput { this._defaultDate = value; this.month = value.getMonth(); + console.log('Llega'); this.repaint(); } -- 2.40.1 From be539a54cea7a7ebf900c0020d9090ebbed1c0a1 Mon Sep 17 00:00:00 2001 From: vicent Date: Wed, 8 Feb 2023 09:31:03 +0100 Subject: [PATCH 02/23] delete console.log --- front/core/components/calendar/index.js | 1 - 1 file changed, 1 deletion(-) diff --git a/front/core/components/calendar/index.js b/front/core/components/calendar/index.js index 12d1757ae..263a95313 100644 --- a/front/core/components/calendar/index.js +++ b/front/core/components/calendar/index.js @@ -38,7 +38,6 @@ export default class Calendar extends FormInput { this._defaultDate = value; this.month = value.getMonth(); - console.log('Llega'); this.repaint(); } -- 2.40.1 From c8c48ea175ad569fd53345bfc3367d012e0e7cf9 Mon Sep 17 00:00:00 2001 From: vicent Date: Tue, 21 Feb 2023 15:16:28 +0100 Subject: [PATCH 03/23] feat: colorar numeros de semanas segun el registro de horas --- front/core/components/calendar/index.html | 4 +-- front/core/components/calendar/index.js | 24 +++++++++----- modules/worker/front/calendar/index.html | 16 +++++----- modules/worker/front/time-control/index.html | 29 ++++++++--------- modules/worker/front/time-control/index.js | 33 ++++++++++++++++++++ 5 files changed, 75 insertions(+), 31 deletions(-) diff --git a/front/core/components/calendar/index.html b/front/core/components/calendar/index.html index 086fe4338..4d02f9ec0 100644 --- a/front/core/components/calendar/index.html +++ b/front/core/components/calendar/index.html @@ -24,7 +24,7 @@
{{::day.localeChar}}
@@ -57,4 +57,4 @@
- \ No newline at end of file + diff --git a/front/core/components/calendar/index.js b/front/core/components/calendar/index.js index 263a95313..0e39267a7 100644 --- a/front/core/components/calendar/index.js +++ b/front/core/components/calendar/index.js @@ -207,14 +207,23 @@ export default class Calendar extends FormInput { } repeatLast() { - if (!this.formatDay) return; + if (this.formatDay) { + const days = this.element.querySelectorAll('.days > .day'); + for (let i = 0; i < days.length; i++) { + this.formatDay({ + $day: this.days[i], + $element: days[i] + }); + } + } - let days = this.element.querySelectorAll('.days > .day'); - for (let i = 0; i < days.length; i++) { - this.formatDay({ - $day: this.days[i], - $element: days[i] - }); + if (this.formatWeek) { + const weeks = this.element.querySelectorAll('.weeks > .day'); + for (const week of weeks) { + this.formatWeek({ + $element: week + }); + } } } } @@ -228,6 +237,7 @@ ngModule.vnComponent('vnCalendar', { hasEvents: '&?', getClass: '&?', formatDay: '&?', + formatWeek: '&?', displayControls: '
{{'Contract' | translate}} #{{$ctrl.businessId}}
- {{'Used' | translate}} {{$ctrl.contractHolidays.holidaysEnjoyed || 0}} + {{'Used' | translate}} {{$ctrl.contractHolidays.holidaysEnjoyed || 0}} {{'of' | translate}} {{$ctrl.contractHolidays.totalHolidays || 0}} {{'days' | translate}}
- {{'Spent' | translate}} {{$ctrl.contractHolidays.hoursEnjoyed || 0}} + {{'Spent' | translate}} {{$ctrl.contractHolidays.hoursEnjoyed || 0}} {{'of' | translate}} {{$ctrl.contractHolidays.totalHours || 0}} {{'hours' | translate}}
@@ -40,11 +40,11 @@
{{'Year' | translate}} {{$ctrl.year}}
- {{'Used' | translate}} {{$ctrl.yearHolidays.holidaysEnjoyed || 0}} + {{'Used' | translate}} {{$ctrl.yearHolidays.holidaysEnjoyed || 0}} {{'of' | translate}} {{$ctrl.yearHolidays.totalHolidays || 0}} {{'days' | translate}}
- {{'Spent' | translate}} {{$ctrl.yearHolidays.hoursEnjoyed || 0}} + {{'Spent' | translate}} {{$ctrl.yearHolidays.hoursEnjoyed || 0}} {{'of' | translate}} {{$ctrl.yearHolidays.totalHours || 0}} {{'hours' | translate}}
@@ -66,7 +66,7 @@ order="businessFk DESC" limit="5"> -
#{{businessFk}}
+
#{{businessFk}}
{{started | date: 'dd/MM/yyyy'}} - {{ended ? (ended | date: 'dd/MM/yyyy') : 'Indef.'}}
@@ -87,17 +87,17 @@ - Festive + Festive - Current day + Current day
- diff --git a/modules/worker/front/time-control/index.html b/modules/worker/front/time-control/index.html index 681d420d0..0f6a99d36 100644 --- a/modules/worker/front/time-control/index.html +++ b/modules/worker/front/time-control/index.html @@ -1,7 +1,7 @@ @@ -16,7 +16,7 @@ {{::weekday.dated | date: 'MMMM'}} - - + - - + - - +
Hours
- -
@@ -106,6 +106,7 @@ vn-id="calendar" class="vn-pt-md" ng-model="$ctrl.date" + format-week="$ctrl.formatWeek($element)" has-events="$ctrl.hasEvents($day)">
@@ -177,4 +178,4 @@ - \ No newline at end of file + diff --git a/modules/worker/front/time-control/index.js b/modules/worker/front/time-control/index.js index f7379fea0..1126ac1e3 100644 --- a/modules/worker/front/time-control/index.js +++ b/modules/worker/front/time-control/index.js @@ -345,6 +345,39 @@ class Controller extends Section { this.vnApp.showError(this.$t(e.message)); } } + + formatWeek($element) { + let weekNumber = $element.firstElementChild; + let weekNumberValue = $element.firstElementChild.innerHTML; + console.log(weekNumberValue); + const filter = { + where: { + workerFk: 9, + // year: this.date.getFullYear(), + // week: weekNumberValue - 1 + } + }; + // const filter = { + // where: { + // and: [ + // {workerFk: parseInt(this.$params.id)}, + // {year: this.date.getFullYear()}, + // {week: weekNumberValue - 1} + // ] + // } + // }; + console.log(filter); + this.$http.get('WorkerTimeControlMails', {filter}) + .then(res => { + console.log(res.data.state); + const state = res.data.state; + if (state == 'CONFIRMED') weekNumber.style.color = '#97B92F'; + else if (state == 'REVISE') weekNumber.style.color = '#FF4444'; + else weekNumber.style.color = '#5151c0'; + // weekNumber.title = event.name; + // weekNumber.style.backgroundColor = event.color; + }); + } } Controller.$inject = ['$element', '$scope', 'vnWeekDays']; -- 2.40.1 From 05d91ed50ebb8d5c39356571ebd6faa0deaaf1c7 Mon Sep 17 00:00:00 2001 From: vicent Date: Wed, 22 Feb 2023 15:12:25 +0100 Subject: [PATCH 04/23] feat: actualizada interfaz --- .../updateWorkerTimeControlMail.js | 2 - modules/worker/front/time-control/index.html | 14 +++- modules/worker/front/time-control/index.js | 74 ++++++++++++++----- .../worker/front/time-control/locale/es.yml | 4 +- modules/worker/front/time-control/style.scss | 12 ++- 5 files changed, 82 insertions(+), 24 deletions(-) diff --git a/modules/worker/back/methods/worker-time-control/updateWorkerTimeControlMail.js b/modules/worker/back/methods/worker-time-control/updateWorkerTimeControlMail.js index a8dc14bb1..dced6487b 100644 --- a/modules/worker/back/methods/worker-time-control/updateWorkerTimeControlMail.js +++ b/modules/worker/back/methods/worker-time-control/updateWorkerTimeControlMail.js @@ -60,8 +60,6 @@ module.exports = Self => { const oldState = workerTimeControlMail.state; const oldReason = workerTimeControlMail.reason; - if (oldState == args.state) throw new UserError('Already has this status'); - await workerTimeControlMail.updateAttributes({ state: args.state, reason: args.reason || null diff --git a/modules/worker/front/time-control/index.html b/modules/worker/front/time-control/index.html index 0f6a99d36..937e9a581 100644 --- a/modules/worker/front/time-control/index.html +++ b/modules/worker/front/time-control/index.html @@ -78,15 +78,27 @@ - + + + + + diff --git a/modules/worker/front/time-control/index.js b/modules/worker/front/time-control/index.js index 1126ac1e3..33a300ac7 100644 --- a/modules/worker/front/time-control/index.js +++ b/modules/worker/front/time-control/index.js @@ -294,11 +294,15 @@ class Controller extends Section { this.$.editEntry.show($event); } - getWeekNumber(currentDate) { - const startDate = new Date(currentDate.getFullYear(), 0, 1); - let days = Math.floor((currentDate - startDate) / - (24 * 60 * 60 * 1000)); - return Math.ceil(days / 7); + getWeekNumber(date) { + const tempDate = new Date(date); + let dayOfWeek = tempDate.getDay(); + dayOfWeek = (dayOfWeek === 0) ? 7 : dayOfWeek; + const firstDayOfWeek = new Date(tempDate.getFullYear(), tempDate.getMonth(), tempDate.getDate() - (dayOfWeek - 1)); + const firstDayOfYear = new Date(tempDate.getFullYear(), 0, 1); + const differenceInMilliseconds = firstDayOfWeek.getTime() - firstDayOfYear.getTime(); + const weekNumber = Math.floor(differenceInMilliseconds / (1000 * 60 * 60 * 24 * 7)) + 1; + return weekNumber - 1; } isSatisfied() { @@ -312,6 +316,7 @@ class Controller extends Section { const query = `WorkerTimeControls/updateWorkerTimeControlMail`; this.$http.post(query, params).then(() => { this.vnApp.showSuccess(this.$t('Data saved!')); + this.$state.reload(); }); } @@ -327,6 +332,7 @@ class Controller extends Section { const query = `WorkerTimeControls/updateWorkerTimeControlMail`; this.$http.post(query, params).then(() => { this.vnApp.showSuccess(this.$t('Data saved!')); + this.$state.reload(); }); } @@ -348,13 +354,12 @@ class Controller extends Section { formatWeek($element) { let weekNumber = $element.firstElementChild; - let weekNumberValue = $element.firstElementChild.innerHTML; - console.log(weekNumberValue); + let weekNumberValue = $element.firstElementChild.innerHTML - 1; const filter = { where: { - workerFk: 9, - // year: this.date.getFullYear(), - // week: weekNumberValue - 1 + workerFk: this.$params.id, + year: this.date.getFullYear(), + week: weekNumberValue } }; // const filter = { @@ -366,18 +371,51 @@ class Controller extends Section { // ] // } // }; - console.log(filter); - this.$http.get('WorkerTimeControlMails', {filter}) + this.$http.get('WorkerTimeControlMails/findOne', {filter}) .then(res => { - console.log(res.data.state); const state = res.data.state; - if (state == 'CONFIRMED') weekNumber.style.color = '#97B92F'; - else if (state == 'REVISE') weekNumber.style.color = '#FF4444'; - else weekNumber.style.color = '#5151c0'; - // weekNumber.title = event.name; - // weekNumber.style.backgroundColor = event.color; + const currentWeekNumber = this.getWeekNumber(this.date); + if (currentWeekNumber == weekNumberValue) { + this.state = state; + this.reason = res.data.reason; + console.log(currentWeekNumber, weekNumberValue, this.state, this.reason); + } + if (state == 'CONFIRMED') { + weekNumber.classList.add('confirmed'); + weekNumber.setAttribute('vn-tooltip', 'Conforme'); + } + if (state == 'REVISE') weekNumber.style.color = '#FF4444'; + if (state == 'SENDED') weekNumber.style.color = '#E65F00'; }); } + + resendEmail() { + const filter = { + where: {userFk: this.$params.id}, + }; + this.$http.get('EmailUsers/findOne', {filter}) + .then(res => { + const timestamp = this.date.getTime() / 1000; + const url = `${window.location.origin}/#!/worker/${this.$params.id}/time-control?timestamp=${timestamp}`; + const weekNumber = this.getWeekNumber(this.date); + + const params = { + recipient: res.data.email, + week: weekNumber + 1, + year: this.date.getFullYear(), + url: url, + }; + this.$http.post(`WorkerTimeControls/weekly-hour-hecord-email`, params) + .then(res => { + this.vnApp.showSuccess(this.$t('Email sended')); + }); + }); + } + + getTime(timeString) { + const [hours, minutes, seconds] = timeString.split(':'); + return [parseInt(hours), parseInt(minutes), parseInt(seconds)]; + } } Controller.$inject = ['$element', '$scope', 'vnWeekDays']; diff --git a/modules/worker/front/time-control/locale/es.yml b/modules/worker/front/time-control/locale/es.yml index 2a3bffc00..2f9234738 100644 --- a/modules/worker/front/time-control/locale/es.yml +++ b/modules/worker/front/time-control/locale/es.yml @@ -13,4 +13,6 @@ Entry removed: Fichada borrada The entry type can't be empty: El tipo de fichada no puede quedar vacía Satisfied: Conforme Not satisfied: No conforme -Reason: Motivo \ No newline at end of file +Reason: Motivo +Resend: Reenviar +Email sended: Email enviado diff --git a/modules/worker/front/time-control/style.scss b/modules/worker/front/time-control/style.scss index 6a46921a7..d39f8418b 100644 --- a/modules/worker/front/time-control/style.scss +++ b/modules/worker/front/time-control/style.scss @@ -14,7 +14,7 @@ vn-worker-time-control { align-items: center; justify-content: center; padding: 4px 0; - + & > vn-icon { color: $color-font-secondary; padding-right: 1px; @@ -28,4 +28,12 @@ vn-worker-time-control { .edit-time-entry { width: 200px -} \ No newline at end of file +} + +.right { + float: right; + } + +.confirmed { + color: #97B92F; +} -- 2.40.1 From 35b47c6da2247241ddd51ca3e0abee637a77584a Mon Sep 17 00:00:00 2001 From: vicent Date: Thu, 23 Feb 2023 08:21:59 +0100 Subject: [PATCH 05/23] refactor code --- modules/worker/front/time-control/index.html | 3 +- modules/worker/front/time-control/index.js | 48 ++++++++++---------- 2 files changed, 26 insertions(+), 25 deletions(-) diff --git a/modules/worker/front/time-control/index.html b/modules/worker/front/time-control/index.html index 937e9a581..0b6c01ea5 100644 --- a/modules/worker/front/time-control/index.html +++ b/modules/worker/front/time-control/index.html @@ -97,7 +97,8 @@ + class="right" + ng-show="::$ctrl.isHr"> diff --git a/modules/worker/front/time-control/index.js b/modules/worker/front/time-control/index.js index 33a300ac7..1fadb93f5 100644 --- a/modules/worker/front/time-control/index.js +++ b/modules/worker/front/time-control/index.js @@ -26,10 +26,22 @@ class Controller extends Section { this.date = initialDate; } + get isHr() { + return this.aclService.hasAny(['hr']); + } + get worker() { return this._worker; } + get weekNumber() { + return this.getWeekNumber(this.date); + } + + set weekNumber(value) { + this._weekNumber = value; + } + set worker(value) { this._worker = value; } @@ -306,11 +318,10 @@ class Controller extends Section { } isSatisfied() { - const weekNumber = this.getWeekNumber(this.date); const params = { workerId: this.worker.id, year: this.date.getFullYear(), - week: weekNumber, + week: this.weekNumber, state: 'CONFIRMED' }; const query = `WorkerTimeControls/updateWorkerTimeControlMail`; @@ -321,11 +332,10 @@ class Controller extends Section { } isUnsatisfied() { - const weekNumber = this.getWeekNumber(this.date); const params = { workerId: this.worker.id, year: this.date.getFullYear(), - week: weekNumber, + week: this.weekNumber, state: 'REVISE', reason: this.reason }; @@ -374,11 +384,9 @@ class Controller extends Section { this.$http.get('WorkerTimeControlMails/findOne', {filter}) .then(res => { const state = res.data.state; - const currentWeekNumber = this.getWeekNumber(this.date); - if (currentWeekNumber == weekNumberValue) { + if (this.weekNumber == weekNumberValue) { this.state = state; this.reason = res.data.reason; - console.log(currentWeekNumber, weekNumberValue, this.state, this.reason); } if (state == 'CONFIRMED') { weekNumber.classList.add('confirmed'); @@ -390,25 +398,17 @@ class Controller extends Section { } resendEmail() { - const filter = { - where: {userFk: this.$params.id}, + const timestamp = this.date.getTime() / 1000; + const url = `${window.location.origin}/#!/worker/${this.worker.id}/time-control?timestamp=${timestamp}`; + const params = { + recipient: this.worker.user.emailUser.email, + week: this.weekNumber + 1, + year: this.date.getFullYear(), + url: url, }; - this.$http.get('EmailUsers/findOne', {filter}) + this.$http.post(`WorkerTimeControls/weekly-hour-hecord-email`, params) .then(res => { - const timestamp = this.date.getTime() / 1000; - const url = `${window.location.origin}/#!/worker/${this.$params.id}/time-control?timestamp=${timestamp}`; - const weekNumber = this.getWeekNumber(this.date); - - const params = { - recipient: res.data.email, - week: weekNumber + 1, - year: this.date.getFullYear(), - url: url, - }; - this.$http.post(`WorkerTimeControls/weekly-hour-hecord-email`, params) - .then(res => { - this.vnApp.showSuccess(this.$t('Email sended')); - }); + this.vnApp.showSuccess(this.$t('Email sended')); }); } -- 2.40.1 From 9310e92223d5d0b8c0e77371e72deb0e25c87585 Mon Sep 17 00:00:00 2001 From: vicent Date: Thu, 23 Feb 2023 10:44:08 +0100 Subject: [PATCH 06/23] refactor --- modules/worker/front/time-control/index.js | 32 +++++++++++--------- modules/worker/front/time-control/style.scss | 10 +++++- 2 files changed, 26 insertions(+), 16 deletions(-) diff --git a/modules/worker/front/time-control/index.js b/modules/worker/front/time-control/index.js index 1fadb93f5..e064044eb 100644 --- a/modules/worker/front/time-control/index.js +++ b/modules/worker/front/time-control/index.js @@ -372,28 +372,30 @@ class Controller extends Section { week: weekNumberValue } }; - // const filter = { - // where: { - // and: [ - // {workerFk: parseInt(this.$params.id)}, - // {year: this.date.getFullYear()}, - // {week: weekNumberValue - 1} - // ] - // } - // }; - this.$http.get('WorkerTimeControlMails/findOne', {filter}) + + this.$http.get('WorkerTimeControlMails', {filter}) .then(res => { - const state = res.data.state; + const [data] = res.data; + if (!data) return; + + const state = data.state; if (this.weekNumber == weekNumberValue) { this.state = state; - this.reason = res.data.reason; + this.reason = data.reason; } + if (state == 'CONFIRMED') { weekNumber.classList.add('confirmed'); - weekNumber.setAttribute('vn-tooltip', 'Conforme'); + weekNumber.setAttribute('title', 'Conforme'); + } + if (state == 'REVISE') { + weekNumber.classList.add('revise'); + weekNumber.setAttribute('title', 'No conforme'); + } + if (state == 'SENDED') { + weekNumber.classList.add('sended'); + weekNumber.setAttribute('title', 'Pendiente'); } - if (state == 'REVISE') weekNumber.style.color = '#FF4444'; - if (state == 'SENDED') weekNumber.style.color = '#E65F00'; }); } diff --git a/modules/worker/front/time-control/style.scss b/modules/worker/front/time-control/style.scss index d39f8418b..000a3b144 100644 --- a/modules/worker/front/time-control/style.scss +++ b/modules/worker/front/time-control/style.scss @@ -35,5 +35,13 @@ vn-worker-time-control { } .confirmed { - color: #97B92F; + color: #97B92F; +} + +.revise { + color: #f61e1e; +} + +.sended { + color: #d19b25; } -- 2.40.1 From 475bc2c255d800c5f1455e5df32f9766bf1ec747 Mon Sep 17 00:00:00 2001 From: vicent Date: Thu, 23 Feb 2023 14:33:16 +0100 Subject: [PATCH 07/23] feat: solo puede dar conforme/no confome el propio usuario --- .../worker-time-control/updateWorkerTimeControlMail.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/modules/worker/back/methods/worker-time-control/updateWorkerTimeControlMail.js b/modules/worker/back/methods/worker-time-control/updateWorkerTimeControlMail.js index dced6487b..642ff90d2 100644 --- a/modules/worker/back/methods/worker-time-control/updateWorkerTimeControlMail.js +++ b/modules/worker/back/methods/worker-time-control/updateWorkerTimeControlMail.js @@ -47,6 +47,10 @@ module.exports = Self => { if (typeof options == 'object') Object.assign(myOptions, options); + const isHimself = userId == args.workerId; + if (!isHimself) + throw new UserError(`You don't have enough privileges`); + const workerTimeControlMail = await models.WorkerTimeControlMail.findOne({ where: { workerFk: args.workerId, -- 2.40.1 From 9b11987d7562ebf4a13b641bc11236d01c21b544 Mon Sep 17 00:00:00 2001 From: vicent Date: Thu, 23 Feb 2023 14:33:38 +0100 Subject: [PATCH 08/23] feat: desaparecen los botones para las semanas que no tienen registros --- modules/worker/front/time-control/index.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/modules/worker/front/time-control/index.js b/modules/worker/front/time-control/index.js index e064044eb..24ae483d6 100644 --- a/modules/worker/front/time-control/index.js +++ b/modules/worker/front/time-control/index.js @@ -376,7 +376,10 @@ class Controller extends Section { this.$http.get('WorkerTimeControlMails', {filter}) .then(res => { const [data] = res.data; - if (!data) return; + if (!data) { + if (this.weekNumber == weekNumberValue) this.state = null; + return; + } const state = data.state; if (this.weekNumber == weekNumberValue) { -- 2.40.1 From 30517687818651dc9df71c3383f24cd80e46d8ee Mon Sep 17 00:00:00 2001 From: vicent Date: Wed, 1 Mar 2023 14:50:23 +0100 Subject: [PATCH 09/23] WIP: 9b11987d7 feat: desaparecen los botones para las semanas que no tienen registros --- db/changes/230801/00-acl_time.sql | 3 + modules/worker/back/models/time.json | 3 + modules/worker/front/time-control/index.js | 165 ++++++++++++++++----- 3 files changed, 135 insertions(+), 36 deletions(-) create mode 100644 db/changes/230801/00-acl_time.sql diff --git a/db/changes/230801/00-acl_time.sql b/db/changes/230801/00-acl_time.sql new file mode 100644 index 000000000..9ef73d409 --- /dev/null +++ b/db/changes/230801/00-acl_time.sql @@ -0,0 +1,3 @@ +INSERT INTO `salix`.`ACL` (`model`, `property`, `accessType`, `permission`, `principalType`, `principalId`) + VALUES + ('Time', '*', '*', 'ALLOW', 'ROLE', 'employee'); diff --git a/modules/worker/back/models/time.json b/modules/worker/back/models/time.json index df9257540..e2f1161d7 100644 --- a/modules/worker/back/models/time.json +++ b/modules/worker/back/models/time.json @@ -14,6 +14,9 @@ "year": { "type": "number" }, + "month": { + "type": "number" + }, "week": { "type": "number" } diff --git a/modules/worker/front/time-control/index.js b/modules/worker/front/time-control/index.js index 24ae483d6..3726243cf 100644 --- a/modules/worker/front/time-control/index.js +++ b/modules/worker/front/time-control/index.js @@ -24,6 +24,97 @@ class Controller extends Section { } this.date = initialDate; + + const filterTime = { + fields: ['week'], + where: { + month: this.date.getMonth() + 1, + year: this.date.getFullYear() + } + }; + this.$http.get('Times', {filter: filterTime}) + .then(res => { + const weeks = res.data.map(time => time.week); + const weekNumbersSet = new Set(weeks); + const weekNumbers = Array.from(weekNumbersSet); + + const filter = { + where: { + workerFk: this.$params.id, + year: this.date.getFullYear(), + week: {inq: weekNumbers} + } + }; + this.$http.get('WorkerTimeControlMails', {filter}) + .then(res => { + const workerTimeControlMails = res.data; + console.log(workerTimeControlMails); + for (const workerTimeControlMail of workerTimeControlMails) { + // const [data] = res.data; + // if (!data) { + // if (this.weekNumber == weekNumberValue) this.state = null; + // return; + // } + + const state = workerTimeControlMail.state; + + console.log(workerTimeControlMail.week, this.weekNumberValue); + if (workerTimeControlMail.week == this.weekNumberValue) { + this.state = state; + this.reason = workerTimeControlMail.reason; + } + if (state == 'CONFIRMED') { + this.weekNumberHTML.classList.add('confirmed'); + this.weekNumberHTML.setAttribute('title', 'Conforme'); + } + if (state == 'REVISE') { + this.weekNumberHTML.classList.add('revise'); + this.weekNumberHTML.setAttribute('title', 'No conforme'); + } + if (state == 'SENDED') { + this.weekNumberHTML.classList.add('sended'); + this.weekNumberHTML.setAttribute('title', 'Pendiente'); + } + } + }); + }); + + // console.log(this.weekNumbers); + // const filter = { + // where: { + // workerFk: this.$params.id, + // year: this.date.getFullYear(), + // week: {inq: this.weekNumbers} + // } + // }; + // this.$http.get('WorkerTimeControlMails', {filter}) + // .then(res => { + // console.log(res.data); + // // const [data] = res.data; + // // if (!data) { + // // if (this.weekNumber == weekNumberValue) this.state = null; + // // return; + // // } + + // // const state = data.state; + // // if (this.weekNumber == weekNumberValue) { + // // this.state = state; + // // this.reason = data.reason; + // // } + + // // if (state == 'CONFIRMED') { + // // weekNumber.classList.add('confirmed'); + // // weekNumber.setAttribute('title', 'Conforme'); + // // } + // // if (state == 'REVISE') { + // // weekNumber.classList.add('revise'); + // // weekNumber.setAttribute('title', 'No conforme'); + // // } + // // if (state == 'SENDED') { + // // weekNumber.classList.add('sended'); + // // weekNumber.setAttribute('title', 'Pendiente'); + // // } + // }); } get isHr() { @@ -314,7 +405,7 @@ class Controller extends Section { const firstDayOfYear = new Date(tempDate.getFullYear(), 0, 1); const differenceInMilliseconds = firstDayOfWeek.getTime() - firstDayOfYear.getTime(); const weekNumber = Math.floor(differenceInMilliseconds / (1000 * 60 * 60 * 24 * 7)) + 1; - return weekNumber - 1; + return weekNumber; } isSatisfied() { @@ -363,43 +454,45 @@ class Controller extends Section { } formatWeek($element) { - let weekNumber = $element.firstElementChild; - let weekNumberValue = $element.firstElementChild.innerHTML - 1; - const filter = { - where: { - workerFk: this.$params.id, - year: this.date.getFullYear(), - week: weekNumberValue - } - }; + this.weekNumberHTML = $element.firstElementChild; + console.log(this.weekNumberHTML); + this.weekNumberValue = $element.firstElementChild.innerHTML; - this.$http.get('WorkerTimeControlMails', {filter}) - .then(res => { - const [data] = res.data; - if (!data) { - if (this.weekNumber == weekNumberValue) this.state = null; - return; - } + // const filter = { + // where: { + // workerFk: this.$params.id, + // year: this.date.getFullYear(), + // week: weekNumberValue + // } + // }; - const state = data.state; - if (this.weekNumber == weekNumberValue) { - this.state = state; - this.reason = data.reason; - } + // this.$http.get('WorkerTimeControlMails', {filter}) + // .then(res => { + // const [data] = res.data; + // if (!data) { + // if (this.weekNumber == weekNumberValue) this.state = null; + // return; + // } - if (state == 'CONFIRMED') { - weekNumber.classList.add('confirmed'); - weekNumber.setAttribute('title', 'Conforme'); - } - if (state == 'REVISE') { - weekNumber.classList.add('revise'); - weekNumber.setAttribute('title', 'No conforme'); - } - if (state == 'SENDED') { - weekNumber.classList.add('sended'); - weekNumber.setAttribute('title', 'Pendiente'); - } - }); + // const state = data.state; + // if (this.weekNumber == weekNumberValue) { + // this.state = state; + // this.reason = data.reason; + // } + + // if (state == 'CONFIRMED') { + // weekNumber.classList.add('confirmed'); + // weekNumber.setAttribute('title', 'Conforme'); + // } + // if (state == 'REVISE') { + // weekNumber.classList.add('revise'); + // weekNumber.setAttribute('title', 'No conforme'); + // } + // if (state == 'SENDED') { + // weekNumber.classList.add('sended'); + // weekNumber.setAttribute('title', 'Pendiente'); + // } + // }); } resendEmail() { @@ -407,7 +500,7 @@ class Controller extends Section { const url = `${window.location.origin}/#!/worker/${this.worker.id}/time-control?timestamp=${timestamp}`; const params = { recipient: this.worker.user.emailUser.email, - week: this.weekNumber + 1, + week: this.weekNumber, year: this.date.getFullYear(), url: url, }; -- 2.40.1 From 7c24b940b3a78af24c0862f19a582c2f0108c92f Mon Sep 17 00:00:00 2001 From: vicent Date: Thu, 2 Mar 2023 14:55:18 +0100 Subject: [PATCH 10/23] feat: colorea los numeros de la semana al inicio y cada vez que canvias de mes --- front/core/components/calendar/index.js | 3 + loopback/locale/es.json | 12 +- modules/worker/front/time-control/index.html | 40 ++- modules/worker/front/time-control/index.js | 241 ++++++++---------- .../worker/front/time-control/locale/es.yml | 4 + modules/worker/front/time-control/style.scss | 5 + 6 files changed, 155 insertions(+), 150 deletions(-) diff --git a/front/core/components/calendar/index.js b/front/core/components/calendar/index.js index 0e39267a7..58b15896e 100644 --- a/front/core/components/calendar/index.js +++ b/front/core/components/calendar/index.js @@ -159,6 +159,8 @@ export default class Calendar extends FormInput { this.repaint(); this.emit('move', {$date: date}); + + this.getStates({$day: date}); } /* @@ -235,6 +237,7 @@ ngModule.vnComponent('vnCalendar', { bindings: { defaultDate: '=?', hasEvents: '&?', + getStates: '&?', getClass: '&?', formatDay: '&?', formatWeek: '&?', diff --git a/loopback/locale/es.json b/loopback/locale/es.json index 10db9a54f..d3b1ab71b 100644 --- a/loopback/locale/es.json +++ b/loopback/locale/es.json @@ -259,11 +259,11 @@ "Aplicación bloqueada por el usuario 9": "Aplicación bloqueada por el usuario 9", "Failed to upload file": "Error al subir archivo", "The DOCUWARE PDF document does not exists": "El documento PDF Docuware no existe", - "It is not possible to modify tracked sales": "No es posible modificar líneas de pedido que se hayan empezado a preparar", - "It is not possible to modify sales that their articles are from Floramondo": "No es posible modificar líneas de pedido cuyos artículos sean de Floramondo", - "It is not possible to modify cloned sales": "No es posible modificar líneas de pedido clonadas", + "It is not possible to modify tracked sales": "No es posible modificar líneas de pedido que se hayan empezado a preparar", + "It is not possible to modify sales that their articles are from Floramondo": "No es posible modificar líneas de pedido cuyos artículos sean de Floramondo", + "It is not possible to modify cloned sales": "No es posible modificar líneas de pedido clonadas", "A supplier with the same name already exists. Change the country.": "Un proveedor con el mismo nombre ya existe. Cambie el país.", "There is no assigned email for this client": "No hay correo asignado para este cliente", - "This locker has already been assigned": "Esta taquilla ya ha sido asignada" -} - + "This locker has already been assigned": "Esta taquilla ya ha sido asignada", + "You must indicate the reason": "You must indicate the reason" +} \ No newline at end of file diff --git a/modules/worker/front/time-control/index.html b/modules/worker/front/time-control/index.html index 0b6c01ea5..7585c7c5e 100644 --- a/modules/worker/front/time-control/index.html +++ b/modules/worker/front/time-control/index.html @@ -78,26 +78,29 @@ - + @@ -120,6 +123,7 @@ class="vn-pt-md" ng-model="$ctrl.date" format-week="$ctrl.formatWeek($element)" + get-states="$ctrl.getStates($day)" has-events="$ctrl.hasEvents($day)"> @@ -180,15 +184,31 @@ vn-id="reason" on-accept="$ctrl.isUnsatisfied()"> - - +
+ + +
- + + + + + Are you sure you want to send it? + + + + + + diff --git a/modules/worker/front/time-control/index.js b/modules/worker/front/time-control/index.js index 3726243cf..b6ff06200 100644 --- a/modules/worker/front/time-control/index.js +++ b/modules/worker/front/time-control/index.js @@ -1,6 +1,7 @@ import ngModule from '../module'; import Section from 'salix/components/section'; import './style.scss'; +import UserError from 'core/lib/user-error'; class Controller extends Section { constructor($element, $, vnWeekDays) { @@ -25,102 +26,18 @@ class Controller extends Section { this.date = initialDate; - const filterTime = { - fields: ['week'], - where: { - month: this.date.getMonth() + 1, - year: this.date.getFullYear() - } - }; - this.$http.get('Times', {filter: filterTime}) - .then(res => { - const weeks = res.data.map(time => time.week); - const weekNumbersSet = new Set(weeks); - const weekNumbers = Array.from(weekNumbersSet); - - const filter = { - where: { - workerFk: this.$params.id, - year: this.date.getFullYear(), - week: {inq: weekNumbers} - } - }; - this.$http.get('WorkerTimeControlMails', {filter}) - .then(res => { - const workerTimeControlMails = res.data; - console.log(workerTimeControlMails); - for (const workerTimeControlMail of workerTimeControlMails) { - // const [data] = res.data; - // if (!data) { - // if (this.weekNumber == weekNumberValue) this.state = null; - // return; - // } - - const state = workerTimeControlMail.state; - - console.log(workerTimeControlMail.week, this.weekNumberValue); - if (workerTimeControlMail.week == this.weekNumberValue) { - this.state = state; - this.reason = workerTimeControlMail.reason; - } - if (state == 'CONFIRMED') { - this.weekNumberHTML.classList.add('confirmed'); - this.weekNumberHTML.setAttribute('title', 'Conforme'); - } - if (state == 'REVISE') { - this.weekNumberHTML.classList.add('revise'); - this.weekNumberHTML.setAttribute('title', 'No conforme'); - } - if (state == 'SENDED') { - this.weekNumberHTML.classList.add('sended'); - this.weekNumberHTML.setAttribute('title', 'Pendiente'); - } - } - }); - }); - - // console.log(this.weekNumbers); - // const filter = { - // where: { - // workerFk: this.$params.id, - // year: this.date.getFullYear(), - // week: {inq: this.weekNumbers} - // } - // }; - // this.$http.get('WorkerTimeControlMails', {filter}) - // .then(res => { - // console.log(res.data); - // // const [data] = res.data; - // // if (!data) { - // // if (this.weekNumber == weekNumberValue) this.state = null; - // // return; - // // } - - // // const state = data.state; - // // if (this.weekNumber == weekNumberValue) { - // // this.state = state; - // // this.reason = data.reason; - // // } - - // // if (state == 'CONFIRMED') { - // // weekNumber.classList.add('confirmed'); - // // weekNumber.setAttribute('title', 'Conforme'); - // // } - // // if (state == 'REVISE') { - // // weekNumber.classList.add('revise'); - // // weekNumber.setAttribute('title', 'No conforme'); - // // } - // // if (state == 'SENDED') { - // // weekNumber.classList.add('sended'); - // // weekNumber.setAttribute('title', 'Pendiente'); - // // } - // }); + this.getStates(this.date); } get isHr() { return this.aclService.hasAny(['hr']); } + get isHimSelf() { + const userId = window.localStorage.currentUserWorkerId; + return userId == this.$params.id; + } + get worker() { return this._worker; } @@ -171,6 +88,27 @@ class Controller extends Section { } this.fetchHours(); + this.getWeekData(); + } + + getWeekData() { + const filter = { + where: { + workerFk: this.$params.id, + year: this._date.getFullYear(), + week: this.getWeekNumber(this._date) + } + }; + this.$http.get('WorkerTimeControlMails', {filter}) + .then(res => { + const [workerTimeControlMail] = res.data; + if (!workerTimeControlMail) { + this.state = null; + return; + } + this.state = workerTimeControlMail.state; + this.reason = workerTimeControlMail.reason; + }); } /** @@ -417,12 +355,15 @@ class Controller extends Section { }; const query = `WorkerTimeControls/updateWorkerTimeControlMail`; this.$http.post(query, params).then(() => { + this.getStates(this.date); + this.getWeekData(); this.vnApp.showSuccess(this.$t('Data saved!')); - this.$state.reload(); }); } isUnsatisfied() { + if (!this.reason) throw new UserError(`You must indicate a reason`); + const params = { workerId: this.worker.id, year: this.date.getFullYear(), @@ -432,11 +373,18 @@ class Controller extends Section { }; const query = `WorkerTimeControls/updateWorkerTimeControlMail`; this.$http.post(query, params).then(() => { + this.getStates(this.date); + this.getWeekData(); this.vnApp.showSuccess(this.$t('Data saved!')); - this.$state.reload(); }); } + changeState(state, reason) { + this.state = state; + this.reason = reason; + this.repaint(); + } + save() { try { const entry = this.selectedRow; @@ -453,48 +401,6 @@ class Controller extends Section { } } - formatWeek($element) { - this.weekNumberHTML = $element.firstElementChild; - console.log(this.weekNumberHTML); - this.weekNumberValue = $element.firstElementChild.innerHTML; - - // const filter = { - // where: { - // workerFk: this.$params.id, - // year: this.date.getFullYear(), - // week: weekNumberValue - // } - // }; - - // this.$http.get('WorkerTimeControlMails', {filter}) - // .then(res => { - // const [data] = res.data; - // if (!data) { - // if (this.weekNumber == weekNumberValue) this.state = null; - // return; - // } - - // const state = data.state; - // if (this.weekNumber == weekNumberValue) { - // this.state = state; - // this.reason = data.reason; - // } - - // if (state == 'CONFIRMED') { - // weekNumber.classList.add('confirmed'); - // weekNumber.setAttribute('title', 'Conforme'); - // } - // if (state == 'REVISE') { - // weekNumber.classList.add('revise'); - // weekNumber.setAttribute('title', 'No conforme'); - // } - // if (state == 'SENDED') { - // weekNumber.classList.add('sended'); - // weekNumber.setAttribute('title', 'Pendiente'); - // } - // }); - } - resendEmail() { const timestamp = this.date.getTime() / 1000; const url = `${window.location.origin}/#!/worker/${this.worker.id}/time-control?timestamp=${timestamp}`; @@ -514,6 +420,73 @@ class Controller extends Section { const [hours, minutes, seconds] = timeString.split(':'); return [parseInt(hours), parseInt(minutes), parseInt(seconds)]; } + + getStates(day) { + const filterTime = { + fields: ['week'], + where: { + month: day.getMonth() + 1, + year: day.getFullYear() + } + }; + this.$http.get('Times', {filter: filterTime}) + .then(res => { + const weeks = res.data.map(time => time.week); + const weekNumbersSet = new Set(weeks); + const weekNumbers = Array.from(weekNumbersSet); + + const filter = { + where: { + workerFk: this.$params.id, + year: day.getFullYear(), + week: {inq: weekNumbers} + } + }; + this.$http.get('WorkerTimeControlMails', {filter}) + .then(res => { + this.workerTimeControlMails = res.data; + this.repaint(); + }); + }); + } + + formatWeek($element) { + const weekNumberHTML = $element.firstElementChild; + const weekNumberValue = weekNumberHTML.innerHTML; + + if (!this.workerTimeControlMails) return; + const workerTimeControlMail = this.workerTimeControlMails.find( + workerTimeControlMail => workerTimeControlMail.week == weekNumberValue + ); + + if (!workerTimeControlMail) return; + const state = workerTimeControlMail.state; + + if (state == 'CONFIRMED') { + weekNumberHTML.classList.remove('revise'); + weekNumberHTML.classList.remove('sended'); + + weekNumberHTML.classList.add('confirmed'); + weekNumberHTML.setAttribute('title', 'Conforme'); + } + if (state == 'REVISE') { + weekNumberHTML.classList.remove('confirmed'); + weekNumberHTML.classList.remove('sended'); + + weekNumberHTML.classList.add('revise'); + weekNumberHTML.setAttribute('title', 'No conforme'); + } + if (state == 'SENDED') { + weekNumberHTML.classList.add('sended'); + weekNumberHTML.setAttribute('title', 'Pendiente'); + } + } + + repaint() { + let calendars = this.element.querySelectorAll('vn-calendar'); + for (let calendar of calendars) + calendar.$ctrl.repaint(); + } } Controller.$inject = ['$element', '$scope', 'vnWeekDays']; diff --git a/modules/worker/front/time-control/locale/es.yml b/modules/worker/front/time-control/locale/es.yml index 2f9234738..091c01baa 100644 --- a/modules/worker/front/time-control/locale/es.yml +++ b/modules/worker/front/time-control/locale/es.yml @@ -16,3 +16,7 @@ Not satisfied: No conforme Reason: Motivo Resend: Reenviar Email sended: Email enviado +You must indicate a reason: Debes indicar un motivo +Send time control email: Enviar email control horario +Are you sure you want to send it?: ¿Seguro que quieres enviarlo? +Resend email of this week to the user: Reenviar email de esta semana al usuario diff --git a/modules/worker/front/time-control/style.scss b/modules/worker/front/time-control/style.scss index 000a3b144..9d7545aaf 100644 --- a/modules/worker/front/time-control/style.scss +++ b/modules/worker/front/time-control/style.scss @@ -24,6 +24,11 @@ vn-worker-time-control { .totalBox { max-width: none } + +} + +.reasonDialog{ + min-width: 500px; } .edit-time-entry { -- 2.40.1 From a98bb59479c0ec5825a2c127e5c0ab1daefe0373 Mon Sep 17 00:00:00 2001 From: vicent Date: Mon, 6 Mar 2023 12:47:49 +0100 Subject: [PATCH 11/23] fix: test front --- front/core/components/calendar/index.spec.js | 5 +++++ modules/worker/front/time-control/index.spec.js | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/front/core/components/calendar/index.spec.js b/front/core/components/calendar/index.spec.js index c4ad6f14b..eff5a2d2d 100644 --- a/front/core/components/calendar/index.spec.js +++ b/front/core/components/calendar/index.spec.js @@ -24,10 +24,13 @@ describe('Component vnCalendar', () => { let nextMonth = new Date(date.getTime()); nextMonth.setMonth(nextMonth.getMonth() + 1); + controller.getStates = jasmine.createSpy(controller, 'getStates'); + controller.moveNext(); expect(controller.month).toEqual(nextMonth.getMonth()); expect(controller.emit).toHaveBeenCalledWith('move', {$date: nextMonth}); + expect(controller.getStates).toHaveBeenCalledWith({$day: nextMonth}); }); }); @@ -37,6 +40,8 @@ describe('Component vnCalendar', () => { let previousMonth = new Date(date.getTime()); previousMonth.setMonth(previousMonth.getMonth() - 1); + controller.getStates = jasmine.createSpy(controller, 'getStates'); + controller.movePrevious(); expect(controller.month).toEqual(previousMonth.getMonth()); diff --git a/modules/worker/front/time-control/index.spec.js b/modules/worker/front/time-control/index.spec.js index b68162d39..7c572c81c 100644 --- a/modules/worker/front/time-control/index.spec.js +++ b/modules/worker/front/time-control/index.spec.js @@ -96,8 +96,8 @@ describe('Component vnWorkerTimeControl', () => { ended.setDate(ended.getDate() + 6); controller.ended = ended; + $httpBackend.expect('GET', `WorkerTimeControlMails`).respond({data: {state: 'SENDED'}}); controller.getWorkedHours(controller.started, controller.ended); - $httpBackend.flush(); expect(controller.weekDays.length).toEqual(7); -- 2.40.1 From 78721e7ffa662a914698a4452516b9483ce4cfe3 Mon Sep 17 00:00:00 2001 From: vicent Date: Wed, 8 Mar 2023 09:50:47 +0100 Subject: [PATCH 12/23] feat: add fixtures --- db/dump/fixtures.sql | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/db/dump/fixtures.sql b/db/dump/fixtures.sql index 5af9b9eeb..34df5060a 100644 --- a/db/dump/fixtures.sql +++ b/db/dump/fixtures.sql @@ -2817,4 +2817,11 @@ INSERT INTO `vn`.`deviceProductionUser` (`deviceProductionFk`, `userFk`, `create (1, 1, util.VN_NOW()), (3, 3, util.VN_NOW()); +INSERT INTO `vn`.`workerTimeControlMail` (`id`, `workerFk`, `year`, `week`, `state`, `updated`, `sendedCounter`, `reason`) + VALUES + (1, 9, 2000, 49, 'REVISE', util.VN_NOW(), 1, 'test2'), + (2, 9, 2000, 50, 'SENDED', util.VN_NOW(), 1, NULL), + (3, 9, 2000, 51, 'CONFIRMED', util.VN_NOW(), 1, NULL), + (4, 9, 2001, 1, 'SENDED', util.VN_NOW(), 1, NULL); + -- 2.40.1 From a68fef8a5b7e7a66075ad8fcff624326804f5bd5 Mon Sep 17 00:00:00 2001 From: vicent Date: Wed, 8 Mar 2023 09:51:09 +0100 Subject: [PATCH 13/23] feat: test front --- front/core/components/calendar/index.spec.js | 1 + 1 file changed, 1 insertion(+) diff --git a/front/core/components/calendar/index.spec.js b/front/core/components/calendar/index.spec.js index eff5a2d2d..3dd08df8f 100644 --- a/front/core/components/calendar/index.spec.js +++ b/front/core/components/calendar/index.spec.js @@ -46,6 +46,7 @@ describe('Component vnCalendar', () => { expect(controller.month).toEqual(previousMonth.getMonth()); expect(controller.emit).toHaveBeenCalledWith('move', {$date: previousMonth}); + expect(controller.getStates).toHaveBeenCalledWith({$day: previousMonth}); }); }); -- 2.40.1 From 760690a625aaf5dc1caf999ebe3771c7441c94e8 Mon Sep 17 00:00:00 2001 From: vicent Date: Wed, 8 Mar 2023 09:51:21 +0100 Subject: [PATCH 14/23] fix: test front --- modules/worker/front/time-control/index.js | 8 ++-- .../worker/front/time-control/index.spec.js | 38 ++++++++++--------- 2 files changed, 24 insertions(+), 22 deletions(-) diff --git a/modules/worker/front/time-control/index.js b/modules/worker/front/time-control/index.js index b6ff06200..063123b04 100644 --- a/modules/worker/front/time-control/index.js +++ b/modules/worker/front/time-control/index.js @@ -101,13 +101,13 @@ class Controller extends Section { }; this.$http.get('WorkerTimeControlMails', {filter}) .then(res => { - const [workerTimeControlMail] = res.data; - if (!workerTimeControlMail) { + const workerTimeControlMail = res.data; + if (!workerTimeControlMail.length) { this.state = null; return; } - this.state = workerTimeControlMail.state; - this.reason = workerTimeControlMail.reason; + this.state = workerTimeControlMail[0].state; + this.reason = workerTimeControlMail[0].reason; }); } diff --git a/modules/worker/front/time-control/index.spec.js b/modules/worker/front/time-control/index.spec.js index 7c572c81c..50a0e5810 100644 --- a/modules/worker/front/time-control/index.spec.js +++ b/modules/worker/front/time-control/index.spec.js @@ -82,6 +82,9 @@ describe('Component vnWorkerTimeControl', () => { $httpBackend.whenRoute('GET', 'Workers/:id/getWorkedHours') .respond(response); + $httpBackend.whenRoute('GET', 'WorkerTimeControlMails') + .respond([]); + today.setHours(0, 0, 0, 0); let weekOffset = today.getDay() - 1; @@ -96,7 +99,6 @@ describe('Component vnWorkerTimeControl', () => { ended.setDate(ended.getDate() + 6); controller.ended = ended; - $httpBackend.expect('GET', `WorkerTimeControlMails`).respond({data: {state: 'SENDED'}}); controller.getWorkedHours(controller.started, controller.ended); $httpBackend.flush(); @@ -130,27 +132,27 @@ describe('Component vnWorkerTimeControl', () => { }); }); - describe('$postLink() ', () => { - it(`should set the controller date as today if no timestamp is defined`, () => { - controller.$.model = {applyFilter: jest.fn().mockReturnValue(Promise.resolve())}; - controller.$params = {timestamp: undefined}; - controller.$postLink(); + // describe('$postLink() ', () => { + // it(`should set the controller date as today if no timestamp is defined`, () => { + // controller.$.model = {applyFilter: jest.fn().mockReturnValue(Promise.resolve())}; + // controller.$params = {timestamp: undefined}; + // controller.$postLink(); - expect(controller.date).toEqual(jasmine.any(Date)); - }); + // expect(controller.date).toEqual(jasmine.any(Date)); + // }); - it(`should set the controller date using the received timestamp`, () => { - const timestamp = 1; - const date = new Date(timestamp); + // it(`should set the controller date using the received timestamp`, () => { + // const timestamp = 1; + // const date = new Date(timestamp); - controller.$.model = {applyFilter: jest.fn().mockReturnValue(Promise.resolve())}; - controller.$.calendar = {}; - controller.$params = {timestamp: timestamp}; + // controller.$.model = {applyFilter: jest.fn().mockReturnValue(Promise.resolve())}; + // controller.$.calendar = {}; + // controller.$params = {timestamp: timestamp}; - controller.$postLink(); + // controller.$postLink(); - expect(controller.date.toDateString()).toEqual(date.toDateString()); - }); - }); + // expect(controller.date.toDateString()).toEqual(date.toDateString()); + // }); + // }); }); }); -- 2.40.1 From 0396d3707cb2bac72acfa82040f84f7d86c5f519 Mon Sep 17 00:00:00 2001 From: vicent Date: Wed, 8 Mar 2023 11:47:10 +0100 Subject: [PATCH 15/23] refator: creada ruta de back, en vez de hacer peticiones http anidadas en el front --- front/core/components/calendar/index.js | 4 +- .../worker-time-control/getMailStates.js | 61 +++++++++++++++++++ .../worker/back/models/worker-time-control.js | 1 + modules/worker/front/time-control/index.html | 2 +- modules/worker/front/time-control/index.js | 39 ++++-------- 5 files changed, 77 insertions(+), 30 deletions(-) create mode 100644 modules/worker/back/methods/worker-time-control/getMailStates.js diff --git a/front/core/components/calendar/index.js b/front/core/components/calendar/index.js index 58b15896e..c7e645ecd 100644 --- a/front/core/components/calendar/index.js +++ b/front/core/components/calendar/index.js @@ -160,7 +160,7 @@ export default class Calendar extends FormInput { this.repaint(); this.emit('move', {$date: date}); - this.getStates({$day: date}); + this.getMailStates({$day: date}); } /* @@ -237,7 +237,7 @@ ngModule.vnComponent('vnCalendar', { bindings: { defaultDate: '=?', hasEvents: '&?', - getStates: '&?', + getMailStates: '&?', getClass: '&?', formatDay: '&?', formatWeek: '&?', diff --git a/modules/worker/back/methods/worker-time-control/getMailStates.js b/modules/worker/back/methods/worker-time-control/getMailStates.js new file mode 100644 index 000000000..855b5adc3 --- /dev/null +++ b/modules/worker/back/methods/worker-time-control/getMailStates.js @@ -0,0 +1,61 @@ +module.exports = Self => { + Self.remoteMethodCtx('getMailStates', { + description: 'Get the states of a month about time control mail', + accessType: 'READ', + accepts: [{ + arg: 'id', + type: 'number', + description: 'The worker id', + http: {source: 'path'} + }, + { + arg: 'month', + type: 'number', + description: 'The number of the month' + }, + { + arg: 'year', + type: 'number', + description: 'The number of the year' + }], + returns: [{ + type: ['object'], + root: true + }], + http: { + path: `/:id/getMailStates`, + verb: 'GET' + } + }); + + Self.getMailStates = async(ctx, workerId, options) => { + const models = Self.app.models; + const args = ctx.args; + const myOptions = {}; + + if (typeof options == 'object') + Object.assign(myOptions, options); + + const times = await models.Time.find({ + fields: ['week'], + where: { + month: args.month, + year: args.year + } + }, myOptions); + + const weeks = times.map(time => time.week); + const weekNumbersSet = new Set(weeks); + const weekNumbers = Array.from(weekNumbersSet); + + const workerTimeControlMails = await models.WorkerTimeControlMail.find({ + where: { + workerFk: workerId, + year: args.year, + week: {inq: weekNumbers} + } + }, myOptions); + + return workerTimeControlMails; + }; +}; diff --git a/modules/worker/back/models/worker-time-control.js b/modules/worker/back/models/worker-time-control.js index 7339f5d15..5b13e17f2 100644 --- a/modules/worker/back/models/worker-time-control.js +++ b/modules/worker/back/models/worker-time-control.js @@ -8,6 +8,7 @@ module.exports = Self => { require('../methods/worker-time-control/sendMail')(Self); require('../methods/worker-time-control/updateWorkerTimeControlMail')(Self); require('../methods/worker-time-control/weeklyHourRecordEmail')(Self); + require('../methods/worker-time-control/getMailStates')(Self); Self.rewriteDbError(function(err) { if (err.code === 'ER_DUP_ENTRY') diff --git a/modules/worker/front/time-control/index.html b/modules/worker/front/time-control/index.html index 7585c7c5e..e972fae22 100644 --- a/modules/worker/front/time-control/index.html +++ b/modules/worker/front/time-control/index.html @@ -123,7 +123,7 @@ class="vn-pt-md" ng-model="$ctrl.date" format-week="$ctrl.formatWeek($element)" - get-states="$ctrl.getStates($day)" + get-mail-states="$ctrl.getMailStates($day)" has-events="$ctrl.hasEvents($day)"> diff --git a/modules/worker/front/time-control/index.js b/modules/worker/front/time-control/index.js index 063123b04..2ea642709 100644 --- a/modules/worker/front/time-control/index.js +++ b/modules/worker/front/time-control/index.js @@ -26,7 +26,7 @@ class Controller extends Section { this.date = initialDate; - this.getStates(this.date); + this.getMailStates(this.date); } get isHr() { @@ -355,7 +355,7 @@ class Controller extends Section { }; const query = `WorkerTimeControls/updateWorkerTimeControlMail`; this.$http.post(query, params).then(() => { - this.getStates(this.date); + this.getMailStates(this.date); this.getWeekData(); this.vnApp.showSuccess(this.$t('Data saved!')); }); @@ -373,7 +373,7 @@ class Controller extends Section { }; const query = `WorkerTimeControls/updateWorkerTimeControlMail`; this.$http.post(query, params).then(() => { - this.getStates(this.date); + this.getMailStates(this.date); this.getWeekData(); this.vnApp.showSuccess(this.$t('Data saved!')); }); @@ -421,32 +421,17 @@ class Controller extends Section { return [parseInt(hours), parseInt(minutes), parseInt(seconds)]; } - getStates(day) { - const filterTime = { - fields: ['week'], - where: { - month: day.getMonth() + 1, - year: day.getFullYear() - } + getMailStates(day) { + const params = { + month: day.getMonth() + 1, + year: day.getFullYear() }; - this.$http.get('Times', {filter: filterTime}) + const query = `WorkerTimeControls/${this.$params.id}/getMailStates`; + this.$http.get(query, {params}) .then(res => { - const weeks = res.data.map(time => time.week); - const weekNumbersSet = new Set(weeks); - const weekNumbers = Array.from(weekNumbersSet); - - const filter = { - where: { - workerFk: this.$params.id, - year: day.getFullYear(), - week: {inq: weekNumbers} - } - }; - this.$http.get('WorkerTimeControlMails', {filter}) - .then(res => { - this.workerTimeControlMails = res.data; - this.repaint(); - }); + console.log(res.data); + this.workerTimeControlMails = res.data; + this.repaint(); }); } -- 2.40.1 From 776f7783c68ba30a8fd1d3ce401f47004a22c848 Mon Sep 17 00:00:00 2001 From: vicent Date: Wed, 8 Mar 2023 12:06:20 +0100 Subject: [PATCH 16/23] refactor code --- modules/worker/front/time-control/index.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/modules/worker/front/time-control/index.js b/modules/worker/front/time-control/index.js index 2ea642709..441b3bbf7 100644 --- a/modules/worker/front/time-control/index.js +++ b/modules/worker/front/time-control/index.js @@ -411,7 +411,7 @@ class Controller extends Section { url: url, }; this.$http.post(`WorkerTimeControls/weekly-hour-hecord-email`, params) - .then(res => { + .then(() => { this.vnApp.showSuccess(this.$t('Email sended')); }); } @@ -429,7 +429,6 @@ class Controller extends Section { const query = `WorkerTimeControls/${this.$params.id}/getMailStates`; this.$http.get(query, {params}) .then(res => { - console.log(res.data); this.workerTimeControlMails = res.data; this.repaint(); }); -- 2.40.1 From f461c75af1ec8a44f37dd6859c722fd586580360 Mon Sep 17 00:00:00 2001 From: vicent Date: Wed, 8 Mar 2023 12:06:31 +0100 Subject: [PATCH 17/23] feat: add front test --- .../worker/front/time-control/index.spec.js | 153 +++++++++++++++--- 1 file changed, 135 insertions(+), 18 deletions(-) diff --git a/modules/worker/front/time-control/index.spec.js b/modules/worker/front/time-control/index.spec.js index 50a0e5810..0f9b48f6b 100644 --- a/modules/worker/front/time-control/index.spec.js +++ b/modules/worker/front/time-control/index.spec.js @@ -5,12 +5,14 @@ describe('Component vnWorkerTimeControl', () => { let $scope; let $element; let controller; + let $httpParamSerializer; beforeEach(ngModule('worker')); - beforeEach(inject(($componentController, $rootScope, $stateParams, _$httpBackend_) => { + beforeEach(inject(($componentController, $rootScope, $stateParams, _$httpBackend_, _$httpParamSerializer_) => { $stateParams.id = 1; $httpBackend = _$httpBackend_; + $httpParamSerializer = _$httpParamSerializer_; $scope = $rootScope.$new(); $element = angular.element(''); controller = $componentController('vnWorkerTimeControl', {$element, $scope}); @@ -132,27 +134,142 @@ describe('Component vnWorkerTimeControl', () => { }); }); - // describe('$postLink() ', () => { - // it(`should set the controller date as today if no timestamp is defined`, () => { - // controller.$.model = {applyFilter: jest.fn().mockReturnValue(Promise.resolve())}; - // controller.$params = {timestamp: undefined}; - // controller.$postLink(); + describe('$postLink() ', () => { + it(`should set the controller date as today if no timestamp is defined`, () => { + controller.$.model = {applyFilter: jest.fn().mockReturnValue(Promise.resolve())}; + controller.$params = {timestamp: undefined}; + controller.$postLink(); - // expect(controller.date).toEqual(jasmine.any(Date)); - // }); + expect(controller.date).toEqual(jasmine.any(Date)); + }); - // it(`should set the controller date using the received timestamp`, () => { - // const timestamp = 1; - // const date = new Date(timestamp); + it(`should set the controller date using the received timestamp`, () => { + const timestamp = 1; + const date = new Date(timestamp); - // controller.$.model = {applyFilter: jest.fn().mockReturnValue(Promise.resolve())}; - // controller.$.calendar = {}; - // controller.$params = {timestamp: timestamp}; + controller.$.model = {applyFilter: jest.fn().mockReturnValue(Promise.resolve())}; + controller.$.calendar = {}; + controller.$params = {timestamp: timestamp}; - // controller.$postLink(); + controller.$postLink(); - // expect(controller.date.toDateString()).toEqual(date.toDateString()); - // }); - // }); + expect(controller.date.toDateString()).toEqual(date.toDateString()); + }); + }); + + describe('getWeekData() ', () => { + it(`should make a query an then update the state and reason`, () => { + const today = Date.vnNew(); + const response = [ + { + state: 'SENDED', + reason: null + } + ]; + + controller._date = today; + + $httpBackend.whenRoute('GET', 'WorkerTimeControlMails') + .respond(response); + + controller.getWeekData(); + $httpBackend.flush(); + + expect(controller.state).toBe('SENDED'); + expect(controller.reason).toBe(null); + }); + }); + + describe('isSatisfied() ', () => { + it(`should make a query an then call three methods`, () => { + const today = Date.vnNew(); + jest.spyOn(controller, 'getWeekData').mockReturnThis(); + jest.spyOn(controller, 'getMailStates').mockReturnThis(); + jest.spyOn(controller.vnApp, 'showSuccess'); + + controller.$.model = {applyFilter: jest.fn().mockReturnValue(Promise.resolve())}; + controller.worker = {id: 1}; + controller.date = today; + controller.weekNumber = 1; + + $httpBackend.expect('POST', 'WorkerTimeControls/updateWorkerTimeControlMail').respond(); + controller.isSatisfied(); + $httpBackend.flush(); + + expect(controller.getMailStates).toHaveBeenCalledWith(controller.date); + expect(controller.getWeekData).toHaveBeenCalled(); + expect(controller.vnApp.showSuccess).toHaveBeenCalled(); + }); + }); + + describe('isUnsatisfied() ', () => { + it(`should throw an error is reason is empty`, () => { + let error; + try { + controller.isUnsatisfied(); + } catch (e) { + error = e; + } + + expect(error).toBeDefined(); + expect(error.message).toBe(`You must indicate a reason`); + }); + + it(`should make a query an then call three methods`, () => { + const today = Date.vnNew(); + jest.spyOn(controller, 'getWeekData').mockReturnThis(); + jest.spyOn(controller, 'getMailStates').mockReturnThis(); + jest.spyOn(controller.vnApp, 'showSuccess'); + + controller.$.model = {applyFilter: jest.fn().mockReturnValue(Promise.resolve())}; + controller.worker = {id: 1}; + controller.date = today; + controller.weekNumber = 1; + controller.reason = 'reason'; + + $httpBackend.expect('POST', 'WorkerTimeControls/updateWorkerTimeControlMail').respond(); + controller.isSatisfied(); + $httpBackend.flush(); + + expect(controller.getMailStates).toHaveBeenCalledWith(controller.date); + expect(controller.getWeekData).toHaveBeenCalled(); + expect(controller.vnApp.showSuccess).toHaveBeenCalled(); + }); + }); + + describe('resendEmail() ', () => { + it(`should make a query an then call showSuccess method`, () => { + const today = Date.vnNew(); + jest.spyOn(controller, 'getWeekData').mockReturnThis(); + jest.spyOn(controller.vnApp, 'showSuccess'); + + controller.$.model = {applyFilter: jest.fn().mockReturnValue(Promise.resolve())}; + controller.worker = {id: 1}; + controller.worker = {user: {emailUser: {email: 'employee@verdnatura.es'}}}; + controller.date = today; + controller.weekNumber = 1; + + $httpBackend.expect('POST', 'WorkerTimeControls/weekly-hour-hecord-email').respond(); + controller.resendEmail(); + $httpBackend.flush(); + + expect(controller.vnApp.showSuccess).toHaveBeenCalled(); + }); + }); + + describe('getMailStates() ', () => { + it(`should make a query an then call showSuccess method`, () => { + const today = Date.vnNew(); + jest.spyOn(controller, 'repaint').mockReturnThis(); + + controller.$params = {id: 1}; + + $httpBackend.expect('GET', `WorkerTimeControls/1/getMailStates?month=1&year=2001`).respond(); + controller.getMailStates(today); + $httpBackend.flush(); + + expect(controller.repaint).toHaveBeenCalled(); + }); + }); }); }); -- 2.40.1 From 79023fbfaf9e11c235103e0501e3f6eece749cbe Mon Sep 17 00:00:00 2001 From: vicent Date: Wed, 8 Mar 2023 12:16:53 +0100 Subject: [PATCH 18/23] feat: add backTest --- .../specs/getMailStates.spec.js | 29 +++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 modules/worker/back/methods/worker-time-control/specs/getMailStates.spec.js diff --git a/modules/worker/back/methods/worker-time-control/specs/getMailStates.spec.js b/modules/worker/back/methods/worker-time-control/specs/getMailStates.spec.js new file mode 100644 index 000000000..cbad32323 --- /dev/null +++ b/modules/worker/back/methods/worker-time-control/specs/getMailStates.spec.js @@ -0,0 +1,29 @@ +const models = require('vn-loopback/server/server').models; + +describe('workerTimeControl getMailStates()', () => { + const workerId = 9; + const ctx = {args: { + month: 12, + year: 2000 + }}; + + it('should get the states of a month about time control mail', async() => { + const tx = await models.WorkerTimeControl.beginTransaction({}); + + try { + const options = {transaction: tx}; + + const response = await models.WorkerTimeControl.getMailStates(ctx, workerId, options); + + expect(response[0].state).toEqual('REVISE'); + expect(response[1].state).toEqual('SENDED'); + expect(response[2].state).toEqual('CONFIRMED'); + + await tx.rollback(); + } catch (e) { + await tx.rollback(); + throw e; + } + }); +}); + -- 2.40.1 From 07edacd55772bc7fd1da562b6b803232e7863ac7 Mon Sep 17 00:00:00 2001 From: vicent Date: Wed, 8 Mar 2023 12:22:14 +0100 Subject: [PATCH 19/23] fix: frontTest --- front/core/components/calendar/index.spec.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/front/core/components/calendar/index.spec.js b/front/core/components/calendar/index.spec.js index 3dd08df8f..1d4633531 100644 --- a/front/core/components/calendar/index.spec.js +++ b/front/core/components/calendar/index.spec.js @@ -24,13 +24,13 @@ describe('Component vnCalendar', () => { let nextMonth = new Date(date.getTime()); nextMonth.setMonth(nextMonth.getMonth() + 1); - controller.getStates = jasmine.createSpy(controller, 'getStates'); + controller.getMailStates = jasmine.createSpy(controller, 'getMailStates'); controller.moveNext(); expect(controller.month).toEqual(nextMonth.getMonth()); expect(controller.emit).toHaveBeenCalledWith('move', {$date: nextMonth}); - expect(controller.getStates).toHaveBeenCalledWith({$day: nextMonth}); + expect(controller.getMailStates).toHaveBeenCalledWith({$day: nextMonth}); }); }); @@ -40,13 +40,13 @@ describe('Component vnCalendar', () => { let previousMonth = new Date(date.getTime()); previousMonth.setMonth(previousMonth.getMonth() - 1); - controller.getStates = jasmine.createSpy(controller, 'getStates'); + controller.getMailStates = jasmine.createSpy(controller, 'getMailStates'); controller.movePrevious(); expect(controller.month).toEqual(previousMonth.getMonth()); expect(controller.emit).toHaveBeenCalledWith('move', {$date: previousMonth}); - expect(controller.getStates).toHaveBeenCalledWith({$day: previousMonth}); + expect(controller.getMailStates).toHaveBeenCalledWith({$day: previousMonth}); }); }); -- 2.40.1 From 4dc9e9e590db639be1d06142b9ae6ad201bfd556 Mon Sep 17 00:00:00 2001 From: vicent Date: Tue, 14 Mar 2023 07:44:39 +0100 Subject: [PATCH 20/23] refs #4856 refactor: make agnostic the component calendar --- front/core/components/calendar/index.js | 3 --- modules/worker/front/time-control/index.html | 2 +- modules/worker/front/time-control/index.js | 6 +++--- 3 files changed, 4 insertions(+), 7 deletions(-) diff --git a/front/core/components/calendar/index.js b/front/core/components/calendar/index.js index c7e645ecd..0e39267a7 100644 --- a/front/core/components/calendar/index.js +++ b/front/core/components/calendar/index.js @@ -159,8 +159,6 @@ export default class Calendar extends FormInput { this.repaint(); this.emit('move', {$date: date}); - - this.getMailStates({$day: date}); } /* @@ -237,7 +235,6 @@ ngModule.vnComponent('vnCalendar', { bindings: { defaultDate: '=?', hasEvents: '&?', - getMailStates: '&?', getClass: '&?', formatDay: '&?', formatWeek: '&?', diff --git a/modules/worker/front/time-control/index.html b/modules/worker/front/time-control/index.html index e972fae22..bd7e68b89 100644 --- a/modules/worker/front/time-control/index.html +++ b/modules/worker/front/time-control/index.html @@ -123,7 +123,7 @@ class="vn-pt-md" ng-model="$ctrl.date" format-week="$ctrl.formatWeek($element)" - get-mail-states="$ctrl.getMailStates($day)" + on-move="$ctrl.getMailStates($date)" has-events="$ctrl.hasEvents($day)"> diff --git a/modules/worker/front/time-control/index.js b/modules/worker/front/time-control/index.js index 441b3bbf7..9ed454d31 100644 --- a/modules/worker/front/time-control/index.js +++ b/modules/worker/front/time-control/index.js @@ -421,10 +421,10 @@ class Controller extends Section { return [parseInt(hours), parseInt(minutes), parseInt(seconds)]; } - getMailStates(day) { + getMailStates(date) { const params = { - month: day.getMonth() + 1, - year: day.getFullYear() + month: date.getMonth() + 1, + year: date.getFullYear() }; const query = `WorkerTimeControls/${this.$params.id}/getMailStates`; this.$http.get(query, {params}) -- 2.40.1 From c5eef959ee758625061c8a612a04a2bdad135aa7 Mon Sep 17 00:00:00 2001 From: vicent Date: Tue, 14 Mar 2023 07:45:00 +0100 Subject: [PATCH 21/23] refs #4856 delete unnessary sql --- db/changes/230801/00-acl_time.sql | 3 --- 1 file changed, 3 deletions(-) delete mode 100644 db/changes/230801/00-acl_time.sql diff --git a/db/changes/230801/00-acl_time.sql b/db/changes/230801/00-acl_time.sql deleted file mode 100644 index 9ef73d409..000000000 --- a/db/changes/230801/00-acl_time.sql +++ /dev/null @@ -1,3 +0,0 @@ -INSERT INTO `salix`.`ACL` (`model`, `property`, `accessType`, `permission`, `principalType`, `principalId`) - VALUES - ('Time', '*', '*', 'ALLOW', 'ROLE', 'employee'); -- 2.40.1 From 2be7320d8949de0c1df57fd1916565c6c348e28d Mon Sep 17 00:00:00 2001 From: vicent Date: Tue, 14 Mar 2023 07:45:22 +0100 Subject: [PATCH 22/23] refs #4856 fix: backTest --- front/core/components/calendar/index.spec.js | 6 ------ 1 file changed, 6 deletions(-) diff --git a/front/core/components/calendar/index.spec.js b/front/core/components/calendar/index.spec.js index 1d4633531..c4ad6f14b 100644 --- a/front/core/components/calendar/index.spec.js +++ b/front/core/components/calendar/index.spec.js @@ -24,13 +24,10 @@ describe('Component vnCalendar', () => { let nextMonth = new Date(date.getTime()); nextMonth.setMonth(nextMonth.getMonth() + 1); - controller.getMailStates = jasmine.createSpy(controller, 'getMailStates'); - controller.moveNext(); expect(controller.month).toEqual(nextMonth.getMonth()); expect(controller.emit).toHaveBeenCalledWith('move', {$date: nextMonth}); - expect(controller.getMailStates).toHaveBeenCalledWith({$day: nextMonth}); }); }); @@ -40,13 +37,10 @@ describe('Component vnCalendar', () => { let previousMonth = new Date(date.getTime()); previousMonth.setMonth(previousMonth.getMonth() - 1); - controller.getMailStates = jasmine.createSpy(controller, 'getMailStates'); - controller.movePrevious(); expect(controller.month).toEqual(previousMonth.getMonth()); expect(controller.emit).toHaveBeenCalledWith('move', {$date: previousMonth}); - expect(controller.getMailStates).toHaveBeenCalledWith({$day: previousMonth}); }); }); -- 2.40.1 From ab5a5924342478ced96f0fc4f1fd60517697f095 Mon Sep 17 00:00:00 2001 From: vicent Date: Thu, 16 Mar 2023 07:37:59 +0100 Subject: [PATCH 23/23] refs #4856 add changelog --- CHANGELOG.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index cf7d8465a..3dadbafcf 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,13 +8,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [2310.01] - 2023-03-23 ### Added -- +- (Trabajadores -> Control de horario) Ahora se puede confirmar/no confirmar el registro horario de cada semana desde esta sección ### Changed -- +- ### Fixed -- (Clientes -> Listado extendido) Resuelto error al filtrar por clientes inactivos desde la columna "Activo" +- (Clientes -> Listado extendido) Resuelto error al filtrar por clientes inactivos desde la columna "Activo" - (General) Al pasar el ratón por encima del icono de "Borrar" en un campo, se hacía más grande afectando a la interfaz ## [2308.01] - 2023-03-09 -- 2.40.1