From 1bb14f2369f52583c0443d352cfb861981786fa5 Mon Sep 17 00:00:00 2001 From: FrancescoMolinaro Date: Fri, 25 Oct 2024 11:30:16 +0200 Subject: [PATCH 1/3] [DSC-1864] fix template function --- src/app/shared/context-menu/context-menu.component.html | 4 ++-- src/app/shared/context-menu/context-menu.component.ts | 6 ++++++ 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/app/shared/context-menu/context-menu.component.html b/src/app/shared/context-menu/context-menu.component.html index ca72dae27c3..9f67127560d 100644 --- a/src/app/shared/context-menu/context-menu.component.html +++ b/src/app/shared/context-menu/context-menu.component.html @@ -1,6 +1,6 @@
- +
- +
diff --git a/src/app/shared/context-menu/context-menu.component.ts b/src/app/shared/context-menu/context-menu.component.ts index acee5a4a63f..4c83924c417 100644 --- a/src/app/shared/context-menu/context-menu.component.ts +++ b/src/app/shared/context-menu/context-menu.component.ts @@ -48,6 +48,9 @@ export class ContextMenuComponent implements OnInit { */ public optionCount = 0; + public standAloneEntries$: Observable; + public contextEntries$: Observable; + /** * Initialize instance variables * @@ -71,6 +74,9 @@ export class ContextMenuComponent implements OnInit { ], parent: this.injector }); + + this.standAloneEntries$ = this.getStandAloneMenuEntries(); + this.contextEntries$ = this.getContextMenuEntries(); } /** From 7323f5819f1a88532ee14779a91aa2f6954d174d Mon Sep 17 00:00:00 2001 From: FrancescoMolinaro Date: Fri, 25 Oct 2024 11:31:33 +0200 Subject: [PATCH 2/3] [DSC-1864] fix space in async pipe --- src/app/shared/context-menu/context-menu.component.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/app/shared/context-menu/context-menu.component.html b/src/app/shared/context-menu/context-menu.component.html index 9f67127560d..5a47718683f 100644 --- a/src/app/shared/context-menu/context-menu.component.html +++ b/src/app/shared/context-menu/context-menu.component.html @@ -1,6 +1,6 @@
- +
Date: Fri, 25 Oct 2024 12:50:25 +0200 Subject: [PATCH 3/3] [DSC-1864] Fix lint warnings --- src/app/shared/context-menu/context-menu.component.ts | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/app/shared/context-menu/context-menu.component.ts b/src/app/shared/context-menu/context-menu.component.ts index 4c83924c417..26c283a8570 100644 --- a/src/app/shared/context-menu/context-menu.component.ts +++ b/src/app/shared/context-menu/context-menu.component.ts @@ -1,4 +1,4 @@ -import { ChangeDetectorRef, Component, Inject, Injector, Input, OnInit } from '@angular/core'; +import { AfterViewChecked, ChangeDetectorRef, Component, Inject, Injector, Input, OnInit } from '@angular/core'; import { DOCUMENT } from '@angular/common'; import { from, Observable } from 'rxjs'; @@ -24,7 +24,7 @@ import { GenericConstructor } from '../../core/shared/generic-constructor'; styleUrls: ['./context-menu.component.scss'], templateUrl: './context-menu.component.html' }) -export class ContextMenuComponent implements OnInit { +export class ContextMenuComponent implements OnInit, AfterViewChecked { /** * The related item @@ -124,10 +124,6 @@ export class ContextMenuComponent implements OnInit { ); } - isItem(): boolean { - return this.contextMenuObjectType === DSpaceObjectType.ITEM; - } - ngAfterViewChecked() { // To check that Context-menu contains options or not if (this._document.getElementById('itemOptionsDropdownMenu')) {