Skip to content

Commit

Permalink
Fix incorrect reporting-profile sidebar expansion content
Browse files Browse the repository at this point in the history
This commit fixes #4333

The scan results expansion items were not being correctly mapped to the nodes they belong to.

Signed-off-by: Scott Christopherson <scott@chef.io>
  • Loading branch information
Scott Christopherson committed Sep 21, 2020
1 parent fe4bd0b commit 2b58c5a
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ <h4><strong>Scan results for control:</strong></h4>
</chef-toggle>
<ng-container [ngSwitch]="openControlPane(node)">
<div *ngSwitchCase="'results'">
<div class="result-item" *ngFor="let result of scanResults.control.results">
<div class="result-item" *ngFor="let result of scanResults.controls[node.id]?.results">
<div class="result-item-header">
<chef-icon [ngClass]="result.status">{{ statusIcon(result.status) }}</chef-icon>
<p>{{ result.code_desc }}</p>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ export class ReportingProfileComponent implements OnInit, OnDestroy {
takeUntil(this.isDestroyed))
.subscribe((control) => {
this.scanResults.control = control;
this.scanResults.controls[nodeId] = control;
this.scanResults.controlDetail.item = control;
this.scanResults.showControlDetail = true;
});
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
import { Injectable } from '@angular/core';
import { BehaviorSubject, Observable } from 'rxjs';

interface ControlsByNode {
[nodeId: string]: any;
}

@Injectable()
export class ScanResultsService {

Expand All @@ -12,6 +16,7 @@ export class ScanResultsService {
node: any = {};
profile: any = {};
control: any = {};
controls: ControlsByNode = {};

showNodesList = false;
nodesList: any = {
Expand Down

0 comments on commit 2b58c5a

Please sign in to comment.