mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2026-09-09 18:03:21 +00:00
[ACS-11973] Fix: context menu disappears during bulk upload (#11994)
This commit is contained in:
@@ -2,7 +2,7 @@
|
|||||||
Title: Document List service
|
Title: Document List service
|
||||||
Added: v2.0.0
|
Added: v2.0.0
|
||||||
Status: Active
|
Status: Active
|
||||||
Last reviewed: 2019-01-16
|
Last reviewed: 2026-06-16
|
||||||
---
|
---
|
||||||
|
|
||||||
# Document List Service
|
# Document List Service
|
||||||
@@ -22,9 +22,10 @@ import { DocumentListService } from '@alfresco/adf-core';
|
|||||||
### Events
|
### Events
|
||||||
|
|
||||||
| Name | Description |
|
| Name | Description |
|
||||||
|-------------------|-------------------------------------------------|
|
|-------------------|----------------------------------------------------------------------------------------------|
|
||||||
| `reload$` | Emits when the document list should be reloaded |
|
| `reload$` | Emits when the document list should be reloaded. |
|
||||||
| `resetSelection$` | Emits when the selection should be reset |
|
| `resetSelection$` | Emits when the selection should be reset. |
|
||||||
|
| `reloadSilently$` | Emits when the document list should be reloaded **without** resetting the current selection. |
|
||||||
|
|
||||||
### Methods
|
### Methods
|
||||||
|
|
||||||
@@ -32,6 +33,8 @@ import { DocumentListService } from '@alfresco/adf-core';
|
|||||||
Reloads the document list.
|
Reloads the document list.
|
||||||
- **resetSelection**(): `void`<br/>
|
- **resetSelection**(): `void`<br/>
|
||||||
Resets the selection.
|
Resets the selection.
|
||||||
|
- **reloadSilently**(): `void`<br/>
|
||||||
|
Reloads the document list **without** resetting the current selection.
|
||||||
- **copyNode**(nodeId: `string`, targetParentId: `string`): `Observable<NodeEntry>`<br/>
|
- **copyNode**(nodeId: `string`, targetParentId: `string`): `Observable<NodeEntry>`<br/>
|
||||||
Copy a node to destination node
|
Copy a node to destination node
|
||||||
- _nodeId:_ `string` - The id of the node to be copied
|
- _nodeId:_ `string` - The id of the node to be copied
|
||||||
|
|||||||
@@ -175,6 +175,16 @@ describe('DocumentList', () => {
|
|||||||
expect(documentList.resetSelection).not.toHaveBeenCalled();
|
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', () => {
|
describe('presets', () => {
|
||||||
const validatePreset = (keys: string[]) => {
|
const validatePreset = (keys: string[]) => {
|
||||||
const columns = documentList.data.getColumns();
|
const columns = documentList.data.getColumns();
|
||||||
|
|||||||
@@ -561,6 +561,10 @@ export class DocumentListComponent extends DataTableSchema implements OnInit, On
|
|||||||
this.reload();
|
this.reload();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
this.documentListService.reloadSilently$.pipe(takeUntilDestroyed(this.destroyRef)).subscribe(() => {
|
||||||
|
this.reloadWithoutResettingSelection();
|
||||||
|
});
|
||||||
|
|
||||||
this.documentListService.resetSelection$.pipe(takeUntilDestroyed(this.destroyRef)).subscribe(() => {
|
this.documentListService.resetSelection$.pipe(takeUntilDestroyed(this.destroyRef)).subscribe(() => {
|
||||||
this.resetSelection();
|
this.resetSelection();
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -93,6 +93,13 @@ describe('DocumentListService', () => {
|
|||||||
service.reload();
|
service.reload();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it('should emit reloadSilently$ when reloadSilently is called', (done) => {
|
||||||
|
service.reloadSilently$.subscribe(() => {
|
||||||
|
done();
|
||||||
|
});
|
||||||
|
service.reloadSilently();
|
||||||
|
});
|
||||||
|
|
||||||
it('should return the folder info', fakeAsync(() => {
|
it('should return the folder info', fakeAsync(() => {
|
||||||
spyOn(service.nodes, 'listNodeChildren').and.returnValue(Promise.resolve(fakeFolder as any));
|
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 _reload = new Subject<void>();
|
||||||
private readonly _resetSelection = 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. */
|
/** Gets an observable that emits when the document list should be reloaded. */
|
||||||
reload$ = this._reload.asObservable();
|
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. */
|
/** Gets an observable that emits when the selection should be reset. */
|
||||||
resetSelection$ = this._resetSelection.asObservable();
|
resetSelection$ = this._resetSelection.asObservable();
|
||||||
|
|
||||||
@@ -53,6 +57,11 @@ export class DocumentListService implements DocumentListLoader {
|
|||||||
this._reload.next();
|
this._reload.next();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** Reloads the document list without resetting the current selection. */
|
||||||
|
reloadSilently() {
|
||||||
|
this._reloadSilently.next();
|
||||||
|
}
|
||||||
|
|
||||||
/** Resets the selection. */
|
/** Resets the selection. */
|
||||||
resetSelection() {
|
resetSelection() {
|
||||||
this._resetSelection.next();
|
this._resetSelection.next();
|
||||||
|
|||||||
Reference in New Issue
Block a user