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

raAvoid changing the public API of the warning component to avoid Backwards compatibility breakage #9435

Merged
merged 1 commit into from
Aug 29, 2018
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
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ function BlockInvalidWarning( { convertToHTML, convertToBlocks, convertToClassic

return (
<Warning
primaryActions={ [
actions={ [
<Button key="convert" onClick={ convertToBlocks } isLarge isPrimary={ ! hasHTMLBlock }>
{ __( 'Convert to Blocks' ) }
</Button>,
Expand Down
6 changes: 3 additions & 3 deletions packages/editor/src/components/warning/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,15 @@ import { Children } from '@wordpress/element';
import { Dropdown, IconButton, MenuGroup, MenuItem } from '@wordpress/components';
import { __ } from '@wordpress/i18n';

function Warning( { className, primaryActions, children, secondaryActions } ) {
function Warning( { className, actions, children, secondaryActions } ) {
return (
<div className={ classnames( className, 'editor-warning' ) }>
<div className="editor-warning__contents">
<p className="editor-warning__message">{ children }</p>

{ Children.count( primaryActions ) > 0 && (
{ Children.count( actions ) > 0 && (
<div className="editor-warning__actions">
{ Children.map( primaryActions, ( action, i ) => (
{ Children.map( actions, ( action, i ) => (
<span key={ i } className="editor-warning__action">
{ action }
</span>
Expand Down
2 changes: 1 addition & 1 deletion packages/editor/src/components/warning/test/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ describe( 'Warning', () => {
} );

it( 'should show child error message element', () => {
const wrapper = shallow( <Warning primaryActions={ <button /> }>Message</Warning> );
const wrapper = shallow( <Warning actions={ <button /> }>Message</Warning> );

const actions = wrapper.find( '.editor-warning__actions' );
const action = actions.childAt( 0 );
Expand Down