Skip to content

Commit

Permalink
Merge pull request #4296 from cisagov/feature/CSET-2929
Browse files Browse the repository at this point in the history
  • Loading branch information
jekuipers authored Dec 12, 2024
2 parents 8ce141c + 77ccb78 commit 30025d2
Show file tree
Hide file tree
Showing 30 changed files with 303 additions and 100 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,16 @@ public CmmcScores GetCmmcScores(int assessmentId)
{
var response = new CmmcScores();

var selectedLevel = _context.ASSESSMENT_SELECTED_LEVELS
.Where(x => x.Assessment_Id == assessmentId && x.Level_Name == Constants.Constants.MaturityLevel)
.FirstOrDefault();

if (selectedLevel != null)
{
response.TargetLevel = int.Parse(selectedLevel.Standard_Specific_Sal_Level);
}



// Level 1
response.Level1Score = GetScoreForLevel(assessmentId, 1);
Expand Down Expand Up @@ -125,9 +135,18 @@ join q in _context.MATURITY_QUESTIONS on a.Question_Or_Requirement_Id equals q.M
/// Returns a list of scorecards, one for each active level.
/// </summary>
/// <returns></returns>
public List<CmmcScoreModel> GetLevelScorecards(int assessmentId)
public ScorecardResponse GetLevelScorecards(int assessmentId)
{
var response = new List<CmmcScoreModel>();
var response = new ScorecardResponse();

var selectedLevel = _context.ASSESSMENT_SELECTED_LEVELS
.Where(x => x.Assessment_Id == assessmentId && x.Level_Name == Constants.Constants.MaturityLevel)
.FirstOrDefault();

if (selectedLevel != null)
{
response.TargetLevel = int.Parse(selectedLevel.Standard_Specific_Sal_Level);
}

var biz = new MaturityBusiness(_context, _assessmentUtil, _adminTabBusiness);

Expand All @@ -142,19 +161,19 @@ public List<CmmcScoreModel> GetLevelScorecards(int assessmentId)
var l1 = FilterByLevel(x, 1);
if (l1.Domains.Count > 0)
{
response.Add(l1);
response.LevelScorecards.Add(l1);
}

var l2 = FilterByLevel(x, 2);
if (l2.Domains.Count > 0)
{
response.Add(l2);
response.LevelScorecards.Add(l2);
}

var l3 = FilterByLevel(x, 3);
if (l3.Domains.Count > 0)
{
response.Add(l3);
response.LevelScorecards.Add(l3);
}

return response;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,13 @@

namespace CSETWebCore.Model.Maturity
{
public class ScorecardResponse
{
public int TargetLevel { get; set; } = 0;
public List<CmmcScoreModel> LevelScorecards { get; set; } = [];
}


public class CmmcScoreModel
{
public int Level { get; set; }
Expand All @@ -25,6 +32,7 @@ public CmmcScoreModel()
}
}


public class CmmcDomain
{
public string DomainName { get; set; }
Expand All @@ -37,6 +45,7 @@ public CmmcDomain()
}
}


public class CmmcQuestion
{
public int QuestionId { get; set; }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ namespace CSETWebCore.Model.Maturity
{
public class CmmcScores
{
public int TargetLevel { get; set; } = 0;


public int Level1Score { get; set; }
public int Level1MaxScore { get; set; }

Expand Down
8 changes: 5 additions & 3 deletions CSETWebNg/src/app/app-routing.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ import { RraSummaryAllComponent } from './assessment/results/mat-rra/rra-summary
import { CrrResultsPage } from './assessment/results/crr/crr-results-page/crr-results-page.component';
import { CrrSummaryResultsComponent } from './assessment/results/crr/crr-summary-results/crr-summary-results.component';
import { TsaAssessmentCompleteComponent } from './assessment/results/tsa-assessment-complete/tsa-assessment-complete.component';
import { SprsScoreComponent } from './assessment/results/mat-cmmc2/sprs-score/sprs-score.component';
import { SprsScoreComponent } from './assessment/results/mat-cmmc2/scorecard/sprs-score/sprs-score.component';
import { Cmmc2LevelResultsComponent } from './assessment/results/mat-cmmc2/cmmc2-level-results/cmmc2-level-results.component';
import { Cmmc2DomainResultsComponent } from './assessment/results/mat-cmmc2/cmmc2-domain-results/cmmc2-domain-results.component';
import { ExecutiveCMMC2Component } from './reports/cmmc2/executive-cmmc2/executive-cmmc2.component';
Expand Down Expand Up @@ -241,7 +241,8 @@ import { AllReviewedComponent } from './reports/all-reviewed/all-reviewed.compon
import { AnalyticsResultsComponent } from './assessment/results/analytics-results/analytics-results.component';
import { Cmmc2LevelsComponent } from './assessment/prepare/maturity/cmmc2-levels/cmmc2-levels.component';
import { Cmmc2ScoresComponent } from './assessment/results/mat-cmmc2/cmmc2-scores/cmmc2-scores.component';
import { Cmmc2ScorecardComponent } from './assessment/results/mat-cmmc2/cmmc2-scorecard/cmmc2-scorecard.component';
import { Cmmc2ScorecardPageComponent } from './assessment/results/mat-cmmc2/scorecard/cmmc2-scorecard/cmmc2-scorecard-page.component';
import { Cmmc2ScorecardReportComponent } from './reports/cmmc2/cmmc2-scorecard-report/cmmc2-scorecard-report.component';

const appRoutes: Routes = [

Expand Down Expand Up @@ -465,7 +466,7 @@ const appRoutes: Routes = [
{ path: 'cmmc-gaps', component: CmmcGapsComponent },
{ path: 'sprs-score', component: SprsScoreComponent },
{ path: 'cmmc2-scores', component: Cmmc2ScoresComponent },
{ path: 'cmmc2-scorecard', component: Cmmc2ScorecardComponent },
{ path: 'cmmc2-scorecard', component: Cmmc2ScorecardPageComponent },
{ path: 'cmmc2-level-results', component: Cmmc2LevelResultsComponent },
{ path: 'cmmc2-domain-results', component: Cmmc2DomainResultsComponent },
{ path: 'rra-summary-all', component: RraSummaryAllComponent },
Expand Down Expand Up @@ -552,6 +553,7 @@ const appRoutes: Routes = [
{ path: 'cmmcCommentsMarked', component: CmmcCommentsMarkedComponent },
{ path: 'cmmcAltJustifications', component: CmmcAltJustificationsComponent },
{ path: 'cmmc2DeficiencyReport', component: Cmmc2DeficiencyComponent },
{ path: 'cmmc2ScorecardReport', component: Cmmc2ScorecardReportComponent },
{ path: 'cmmc2CommentsMarked', component: Cmmc2CommentsMarkedComponent },
{ path: 'executivecmmc2', component: ExecutiveCMMC2Component },
{ path: 'edm', component: EdmComponent },
Expand Down
12 changes: 7 additions & 5 deletions CSETWebNg/src/app/app.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -298,9 +298,9 @@ import { CmmcGapsComponent } from './assessment/results/mat-cmmc/cmmc-gaps/cmmc-
import { Cmmc2ScoresComponent } from './assessment/results/mat-cmmc2/cmmc2-scores/cmmc2-scores.component';
import { Cmmc2Level1ScoreComponent } from './assessment/results/mat-cmmc2/cmmc2-level1-score/cmmc2-level1-score.component';
import { Cmmc2Level2ScoreComponent } from './assessment/results/mat-cmmc2/cmmc2-level2-score/cmmc2-level2-score.component';
import { Cmmc2Level3ScoreComponent } from './assessment/results/mat-cmmc2/cmmc2-level3-score/cmmc2-level3-score.component';
import { Cmmc2ScorecardComponent } from './assessment/results/mat-cmmc2/cmmc2-scorecard/cmmc2-scorecard.component';
import { LevelScorecardComponent } from './assessment/results/mat-cmmc2/level-scorecard/level-scorecard.component';
import { Cmmc2Level3ScoreComponent } from './assessment/results/mat-cmmc2/scorecard/cmmc2-level3-score/cmmc2-level3-score.component';
import { Cmmc2ScorecardPageComponent } from './assessment/results/mat-cmmc2/scorecard/cmmc2-scorecard/cmmc2-scorecard-page.component';
import { LevelScorecardComponent } from './assessment/results/mat-cmmc2/scorecard/level-scorecard/level-scorecard.component';
import { Cmmc2LevelResultsComponent } from './assessment/results/mat-cmmc2/cmmc2-level-results/cmmc2-level-results.component';
import { Cmmc2DomainResultsComponent } from './assessment/results/mat-cmmc2/cmmc2-domain-results/cmmc2-domain-results.component';
import { ExecutiveCMMC2Component } from './reports/cmmc2/executive-cmmc2/executive-cmmc2.component';
Expand Down Expand Up @@ -417,7 +417,7 @@ import { TsaAssessmentCompleteComponent } from './assessment/results/tsa-assessm
import { LoginTsaComponent } from './initial/login-tsa/login-tsa.component';
import { FeatureOptionTsaComponent } from './assessment/prepare/assessment-info/assessment-config-tsa/feature-option-tsa/feature-option-tsa.component';
import { AboutTsaComponent } from './dialogs/about-tsa/about-tsa.component';
import { SprsScoreComponent } from './assessment/results/mat-cmmc2/sprs-score/sprs-score.component';
import { SprsScoreComponent } from './assessment/results/mat-cmmc2/scorecard/sprs-score/sprs-score.component';
import { AssessmentConfigTsaComponent } from './assessment/prepare/assessment-info/assessment-config-tsa/assessment-config-tsa.component';
import { TutorialCmmc2Component } from './assessment/prepare/maturity/tutorial-cmmc2/tutorial-cmmc2.component';
import { TopMenusComponent } from './layout/top-menus/top-menus.component';
Expand Down Expand Up @@ -510,6 +510,7 @@ import { CrrSideTocComponent } from './reports/crr/crr-report/crr-side-toc/crr-s
import { CrrMainTocComponent } from './reports/crr/crr-report/crr-main-toc/crr-main-toc.component';
import { Cmmc2CommentsMarkedComponent } from './reports/cmmc2/cmmc2-comments-marked/cmmc2-comments-marked.component';
import { Cmmc2DeficiencyComponent } from './reports/cmmc2/cmmc2-deficiency/cmmc2-deficiency.component';
import { Cmmc2ScorecardReportComponent } from './reports/cmmc2/cmmc2-scorecard-report/cmmc2-scorecard-report.component';
import { IseAnsweredQuestionsComponent } from './reports/ise-answeredquestions/ise-answeredquestions.component';
import { IseMeritComponent } from './reports/ise-merit/ise-merit.component';
import { IseDonutChartComponent } from './reports/ise-donut-chart/ise-donut-chart.component';
Expand Down Expand Up @@ -848,7 +849,7 @@ import { AnalyticsResultsComponent } from './assessment/results/analytics-result
Cmmc2Level1ScoreComponent,
Cmmc2Level2ScoreComponent,
Cmmc2Level3ScoreComponent,
Cmmc2ScorecardComponent,
Cmmc2ScorecardPageComponent,
LevelScorecardComponent,
Cmmc2LevelResultsComponent,
Cmmc2DomainResultsComponent,
Expand Down Expand Up @@ -1064,6 +1065,7 @@ import { AnalyticsResultsComponent } from './assessment/results/analytics-result
CrrMainTocComponent,
Cmmc2CommentsMarkedComponent,
Cmmc2DeficiencyComponent,
Cmmc2ScorecardReportComponent,
PrivacyWarningComponent,
PrivacyWarningRejectComponent,
SearchPageComponent,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
</div>

<div class="d-block mb-2">
<h2 *ngIf="groupings?.length != 0">{{ pageTitle }}</h2>
<h2>{{ pageTitle }}</h2>

<h3>{{ groupingTitle }}</h3>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,6 @@ <h3>{{t('titles.performance by level')}}</h3>
<div id="chart" class="mb-3">
<canvas id="{{'level' + l.levelValue }}" style="max-width: 800px; margin: 0 auto;">{{l.chart}}</canvas>
</div>
<div class="d-none">
<div>Compliant: {{l.compliancePercent}}%</div>
<div>Non Compliant {{l.nonCompliancePercent}}%</div>
</div>
</div>
</div>

Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -29,19 +29,19 @@ <h3>{{t('titles.cmmc scorecard')}}</h3>

<div>
<h4>Level 1</h4>
<app-level-scorecard [response]="level(0)"></app-level-scorecard>
<app-level-scorecard [response]="scorecardForLevel(1)"></app-level-scorecard>
</div>


<div *ngIf="assessSvc.assessment.maturityModel.maturityTargetLevel >= 2">
<div *ngIf="targetLevel >= 2">
<h4>Level 2</h4>
<app-level-scorecard [response]="level(1)"></app-level-scorecard>
<app-level-scorecard [response]="scorecardForLevel(2)"></app-level-scorecard>
</div>


<div *ngIf="assessSvc.assessment.maturityModel.maturityTargetLevel >= 3">
<div *ngIf="targetLevel >= 3">
<h4>Level 3</h4>
<app-level-scorecard [response]="level(2)"></app-level-scorecard>
<app-level-scorecard [response]="scorecardForLevel(3)"></app-level-scorecard>
</div>


Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
import { Component, OnInit } from '@angular/core';
import { AssessmentService } from '../../../../../services/assessment.service';
import { MaturityService } from '../../../../../services/maturity.service';

@Component({
selector: 'app-cmmc2-scorecard-page',
templateUrl: './cmmc2-scorecard-page.component.html',
styleUrl: './cmmc2-scorecard-page.component.scss'
})
export class Cmmc2ScorecardPageComponent implements OnInit {

scorecards: any[];

targetLevel: number;

/**
*
*/
constructor(
public maturitySvc: MaturityService
) {}

/**
*
*/
ngOnInit(): void {
this.maturitySvc.getCmmcScorecards().subscribe((x: any) => {
this.targetLevel = x.targetLevel;
this.scorecards = x.levelScorecards;
});
}

scorecardForLevel(l: number) {
if (!!this.scorecards) {
const sc = this.scorecards.find(x => x.level == l);
return sc;
}
return null;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
<tr>
<td class="text-nowrap align-top" [class.fw-bold]="q.score != 0">{{q.title}}</td>
<td class="align-top" [class.fw-bold]="q.score != 0" [innerHTML]="q.questionText"></td>
<td class="align-top" [class.fw-bold]="q.score != 0">{{t('answer-options.labels.' + q.answerText.toLowerCase() +
<td class="align-top text-nowrap" [class.fw-bold]="q.score != 0">{{t('answer-options.labels.' + q.answerText.toLowerCase() +
'-cmmc')}}</td>
<td class="align-top text-center" [class.fw-bold]="q.score != 0">{{q.score == 0 ? '' : q.score}}</td>
</tr>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { Component, Input } from '@angular/core';
import { LayoutService } from '../../../../services/layout.service';
import { LayoutService } from '../../../../../services/layout.service';

@Component({
selector: 'app-level-scorecard',
templateUrl: './level-scorecard.component.html',
styleUrl: './level-scorecard.component.scss'
styleUrls: ['../../../../../reports/reports.scss','./level-scorecard.component.scss']
})
export class LevelScorecardComponent {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@
////////////////////////////////
import { Component, OnInit } from '@angular/core';
import { Title } from '@angular/platform-browser';
import { LayoutService } from '../../../../services/layout.service';
import { MaturityService } from '../../../../services/maturity.service';
import { NavigationService } from '../../../../services/navigation/navigation.service';
import { LayoutService } from '../../../../../services/layout.service';
import { MaturityService } from '../../../../../services/maturity.service';
import { NavigationService } from '../../../../../services/navigation/navigation.service';

@Component({
selector: 'app-sprs-score',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,20 @@
}
]
},
{
"title": "CMMC2",
"reportList": [
{
"linkUrl": "executivecmmc2"
},
{
"linkUrl": "cmmc2ScorecardReport"
},
{
"linkUrl": "cmmc2CommentsMarked"
}
]
},
{
"title": "CPG",
"reportList": [
Expand Down Expand Up @@ -189,20 +203,6 @@
}
]
},
{
"title": "CMMC2",
"reportList": [
{
"linkUrl": "executivecmmc2"
},
{
"linkUrl": "cmmc2DeficiencyReport"
},
{
"linkUrl": "cmmc2CommentsMarked"
}
]
},
{
"title": "CIS",
"reportList": [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -362,6 +362,8 @@ export class ReportsComponent implements OnInit, AfterViewInit {
this.currentSectionId = 'CIS';
} else if (this.assessSvc.usesMaturityModel('CMMC2')) {
this.currentSectionId = 'CMMC2';
} else if (this.assessSvc.usesMaturityModel('CMMC2F')) {
this.currentSectionId = 'CMMC2';
} else if (this.assessSvc.usesMaturityModel('RRA') && !this.isMobile) {
this.currentSectionId = 'RRA';
} else if (this.assessSvc.usesMaturityModel('ACET') && !this.isMobile) {
Expand Down
Loading

0 comments on commit 30025d2

Please sign in to comment.