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$', () => {
|
describe('managePermissions$', () => {
|
||||||
it('should manage permissions from the payload', () => {
|
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' } };
|
const node: any = { entry: { isFile: true, id: 'fileId' } };
|
||||||
store.dispatch(new ManagePermissionsAction(node));
|
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', () => {
|
it('should manage permissions from the active selection', () => {
|
||||||
spyOn(store, 'select').and.returnValue(of({ isEmpty: false, last: { entry: { id: 'fileId' } } }));
|
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));
|
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', () => {
|
it('should do nothing if invoking manage permissions with no data', () => {
|
||||||
|
@ -50,7 +50,8 @@ import {
|
|||||||
ExpandInfoDrawerAction,
|
ExpandInfoDrawerAction,
|
||||||
ManageRulesAction,
|
ManageRulesAction,
|
||||||
ShowLoaderAction,
|
ShowLoaderAction,
|
||||||
ToggleInfoDrawerAction
|
ToggleInfoDrawerAction,
|
||||||
|
NavigateUrlAction
|
||||||
} from '@alfresco/aca-shared/store';
|
} from '@alfresco/aca-shared/store';
|
||||||
import { ContentManagementService } from '../../services/content-management.service';
|
import { ContentManagementService } from '../../services/content-management.service';
|
||||||
import { RenditionService } from '@alfresco/adf-content-services';
|
import { RenditionService } from '@alfresco/adf-content-services';
|
||||||
@ -285,7 +286,7 @@ export class NodeEffects {
|
|||||||
map((action) => {
|
map((action) => {
|
||||||
if (action?.payload) {
|
if (action?.payload) {
|
||||||
const route = 'personal-files/details';
|
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 {
|
} else {
|
||||||
this.store
|
this.store
|
||||||
.select(getAppSelection)
|
.select(getAppSelection)
|
||||||
@ -293,7 +294,7 @@ export class NodeEffects {
|
|||||||
.subscribe((selection) => {
|
.subscribe((selection) => {
|
||||||
if (selection && !selection.isEmpty) {
|
if (selection && !selection.isEmpty) {
|
||||||
const route = 'personal-files/details';
|
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