Skip to content

Commit b65866f

Browse files
alisaismailatiatarix83
authored andcommitted
Merged in task/dspace-cris-2023_02_x/DSC-1831 (pull request DSpace#1984)
[DSC-1831] prevent rendering of context-menu during ssr Approved-by: Giuseppe Digilio
2 parents 07192b1 + 5e0dcc4 commit b65866f

2 files changed

Lines changed: 3 additions & 4 deletions

File tree

src/app/shared/context-menu/context-menu.component.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<div class="d-flex space-children-mr justify-content-end" *ngIf="contextMenuObject">
1+
<div class="d-flex space-children-mr justify-content-end" dsRenderOnlyForBrowser>
22
<ng-container *ngFor="let entry of (getStandAloneMenuEntries() | async)">
33
<ng-container *ngComponentOutlet="entry; injector: objectInjector;"></ng-container>
44
</ng-container>

src/app/shared/context-menu/context-menu.component.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,7 @@ export class ContextMenuComponent implements OnInit {
6161
private cdr: ChangeDetectorRef,
6262
private configurationService: ConfigurationDataService,
6363
private injector: Injector
64-
) {
65-
}
64+
) { }
6665

6766
ngOnInit(): void {
6867
this.objectInjector = Injector.create({
@@ -91,7 +90,7 @@ export class ContextMenuComponent implements OnInit {
9190
private retrieveSelectedContextMenuEntries(isStandAlone: boolean): Observable<any[]> {
9291
const list = this.contextMenuObjectType ? getContextMenuEntriesForDSOType(this.contextMenuObjectType) : [];
9392
return from(list).pipe(
94-
filter((renderOptions: ContextMenuEntryRenderOptions) => isNotEmpty(renderOptions ?.componentRef) && renderOptions ?.isStandAlone === isStandAlone),
93+
filter((renderOptions: ContextMenuEntryRenderOptions) => isNotEmpty(renderOptions?.componentRef) && renderOptions?.isStandAlone === isStandAlone),
9594
map((renderOptions: ContextMenuEntryRenderOptions) => renderOptions.componentRef),
9695
concatMap((constructor: GenericConstructor<ContextMenuEntryComponent>) => {
9796
const entryComp: ContextMenuEntryComponent = new constructor();

0 commit comments

Comments
 (0)