From 7dd82cac19361c98955d2dc709788959acb5906c Mon Sep 17 00:00:00 2001
From: nelo
Date: Tue, 17 Jan 2017 11:26:59 +0100
Subject: [PATCH 1/4] =?UTF-8?q?Boton=20redondo=20Arreglado=20detalles=20de?=
=?UTF-8?q?=20dise=C3=B1o=20en=20consignatarios?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../src/components/left-menu/menu-item.html | 10 ++--
@salix/core/src/card/card.js | 2 +-
@salix/core/src/core.js | 2 +
@salix/core/src/floatbutton/floatbutton.js | 19 +++++++
.../core/src/floatbutton/floatbutton.mdl.html | 3 +
.../core/src/floatbutton/floatbutton.mdl.js | 20 +++++++
.../client/addresses-data-create/index.html | 54 +++++++++---------
.../src/client/addresses-data-edit/index.html | 56 +++++++++----------
@salix/crud/src/client/addresses/index.html | 46 ++++++++-------
@salix/crud/src/client/basic-data/index.html | 5 +-
@salix/crud/src/client/card/card.html | 21 ++++---
.../src/client/descriptor/descriptor.html | 2 +-
@salix/crud/src/client/fiscal-data/index.html | 14 ++---
services/client/common/models/Client.json | 3 +
14 files changed, 150 insertions(+), 107 deletions(-)
create mode 100644 @salix/core/src/floatbutton/floatbutton.js
create mode 100644 @salix/core/src/floatbutton/floatbutton.mdl.html
create mode 100644 @salix/core/src/floatbutton/floatbutton.mdl.js
diff --git a/@salix/app/src/components/left-menu/menu-item.html b/@salix/app/src/components/left-menu/menu-item.html
index 3f38ba07e5..5bffa626d4 100644
--- a/@salix/app/src/components/left-menu/menu-item.html
+++ b/@salix/app/src/components/left-menu/menu-item.html
@@ -1,7 +1,7 @@
-
- keyboard_arrow_right
- {{menu.item.icon}}
- {{menu.item.description}}
-
+
+ keyboard_arrow_right
+ {{menu.item.icon}}
+ {{menu.item.description}}
+
\ No newline at end of file
diff --git a/@salix/core/src/card/card.js b/@salix/core/src/card/card.js
index 1dfe2ccc61..01f3118be4 100644
--- a/@salix/core/src/card/card.js
+++ b/@salix/core/src/card/card.js
@@ -9,7 +9,7 @@ export const NAME = util.getName(_NAME);
directive.$inject = [resolveFactory.NAME];
export function directive(resolve) {
return {
- require: 'E',
+ restrict: 'E',
transclude: true,
template: function(_, attr) {
return resolve.getTemplate(_NAME, attr);
diff --git a/@salix/core/src/core.js b/@salix/core/src/core.js
index 5c2e9a2da5..3c98db40b6 100644
--- a/@salix/core/src/core.js
+++ b/@salix/core/src/core.js
@@ -46,6 +46,8 @@ export {NAME as CARD, directive as CardDirective} from './card/card';
export {NAME as CARD_MDL, factory as cardMdl} from './card/card.mdl';
export {NAME as SWITCH, directive as SwitchDirective} from './switch/switch';
export {NAME as SWITCH_MDL, factory as switchdMdl} from './switch/switch.mdl';
+export {NAME as FLOATBUTTON, directive as FloatButtonDirective} from './floatbutton/floatbutton';
+export {NAME as FLOATBUTTON_MDL, factory as floatButtondMdl} from './floatbutton/floatbutton.mdl';
export {directive as Icon} from './icon/icon';
export {factory as IconMdl} from './icon/icon.mdl';
diff --git a/@salix/core/src/floatbutton/floatbutton.js b/@salix/core/src/floatbutton/floatbutton.js
new file mode 100644
index 0000000000..276ae4618e
--- /dev/null
+++ b/@salix/core/src/floatbutton/floatbutton.js
@@ -0,0 +1,19 @@
+import {module as _module} from '../module';
+import * as resolveFactory from '../resolveDefaultComponents';
+import * as util from '../util';
+
+const _NAME = 'floatButton';
+export const NAME = util.getName(_NAME);
+
+directive.$inject = [resolveFactory.NAME];
+export function directive(resolve) {
+ return {
+ restrict: 'E',
+ template: function(_, attr) {
+ return resolve.getTemplate(_NAME, attr);
+ }
+ };
+}
+
+_module.directive(NAME, directive);
+
diff --git a/@salix/core/src/floatbutton/floatbutton.mdl.html b/@salix/core/src/floatbutton/floatbutton.mdl.html
new file mode 100644
index 0000000000..14618c3d21
--- /dev/null
+++ b/@salix/core/src/floatbutton/floatbutton.mdl.html
@@ -0,0 +1,3 @@
+
\ No newline at end of file
diff --git a/@salix/core/src/floatbutton/floatbutton.mdl.js b/@salix/core/src/floatbutton/floatbutton.mdl.js
new file mode 100644
index 0000000000..3a7c5a3d3f
--- /dev/null
+++ b/@salix/core/src/floatbutton/floatbutton.mdl.js
@@ -0,0 +1,20 @@
+import {module as _module} from '../module';
+import * as util from '../util';
+import * as constant from '../constants';
+import template from './floatbutton.mdl.html';
+
+const _NAME = 'floatButton';
+const DEFAULT_CLASS = 'mdl-button mdl-js-button mdl-button--fab mdl-js-ripple-effect mdl-button--colored';
+
+export const NAME = util.getFactoryName(_NAME + constant.MATERIAL_DESIGN_FRAMEWORK);
+
+export function factory() {
+ return {
+ template: template,
+ default: {
+ className: DEFAULT_CLASS
+ }
+ };
+}
+
+_module.factory(NAME, factory);
diff --git a/@salix/crud/src/client/addresses-data-create/index.html b/@salix/crud/src/client/addresses-data-create/index.html
index fb97f1a086..a962380f82 100644
--- a/@salix/crud/src/client/addresses-data-create/index.html
+++ b/@salix/crud/src/client/addresses-data-create/index.html
@@ -1,31 +1,31 @@
\ No newline at end of file
diff --git a/@salix/crud/src/client/addresses-data-edit/index.html b/@salix/crud/src/client/addresses-data-edit/index.html
index 2fbdc24a22..4578044eea 100644
--- a/@salix/crud/src/client/addresses-data-edit/index.html
+++ b/@salix/crud/src/client/addresses-data-edit/index.html
@@ -1,32 +1,32 @@
\ No newline at end of file
diff --git a/@salix/crud/src/client/addresses/index.html b/@salix/crud/src/client/addresses/index.html
index f563071b92..4160250d33 100644
--- a/@salix/crud/src/client/addresses/index.html
+++ b/@salix/crud/src/client/addresses/index.html
@@ -1,27 +1,25 @@
-
-
-
- Consignatario
-
-
-
-
-
- {{i.consignee}}
- {{i.street}}
- {{i.city}}, {{i.province}}
- {{i.phone}}, {{i.mobile}}
-
-
+
+
+
+ Consignatario
-
-
-
-
-
-
-
-
-
+
+
+
+
+ {{i.consignee}}
+ {{i.street}}
+ {{i.city}}, {{i.province}}
+ {{i.phone}}, {{i.mobile}}
+
+
+
+
+
+
+
+
+
+
diff --git a/@salix/crud/src/client/basic-data/index.html b/@salix/crud/src/client/basic-data/index.html
index b9105cfdfc..77302f8a8e 100644
--- a/@salix/crud/src/client/basic-data/index.html
+++ b/@salix/crud/src/client/basic-data/index.html
@@ -9,15 +9,16 @@
+
-
+
-
+
diff --git a/@salix/crud/src/client/card/card.html b/@salix/crud/src/client/card/card.html
index 029eaf3532..124f988fda 100644
--- a/@salix/crud/src/client/card/card.html
+++ b/@salix/crud/src/client/card/card.html
@@ -1,11 +1,14 @@
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/@salix/crud/src/client/descriptor/descriptor.html b/@salix/crud/src/client/descriptor/descriptor.html
index 74cef41ddd..c6a198de2d 100644
--- a/@salix/crud/src/client/descriptor/descriptor.html
+++ b/@salix/crud/src/client/descriptor/descriptor.html
@@ -5,7 +5,7 @@
person
- {{descriptor.client.clientId}}
+ {{descriptor.client.id}}
{{descriptor.client.name}}
{{descriptor.client.phone}}
diff --git a/@salix/crud/src/client/fiscal-data/index.html b/@salix/crud/src/client/fiscal-data/index.html
index 11b7f39496..ffa74f5fc4 100644
--- a/@salix/crud/src/client/fiscal-data/index.html
+++ b/@salix/crud/src/client/fiscal-data/index.html
@@ -4,7 +4,6 @@
Datos fiscales y de facturación
-
@@ -21,12 +20,7 @@
-
-
-
-
-
-
+
@@ -56,8 +50,8 @@
+
+
+
-
-
-
diff --git a/services/client/common/models/Client.json b/services/client/common/models/Client.json
index c960019961..6114b676fa 100644
--- a/services/client/common/models/Client.json
+++ b/services/client/common/models/Client.json
@@ -43,6 +43,9 @@
"phone": {
"type": "string"
},
+ "mobile": {
+ "type": "string"
+ },
"fax": {
"type": "string"
},
From 8f372a7331ca8409e1df4390f9db950cb5a80009 Mon Sep 17 00:00:00 2001
From: nelo
Date: Tue, 17 Jan 2017 12:24:32 +0100
Subject: [PATCH 2/4] =?UTF-8?q?modificaci=C3=B3n=20estilos=20css?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
@salix/core/src/floatbutton/floatbutton.mdl.html | 2 +-
@salix/core/src/icon-button/icon-button.mdl.html | 4 ++--
@salix/core/src/icon/icon.mdl.html | 2 +-
@salix/core/src/mdl-override.css | 5 +++++
4 files changed, 9 insertions(+), 4 deletions(-)
diff --git a/@salix/core/src/floatbutton/floatbutton.mdl.html b/@salix/core/src/floatbutton/floatbutton.mdl.html
index 14618c3d21..d9467b5ce8 100644
--- a/@salix/core/src/floatbutton/floatbutton.mdl.html
+++ b/@salix/core/src/floatbutton/floatbutton.mdl.html
@@ -1,3 +1,3 @@
-
- Aceptar
- Cancelar
+ Aceptar
+ Cancelar
\ No newline at end of file
diff --git a/@salix/crud/src/client/confirm/index.js b/@salix/crud/src/client/confirm/index.js
index 5d4c2615c0..f9c3400bb1 100644
--- a/@salix/crud/src/client/confirm/index.js
+++ b/@salix/crud/src/client/confirm/index.js
@@ -1,28 +1,27 @@
import template from './index.html';
import {module} from '../../module';
-export const NAME = 'vnConfirmClient';
+export const NAME = 'vnDialogConfirm';
export const COMPONENT = {
template: template,
- controllerAs: 'clientConfirm',
+ controllerAs: 'dialogConfirm',
bindings: {
state: '<',
- client: '=',
- clientOld: "="
+ object: '=',
+ objectOld: "="
},
- controller: function($state, $element, copyObject){
-
- var dialog = $element.find('dialog')[0]
+ controller: function($state, $element, copyObject) {
+ var dialog = $element.find('dialog')[0];
- this.accept = function(){
- copyObject(this.clientOld, this.client);
+ this.accept = function() {
+ copyObject(this.objectOld, this.object);
$state.go(this.state);
dialog.close();
- }
+ };
- this.cancel = function(){
+ this.cancel = function() {
dialog.close();
- }
+ };
}
};
COMPONENT.controller.$inject = ['$state', '$element', 'copyObject'];
diff --git a/@salix/crud/src/client/fiscal-data/index.html b/@salix/crud/src/client/fiscal-data/index.html
index 11b7f39496..d7008b4de6 100644
--- a/@salix/crud/src/client/fiscal-data/index.html
+++ b/@salix/crud/src/client/fiscal-data/index.html
@@ -60,4 +60,4 @@
-
+
diff --git a/@salix/crud/src/client/fiscal-data/index.js b/@salix/crud/src/client/fiscal-data/index.js
index bccda409d0..401c22d970 100644
--- a/@salix/crud/src/client/fiscal-data/index.js
+++ b/@salix/crud/src/client/fiscal-data/index.js
@@ -9,14 +9,13 @@ export const COMPONENT = {
client: '<'
},
controller: function($http, copyObject, equalsObject, $transitions, $element) {
-
var self = this;
var deregister = $transitions.onStart({ }, callback);
-
+
$http.get('/client/api/Countries').then(
json => this.countries = json.data
);
-
+
$http.get('/client/api/Provinces').then(
json => this.provinces = json.data
);
@@ -24,7 +23,7 @@ export const COMPONENT = {
$http.get('/client/api/PaymentMethods').then(
json => this.payments = json.data
);
-
+
this.submit = function() {
if (!equalsObject(this.client, this.clientOld)) {
this.client.modify = "FiscalData";
diff --git a/@salix/crud/src/client/index/index.js b/@salix/crud/src/client/index/index.js
index d62cb27cfe..3830a3e373 100644
--- a/@salix/crud/src/client/index/index.js
+++ b/@salix/crud/src/client/index/index.js
@@ -12,13 +12,12 @@ export const COMPONENT = {
var where = null;
var filter = this.filter;
var queryStr = '/client/api/Clients';
-
var search = filter.search;
- if(search)
+ if (search)
where = {name: {ilike: search}};
var params = filter.params;
- if(params) {
+ if (params) {
where = {};
let partials = {
alias: true,
@@ -26,18 +25,18 @@ export const COMPONENT = {
socialName: true,
city: true,
email: true
- }
- for(let param in params)
- if (params[param]) {
- if(partials[param])
- where[param] = {ilike: params[param]};
- else
+ };
+ for (let param in params)
+ if (params[param]) {
+ if (partials[param])
+ where[param] = {ilike: params[param]};
+ else
where[param] = params[param];
- }
+ }
filter.params = undefined;
}
- if(where) {
+ if (where) {
let json = JSON.stringify({where: where});
queryStr = `${queryStr}?filter=${json}`;
}
diff --git a/@salix/crud/src/client/web-access/index.html b/@salix/crud/src/client/web-access/index.html
index 540ee47e7f..b8dae30c3a 100644
--- a/@salix/crud/src/client/web-access/index.html
+++ b/@salix/crud/src/client/web-access/index.html
@@ -2,12 +2,12 @@
Acceso Web
-
-
+
+
-
+
-
+
diff --git a/@salix/crud/src/client/web-access/index.js b/@salix/crud/src/client/web-access/index.js
index b123c888d6..de7d2216e0 100644
--- a/@salix/crud/src/client/web-access/index.js
+++ b/@salix/crud/src/client/web-access/index.js
@@ -9,17 +9,16 @@ export const COMPONENT = {
client: '<'
},
controller: function($http, copyObject, equalsObject, $transitions, $element) {
-
var self = this;
var deregister = $transitions.onStart({ }, callback);
-
+
this.submit = function() {
- if (!equalsObject(this.client, this.clientOld)) {
+ if (!equalsObject(this.account, this.accountOld)) {
this.client.modify = "WebAccess";
- $http.put('/client/api/Clients', this.client).then(
+ $http.put(`/client/api/Accounts/${this.account.id}`, this.account).then(
json => {
- this.client = json.data;
- this.copyClient();
+ this.account = json.data;
+ self.copyAccount();
}
);
}
@@ -27,7 +26,7 @@ export const COMPONENT = {
this.$onChanges = function(changes) {
if (this.client) {
- this.copyClient();
+ this.getAccount(this.client.id);
}
};
@@ -36,7 +35,7 @@ export const COMPONENT = {
};
function callback(transition) {
- if (!equalsObject(self.client, self.clientOld)) {
+ if (!equalsObject(self.account, self.accountOld)) {
self.state = transition.to().name;
var dialog = $element[0].querySelector('dialog');
dialog.showModal();
@@ -44,9 +43,21 @@ export const COMPONENT = {
}
}
- this.copyClient = function() {
- this.clientOld = {};
- copyObject(this.client, this.clientOld);
+ this.copyAccount = function() {
+ this.accountOld = {};
+ copyObject(this.account, this.accountOld);
+ };
+
+ this.getAccount = function(clientId) {
+ $http.get(`/client/api/Accounts/${clientId}`).then(
+ json => {
+ this.account = json.data;
+ this.copyAccount();
+ },
+ json => {
+ this.account = {id: clientId};
+ }
+ );
};
}
};
diff --git a/db.json b/db.json
index 4e3bc286f6..67d09dd6b6 100644
--- a/db.json
+++ b/db.json
@@ -8,7 +8,8 @@
"Address": 58,
"Country": 3,
"Province": 3,
- "Agency": 4
+ "Agency": 4,
+ "Account": 14
},
"models": {
"User": {
@@ -49,6 +50,10 @@
"1": "{\"name\":\"Zeleris\",\"id\":1}",
"2": "{\"name\":\"MRW\",\"id\":2}",
"3": "{\"name\":\"DHL\",\"id\":3}"
+ },
+ "Account": {
+ "12": "{\"id\":12,\"name\":\"prueba12\",\"active\":false,\"user\":\"juanete\"}",
+ "13": "{\"id\":13,\"name\":\"manu\",\"active\":false,\"user\":\"joselito\"}"
}
}
}
\ No newline at end of file
diff --git a/services/client/common/models/account.json b/services/client/common/models/account.json
index 8a18abc759..af3254ad95 100644
--- a/services/client/common/models/account.json
+++ b/services/client/common/models/account.json
@@ -1,5 +1,5 @@
{
- "name": "account",
+ "name": "Account",
"base": "PersistedModel",
"properties": {
"id": {
diff --git a/services/client/server/model-config.json b/services/client/server/model-config.json
index cdeb2a7191..30d28228c5 100644
--- a/services/client/server/model-config.json
+++ b/services/client/server/model-config.json
@@ -63,5 +63,9 @@
"ClientObservation": {
"dataSource": "db",
"public": true
+ },
+ "Account": {
+ "dataSource": "db",
+ "public": true
}
}
\ No newline at end of file
From ec5c70ed94f4633a4f90c77b80fb285c02c415cd Mon Sep 17 00:00:00 2001
From: nelo
Date: Tue, 17 Jan 2017 13:03:04 +0100
Subject: [PATCH 4/4] modificaciones estilos
---
.../crud/src/client/addresses-data-create/index.js | 12 +++++++-----
@salix/crud/src/client/index/style.css | 3 ++-
2 files changed, 9 insertions(+), 6 deletions(-)
diff --git a/@salix/crud/src/client/addresses-data-create/index.js b/@salix/crud/src/client/addresses-data-create/index.js
index b202e2dfdc..b426bddb43 100644
--- a/@salix/crud/src/client/addresses-data-create/index.js
+++ b/@salix/crud/src/client/addresses-data-create/index.js
@@ -5,7 +5,7 @@ export const NAME = 'vnClientAddressesDataCreate';
export const COMPONENT = {
template: template,
controllerAs: 'addressData',
- controller: function($http)
+ controller: function($http, $state)
{
this.address = {};
$http.get('/client/api/Agencies').then(
@@ -16,10 +16,12 @@ export const COMPONENT = {
);
this.submit = function(){
- $http.post('/client/api/Addresses', this.address);
- }
- }
+ $http.post('/client/api/Addresses', this.address).then(
+ json => $state.go('clientCard.addresses')
+ );
+ };
+ }
}
-COMPONENT.controller.$inject = ['$http'];
+COMPONENT.controller.$inject = ['$http', '$state'];
module.component(NAME, COMPONENT);
diff --git a/@salix/crud/src/client/index/style.css b/@salix/crud/src/client/index/style.css
index 5329ae7426..7e56420c48 100644
--- a/@salix/crud/src/client/index/style.css
+++ b/@salix/crud/src/client/index/style.css
@@ -7,7 +7,8 @@ vn-item-client a {
color: inherit;
}
vn-item-client a:hover {
- background-color: rgba(0, 0, 0, .1);
+ color: white;
+ background-color: #424242;
}
.vn-item-client-name{