Skip to content

Commit

Permalink
TASK: Prevent editing with conflicting workspace
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
markusguenther committed Dec 21, 2023
1 parent 992fabe commit 5c590c3
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions packages/neos-ui-redux-store/src/CR/Workspaces/selectors.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,20 @@
import {createSelector} from 'reselect';
import {documentNodeContextPathSelector} from '../Nodes/selectors';
import {GlobalState} from '../../System';
import {NodeContextPath} from '@neos-project/neos-ts-interfaces';
import {NodeContextPath, WorkspaceStatus} from '@neos-project/neos-ts-interfaces';

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

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

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

export const isWorkspaceReadOnlySelector = (state: GlobalState) => state?.cr?.workspaces?.personalWorkspace?.readOnly || false;
export const isWorkspaceReadOnlySelector = (state: GlobalState) => {
if (state?.cr?.workspaces?.personalWorkspace?.status === WorkspaceStatus.OUTDATED_CONFLICT) {
return true;
}
return state?.cr?.workspaces?.personalWorkspace?.readOnly || false
};

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

Expand Down

0 comments on commit 5c590c3

Please sign in to comment.