Skip to content

Commit

Permalink
Merge pull request #560 from ncats/simplified_fix2
Browse files Browse the repository at this point in the history
fixing simplied form again
  • Loading branch information
NikoAnderson authored Oct 25, 2024
2 parents 5bf4e07 + 34e54f0 commit 7f63300
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,16 @@ export class SimplifiedReferenceFormComponent implements OnInit, AfterViewInit,
}

updateAccess(access: Array<string>): 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 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<T>(getter: () => T | undefined, interval = 100): Promise<T> {
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) {
Expand All @@ -143,6 +158,7 @@ export class SubstanceFormSimplifiedReferencesCardComponent extends SubstanceCar
});

this.substanceFormReferencesService.emitReferencesUpdate();
});
}

applyReference(domain: any, uuid: string): void {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<h1 mat-dialog-title>
{{dialogTitle}}
</h1>
<div mat-dialog-content>
<div mat-dialog-content class = "submit-message">
{{dialogMessage}}
</div>
<div class="flex-row dialog-actions" mat-dialog-actions *ngIf="!fileUrl">
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
.dialog-actions {
margin-top: 12px;
}

.submit-message {
padding-bottom: 5px;
padding-top: 5px;
}

0 comments on commit 7f63300

Please sign in to comment.