From 786d3217945c8483982916c03388ce4d5d44c3f0 Mon Sep 17 00:00:00 2001 From: Daniel Herrero Date: Wed, 13 Dec 2017 08:04:53 +0100 Subject: [PATCH] Tarea #14 Interfaz lista mandatos --- client/client/routes.json | 8 ++++++ client/client/src/client.js | 1 + client/client/src/filterClientList.js | 5 +++- client/client/src/locale/es.json | 3 ++- client/client/src/mandate/locale/es.json | 5 ++++ client/client/src/mandate/mandate.html | 31 ++++++++++++++++++++++++ client/client/src/mandate/mandate.js | 7 ++++++ 7 files changed, 58 insertions(+), 2 deletions(-) create mode 100644 client/client/src/mandate/locale/es.json create mode 100644 client/client/src/mandate/mandate.html create mode 100644 client/client/src/mandate/mandate.js diff --git a/client/client/routes.json b/client/client/routes.json index 99c083ff3..de6bcb562 100644 --- a/client/client/routes.json +++ b/client/client/routes.json @@ -152,6 +152,14 @@ "params": { "client": "$ctrl.client" } + }, { + "url": "/mandate", + "state": "clientCard.mandate", + "component": "vn-client-mandate", + "menu": { + "description": "Mandate", + "icon": "pan_tool" + } } ] } diff --git a/client/client/src/client.js b/client/client/src/client.js index 15bd2d8ec..d61f4e4aa 100644 --- a/client/client/src/client.js +++ b/client/client/src/client.js @@ -18,3 +18,4 @@ import './credit-list/credit-list'; import './credit-create/credit-create'; import './greuge-list/greuge-list'; import './greuge-create/greuge-create'; +import './mandate/mandate'; diff --git a/client/client/src/filterClientList.js b/client/client/src/filterClientList.js index 3ad70cfc5..6b6f48bb9 100644 --- a/client/client/src/filterClientList.js +++ b/client/client/src/filterClientList.js @@ -1,3 +1,4 @@ +// Generic object to list models, related to the client, with mgCrud export default class FilterClientList { constructor($scope, $timeout, $state) { this.$ = $scope; @@ -24,8 +25,10 @@ export default class FilterClientList { } this.$.index.accept(); + } else if (!this.clientFk) { + throw new Error('Error: ClientFk not found'); } else if (this.waitingMgCrud > 3) { - throw new Error('Magic Crud is not loaded'); + throw new Error('Error: Magic Crud is not loaded'); } else { this.waitingMgCrud++; this.$timeout(() => { diff --git a/client/client/src/locale/es.json b/client/client/src/locale/es.json index 3a037b3aa..cdd92bb5a 100644 --- a/client/client/src/locale/es.json +++ b/client/client/src/locale/es.json @@ -19,5 +19,6 @@ "Address": "Consignatario", "Credit" : "Crédito", "Secured credit": "Crédito asegurado", - "Verified data": "Datos comprobados" + "Verified data": "Datos comprobados", + "Mandate": "Mandato" } diff --git a/client/client/src/mandate/locale/es.json b/client/client/src/mandate/locale/es.json new file mode 100644 index 000000000..51e30f9ed --- /dev/null +++ b/client/client/src/mandate/locale/es.json @@ -0,0 +1,5 @@ +{ + "Company": "Empresa", + "Register date": "Fecha alta", + "End date": "Fecha baja" +} \ No newline at end of file diff --git a/client/client/src/mandate/mandate.html b/client/client/src/mandate/mandate.html new file mode 100644 index 000000000..54b388267 --- /dev/null +++ b/client/client/src/mandate/mandate.html @@ -0,0 +1,31 @@ + + + + Mandate + + + + + + + + + + + {{::mandate.id}} + {{::mandate.company}} + {{::mandate.type}} + {{::mandate.created | date:'dd/MM/yyyy HH:mm' }} + {{::mandate.finished | date:'dd/MM/yyyy HH:mm' || '-'}} + + + No results + + + + + \ No newline at end of file diff --git a/client/client/src/mandate/mandate.js b/client/client/src/mandate/mandate.js new file mode 100644 index 000000000..e48222ce6 --- /dev/null +++ b/client/client/src/mandate/mandate.js @@ -0,0 +1,7 @@ +import ngModule from '../module'; +import FilterClientList from '../filterClientList'; + +ngModule.component('vnClientMandate', { + template: require('./mandate.html'), + controller: FilterClientList +});