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

This commit is contained in:
Dani Herrero 2017-07-03 14:50:52 +02:00
commit 76d9546355
9 changed files with 48 additions and 7 deletions

View File

@ -6,6 +6,7 @@
data="$ctrl.address"
form="form">
</vn-watcher>
<mg-ajax path="/client/api/Addresses/{{edit.params.addressId}}" actions="$ctrl.address=edit.model" options="mgEdit"></mg-ajax>
<form name="form" ng-submit="watcher.submitBack()" pad-medium>
<vn-card>
<vn-vertical pad-large>

View File

@ -24,7 +24,10 @@
<vn-textfield vn-one label="Descuento" field="$ctrl.client.discount"></vn-textfield>
<vn-textfield vn-one label="Crédito" field="$ctrl.client.credit"></vn-textfield>
<vn-textfield vn-one label="Crédito asegurado" field="$ctrl.client.creditInsurance"></vn-textfield>
<vn-check vn-three label="Recargo de equivalencia" field="$ctrl.client.equalizationTax"></vn-check>
</vn-horizontal>
<vn-horizontal>
<vn-check vn-one label="Recargo de equivalencia" field="$ctrl.client.equalizationTax"></vn-check>
<vn-check vn-one label="Vies" field="$ctrl.client.vies"></vn-check>
</vn-horizontal>
</vn-vertical>
</vn-card>

View File

@ -3,6 +3,9 @@ import './style.css';
import './item-client';
export default class Controller {
constructor() {
this.model = {};
}
search(index) {
index.filter.search = this.model.search;
index.accept();

View File

@ -41,9 +41,7 @@ module.exports = function(Client){
};
Client.app.models.Address.find(filter, function(err, instances) {
if(!err) {
cb(null, instances);
}
})
(err)? cb(err, null) : cb(null, instances);
});
};
}

View File

@ -25,7 +25,7 @@ module.exports = function(Address) {
function getAddress(ctx, data, next){
var address = Address.findOne( {where: { id: data.id}}, function (err, address){
if(address)
callbackGetAddress(ctx, data, address, next)
callbackGetAddress(ctx, data, address, next);
});
}

View File

@ -29,15 +29,18 @@ module.exports = function(Client) {
Client.validatesFormatOf('postcode', {
message: 'El código postal solo debe contener números',
allowNull: true,
allowBlank: true,
with: /^\d+$/
});
Client.validatesFormatOf('email', {
message: 'Correo electrónico inválido',
allowNull: true,
allowBlank: true,
with: /^[\w|\.|\-]+@\w[\w|\.|\-]*\w(,[\w|\.|\-]+@\w[\w|\.|\-]*\w)*$/
});
Client.validatesLengthOf('postcode', {
allowNull: true,
allowBlank: true,
min: 3, max: 10
});
Client.validatesLengthOf('iban', {

View File

@ -89,7 +89,7 @@
"type": "Number"
},
"vies": {
"type": "Number"
"type": "boolean"
},
"isRelevant": {
"type": "boolean"

View File

@ -0,0 +1,29 @@
{
"name": "Route",
"base": "MyModel",
"validateUpsert": true,
"properties": {
"id": {
"type": "Number",
"id": true,
"description": "Identifier"
},
"date": {
"type": "date"
}
},
"acls": [
{
"accessType": "READ",
"principalType": "ROLE",
"principalId": "$everyone",
"permission": "ALLOW"
},
{
"accessType": "WRITE",
"principalType": "ROLE",
"principalId": "$everyone",
"permission": "DENY"
}
]
}

View File

@ -84,6 +84,10 @@
"MessageInbox": {
"dataSource": "vn",
"public": true
},
"Routes": {
"dataSource": "vn",
"public": true
}
}