Skip to content

Commit

Permalink
Only show corresponding component in WorkgroupItem if componentId is …
Browse files Browse the repository at this point in the history
…set. #18
  • Loading branch information
breity committed Mar 25, 2021
1 parent 3d369f0 commit 6cb5289
Showing 1 changed file with 14 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { UtilService } from '../../../../services/utilService';
class WorkgroupItemController {
$translate: any;
componentId: string;
components: any[];
components: any[] = [];
disabled: any;
expand: any;
hasAlert: boolean;
Expand Down Expand Up @@ -37,9 +37,19 @@ class WorkgroupItemController {
this.nodeHasWork = this.ProjectService.nodeHasWork(this.nodeId);
this.statusText = '';
this.update();
this.components = this.ProjectService.getComponentsByNodeId(this.nodeId).filter((component) => {
return this.ProjectService.componentHasWork(component);
});
if (this.componentId) {
const component =
this.ProjectService.getComponentByNodeIdAndComponentId(this.nodeId, this.componentId);
if (this.ProjectService.componentHasWork(component)) {
this.components.push(component);
}
} else {
this.components = this.ProjectService.getComponentsByNodeId(this.nodeId).filter(
(component) => {
return this.ProjectService.componentHasWork(component);
}
);
}
}

$onChanges(changesObj) {
Expand Down

0 comments on commit 6cb5289

Please sign in to comment.