From 0a5ca5363f1d9969a95cfea43e9d6a3671f7f511 Mon Sep 17 00:00:00 2001 From: Randy Woods Date: Wed, 12 Jun 2024 15:54:25 -0600 Subject: [PATCH] Fixed CPG question text in Deficiency and Tear-Out Sheets QuestionText is no longer used for CPG questions, so we now display SecurityPractice instead. --- .../CSETWebCore.Business/Reports/ReportsDataBusiness.cs | 6 ++++++ .../cpg/cpg-deficiency/cpg-deficiency.component.html | 3 +-- .../cpg/cpg-deficiency/cpg-deficiency.component.ts | 8 -------- 3 files changed, 7 insertions(+), 10 deletions(-) diff --git a/CSETWebApi/CSETWeb_Api/CSETWebCore.Business/Reports/ReportsDataBusiness.cs b/CSETWebApi/CSETWeb_Api/CSETWebCore.Business/Reports/ReportsDataBusiness.cs index 365760b7a6..e040ddbcf9 100644 --- a/CSETWebApi/CSETWeb_Api/CSETWebCore.Business/Reports/ReportsDataBusiness.cs +++ b/CSETWebApi/CSETWeb_Api/CSETWebCore.Business/Reports/ReportsDataBusiness.cs @@ -1781,6 +1781,12 @@ private void GetQuestionTitleAndText(dynamic f, identifier = f.mq.Question_Title; questionText = f.mq.Question_Text; + // CPG is a special case + if (!String.IsNullOrEmpty(f.mq.Security_Practice)) + { + questionText = f.mq.Security_Practice; + } + // overlay MaturityQuestionOverlay o = _overlay.GetMaturityQuestion(f.mq.Mat_Question_Id, lang); if (o != null) diff --git a/CSETWebNg/src/app/reports/cpg/cpg-deficiency/cpg-deficiency.component.html b/CSETWebNg/src/app/reports/cpg/cpg-deficiency/cpg-deficiency.component.html index 99fcd303aa..7d5c9f6557 100644 --- a/CSETWebNg/src/app/reports/cpg/cpg-deficiency/cpg-deficiency.component.html +++ b/CSETWebNg/src/app/reports/cpg/cpg-deficiency/cpg-deficiency.component.html @@ -45,10 +45,9 @@

{{t('reports.core.cpg.deficiency.deficiencies')}}

{{s.mat.question_Title}} - {{parseQuestionText(s.mat.question_Text)}} + {{s.mat.security_Practice}}
- {{questionsSvc.answerDisplayLabel(11, s.answer.answer_Text)}}
diff --git a/CSETWebNg/src/app/reports/cpg/cpg-deficiency/cpg-deficiency.component.ts b/CSETWebNg/src/app/reports/cpg/cpg-deficiency/cpg-deficiency.component.ts index 353251fa12..66890e1d29 100644 --- a/CSETWebNg/src/app/reports/cpg/cpg-deficiency/cpg-deficiency.component.ts +++ b/CSETWebNg/src/app/reports/cpg/cpg-deficiency/cpg-deficiency.component.ts @@ -87,12 +87,4 @@ export class CpgDeficiencyComponent implements OnInit { this.loading = true; }) } - - parseQuestionText(textWithHtml: string) { - let startOfRealText = textWithHtml.indexOf(this.cpgPracticeTag) + this.cpgPracticeTag.length; - let endOfRealText = textWithHtml.indexOf('<', startOfRealText); - - return textWithHtml.substring(startOfRealText, endOfRealText); - } - }