mirror of
https://github.com/Alfresco/alfresco-content-app.git
synced 2025-05-12 17:04:46 +00:00
[ACS-6573] Manage permissions window can now be opened from inside file preview (#3596)
* [ACS-6573] Resolved issue where manage permissions window could not be opened when opened from inside file preview * [ACS-6573] Fixed unit test
This commit is contained in:
parent
53245d6d6f
commit
dc2c7c9109
@ -381,19 +381,19 @@ describe('NodeEffects', () => {
|
||||
|
||||
describe('managePermissions$', () => {
|
||||
it('should manage permissions from the payload', () => {
|
||||
spyOn(router, 'navigate').and.stub();
|
||||
spyOn(router, 'navigateByUrl').and.stub();
|
||||
const node: any = { entry: { isFile: true, id: 'fileId' } };
|
||||
store.dispatch(new ManagePermissionsAction(node));
|
||||
|
||||
expect(router.navigate).toHaveBeenCalledWith(['personal-files/details', 'fileId', 'permissions']);
|
||||
expect(router.navigateByUrl).toHaveBeenCalledWith('personal-files/details/fileId/permissions');
|
||||
});
|
||||
|
||||
it('should manage permissions from the active selection', () => {
|
||||
spyOn(store, 'select').and.returnValue(of({ isEmpty: false, last: { entry: { id: 'fileId' } } }));
|
||||
spyOn(router, 'navigate').and.stub();
|
||||
spyOn(router, 'navigateByUrl').and.stub();
|
||||
store.dispatch(new ManagePermissionsAction(null));
|
||||
|
||||
expect(router.navigate).toHaveBeenCalledWith(['personal-files/details', 'fileId', 'permissions']);
|
||||
expect(router.navigateByUrl).toHaveBeenCalledWith('personal-files/details/fileId/permissions');
|
||||
});
|
||||
|
||||
it('should do nothing if invoking manage permissions with no data', () => {
|
||||
|
@ -50,7 +50,8 @@ import {
|
||||
ExpandInfoDrawerAction,
|
||||
ManageRulesAction,
|
||||
ShowLoaderAction,
|
||||
ToggleInfoDrawerAction
|
||||
ToggleInfoDrawerAction,
|
||||
NavigateUrlAction
|
||||
} from '@alfresco/aca-shared/store';
|
||||
import { ContentManagementService } from '../../services/content-management.service';
|
||||
import { RenditionService } from '@alfresco/adf-content-services';
|
||||
@ -285,7 +286,7 @@ export class NodeEffects {
|
||||
map((action) => {
|
||||
if (action?.payload) {
|
||||
const route = 'personal-files/details';
|
||||
this.store.dispatch(new NavigateRouteAction([route, action.payload.entry.id, 'permissions']));
|
||||
this.store.dispatch(new NavigateUrlAction([route, action.payload.entry.id, 'permissions'].join('/')));
|
||||
} else {
|
||||
this.store
|
||||
.select(getAppSelection)
|
||||
@ -293,7 +294,7 @@ export class NodeEffects {
|
||||
.subscribe((selection) => {
|
||||
if (selection && !selection.isEmpty) {
|
||||
const route = 'personal-files/details';
|
||||
this.store.dispatch(new NavigateRouteAction([route, selection.last.entry.id, 'permissions']));
|
||||
this.store.dispatch(new NavigateUrlAction([route, selection.last.entry.id, 'permissions'].join('/')));
|
||||
}
|
||||
});
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user