mirror of
https://github.com/Alfresco/alfresco-content-app.git
synced 2026-09-09 18:02:54 +00:00
navigate inside original folder when clicking on a folder-link (#2156)
This commit is contained in:
@@ -323,6 +323,24 @@ describe('FilesComponent', () => {
|
||||
component.navigate(node.id);
|
||||
expect(router.navigate).toHaveBeenCalledWith(['libraries', node.id]);
|
||||
});
|
||||
|
||||
it('should navigate to destination folder if node is `app:folderlink`', () => {
|
||||
node = {
|
||||
entry: {
|
||||
id: 'folder-link-id',
|
||||
isFolder: true,
|
||||
nodeType: 'app:folderlink',
|
||||
properties: {
|
||||
'cm:destination': 'original-folder-id'
|
||||
}
|
||||
}
|
||||
} as any;
|
||||
|
||||
router.url = '/personal-files';
|
||||
spyOn(route.snapshot.paramMap, 'get').and.returnValue('personal-files');
|
||||
component.navigateTo(node);
|
||||
expect(router.navigate).toHaveBeenCalledWith([node.entry.properties['cm:destination']]);
|
||||
});
|
||||
});
|
||||
|
||||
describe('isSiteContainer', () => {
|
||||
|
||||
@@ -173,9 +173,17 @@ export class FilesComponent extends PageComponent implements OnInit, OnDestroy {
|
||||
navigateTo(node: MinimalNodeEntity) {
|
||||
if (node && node.entry) {
|
||||
this.selectedNode = node;
|
||||
const { id, isFolder } = node.entry;
|
||||
const { isFolder } = node.entry;
|
||||
|
||||
if (isFolder) {
|
||||
let id: string;
|
||||
|
||||
if (node.entry.nodeType === 'app:folderlink') {
|
||||
id = node.entry.properties['cm:destination'];
|
||||
} else {
|
||||
id = node.entry.id;
|
||||
}
|
||||
|
||||
this.documentList.resetNewFolderPagination();
|
||||
this.navigate(id);
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user