From 5a9fcf7dd3b9a3b614b51ef0e2e90e0f3a9f1ff9 Mon Sep 17 00:00:00 2001 From: LaddieZeigler <85979055+LaddieZeigler@users.noreply.github.com> Date: Tue, 16 Jan 2024 12:54:43 -0700 Subject: [PATCH 1/2] Fixed component detail toggle --- .../question-extras/question-extras.component.ts | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/CSETWebNg/src/app/assessment/questions/question-extras/question-extras.component.ts b/CSETWebNg/src/app/assessment/questions/question-extras/question-extras.component.ts index 9a32026768..bc1a755f49 100644 --- a/CSETWebNg/src/app/assessment/questions/question-extras/question-extras.component.ts +++ b/CSETWebNg/src/app/assessment/questions/question-extras/question-extras.component.ts @@ -75,6 +75,8 @@ export class QuestionExtrasComponent implements OnInit { showQuestionIds = false; + count = 0; + /** * Stores the original document title, in case the user escapes out of an unwanted change */ @@ -169,12 +171,18 @@ export class QuestionExtrasComponent implements OnInit { this.extras = details; if (details.is_Component === true){ this.myQuestion.is_Component = true; + this.count = 1; } this.extras.questionId = this.myQuestion.questionId; // populate my details with the first "non-null" tab this.tab = this.extras.listTabs?.find(t => t.requirementFrameworkTitle != null) ?? this.extras.listTabs[0]; + + if (this.count == 1){ + this.toggleExtras('COMPONENT') + this.count = 0; + } // add questionIDs to related questions for debug if configured to do so if (this.showQuestionIds) { From 026d05e3ebd37e22562af313dbe98366be0745e4 Mon Sep 17 00:00:00 2001 From: LaddieZeigler <85979055+LaddieZeigler@users.noreply.github.com> Date: Tue, 16 Jan 2024 13:30:38 -0700 Subject: [PATCH 2/2] Variable to boolean and comment added --- .../question-extras/question-extras.component.ts | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/CSETWebNg/src/app/assessment/questions/question-extras/question-extras.component.ts b/CSETWebNg/src/app/assessment/questions/question-extras/question-extras.component.ts index bc1a755f49..b909a1401e 100644 --- a/CSETWebNg/src/app/assessment/questions/question-extras/question-extras.component.ts +++ b/CSETWebNg/src/app/assessment/questions/question-extras/question-extras.component.ts @@ -75,7 +75,7 @@ export class QuestionExtrasComponent implements OnInit { showQuestionIds = false; - count = 0; + toggleComponent = false; /** * Stores the original document title, in case the user escapes out of an unwanted change @@ -171,7 +171,7 @@ export class QuestionExtrasComponent implements OnInit { this.extras = details; if (details.is_Component === true){ this.myQuestion.is_Component = true; - this.count = 1; + this.toggleComponent = true; } this.extras.questionId = this.myQuestion.questionId; @@ -179,9 +179,11 @@ export class QuestionExtrasComponent implements OnInit { // populate my details with the first "non-null" tab this.tab = this.extras.listTabs?.find(t => t.requirementFrameworkTitle != null) ?? this.extras.listTabs[0]; - if (this.count == 1){ + + // Component detail toggle + if (this.toggleComponent == true){ this.toggleExtras('COMPONENT') - this.count = 0; + this.toggleComponent = false; } // add questionIDs to related questions for debug if configured to do so