#769 crear sección log en item y ticket

This commit is contained in:
Gerard 2018-10-29 11:56:55 +01:00
parent 36f048e4ef
commit 5ef3820912
7 changed files with 16 additions and 15 deletions

View File

@ -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"
}

View File

@ -33,4 +33,4 @@ import './contact';
import './sample/index';
import './sample/create';
import './web-payment';
import './history';
import './log';

View File

@ -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,
});