Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add new properties to SSG IT questions #4316

Merged
merged 3 commits into from
Jan 3, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,15 @@ private List<Series> InitializeSeries()
}


// INFORMATION TECHNOLOGY (IT)
var itSectors = new List<int>() { 13, 28 };
if ((itSectors.Contains(demographics?.SectorId ?? -1))
|| itSectors.Contains(ddSector?.IntValue ?? -1))
{
return 20;
}


return null;
}
}
Expand Down
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
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,12 @@ export class CpgPracticeTableComponent implements OnInit {
case 564:
// recover
return this.colorSvc.nistCsfFuncColor('RC');
case 565:
// SSG - IT Software Development
return '#305496';
case 566:
// SSG - IT Product Design
return '#548235';
default:
return '#6BA443';
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ import { Title } from '@angular/platform-browser';
import { ConfigService } from '../../../services/config.service';
import { MaturityService } from '../../../services/maturity.service';
import { QuestionsService } from '../../../services/questions.service';
import { TranslocoService } from '@jsverse/transloco';

@Component({
selector: 'app-cmmc2-comments-marked',
Expand All @@ -45,13 +46,18 @@ export class Cmmc2CommentsMarkedComponent implements OnInit {
public configSvc: ConfigService,
private titleService: Title,
private maturitySvc: MaturityService,
public questionsSvc: QuestionsService
public questionsSvc: QuestionsService,
public tSvc: TranslocoService
) { }

ngOnInit() {
this.tSvc.selectTranslate('comments and marked for review', {}, { scope: 'reports' })
.subscribe(title =>
this.titleService.setTitle(title + ' - ' + this.configSvc.behaviors.defaultTitle));

this.loading = true;
this.keyToCategory = this.maturitySvc.keyToCategory;
this.titleService.setTitle("CMMC 2.0 Comments and Marked for Review - " + this.configSvc.behaviors.defaultTitle);


this.maturitySvc.getCmmcReportData().subscribe(
(r: any) => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
import { Component, Input } from '@angular/core';
import { AssessmentService } from '../../../services/assessment.service';
import { MaturityService } from '../../../services/maturity.service';
import { TranslocoService } from '@jsverse/transloco';
import { TypescriptDefaultsService } from '@ngstack/code-editor';
import { Title } from '@angular/platform-browser';
import { ConfigService } from '../../../services/config.service';

@Component({
selector: 'app-cmmc2-scorecard-report',
Expand All @@ -18,18 +22,26 @@ export class Cmmc2ScorecardReportComponent {

targetLevel: number;

/**
*
*/
/**
*
*/
constructor(
public assessSvc: AssessmentService,
public maturitySvc: MaturityService
public maturitySvc: MaturityService,
public tSvc: TranslocoService,
public titleService: Title,
public configSvc: ConfigService
) { }

/**
*
*/
ngOnInit(): void {
this.tSvc.selectTranslate('scorecard report', {}, { scope: 'reports' })
.subscribe(title => {
this.titleService.setTitle(title + ' - ' + this.configSvc.behaviors.defaultTitle)
});

this.maturitySvc.getCmmcReportData().subscribe((r: any) => {
const info = r.reportData.information;
this.assessmentDate = info.assessment_Date;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ import Chart from 'chart.js/auto';
import { ChartService } from '../../../services/chart.service';
import { MaturityService } from '../../../services/maturity.service';
import { ConfigService } from '../../../services/config.service';
import { TranslocoService } from '@jsverse/transloco';


@Component({
Expand Down Expand Up @@ -62,7 +63,8 @@ export class ExecutiveCMMC2Component implements OnInit, AfterViewInit {
public chartSvc: ChartService,
private maturitySvc: MaturityService,
private titleService: Title,
public configSvc: ConfigService
public configSvc: ConfigService,
public tSvc: TranslocoService
) {

}
Expand All @@ -71,7 +73,10 @@ export class ExecutiveCMMC2Component implements OnInit, AfterViewInit {
*
*/
ngOnInit() {
this.titleService.setTitle("Executive Summary - " + this.configSvc.behaviors.defaultTitle);

this.tSvc.selectTranslate('executive summary', {}, { scope: 'reports' })
.subscribe(title =>
this.titleService.setTitle(title + ' - ' + this.configSvc.behaviors.defaultTitle));

this.targetLevel = 0;
this.reportSvc.getReport('executivematurity').subscribe(
Expand Down
11 changes: 5 additions & 6 deletions CSETWebNg/src/app/reports/commentsmfr/commentsmfr.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ import { TranslocoService } from '@jsverse/transloco';
styleUrls: ['../reports.scss', '../acet-reports.scss']
})
export class CommentsMfrComponent implements OnInit {
translationTabTitle: any;
response: any = null;
remarks: string;

Expand Down Expand Up @@ -66,11 +65,11 @@ export class CommentsMfrComponent implements OnInit {
*/
ngOnInit(): void {
this.loading = true;
this.translationTabTitle = this.tSvc.selectTranslate('reports.core.rra.cmfr.report title')
.subscribe(value =>
this.titleService.setTitle(this.tSvc.translate('reports.core.rra.cmfr.report title') + ' - ' + this.configSvc.behaviors.defaultTitle));

this.tSvc.selectTranslate('comments and marked for review', {}, { scope: 'reports' })
.subscribe(title =>
this.titleService.setTitle(title + ' - ' + this.configSvc.behaviors.defaultTitle));


this.maturitySvc.getCommentsMarked().subscribe(
(r: any) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,10 @@ export class CpgDeficiencyComponent implements OnInit {
ngOnInit(): void {
this.loading = true;

this.titleSvc.setTitle(this.tSvc.translate('reports.core.cpg.deficiency.cpg deficiency') + " - " + this.configSvc.behaviors.defaultTitle);
this.tSvc.selectTranslate('core.cpg.deficiency.cpg deficiency', {}, {scope: 'reports'})
.subscribe(title => {
this.titleSvc.setTitle(title + ' - ' + this.configSvc.behaviors.defaultTitle)
});

// make sure that the assessSvc has the assessment loaded so that we can determine any SSG model applicable
this.assessSvc.getAssessmentDetail().subscribe((assessmentDetail: any) => {
Expand Down
10 changes: 4 additions & 6 deletions CSETWebNg/src/app/reports/cpg/cpg-report/cpg-report.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,8 @@ import { TranslocoService } from '@jsverse/transloco';
styleUrls: ['./cpg-report.component.scss', '../../reports.scss']
})
export class CpgReportComponent implements OnInit {
translationTabTitle: any;

loading = false;

assessmentName: string;
assessmentDate: string;
assessorName: string;
Expand Down Expand Up @@ -66,9 +64,9 @@ export class CpgReportComponent implements OnInit {
*
*/
ngOnInit(): void {
this.translationTabTitle = this.tSvc.selectTranslate('reports.core.cpg.report.cpg report')
.subscribe(value =>
this.titleSvc.setTitle(this.tSvc.translate('reports.core.cpg.report.cpg report') + ' - ' + this.configSvc.behaviors.defaultTitle));
this.tSvc.selectTranslate('core.cpg.report.cpg report', {}, { scope: 'reports' })
.subscribe(title =>
this.titleSvc.setTitle(title + ' - ' + this.configSvc.behaviors.defaultTitle));

this.assessSvc.getAssessmentDetail().subscribe((assessmentDetail: any) => {
this.assessmentName = assessmentDetail.assessmentName;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ export class ExecutiveSummaryComponent implements OnInit {
chartStandardsSummary: Chart;
//canvasStandardResultsByCategory: Chart;
responseResultsByCategory: any;
translationSub: any;

// Charts for Components
componentCount = 0;
Expand All @@ -69,17 +68,16 @@ export class ExecutiveSummaryComponent implements OnInit {
public acetSvc: ACETService,
private assessmentSvc: AssessmentService,
public configSvc: ConfigService,
public tSvc: TranslocoService,
private translocoService: TranslocoService
public tSvc: TranslocoService,
) { }

ngOnInit() {

this.titleService.setTitle("Executive Summary - " + this.configSvc.behaviors.defaultTitle);

this.translationSub = this.translocoService.selectTranslate('')
.subscribe(value =>
this.titleService.setTitle(this.tSvc.translate('reports.core.executive summary.report title') + ' - ' + this.configSvc.behaviors.defaultTitle));
this.tSvc.selectTranslate('core.executive summary.report title', {}, { scope: 'reports' })
.subscribe(title =>
this.titleService.setTitle(title + ' - ' + this.configSvc.behaviors.defaultTitle));

this.reportSvc.getReport('executive').subscribe(
(r: any) => {
Expand Down Expand Up @@ -121,9 +119,4 @@ export class ExecutiveSummaryComponent implements OnInit {
usesRAC() {
return !!this.responseResultsByCategory?.dataSets.find(e => e.label === 'RAC');
}

ngOnDestroy() {
this.translationSub.unsubscribe()
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,9 @@ export class PhysicalSummaryComponent implements OnInit, AfterViewInit {
) { }

ngOnInit() {
this.translationSub = this.tSvc.selectTranslate('reports.core.physical summary.report title')
.subscribe(value =>
this.titleService.setTitle(this.tSvc.translate('reports.core.physical summary.report title') + ' - ' + this.configSvc.behaviors.defaultTitle));
this.tSvc.selectTranslate('core.physical summary.report title', {}, { scope: 'reports' })
.subscribe(title =>
this.titleService.setTitle(title + ' - ' + this.configSvc.behaviors.defaultTitle));

this.reportSvc.getReport('physicalsummary').subscribe(
(r: any) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,6 @@ import { TranslocoService } from '@jsverse/transloco';
styleUrls: ['../../reports.scss', '../../acet-reports.scss']
})
export class RraDeficiencyComponent implements OnInit {
translationTabTitle: any;

response: any;

loading: boolean = false;
Expand All @@ -65,9 +63,9 @@ export class RraDeficiencyComponent implements OnInit {
ngOnInit() {
this.loading = true;

this.translationTabTitle = this.tSvc.selectTranslate('reports.core.rra.rra deficiency report')
.subscribe(value =>
this.titleService.setTitle(this.tSvc.translate('reports.core.rra.rra deficiency report') + ' - ' + this.configSvc.behaviors.defaultTitle));
this.tSvc.selectTranslate('core.rra.rra deficiency report', {}, {scope: 'reports'})
.subscribe(title =>
this.titleService.setTitle(title + ' - ' + this.configSvc.behaviors.defaultTitle));


this.maturitySvc.getMaturityDeficiency("RRA").subscribe(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ import { TranslocoService } from '@jsverse/transloco';
})
export class RraReportComponent implements OnInit {
response: any;
translationTabTitle: any;

overallScoreDisplay: string;
standardBasedScore: number;
Expand Down Expand Up @@ -131,9 +130,9 @@ export class RraReportComponent implements OnInit {
error => console.log('Main RRA report load Error: ' + (<Error>error).message)
);

this.translationTabTitle = this.tSvc.selectTranslate('reports.core.rra.tab title')
.subscribe(value =>
this.titleService.setTitle(this.tSvc.translate('reports.core.rra.tab title') + ' - ' + this.configSvc.behaviors.defaultTitle));
this.tSvc.selectTranslate('core.rra.tab title', {}, { scope: 'reports' })
.subscribe(title =>
this.titleService.setTitle(title + ' - ' + this.configSvc.behaviors.defaultTitle));
}

/**
Expand Down
Loading
Loading