From 137e01e60cf963af22bf51489be5c74bc8ca5379 Mon Sep 17 00:00:00 2001 From: carlossa Date: Thu, 22 Jun 2023 15:00:59 +0200 Subject: [PATCH] refs #5334 fix acl, filter --- modules/worker/front/department/card/index.js | 7 ++++--- .../front/department/descriptor/index.html | 4 ++-- .../worker/front/department/summary/index.js | 21 +------------------ modules/worker/front/routes.json | 3 +-- 4 files changed, 8 insertions(+), 27 deletions(-) diff --git a/modules/worker/front/department/card/index.js b/modules/worker/front/department/card/index.js index 93a39dd44c..cf0f3922d6 100644 --- a/modules/worker/front/department/card/index.js +++ b/modules/worker/front/department/card/index.js @@ -7,11 +7,12 @@ class Controller extends ModuleCard { fields: ['id', 'name', 'code', 'workerFk', 'isProduction', 'chatName', 'isTeleworking', 'notificationEmail', 'hasToRefill', 'hasToSendMail', 'hasToMistake', 'clientFk'], include: [ - {relation: 'client', + { + relation: 'client', scope: { fields: ['id', 'name'] - }}, - { + } + }, { relation: 'worker', scope: { fields: ['id', 'firstName', 'lastName'] diff --git a/modules/worker/front/department/descriptor/index.html b/modules/worker/front/department/descriptor/index.html index 904643cc6a..6b7ade66a9 100644 --- a/modules/worker/front/department/descriptor/index.html +++ b/modules/worker/front/department/descriptor/index.html @@ -32,8 +32,8 @@ diff --git a/modules/worker/front/department/summary/index.js b/modules/worker/front/department/summary/index.js index 45e3f6d2d5..574dfac353 100644 --- a/modules/worker/front/department/summary/index.js +++ b/modules/worker/front/department/summary/index.js @@ -6,26 +6,7 @@ class Controller extends Component { this._department = value; this.$.summary = null; if (!value) return; - - const filter = { - fields: ['id', 'name', 'code', 'workerFk', 'isProduction', 'chatName', - 'isTeleworking', 'notificationEmail', 'hasToRefill', 'hasToSendMail', 'hasToMistake', 'clientFk'], - include: [ - {relation: 'client', - scope: { - fields: ['id', 'name'] - }}, - { - relation: 'worker', - scope: { - fields: ['id', 'firstName', 'lastName'] - } - } - ] - }; - - this.$http.get(`Departments/${value.id}`, {filter}) - .then(res => this.$.summary = res.data); + this.$.summary = this.department; } get department() { return this._department; diff --git a/modules/worker/front/routes.json b/modules/worker/front/routes.json index 1a266869e2..7906b1f45c 100644 --- a/modules/worker/front/routes.json +++ b/modules/worker/front/routes.json @@ -124,8 +124,7 @@ "url": "/department?q", "state": "worker.department", "component": "vn-worker-department", - "description":"Departments", - "acl":["hr"] + "description":"Departments" }, { "url": "/:id", "state": "worker.department.card",