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

Fixed bug with Observation red dot not showing on first load #3730

Merged
merged 1 commit into from
Feb 7, 2024
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 @@ -230,7 +230,7 @@ private void GetSubgroups(object oParent, int? parentId, int? filterId = null)

if (answer != null)
{
question.HasObservations = _context.FINDING.Any(x => x.Answer_Id == answer.Answer_Id);
question.HasObservation = _context.FINDING.Any(x => x.Answer_Id == answer.Answer_Id);
}


Expand Down Expand Up @@ -298,7 +298,7 @@ private void GetSubgroups(object oParent, int? parentId, int? filterId = null)

if (answer != null)
{
question.HasObservations = _context.FINDING.Any(x => x.Answer_Id == answer.Answer_Id);
question.HasObservation = _context.FINDING.Any(x => x.Answer_Id == answer.Answer_Id);
}


Expand Down Expand Up @@ -405,7 +405,7 @@ private List<Option> GetOptions(int questionId)

if (answer != null)
{
question.HasObservations = _context.FINDING.Any(x => x.Answer_Id == answer.Answer_Id);
question.HasObservation = _context.FINDING.Any(x => x.Answer_Id == answer.Answer_Id);
}


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1066,6 +1066,9 @@ public void BuildSubGroupings(MaturityGrouping g, int? parentID,
{
TinyMapper.Bind<VIEW_QUESTIONS_STATUS, QuestionAnswer>();
TinyMapper.Map(answer.b, qa);

// db view still uses the term "HasDiscovery" - map to "HasObservation"
qa.HasObservation = answer.b.HasDiscovery ?? false;
}

newGrouping.Questions.Add(qa);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,9 @@ private void AddResponseComponentOverride(QuestionResponse resp, List<Answer_Com
{
TinyMapper.Bind<VIEW_QUESTIONS_STATUS, QuestionAnswer>();
TinyMapper.Map(answer.b, qa);

// db view still uses the term "HasDiscovery" - map to "HasObservation"
qa.HasObservation = answer.b.HasDiscovery ?? false;
}

sc.Questions.Add(qa);
Expand Down Expand Up @@ -292,6 +295,9 @@ private void AddResponse(QuestionResponse resp, List<Answer_Components_Base> lis
{
TinyMapper.Bind<VIEW_QUESTIONS_STATUS, QuestionAnswer>();
TinyMapper.Map(answer.b, qa);

// db view still uses the term "HasDiscovery" - map to "HasObservation"
qa.HasObservation = answer.b.HasDiscovery ?? false;
}

sc.Questions.Add(qa);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,9 @@ public QuestionResponse BuildResponse(List<RequirementPlus> requirements,
{
TinyMapper.Bind<VIEW_QUESTIONS_STATUS, QuestionAnswer>();
TinyMapper.Map<VIEW_QUESTIONS_STATUS, QuestionAnswer>(answer.b, qa);

// db view still uses the term "HasDiscovery" - map to "HasObservation"
qa.HasObservation = answer.b.HasDiscovery ?? false;
}

qa.ParmSubs = GetTokensForRequirement(qa.QuestionId, (answer != null) ? answer.a.Answer_Id : 0);
Expand Down Expand Up @@ -364,6 +367,9 @@ public QuestionResponse BuildResponseOLD(List<RequirementPlus> requirements,
if (answer != null)
{
TinyMapper.Map<VIEW_QUESTIONS_STATUS, QuestionAnswer>(answer.b, qa);

// db view still uses the term "HasDiscovery" - map to "HasObservation"
qa.HasObservation = answer.b.HasDiscovery ?? false;
}

qa.ParmSubs = GetTokensForRequirement(qa.QuestionId, (answer != null) ? answer.a.Answer_Id : 0);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -765,6 +765,9 @@ public void BuildSubGroupings(MaturityGrouping g, int? parentID,
{
TinyMapper.Bind<VIEW_QUESTIONS_STATUS, QuestionAnswer>();
TinyMapper.Map(answer.b, qa);

// db view still uses the term "HasDiscovery" - map to "HasObservation"
qa.HasObservation = answer.b.HasDiscovery ?? false;
}

newGrouping.Questions.Add(qa);
Expand Down
2 changes: 1 addition & 1 deletion CSETWebApi/CSETWeb_Api/CSETWebCore.Model/Cis/CisModels.cs
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ public class Question
public List<Question> Followups { get; set; } = new List<Question>();

public string Comment { get; set; }
public bool HasObservations { get; set; }
public bool HasObservation { get; set; }
public string Feedback { get; set; }
public bool MarkForReview { get; set; }
public List<int> DocumentIds { get; set; } = new List<int>();
Expand Down
4 changes: 2 additions & 2 deletions CSETWebNg/src/app/assessment/prepare/sals/sals.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,10 @@ export class SalsComponent implements OnInit {
this.salsSvc.selectedSAL = data;
this.sal_Levels = data;

if (data.methodology.toLowerCase() === 'simple') {
if (!data.methodology) {
data.methodology = 'Simple';
}
if (!data.methodology) {
if (data.methodology.toLowerCase() === 'simple') {
data.methodology = 'Simple';
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -326,6 +326,7 @@ export class QuestionExtrasComponent implements OnInit {
}
return (this.extras && this.extras.observations && this.extras.observations.length > 0) ? 'inline' : 'none';
}
return false;
}

/**
Expand Down
Loading