Skip to content

Commit

Permalink
Merge pull request #538 from ncats/fixesHF2
Browse files Browse the repository at this point in the history
fix to polymer / mixture acces defaulting wrong
  • Loading branch information
NikoAnderson authored Aug 19, 2024
2 parents a462fec + 326d1fa commit 29ec708
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -83,10 +83,6 @@ export class SubstanceFormDefinitionComponent extends SubstanceFormBase implemen
const subscription = this.substanceFormService.definition.subscribe(definition => {
this.defAccess = this.substanceFormService.getDefinitionForDefRef();
this.definition = definition || {};
if (definition && definition.substanceClass && (definition.substanceClass === 'polymer' || definition.substanceClass === 'mixture') && !definition.uuid) {
this.definition.definitionLevel = 'REPRESENTATIVE';
this.updateDefinition();
}
this.crossCheckTags();
if (this.definition.substanceClass === 'structure') {
this.substanceClass = 'chemical';
Expand Down
6 changes: 5 additions & 1 deletion src/app/core/substance-form/substance-form.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,8 @@ export class SubstanceFormService implements OnDestroy {
codes: [],
relationships: [],
properties: [],
definitionLevel: 'REPRESENTATIVE',
access: ['protected']
};
} else if (substanceClass === 'structurallyDiverse') {
this.privateSubstance = {
Expand Down Expand Up @@ -230,6 +232,8 @@ export class SubstanceFormService implements OnDestroy {
moieties: [],
relationships: [],
properties: [],
definitionLevel: 'REPRESENTATIVE',
access: ['protected']
};
} else {
this.privateSubstance = {
Expand Down Expand Up @@ -537,7 +541,7 @@ export class SubstanceFormService implements OnDestroy {
updateDefinition(definition: SubstanceFormDefinition): void {
this.privateSubstance.definitionLevel = definition.definitionLevel;
this.privateSubstance.deprecated = definition.deprecated;
this.privateSubstance.access = definition.access;
this.privateSubstance.access = definition.access
this.privateSubstance.created = definition.created;
this.privateSubstance.createdBy = definition.createdBy;
this.privateSubstance.lastEdited = definition.lastEdited;
Expand Down

0 comments on commit 29ec708

Please sign in to comment.