From 26a0ee109668af0bcec255295e75288d452c29ad Mon Sep 17 00:00:00 2001 From: Bernat Date: Wed, 11 Jul 2018 08:47:20 +0200 Subject: [PATCH 1/2] update ACL --- services/db/install/changes/1.0.8/ACL.sql | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 services/db/install/changes/1.0.8/ACL.sql diff --git a/services/db/install/changes/1.0.8/ACL.sql b/services/db/install/changes/1.0.8/ACL.sql new file mode 100644 index 000000000..d8abe02f2 --- /dev/null +++ b/services/db/install/changes/1.0.8/ACL.sql @@ -0,0 +1,2 @@ +UPDATE `salix`.`ACL` SET `accessType`='*' WHERE `id`='58'; +UPDATE `salix`.`ACL` SET `accessType`='*' WHERE `id`='60'; \ No newline at end of file From b01c237769399c498da6a34b8faae0daeeafe571 Mon Sep 17 00:00:00 2001 From: Joan Date: Wed, 11 Jul 2018 09:11:45 +0200 Subject: [PATCH 2/2] Show city and province on address autocomplete #395 --- client/order/routes.json | 3 +- client/ticket/src/data/step-one/index.html | 8 ++-- client/ticket/src/data/step-one/index.js | 41 ++++++++++++++++--- .../ticket/src/data/step-one/step-one.spec.js | 26 ++++++++++-- 4 files changed, 64 insertions(+), 14 deletions(-) diff --git a/client/order/routes.json b/client/order/routes.json index a57904950..a516f01ad 100644 --- a/client/order/routes.json +++ b/client/order/routes.json @@ -8,7 +8,8 @@ "url": "/order", "state": "order", "abstract": true, - "component": "ui-view" + "component": "ui-view", + "acl": ["developer"] }, { "url": "/index?q", diff --git a/client/ticket/src/data/step-one/index.html b/client/ticket/src/data/step-one/index.html index 3db14f580..d0c56ec12 100644 --- a/client/ticket/src/data/step-one/index.html +++ b/client/ticket/src/data/step-one/index.html @@ -9,15 +9,17 @@ show-field="name" value-field="id" field="$ctrl.clientFk" - initial-data="$ctrl.clientFk" - on-change="$ctrl.onChange()"> + initial-data="$ctrl.clientFk"> + {{::nickname}} + - {{::city}} ({{::province.name}}) + { + if (res.data) + this.addresses = res.data; + }); } async onStepChange(state) { diff --git a/client/ticket/src/data/step-one/step-one.spec.js b/client/ticket/src/data/step-one/step-one.spec.js index 625c90e90..9a2d8ca63 100644 --- a/client/ticket/src/data/step-one/step-one.spec.js +++ b/client/ticket/src/data/step-one/step-one.spec.js @@ -1,6 +1,6 @@ import './index.js'; -describe('ticket', () => { +fdescribe('ticket', () => { describe('Component vnTicketDataStepOne', () => { let $componentController; let $state; @@ -19,6 +19,25 @@ describe('ticket', () => { controller = $componentController('vnTicketDataStepOne', {$state: $state}); })); + describe('ticket() setter', () => { + it('should set ticket property and call onChange() method ', () => { + spyOn(controller, 'onChange'); + controller.ticket = {id: 1, clientFk: 101}; + + expect(controller.onChange).toHaveBeenCalledWith(101); + }); + }); + + describe('clientFk() setter', () => { + it('should set clientFk property and call onChange() method ', () => { + spyOn(controller, 'onChange'); + controller.ticket = {id: 1, clientFk: 101}; + controller.clientFk = 102; + + expect(controller.onChange).toHaveBeenCalledWith(102); + }); + }); + describe('isFormInvalid()', () => { it('should check if all form fields are valid', () => { controller.ticket = { @@ -31,8 +50,7 @@ describe('ticket', () => { landed: new Date() }; - let result = controller.isFormInvalid(); - expect(result).toBeFalsy(); + expect(controller.isFormInvalid()).toBeFalsy(); }); }); @@ -41,7 +59,7 @@ describe('ticket', () => { let landed = new Date(); landed.setHours(0, 0, 0, 0); - controller.ticket = { + controller._ticket = { id: 1, clientFk: 1, addressFk: 121,