From 72d46b932431d3f7e39e7673022e8d72438abc85 Mon Sep 17 00:00:00 2001 From: Tristan Eisermann <19949441+Tristan2357@users.noreply.github.com> Date: Thu, 16 Jul 2020 14:32:52 +0200 Subject: [PATCH] TSK-1340: Classification now gets displayed correctly in Workplace --- .../app/shared/components/dropdown/dropdown.component.ts | 2 +- web/src/app/workplace/components/task/task.component.ts | 2 +- .../taskdetails-general/general-fields.component.html | 2 +- .../taskdetails-general/general-fields.component.ts | 8 ++------ web/src/app/workplace/models/task.ts | 4 ++-- 5 files changed, 7 insertions(+), 11 deletions(-) diff --git a/web/src/app/shared/components/dropdown/dropdown.component.ts b/web/src/app/shared/components/dropdown/dropdown.component.ts index ebd0d3d53..1f368f900 100644 --- a/web/src/app/shared/components/dropdown/dropdown.component.ts +++ b/web/src/app/shared/components/dropdown/dropdown.component.ts @@ -7,7 +7,7 @@ import { Component, EventEmitter, Input, OnInit, Output } from '@angular/core'; }) export class DropdownComponent implements OnInit { @Input() itemSelected: any; - @Input() list: Array; + @Input() list: any[]; @Output() performClassification = new EventEmitter(); ngOnInit(): void { diff --git a/web/src/app/workplace/components/task/task.component.ts b/web/src/app/workplace/components/task/task.component.ts index be72fdda1..6ddcb1313 100644 --- a/web/src/app/workplace/components/task/task.component.ts +++ b/web/src/app/workplace/components/task/task.component.ts @@ -43,7 +43,7 @@ export class TaskComponent implements OnInit, OnDestroy { this.requestInProgress = true; this.task = await this.taskService.getTask(id).toPromise(); const classification = await this.classificationService.getClassification( - this.task.classificationSummaryResource.classificationId + this.task.classificationSummary.classificationId ).toPromise(); this.address = this.extractUrl(classification.applicationEntryPoint) || `${this.address}/?q=${this.task.name}`; this.link = this.sanitizer.bypassSecurityTrustResourceUrl(this.address); diff --git a/web/src/app/workplace/components/taskdetails-general/general-fields.component.html b/web/src/app/workplace/components/taskdetails-general/general-fields.component.html index 953c919f0..f89badfb0 100644 --- a/web/src/app/workplace/components/taskdetails-general/general-fields.component.html +++ b/web/src/app/workplace/components/taskdetails-general/general-fields.component.html @@ -58,7 +58,7 @@
- +
diff --git a/web/src/app/workplace/components/taskdetails-general/general-fields.component.ts b/web/src/app/workplace/components/taskdetails-general/general-fields.component.ts index a86253fe2..958875686 100644 --- a/web/src/app/workplace/components/taskdetails-general/general-fields.component.ts +++ b/web/src/app/workplace/components/taskdetails-general/general-fields.component.ts @@ -52,10 +52,6 @@ export class TaskdetailsGeneralFieldsComponent implements OnInit, OnChanges { } } - selectClassification(classification: Classification) { - this.task.classificationSummaryResource = classification; - } - isFieldValid(field: string): boolean { return this.formsValidatorService.isFieldValid(this.taskForm, field); } @@ -77,8 +73,8 @@ export class TaskdetailsGeneralFieldsComponent implements OnInit, OnChanges { }); } - private changedClassification(itemSelected: any) { - this.task.classificationSummaryResource = itemSelected; + changedClassification(itemSelected: Classification) { + this.task.classificationSummary = itemSelected; } private async getClassificationByDomain() { diff --git a/web/src/app/workplace/models/task.ts b/web/src/app/workplace/models/task.ts index 61a6d849a..7e72f0f38 100644 --- a/web/src/app/workplace/models/task.ts +++ b/web/src/app/workplace/models/task.ts @@ -1,12 +1,12 @@ -import { Classification } from 'app/shared/models/classification'; import { Workbasket } from 'app/shared/models/workbasket'; import { ObjectReference } from './object-reference'; +import { ClassificationSummary } from '../../shared/models/classification-summary'; export class Task { constructor(public taskId: string, public primaryObjRef: ObjectReference = new ObjectReference(), public workbasketSummaryResource?: Workbasket, - public classificationSummaryResource?: Classification, + public classificationSummary?: ClassificationSummary, public businessProcessId?: string, public parentBusinessProcessId?: string, public owner?: string,