Merge branch 'dev' of https://git.verdnatura.es/salix into dev
This commit is contained in:
commit
76d9546355
|
@ -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>
|
||||||
|
|
|
@ -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>
|
||||||
|
|
|
@ -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();
|
||||||
|
|
|
@ -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);
|
});
|
||||||
}
|
|
||||||
})
|
|
||||||
};
|
};
|
||||||
}
|
}
|
|
@ -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);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -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', {
|
||||||
|
|
|
@ -89,7 +89,7 @@
|
||||||
"type": "Number"
|
"type": "Number"
|
||||||
},
|
},
|
||||||
"vies": {
|
"vies": {
|
||||||
"type": "Number"
|
"type": "boolean"
|
||||||
},
|
},
|
||||||
"isRelevant": {
|
"isRelevant": {
|
||||||
"type": "boolean"
|
"type": "boolean"
|
||||||
|
|
|
@ -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"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
|
@ -84,6 +84,10 @@
|
||||||
"MessageInbox": {
|
"MessageInbox": {
|
||||||
"dataSource": "vn",
|
"dataSource": "vn",
|
||||||
"public": true
|
"public": true
|
||||||
|
},
|
||||||
|
"Routes": {
|
||||||
|
"dataSource": "vn",
|
||||||
|
"public": true
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue