Skip to content

Commit

Permalink
Merge pull request #4443 from cisagov/bug/cmmc-fix
Browse files Browse the repository at this point in the history
Made POAM export a bit more flexible for other CMMC
  • Loading branch information
randywoods authored Feb 14, 2025
2 parents 121dde5 + cf75123 commit 450c0e4
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
using System.Collections.Generic;
using System.Xml.Linq;
using System.Linq;
using CSETWebCore.Business.Aggregation;


namespace CSETWebCore.Business.Maturity
Expand Down Expand Up @@ -122,8 +121,11 @@ public int GetScoreForLevel(int assessmentId, int level)
{
_context.FillEmptyMaturityQuestionsForAnalysis(assessmentId);

var modelId = _context.AVAILABLE_MATURITY_MODELS.Where(x => x.Assessment_Id == assessmentId).FirstOrDefault()?.model_id;


var levelId = _context.MATURITY_LEVELS
.Where(x => x.Level == level && x.Maturity_Model_Id == modelIdCmmc2)
.Where(x => x.Level == level && x.Maturity_Model_Id == modelId)
.Select(x => x.Maturity_Level_Id)
.FirstOrDefault();

Expand Down
Original file line number Diff line number Diff line change
@@ -1,17 +1,11 @@
using CSETWebCore.Business.Authorization;
using CSETWebCore.Business.Document;
using CSETWebCore.Business.Maturity;
using CSETWebCore.DataLayer.Model;
using CSETWebCore.Interfaces.AdminTab;
using CSETWebCore.Interfaces.Document;
using CSETWebCore.Interfaces.Helpers;
using CSETWebCore.Interfaces.Reports;
using CSETWebCore.Model.Document;
using CSETWebCore.Model.Question;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using Microsoft.CodeAnalysis.Elfie.Model.Map;
using System.Collections.Generic;


namespace CSETWebCore.Api.Controllers
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,12 +87,12 @@ export class ReportListComponent implements OnInit {
*/
setCmmcLevelAchievement() {
const a = this.assessSvc.assessment;

const cmmcModels = ['CMMC', 'CMMC2', 'CMMC2F'];

if (a.maturityModel?.maturityTargetLevel > 1 &&
cmmcModels.indexOf(a.maturityModel?.modelName) >= 0) {
this.maturitySvc.getCmmcScores().subscribe((scores: any) => {
this.cmmcLevel1Achieved = scores.level1Score == scores.level1MaxScore;
this.cmmcLevel1Achieved = scores.level1Score >= scores.level1MaxScore;
});
}
}
Expand Down

0 comments on commit 450c0e4

Please sign in to comment.