Skip to content
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

made openGeneralSidebar to private #80

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
8 changes: 0 additions & 8 deletions docs/reference-guides/data/data-core-editor.md
Original file line number Diff line number Diff line change
Expand Up @@ -1344,14 +1344,6 @@ _Related_

- multiSelect in core/block-editor store.

### openGeneralSidebar

Action that opens an editor sidebar.

_Parameters_

- _name_ `?string`: Sidebar name to be opened.

### openPublishSidebar

Returns an action object used in signalling that the user opened the publish sidebar.
Expand Down
5 changes: 3 additions & 2 deletions packages/editor/src/components/collab-sidebar/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import { addFilter } from '@wordpress/hooks';
import { store as noticesStore } from '@wordpress/notices';
import { store as coreStore } from '@wordpress/core-data';
import { store as blockEditorStore } from '@wordpress/block-editor';
import { store as interfaceStore } from '@wordpress/interface';

/**
* Internal dependencies
Expand Down Expand Up @@ -52,7 +53,7 @@ export default function CollabSidebar() {
const { getEntityRecords, getEntityRecord } = resolveSelect( coreStore );

// eslint-disable-next-line @wordpress/data-no-store-string-literals
const { openGeneralSidebar } = useDispatch( editorStore );
const { enableComplementaryArea } = useDispatch( interfaceStore );
const [ blockCommentID, setBlockCommentID ] = useState( null );
const [ showCommentBoard, setShowCommentBoard ] = useState( false );

Expand Down Expand Up @@ -82,7 +83,7 @@ export default function CollabSidebar() {

const openCollabBoard = () => {
setShowCommentBoard( true );
openGeneralSidebar( 'edit-post/collab-sidebar' );
enableComplementaryArea( 'core', 'edit-post/collab-sidebar' );
};

// Function to save the comment.
Expand Down
16 changes: 0 additions & 16 deletions packages/editor/src/store/actions.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,7 @@ import {
getNotificationArgumentsForSaveFail,
getNotificationArgumentsForTrashFail,
} from './utils/notice-builder';
import { privateApis as editorPrivateApis } from '../private-apis';
import { unlock } from '../lock-unlock';

const { interfaceStore } = unlock( editorPrivateApis );
/**
* Returns an action generator used in signalling that editor has initialized with
* the specified post object and editor settings.
Expand Down Expand Up @@ -195,19 +192,6 @@ export const editPost =
.editEntityRecord( 'postType', type, id, edits, options );
};

/**
* Action that opens an editor sidebar.
*
* @param {?string} name Sidebar name to be opened.
*/
export const openGeneralSidebar =
( name ) =>
( { registry } ) => {
registry
.dispatch( interfaceStore )
.enableComplementaryArea( 'core', name );
};

/**
* Action for saving the current post in the editor.
*
Expand Down
Loading