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 where autoLoadSupp nulls out #4033

Merged
merged 1 commit into from
Aug 28, 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 @@ -639,7 +639,7 @@ export class QuestionExtrasComponent implements OnInit {
// }

autoLoadSupplemental() {
return this.questionsSvc.autoLoadSupplemental(this.assessSvc.assessment.maturityModel?.modelId);
return this.questionsSvc.autoLoadSupplemental(this.assessSvc.assessment.maturityModel);
}

/**
Expand Down
17 changes: 13 additions & 4 deletions CSETWebNg/src/app/services/questions.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -134,23 +134,32 @@ export class QuestionsService {
/**
* Analyzes the current 'auto load supplemental' preference and the maturity model
*/
autoLoadSupplemental(modelId?: number) {
autoLoadSupplemental(model?: any) {
// first see if it should be forced on by configuration
if (this.configSvc.config.supplementalAutoloadInitialValue) {
return true;
}

// standards (modelid is null) - check the checkbox state
if (!modelId) {
if (!model) {
return this.autoLoadSuppCheckboxState;
}

// check the model's configuration
const modelConfiguration = this.configSvc.config.moduleBehaviors.find(x => x.modelId == modelId);
if (modelConfiguration.autoLoadSupplemental ?? false) {
const modelConfiguration = this.configSvc.config.moduleBehaviors.find(x => x.modelId == model.modelId);
if (modelConfiguration != null && (modelConfiguration.autoLoadSupplemental ?? false)) {
return true;
}

else {
let modelConfigurationByModelName = this.configSvc.config.moduleBehaviors.find(x => x.moduleName == model.moduleName);
if (modelConfigurationByModelName != null && (modelConfiguration.autoLoadSupplemental ?? false)) {
return true;
}
}



return false;
}

Expand Down
Loading