Merge branch 'test' into dev
gitea/salix/dev This commit looks good Details

This commit is contained in:
Joan Sanchez 2020-01-30 11:54:51 +01:00
commit 31349b2ebf
4 changed files with 11 additions and 6 deletions

View File

@ -6,14 +6,14 @@ services:
context: . context: .
dockerfile: front/Dockerfile dockerfile: front/Dockerfile
ports: ports:
- ${FRONT_PORT:?}:80 - 80
deploy: deploy:
replicas: 3 replicas: 3
back: back:
image: registry.verdnatura.es/salix-back:${BRANCH_NAME:?} image: registry.verdnatura.es/salix-back:${BRANCH_NAME:?}
build: . build: .
ports: ports:
- ${BACK_PORT:?}:3000 - 3000
environment: environment:
- NODE_ENV - NODE_ENV
configs: configs:

View File

@ -11,4 +11,8 @@ server {
location / { location / {
autoindex on; autoindex on;
} }
location /index.html {
expires -1;
add_header 'Cache-Control' 'no-store, no-cache, must-revalidate, proxy-revalidate, max-age=0';
}
} }

View File

@ -1,6 +1,7 @@
const app = require('vn-loopback/server/server'); const app = require('vn-loopback/server/server');
describe('Worker absences()', () => { // 2066
xdescribe('Worker absences()', () => {
it('should get the absence calendar for a full year contract', async() => { it('should get the absence calendar for a full year contract', async() => {
let ctx = {req: {accessToken: {userId: 106}}}; let ctx = {req: {accessToken: {userId: 106}}};
let workerFk = 106; let workerFk = 106;
@ -133,6 +134,7 @@ describe('Worker absences()', () => {
let remainingDays = 0; let remainingDays = 0;
for (let i = today.getMonth(); i < 12; i++) { for (let i = today.getMonth(); i < 12; i++) {
today.setDate(1);
today.setMonth(i + 1); today.setMonth(i + 1);
today.setDate(0); today.setDate(0);

View File

@ -36,8 +36,8 @@ module.exports = Self => {
Self.getWorkedHours = async(id, started, ended) => { Self.getWorkedHours = async(id, started, ended) => {
const conn = Self.dataSource.connector; const conn = Self.dataSource.connector;
const stmts = []; const stmts = [];
const startedMinusOne = new Date(); const startedMinusOne = new Date(started);
const endedPlusOne = new Date(); const endedPlusOne = new Date(ended);
let worker = await Self.app.models.Worker.findById(id); let worker = await Self.app.models.Worker.findById(id);
let userId = worker.userFk; let userId = worker.userFk;
@ -61,7 +61,6 @@ module.exports = Self => {
tmp.timeControlCalculate, tmp.timeControlCalculate,
tmp.timeBusinessCalculate tmp.timeBusinessCalculate
`); `);
let sql = ParameterizedSQL.join(stmts, ';'); let sql = ParameterizedSQL.join(stmts, ';');
let result = await conn.executeStmt(sql); let result = await conn.executeStmt(sql);