[ACS-11973] Fix: context menu disappears during bulk upload (#11994)

This commit is contained in:
Mykyta Maliarchuk
2026-06-19 10:26:17 +02:00
committed by GitHub
parent 76fd461741
commit 0beaa18452
5 changed files with 38 additions and 5 deletions
@@ -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();
@@ -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();
});
@@ -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));
@@ -41,10 +41,14 @@ export class DocumentListService implements DocumentListLoader {
private readonly _reload = new Subject<void>();
private readonly _resetSelection = new Subject<void>();
private readonly _reloadSilently = new Subject<void>();
/** 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();