Skip to content

Commit

Permalink
TASK: Remove auto publishing feature
Browse files Browse the repository at this point in the history
  • Loading branch information
ahaeslich committed Nov 1, 2023
1 parent f332d9f commit 5306eea
Show file tree
Hide file tree
Showing 8 changed files with 4 additions and 184 deletions.
1 change: 0 additions & 1 deletion Configuration/Settings.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
53 changes: 0 additions & 53 deletions packages/neos-ui-redux-store/src/User/Settings/index.spec.js

This file was deleted.

56 changes: 0 additions & 56 deletions packages/neos-ui-redux-store/src/User/Settings/index.ts

This file was deleted.

5 changes: 1 addition & 4 deletions packages/neos-ui-redux-store/src/User/index.ts
Original file line number Diff line number Diff line change
@@ -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;
Expand All @@ -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
Expand Down
13 changes: 1 addition & 12 deletions packages/neos-ui-sagas/src/Changes/index.js
Original file line number Diff line number Diff line change
@@ -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;

Expand All @@ -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 {
Expand Down
14 changes: 0 additions & 14 deletions packages/neos-ui-sagas/src/Publish/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand All @@ -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) {
Expand Down
1 change: 0 additions & 1 deletion packages/neos-ui-sagas/src/manifest.js
Original file line number Diff line number Diff line change
Expand Up @@ -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});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand All @@ -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
Expand All @@ -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,
Expand Down Expand Up @@ -92,9 +86,7 @@ export default class PublishDropDown extends PureComponent {
isSaving,
isPublishing,
isDiscarding,
isAutoPublishingEnabled,
isWorkspaceReadOnly,
toggleAutoPublishing,
baseWorkspace,
changeBaseWorkspaceAction,
i18nRegistry,
Expand All @@ -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,
Expand Down Expand Up @@ -213,27 +201,6 @@ export default class PublishDropDown extends PureComponent {
<I18n id="Neos.Neos:Main:reviewChanges" fallback="Review changes"/>
</a>
</li>)}
<li className={autoPublishWrapperClassNames}>
{
/**
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
*/
}
<Label htmlFor="neos-PublishDropDown-AutoPublish" className={style.dropdownOptionCheckbox}>
<
// @ts-ignore
CheckBox
id="neos-PublishDropDown-AutoPublish"
onChange={toggleAutoPublishing}
isChecked={isAutoPublishingEnabled}
className={style.dropdownOptionCheckbox__input}
/>
<span className={style.dropdownOptionCheckbox__label}>
<I18n id="Neos.Neos:Main:autoPublish" fallback="Auto-Publish"/>
</span>
</Label>
</li>
<li className={style.dropDown__item}>
<a id="neos-PublishDropDown-Workspaces" href={workspaceModuleUri}>
<div className={style.dropDown__iconWrapper}>
Expand All @@ -253,8 +220,7 @@ export default class PublishDropDown extends PureComponent {
publishableNodesInDocument,
isSaving,
isPublishing,
isDiscarding,
isAutoPublishingEnabled
isDiscarding
} = this.props;
const canPublishLocally = publishableNodesInDocument && (publishableNodesInDocument.length > 0);

Expand All @@ -270,13 +236,6 @@ export default class PublishDropDown extends PureComponent {
return 'Discarding...';
}

if (isAutoPublishingEnabled) {
if (baseWorkspaceTitle) {
return <I18n id="Neos.Neos:Main:autoPublishTo" fallback={'Auto publish to ' + baseWorkspaceTitle} params={{0: baseWorkspaceTitle}}/>;
}
return <I18n id="Neos.Neos:Main:autoPublish" fallback="Auto publish"/>;
}

if (canPublishLocally) {
return <I18n id="Neos.Neos:Main:publishTo" fallback="Publish to" params={{0: baseWorkspaceTitle}}/>;
}
Expand Down

0 comments on commit 5306eea

Please sign in to comment.