Skip to content

Commit

Permalink
Treat unregistered block case as a warning
Browse files Browse the repository at this point in the history
  • Loading branch information
brandonpayton committed Oct 9, 2018
1 parent 54cc6ab commit 5be3d3b
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 23 deletions.
1 change: 0 additions & 1 deletion packages/block-library/src/editor.scss
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
@import "./latest-comments/editor.scss";
@import "./latest-posts/editor.scss";
@import "./list/editor.scss";
@import "./missing/editor.scss";
@import "./more/editor.scss";
@import "./nextpage/editor.scss";
@import "./preformatted/editor.scss";
Expand Down
21 changes: 0 additions & 21 deletions packages/block-library/src/missing/editor.scss

This file was deleted.

5 changes: 4 additions & 1 deletion packages/editor/src/components/block-list/block.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import {
getSaveElement,
isReusableBlock,
isUnmodifiedDefaultBlock,
getUnregisteredTypeHandlerName,
} from '@wordpress/blocks';
import { withFilters } from '@wordpress/components';
import { __, sprintf } from '@wordpress/i18n';
Expand Down Expand Up @@ -382,6 +383,8 @@ export class BlockListBlock extends Component {
// The block as rendered in the editor is composed of general block UI
// (mover, toolbar, wrapper) and the display of the block content.

const isUnregisteredBlock = block.name === getUnregisteredTypeHandlerName();

// If the block is selected and we're typing the block should not appear.
// Empty paragraph blocks should always show up as unselected.
const showEmptyBlockSideInserter = ( isSelected || isHovered ) && isEmptyDefaultBlock && isValid;
Expand All @@ -404,7 +407,7 @@ export class BlockListBlock extends Component {

// Generate the wrapper class names handling the different states of the block.
const wrapperClassName = classnames( 'editor-block-list__block', {
'has-warning': ! isValid || !! error,
'has-warning': ! isValid || !! error || isUnregisteredBlock,
'is-selected': shouldAppearSelected,
'is-multi-selected': isPartOfMultiSelection,
'is-selected-parent': shouldAppearSelectedParent,
Expand Down

0 comments on commit 5be3d3b

Please sign in to comment.