Skip to content

Commit

Permalink
Merge pull request #556 from ncats/chemForm_fix
Browse files Browse the repository at this point in the history
fix for simplified form cards appearing elsewhere
  • Loading branch information
NikoAnderson authored Oct 1, 2024
2 parents a45f4b4 + ae70d8d commit 1ce758b
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/app/core/substance-form/substance-form.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -515,9 +515,13 @@ export class SubstanceFormComponent implements OnInit, AfterViewInit, OnDestroy
this.formSections[index].menuLabel = label;
});
const hiddenStateSubscription =
this.formSections[index].dynamicComponentRef.instance.hiddenStateUpdate.subscribe(isHidden => {
this.formSections[index].dynamicComponentRef.instance.hiddenStateUpdate.subscribe(isHidden => {
if ((!this.simplifiedForm) && !(['substance-form-simplified-names','substance-form-simplified-codes-card','substance-form-simplified-references'].includes(this.formSections[index].dynamicComponentName))) {
this.formSections[index].isHidden = isHidden;
});
} else if (this.simplifiedForm) {
this.formSections[index].isHidden = isHidden;
}
});
this.subscriptions.push(hiddenStateSubscription);
this.formSections[index].dynamicComponentRef.instance.canAddItemUpdate.pipe(take(1)).subscribe(isList => {
this.formSections[index].canAddItem = isList;
Expand Down

0 comments on commit 1ce758b

Please sign in to comment.