Skip to content

Commit

Permalink
Rename prop
Browse files Browse the repository at this point in the history
  • Loading branch information
pierlon committed Aug 31, 2021
1 parent 96e8e02 commit 310ea5b
Show file tree
Hide file tree
Showing 4 changed files with 359 additions and 429 deletions.
10 changes: 5 additions & 5 deletions assets/src/block-validation/components/error/error-content.js
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ BlockType.propTypes = {
*
* @param {Object} props Component props.
* @param {Object} props.blockType Block type details.
* @param {boolean} props.external Flag indicating if the error comes from outside of post content.
* @param {boolean} props.isExternal Flag indicating if the error comes from outside of post content.
* @param {boolean} props.removed Flag indicating if the block has been removed.
* @param {string} props.clientId Block client ID
* @param {number} props.status Number indicating the error status.
Expand All @@ -188,7 +188,7 @@ export function ErrorContent( {
blockType,
clientId,
error: { sources },
external,
isExternal,
removed,
status,
} ) {
Expand All @@ -203,13 +203,13 @@ export function ErrorContent( {
{ __( 'This error is no longer detected, either because the block was removed or the editor mode was switched.', 'amp' ) }
</p>
) }
{ external && (
{ isExternal && (
<p>
{ __( 'This error comes from outside the content (e.g. header or footer).', 'amp' ) }
</p>
) }
<dl className="amp-error__details">
{ ! ( removed || external ) && (
{ ! ( removed || isExternal ) && (
<BlockType
blockTypeIcon={ blockTypeIcon }
blockTypeTitle={ blockTypeTitle }
Expand All @@ -231,7 +231,7 @@ ErrorContent.propTypes = {
error: PropTypes.shape( {
sources: PropTypes.arrayOf( PropTypes.object ),
} ).isRequired,
external: PropTypes.bool,
isExternal: PropTypes.bool,
removed: PropTypes.bool,
status: PropTypes.oneOf( [
VALIDATION_ERROR_ACK_ACCEPTED_STATUS,
Expand Down
6 changes: 3 additions & 3 deletions assets/src/block-validation/components/error/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ export function Error( { clientId, error, status, term_id: termId, title } ) {
const reviewLink = useSelect( ( select ) => select( BLOCK_VALIDATION_STORE_KEY ).getReviewLink(), [] );
const reviewed = status === VALIDATION_ERROR_ACK_ACCEPTED_STATUS || status === VALIDATION_ERROR_ACK_REJECTED_STATUS;
const kept = status === VALIDATION_ERROR_ACK_REJECTED_STATUS || status === VALIDATION_ERROR_NEW_REJECTED_STATUS;
const external = ! Boolean( clientId );
const isExternal = ! Boolean( clientId );

const { blockType, removed } = useSelect( ( select ) => {
const blockName = select( 'core/block-editor' ).getBlockName( clientId );
Expand Down Expand Up @@ -80,13 +80,13 @@ export function Error( { clientId, error, status, term_id: termId, title } ) {
blockType={ blockType }
clientId={ clientId }
error={ error }
external={ external }
isExternal={ isExternal }
removed={ removed }
status={ status }
/>

<div className="amp-error__actions">
{ ! ( removed || external ) && (
{ ! ( removed || isExternal ) && (
<Button
className="amp-error__select-block"
isSecondary
Expand Down
Loading

0 comments on commit 310ea5b

Please sign in to comment.