From 746cbede4bb37c0c4ca28c0f27a81373e1f617a0 Mon Sep 17 00:00:00 2001 From: alexm Date: Mon, 31 Jan 2022 08:17:15 +0100 Subject: [PATCH] feat(client_defaulter): move tool-bar up , add column author --- e2e/helpers/selectors.js | 2 +- e2e/paths/02-client/21_defaulter.spec.js | 4 +- .../client/back/methods/defaulter/filter.js | 3 +- modules/client/front/defaulter/index.html | 61 +++++++++++-------- modules/client/front/defaulter/locale/es.yml | 5 +- 5 files changed, 45 insertions(+), 30 deletions(-) diff --git a/e2e/helpers/selectors.js b/e2e/helpers/selectors.js index 0172ca4e0..e757ca385 100644 --- a/e2e/helpers/selectors.js +++ b/e2e/helpers/selectors.js @@ -308,7 +308,7 @@ export default { anyClient: 'vn-client-defaulter-index vn-tbody > vn-tr', firstClientName: 'vn-client-defaulter-index vn-tbody > vn-tr:nth-child(1) > vn-td:nth-child(2) > span', firstSalesPersonName: 'vn-client-defaulter-index vn-tbody > vn-tr:nth-child(1) > vn-td:nth-child(3) > span', - firstObservation: 'vn-client-defaulter-index vn-tbody > vn-tr:nth-child(1) > vn-td:nth-child(5) > vn-textarea[ng-model="defaulter.observation"]', + firstObservation: 'vn-client-defaulter-index vn-tbody > vn-tr:nth-child(1) > vn-td:nth-child(6) > vn-textarea[ng-model="defaulter.observation"]', allDefaulterCheckbox: 'vn-client-defaulter-index vn-thead vn-multi-check', addObservationButton: 'vn-client-defaulter-index vn-button[icon="icon-notes"]', observation: '.vn-dialog.shown vn-textarea[ng-model="$ctrl.defaulter.observation"]', diff --git a/e2e/paths/02-client/21_defaulter.spec.js b/e2e/paths/02-client/21_defaulter.spec.js index 406c802ab..1d5fc8efb 100644 --- a/e2e/paths/02-client/21_defaulter.spec.js +++ b/e2e/paths/02-client/21_defaulter.spec.js @@ -36,7 +36,7 @@ describe('Client defaulter path', () => { const expectedObservation = 'Madness, as you know, is like gravity, all it takes is a little push'; const result = await page.waitToGetProperty(selectors.clientDefaulter.firstObservation, 'value'); - expect(result).toEqual(expectedObservation); + expect(result).toContain(expectedObservation); }); it('should not add empty observation', async() => { @@ -68,6 +68,6 @@ describe('Client defaulter path', () => { const message = await page.waitForSnackbar(); expect(message.text).toContain('Observation saved!'); - expect(result).toEqual('My new observation'); + expect(result).toContain('My new observation'); }); }); diff --git a/modules/client/back/methods/defaulter/filter.js b/modules/client/back/methods/defaulter/filter.js index 15a56fb63..c06d1c51b 100644 --- a/modules/client/back/methods/defaulter/filter.js +++ b/modules/client/back/methods/defaulter/filter.js @@ -61,7 +61,8 @@ module.exports = Self => { u.name salesPersonName, d.amount, co.created, - co.text observation, + CONCAT(DATE(co.created), ' ', co.text) observation, + uw.id workerFk, uw.name workerName, c.creditInsurance, d.defaulterSinced diff --git a/modules/client/front/defaulter/index.html b/modules/client/front/defaulter/index.html index ed50ebad9..121556df2 100644 --- a/modules/client/front/defaulter/index.html +++ b/modules/client/front/defaulter/index.html @@ -15,23 +15,21 @@ model="model"> - -
-
-
Total
- - -
-
-
+ class="vn-w-xl"> - - + +
+
+
Total
+ + +
+
+
- - +
+
@@ -53,20 +51,27 @@ Comercial - Balance D + vn-tooltip="Balance due" + number> + Balance D. - Last observation - Credit I + vn-tooltip="Worker who made the last observation" + shrink> + Author - From + Last observation + + Credit I. + + From - + @@ -89,11 +94,19 @@ {{::defaulter.amount}} + + + {{::defaulter.workerName | dashIfEmpty}} + + diff --git a/modules/client/front/defaulter/locale/es.yml b/modules/client/front/defaulter/locale/es.yml index d0cca6e2a..172a3125d 100644 --- a/modules/client/front/defaulter/locale/es.yml +++ b/modules/client/front/defaulter/locale/es.yml @@ -2,5 +2,6 @@ Last observation: Última observación Add observation: Añadir observación Search client: Buscar clientes Add observation to all selected clients: Añadir observación a {{total}} cliente(s) seleccionado(s) -Credit I: Crédito A -Balance D: Saldo V \ No newline at end of file +Credit I.: Crédito A. +Balance D.: Saldo V. +Worker who made the last observation: Trabajador que ha realizado la última observación \ No newline at end of file