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" data="$ctrl.address"
form="form"> form="form">
</vn-watcher> </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> <form name="form" ng-submit="watcher.submitBack()" pad-medium>
<vn-card> <vn-card>
<vn-vertical pad-large> <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="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" field="$ctrl.client.credit"></vn-textfield>
<vn-textfield vn-one label="Crédito asegurado" field="$ctrl.client.creditInsurance"></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-horizontal>
</vn-vertical> </vn-vertical>
</vn-card> </vn-card>

View File

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

View File

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

View File

@ -25,7 +25,7 @@ module.exports = function(Address) {
function getAddress(ctx, data, next){ function getAddress(ctx, data, next){
var address = Address.findOne( {where: { id: data.id}}, function (err, address){ var address = Address.findOne( {where: { id: data.id}}, function (err, address){
if(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', { Client.validatesFormatOf('postcode', {
message: 'El código postal solo debe contener números', message: 'El código postal solo debe contener números',
allowNull: true, allowNull: true,
allowBlank: true,
with: /^\d+$/ with: /^\d+$/
}); });
Client.validatesFormatOf('email', { Client.validatesFormatOf('email', {
message: 'Correo electrónico inválido', message: 'Correo electrónico inválido',
allowNull: true, allowNull: true,
allowBlank: true,
with: /^[\w|\.|\-]+@\w[\w|\.|\-]*\w(,[\w|\.|\-]+@\w[\w|\.|\-]*\w)*$/ with: /^[\w|\.|\-]+@\w[\w|\.|\-]*\w(,[\w|\.|\-]+@\w[\w|\.|\-]*\w)*$/
}); });
Client.validatesLengthOf('postcode', { Client.validatesLengthOf('postcode', {
allowNull: true, allowNull: true,
allowBlank: true,
min: 3, max: 10 min: 3, max: 10
}); });
Client.validatesLengthOf('iban', { Client.validatesLengthOf('iban', {

View File

@ -89,7 +89,7 @@
"type": "Number" "type": "Number"
}, },
"vies": { "vies": {
"type": "Number" "type": "boolean"
}, },
"isRelevant": { "isRelevant": {
"type": "boolean" "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": { "MessageInbox": {
"dataSource": "vn", "dataSource": "vn",
"public": true "public": true
},
"Routes": {
"dataSource": "vn",
"public": true
} }
} }