From 25187b955fc76b73c3435fea8aa8b2132c99f64f Mon Sep 17 00:00:00 2001 From: Joan Date: Thu, 2 Aug 2018 10:06:11 +0200 Subject: [PATCH] Fixed descriptor quicklinks --- client/client/src/descriptor-popover/index.js | 4 +-- client/client/src/descriptor/index.js | 27 +++++++++++++------ client/item/src/descriptor-popover/index.js | 4 +-- client/item/src/descriptor/index.js | 4 +-- 4 files changed, 25 insertions(+), 14 deletions(-) diff --git a/client/client/src/descriptor-popover/index.js b/client/client/src/descriptor-popover/index.js index 41c617c74..fc1333851 100644 --- a/client/client/src/descriptor-popover/index.js +++ b/client/client/src/descriptor-popover/index.js @@ -9,7 +9,7 @@ class Controller extends Component { this.$timeout = $timeout; this.isTooltip = true; this.client = {}; - this.links = {}; + this._quicklinks = {}; } set clientFk(value) { @@ -20,7 +20,7 @@ class Controller extends Component { } set quicklinks(value = {}) { - this._quicklinks = Object.assign(value, this.links); + this._quicklinks = Object.assign(value, this._quicklinks); } get quicklinks() { diff --git a/client/client/src/descriptor/index.js b/client/client/src/descriptor/index.js index 9ec8e5f4c..8b7f019f7 100644 --- a/client/client/src/descriptor/index.js +++ b/client/client/src/descriptor/index.js @@ -4,25 +4,36 @@ class Controller { constructor($http, $state) { this.$state = $state; this.$http = $http; - this.links = { + } + + set clientFk(value) { + if (!value) return; + + this._getClient(value); + this._getClientDebt(value); + } + + set client(value) { + this._client = value; + + if (!value) return; + + this._quicklinks = { btnOne: { icon: 'icon-ticket', state: 'ticket.index', - params: {q: `{"clientFk": ${$state.params.id}}`}, + params: {q: `{"clientFk": 1}`}, tooltip: 'Client ticket list' } }; } - set clientFk(value) { - if (value) { - this._getClient(value); - this._getClientDebt(value); - } + get client() { + return this._client; } set quicklinks(value = {}) { - this._quicklinks = Object.assign(value, this.links); + this._quicklinks = Object.assign(value, this._quicklinks); } get quicklinks() { diff --git a/client/item/src/descriptor-popover/index.js b/client/item/src/descriptor-popover/index.js index 0093c57aa..e23def91f 100644 --- a/client/item/src/descriptor-popover/index.js +++ b/client/item/src/descriptor-popover/index.js @@ -7,13 +7,13 @@ class Controller extends Component { super($element, $scope); this.$http = $http; this.$timeout = $timeout; - this.links = {}; + this._quicklinks = {}; this.isTooltip = true; this.clear(); } set quicklinks(value = {}) { - this._quicklinks = Object.assign(value, this.links); + this._quicklinks = Object.assign(value, this._quicklinks); } get quicklinks() { diff --git a/client/item/src/descriptor/index.js b/client/item/src/descriptor/index.js index 103ebc47f..043011574 100644 --- a/client/item/src/descriptor/index.js +++ b/client/item/src/descriptor/index.js @@ -4,11 +4,11 @@ import './style.scss'; class Controller { constructor($state) { this.$state = $state; - this.links = {}; + this._quicklinks = {}; } set quicklinks(value = {}) { - this._quicklinks = Object.assign(value, this.links); + this._quicklinks = Object.assign(value, this._quicklinks); } get quicklinks() {