Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fixing simplied form again #560

Merged
merged 2 commits into from
Oct 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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;
}
Loading