Skip to content

Commit

Permalink
Include new properties for SSG IT questions
Browse files Browse the repository at this point in the history
New properties are Measurement and Attestation.
  • Loading branch information
randywoods1 committed Jan 3, 2025
1 parent 814a27d commit c27e217
Show file tree
Hide file tree
Showing 9 changed files with 45 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
using System;
using System.Collections.Generic;
using System.Linq;
using NPOI.SS.Formula.Functions;
using Microsoft.EntityFrameworkCore;

namespace CSETWebCore.Business.Question
{
Expand Down Expand Up @@ -132,7 +132,10 @@ public QuestionDetails GetQuestionDetails(int? questionId, int assessmentId, str

if (questionType == "Maturity")
{
var matQuestion = _context.MATURITY_QUESTIONS.Where(q => q.Mat_Question_Id == questionId).FirstOrDefault();
var matQuestion = _context.MATURITY_QUESTIONS
.Include(x => x.MATURITY_QUESTION_PROPS)
.Where(q => q.Mat_Question_Id == questionId).FirstOrDefault();

qp = new QuestionPoco(_context, newAnswer, matQuestion);
}
else
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
using CSETWebCore.Helpers;
using CSETWebCore.Interfaces.Helpers;
using CSETWebCore.Model.Question;
using Microsoft.EntityFrameworkCore.Query;



Expand Down Expand Up @@ -569,6 +570,12 @@ public void BuildMaturityInfoTab(MaturityQuestionInfoData info)
tabData.ExaminationApproach = info.MaturityQuestion.Examination_Approach;


//Include details stored in MATURITY_QUESTION_PROPS
tabData.Measurement = info.MaturityQuestion.MATURITY_QUESTION_PROPS.FirstOrDefault(x => x.PropertyName == "MEASUREMENT")?.PropertyValue;
tabData.Attestation = info.MaturityQuestion.MATURITY_QUESTION_PROPS.FirstOrDefault(x => x.PropertyName == "ATTESTATION")?.PropertyValue;



// apply an overlay if one exists
var lang = _tokenManager.GetCurrentLanguage();

Expand Down
4 changes: 4 additions & 0 deletions CSETWebApi/CSETWeb_Api/CSETWebCore.Helpers/CpgStructure.cs
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,10 @@ private void GetSubgroups(List<Model.Maturity.CPG.Domain> domainList,
question.Complexity = myQ.MATURITY_QUESTION_PROPS.FirstOrDefault(x => x.PropertyName == "COMPLEXITY")?.PropertyValue;


question.Measurement = myQ.MATURITY_QUESTION_PROPS.FirstOrDefault(x => x.PropertyName == "MEASUREMENT")?.PropertyValue;
question.Attestation = myQ.MATURITY_QUESTION_PROPS.FirstOrDefault(x => x.PropertyName == "ATTESTATION")?.PropertyValue;


// overlay
var o = _overlay.GetMaturityQuestion(question.QuestionId, _lang);
if (o != null)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,9 @@ public class Question
public string Impact { get; set; }
public string Complexity { get; set; }

public string Measurement { get; set; }
public string Attestation { get; set; }

public List<string> CsfMappings { get; set; } = [];
public List<TTPReference> TTP { get; set; } = [];

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ public class RequirementTabData
public string SupplementalFact { get; set; }
public string ExaminationApproach { get; set; }

public string Measurement { get; set; }
public string Attestation { get; set; }

public string Set_Name { get; set; }
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -239,8 +239,8 @@
</div>

<div *ngIf=" !!extras && mode == 'SUPP' && displayIcon('SUPP')" class="supplemental">
<!-- CPG "pieces" -->

<!-- CPG "pieces" -->
<div *ngIf="!!myQuestion.scope" class="mb-3">
<div class="sub-header-1">{{t('extras.scope')}}</div>
<div>
Expand All @@ -256,6 +256,22 @@
</div>
</div>

<div *ngIf="!!tab?.requirementsData?.attestation" class="mb-3">
<div class="sub-header-1">
{{t('extras.attestation')}}
</div>
<div [innerHTML]="tab.requirementsData.attestation">
</div>
</div>

<div *ngIf="!!tab?.requirementsData?.measurement" class="mb-3">
<div class="sub-header-1">
{{t('extras.measurement')}}
</div>
<div [innerHTML]="tab.requirementsData.measurement">
</div>
</div>

<div *ngIf="!!myQuestion.implementationGuides" class="mb-3">
<div class="sub-header-1">
{{t('extras.implementation guidance')}}
Expand Down
2 changes: 2 additions & 0 deletions CSETWebNg/src/assets/i18n/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -747,6 +747,8 @@
"recommended action": "Recommended Action",
"free services": "Free Services and References",
"implementation guidance": "Implementation Guidance",
"attestation": "Attestation",
"measurement": "Measurement",
"component type": "Component Type",
"override component answer": "Override Component Answer",
"override": "Override",
Expand Down
2 changes: 2 additions & 0 deletions CSETWebNg/src/assets/i18n/es.json
Original file line number Diff line number Diff line change
Expand Up @@ -600,6 +600,8 @@
"recommended action": "Acción recomendada",
"free services": "Servicios gratuitas y referencias",
"implementation guidance": "Guía de implementación",
"attestation": "Atestación",
"measurement": "Medición",
"component type": "Tipo de componente",
"override component answer": "Sobreescribir Respuesta",
"override": "Sobreescribir",
Expand Down
2 changes: 2 additions & 0 deletions CSETWebNg/src/assets/i18n/uk.json
Original file line number Diff line number Diff line change
Expand Up @@ -554,6 +554,8 @@
"recommended action": "Рекомендована дія",
"free services": "Безкоштовні послуги та довідкові матеріали",
"implementation guidance": "Посібники із впровадження",
"attestation": "Атестація",
"measurement": "Вимірювання",
"component type": "Тип компоненту",
"override component answer": "Перевизначення відповіді компоненту",
"override": "Перевизначення",
Expand Down

0 comments on commit c27e217

Please sign in to comment.