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

This commit is contained in:
Carlos Jimenez 2018-11-07 13:56:19 +01:00
commit d0f1c582a4
6 changed files with 16 additions and 16 deletions

View File

@ -168,12 +168,12 @@ export default class Autocomplete extends Input {
} }
onSelectionRequest(data) { onSelectionRequest(data) {
if (data && data.length > 0) if (data && data.length > 0) {
if (this.multiple) if (this.multiple)
this.selection = data; this.selection = data;
else else
this.selection = data[0]; this.selection = data[0];
else } else
this.selection = null; this.selection = null;
} }
@ -181,7 +181,7 @@ export default class Autocomplete extends Input {
let display = ''; let display = '';
let hasTemplate = this.$transclude && this.$transclude.isSlotFilled('tplItem'); let hasTemplate = this.$transclude && this.$transclude.isSlotFilled('tplItem');
if (this._selection && this.showField) if (this._selection && this.showField) {
if (this.multiple && Array.isArray(this._selection)) { if (this.multiple && Array.isArray(this._selection)) {
for (let item of this._selection) { for (let item of this._selection) {
if (display.length > 0) display += ', '; if (display.length > 0) display += ', ';
@ -194,12 +194,14 @@ export default class Autocomplete extends Input {
display = this.$interpolate(template)(this._selection); display = this.$interpolate(template)(this._selection);
} }
} }
}
this.input.value = display; this.input.value = display;
if (this.translateFields) if (this.translateFields) {
if (this.translateFields.indexOf(this.showField) > -1) if (this.translateFields.indexOf(this.showField) > -1)
this.input.value = this.$translate.instant(display); this.input.value = this.$translate.instant(display);
}
this.mdlUpdate(); this.mdlUpdate();
} }

View File

@ -45,7 +45,7 @@
ng-show="tag.selection.isFree === false" ng-show="tag.selection.isFree === false"
vn-three vn-three
url="{{$ctrl.getSourceTable(tag.selection)}}" url="{{$ctrl.getSourceTable(tag.selection)}}"
where="{name: {like: 'search%'}}" search-function="{name: {regexp: $search}}"
label="Value" label="Value"
field="itemTag.value" field="itemTag.value"
show-field="name" show-field="name"

View File

@ -7,7 +7,7 @@ class Controller {
this.include = { this.include = {
relation: 'tag', relation: 'tag',
scope: { scope: {
fields: ['id', 'name', 'isFree'] fields: ['id', 'name', 'isFree', 'sourceTable']
} }
}; };
} }
@ -31,13 +31,11 @@ class Controller {
getSourceTable(selection) { getSourceTable(selection) {
if (!selection || selection.isFree === true) if (!selection || selection.isFree === true)
return null; return null;
if (selection.sourceTable) { if (selection.sourceTable) {
return '/api/' + selection.sourceTable.charAt(0).toUpperCase() + return '/api/' + selection.sourceTable.charAt(0).toUpperCase() +
selection.sourceTable.substring(1) + 's'; selection.sourceTable.substring(1) + 's';
} else if (selection.sourceTable == null) { } else if (selection.sourceTable == null)
return `/api/ItemTags/filterItemTags/${selection.id}`; return `/api/ItemTags/filterItemTags/${selection.id}`;
}
} }
onSubmit() { onSubmit() {

View File

@ -113,7 +113,7 @@ describe('Client Edit pay method path', () => {
it('should confirm Received LCR checkbox is checked', async () => { it('should confirm Received LCR checkbox is checked', async () => {
const checkedBox = await nightmare const checkedBox = await nightmare
.evaluate((selector) => { .evaluate(selector => {
return document.querySelector(selector).checked; return document.querySelector(selector).checked;
}, selectors.clientPayMethod.receivedCoreLCRCheckbox); }, selectors.clientPayMethod.receivedCoreLCRCheckbox);
@ -122,7 +122,7 @@ describe('Client Edit pay method path', () => {
it('should confirm Received core VNL checkbox is unchecked', async () => { it('should confirm Received core VNL checkbox is unchecked', async () => {
const checkedBox = await nightmare const checkedBox = await nightmare
.evaluate((selector) => { .evaluate(selector => {
return document.querySelector(selector).checked; return document.querySelector(selector).checked;
}, selectors.clientPayMethod.receivedCoreVNLCheckbox); }, selectors.clientPayMethod.receivedCoreVNLCheckbox);
@ -131,7 +131,7 @@ describe('Client Edit pay method path', () => {
it('should confirm Received B2B VNL checkbox is unchecked', async () => { it('should confirm Received B2B VNL checkbox is unchecked', async () => {
const checkedBox = await nightmare const checkedBox = await nightmare
.evaluate((selector) => { .evaluate(selector => {
return document.querySelector(selector).checked; return document.querySelector(selector).checked;
}, selectors.clientPayMethod.receivedB2BVNLCheckbox); }, selectors.clientPayMethod.receivedB2BVNLCheckbox);

View File

@ -1,8 +1,7 @@
import selectors from '../../helpers/selectors.js'; import selectors from '../../helpers/selectors.js';
import createNightmare from '../../helpers/nightmare'; import createNightmare from '../../helpers/nightmare';
// e2e path excluded ultil #764 is completed describe('Ticket Create packages path', () => {
xdescribe('Ticket Create packages path', () => {
const nightmare = createNightmare(); const nightmare = createNightmare();
beforeAll(() => { beforeAll(() => {

View File

@ -23,6 +23,7 @@ module.exports = Self => {
}); });
Self.listPackaging = async filter => { Self.listPackaging = async filter => {
let conn = Self.dataSource.connector;
let stmt = new ParameterizedSQL( let stmt = new ParameterizedSQL(
`SELECT name, itemFk, packagingFk `SELECT name, itemFk, packagingFk
FROM (SELECT i.name, i.id itemFk, p.id packagingFk FROM (SELECT i.name, i.id itemFk, p.id packagingFk
@ -30,7 +31,7 @@ module.exports = Self => {
JOIN packaging p ON i.id = p.itemFk) p` JOIN packaging p ON i.id = p.itemFk) p`
); );
stmt.merge(Self.buildSuffix(filter)); stmt.merge(conn.makeSuffix(filter));
return Self.rawStmt(stmt); return conn.executeStmt(stmt);
}; };
}; };