From 394a987a05233ff3befb16b3326f60b493650c37 Mon Sep 17 00:00:00 2001 From: jgallego Date: Fri, 8 Feb 2019 09:37:11 +0100 Subject: [PATCH 1/4] defaulter no muestra negativos --- modules/client/back/models/defaulter.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/modules/client/back/models/defaulter.json b/modules/client/back/models/defaulter.json index 8d50356f1..b002fcca6 100644 --- a/modules/client/back/models/defaulter.json +++ b/modules/client/back/models/defaulter.json @@ -27,5 +27,6 @@ "model": "Client", "foreignKey": "clientFk" } - } + }, + "scope" : {"where": {"amount": {"gt": 0}}} } \ No newline at end of file From 0aefe733795c9007a2b34bd9589cbc49543d0258 Mon Sep 17 00:00:00 2001 From: Gerard Date: Fri, 8 Feb 2019 15:07:18 +0100 Subject: [PATCH 2/4] #1032 order.index buscador avanzado no se puede buscar a carlos lopez --- modules/order/front/search-panel/index.html | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/modules/order/front/search-panel/index.html b/modules/order/front/search-panel/index.html index 7b1fb7367..07dbdf1bc 100644 --- a/modules/order/front/search-panel/index.html +++ b/modules/order/front/search-panel/index.html @@ -31,11 +31,12 @@ + url="/client/api/Clients/activeWorkersWithRole" + search-function="{firstName: $search}" + value-field="id" + where="{role: 'employee'}" + label="Sales person"> {{firstName}} {{name}} From 77600d4d11a26d6c2e759b5c4b1fd508757d2516 Mon Sep 17 00:00:00 2001 From: Gerard Date: Fri, 8 Feb 2019 15:08:36 +0100 Subject: [PATCH 3/4] #1024 td-editable component created --- front/core/components/td-editable/index.html | 4 ++ front/core/components/td-editable/index.js | 44 ++++++++++++++++++++ front/core/components/td-editable/style.scss | 16 +++++++ 3 files changed, 64 insertions(+) create mode 100644 front/core/components/td-editable/index.html create mode 100644 front/core/components/td-editable/index.js create mode 100644 front/core/components/td-editable/style.scss diff --git a/front/core/components/td-editable/index.html b/front/core/components/td-editable/index.html new file mode 100644 index 000000000..14336126d --- /dev/null +++ b/front/core/components/td-editable/index.html @@ -0,0 +1,4 @@ + + + +
diff --git a/front/core/components/td-editable/index.js b/front/core/components/td-editable/index.js new file mode 100644 index 000000000..49a4c3dcd --- /dev/null +++ b/front/core/components/td-editable/index.js @@ -0,0 +1,44 @@ +import ngModule from '../../module'; +import Component from '../../lib/component'; +import './style.scss'; + +export default class Controller extends Component { + constructor($element, $scope, $transclude) { + super($element, $scope); + let element = $element[0]; + element.tabIndex = 0; + + element.addEventListener('focus', () => { + $transclude((tClone, tScope) => { + this.field = tClone; + this.tScope = tScope; + this.element.querySelector('.field').appendChild(this.field[0]); + }, null, 'field'); + element.classList.add('selected'); + }); + + element.addEventListener('focusout', event => { + this.lastEvent = event; + let target = event.relatedTarget; + while (target && target.parentNode != element) + target = target.parentNode; + + if (!target) { + this.tScope.$destroy(); + this.field.remove(); + element.classList.remove('selected'); + } + }); + } +} + +Controller.$inject = ['$element', '$scope', '$transclude']; + +ngModule.component('vnTdEditable', { + template: require('./index.html'), + controller: Controller, + transclude: { + text: 'text', + field: '?field' + } +}); diff --git a/front/core/components/td-editable/style.scss b/front/core/components/td-editable/style.scss new file mode 100644 index 000000000..563590b3d --- /dev/null +++ b/front/core/components/td-editable/style.scss @@ -0,0 +1,16 @@ +vn-td-editable { + cursor: pointer; + & > div.text-container{ + width: 100%; + } + + &.selected { + & > .text-container{ + display: none; + } + } + + vn-icon { + font-size: 1em; + } +} \ No newline at end of file From 815985e5ded7ee35f645ae4b1f683638a4363676 Mon Sep 17 00:00:00 2001 From: Gerard Date: Fri, 8 Feb 2019 15:09:47 +0100 Subject: [PATCH 4/4] #1024 th-editable --- front/core/components/index.js | 1 + front/core/components/table/style.scss | 6 +++--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/front/core/components/index.js b/front/core/components/index.js index 6cfdb9396..d967bbb9a 100644 --- a/front/core/components/index.js +++ b/front/core/components/index.js @@ -34,6 +34,7 @@ import './paging/paging'; import './pagination/pagination'; import './searchbar/searchbar'; import './table'; +import './td-editable'; import './th'; import './input-range'; import './chip'; diff --git a/front/core/components/table/style.scss b/front/core/components/table/style.scss index e5da48f29..5385386c3 100644 --- a/front/core/components/table/style.scss +++ b/front/core/components/table/style.scss @@ -64,7 +64,7 @@ vn-table { vn-th { font-weight: bold } - vn-td, vn-th { + vn-td, vn-th, vn-td-editable { vertical-align: middle; display: table-cell; text-align: left; @@ -92,14 +92,14 @@ vn-table { &.clickable { @extend %clickable; } - &.success, & > vn-td.success { + &.success, & > vn-td.success, & > vn-td-editable.success { background-color: rgba(163, 209, 49, 0.3); &:hover { background-color: rgba(163, 209, 49, 0.5); } } - &.warning, & > vn-td.warning { + &.warning, & > vn-td.warning, & > vn-td-editable.warning { background-color: rgba(247, 147, 30, 0.3); &:hover {