Skip to content

Commit

Permalink
TASK: Remove legacy actions.UI.Remote actions
Browse files Browse the repository at this point in the history
  • Loading branch information
grebaldi committed Mar 29, 2024
1 parent 85d6bbd commit 8b81c31
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 114 deletions.
12 changes: 0 additions & 12 deletions packages/neos-ui-redux-store/src/CR/Workspaces/index.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,25 +4,13 @@ import {actionTypes as system} from '../../System/index';
test(`should export actionTypes`, () => {
expect(actionTypes).not.toBe(undefined);
expect(typeof (actionTypes.UPDATE)).toBe('string');
expect(typeof (actionTypes.PUBLISH_STARTED)).toBe('string');
expect(typeof (actionTypes.PUBLISH_FINISHED)).toBe('string');
expect(typeof (actionTypes.DISCARD_STARTED)).toBe('string');
expect(typeof (actionTypes.DISCARD_ABORTED)).toBe('string');
expect(typeof (actionTypes.DISCARD_CONFIRMED)).toBe('string');
expect(typeof (actionTypes.DISCARD_FINISHED)).toBe('string');
expect(typeof (actionTypes.CHANGE_BASE_WORKSPACE)).toBe('string');
expect(typeof (actionTypes.REBASE_WORKSPACE)).toBe('string');
});

test(`should export action creators`, () => {
expect(actions).not.toBe(undefined);
expect(typeof (actions.update)).toBe('function');
expect(typeof (actions.publish)).toBe('function');
expect(typeof (actions.finishPublish)).toBe('function');
expect(typeof (actions.discard)).toBe('function');
expect(typeof (actions.abortDiscard)).toBe('function');
expect(typeof (actions.confirmDiscard)).toBe('function');
expect(typeof (actions.finishDiscard)).toBe('function');
expect(typeof (actions.changeBaseWorkspace)).toBe('function');
expect(typeof (actions.rebaseWorkspace)).toBe('function');
});
Expand Down
54 changes: 0 additions & 54 deletions packages/neos-ui-redux-store/src/UI/Remote/index.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,12 @@ test(`should export actionTypes`, () => {
expect(actionTypes).not.toBe(undefined);
expect(typeof (actionTypes.START_SAVING)).toBe('string');
expect(typeof (actionTypes.FINISH_SAVING)).toBe('string');
expect(typeof (actionTypes.START_PUBLISHING)).toBe('string');
expect(typeof (actionTypes.FINISH_PUBLISHING)).toBe('string');
expect(typeof (actionTypes.START_DISCARDING)).toBe('string');
expect(typeof (actionTypes.FINISH_DISCARDING)).toBe('string');
});

test(`should export action creators`, () => {
expect(actions).not.toBe(undefined);
expect(typeof (actions.startSaving)).toBe('function');
expect(typeof (actions.finishSaving)).toBe('function');
expect(typeof (actions.startPublishing)).toBe('function');
expect(typeof (actions.finishPublishing)).toBe('function');
expect(typeof (actions.startDiscarding)).toBe('function');
expect(typeof (actions.finishDiscarding)).toBe('function');
});

test(`should export a reducer`, () => {
Expand All @@ -41,8 +33,6 @@ test(`should initially mark the remote states as inactive.`, () => {
});

expect(nextState.isSaving).toBe(false);
expect(nextState.isPublishing).toBe(false);
expect(nextState.isDiscarding).toBe(false);
});

test(`The "startSaving" action should set the value of the "isSaving" key to "true"`, () => {
Expand All @@ -66,47 +56,3 @@ test(`The "finishSaving" action should set the value of the "isSaving" key to "f
expect(nextState1.isSaving).toBe(false);
expect(nextState2.isSaving).toBe(false);
});

test(`The "startPublishing" action should set the value of the "isPublishing" key to "true"`, () => {
const state = {
isPublishing: false
};
const nextState1 = reducer(state, actions.startPublishing());
const nextState2 = reducer(nextState1, actions.startPublishing());

expect(nextState1.isPublishing).toBe(true);
expect(nextState2.isPublishing).toBe(true);
});

test(`The "finishPublishing" action should set the value of the "isPublishing" key to "false"`, () => {
const state = {
isPublishing: true
};
const nextState1 = reducer(state, actions.finishPublishing());
const nextState2 = reducer(nextState1, actions.finishPublishing());

expect(nextState1.isPublishing).toBe(false);
expect(nextState2.isPublishing).toBe(false);
});

test(`The "startDiscarding" action should set the value of the "isDiscarding" key to "true"`, () => {
const state = {
isDiscarding: false
};
const nextState1 = reducer(state, actions.startDiscarding());
const nextState2 = reducer(nextState1, actions.startDiscarding());

expect(nextState1.isDiscarding).toBe(true);
expect(nextState2.isDiscarding).toBe(true);
});

test(`The "finishDiscarding" action should set the value of the "isDiscarding" key to "false"`, () => {
const state = {
isDiscarding: true
};
const nextState1 = reducer(state, actions.finishDiscarding());
const nextState2 = reducer(nextState1, actions.finishDiscarding());

expect(nextState1.isDiscarding).toBe(false);
expect(nextState2.isDiscarding).toBe(false);
});
48 changes: 0 additions & 48 deletions packages/neos-ui-redux-store/src/UI/Remote/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,11 @@ import {NodeContextPath} from '@neos-project/neos-ts-interfaces';

export interface State extends Readonly<{
isSaving: boolean,
isPublishing: boolean,
isDiscarding: boolean,
isSyncing: boolean
}> {}

export const defaultState: State = {
isSaving: false,
isPublishing: false,
isDiscarding: false,
isSyncing: false
};

Expand All @@ -26,10 +22,6 @@ export enum actionTypes {
FINISH_SAVING = '@neos/neos-ui/UI/Remote/FINISH_SAVING',
LOCK_PUBLISHING = '@neos/neos-ui/UI/Remote/LOCK_PUBLISHING',
UNLOCK_PUBLISHING = '@neos/neos-ui/UI/Remote/UNLOCK_PUBLISHING',
START_PUBLISHING = '@neos/neos-ui/UI/Remote/START_PUBLISHING',
FINISH_PUBLISHING = '@neos/neos-ui/UI/Remote/FINISH_PUBLISHING',
START_DISCARDING = '@neos/neos-ui/UI/Remote/START_DISCARDING',
FINISH_DISCARDING = '@neos/neos-ui/UI/Remote/FINISH_DISCARDING',
START_SYNCHRONIZATION = '@neos/neos-ui/UI/Remote/START_SYNCHRONIZATION',
FINISH_SYNCHRONIZATION = '@neos/neos-ui/UI/Remote/FINISH_SYNCHRONIZATION',
DOCUMENT_NODE_CREATED = '@neos/neos-ui/UI/Remote/DOCUMENT_NODE_CREATED'
Expand All @@ -45,26 +37,6 @@ const startSaving = () => createAction(actionTypes.START_SAVING);
*/
const finishSaving = () => createAction(actionTypes.FINISH_SAVING);

/**
* Marks an ongoing publishing process.
*/
const startPublishing = () => createAction(actionTypes.START_PUBLISHING);

/**
* Marks that an ongoing publishing process has finished.
*/
const finishPublishing = () => createAction(actionTypes.FINISH_PUBLISHING);

/**
* Marks an ongoing discarding process.
*/
const startDiscarding = () => createAction(actionTypes.START_DISCARDING);

/**
* Marks that an ongoing discarding process has finished.
*/
const finishDiscarding = () => createAction(actionTypes.FINISH_DISCARDING);

/**
* Marks an ongoing synchronization process.
*/
Expand Down Expand Up @@ -98,10 +70,6 @@ export const actions = {
finishSaving,
lockPublishing,
unlockPublishing,
startPublishing,
finishPublishing,
startDiscarding,
finishDiscarding,
startSynchronization,
finishSynchronization,
documentNodeCreated
Expand Down Expand Up @@ -130,22 +98,6 @@ export const reducer = (state: State = defaultState, action: InitAction | Action
draft.isSaving = false;
break;
}
case actionTypes.START_PUBLISHING: {
draft.isPublishing = true;
break;
}
case actionTypes.FINISH_PUBLISHING: {
draft.isPublishing = false;
break;
}
case actionTypes.START_DISCARDING: {
draft.isDiscarding = true;
break;
}
case actionTypes.FINISH_DISCARDING: {
draft.isDiscarding = false;
break;
}
case actionTypes.START_SYNCHRONIZATION: {
draft.isSyncing = true;
break;
Expand Down

0 comments on commit 8b81c31

Please sign in to comment.