Fixes and E2E updated
gitea/salix/pipeline/head This commit looks good Details

This commit is contained in:
Joan Sanchez 2021-06-11 10:58:00 +02:00
parent 3f3e5c2735
commit a72010554c
4 changed files with 33 additions and 13 deletions

View File

@ -888,7 +888,7 @@ export default {
},
workerCalendar: {
year: 'vn-worker-calendar vn-autocomplete[ng-model="$ctrl.year"]',
totalHolidaysUsed: 'vn-worker-calendar div.totalBox > div',
totalHolidaysUsed: 'vn-worker-calendar div.totalBox:first-child > div',
penultimateMondayOfJanuary: 'vn-worker-calendar vn-calendar:nth-child(2) section:nth-child(22) > div',
lastMondayOfMarch: 'vn-worker-calendar vn-calendar:nth-child(4) section:nth-child(29) > div',
fistMondayOfMay: 'vn-worker-calendar vn-calendar:nth-child(6) section:nth-child(8) > div',
@ -896,11 +896,11 @@ export default {
secondTuesdayOfMay: 'vn-worker-calendar vn-calendar:nth-child(6) section:nth-child(16) > div',
secondWednesdayOfMay: 'vn-worker-calendar vn-calendar:nth-child(6) section:nth-child(17) > div',
secondThursdayOfMay: 'vn-worker-calendar vn-calendar:nth-child(6) section:nth-child(18) > div',
holidays: 'vn-worker-calendar > vn-side-menu div:nth-child(3) > vn-chip:nth-child(1)',
absence: 'vn-worker-calendar > vn-side-menu div:nth-child(3) > vn-chip:nth-child(2)',
halfHoliday: 'vn-worker-calendar > vn-side-menu div:nth-child(3) > vn-chip:nth-child(3)',
furlough: 'vn-worker-calendar > vn-side-menu div:nth-child(3) > vn-chip:nth-child(4)',
halfFurlough: 'vn-worker-calendar > vn-side-menu div:nth-child(3) > vn-chip:nth-child(5)',
holidays: 'vn-worker-calendar > vn-side-menu [name="absenceTypes"] > vn-chip:nth-child(1)',
absence: 'vn-worker-calendar > vn-side-menu [name="absenceTypes"] > vn-chip:nth-child(2)',
halfHoliday: 'vn-worker-calendar > vn-side-menu [name="absenceTypes"] > vn-chip:nth-child(3)',
furlough: 'vn-worker-calendar > vn-side-menu [name="absenceTypes"] > vn-chip:nth-child(4)',
halfFurlough: 'vn-worker-calendar > vn-side-menu [name="absenceTypes"] > vn-chip:nth-child(5)',
},
invoiceOutIndex: {
topbarSearch: 'vn-searchbar',

View File

@ -1,7 +1,7 @@
import selectors from '../../helpers/selectors.js';
import getBrowser from '../../helpers/puppeteer';
fdescribe('Worker calendar path', () => {
describe('Worker calendar path', () => {
let reasonableTimeBetweenClicks = 400;
let browser;
let page;

View File

@ -62,7 +62,7 @@
</tpl-item>
</vn-autocomplete>
</div>
<div class="input vn-py-md" style="overflow: hidden;">
<div name="absenceTypes" class="input vn-py-md" style="overflow: hidden;">
<vn-chip ng-repeat="absenceType in absenceTypes" ng-class="::{'selectable': $ctrl.isSubordinate}"
ng-click="$ctrl.pick(absenceType)">
<vn-avatar

View File

@ -13,6 +13,19 @@ class Controller extends Section {
this.date = new Date();
}
get worker() {
return this._worker;
}
set worker(value) {
this._worker = value;
if (value) {
this.getActiveContract()
.then(() => this.getAbsences());
}
}
/**
* The current selected date
*/
@ -70,6 +83,11 @@ class Controller extends Section {
}
}
getActiveContract() {
return this.$http.get(`Workers/${this.worker.id}/activeContract`)
.then(res => this.businessId = res.data.businessFk);
}
fetchHours() {
const params = {workerFk: this.$params.id};
const filter = {
@ -80,7 +98,6 @@ class Controller extends Section {
};
this.$.model.applyFilter(filter, params).then(() => {
this.getWorkedHours(this.started, this.ended);
this.getAbsences();
});
}
@ -89,10 +106,10 @@ class Controller extends Section {
}
getAbsences() {
const fullYear = this.started.getFullYear();
let params = {
workerFk: this.$params.id,
started: this.started,
ended: this.ended
businessFk: this.businessId,
year: fullYear
};
return this.$http.get(`Calendars/absences`, {params})
@ -257,5 +274,8 @@ Controller.$inject = ['$element', '$scope', 'vnWeekDays'];
ngModule.vnComponent('vnWorkerTimeControl', {
template: require('./index.html'),
controller: Controller
controller: Controller,
bindings: {
worker: '<'
}
});