From f45aa7937dda4511fc7cfc5d938a5b520a6c15d3 Mon Sep 17 00:00:00 2001 From: Jorge Padawan Date: Tue, 12 Jan 2021 07:39:12 +0100 Subject: [PATCH] Added conditionals with rols to display or not the icons with link --- modules/account/front/summary/index.html | 7 +++- modules/account/front/summary/index.js | 3 ++ modules/claim/front/summary/index.html | 21 ++++++++-- modules/claim/front/summary/index.js | 8 ++++ modules/client/front/summary/index.html | 40 +++++++++++++++--- modules/client/front/summary/index.js | 3 ++ modules/item/front/summary/index.html | 51 +++++++++++++++++++---- modules/item/front/summary/index.js | 16 +++++++ modules/route/front/summary/index.html | 7 +++- modules/route/front/summary/index.js | 4 ++ modules/supplier/front/summary/index.html | 28 +++++++++++-- modules/supplier/front/summary/index.js | 4 ++ modules/travel/front/summary/index.html | 7 +++- modules/travel/front/summary/index.js | 4 ++ modules/worker/front/summary/index.html | 7 +++- modules/worker/front/summary/index.js | 4 ++ 16 files changed, 189 insertions(+), 25 deletions(-) diff --git a/modules/account/front/summary/index.html b/modules/account/front/summary/index.html index 75534d4e6..3f6798db9 100644 --- a/modules/account/front/summary/index.html +++ b/modules/account/front/summary/index.html @@ -10,13 +10,18 @@ -

+

Basic Data

+

+ Basic Data +

diff --git a/modules/account/front/summary/index.js b/modules/account/front/summary/index.js index 21be84660..8ed025b61 100644 --- a/modules/account/front/summary/index.js +++ b/modules/account/front/summary/index.js @@ -18,6 +18,9 @@ class Controller extends Summary { this.$http.get(`Accounts/${value.id}`, {filter}) .then(res => this.$.summary = res.data); } + get isHr() { + return this.aclService.hasAny(['hr']); + } get user() { return this._user; diff --git a/modules/claim/front/summary/index.html b/modules/claim/front/summary/index.html index f8e77b50b..a5afc97ce 100644 --- a/modules/claim/front/summary/index.html +++ b/modules/claim/front/summary/index.html @@ -54,13 +54,18 @@
-

+

Detail

+

+ Detail +

@@ -111,13 +116,18 @@
-

+

Development

+

+ Development +

@@ -148,13 +158,18 @@
-

+

Action

+

+ Action +

diff --git a/modules/claim/front/summary/index.js b/modules/claim/front/summary/index.js index 89848ecc6..bda830d6a 100644 --- a/modules/claim/front/summary/index.js +++ b/modules/claim/front/summary/index.js @@ -13,6 +13,14 @@ class Controller extends Summary { this.getSummary(); } + get isSalesPerson() { + return this.aclService.hasAny(['salesPerson']); + } + + get isClaimManager() { + return this.aclService.hasAny(['claimManager']); + } + get claim() { return this._claim; } diff --git a/modules/client/front/summary/index.html b/modules/client/front/summary/index.html index 59afaeeeb..a56c3b680 100644 --- a/modules/client/front/summary/index.html +++ b/modules/client/front/summary/index.html @@ -12,13 +12,18 @@ -

+

Basic data

+

+ Basic data +

@@ -49,13 +54,18 @@
-

+

Fiscal address

+

+ Fiscal address +

@@ -79,13 +89,18 @@
-

+

Fiscal data

+

+ Fiscal data +

-

+

Billing data

+

+ Billing data +

@@ -160,13 +180,18 @@
-

+

Address

+

+ Address +

@@ -178,13 +203,16 @@
-

+

Web access

+

Web access +

diff --git a/modules/client/front/summary/index.js b/modules/client/front/summary/index.js index cf5991247..8ef724061 100644 --- a/modules/client/front/summary/index.js +++ b/modules/client/front/summary/index.js @@ -18,6 +18,9 @@ class Controller extends Summary { } }); } + get isEmployee() { + return this.aclService.hasAny(['employee']); + } sumRisk() { let total = 0; diff --git a/modules/item/front/summary/index.html b/modules/item/front/summary/index.html index 51413860e..79c0d6bfb 100644 --- a/modules/item/front/summary/index.html +++ b/modules/item/front/summary/index.html @@ -25,13 +25,18 @@
-

+

Basic data

+

+ Basic data +

@@ -59,13 +64,18 @@
-

+

Other data

+

+ Other data +

@@ -89,13 +99,18 @@
-

+

Tags

+

+ Tags +

-

- +

+ Tax

+

+ Tax +

-

+

Niche

+

+ Niche +

-

+

Botanical

+

+ Botanical +

@@ -145,13 +175,18 @@
-

+

Barcode

+

+ Barcode +

{{barcode.code}}

diff --git a/modules/item/front/summary/index.js b/modules/item/front/summary/index.js index dc4e638b8..52753ff65 100644 --- a/modules/item/front/summary/index.js +++ b/modules/item/front/summary/index.js @@ -13,6 +13,22 @@ class Controller extends Summary { if (this.item && this.item.id) this.getSummary(); } + + get isBuyer() { + return this.aclService.hasAny(['buyer']); + } + + get isReplenisher() { + return this.aclService.hasAny(['replenisher']); + } + + get isAdministrative() { + return this.aclService.hasAny(['administrative']); + } + + get isEmployee() { + return this.aclService.hasAny(['employee']); + } } ngModule.vnComponent('vnItemSummary', { diff --git a/modules/route/front/summary/index.html b/modules/route/front/summary/index.html index c683ec6ce..9bd83a14d 100644 --- a/modules/route/front/summary/index.html +++ b/modules/route/front/summary/index.html @@ -61,13 +61,18 @@
-

+

Ticket

+

+ Ticket +

diff --git a/modules/route/front/summary/index.js b/modules/route/front/summary/index.js index 762cd8a41..543c54afc 100644 --- a/modules/route/front/summary/index.js +++ b/modules/route/front/summary/index.js @@ -16,6 +16,10 @@ class Controller extends Summary { }); } + get isDelivery() { + return this.aclService.hasAny(['delivery']); + } + get route() { return this._route; } diff --git a/modules/supplier/front/summary/index.html b/modules/supplier/front/summary/index.html index fde1b4304..9ac79fd27 100644 --- a/modules/supplier/front/summary/index.html +++ b/modules/supplier/front/summary/index.html @@ -10,13 +10,18 @@ -

+

Basic data

+

+ Basic data +

-

+

Billing data

+

+ Billing data +

@@ -75,13 +85,18 @@
-

+

Fiscal data

+

+ Fiscal data +

@@ -100,13 +115,18 @@
-

+

Fiscal address

+

+ Fiscal address +

diff --git a/modules/supplier/front/summary/index.js b/modules/supplier/front/summary/index.js index 099257848..a828379bc 100644 --- a/modules/supplier/front/summary/index.js +++ b/modules/supplier/front/summary/index.js @@ -10,6 +10,10 @@ class Controller extends Summary { this.getSummary(); } + get isAdministrative() { + return this.aclService.hasAny(['administrative']); + } + getSummary() { return this.$http.get(`Suppliers/${this.supplier.id}/getSummary`).then(response => { this.summary = response.data; diff --git a/modules/travel/front/summary/index.html b/modules/travel/front/summary/index.html index 29c4e723c..b8db9946c 100644 --- a/modules/travel/front/summary/index.html +++ b/modules/travel/front/summary/index.html @@ -132,13 +132,18 @@
-

+

Thermograph

+

+ Thermograph +

diff --git a/modules/travel/front/summary/index.js b/modules/travel/front/summary/index.js index 876d1ec6c..5144a0bb5 100644 --- a/modules/travel/front/summary/index.js +++ b/modules/travel/front/summary/index.js @@ -56,6 +56,10 @@ class Controller extends Summary { return total; } + + get isBuyer() { + return this.aclService.hasAny(['buyer']); + } } ngModule.vnComponent('vnTravelSummary', { diff --git a/modules/worker/front/summary/index.html b/modules/worker/front/summary/index.html index 8c7daeb44..324837ae8 100644 --- a/modules/worker/front/summary/index.html +++ b/modules/worker/front/summary/index.html @@ -10,11 +10,16 @@ -

+

Basic data

+

+ Basic data +

diff --git a/modules/worker/front/summary/index.js b/modules/worker/front/summary/index.js index 178df81a9..6a4d87007 100644 --- a/modules/worker/front/summary/index.js +++ b/modules/worker/front/summary/index.js @@ -52,6 +52,10 @@ class Controller extends Summary { this.$.worker = res.data; }); } + + get isHr() { + return this.aclService.hasAny(['hr']); + } } ngModule.vnComponent('vnWorkerSummary', {