From f510ce5e9df9fdfc91b293cb253a92caa9194c9a Mon Sep 17 00:00:00 2001 From: nelo Date: Mon, 9 Jan 2017 14:58:44 +0100 Subject: [PATCH] vn-switch cambio campos obligatorios cliente eliminado campo fecha de alta --- @salix/core/src/core.js | 2 ++ @salix/core/src/switch/switch.js | 28 ++++++++++++++++ @salix/core/src/switch/switch.mdl.html | 4 +++ @salix/core/src/switch/switch.mdl.js | 21 ++++++++++++ @salix/crud/src/client/basic-data/index.html | 6 ++-- @salix/crud/src/client/basic-data/index.js | 3 +- @salix/crud/src/client/card/card.html | 2 +- @salix/crud/src/client/card/card.js | 4 ++- @salix/crud/src/client/card/style.css | 3 ++ @salix/crud/src/client/create/index.html | 33 +++++++++++-------- .../src/client/descriptor/descriptor.html | 23 +++++++------ .../crud/src/client/descriptor/descriptor.js | 1 + @salix/crud/src/client/descriptor/style.css | 3 ++ @salix/crud/src/client/index/item-client.html | 6 ++-- @salix/crud/src/client/index/style.css | 4 +++ services/client/common/models/Client.json | 12 +++---- 16 files changed, 113 insertions(+), 42 deletions(-) create mode 100644 @salix/core/src/switch/switch.js create mode 100644 @salix/core/src/switch/switch.mdl.html create mode 100644 @salix/core/src/switch/switch.mdl.js create mode 100644 @salix/crud/src/client/card/style.css create mode 100644 @salix/crud/src/client/descriptor/style.css diff --git a/@salix/core/src/core.js b/@salix/core/src/core.js index 45eeb58bc..b0b011074 100644 --- a/@salix/core/src/core.js +++ b/@salix/core/src/core.js @@ -42,6 +42,8 @@ export {NAME as DATE_PICKER, directive as DatePickerDirective} from './date-pick export {NAME as DATE_PICKER_MDL, factory as datePickerMdl} from './date-picker/date-picker.mdl'; 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 {directive as Popover} from './popover/popover'; export {factory as PopoverMdl} from './popover/popover.mdl'; diff --git a/@salix/core/src/switch/switch.js b/@salix/core/src/switch/switch.js new file mode 100644 index 000000000..506d7c5ca --- /dev/null +++ b/@salix/core/src/switch/switch.js @@ -0,0 +1,28 @@ +import {module as _module} from '../module'; +import * as resolveFactory from '../resolveDefaultComponents'; +import * as normalizerFactory from '../inputAttrsNormalizer'; +import * as util from '../util'; + +const _NAME = 'switch'; +export const NAME = util.getName(_NAME); + +directive.$inject = [resolveFactory.NAME, normalizerFactory.NAME]; +export function directive(resolve, normalizer) { + return { + restrict: 'E', + template: function(_, attrs) { + normalizer.normalize(attrs); + return resolve.getTemplate(_NAME, attrs); + }, + link: function(scope, element, attrs) { + scope.$watch(attrs.model, () => { + let mdlField = element[0].firstChild.MaterialSwitch; + if (mdlField) + mdlField.updateClasses_(); + }); + } + }; +} + +_module.directive(NAME, directive); + diff --git a/@salix/core/src/switch/switch.mdl.html b/@salix/core/src/switch/switch.mdl.html new file mode 100644 index 000000000..845e1b951 --- /dev/null +++ b/@salix/core/src/switch/switch.mdl.html @@ -0,0 +1,4 @@ + \ No newline at end of file diff --git a/@salix/core/src/switch/switch.mdl.js b/@salix/core/src/switch/switch.mdl.js new file mode 100644 index 000000000..c88b1d996 --- /dev/null +++ b/@salix/core/src/switch/switch.mdl.js @@ -0,0 +1,21 @@ +import {module as _module} from '../module'; +import * as util from '../util'; +import * as constant from '../constants'; +import template from './switch.mdl.html'; + +const _NAME = 'switch'; +const DEFAULT_CLASS = 'mdl-switch__input'; + +export const NAME = util.getFactoryName(_NAME + constant.MATERIAL_DESIGN_FRAMEWORK); + +export function factory() { + return { + template: template, + default: { + className: DEFAULT_CLASS, + label: "" + } + } +} + +_module.factory(NAME, factory); diff --git a/@salix/crud/src/client/basic-data/index.html b/@salix/crud/src/client/basic-data/index.html index b999d5509..aeb0eb2d1 100644 --- a/@salix/crud/src/client/basic-data/index.html +++ b/@salix/crud/src/client/basic-data/index.html @@ -5,13 +5,10 @@ - - - - + @@ -19,6 +16,7 @@ + diff --git a/@salix/crud/src/client/basic-data/index.js b/@salix/crud/src/client/basic-data/index.js index 4f4a41754..a883e09b3 100644 --- a/@salix/crud/src/client/basic-data/index.js +++ b/@salix/crud/src/client/basic-data/index.js @@ -6,9 +6,10 @@ export const COMPONENT = { template: template, controllerAs: 'basicData', bindings: { - client: '<' + client: '=' }, controller: function($http) { + $http.get('/client/api/SalesPeople').then( json => this.sales = json.data, json => console.error(json.data.error.message) diff --git a/@salix/crud/src/client/card/card.html b/@salix/crud/src/client/card/card.html index 84cae97d3..57bd9441d 100644 --- a/@salix/crud/src/client/card/card.html +++ b/@salix/crud/src/client/card/card.html @@ -1,7 +1,7 @@ - + diff --git a/@salix/crud/src/client/card/card.js b/@salix/crud/src/client/card/card.js index dd44f8eb6..e38652026 100644 --- a/@salix/crud/src/client/card/card.js +++ b/@salix/crud/src/client/card/card.js @@ -1,3 +1,4 @@ +import './style.css'; import template from './card.html'; import {module} from '../../module'; @@ -15,7 +16,8 @@ export const COMPONENT = { this.descriptor = { clientId: this.client.id, name: this.client.name, - phone: this.client.phone + phone: this.client.phone, + active: this.client.active }; }, json => console.error(json.data.error.message) diff --git a/@salix/crud/src/client/card/style.css b/@salix/crud/src/client/card/style.css new file mode 100644 index 000000000..f788e35c6 --- /dev/null +++ b/@salix/crud/src/client/card/style.css @@ -0,0 +1,3 @@ +vn-descriptor{ + font-family: raleway-bold; +} \ No newline at end of file diff --git a/@salix/crud/src/client/create/index.html b/@salix/crud/src/client/create/index.html index 7b563bc80..c1df86615 100644 --- a/@salix/crud/src/client/create/index.html +++ b/@salix/crud/src/client/create/index.html @@ -1,16 +1,21 @@ +
- Crear Cliente - - - - - - - - - - - - - + + + Crear Cliente + + + + + + + + + + + + + + +
\ No newline at end of file diff --git a/@salix/crud/src/client/descriptor/descriptor.html b/@salix/crud/src/client/descriptor/descriptor.html index 2f103ed59..cdd9bec0c 100644 --- a/@salix/crud/src/client/descriptor/descriptor.html +++ b/@salix/crud/src/client/descriptor/descriptor.html @@ -1,12 +1,15 @@ - - - person - - -
{{descriptor.descriptor.clientId}}
-
{{descriptor.descriptor.name}}
-
{{descriptor.descriptor.phone}}
-
-
+ + + + person + + +
{{descriptor.descriptor.clientId}}
+
{{descriptor.descriptor.name}}
+
{{descriptor.descriptor.phone}}
+
+
+ +
diff --git a/@salix/crud/src/client/descriptor/descriptor.js b/@salix/crud/src/client/descriptor/descriptor.js index 012ad8f5d..36de83103 100644 --- a/@salix/crud/src/client/descriptor/descriptor.js +++ b/@salix/crud/src/client/descriptor/descriptor.js @@ -1,3 +1,4 @@ +import './style.css'; import template from './descriptor.html'; import {module} from '../../module'; diff --git a/@salix/crud/src/client/descriptor/style.css b/@salix/crud/src/client/descriptor/style.css new file mode 100644 index 000000000..d5f633d8c --- /dev/null +++ b/@salix/crud/src/client/descriptor/style.css @@ -0,0 +1,3 @@ +.descriptor-icon{ + font-size:60px; +} \ No newline at end of file diff --git a/@salix/crud/src/client/index/item-client.html b/@salix/crud/src/client/index/item-client.html index 8e29478bd..a5812c4d9 100644 --- a/@salix/crud/src/client/index/item-client.html +++ b/@salix/crud/src/client/index/item-client.html @@ -1,11 +1,11 @@ -
{{itemClient.client.name}}
-
{{itemClient.client.phone}}, {{itemClient.client.contact}}
+
{{itemClient.client.name}}
+
{{itemClient.client.id}}
- +
\ No newline at end of file diff --git a/@salix/crud/src/client/index/style.css b/@salix/crud/src/client/index/style.css index d12d1c754..5329ae742 100644 --- a/@salix/crud/src/client/index/style.css +++ b/@salix/crud/src/client/index/style.css @@ -8,4 +8,8 @@ vn-item-client a { } vn-item-client a:hover { background-color: rgba(0, 0, 0, .1); +} + +.vn-item-client-name{ + font-family: raleway-bold; } \ No newline at end of file diff --git a/services/client/common/models/Client.json b/services/client/common/models/Client.json index 80ac6775a..a965ffd4a 100644 --- a/services/client/common/models/Client.json +++ b/services/client/common/models/Client.json @@ -25,16 +25,13 @@ "type": "string" }, "street": { - "type": "string", - "required": "true" + "type": "string" }, "consignee": { - "type": "string", - "required": "true" + "type": "string" }, "city": { - "type": "string", - "required": "true" + "type": "string" }, "postcode": { "type": "string" @@ -43,8 +40,7 @@ "type": "Number" }, "country": { - "type": "string", - "required": "true" + "type": "string" }, "email": { "type": "string"