From 6f6ca17e74a2fd7be77f18b48fcce7197be6710c Mon Sep 17 00:00:00 2001 From: Brett <43300357+MathesonBrett@users.noreply.github.com> Date: Mon, 5 Feb 2024 14:52:23 -0700 Subject: [PATCH 1/5] Added state led to the demographics page warnings --- .../ise-warnings/ise-warnings.component.html | 75 +++++++++++++++---- 1 file changed, 59 insertions(+), 16 deletions(-) diff --git a/CSETWebNg/src/app/assessment/results/reports/ise-warnings/ise-warnings.component.html b/CSETWebNg/src/app/assessment/results/reports/ise-warnings/ise-warnings.component.html index 293f805ace..08d644752c 100644 --- a/CSETWebNg/src/app/assessment/results/reports/ise-warnings/ise-warnings.component.html +++ b/CSETWebNg/src/app/assessment/results/reports/ise-warnings/ise-warnings.component.html @@ -27,20 +27,33 @@ + If state-led, we don't care about the submit button, because it's hidden --> - - "Submit" button is disabled until all required fields on
the - "Demographics" page have been specified. -

- The following required fields are missing from the "Demographics" page: - -
+
+ + "Submit" button is disabled until all required fields on
the + "Demographics" page have been specified. +

+ The following required fields are missing from the "Demographics" page: +
    + +
  • {{ field }}
  • +
    +
+
+
+ +
+ + The following required fields are missing from the "Demographics" page: +
    + +
  • {{ field }}
  • +
    +
+
+
@@ -62,7 +75,14 @@ - + + The following required fields are missing from the "Demographics" page: +
    + +
  • {{ field }}
  • +
    +
+ There are unanswered statements. Some domains will be incomplete.

Some reports are disabled until all Issues have @@ -86,7 +106,7 @@
- + @@ -105,7 +125,15 @@ + + The following required fields are missing from the "Demographics" page: +
    + +
  • {{ field }}
  • +
    +
There are unanswered statements. Some domains will be incomplete. +
@@ -119,11 +147,18 @@ "Submit" button and some reports are disabled until all statements have been answered.
- + + + The following required fields are missing from the "Demographics" page: + There are unanswered statements. Some domains will be incomplete. + @@ -218,6 +253,14 @@ + + The following required fields are missing from the "Demographics" page: + +
Some reports are disabled until all Issues have an "Issue Type" assigned

From 92294c6b2a8e362bab7289b20fcce78ebd943f0b Mon Sep 17 00:00:00 2001 From: Brett <43300357+MathesonBrett@users.noreply.github.com> Date: Tue, 6 Feb 2024 12:47:25 -0700 Subject: [PATCH 2/5] Refactor of the ise warnings page --- .../ise-warnings/ise-warnings.component.html | 157 ++++++++++++++---- .../ise-warnings/ise-warnings.component.ts | 6 +- 2 files changed, 130 insertions(+), 33 deletions(-) diff --git a/CSETWebNg/src/app/assessment/results/reports/ise-warnings/ise-warnings.component.html b/CSETWebNg/src/app/assessment/results/reports/ise-warnings/ise-warnings.component.html index 08d644752c..e964df7ca9 100644 --- a/CSETWebNg/src/app/assessment/results/reports/ise-warnings/ise-warnings.component.html +++ b/CSETWebNg/src/app/assessment/results/reports/ise-warnings/ise-warnings.component.html @@ -20,14 +20,110 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. --------------------------> + +
+
+
+ + + +
+ The following required fields are missing from the "Demographics" page: +
    + +
  • {{ field }}
  • +
    +
+
+ +
+ There are unanswered statements. Some domains will be incomplete. +

+
+ +
+ Some reports are disabled until all Issues have + an "Issue Type" assigned.

+ + Assign an "Issue Type" to the following issues which were +
generated on the "Statements" page: +
    + +
  • {{ title }}
  • +
    +
+
+ +
+
+
+
+ + +
+
+
+ + + +
"Submit" button and some reports are disabled until all issues are resolved
+
+ +
+ The following required fields are missing from the "Demographics" page: +
    + +
  • {{ field }}
  • +
    +
+
+ +
+ There are unanswered examination statements that need to be answered. +

+
+ +
+ All Issues require an "Issue Type" to be assigned. Assign an "Issue Type"
+ to the following issues which were generated on the "Statements" page: +
    + +
  • {{ title }}
  • +
    +
+
+ +
+
+
+
+ + +
+
+
+
+ +
+ This assessment has not been submitted yet. If this assessment is complete, please click submit. +
+
+
+
+
+ + + + + + Don't submit to MERIT without a Credit Union name or asset value above $0 + If state-led, we don't care about the submit button, because it's hidden
@@ -56,9 +152,9 @@
- + have all 3 types of warnings
- + non-state-led "Submit" button and some reports are disabled until
    @@ -74,7 +170,7 @@
- + state-led The following required fields are missing from the "Demographics" page:
    @@ -89,12 +185,12 @@ an "Issue Type" assigned.

    - + singular Assign an "Issue Type" to the following issue which was
    generated on the "Statements" page:
    - + plural Assign an "Issue Type" to the following issues which were
    generated on the "Statements" page: @@ -106,9 +202,9 @@
- + Assessment Config and Unanswered Statements - + non-state-led
"Submit" button and some reports are disabled until
    @@ -123,7 +219,7 @@
- + state-led The following required fields are missing from the "Demographics" page: @@ -141,13 +237,13 @@ - + Submit and reports disabled because unanswered statements "Submit" button and some reports are disabled until all statements have been answered. - + can get here in the case it's state-led and isAssessmentPageFilled() is false @@ -163,25 +259,25 @@ - + only Issue Type warning - + non-state-led
"Submit" button and some reports are disabled until all Issues have an "Issue Type" assigned.

- + state-led
Some reports are disabled until all Issues have an "Issue Type" assigned.

- + singular Assign an "Issue Type" to the following issue which was
generated on the "Statements" page:
- + plural Assign an "Issue Type" to the following issues which were
generated on the "Statements" page: @@ -193,10 +289,10 @@
- + Unanswered Statements and Issue Types (also with state-led and Issue Type)
- + Unanswered and Issue Type for non-state-led "Submit" button and some reports are disabled until
    @@ -205,7 +301,7 @@
- + Unanswered and Issue Type for state-led There are unanswered statements. Some domains will be incomplete.

@@ -213,12 +309,12 @@ an "Issue Type" assigned.

- + singular Assign an "Issue Type" to the following issue which was
generated on the "Statements" page:
- + plural Assign an "Issue Type" to the following issues which were
generated on the "Statements" page: @@ -231,10 +327,10 @@
- + Assessment Config and Issue Types
- + Assessment Config and Issue Type for non-state-led "Submit" button and some reports are disabled until
    @@ -251,7 +347,7 @@
    - + Unanswered and Issue Type for state-led The following required fields are missing from the "Demographics" page: @@ -265,12 +361,12 @@ an "Issue Type" assigned

    - + singular Assign an "Issue Type" to the following issue which was
    generated on the "Statements" page:
    - + plural Assign an "Issue Type" to the following issues which were
    generated on the "Statements" page: @@ -285,8 +381,8 @@ - +If no warnings exist that disable the "Submit" button, check if it has already been submitted + (or if it's state-led and doesn't need a reminder to submit)
    @@ -295,4 +391,5 @@ This assessment has not been submitted yet. If this assessment is complete, please click submit.
    -
    \ No newline at end of file + +--> diff --git a/CSETWebNg/src/app/assessment/results/reports/ise-warnings/ise-warnings.component.ts b/CSETWebNg/src/app/assessment/results/reports/ise-warnings/ise-warnings.component.ts index 04189fe55f..0b73206971 100644 --- a/CSETWebNg/src/app/assessment/results/reports/ise-warnings/ise-warnings.component.ts +++ b/CSETWebNg/src/app/assessment/results/reports/ise-warnings/ise-warnings.component.ts @@ -10,7 +10,7 @@ import { NCUAService } from '../../../../services/ncua.service'; }) export class IseWarningsComponent { @Input() iseHasBeenSubmitted; - @Input() disableIseReportLinks; + @Input() disableIseReportLinks; // <-- Checks for unanswered questions missingFields = []; @@ -20,10 +20,10 @@ export class IseWarningsComponent { ) {} ngOnInit() { - this.getMissingFields(); + this.checkMissingFields(); } - getMissingFields() { + checkMissingFields() { if (this.ncuaSvc.creditUnionName == '' || this.ncuaSvc.creditUnionName === null) { this.missingFields.push("Credit union name"); } From 97c373d457d82d2cd647f4c0fe36fded82a52468 Mon Sep 17 00:00:00 2001 From: Brett <43300357+MathesonBrett@users.noreply.github.com> Date: Wed, 7 Feb 2024 09:05:35 -0700 Subject: [PATCH 3/5] Fix assets being slow --- .../results/reports/ise-warnings/ise-warnings.component.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CSETWebNg/src/app/assessment/results/reports/ise-warnings/ise-warnings.component.ts b/CSETWebNg/src/app/assessment/results/reports/ise-warnings/ise-warnings.component.ts index 0b73206971..01764d2c65 100644 --- a/CSETWebNg/src/app/assessment/results/reports/ise-warnings/ise-warnings.component.ts +++ b/CSETWebNg/src/app/assessment/results/reports/ise-warnings/ise-warnings.component.ts @@ -28,7 +28,7 @@ export class IseWarningsComponent { this.missingFields.push("Credit union name"); } - if (this.ncuaSvc.assetsAsNumber == 0 || this.ncuaSvc.assetsAsString == null) { + if (this.ncuaSvc.assetsAsNumber == 0 || this.ncuaSvc.assetsAsString == null || this.assessSvc.assessment.assets == null) { this.missingFields.push("Assets"); } } From 12d30a5d570693d64ad50de6c553abfcf7421e7b Mon Sep 17 00:00:00 2001 From: Brett <43300357+MathesonBrett@users.noreply.github.com> Date: Wed, 7 Feb 2024 11:57:34 -0700 Subject: [PATCH 4/5] Fixed NCUA observations --- .../questions/issues/issues.component.html | 28 +++---- .../questions/issues/issues.component.ts | 2 + .../question-block-ise.component.html | 12 +-- .../question-block-ise.component.ts | 81 +++++++++---------- CSETWebNg/src/app/services/ncua.service.ts | 4 +- 5 files changed, 64 insertions(+), 63 deletions(-) diff --git a/CSETWebNg/src/app/assessment/questions/issues/issues.component.html b/CSETWebNg/src/app/assessment/questions/issues/issues.component.html index 889738b867..8741f7e898 100644 --- a/CSETWebNg/src/app/assessment/questions/issues/issues.component.html +++ b/CSETWebNg/src/app/assessment/questions/issues/issues.component.html @@ -38,7 +38,7 @@

    Issues

    + [(ngModel)]="observation.title">
    @@ -46,7 +46,7 @@

    Issues

    * (required) - @@ -55,19 +55,19 @@

    Issues

    -
    +
    + [(ngModel)]="observation.risk_Area">
    + [(ngModel)]="observation.sub_Risk">
    @@ -76,32 +76,32 @@

    Issues

    + [(ngModel)]="observation.description">
    - +
    + [(ngModel)]="observation.supp_Guidance">
    - -
    + +
    + [(ngModel)]="observation.actionItems">
    -
    +

    Items marked in red indicate a higher level of risk

    @@ -146,7 +146,7 @@

    Issues

    + [(ngModel)]="observation.citations">
    @@ -155,7 +155,7 @@

    Issues

    - diff --git a/CSETWebNg/src/app/assessment/questions/issues/issues.component.ts b/CSETWebNg/src/app/assessment/questions/issues/issues.component.ts index c452abcf12..fbf2d6abd0 100644 --- a/CSETWebNg/src/app/assessment/questions/issues/issues.component.ts +++ b/CSETWebNg/src/app/assessment/questions/issues/issues.component.ts @@ -102,6 +102,8 @@ export class IssuesComponent implements OnInit { this.questionsSvc.getActionItems(this.questionID, this.observation.observation_Id).subscribe( (data: any) => { + console.log("data:"); + console.log(data); this.actionItems = data; this.observation.risk_Area = this.risk; diff --git a/CSETWebNg/src/app/assessment/questions/question-block-ise/question-block-ise.component.html b/CSETWebNg/src/app/assessment/questions/question-block-ise/question-block-ise.component.html index 2c4e6ea984..78f540994f 100644 --- a/CSETWebNg/src/app/assessment/questions/question-block-ise/question-block-ise.component.html +++ b/CSETWebNg/src/app/assessment/questions/question-block-ise/question-block-ise.component.html @@ -199,27 +199,27 @@ -
    Issue {{ i+1 }}
    -
    {{find.title}}
    +
    {{obs.title}}
    -
    Yes
    -
    -
    +
    Yes
    +
    -
    diff --git a/CSETWebNg/src/app/assessment/questions/question-block-ise/question-block-ise.component.ts b/CSETWebNg/src/app/assessment/questions/question-block-ise/question-block-ise.component.ts index 931eba3c67..55dc411aec 100644 --- a/CSETWebNg/src/app/assessment/questions/question-block-ise/question-block-ise.component.ts +++ b/CSETWebNg/src/app/assessment/questions/question-block-ise/question-block-ise.component.ts @@ -131,16 +131,16 @@ export class QuestionBlockIseComponent implements OnInit { this.extras = details; this.extras.questionId = this.myGrouping.questions[0].questionId; - this.extras.observations.forEach(find => { - if (find.auto_Generated === 1) { - find.question_Id = this.myGrouping.questions[0].questionId; + this.extras.observations.forEach(obs => { + if (obs.auto_Generated === 1) { + obs.question_Id = this.myGrouping.questions[0].questionId; // This is a check for post-merging ISE assessments. // If an issue existed, but all answers were changed to "Yes" on merge, delete the issue. - if (this.ncuaSvc.questionCheck.get(find.question_Id) !== undefined) { - this.ncuaSvc.issueFindingId.set(find.question_Id, find.observation_Id); + if (this.ncuaSvc.questionCheck.get(obs.question_Id) !== undefined) { + this.ncuaSvc.issueObservationId.set(obs.question_Id, obs.observation_Id); } else { - this.deleteIssue(find.observation_Id, true); + this.deleteIssue(obs.observation_Id, true); } } @@ -225,15 +225,15 @@ export class QuestionBlockIseComponent implements OnInit { }); } - deleteIssueMaps(findingId: number) { - const iterator = this.ncuaSvc.issueFindingId.entries(); + deleteIssueMaps(observation: number) { + const iterator = this.ncuaSvc.issueObservationId.entries(); let parentKey = 0; for (let value of iterator) { - if (value[1] === findingId) { + if (value[1] === observation) { parentKey = value[0]; this.ncuaSvc.questionCheck.delete(parentKey); - this.ncuaSvc.issueFindingId.delete(parentKey); + this.ncuaSvc.issueObservationId.delete(parentKey); this.ncuaSvc.deleteHistory.add(parentKey); } } @@ -338,7 +338,7 @@ export class QuestionBlockIseComponent implements OnInit { value++; this.ncuaSvc.questionCheck.set(q.parentQuestionId, value); - if (value >= 1 && !this.ncuaSvc.issueFindingId.has(q.parentQuestionId)) { + if (value >= 1 && !this.ncuaSvc.issueObservationId.has(q.parentQuestionId)) { if (!this.ncuaSvc.deleteHistory.has(q.parentQuestionId)) { this.autoGenerateIssue(q.parentQuestionId, 0); } @@ -348,10 +348,10 @@ export class QuestionBlockIseComponent implements OnInit { if (value < 1) { this.ncuaSvc.questionCheck.delete(q.parentQuestionId); - if (this.ncuaSvc.issueFindingId.has(q.parentQuestionId)) { - let findId = this.ncuaSvc.issueFindingId.get(q.parentQuestionId); - this.ncuaSvc.issueFindingId.delete(q.parentQuestionId); - this.deleteIssue(findId, true); + if (this.ncuaSvc.issueObservationId.has(q.parentQuestionId)) { + let observationId = this.ncuaSvc.issueObservationId.get(q.parentQuestionId); + this.ncuaSvc.issueObservationId.delete(q.parentQuestionId); + this.deleteIssue(observationId, true); } } else { this.ncuaSvc.questionCheck.set(q.parentQuestionId, value); @@ -741,9 +741,9 @@ export class QuestionBlockIseComponent implements OnInit { /** * - * @param findid + * @param observationid */ - addEditIssue(parentId, findid) { + addEditIssue(parentId, observationId) { /* * Per the customer's requests, an Issue's title should include the main * grouping header text and the sub grouping header text. @@ -758,11 +758,11 @@ export class QuestionBlockIseComponent implements OnInit { name = ("Cybersecurity Controls, " + this.myGrouping.title); } - const find: Observation = { + const observation: Observation = { question_Id: parentId, questionType: this.myGrouping.questions[0].questionType, answer_Id: this.myGrouping.questions[0].answer_Id, - observation_Id: findid, + observation_Id: observationId, summary: '', observation_Contacts: null, impact: '', @@ -784,28 +784,28 @@ export class QuestionBlockIseComponent implements OnInit { }; this.dialog.open(IssuesComponent, { - data: find, + data: observation, disableClose: true, }).afterClosed().subscribe(result => { let stringResult = result.toString(); if (stringResult != 'true') { - find.observation_Id = result; + observation.observation_Id = result; - this.observationSvc.saveObservation(find, true).subscribe((r: any) => { + this.observationSvc.saveObservation(observation, true).subscribe((r: any) => { this.myGrouping.questions[0].hasObservation = (this.extras.observations.length > 0); - this.myGrouping.questions[0].answer_Id = find.answer_Id; + this.myGrouping.questions[0].answer_Id = observation.answer_Id; }); } else { - const answerID = find.answer_Id; + const answerID = observation.answer_Id; // if (result == true) { this.observationSvc.getAllObservations(answerID).subscribe( (response: Observation[]) => { this.extras.observations = response; this.myGrouping.questions[0].hasObservation = (this.extras.observations.length > 0); - this.myGrouping.questions[0].answer_Id = find.answer_Id; + this.myGrouping.questions[0].answer_Id = observation.answer_Id; } ), @@ -816,20 +816,19 @@ export class QuestionBlockIseComponent implements OnInit { } - isIssueEmpty(finding: Observation) { - if (finding.actionItems == null - && finding.citations == null - && finding.description == null - && finding.issue == null - && finding.type == null) { + isIssueEmpty(observation: Observation) { + if (observation.actionItems == null + && observation.citations == null + && observation.description == null + && observation.issue == null + && observation.type == null) { return true; } return false; } // ISE "issues" should be generated if an examiner answers 'No' to - // 2 or more important questions with no popup. - autoGenerateIssue(parentId, findId) { + autoGenerateIssue(parentId, observationId) { let name = ""; let desc = ""; @@ -839,16 +838,16 @@ export class QuestionBlockIseComponent implements OnInit { name = ("Cybersecurity Controls, " + this.myGrouping.title); } - this.questionsSvc.getActionItems(parentId, findId).subscribe( + this.questionsSvc.getActionItems(parentId, observationId).subscribe( (data: any) => { // Used to generate a description for ISE reports even if a user doesn't open the issue. desc = data[0]?.description; - const find: Observation = { + const obs: Observation = { question_Id: parentId, questionType: this.myGrouping.questions[0].questionType, answer_Id: this.myGrouping.questions[0].answer_Id, - observation_Id: findId, + observation_Id: observationId, summary: '', observation_Contacts: null, impact: '', @@ -869,20 +868,20 @@ export class QuestionBlockIseComponent implements OnInit { supp_Guidance: null }; - this.ncuaSvc.issueFindingId.set(parentId, findId); + this.ncuaSvc.issueObservationId.set(parentId, observationId); - this.observationSvc.saveObservation(find).subscribe(() => { - const answerID = find.answer_Id; + this.observationSvc.saveObservation(obs).subscribe(() => { + const answerID = obs.answer_Id; this.observationSvc.getAllObservations(answerID).subscribe( (response: Observation[]) => { for (let i = 0; i < response.length; i++) { if (response[i].auto_Generated === 1) { - this.ncuaSvc.issueFindingId.set(parentId, response[i].observation_Id); + this.ncuaSvc.issueObservationId.set(parentId, response[i].observation_Id); } } this.extras.observations = response; this.myGrouping.questions[0].hasObservation = (this.extras.observations.length > 0); - this.myGrouping.questions[0].answer_Id = find.answer_Id; + this.myGrouping.questions[0].answer_Id = obs.answer_Id; }, error => console.log('Error updating observations | ' + (error).message) ); diff --git a/CSETWebNg/src/app/services/ncua.service.ts b/CSETWebNg/src/app/services/ncua.service.ts index 4c560eabb4..258827e0e6 100644 --- a/CSETWebNg/src/app/services/ncua.service.ts +++ b/CSETWebNg/src/app/services/ncua.service.ts @@ -83,7 +83,7 @@ export class NCUAService { // Variables to manage ISE issues state issuesFinishedLoading: boolean = false; questionCheck = new Map(); - issueFindingId = new Map(); + issueObservationId = new Map(); deleteHistory = new Set(); // Keeps track of Issues with unassigned Types for report notification @@ -295,7 +295,7 @@ export class NCUAService { // Clears necessary variables on assessment drop reset() { this.questionCheck.clear(); - this.issueFindingId.clear(); + this.issueObservationId.clear(); this.deleteHistory.clear(); } From bad2b6e51af6aad51cf1b3dc46ffe3942ba3b9a9 Mon Sep 17 00:00:00 2001 From: Brett <43300357+MathesonBrett@users.noreply.github.com> Date: Wed, 7 Feb 2024 12:00:03 -0700 Subject: [PATCH 5/5] Removing some old console logs --- .../src/app/assessment/questions/issues/issues.component.ts | 2 -- 1 file changed, 2 deletions(-) diff --git a/CSETWebNg/src/app/assessment/questions/issues/issues.component.ts b/CSETWebNg/src/app/assessment/questions/issues/issues.component.ts index fbf2d6abd0..c452abcf12 100644 --- a/CSETWebNg/src/app/assessment/questions/issues/issues.component.ts +++ b/CSETWebNg/src/app/assessment/questions/issues/issues.component.ts @@ -102,8 +102,6 @@ export class IssuesComponent implements OnInit { this.questionsSvc.getActionItems(this.questionID, this.observation.observation_Id).subscribe( (data: any) => { - console.log("data:"); - console.log(data); this.actionItems = data; this.observation.risk_Area = this.risk;