Merge branch 'dev' of https://git.verdnatura.es/salix into dev

This commit is contained in:
gerard 2018-05-24 13:44:59 +02:00
commit b3ce2a8630
5 changed files with 34 additions and 9 deletions

View File

@ -22,6 +22,11 @@ export default class Controller extends Component {
* @param {Object} data The message data
*/
show(data) {
if (this.shown) {
this.hide();
this.onTransitionEnd();
}
this.clearTimeouts();
this.shown = true;
this.textNode.textContent = data.message;
@ -43,8 +48,8 @@ export default class Controller extends Component {
* @param {Object} data The message data
*/
showError(data) {
this.$snackbar.addClass('error');
this.show(data);
this.$snackbar.addClass('error');
}
/**

View File

@ -0,0 +1,19 @@
/**
* Transforms a UTC date to JSON date without datetime.
*
* @param {date} date Date to format
* @return {String} Formatted date string
*/
export function toJsonDate(date) {
let day = date.getDate();
let month = date.getMonth() + 1;
let year = date.getFullYear();
if (day < 10)
day = `0${day}`
if (month < 10)
month = `0${month}`
return `${year}-${month}-${day}`;
}

View File

@ -1,4 +1,5 @@
import ngModule from '../../module';
import {toJsonDate} from 'core/src/lib/date';
class Controller {
constructor($scope, $http, $translate, vnApp) {
@ -30,11 +31,11 @@ class Controller {
let query = `/ticket/api/sales/${this.ticket.id}/priceDifference`;
let data = {
landed: this.ticket.landed,
landed: toJsonDate(this.ticket.landed),
addressFk: this.ticket.addressFk,
agencyModeFk: this.ticket.agencyModeFk
};
return this.$http.post(query, data).then(res => {
if (res.data)
this.ticket.sale = res.data;

View File

@ -63,7 +63,7 @@ describe('Client', () => {
.evaluate(selector => {
console.log(document.querySelector(selector));
return document.querySelector(selector).className;
}, 'body > vn-app > vn-vertical > vn-vertical > vn-client-card > vn-main-block > vn-horizontal > vn-one > vn-vertical > vn-client-fiscal-data > form > vn-card > div > vn-horizontal:nth-child(5) > vn-check:nth-child(4) > label')
}, 'vn-client-fiscal-data > form > vn-card > div > vn-horizontal:nth-child(5) > vn-check:nth-child(4) > label')
.then(result => {
expect(result).toContain('is-disabled');
});
@ -152,7 +152,7 @@ describe('Client', () => {
.wait(selectors.clientFiscalData.verifiedDataCheckboxInput)
.evaluate(selector => {
return document.querySelector(selector).className;
}, 'body > vn-app > vn-vertical > vn-vertical > vn-client-card > vn-main-block > vn-horizontal > vn-one > vn-vertical > vn-client-fiscal-data > form > vn-card > div > vn-horizontal:nth-child(5) > vn-check:nth-child(3) > label')
}, 'vn-client-fiscal-data > form > vn-card > div > vn-horizontal:nth-child(5) > vn-check:nth-child(3) > label')
.then(result => {
expect(result).not.toContain('is-disabled');
});
@ -265,7 +265,7 @@ describe('Client', () => {
.wait(selectors.clientFiscalData.verifiedDataCheckboxInput)
.evaluate(selector => {
return document.querySelector(selector).className;
}, 'body > vn-app > vn-vertical > vn-vertical > vn-client-card > vn-main-block > vn-horizontal > vn-one > vn-vertical > vn-client-fiscal-data > form > vn-card > div > vn-horizontal:nth-child(5) > vn-check:nth-child(3) > label')
}, 'vn-client-fiscal-data > form > vn-card > div > vn-horizontal:nth-child(5) > vn-check:nth-child(3) > label')
.then(result => {
expect(result).toContain('is-disabled');
});
@ -341,7 +341,7 @@ describe('Client', () => {
.wait(selectors.clientFiscalData.verifiedDataCheckboxInput)
.evaluate(selector => {
return document.querySelector(selector).className;
}, 'body > vn-app > vn-vertical > vn-vertical > vn-client-card > vn-main-block > vn-horizontal > vn-one > vn-vertical > vn-client-fiscal-data > form > vn-card > div > vn-horizontal:nth-child(5) > vn-check:nth-child(3) > label')
}, 'vn-client-fiscal-data > form > vn-card > div > vn-horizontal:nth-child(5) > vn-check:nth-child(3) > label')
.then(result => {
expect(result).not.toContain('is-disabled');
});
@ -454,7 +454,7 @@ describe('Client', () => {
.wait(selectors.clientFiscalData.verifiedDataCheckboxInput)
.evaluate(selector => {
return document.querySelector(selector).className;
}, 'body > vn-app > vn-vertical > vn-vertical > vn-client-card > vn-main-block > vn-horizontal > vn-one > vn-vertical > vn-client-fiscal-data > form > vn-card > div > vn-horizontal:nth-child(5) > vn-check:nth-child(4) > label')
}, 'vn-client-fiscal-data > form > vn-card > div > vn-horizontal:nth-child(5) > vn-check:nth-child(4) > label')
.then(result => {
expect(result).toContain('is-disabled');
});

View File

@ -1,6 +1,6 @@
FROM verdnatura/vn-mysql:latest
ENV MYSQL_ROOT_PASSWORD root
ENV TZ GMT-1
ENV TZ=Europe/Madrid
WORKDIR /docker-entrypoint-initdb.d
COPY install ./
RUN chmod -R 777 .