From 326d1fafde0edfe35f93816b813dc9979937840a Mon Sep 17 00:00:00 2001 From: NikoAnderson Date: Mon, 19 Aug 2024 14:49:34 -0400 Subject: [PATCH] fix to polymer / mixture acces defaulting wrong --- .../substance-form-definition.component.ts | 4 ---- src/app/core/substance-form/substance-form.service.ts | 6 +++++- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/app/core/substance-form/substance-form-definition/substance-form-definition.component.ts b/src/app/core/substance-form/substance-form-definition/substance-form-definition.component.ts index 16993db82..536b6b523 100644 --- a/src/app/core/substance-form/substance-form-definition/substance-form-definition.component.ts +++ b/src/app/core/substance-form/substance-form-definition/substance-form-definition.component.ts @@ -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'; diff --git a/src/app/core/substance-form/substance-form.service.ts b/src/app/core/substance-form/substance-form.service.ts index cff68e787..18f9cff66 100644 --- a/src/app/core/substance-form/substance-form.service.ts +++ b/src/app/core/substance-form/substance-form.service.ts @@ -145,6 +145,8 @@ export class SubstanceFormService implements OnDestroy { codes: [], relationships: [], properties: [], + definitionLevel: 'REPRESENTATIVE', + access: ['protected'] }; } else if (substanceClass === 'structurallyDiverse') { this.privateSubstance = { @@ -230,6 +232,8 @@ export class SubstanceFormService implements OnDestroy { moieties: [], relationships: [], properties: [], + definitionLevel: 'REPRESENTATIVE', + access: ['protected'] }; } else { this.privateSubstance = { @@ -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;