Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ACS-6583] Fix flickering toolbar on folder upload #3609

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,18 @@ describe('FilesComponent', () => {
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(() => {
const file: any = { file: { options: { parentId: 'otherId' } } };
component.node = { id: 'parentId' } as any;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ export class FilesComponent extends PageComponent implements OnInit, OnDestroy {
}

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 alreadyDisplayedParentFolder = currentFoldersDisplayed.find((row) => row.node.entry.isFolder && row.node.entry.name === parentName);
Expand Down
Loading