From d9a64211de6f1f46ebdbe5f63b6ba453ddf60a32 Mon Sep 17 00:00:00 2001 From: carlossa Date: Tue, 30 May 2023 09:16:02 +0200 Subject: [PATCH] refs #5334 fix descriptor, basic-data, summary --- modules/worker/back/models/department.json | 5 ++++- .../front/department/basic-data/index.html | 3 +-- .../front/department/descriptor/index.html | 12 ++++++------ .../front/department/descriptor/index.js | 7 ++----- .../worker/front/department/summary/index.html | 18 ++++++++++++------ .../worker/front/department/summary/index.js | 3 +-- modules/worker/front/routes.json | 5 ++--- 7 files changed, 28 insertions(+), 25 deletions(-) diff --git a/modules/worker/back/models/department.json b/modules/worker/back/models/department.json index 855124620..37ec3a3a1 100644 --- a/modules/worker/back/models/department.json +++ b/modules/worker/back/models/department.json @@ -8,8 +8,8 @@ }, "properties": { "id": { - "id": true, "type": "number", + "id": true, "description": "Identifier" }, "code": { @@ -38,6 +38,9 @@ }, "hasToMistake": { "type": "number" + }, + "isTeleworking": { + "type": "boolean" } }, "relations": { diff --git a/modules/worker/front/department/basic-data/index.html b/modules/worker/front/department/basic-data/index.html index 2406080bf..9b82f4ec6 100644 --- a/modules/worker/front/department/basic-data/index.html +++ b/modules/worker/front/department/basic-data/index.html @@ -1,9 +1,8 @@ - + url="Departments">
diff --git a/modules/worker/front/department/descriptor/index.html b/modules/worker/front/department/descriptor/index.html index 28433e612..8ac078968 100644 --- a/modules/worker/front/department/descriptor/index.html +++ b/modules/worker/front/department/descriptor/index.html @@ -11,24 +11,24 @@ -

{{worker.department.name}}

-

{{worker.department.id}}

+

{{department}}

+

{{department.id}}

+ value="{{$ctrl.department.chatName}}"> + value="{{$ctrl.department.emailNotification}}"> + value="{{$ctrl.department.clientFK}}"> + value="{{$ctrl.department.workerFk}}">
diff --git a/modules/worker/front/department/descriptor/index.js b/modules/worker/front/department/descriptor/index.js index 31a37e338..3a7c2b5fe 100644 --- a/modules/worker/front/department/descriptor/index.js +++ b/modules/worker/front/department/descriptor/index.js @@ -26,14 +26,11 @@ class Controller extends Descriptor { { relation: 'worker', scope: {fields: ['name']} - }, { - relation: 'department', - scope: {fields: ['name']} } ] }; - return this.getData(`Workers/${this.id}`, {filter}) + return this.getData(`Departments/${this.id}`, {filter}) .then(res => this.entity = res.data); } } @@ -44,6 +41,6 @@ ngModule.vnComponent('vnWorkerDepartmentDescriptor', { template: require('./index.html'), controller: Controller, bindings: { - worker: '<' + department: '<' } }); diff --git a/modules/worker/front/department/summary/index.html b/modules/worker/front/department/summary/index.html index 6950ea7c1..2750cd28e 100644 --- a/modules/worker/front/department/summary/index.html +++ b/modules/worker/front/department/summary/index.html @@ -1,4 +1,5 @@ +
{{summary.name}}
@@ -21,7 +22,7 @@ value="{{summary.code}}"> + value="{{summary.chatName}}"> + ng-model="summary.isTeleworking" + disabled="true"> + ng-model="summary.hasToMistake" + disabled="true"> + ng-model="summary.isProduction" + disabled="true"> + ng-model="summary.hasToRefill" + disabled="true"> + ng-model="summary.hasToSendMail" + disabled="true"> diff --git a/modules/worker/front/department/summary/index.js b/modules/worker/front/department/summary/index.js index 4897c27a2..6fbffc852 100644 --- a/modules/worker/front/department/summary/index.js +++ b/modules/worker/front/department/summary/index.js @@ -10,8 +10,7 @@ class Controller extends Component { const filter = { include: [ {relation: 'client'}, - {relation: 'worker'}, - {relation: 'department'} + {relation: 'worker'} ] }; diff --git a/modules/worker/front/routes.json b/modules/worker/front/routes.json index ccba0551a..7ac692391 100644 --- a/modules/worker/front/routes.json +++ b/modules/worker/front/routes.json @@ -146,9 +146,8 @@ "component": "vn-worker-department-basic-data", "description": "Basic data", "params": { - "item-type": "$ctrl.itemType" - }, - "acl": ["buyer"] + "department": "$ctrl.department" + } }, { "url": "/dms",