mirror of
https://github.com/Alfresco/alfresco-content-app.git
synced 2025-07-24 17:31:52 +00:00
[ACS-6583] fix flickering toolbar on folder upload (#3609)
This commit is contained in:
committed by
GitHub
parent
f628892cf3
commit
c9dc3ce5ca
@@ -227,6 +227,18 @@ describe('FilesComponent', () => {
|
|||||||
expect(component.reload).toHaveBeenCalled();
|
expect(component.reload).toHaveBeenCalled();
|
||||||
}));
|
}));
|
||||||
|
|
||||||
|
it('should not call reload on fileUploadComplete event if file parent folder already displayed', fakeAsync(() => {
|
||||||
|
spyOn(component.documentList.data, 'getRows').and.returnValue([{ node: { entry: { isFolder: true, name: 'files' } } }] as any);
|
||||||
|
const file: any = { file: { options: { parentId: 'parentId', path: '/files' } } };
|
||||||
|
component.node = { id: 'parentId' } as any;
|
||||||
|
|
||||||
|
uploadService.fileUploadComplete.next(file);
|
||||||
|
|
||||||
|
tick(500);
|
||||||
|
|
||||||
|
expect(component.reload).not.toHaveBeenCalled();
|
||||||
|
}));
|
||||||
|
|
||||||
it('should not call refresh on fileUploadComplete event if parent mismatch', fakeAsync(() => {
|
it('should not call refresh on fileUploadComplete event if parent mismatch', fakeAsync(() => {
|
||||||
const file: any = { file: { options: { parentId: 'otherId' } } };
|
const file: any = { file: { options: { parentId: 'otherId' } } };
|
||||||
component.node = { id: 'parentId' } as any;
|
component.node = { id: 'parentId' } as any;
|
||||||
|
@@ -257,7 +257,7 @@ export class FilesComponent extends PageComponent implements OnInit, OnDestroy {
|
|||||||
}
|
}
|
||||||
|
|
||||||
displayFolderParent(index: number, filePath = '') {
|
displayFolderParent(index: number, filePath = '') {
|
||||||
const parentName = filePath.split('/')[index];
|
const parentName = filePath.split('/').filter((el) => el)[index];
|
||||||
const currentFoldersDisplayed = (this.documentList.data.getRows() as ShareDataRow[]) || [];
|
const currentFoldersDisplayed = (this.documentList.data.getRows() as ShareDataRow[]) || [];
|
||||||
|
|
||||||
const alreadyDisplayedParentFolder = currentFoldersDisplayed.find((row) => row.node.entry.isFolder && row.node.entry.name === parentName);
|
const alreadyDisplayedParentFolder = currentFoldersDisplayed.find((row) => row.node.entry.isFolder && row.node.entry.name === parentName);
|
||||||
|
Reference in New Issue
Block a user