From 570e2b5732d641d01a693c103bc4d8f437f6ef09 Mon Sep 17 00:00:00 2001 From: Carlos Jimenez Ruiz Date: Tue, 2 Apr 2019 11:04:53 +0200 Subject: [PATCH] #1243 ticket.log columna worker --- e2e/helpers/selectors.js | 2 +- .../ticket-module/08_list_components.spec.js | 26 -------------- front/core/components/index.js | 1 - front/core/components/log/index.js | 21 ----------- modules/agency/front/routes.json | 1 + modules/client/front/routes.json | 1 + modules/invoiceOut/front/routes.json | 2 +- modules/route/front/index/index.js | 1 - modules/travel/front/routes.json | 1 + modules/worker/front/index.js | 1 + .../worker/front}/log/index.html | 18 ++++++++-- modules/worker/front/log/index.js | 35 +++++++++++++++++++ .../worker/front}/log/locale/es.yml | 0 .../worker/front}/log/style.scss | 0 14 files changed, 57 insertions(+), 53 deletions(-) delete mode 100644 front/core/components/log/index.js rename {front/core/components => modules/worker/front}/log/index.html (83%) create mode 100644 modules/worker/front/log/index.js rename {front/core/components => modules/worker/front}/log/locale/es.yml (100%) rename {front/core/components => modules/worker/front}/log/style.scss (100%) diff --git a/e2e/helpers/selectors.js b/e2e/helpers/selectors.js index bdd4cb354..5ad78097f 100644 --- a/e2e/helpers/selectors.js +++ b/e2e/helpers/selectors.js @@ -449,7 +449,7 @@ export default { }, ticketLog: { logButton: `vn-left-menu a[ui-sref="ticket.card.log"]`, - changedBy: 'vn-ticket-log > vn-log > vn-vertical > vn-card > div > vn-vertical > vn-table > div > vn-tbody > vn-tr > vn-td:nth-child(1) > div > div:nth-child(1) > span.value.ng-scope.ng-binding', + changedBy: 'vn-ticket-log > vn-log > vn-vertical > vn-card > div > vn-vertical > vn-table > div > vn-tbody > vn-tr:nth-child(1) > vn-td:nth-child(2) > span', actionTaken: 'vn-ticket-log > vn-log > vn-vertical > vn-card > div > vn-vertical > vn-table > div > vn-tbody > vn-tr > vn-td:nth-child(1) > div > div:nth-child(3) > span.value.ng-scope.ng-binding', id: 'vn-ticket-log > vn-log > vn-vertical > vn-card > div > vn-vertical > vn-table > div > vn-tbody > vn-tr > vn-td.before > vn-one:nth-child(1) > div > span.value.ng-scope.ng-binding' }, diff --git a/e2e/paths/ticket-module/08_list_components.spec.js b/e2e/paths/ticket-module/08_list_components.spec.js index 643b45da7..4603650ac 100644 --- a/e2e/paths/ticket-module/08_list_components.spec.js +++ b/e2e/paths/ticket-module/08_list_components.spec.js @@ -23,30 +23,4 @@ describe('Ticket List components path', () => { expect(base).toContain('Base'); expect(base.length).toBeGreaterThan(minLength); }); - - it('should confirm the total margin is correct', async() => { - const name = 'Margin €'; - const minLength = name.length; - - const margin = await nightmare - .waitPropertyLength(selectors.ticketComponents.margin, 'innerText', minLength) - .waitToGetProperty(selectors.ticketComponents.margin, 'innerText'); - - - expect(margin).toContain('Margin'); - expect(margin.length).toBeGreaterThan(minLength); - }); - - it('should confirm the total total is correct', async() => { - const name = 'Total €'; - const minLength = name.length; - - const total = await nightmare - .waitPropertyLength(selectors.ticketComponents.total, 'innerText', minLength) - .waitToGetProperty(selectors.ticketComponents.total, 'innerText'); - - - expect(total).toContain('Total'); - expect(total.length).toBeGreaterThan(minLength); - }); }); diff --git a/front/core/components/index.js b/front/core/components/index.js index 411048985..a7bd664c4 100644 --- a/front/core/components/index.js +++ b/front/core/components/index.js @@ -40,7 +40,6 @@ import './input-range'; import './chip'; import './input-number'; import './input-time'; -import './log'; import './treeview'; import './treeview/child'; import './calendar'; diff --git a/front/core/components/log/index.js b/front/core/components/log/index.js deleted file mode 100644 index 99290837a..000000000 --- a/front/core/components/log/index.js +++ /dev/null @@ -1,21 +0,0 @@ -import ngModule from '../../module'; -import './style.scss'; - -export default class Controller { - constructor() { - this.actionsText = { - 'insert': 'Creates', - 'update': 'Updates', - 'delete': 'Deletes', - 'select': 'Views' - }; - } -} - -ngModule.component('vnLog', { - controller: Controller, - template: require('./index.html'), - bindings: { - model: '<' - } -}); diff --git a/modules/agency/front/routes.json b/modules/agency/front/routes.json index de38de230..fe4e74707 100644 --- a/modules/agency/front/routes.json +++ b/modules/agency/front/routes.json @@ -3,6 +3,7 @@ "name": "Agencies", "icon" : "icon-delivery", "validations" : true, + "dependencies": ["worker"], "menu": [ {"state": "zone.card.basicData", "icon": "settings"}, {"state": "zone.card.location", "icon": "my_location"} diff --git a/modules/client/front/routes.json b/modules/client/front/routes.json index 873d283ec..457f75f0b 100644 --- a/modules/client/front/routes.json +++ b/modules/client/front/routes.json @@ -3,6 +3,7 @@ "name": "Clients", "icon": "icon-person", "validations" : true, + "dependencies": ["worker"], "menu": [ {"state": "client.card.basicData", "icon": "settings"}, {"state": "client.card.fiscalData", "icon": "account_balance"}, diff --git a/modules/invoiceOut/front/routes.json b/modules/invoiceOut/front/routes.json index 54d60fc7c..dbaa4be29 100644 --- a/modules/invoiceOut/front/routes.json +++ b/modules/invoiceOut/front/routes.json @@ -3,7 +3,7 @@ "name": "Invoices out", "icon": "icon-invoices1", "validations" : true, - "dependencies": ["client", "ticket"], + "dependencies": ["worker", "client", "ticket"], "routes": [ { "url": "/invoice-out", diff --git a/modules/route/front/index/index.js b/modules/route/front/index/index.js index c516a2e8f..0fa102c4d 100644 --- a/modules/route/front/index/index.js +++ b/modules/route/front/index/index.js @@ -4,7 +4,6 @@ export default class Controller { constructor($scope, vnToken) { this.accessToken = vnToken.token; this.$ = $scope; - this.ticketSelected = null; this.filter = { include: [ diff --git a/modules/travel/front/routes.json b/modules/travel/front/routes.json index 979ae361a..ed7b229cf 100644 --- a/modules/travel/front/routes.json +++ b/modules/travel/front/routes.json @@ -2,6 +2,7 @@ "module": "travel", "name": "Travels", "validations": true, + "dependencies": ["worker"], "routes": [ { "url": "/travel", diff --git a/modules/worker/front/index.js b/modules/worker/front/index.js index 308de70fe..dce6d394a 100644 --- a/modules/worker/front/index.js +++ b/modules/worker/front/index.js @@ -10,3 +10,4 @@ import './basic-data'; import './pbx'; import './department'; import './calendar'; +import './log'; diff --git a/front/core/components/log/index.html b/modules/worker/front/log/index.html similarity index 83% rename from front/core/components/log/index.html rename to modules/worker/front/log/index.html index f717bd8a0..a060289a6 100644 --- a/front/core/components/log/index.html +++ b/modules/worker/front/log/index.html @@ -21,7 +21,12 @@
Changed by: - {{::log.user.name | dashIfEmpty}} + {{::log.user.name | dashIfEmpty}} +
Model: @@ -38,7 +43,12 @@
- {{::log.user.name}} + {{::log.user.name | dashIfEmpty}} + {{::log.changedModel}} @@ -82,3 +92,7 @@ + + diff --git a/modules/worker/front/log/index.js b/modules/worker/front/log/index.js new file mode 100644 index 000000000..6cd36d47c --- /dev/null +++ b/modules/worker/front/log/index.js @@ -0,0 +1,35 @@ +import ngModule from '../module'; +import './style.scss'; + +export default class Controller { + constructor($scope) { + this.$ = $scope; + this.actionsText = { + 'insert': 'Creates', + 'update': 'Updates', + 'delete': 'Deletes', + 'select': 'Views' + }; + } + + showWorkerDescriptor(event, userId) { + if (event.defaultPrevented) return; + + event.preventDefault(); + event.stopPropagation(); + + this.selectedWorker = userId; + this.$.workerDescriptor.parent = event.target; + this.$.workerDescriptor.show(); + } +} + +Controller.$inject = ['$scope']; + +ngModule.component('vnLog', { + controller: Controller, + template: require('./index.html'), + bindings: { + model: '<' + } +}); diff --git a/front/core/components/log/locale/es.yml b/modules/worker/front/log/locale/es.yml similarity index 100% rename from front/core/components/log/locale/es.yml rename to modules/worker/front/log/locale/es.yml diff --git a/front/core/components/log/style.scss b/modules/worker/front/log/style.scss similarity index 100% rename from front/core/components/log/style.scss rename to modules/worker/front/log/style.scss