diff --git a/Configuration/Settings.yaml b/Configuration/Settings.yaml index 414f5f4e77..a5aa25d1cf 100644 --- a/Configuration/Settings.yaml +++ b/Configuration/Settings.yaml @@ -176,7 +176,6 @@ Neos: preferences: interfaceLanguage: '${q(user).property(''preferences.interfaceLanguage'') || Configuration.setting(''Neos.Neos.userInterface.defaultLanguage'')}' settings: - isAutoPublishingEnabled: false targetWorkspace: 'live' changes: types: diff --git a/packages/neos-ui-redux-store/src/User/Settings/index.spec.js b/packages/neos-ui-redux-store/src/User/Settings/index.spec.js deleted file mode 100644 index a942bbc090..0000000000 --- a/packages/neos-ui-redux-store/src/User/Settings/index.spec.js +++ /dev/null @@ -1,53 +0,0 @@ -import {actionTypes, actions, reducer, defaultState} from './index'; -import {actionTypes as system} from '../../System/index'; - -test(`should export actionTypes`, () => { - expect(actionTypes).not.toBe(undefined); - expect(typeof (actionTypes.TOGGLE_AUTO_PUBLISHING)).toBe('string'); -}); - -test(`should export action creators`, () => { - expect(actions).not.toBe(undefined); - expect(typeof (actions.toggleAutoPublishing)).toBe('function'); -}); - -test(`should export a reducer`, () => { - expect(reducer).not.toBe(undefined); - expect(typeof (reducer)).toBe('function'); -}); - -test(`The reducer should return the default state when called with undefined.`, () => { - const nextState = reducer(undefined, { - type: 'unknown' - }); - - expect(nextState).toBe(defaultState); -}); - -test(`The reducer should correctly rehydrate data on INIT.`, () => { - const initValues = { - isAutoPublishingEnabled: true - }; - const nextState = reducer(undefined, { - type: system.INIT, - payload: { - user: { - settings: initValues - } - } - }); - expect(nextState).toEqual(initValues); -}); - -test(` - The "toggle" action should be able to reverse the value of the - "isAutoPublishingEnabled" key.`, () => { - const state = { - isAutoPublishingEnabled: false - }; - const nextState1 = reducer(state, actions.toggleAutoPublishing()); - const nextState2 = reducer(nextState1, actions.toggleAutoPublishing()); - - expect(nextState1.isAutoPublishingEnabled).toBe(true); - expect(nextState2.isAutoPublishingEnabled).toBe(false); -}); diff --git a/packages/neos-ui-redux-store/src/User/Settings/index.ts b/packages/neos-ui-redux-store/src/User/Settings/index.ts deleted file mode 100644 index 29cb79f778..0000000000 --- a/packages/neos-ui-redux-store/src/User/Settings/index.ts +++ /dev/null @@ -1,56 +0,0 @@ -import produce from 'immer'; -import {action as createAction, ActionType} from 'typesafe-actions'; - -import {actionTypes as system, InitAction} from '../../System'; - -// -// Export the subreducer state shape interface -// -export interface State extends Readonly<{ - isAutoPublishingEnabled: boolean; -}> {} - -export const defaultState: State = { - isAutoPublishingEnabled: false -}; - -// -// Export the action types -// -export enum actionTypes { - TOGGLE_AUTO_PUBLISHING = '@neos/neos-ui/User/Settings/TOGGLE_AUTO_PUBLISHING' -} - -// -// Export the actions -// -export const actions = { - /** - * Toggles the auto publishing mode for the current logged in user. - */ - toggleAutoPublishing: () => createAction(actionTypes.TOGGLE_AUTO_PUBLISHING) -}; - -// -// Export the union type of all actions -// -export type Action = ActionType; - -// -// Export the reducer -// -export const reducer = (state: State = defaultState, action: Action | InitAction) => produce(state, draft => { - switch (action.type) { - case system.INIT: - draft.isAutoPublishingEnabled = action.payload.user.settings.isAutoPublishingEnabled; - break; - case actionTypes.TOGGLE_AUTO_PUBLISHING: - draft.isAutoPublishingEnabled = !state.isAutoPublishingEnabled; - break; - } -}); - -// -// Export the selectors -// -export const selectors = {}; diff --git a/packages/neos-ui-redux-store/src/User/index.ts b/packages/neos-ui-redux-store/src/User/index.ts index 46b794a61f..fbe1d17a3c 100644 --- a/packages/neos-ui-redux-store/src/User/index.ts +++ b/packages/neos-ui-redux-store/src/User/index.ts @@ -1,17 +1,15 @@ import {combineReducers} from '../combineReducers'; -import * as Settings from './Settings'; import * as Preferences from './Preferences'; import * as Name from './Name'; import * as Impersonate from './Impersonate'; -const all = {Settings, Preferences, Name, Impersonate}; +const all = {Preferences, Name, Impersonate}; // // Export the subreducer state shape interface // export interface State { - settings: Settings.State; preferences: Preferences.State; name: Name.State; impersonate: Impersonate.State; @@ -35,7 +33,6 @@ export const actions = typedKeys(all).reduce((acc, cur) => ({...acc, [cur]: all[ // Export the reducer // export const reducer = combineReducers({ - settings: Settings.reducer, preferences: Preferences.reducer, name: Name.reducer, impersonate: Impersonate.reducer diff --git a/packages/neos-ui-sagas/src/Changes/index.js b/packages/neos-ui-sagas/src/Changes/index.js index 5bff7889d8..f0df377dfa 100644 --- a/packages/neos-ui-sagas/src/Changes/index.js +++ b/packages/neos-ui-sagas/src/Changes/index.js @@ -1,11 +1,9 @@ import {takeEvery, put, call, select} from 'redux-saga/effects'; import {$get} from 'plow-js'; -import {actionTypes, actions, selectors} from '@neos-project/neos-ui-redux-store'; +import {actionTypes, actions} from '@neos-project/neos-ui-redux-store'; import backend from '@neos-project/neos-ui-backend-connector'; -const {publishableNodesInDocumentSelector, baseWorkspaceSelector} = selectors.CR.Workspaces; - function * persistChanges(changes) { const {change} = backend.get().endpoints; @@ -14,15 +12,6 @@ function * persistChanges(changes) { try { const feedback = yield call(change, changes); yield put(actions.ServerFeedback.handleServerFeedback(feedback)); - - const state = yield select(); - const isAutoPublishingEnabled = $get('user.settings.isAutoPublishingEnabled', state); - - if (isAutoPublishingEnabled) { - const baseWorkspace = baseWorkspaceSelector(state); - const publishableNodesInDocument = publishableNodesInDocumentSelector(state); - yield put(actions.CR.Workspaces.publish(publishableNodesInDocument.map($get('contextPath')), baseWorkspace)); - } } catch (error) { console.error('Failed to persist changes', error); } finally { diff --git a/packages/neos-ui-sagas/src/Publish/index.js b/packages/neos-ui-sagas/src/Publish/index.js index 6822c2d301..e8a650d86e 100644 --- a/packages/neos-ui-sagas/src/Publish/index.js +++ b/packages/neos-ui-sagas/src/Publish/index.js @@ -5,8 +5,6 @@ import {actionTypes, actions, selectors} from '@neos-project/neos-ui-redux-store import backend from '@neos-project/neos-ui-backend-connector'; import {getGuestFrameDocument} from '@neos-project/neos-ui-guest-frame/src/dom'; -const {publishableNodesInDocumentSelector} = selectors.CR.Workspaces; - export function * watchPublish() { const {publish} = backend.get().endpoints; @@ -27,18 +25,6 @@ export function * watchPublish() { }); } -export function * watchToggleAutoPublish() { - yield takeEvery(actionTypes.User.Settings.TOGGLE_AUTO_PUBLISHING, function * publishInitially() { - const state = yield select(); - const isAutoPublishingEnabled = $get('user.settings.isAutoPublishingEnabled', state); - - if (isAutoPublishingEnabled) { - const publishableNodesInDocument = publishableNodesInDocumentSelector(state); - yield put(actions.CR.Workspaces.publish(publishableNodesInDocument.map($get('contextPath')), 'live')); - } - }); -} - export function * watchChangeBaseWorkspace() { const {changeBaseWorkspace} = backend.get().endpoints; yield takeEvery(actionTypes.CR.Workspaces.CHANGE_BASE_WORKSPACE, function * change(action) { diff --git a/packages/neos-ui-sagas/src/manifest.js b/packages/neos-ui-sagas/src/manifest.js index 6c88de7dfc..55cdfa564c 100644 --- a/packages/neos-ui-sagas/src/manifest.js +++ b/packages/neos-ui-sagas/src/manifest.js @@ -51,7 +51,6 @@ manifest('main.sagas', {}, globalRegistry => { sagasRegistry.set('neos-ui/Publish/watchChangeBaseWorkspace', {saga: publish.watchChangeBaseWorkspace}); sagasRegistry.set('neos-ui/Publish/discardIfConfirmed', {saga: publish.discardIfConfirmed}); sagasRegistry.set('neos-ui/Publish/watchPublish', {saga: publish.watchPublish}); - sagasRegistry.set('neos-ui/Publish/watchToggleAutoPublish', {saga: publish.watchToggleAutoPublish}); sagasRegistry.set('neos-ui/ServerFeedback/watchServerFeedback', {saga: serverFeedback.watchServerFeedback}); diff --git a/packages/neos-ui/src/Containers/PrimaryToolbar/PublishDropDown/index.js b/packages/neos-ui/src/Containers/PrimaryToolbar/PublishDropDown/index.js index aa39151dcc..c37151c371 100644 --- a/packages/neos-ui/src/Containers/PrimaryToolbar/PublishDropDown/index.js +++ b/packages/neos-ui/src/Containers/PrimaryToolbar/PublishDropDown/index.js @@ -7,8 +7,6 @@ import {$transform, $get} from 'plow-js'; import Badge from '@neos-project/react-ui-components/src/Badge/'; import Icon from '@neos-project/react-ui-components/src/Icon/'; -import CheckBox from '@neos-project/react-ui-components/src/CheckBox/'; -import Label from '@neos-project/react-ui-components/src/Label/'; import DropDown from '@neos-project/react-ui-components/src/DropDown/'; import I18n from '@neos-project/neos-ui-i18n'; @@ -29,10 +27,8 @@ import style from './style.module.css'; publishableNodesInDocument: publishableNodesInDocumentSelector, personalWorkspaceName: personalWorkspaceNameSelector, baseWorkspace: baseWorkspaceSelector, - isWorkspaceReadOnly: isWorkspaceReadOnlySelector, - isAutoPublishingEnabled: $get('user.settings.isAutoPublishingEnabled') + isWorkspaceReadOnly: isWorkspaceReadOnlySelector }), { - toggleAutoPublishing: actions.User.Settings.toggleAutoPublishing, changeBaseWorkspaceAction: actions.CR.Workspaces.changeBaseWorkspace, publishAction: actions.CR.Workspaces.publish, discardAction: actions.CR.Workspaces.commenceDiscard @@ -52,8 +48,6 @@ export default class PublishDropDown extends PureComponent { personalWorkspaceName: PropTypes.string.isRequired, baseWorkspace: PropTypes.string.isRequired, neos: PropTypes.object.isRequired, - isAutoPublishingEnabled: PropTypes.bool, - toggleAutoPublishing: PropTypes.func.isRequired, publishAction: PropTypes.func.isRequired, discardAction: PropTypes.func.isRequired, changeBaseWorkspaceAction: PropTypes.func.isRequired, @@ -92,9 +86,7 @@ export default class PublishDropDown extends PureComponent { isSaving, isPublishing, isDiscarding, - isAutoPublishingEnabled, isWorkspaceReadOnly, - toggleAutoPublishing, baseWorkspace, changeBaseWorkspaceAction, i18nRegistry, @@ -107,10 +99,6 @@ export default class PublishDropDown extends PureComponent { const canPublishLocally = !isSaving && !isPublishing && !isDiscarding && publishableNodesInDocument && (publishableNodesInDocument.length > 0); const canPublishGlobally = !isSaving && !isPublishing && !isDiscarding && publishableNodes && (publishableNodes.length > 0); const changingWorkspaceAllowed = !canPublishGlobally; - const autoPublishWrapperClassNames = mergeClassNames({ - [style.dropDown__item]: true, - [style['dropDown__item--noHover']]: true - }); const mainButton = this.getTranslatedMainButton(baseWorkspaceTitle); const dropDownBtnClassName = mergeClassNames({ [style.dropDown__btn]: true, @@ -213,27 +201,6 @@ export default class PublishDropDown extends PureComponent { )} -
  • - { - /** - PLEASE NOTE: this additional styleClass is a fix, because react checkboxes inside a react select component are buggy, - for further information see https://github.com/neos/neos-ui/pull/3211 - */ - } - -
  • @@ -253,8 +220,7 @@ export default class PublishDropDown extends PureComponent { publishableNodesInDocument, isSaving, isPublishing, - isDiscarding, - isAutoPublishingEnabled + isDiscarding } = this.props; const canPublishLocally = publishableNodesInDocument && (publishableNodesInDocument.length > 0); @@ -270,13 +236,6 @@ export default class PublishDropDown extends PureComponent { return 'Discarding...'; } - if (isAutoPublishingEnabled) { - if (baseWorkspaceTitle) { - return ; - } - return ; - } - if (canPublishLocally) { return ; }