From 5ef3820912c2f0321264e9b831877fc5876a96ea Mon Sep 17 00:00:00 2001 From: Gerard Date: Mon, 29 Oct 2018 11:56:55 +0100 Subject: [PATCH] =?UTF-8?q?#769=20crear=20secci=C3=B3n=20log=20en=20item?= =?UTF-8?q?=20y=20ticket?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- client/client/routes.json | 8 +++---- client/client/src/client.js | 2 +- client/client/src/{history => log}/index.html | 0 client/client/src/{history => log}/index.js | 21 ++++++++++--------- .../client/src/{history => log}/index.spec.js | 0 .../client/src/{history => log}/locale/es.yml | 0 client/client/src/{history => log}/style.scss | 0 7 files changed, 16 insertions(+), 15 deletions(-) rename client/client/src/{history => log}/index.html (100%) rename client/client/src/{history => log}/index.js (70%) rename client/client/src/{history => log}/index.spec.js (100%) rename client/client/src/{history => log}/locale/es.yml (100%) rename client/client/src/{history => log}/style.scss (100%) diff --git a/client/client/routes.json b/client/client/routes.json index b53394ce29..328c297eb4 100644 --- a/client/client/routes.json +++ b/client/client/routes.json @@ -363,10 +363,10 @@ } }, { - "url" : "/history", - "state": "client.card.history", - "component": "vn-client-history", - "description": "History", + "url" : "/log", + "state": "client.card.log", + "component": "vn-client-log", + "description": "Log", "menu": { "icon": "history" } diff --git a/client/client/src/client.js b/client/client/src/client.js index 007a1c970d..f53865547f 100644 --- a/client/client/src/client.js +++ b/client/client/src/client.js @@ -33,4 +33,4 @@ import './contact'; import './sample/index'; import './sample/create'; import './web-payment'; -import './history'; +import './log'; diff --git a/client/client/src/history/index.html b/client/client/src/log/index.html similarity index 100% rename from client/client/src/history/index.html rename to client/client/src/log/index.html diff --git a/client/client/src/history/index.js b/client/client/src/log/index.js similarity index 70% rename from client/client/src/history/index.js rename to client/client/src/log/index.js index 7f63b674ec..c0ee420093 100644 --- a/client/client/src/history/index.js +++ b/client/client/src/log/index.js @@ -7,11 +7,11 @@ class Controller { this.$stateParams = $stateParams; this.filter = { include: [{ - relation: "user", + relation: 'user', scope: { - fields: ["name"] - } - }] + fields: ['name'], + }, + }], }; } @@ -22,17 +22,18 @@ class Controller { set logs(value) { this._logs = value; - if (this.logs) - this.logs.forEach(log => { + if (this.logs) { + this.logs.forEach((log) => { log.oldProperties = this.getInstance(log.oldInstance); log.newProperties = this.getInstance(log.newInstance); }); + } } getInstance(instance) { - let properties = []; + const properties = []; - Object.keys(instance).forEach(property => { + Object.keys(instance).forEach((property) => { properties.push({key: property, value: instance[property]}); }); @@ -42,7 +43,7 @@ class Controller { Controller.$inject = ['$scope', '$stateParams']; -ngModule.component('vnClientHistory', { +ngModule.component('vnClientLog', { template: require('./index.html'), - controller: Controller + controller: Controller, }); diff --git a/client/client/src/history/index.spec.js b/client/client/src/log/index.spec.js similarity index 100% rename from client/client/src/history/index.spec.js rename to client/client/src/log/index.spec.js diff --git a/client/client/src/history/locale/es.yml b/client/client/src/log/locale/es.yml similarity index 100% rename from client/client/src/history/locale/es.yml rename to client/client/src/log/locale/es.yml diff --git a/client/client/src/history/style.scss b/client/client/src/log/style.scss similarity index 100% rename from client/client/src/history/style.scss rename to client/client/src/log/style.scss