From 0beaa18452fb4960c79a31f3bc31524ec0d5e8cc Mon Sep 17 00:00:00 2001 From: Mykyta Maliarchuk <84377976+nikita-web-ua@users.noreply.github.com> Date: Fri, 19 Jun 2026 10:26:17 +0200 Subject: [PATCH] [ACS-11973] Fix: context menu disappears during bulk upload (#11994) --- .../services/document-list.service.md | 13 ++++++++----- .../components/document-list.component.spec.ts | 10 ++++++++++ .../components/document-list.component.ts | 4 ++++ .../services/document-list.service.spec.ts | 7 +++++++ .../document-list/services/document-list.service.ts | 9 +++++++++ 5 files changed, 38 insertions(+), 5 deletions(-) diff --git a/docs/content-services/services/document-list.service.md b/docs/content-services/services/document-list.service.md index 5539991b69..84279ed197 100644 --- a/docs/content-services/services/document-list.service.md +++ b/docs/content-services/services/document-list.service.md @@ -2,7 +2,7 @@ Title: Document List service Added: v2.0.0 Status: Active -Last reviewed: 2019-01-16 +Last reviewed: 2026-06-16 --- # Document List Service @@ -21,10 +21,11 @@ import { DocumentListService } from '@alfresco/adf-core'; ### Events -| Name | Description | -|-------------------|-------------------------------------------------| -| `reload$` | Emits when the document list should be reloaded | -| `resetSelection$` | Emits when the selection should be reset | +| Name | Description | +|-------------------|----------------------------------------------------------------------------------------------| +| `reload$` | Emits when the document list should be reloaded. | +| `resetSelection$` | Emits when the selection should be reset. | +| `reloadSilently$` | Emits when the document list should be reloaded **without** resetting the current selection. | ### Methods @@ -32,6 +33,8 @@ import { DocumentListService } from '@alfresco/adf-core'; Reloads the document list. - **resetSelection**(): `void`
Resets the selection. +- **reloadSilently**(): `void`
+ Reloads the document list **without** resetting the current selection. - **copyNode**(nodeId: `string`, targetParentId: `string`): `Observable`
Copy a node to destination node - _nodeId:_ `string` - The id of the node to be copied diff --git a/lib/content-services/src/lib/document-list/components/document-list.component.spec.ts b/lib/content-services/src/lib/document-list/components/document-list.component.spec.ts index 6dea15dd38..95a21f2586 100644 --- a/lib/content-services/src/lib/document-list/components/document-list.component.spec.ts +++ b/lib/content-services/src/lib/document-list/components/document-list.component.spec.ts @@ -175,6 +175,16 @@ describe('DocumentList', () => { expect(documentList.resetSelection).not.toHaveBeenCalled(); }); + it('should call reloadWithoutResettingSelection and NOT resetSelection when reloadSilently$ is emitted', () => { + spyOn(documentList, 'reloadWithoutResettingSelection').and.callThrough(); + spyOn(documentList, 'resetSelection').and.callThrough(); + + documentListService.reloadSilently(); + + expect(documentList.reloadWithoutResettingSelection).toHaveBeenCalled(); + expect(documentList.resetSelection).not.toHaveBeenCalled(); + }); + describe('presets', () => { const validatePreset = (keys: string[]) => { const columns = documentList.data.getColumns(); diff --git a/lib/content-services/src/lib/document-list/components/document-list.component.ts b/lib/content-services/src/lib/document-list/components/document-list.component.ts index a402e57b7a..53c266896c 100644 --- a/lib/content-services/src/lib/document-list/components/document-list.component.ts +++ b/lib/content-services/src/lib/document-list/components/document-list.component.ts @@ -561,6 +561,10 @@ export class DocumentListComponent extends DataTableSchema implements OnInit, On this.reload(); }); + this.documentListService.reloadSilently$.pipe(takeUntilDestroyed(this.destroyRef)).subscribe(() => { + this.reloadWithoutResettingSelection(); + }); + this.documentListService.resetSelection$.pipe(takeUntilDestroyed(this.destroyRef)).subscribe(() => { this.resetSelection(); }); diff --git a/lib/content-services/src/lib/document-list/services/document-list.service.spec.ts b/lib/content-services/src/lib/document-list/services/document-list.service.spec.ts index 3511f61581..4b6cf29c9e 100644 --- a/lib/content-services/src/lib/document-list/services/document-list.service.spec.ts +++ b/lib/content-services/src/lib/document-list/services/document-list.service.spec.ts @@ -93,6 +93,13 @@ describe('DocumentListService', () => { service.reload(); }); + it('should emit reloadSilently$ when reloadSilently is called', (done) => { + service.reloadSilently$.subscribe(() => { + done(); + }); + service.reloadSilently(); + }); + it('should return the folder info', fakeAsync(() => { spyOn(service.nodes, 'listNodeChildren').and.returnValue(Promise.resolve(fakeFolder as any)); diff --git a/lib/content-services/src/lib/document-list/services/document-list.service.ts b/lib/content-services/src/lib/document-list/services/document-list.service.ts index da54bf1785..70b7672720 100644 --- a/lib/content-services/src/lib/document-list/services/document-list.service.ts +++ b/lib/content-services/src/lib/document-list/services/document-list.service.ts @@ -41,10 +41,14 @@ export class DocumentListService implements DocumentListLoader { private readonly _reload = new Subject(); private readonly _resetSelection = new Subject(); + private readonly _reloadSilently = new Subject(); /** Gets an observable that emits when the document list should be reloaded. */ reload$ = this._reload.asObservable(); + /** Gets an observable that emits when the document list should be reloaded without resetting the current selection. */ + reloadSilently$ = this._reloadSilently.asObservable(); + /** Gets an observable that emits when the selection should be reset. */ resetSelection$ = this._resetSelection.asObservable(); @@ -53,6 +57,11 @@ export class DocumentListService implements DocumentListLoader { this._reload.next(); } + /** Reloads the document list without resetting the current selection. */ + reloadSilently() { + this._reloadSilently.next(); + } + /** Resets the selection. */ resetSelection() { this._resetSelection.next();