From 87add6cd337a4edb0d5131ccab9aea47330b5fbf Mon Sep 17 00:00:00 2001 From: Juan Ferrer Toribio Date: Wed, 2 Oct 2019 19:24:42 +0200 Subject: [PATCH] vnDataViewer --- front/core/components/data-viewer/index.html | 25 +++ front/core/components/data-viewer/index.js | 39 ++++ front/core/components/data-viewer/style.scss | 14 ++ front/core/components/index.js | 1 + front/core/components/table/index.html | 11 +- front/core/components/table/index.js | 12 -- front/salix/styles/list.scss | 2 +- front/salix/styles/variables.scss | 2 +- modules/agency/front/basic-data/index.html | 16 +- modules/agency/front/events/index.html | 17 +- modules/agency/front/exclusions/index.html | 39 ++-- modules/agency/front/index/index.html | 33 ++-- modules/agency/front/warehouses/index.html | 15 +- modules/client/front/address/index/index.html | 129 ++++++------- modules/client/front/balance/index/index.html | 14 +- .../front/credit-insurance/index/index.html | 103 +++++----- modules/client/front/credit/index/index.html | 43 +++-- modules/client/front/dms/index/index.html | 179 +++++++++--------- modules/client/front/greuge/index/index.html | 7 +- modules/client/front/index/index.html | 81 ++++---- modules/client/front/mandate/index.html | 50 ++--- modules/client/front/note/index/index.html | 10 +- .../client/front/recovery/index/index.html | 68 +++---- modules/client/front/sample/index/index.html | 19 +- modules/client/front/web-payment/index.html | 91 ++++----- .../client/front/web-payment/locale/es.yml | 1 - modules/worker/front/log/index.html | 6 +- 27 files changed, 554 insertions(+), 473 deletions(-) create mode 100644 front/core/components/data-viewer/index.html create mode 100644 front/core/components/data-viewer/index.js create mode 100644 front/core/components/data-viewer/style.scss diff --git a/front/core/components/data-viewer/index.html b/front/core/components/data-viewer/index.html new file mode 100644 index 000000000..1a5a76ef8 --- /dev/null +++ b/front/core/components/data-viewer/index.html @@ -0,0 +1,25 @@ +
+
+ + +
+
+ + + + Enter a new search + + + No results + +
\ No newline at end of file diff --git a/front/core/components/data-viewer/index.js b/front/core/components/data-viewer/index.js new file mode 100644 index 000000000..2ec61ee5a --- /dev/null +++ b/front/core/components/data-viewer/index.js @@ -0,0 +1,39 @@ +import ngModule from '../../module'; +import './style.scss'; + +export default class DataViewer { + get computedData() { + return this.data || (this.model && this.model.data); + } + + get computedLoading() { + return this.isLoading || (this.model && this.model.isRefreshing); + } + + get hasData() { + let data = this.computedData; + return data && data.length; + } + + get status() { + if (this.hasData) + return null; + if (this.computedLoading) + return 'loading'; + if (this.computedData) + return 'empty'; + else + return 'clear'; + } +} + +ngModule.component('vnDataViewer', { + template: require('./index.html'), + transclude: true, + controller: DataViewer, + bindings: { + model: ' .empty-rows { + display: block; + text-align: center; + padding: 1.5em; + box-sizing: border-box; + color: $color-font-secondary; + font-size: 1.4em; + } +} \ No newline at end of file diff --git a/front/core/components/index.js b/front/core/components/index.js index e8adb008e..54f9f18f2 100644 --- a/front/core/components/index.js +++ b/front/core/components/index.js @@ -37,6 +37,7 @@ import './calendar'; import './check'; import './chip'; import './color-legend'; +import './data-viewer'; import './input-number'; import './input-time'; import './input-file'; diff --git a/front/core/components/table/index.html b/front/core/components/table/index.html index a5abd1c66..e7ae44886 100644 --- a/front/core/components/table/index.html +++ b/front/core/components/table/index.html @@ -1,11 +1,2 @@ -
- - - - - Enter a new search - - - No results - +
\ No newline at end of file diff --git a/front/core/components/table/index.js b/front/core/components/table/index.js index d091e8345..352a39b4a 100644 --- a/front/core/components/table/index.js +++ b/front/core/components/table/index.js @@ -8,18 +8,6 @@ export default class Table { this.field = null; this.order = null; this.autoLoad = true; - - $transclude($scope.$parent, clone => { - angular.element($element[0].querySelector('.table')).append(clone); - }); - } - - get isRefreshing() { - return (this.model && this.model.isRefreshing); - } - - get isPaging() { - return (this.model && this.model.isPaging); } setOrder(field, order) { diff --git a/front/salix/styles/list.scss b/front/salix/styles/list.scss index c483feca1..3a6d0d6d9 100644 --- a/front/salix/styles/list.scss +++ b/front/salix/styles/list.scss @@ -1,7 +1,7 @@ @import "./effects"; .vn-list { - max-width: 36em; + max-width: $width-sm; margin: 0 auto; a.vn-list-item { diff --git a/front/salix/styles/variables.scss b/front/salix/styles/variables.scss index 6bc311c33..932596ef9 100644 --- a/front/salix/styles/variables.scss +++ b/front/salix/styles/variables.scss @@ -6,7 +6,7 @@ $mobile-width: 800px; // Width $width-xs: 25em; -$width-sm: 32em; +$width-sm: 34em; $width-md: 50em; $width-lg: 80em; $width-xl: 100em; diff --git a/modules/agency/front/basic-data/index.html b/modules/agency/front/basic-data/index.html index 8749494e1..8e3067877 100644 --- a/modules/agency/front/basic-data/index.html +++ b/modules/agency/front/basic-data/index.html @@ -5,7 +5,10 @@ form="form" save="patch"> -
+ - - + + + +
diff --git a/modules/agency/front/events/index.html b/modules/agency/front/events/index.html index 93132501d..b54ee8f0b 100644 --- a/modules/agency/front/events/index.html +++ b/modules/agency/front/events/index.html @@ -1,6 +1,10 @@
-
- + + +
+
-
- - - - - No records found - +
- - + + + - - {{::row.day | dateTime:'dd/MM/yyyy'}} - - - - - + + {{::row.day | dateTime:'dd/MM/yyyy'}} + + + + + - - - - - - - No records found - + + +
+ auto-load="true">
-
- - - - -
- + + + + + + @@ -59,8 +62,8 @@ - - + +
+ + @@ -13,13 +17,8 @@ - - - - - - No records found - + + - + + + + diff --git a/modules/client/front/balance/index/index.html b/modules/client/front/balance/index/index.html index a03790582..55ad2f615 100644 --- a/modules/client/front/balance/index/index.html +++ b/modules/client/front/balance/index/index.html @@ -3,7 +3,8 @@ url="/client/api/receipts/filter" params="$ctrl.params" limit="20" - data="$ctrl.balances"> + data="$ctrl.balances" + auto-load="true"> -
+
@@ -40,11 +41,12 @@ - + + - Date + Date Creation date Employee Reference @@ -97,8 +99,8 @@ - - + +
+ - - - - - - - - -
Since {{::classification.started | dateTime:'dd/MM/yyyy'}}
-
To {{classification.finished | dateTime:'dd/MM/yyyy'}}
-
- - - - - - - - - - - - - - - - - - - -
-
-
- - - No results - - + + + + + + + + +
Since {{::classification.started | dateTime:'dd/MM/yyyy'}}
+
To {{classification.finished | dateTime:'dd/MM/yyyy'}}
+
+ + + + + + + + + + + + + + + + + + + +
+
+
-
+ + data="credits" + order="created DESC" + auto-load="true"> -
+ - - - - Since - Employee - Credit - - - - - {{::credit.created | dateTime:'dd/MM/yyyy HH:mm'}} - {{::credit.worker.user.nickname}} - {{::credit.amount | currency:'EUR':2}} - - - + + + + Since + Employee + Credit + + + + + {{::credit.created | dateTime:'dd/MM/yyyy HH:mm'}} + {{::credit.worker.user.nickname}} + {{::credit.amount | currency:'EUR':2}} + + + - -
+ + data="$ctrl.clientDms" + order="dmsFk DESC" + auto-load="true"> -
+ - - - - Id - Type - Order - Reference - Description - Original - File - Employee - Created - - - - - - - - {{::document.dmsFk}} - - - {{::document.dms.dmsType.name}} - - - - - {{::document.dms.hardCopyNumber}} - - - - - {{::document.dms.reference}} - - - - - {{::document.dms.description}} - - - - - - - - {{::document.dms.file}} - - - - - {{::document.dms.worker.user.nickname | dashIfEmpty}} - - - {{::document.dms.created | dateTime:'dd/MM/yyyy HH:mm'}} - - - - - - - - - - - - + + + + Id + Type + Order + Reference + Description + Original + File + Employee + Created + + + + + + + + {{::document.dmsFk}} + + + {{::document.dms.dmsType.name}} + + + + + {{::document.dms.hardCopyNumber}} + + + + + {{::document.dms.reference}} + + + + + {{::document.dms.description}} + + + + + + + + {{::document.dms.file}} + + + + + {{::document.dms.worker.user.nickname | dashIfEmpty}} + + + {{::document.dms.created | dateTime:'dd/MM/yyyy HH:mm'}} + + + + icon="cloud_download" + title="{{'Download file' | translate}}"> - - - - + + + + + + + + + + + + + -
- + diff --git a/modules/client/front/greuge/index/index.html b/modules/client/front/greuge/index/index.html index a5e7e5f56..9ce76491c 100644 --- a/modules/client/front/greuge/index/index.html +++ b/modules/client/front/greuge/index/index.html @@ -11,7 +11,9 @@ path="/client/api/greuges/{{$ctrl.$stateParams.id}}/sumAmount" options="mgEdit"> -
+ - -
+ - - - - -
{{::client.name}}
- - - - - - - - -
- - - - - + + +
+ + +
{{::client.name}}
+ + + + + + + + +
+ + + + + +
- -
- - No results - - - Enter a new search - -
- + + + diff --git a/modules/client/front/mandate/index.html b/modules/client/front/mandate/index.html index b4db8970d..c5bfb058a 100644 --- a/modules/client/front/mandate/index.html +++ b/modules/client/front/mandate/index.html @@ -5,30 +5,32 @@ link="{clientFk: $ctrl.$stateParams.id}" limit="20" data="mandates" - auto-load="false"> + order="created DESC" + auto-load="true"> -
+ - - - - Id - Company - Type - Register date - End date - - - - - {{::mandate.id}} - {{::mandate.company.code}} - {{::mandate.mandateType.name}} - {{::mandate.created | dateTime:'dd/MM/yyyy HH:mm' }} - {{::mandate.finished | dateTime:'dd/MM/yyyy HH:mm' || '-'}} - - - + + + + Id + Company + Type + Register date + End date + + + + + {{::mandate.id}} + {{::mandate.company.code}} + {{::mandate.mandateType.name}} + {{::mandate.created | dateTime:'dd/MM/yyyy HH:mm' }} + {{::mandate.finished | dateTime:'dd/MM/yyyy HH:mm' || '-'}} + + + - - \ No newline at end of file + \ No newline at end of file diff --git a/modules/client/front/note/index/index.html b/modules/client/front/note/index/index.html index a9182634e..a653ef9da 100644 --- a/modules/client/front/note/index/index.html +++ b/modules/client/front/note/index/index.html @@ -6,7 +6,9 @@ data="notes" auto-load="true"> -
+
-
- No results -
-
- +
+ order="started DESC" + auto-load="true"> -
+ - - - - - Since - To - Amount - Period - - - - - - - - - {{::recovery.started | dateTime:'dd/MM/yyyy' }} - {{recovery.finished | dateTime:'dd/MM/yyyy' }} - {{::recovery.amount | currency: 'EUR': 0}} - {{::recovery.period}} - - - + + + + + Since + To + Amount + Period + + + + + + + + + {{::recovery.started | dateTime:'dd/MM/yyyy' }} + {{recovery.finished | dateTime:'dd/MM/yyyy' }} + {{::recovery.amount | currency: 'EUR': 0}} + {{::recovery.period}} + + + - -
+ + order="created DESC" + auto-load="true"> -
+ - Sent + Sent Description Worker Company @@ -36,14 +39,16 @@ - -
+ -
+ \ No newline at end of file diff --git a/modules/client/front/web-payment/index.html b/modules/client/front/web-payment/index.html index bd3cbe446..326945c21 100644 --- a/modules/client/front/web-payment/index.html +++ b/modules/client/front/web-payment/index.html @@ -3,50 +3,53 @@ url="/client/api/clients/getTransactions" link="{clientFk: $ctrl.$stateParams.id}" limit="20" - data="transactions" auto-load="false"> + data="transactions" + order="created DESC" + auto-load="true"> -
+ - - - - State - Id - Amount - Payed - Confirm - - - - - - - - - - - {{::transaction.id}} - {{::transaction.amount | currency: 'EUR':2}} - {{::transaction.created | dateTime:'dd/MM/yyyy HH:mm'}} - - - - - - - + + + + State + Id + Date + Amount + + + + + + + + + + + + {{::transaction.id}} + {{::transaction.created | dateTime:'dd/MM/yyyy HH:mm'}} + {{::transaction.amount | currency: 'EUR':2}} + + + + + + + - -
\ No newline at end of file + \ No newline at end of file diff --git a/modules/client/front/web-payment/locale/es.yml b/modules/client/front/web-payment/locale/es.yml index 099ca359c..8e988857c 100644 --- a/modules/client/front/web-payment/locale/es.yml +++ b/modules/client/front/web-payment/locale/es.yml @@ -1,6 +1,5 @@ Web Payment: Pago Web Confirmed: Confirmado -Payed: Pagado Confirm transaction: Confirmar transacción Confirm: Confirmar State: Estado \ No newline at end of file diff --git a/modules/worker/front/log/index.html b/modules/worker/front/log/index.html index 0de0eadf6..4f170ac35 100644 --- a/modules/worker/front/log/index.html +++ b/modules/worker/front/log/index.html @@ -7,7 +7,9 @@ limit="20" auto-load="true"> -
+ @@ -95,7 +97,7 @@ -
+