Skip to content

Remove unused action #559

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Dec 15, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions docs/_frontend/actions.md
Original file line number Diff line number Diff line change
Expand Up @@ -142,10 +142,6 @@ Updates the content body when the markdown editor changes.

Updates the content path when the input changes.

### `updateDraft(isDraft)`

Updates the content visibility when the checkbox changes.

## Static Files

### `fetchStaticFiles`
Expand Down
3 changes: 0 additions & 3 deletions docs/_frontend/containers.md
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,6 @@ Container for creating a new page.
updateTitle: Function,
updateBody: Function,
updatePath: Function,
updateDraft: Function,
clearErrors: Function,
errors: Array,
fieldChanged: Boolean
Expand Down Expand Up @@ -221,7 +220,6 @@ Container for creating a new document.
updateTitle: Function,
updateBody: Function,
updatePath: Function,
updateDraft: Function,
clearErrors: Function,
errors: Array,
fieldChanged: Boolean
Expand Down Expand Up @@ -255,7 +253,6 @@ Container for creating a new draft.
updateTitle: Function,
updateBody: Function,
updatePath: Function,
updateDraft: Function,
clearErrors: Function,
errors: Array,
fieldChanged: Boolean,
Expand Down
9 changes: 1 addition & 8 deletions src/containers/views/DraftNew.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,7 @@ import { getLeaveMessage } from '../../translations';
import { injectDefaultFields } from '../../utils/metadata';
import { preventDefault, getDocumentTitle } from '../../utils/helpers';
import { ADMIN_PREFIX } from '../../constants';
import {
updateTitle,
updateBody,
updatePath,
updateDraft,
} from '../../ducks/metadata';
import { updateTitle, updateBody, updatePath } from '../../ducks/metadata';

export class DraftNew extends Component {
componentDidMount() {
Expand Down Expand Up @@ -122,7 +117,6 @@ DraftNew.propTypes = {
updateTitle: PropTypes.func.isRequired,
updateBody: PropTypes.func.isRequired,
updatePath: PropTypes.func.isRequired,
updateDraft: PropTypes.func.isRequired,
clearErrors: PropTypes.func.isRequired,
errors: PropTypes.array.isRequired,
fieldChanged: PropTypes.bool.isRequired,
Expand All @@ -148,7 +142,6 @@ const mapDispatchToProps = dispatch =>
updateTitle,
updateBody,
updatePath,
updateDraft,
putDraft,
clearErrors,
},
Expand Down
9 changes: 1 addition & 8 deletions src/containers/views/PageNew.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,7 @@ import InputTitle from '../../components/form/InputTitle';
import MarkdownEditor from '../../components/MarkdownEditor';
import StaticMetaData from '../../components/metadata/StaticMetaFields';
import Metadata from '../../containers/MetaFields';
import {
updateTitle,
updateBody,
updatePath,
updateDraft,
} from '../../ducks/metadata';
import { updateTitle, updateBody, updatePath } from '../../ducks/metadata';
import { createPage } from '../../ducks/pages';
import { clearErrors } from '../../ducks/utils';
import { getLeaveMessage } from '../../translations';
Expand Down Expand Up @@ -122,7 +117,6 @@ PageNew.propTypes = {
updateTitle: PropTypes.func.isRequired,
updateBody: PropTypes.func.isRequired,
updatePath: PropTypes.func.isRequired,
updateDraft: PropTypes.func.isRequired,
clearErrors: PropTypes.func.isRequired,
errors: PropTypes.array.isRequired,
fieldChanged: PropTypes.bool.isRequired,
Expand All @@ -148,7 +142,6 @@ const mapDispatchToProps = dispatch =>
updateTitle,
updateBody,
updatePath,
updateDraft,
createPage,
clearErrors,
},
Expand Down
1 change: 0 additions & 1 deletion src/containers/views/tests/pageedit.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ const setup = (props = defaultProps) => {
updateTitle: jest.fn(),
updateBody: jest.fn(),
updatePath: jest.fn(),
updateDraft: jest.fn(),
clearErrors: jest.fn(),
};

Expand Down
1 change: 0 additions & 1 deletion src/containers/views/tests/pagenew.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ function setup(props = defaultProps) {
updateTitle: jest.fn(),
updateBody: jest.fn(),
updatePath: jest.fn(),
updateDraft: jest.fn(),
clearErrors: jest.fn(),
};

Expand Down
8 changes: 0 additions & 8 deletions src/ducks/action_tests/metadata.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -95,14 +95,6 @@ describe('Actions::Metadata', () => {
expect(metadataDuck.updateBody('Test Body')).toEqual(expectedAction);
});

it('creates UPDATE_DRAFT', () => {
const expectedAction = {
type: metadataDuck.UPDATE_DRAFT,
draft: false,
};
expect(metadataDuck.updateDraft(false)).toEqual(expectedAction);
});

it('creates UPDATE_PATH', () => {
const expectedAction = {
type: metadataDuck.UPDATE_PATH,
Expand Down
15 changes: 0 additions & 15 deletions src/ducks/metadata.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import {
export const UPDATE_TITLE = 'UPDATE_TITLE';
export const UPDATE_BODY = 'UPDATE_BODY';
export const UPDATE_PATH = 'UPDATE_PATH';
export const UPDATE_DRAFT = 'UPDATE_DRAFT';
export const STORE_CONTENT_FIELDS = 'STORE_CONTENT_FIELDS';
export const ADD_METAFIELD = 'ADD_METAFIELD';
export const REMOVE_METAFIELD = 'REMOVE_METAFIELD';
Expand Down Expand Up @@ -73,11 +72,6 @@ export const updateBody = body => ({
body,
});

export const updateDraft = draft => ({
type: UPDATE_DRAFT,
draft,
});

export const updatePath = path => ({
type: UPDATE_PATH,
path,
Expand Down Expand Up @@ -121,15 +115,6 @@ export default function metadata( // TODO normalize the metadata
},
fieldChanged: true,
};
case UPDATE_DRAFT:
return {
...state,
draft: {
...state.metadata,
draft: action.draft,
},
fieldChanged: true,
};
case STORE_CONTENT_FIELDS:
return {
...state,
Expand Down