Merge branch 'dev' of http://git.verdnatura.es/salix into dev
This commit is contained in:
commit
d2a2aa08d7
|
@ -18,7 +18,7 @@
|
|||
<vn-textfield vn-one label="Street address" field="$ctrl.address.street"></vn-textfield>
|
||||
</vn-horizontal>
|
||||
<vn-horizontal>
|
||||
<vn-textfield vn-one label="Postcode" field="$ctrl.address.postcode"></vn-textfield>
|
||||
<vn-textfield vn-one label="Postcode" field="$ctrl.address.postalCode"></vn-textfield>
|
||||
<vn-textfield vn-one label="Town/City" field="$ctrl.address.city"></vn-textfield>
|
||||
<vn-autocomplete vn-one
|
||||
field="$ctrl.address.provinceFk"
|
||||
|
|
|
@ -23,7 +23,7 @@
|
|||
<vn-textfield vn-one label="Street" field="$ctrl.address.street"></vn-textfield>
|
||||
</vn-horizontal>
|
||||
<vn-horizontal>
|
||||
<vn-textfield vn-one label="Postcode" field="$ctrl.address.postcode"></vn-textfield>
|
||||
<vn-textfield vn-one label="Postcode" field="$ctrl.address.postalCode"></vn-textfield>
|
||||
<vn-textfield vn-one label="City" field="$ctrl.address.city"></vn-textfield>
|
||||
<vn-autocomplete vn-one
|
||||
initial-data="$ctrl.address.province"
|
||||
|
|
|
@ -66,8 +66,8 @@ export default class Controller {
|
|||
|
||||
submit() {
|
||||
this._unsetDirtyForm();
|
||||
let submitWatcher = this.$scope.watcher.dataChanged();
|
||||
let submitObservations;
|
||||
let canWatcherSubmit = this.$scope.watcher.dataChanged();
|
||||
let canObservationsSubmit;
|
||||
let repeatedTypes = false;
|
||||
let types = [];
|
||||
let observationsObj = {
|
||||
|
@ -95,21 +95,21 @@ export default class Controller {
|
|||
}
|
||||
}
|
||||
|
||||
submitObservations = observationsObj.update.length > 0 || observationsObj.create.length > 0 || observationsObj.delete.length > 0;
|
||||
canObservationsSubmit = observationsObj.update.length > 0 || observationsObj.create.length > 0 || observationsObj.delete.length > 0;
|
||||
|
||||
if (repeatedTypes) {
|
||||
this.vnApp.showMessage(
|
||||
this.$translate.instant('The observation type must be unique')
|
||||
);
|
||||
} else if (submitWatcher && !submitObservations) {
|
||||
} else if (canWatcherSubmit && !canObservationsSubmit) {
|
||||
this.$scope.watcher.submit().then(() => {
|
||||
this.$state.go('clientCard.addresses.list', {id: this.$state.params.id});
|
||||
});
|
||||
} else if (!submitWatcher && submitObservations) {
|
||||
} else if (!canWatcherSubmit && canObservationsSubmit) {
|
||||
this._submitObservations(observationsObj).then(() => {
|
||||
this.$state.go('clientCard.addresses.list', {id: this.$state.params.id});
|
||||
});
|
||||
} else if (submitWatcher && submitObservations) {
|
||||
} else if (canWatcherSubmit && canObservationsSubmit) {
|
||||
this.$q.all([this.$scope.watcher.submit(), this._submitObservations(observationsObj)]).then(() => {
|
||||
this.$state.go('clientCard.addresses.list', {id: this.$state.params.id});
|
||||
});
|
||||
|
|
|
@ -41,9 +41,8 @@ describe('Directive zoomImage', () => {
|
|||
it('should detroy zoom container when click outside zoomed image', () => {
|
||||
let image = getCompiledImage(`<img src="${srcDefault}" zoom-image>`);
|
||||
image[0].click();
|
||||
findContainer = document.getElementById(idContainer);
|
||||
|
||||
let findOutsideImage = findContainer.querySelector('.zoomImage-background');
|
||||
let findOutsideImage = document.querySelector('.zoomImage-background');
|
||||
findOutsideImage.click();
|
||||
|
||||
findContainer = document.getElementById(idContainer);
|
||||
|
|
|
@ -118,7 +118,7 @@
|
|||
"angular": {
|
||||
"version": "1.6.8",
|
||||
"resolved": "https://registry.npmjs.org/angular/-/angular-1.6.8.tgz",
|
||||
"integrity": "sha512-9WErZIOw1Cu1V5Yxdvxz/6YpND8ntdP71fdPpufPFJvZodZXqCjQBYrHqEoMZreO5i84O3D/Jw/vepoFt68Azw=="
|
||||
"integrity": "sha1-W+N4pYvpGlSJ54tZxFGM2f0nP/s="
|
||||
},
|
||||
"angular-cookies": {
|
||||
"version": "1.6.4",
|
||||
|
@ -5049,12 +5049,6 @@
|
|||
"integrity": "sha1-Hn1Khr9JF5gFxGIugyp7G+606IE=",
|
||||
"dev": true
|
||||
},
|
||||
"eslint-plugin-angular": {
|
||||
"version": "1.4.1",
|
||||
"resolved": "https://registry.npmjs.org/eslint-plugin-angular/-/eslint-plugin-angular-1.4.1.tgz",
|
||||
"integrity": "sha1-ekJ55yLUXg5Bm9Nik3PvXQZqoOM=",
|
||||
"dev": true
|
||||
},
|
||||
"eslint-plugin-html": {
|
||||
"version": "4.0.2",
|
||||
"resolved": "https://registry.npmjs.org/eslint-plugin-html/-/eslint-plugin-html-4.0.2.tgz",
|
||||
|
@ -11104,7 +11098,7 @@
|
|||
"karma-firefox-launcher": {
|
||||
"version": "1.1.0",
|
||||
"resolved": "https://registry.npmjs.org/karma-firefox-launcher/-/karma-firefox-launcher-1.1.0.tgz",
|
||||
"integrity": "sha512-LbZ5/XlIXLeQ3cqnCbYLn+rOVhuMIK9aZwlP6eOLGzWdo1UVp7t6CN3DP4SafiRLjexKwHeKHDm0c38Mtd3VxA==",
|
||||
"integrity": "sha1-LEcDBFLwRTHrfRPU/HZpYwu5Mzk=",
|
||||
"dev": true
|
||||
},
|
||||
"karma-jasmine": {
|
||||
|
@ -11125,7 +11119,7 @@
|
|||
"karma-webpack": {
|
||||
"version": "2.0.9",
|
||||
"resolved": "https://registry.npmjs.org/karma-webpack/-/karma-webpack-2.0.9.tgz",
|
||||
"integrity": "sha512-F1j3IG/XhiMzcunAXbWXH95uizjzr3WdTzmVWlta8xqxcCtAu9FByCb4sccIMxaVFAefpgnUW9KlCo0oLvIX6A==",
|
||||
"integrity": "sha1-YciAkffdkQY1E0wDKyZqRlr/tX8=",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"async": "0.9.2",
|
||||
|
|
|
@ -39,7 +39,6 @@
|
|||
"eslint-config-google": "^0.6.0",
|
||||
"eslint-config-loopback": "^4.0.0",
|
||||
"eslint-config-xo": "^0.17.0",
|
||||
"eslint-plugin-angular": "^1.4.1",
|
||||
"eslint-plugin-jasmine": "^2.8.4",
|
||||
"fancy-log": "^1.3.2",
|
||||
"file-loader": "^1.1.6",
|
||||
|
|
|
@ -19,12 +19,37 @@ module.exports = Self => {
|
|||
delete params.size;
|
||||
delete params.order;
|
||||
|
||||
if (params.search) {
|
||||
filter.where.and = [
|
||||
{
|
||||
or: [
|
||||
{id: params.search},
|
||||
{name: {regexp: params.search}}
|
||||
]
|
||||
}
|
||||
];
|
||||
delete params.search;
|
||||
}
|
||||
|
||||
if (params.itemSize) {
|
||||
filter.where.size = params.itemSize;
|
||||
params.size = params.itemSize;
|
||||
delete params.itemSize;
|
||||
}
|
||||
|
||||
Object.assign(filter.where, params);
|
||||
let keys = Object.keys(params);
|
||||
if (keys.length) {
|
||||
keys.forEach(
|
||||
key => {
|
||||
if (filter.where.and) {
|
||||
let filter = {};
|
||||
filter[key] = (key === 'description') ? {regexp: params[key]} : params[key];
|
||||
filter.where.and.push(filter);
|
||||
} else {
|
||||
filter.where[key] = (key === 'description') ? {regexp: params[key]} : params[key];
|
||||
}
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
return filter;
|
||||
}
|
||||
|
|
|
@ -0,0 +1,28 @@
|
|||
{
|
||||
"name": "Genus",
|
||||
"base": "VnModel",
|
||||
"options": {
|
||||
"mysql": {
|
||||
"table": "genus"
|
||||
}
|
||||
},
|
||||
"properties": {
|
||||
"genus_id": {
|
||||
"type": "Number",
|
||||
"id": true,
|
||||
"description": "Identifier"
|
||||
},
|
||||
"latin_genus_name": {
|
||||
"type": "String"
|
||||
},
|
||||
"entry_date": {
|
||||
"type": "date"
|
||||
},
|
||||
"expiry_date": {
|
||||
"type": "date"
|
||||
},
|
||||
"change_date_time": {
|
||||
"type": "date"
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,36 @@
|
|||
{
|
||||
"name": "ItemBotanical",
|
||||
"base": "VnModel",
|
||||
"options": {
|
||||
"mysql": {
|
||||
"table": "itemBotanical"
|
||||
}
|
||||
},
|
||||
"properties": {
|
||||
"itemFk": {
|
||||
"type": "Number",
|
||||
"id": true,
|
||||
"description": "Identifier"
|
||||
},
|
||||
"botanical": {
|
||||
"type": "String"
|
||||
}
|
||||
},
|
||||
"relations": {
|
||||
"item": {
|
||||
"type": "belongsTo",
|
||||
"model": "Item",
|
||||
"foreignKey": "itemFk"
|
||||
},
|
||||
"genus": {
|
||||
"type": "belongsTo",
|
||||
"model": "Genus",
|
||||
"foreignKey": "genusFk"
|
||||
},
|
||||
"specie": {
|
||||
"type": "belongsTo",
|
||||
"model": "Specie",
|
||||
"foreignKey": "specieFk"
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,26 @@
|
|||
{
|
||||
"name": "ItemPlacement",
|
||||
"base": "VnModel",
|
||||
"options": {
|
||||
"mysql": {
|
||||
"table": "itemPlacement"
|
||||
}
|
||||
},
|
||||
"properties": {
|
||||
"code": {
|
||||
"type": "String"
|
||||
}
|
||||
},
|
||||
"relations": {
|
||||
"item": {
|
||||
"type": "belongsTo",
|
||||
"model": "Item",
|
||||
"foreignKey": "itemFk"
|
||||
},
|
||||
"warehouse": {
|
||||
"type": "belongsTo",
|
||||
"model": "Warehouse",
|
||||
"foreignKey": "warehouseFk"
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,35 @@
|
|||
{
|
||||
"name": "Specie",
|
||||
"base": "VnModel",
|
||||
"options": {
|
||||
"mysql": {
|
||||
"table": "specie"
|
||||
}
|
||||
},
|
||||
"properties": {
|
||||
"specie_id": {
|
||||
"type": "Number",
|
||||
"id": true,
|
||||
"description": "Identifier"
|
||||
},
|
||||
"latin_species_name": {
|
||||
"type": "String"
|
||||
},
|
||||
"entry_date": {
|
||||
"type": "date"
|
||||
},
|
||||
"expiry_date": {
|
||||
"type": "date"
|
||||
},
|
||||
"change_date_time": {
|
||||
"type": "date"
|
||||
}
|
||||
},
|
||||
"relations": {
|
||||
"genus": {
|
||||
"type": "belongsTo",
|
||||
"model": "Genus",
|
||||
"foreignKey": "genus_id"
|
||||
}
|
||||
}
|
||||
}
|
|
@ -40,5 +40,17 @@
|
|||
},
|
||||
"ItemBarcode": {
|
||||
"dataSource": "vn"
|
||||
},
|
||||
"ItemBotanical": {
|
||||
"dataSource": "vn"
|
||||
},
|
||||
"ItemPlacement": {
|
||||
"dataSource": "vn"
|
||||
},
|
||||
"Specie": {
|
||||
"dataSource": "edi"
|
||||
},
|
||||
"Genus": {
|
||||
"dataSource": "edi"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -34,5 +34,16 @@
|
|||
"password": "",
|
||||
"connectTimeout": 20000,
|
||||
"acquireTimeout": 20000
|
||||
},
|
||||
"edi": {
|
||||
"connector": "mysql",
|
||||
"database": "edi",
|
||||
"debug": false,
|
||||
"host": "localhost",
|
||||
"port": 3306,
|
||||
"username": "root",
|
||||
"password": "",
|
||||
"connectTimeout": 20000,
|
||||
"acquireTimeout": 20000
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue