From 41384b3bdd42e8a555a0ecfb32cbc475b8ec58e6 Mon Sep 17 00:00:00 2001 From: NikoAnderson Date: Fri, 25 Oct 2024 15:25:13 -0400 Subject: [PATCH 1/2] fixing simplied form again --- .../simplified-reference-form.component.ts | 9 ++++++++ ...rm-simplified-references-card.component.ts | 22 ++++++++++++++++--- 2 files changed, 28 insertions(+), 3 deletions(-) diff --git a/src/app/core/substance-form/simplified-references/simplified-reference-form.component.ts b/src/app/core/substance-form/simplified-references/simplified-reference-form.component.ts index 13b3da5f..53201b14 100644 --- a/src/app/core/substance-form/simplified-references/simplified-reference-form.component.ts +++ b/src/app/core/substance-form/simplified-references/simplified-reference-form.component.ts @@ -52,7 +52,16 @@ export class SimplifiedReferenceFormComponent implements OnInit, AfterViewInit, } updateAccess(access: Array): void { + this.reference.access = access; + if(access && access.length == 0) { + this.reference.tags = ["PUBLIC_DOMAIN_RELEASE"]; + this.reference.publicDomain = true; + } else { + delete this.reference.tags; + this.reference.publicDomain = false; + + } } setSourceType(event?: any): void { diff --git a/src/app/core/substance-form/simplified-references/substance-form-simplified-references-card.component.ts b/src/app/core/substance-form/simplified-references/substance-form-simplified-references-card.component.ts index ba266a60..563b32d3 100644 --- a/src/app/core/substance-form/simplified-references/substance-form-simplified-references-card.component.ts +++ b/src/app/core/substance-form/simplified-references/substance-form-simplified-references-card.component.ts @@ -123,16 +123,31 @@ export class SubstanceFormSimplifiedReferencesCardComponent extends SubstanceCar } applyAllReferencesToAll(): void { - for(const ref of this.references){ - this.applyToAll(ref.uuid) - } + if (this.references && this.references.length > 0) { + for(let ref of this.references){ + this.applyToAll(ref.uuid) + } + } } deleteReference(reference: SubstanceReference): void { this.substanceFormReferencesService.deleteSubstanceReference(reference); } + executeOnceNotUndefined(getter: () => T | undefined, interval = 100): Promise { + return new Promise((resolve) => { + const checkInterval = setInterval(() => { + const result = getter(); + if (result !== undefined) { + clearInterval(checkInterval); + resolve(result); + } + }, interval); + }); +} + applyToAll(uuid: string): void { + this.executeOnceNotUndefined(() => this.domainsWithReferences).then((value) => { this.applyReference(this.domainsWithReferences.definition.domain, uuid); this.domainKeys.map(key => this.domainsWithReferences[key]?.domains).forEach(domains => { if (domains) { @@ -143,6 +158,7 @@ export class SubstanceFormSimplifiedReferencesCardComponent extends SubstanceCar }); this.substanceFormReferencesService.emitReferencesUpdate(); + }); } applyReference(domain: any, uuid: string): void { From 34e54f07defc784ec1754eeed896f0815940e229 Mon Sep 17 00:00:00 2001 From: NikoAnderson Date: Fri, 25 Oct 2024 17:12:20 -0400 Subject: [PATCH 2/2] overflow fix --- .../submit-success-dialog.component.html | 2 +- .../submit-success-dialog.component.scss | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/app/core/substance-form/submit-success-dialog/submit-success-dialog.component.html b/src/app/core/substance-form/submit-success-dialog/submit-success-dialog.component.html index 585d199d..d74d392b 100644 --- a/src/app/core/substance-form/submit-success-dialog/submit-success-dialog.component.html +++ b/src/app/core/substance-form/submit-success-dialog/submit-success-dialog.component.html @@ -1,7 +1,7 @@

{{dialogTitle}}

-
+
{{dialogMessage}}
diff --git a/src/app/core/substance-form/submit-success-dialog/submit-success-dialog.component.scss b/src/app/core/substance-form/submit-success-dialog/submit-success-dialog.component.scss index 6c4b2ba4..9744330f 100644 --- a/src/app/core/substance-form/submit-success-dialog/submit-success-dialog.component.scss +++ b/src/app/core/substance-form/submit-success-dialog/submit-success-dialog.component.scss @@ -1,3 +1,8 @@ .dialog-actions { margin-top: 12px; } + +.submit-message { + padding-bottom: 5px; + padding-top: 5px; +} \ No newline at end of file