Skip to content

Commit

Permalink
Merge pull request #4271 from cisagov/feature/acet794
Browse files Browse the repository at this point in the history
Feature/acet794
  • Loading branch information
randywoods authored Dec 3, 2024
2 parents a3bc9fe + b76e121 commit 8df9571
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 36 deletions.
42 changes: 16 additions & 26 deletions CSETWebNg/src/app/reports/ise-merit/ise-merit.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -39,19 +39,10 @@
<div>
<img src="assets/images/NCUA/ncua_seal_blue.svg" alt="ncua" style="height: 185px" alt="ncua" />
</div>
<div style="
text-align: right;
font-weight: normal;
font-size: 18px;
flex-direction: column;
line-height: 150%;
padding-right: 2em;
">

<div style="text-align: right; font-weight: normal; font-size: 18px;
flex-direction: column; line-height: 150%; padding-right: 2em;">
<div class="title-page-name">{{this.demographics?.information?.assessment_Name}}</div>
<div class="title-page-content">{{this.demographics?.information?.assessment_Date |
localizeDate}}
</div>
<div class="title-page-content">{{this.demographics?.information?.assessment_Date | localizeDate}}</div>
<div class="title-page-content">{{this.demographics?.information?.assessor_Name}}</div>
</div>
</div>
Expand Down Expand Up @@ -243,6 +234,10 @@
</div>

<div *ngIf="observation?.finding?.type !== 'Supplemental Fact'">
<label class="btn form-check-label btn-copy" style="text-align: right; font-weight: normal; font-size: 14px; flex-direction: column; line-height: 150%;"
title="Copy to Clipboard" [cdkCopyToClipboard]="this.combinedActionItems.get(observation?.finding?.finding_Id)">
<span class="cset-icons-copy"></span>
</label>
<strong> Action Items: </strong>
<br>
<div *ngIf="observation?.finding?.auto_Generated != 1">
Expand All @@ -253,16 +248,14 @@
(no Action Items available)
</div>
</div>
<div
*ngIf="this.masterActionItemsMap.has(observation?.finding?.finding_Id) && observation?.finding?.auto_Generated == 1">
<div
*ngFor="let allActionsInFinding of this.masterActionItemsMap.get(observation?.finding?.finding_Id); let i = index">
<div
*ngIf="allActionsInFinding.action_Items != '' && allActionsInFinding.action_Items != '.'">
<label class="btn form-check-label btn-copy" style="text-align: right; font-weight: normal;font-size: 14px;
flex-direction: column; line-height: 150%;"
title="Copy to Clipboard"
[cdkCopyToClipboard]="allActionsInFinding.action_Items">
<div *ngIf="this.masterActionItemsMap.has(observation?.finding?.finding_Id) && observation?.finding?.auto_Generated == 1">
{{ this.combinedActionItems.get(observation?.finding?.finding_Id) }}

<!-- The below code lists all action items individually. This changed on 12/3/24, uncomment this to revert if necessary -->
<!--<div *ngFor="let allActionsInFinding of this.masterActionItemsMap.get(observation?.finding?.finding_Id); let i = index">
<div *ngIf="allActionsInFinding.action_Items != '' && allActionsInFinding.action_Items != '.'">
<label class="btn form-check-label btn-copy" style="text-align: right; font-weight: normal; font-size: 14px; flex-direction: column; line-height: 150%;"
title="Copy to Clipboard" [cdkCopyToClipboard]="allActionsInFinding.action_Items">
<span class="cset-icons-copy"></span>
</label> {{
this.getChildQuestionNumber(allActionsInFinding.question_Title) }}: {{
Expand All @@ -273,10 +266,7 @@
*ngIf="(allActionsInFinding.action_Items == '' || allActionsInFinding.action_Items == '.') && observation?.finding?.actionItems == null">
(no Action Items available)
</div>
</div>
<!-- <div *ngIf="areAllActionItemsBlank(this.masterActionItemsMap.get(observation?.finding?.finding_Id))">
(no Action Items available)
</div> -->
</div>-->
</div>

<div
Expand Down
37 changes: 27 additions & 10 deletions CSETWebNg/src/app/reports/ise-merit/ise-merit.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,11 @@ export class IseMeritComponent implements OnInit {

masterActionItemsMap: Map<number, any[]> = new Map<number, any[]>();

// 12/3/24: Jon wants the action items all combined into one big paragraph. If he decided he doesn't want this
// in the future, just remove any code that references "combinedActionItems" it'll go back to the way it was.
combinedActionItems: Map<number, string> = new Map<number, string>();


// actionItemsMap: Map<number, Map<number, any[]>> = new Map<number, Map<number, any[]>>();
// finding_Id, <question_Id, [action_Items]>
// manualOrAutoMap: Map<number, string> = new Map<number, string>();
Expand Down Expand Up @@ -122,26 +127,39 @@ export class IseMeritComponent implements OnInit {

this.acetSvc.getActionItemsReport(this.ncuaSvc.translateExamLevelToInt(examLevelString)).subscribe((findingData: any) => {
this.actionData = findingData;

let combinedCount = 1;
for (let i = 0; i < this.actionData?.length; i++) {
let actionItemRow = this.actionData[i];

if (actionItemRow.action_Items != '') { //filters out 'deleted' action items
// filters out 'deleted' action items
if (actionItemRow.action_Items != '') {
if (!this.masterActionItemsMap.has(actionItemRow.observation_Id)) {

this.masterActionItemsMap.set(actionItemRow.observation_Id, [actionItemRow]);
} else {
this.combinedActionItems.set(actionItemRow.observation_Id, "");
combinedCount = 1;
}
else
{
let tempActionArray = this.masterActionItemsMap.get(actionItemRow.observation_Id);

tempActionArray.push(actionItemRow);

this.masterActionItemsMap.set(actionItemRow.observation_Id, tempActionArray);

let combinedText = this.combinedActionItems.get(actionItemRow.observation_Id);
combinedText += (combinedCount + ". " + actionItemRow.action_Items + " ");
this.combinedActionItems.set(actionItemRow.observation_Id, combinedText);
combinedCount++;

}
}
}
this.loadingCounter++;

console.log("this.combinedActionItems");
console.log(this.combinedActionItems);
this.loadingCounter++;
});


this.loadingCounter++;

this.acetSvc.getAssessmentInformation().subscribe(
Expand Down Expand Up @@ -169,13 +187,12 @@ export class IseMeritComponent implements OnInit {

for (let i = 0; i < sourceDocList?.length; i++) {
if (!this.sourceFilesMap.has(observation.finding.finding_Id)) {

this.sourceFilesMap.set(observation.finding.finding_Id, [sourceDocList[i]]);
} else {
}
else
{
let tempFileArray = this.sourceFilesMap.get(observation.finding.finding_Id);

tempFileArray.push(sourceDocList[i]);

this.sourceFilesMap.set(observation.finding.finding_Id, tempFileArray);
}
}
Expand Down

0 comments on commit 8df9571

Please sign in to comment.