mirror of
https://github.com/Alfresco/alfresco-content-app.git
synced 2025-05-12 17:04:46 +00:00
[ACA-3855] fix go home id you are in uuuid root (#1607)
* fix go home id you are in uuuid root * fix lint
This commit is contained in:
parent
8096741398
commit
c015c8a6a6
@ -265,6 +265,19 @@ describe('FilesComponent', () => {
|
||||
|
||||
expect(router.navigate).toHaveBeenCalledWith(['personal-files']);
|
||||
});
|
||||
|
||||
it('should navigate home if node is root also if it contain a uuid', () => {
|
||||
component.node = {
|
||||
path: {
|
||||
elements: [{ id: 'node-id' }]
|
||||
}
|
||||
} as any;
|
||||
|
||||
router.url = '/personal-files/895de2b3-1b69-4cc7-bff2-a0d7c86b7bc7';
|
||||
component.navigate(node.id);
|
||||
|
||||
expect(router.navigate).toHaveBeenCalledWith(['personal-files']);
|
||||
});
|
||||
});
|
||||
|
||||
describe('isSiteContainer', () => {
|
||||
|
@ -132,7 +132,12 @@ export class FilesComponent extends PageComponent implements OnInit, OnDestroy {
|
||||
let urlToNavigate;
|
||||
|
||||
if (this.router.url.match(uuidRegEx)) {
|
||||
if (nodeId && !this.isRootNode(nodeId)) {
|
||||
urlToNavigate = this.router.url.replace(uuidRegEx, nodeId).split('/');
|
||||
} else {
|
||||
urlToNavigate = this.router.url.replace(uuidRegEx, '').split('/');
|
||||
urlToNavigate.pop();
|
||||
}
|
||||
urlToNavigate.shift();
|
||||
} else {
|
||||
urlToNavigate = this.router.url.split('/');
|
||||
|
Loading…
x
Reference in New Issue
Block a user