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

Adding UI to map non-Standard Concepts to the Standard ones to streamline Concept Set creation #2978

Merged
merged 7 commits into from
Feb 18, 2025
7 changes: 6 additions & 1 deletion js/components/conceptAddBox/concept-add-box.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ define([
this.noPreview = params.noPreview || false;
this.conceptsToAdd = params.concepts;
this.canSelectSource = params.canSelectSource || false;
this.overrideHandleAddToConceptSet = params.overrideHandleAddToConceptSet;
this.isAdded = ko.observable(false);
this.defaultSelectionOptions = {
includeDescendants: ko.observable(false),
Expand Down Expand Up @@ -142,6 +143,10 @@ define([
}

handleSubmit() {
if (this.overrideHandleAddToConceptSet) {
const items = CommonUtils.buildConceptSetItems(this.conceptsToAdd(), this.selectionOptions());
this.overrideHandleAddToConceptSet(items);
} else {
clearTimeout(this.messageTimeout);
this.isSuccessMessageVisible(true);
this.messageTimeout = setTimeout(() => {
Expand Down Expand Up @@ -186,6 +191,7 @@ define([
CommonUtils.clearConceptsSelectionState(this.conceptsToAdd());
this.selectionOptions(this.defaultSelectionOptions);
}
}

toggleSelectionOption(option) {
const options = this.selectionOptions();
Expand All @@ -198,7 +204,6 @@ define([
setActiveConceptSet(conceptSet) {
this.activeConceptSet(conceptSet);
}

}

return CommonUtils.build('concept-add-box', ConceptAddBox, view);
Expand Down
Loading
Loading