Skip to content

Commit

Permalink
Merge pull request #4413 from cisagov/ise-updates
Browse files Browse the repository at this point in the history
Ise updates
  • Loading branch information
randywoods authored Feb 10, 2025
2 parents 8d48cf8 + 05f362c commit 445a5cf
Show file tree
Hide file tree
Showing 7 changed files with 123 additions and 125 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -592,6 +592,12 @@ join a in _context.ANSWER on q.Mat_Question_Id equals a.Question_Or_Requirement_
return info;
}

public ISE_ACTIONS GetRegulatoryCitations(int questionId)
{
var result = _context.ISE_ACTIONS.Where(x => x.Parent_Id == questionId).FirstOrDefault();
return result;
}


public int SaveHydroComment(ANSWER answer, int answerId, int progressId, string comment)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -473,8 +473,6 @@ orderby finding.Type.StartsWith("Non"), finding.Type.StartsWith("Supplemental"),
}




/// <summary>
///
/// </summary>
Expand Down Expand Up @@ -729,6 +727,16 @@ public IActionResult AllSubGroupingQuestionCount([FromQuery] int modelId, [FromQ
return Ok(qb.AllQuestionsInSubGroup(modelId, groupLevel, assessmentId));
}

[HttpGet]
[Route("api/getRegulatoryCitations")]
public IActionResult GetRegulatoryCitations([FromQuery] int questionId)
{
int assessmentId = _token.AssessmentForUser();
var qb = new QuestionBusiness(_token, _document, _htmlConverter, _questionRequirement, _assessmentUtil, _context);

var resp = qb.GetRegulatoryCitations(questionId);
return Ok(resp);
}

/// <summary>
///
Expand All @@ -741,6 +749,7 @@ public IActionResult SaveHydroComment([FromBody] HYDRO_DATA_ACTIONS hda)
int assessmentId = _token.AssessmentForUser();
var qb = new QuestionBusiness(_token, _document, _htmlConverter, _questionRequirement, _assessmentUtil, _context);


return Ok(qb.SaveHydroComment(hda.Answer, hda.Answer_Id, hda.Progress_Id, hda.Comment));
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -308,41 +308,22 @@
<br>
<strong> Sub-Risk Area: </strong> {{ observation?.finding?.sub_Risk }}
<br>
<strong> Regulatory Citation: </strong>
<strong>Regulatory Citation: </strong>
<br>
<span *ngIf="regCitationsMap.has(observation?.question?.mat_Question_Id)">
<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]="getReferenceCopyText(observation?.question?.mat_Question_Id)">
<span class="cset-icons-copy"></span>
</label>
{{ regCitationsMap.get(observation?.question?.mat_Question_Id) }}
</span>
<span *ngIf="!regCitationsMap.has(observation?.question?.mat_Question_Id)">(No Regulatory Citations available)</span>
<br>
<div *ngIf="this.masterActionItemsMap.has(observation?.finding?.finding_Id)">
<div *ngIf="observation?.finding?.citations != null && observation?.finding?.citations != ''">
{{
(this.masterActionItemsMap.get(observation?.finding?.finding_Id)[0].regulatory_Citation
== null
||
this.masterActionItemsMap.get(observation?.finding?.finding_Id)[0].regulatory_Citation
== '') ?
' ' :
this.masterActionItemsMap.get(observation?.finding?.finding_Id)[0].regulatory_Citation
+ ', ' }}{{ observation?.finding?.citations }}
</div>
<div *ngIf="(observation?.finding?.citations == null || observation?.finding?.citations == '')
&& this.masterActionItemsMap.get(observation?.finding?.finding_Id)[0].regulatory_Citation != null
&& this.masterActionItemsMap.get(observation?.finding?.finding_Id)[0].regulatory_Citation != ''">
{{
this.masterActionItemsMap.get(observation?.finding?.finding_Id)[0].regulatory_Citation
}}
</div>
<div *ngIf="(this.masterActionItemsMap.get(observation?.finding?.finding_Id)[0].regulatory_Citation == null
|| this.masterActionItemsMap.get(observation?.finding?.finding_Id)[0].regulatory_Citation == '')
&& (observation?.finding?.citations == null || observation?.finding?.citations == '')">
(no Regulatory Citations available)
</div>
</div>
<div *ngIf="!this.masterActionItemsMap.has(observation?.finding?.finding_Id)">
(no Regulatory Citations available)
</div>
</div>
<div *ngIf="observation?.finding?.type === 'Supplemental Fact'">

<div *ngIf="observation?.finding?.type === 'Supplemental Fact'">
<strong> Supplemental Fact: </strong>

<br>
<span
*ngIf="observation?.finding?.supp_Guidance != null && observation?.finding?.supp_Guidance != ''"
Expand All @@ -358,6 +339,16 @@
</div>
</span>
<span *ngIf="!sourceFilesMap.has(observation?.finding?.finding_Id)">(no Resources available)</span>

<br>

<strong> References: </strong>
<br>
<span *ngIf="regCitationsMap.has(observation?.question?.mat_Question_Id)">
{{ regCitationsMap.get(observation?.question?.mat_Question_Id) }}
</span>
<span *ngIf="!regCitationsMap.has(observation?.question?.mat_Question_Id)">(No Regulatory Citations available)</span>
<br>
</div>


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ export class IseExaminationComponent implements OnInit {
masterActionItemsMap: Map<number, any[]> = new Map<number, any[]>();

sourceFilesMap: Map<number, any[]> = new Map<number, any[]>();
regCitationsMap: Map<number, any[]> = new Map<number, any[]>();
regCitationsMap: Map<number, string> = new Map<number, string>();
showActionItemsMap: Map<string, any[]> = new Map<string, any[]>(); //stores what action required to show (answered 'No')

examinerFindings: string[] = [];
Expand Down Expand Up @@ -217,6 +217,11 @@ export class IseExaminationComponent implements OnInit {
for (let i = 0; i < this.observationResponse?.length; i++) {
if (this.ncuaSvc.translateExamLevel(this.observationResponse[i]?.question?.maturity_Level_Id).substring(0, 4) == this.examLevel.substring(0, 4)) {
let observation = this.observationResponse[i];

this.questionsSvc.getRegulatoryCitations(observation.question.mat_Question_Id).subscribe((result: any) => {
this.regCitationsMap.set(observation.question.mat_Question_Id, result.regulatory_Citation);
});

this.questionsSvc.getDetails(observation.question.mat_Question_Id, 'Maturity').subscribe(
(r: any) => {
this.files = r;
Expand Down Expand Up @@ -389,4 +394,7 @@ export class IseExaminationComponent implements OnInit {
return false;
}

getReferenceCopyText(parentId: number) {
return (this.regCitationsMap.get(parentId));
}
}
89 changes: 29 additions & 60 deletions CSETWebNg/src/app/reports/ise-merit/ise-merit.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -290,64 +290,18 @@
<br>
<strong>Regulatory Citation: </strong>
<br>
<div *ngIf="this.masterActionItemsMap.has(observation?.finding?.finding_Id)">
<div
*ngIf="observation?.finding?.citations != null && observation?.finding?.citations != ''">
<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.masterActionItemsMap.get(observation?.finding?.finding_Id)[0].regulatory_Citation == null
|| this.masterActionItemsMap.get(observation?.finding?.finding_Id)[0].regulatory_Citation == '') ?
' ' : this.masterActionItemsMap.get(observation?.finding?.finding_Id)[0].regulatory_Citation + ', ') + observation?.finding?.citations">
<span class="cset-icons-copy"></span>
</label>
{{
(this.masterActionItemsMap.get(observation?.finding?.finding_Id)[0].regulatory_Citation
== null
||
this.masterActionItemsMap.get(observation?.finding?.finding_Id)[0].regulatory_Citation
== '') ?
' ' :
this.masterActionItemsMap.get(observation?.finding?.finding_Id)[0].regulatory_Citation
+ ', ' }}{{ observation?.finding?.citations }}
</div>
<div
*ngIf="(observation?.finding?.citations == null || observation?.finding?.citations == '')
&& this.masterActionItemsMap.get(observation?.finding?.finding_Id)[0].regulatory_Citation != null
&& this.masterActionItemsMap.get(observation?.finding?.finding_Id)[0].regulatory_Citation != ''">
<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.masterActionItemsMap.get(observation?.finding?.finding_Id)[0].regulatory_Citation">
<span class="cset-icons-copy"></span>
</label>
{{
this.masterActionItemsMap.get(observation?.finding?.finding_Id)[0].regulatory_Citation
}}
</div>
<div
*ngIf="(this.masterActionItemsMap.get(observation?.finding?.finding_Id)[0].regulatory_Citation == null
|| this.masterActionItemsMap.get(observation?.finding?.finding_Id)[0].regulatory_Citation == '')
&& (observation?.finding?.citations == null || observation?.finding?.citations == '')">
<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]="'(no Regulatory Citations available)'">
<span class="cset-icons-copy"></span>
</label>
(no Regulatory Citations available)
</div>
</div>
<div *ngIf="!this.masterActionItemsMap.has(observation?.finding?.finding_Id)">
<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]="'(no Regulatory Citations available)'">
<span *ngIf="regCitationsMap.has(observation?.question?.mat_Question_Id)">
<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]="getReferenceCopyText(observation?.question?.mat_Question_Id)">
<span class="cset-icons-copy"></span>
</label>
(no Regulatory Citations available)
</div>

{{ regCitationsMap.get(observation?.question?.mat_Question_Id) }}
</span>
<span *ngIf="!regCitationsMap.has(observation?.question?.mat_Question_Id)">(No Regulatory Citations available)</span>
<br>
</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"
Expand All @@ -358,9 +312,9 @@
<strong> Supplemental Fact: </strong>
<br>
<span *ngIf="observation?.finding?.supp_Guidance != ''" style="white-space: pre-wrap;"
[innerHtml]="observation?.finding?.supp_Guidance"></span>
<span *ngIf="observation?.finding?.supp_Guidance == ''">(no Supplemental Fact
available)</span>
[innerHtml]="observation?.finding?.supp_Guidance">
</span>
<span *ngIf="observation?.finding?.supp_Guidance == ''">(no Supplemental Fact available)</span>

<br>
<!-- <label class="btn form-check-label btn-copy" style="text-align: right; font-weight: normal; font-size: 14px;
Expand All @@ -372,15 +326,30 @@
<br>
<span *ngIf="sourceFilesMap.has(observation?.finding?.finding_Id)">
<div *ngFor="let file of sourceFilesMap.get(observation?.finding?.finding_Id)">
<label class="btn form-check-label btn-copy" style="text-align: right; font-weight: normal; font-size: 14px;
<label class="btn form-check-label btn-copy" style="text-align: left; font-weight: normal; font-size: 14px;
flex-direction: column; line-height: 150%;" title="Copy to Clipboard"
[cdkCopyToClipboard]="file.title + ' (Section: ' + file.sectionRef + ')'">
<span class="cset-icons-copy"></span>
</label>
{{ file.title }} (<strong>Section:</strong> {{ file.sectionRef }})
</div>
</span>
<span *ngIf="!sourceFilesMap.has(observation?.finding?.finding_Id)">(no Resources available)</span>
<span *ngIf="!sourceFilesMap.has(observation?.finding?.finding_Id)">(No Resources available)</span>

<br>

<strong> References: </strong>
<br>
<span *ngIf="regCitationsMap.has(observation?.question?.mat_Question_Id)">
<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]="getReferenceCopyText(observation?.question?.mat_Question_Id)">
<span class="cset-icons-copy"></span>
</label>
{{ regCitationsMap.get(observation?.question?.mat_Question_Id) }}
</span>
<span *ngIf="!regCitationsMap.has(observation?.question?.mat_Question_Id)">(No Regulatory Citations available)</span>
<br>
</div>

<hr class="page-line">
Expand Down
Loading

0 comments on commit 445a5cf

Please sign in to comment.