Skip to content

Commit bc5ae1d

Browse files
TASK: Prevent editing with conflicting workspace
When the workspace has conflicts that cannot be resolved, it does not make sense to be able to edit the content. Therefore, we mark the workspace as read only in this case.
1 parent 9862564 commit bc5ae1d

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

packages/neos-ui-redux-store/src/CR/Workspaces/selectors.ts

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,20 @@
11
import {createSelector} from 'reselect';
22
import {documentNodeContextPathSelector} from '../Nodes/selectors';
33
import {GlobalState} from '../../System';
4-
import {NodeContextPath} from '@neos-project/neos-ts-interfaces';
4+
import {NodeContextPath, WorkspaceStatus} from '@neos-project/neos-ts-interfaces';
55

66
export const personalWorkspaceNameSelector = (state: GlobalState) => state?.cr?.workspaces?.personalWorkspace?.name;
77

88
export const personalWorkspaceRebaseStatusSelector = (state: GlobalState) => state?.cr?.workspaces?.personalWorkspace?.status;
99

1010
export const baseWorkspaceSelector = (state: GlobalState) => state?.cr?.workspaces?.personalWorkspace?.baseWorkspace;
1111

12-
export const isWorkspaceReadOnlySelector = (state: GlobalState) => state?.cr?.workspaces?.personalWorkspace?.readOnly || false;
12+
export const isWorkspaceReadOnlySelector = (state: GlobalState) => {
13+
if (state?.cr?.workspaces?.personalWorkspace?.status === WorkspaceStatus.OUTDATED_CONFLICT) {
14+
return true;
15+
}
16+
return state?.cr?.workspaces?.personalWorkspace?.readOnly || false
17+
};
1318

1419
export const publishableNodesSelector = (state: GlobalState) => state?.cr?.workspaces?.personalWorkspace?.publishableNodes;
1520

0 commit comments

Comments
 (0)