-
Notifications
You must be signed in to change notification settings - Fork 54
P2-704 Same Post and Job titles do not trigger red analysis #1120
Conversation
…ascript into P2-704-same-post-and-job-title
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
only a few comments for minor improvements.
also, /src/functions/blocks/index.ts is an empty file, please remove
@@ -1,7 +1,7 @@ | |||
import { ReactElement } from "react"; | |||
import { createElement } from "@wordpress/element"; | |||
import { BlockInstance } from "@wordpress/blocks"; | |||
import BlockSuggestions from "../../blocks/BlockSuggestions"; | |||
import { RequiredBlocks as BlockSuggestions } from "../../blocks/BlockSuggestions"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why the rename?
@@ -1,6 +1,6 @@ | |||
import attributeExists from "./attributeExists"; | |||
import attributeNotEmpty from "./attributeNotEmpty"; | |||
import getInvalidInnerBlocks from "./innerBlocksValid"; | |||
import { validateInnerBlocks as getInvalidInnerBlocks } from "./innerBlocksValid"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why the rename?
import { validateInnerBlocks as getInvalidInnerBlocks } from "./innerBlocksValid"; | |
import { validateInnerBlocks } from "./innerBlocksValid"; |
@@ -6,6 +6,7 @@ import recurseOverBlocks from "../blocks/recurseOverBlocks"; | |||
import { getInnerblocksByName } from "../innerBlocksHelper"; | |||
import logger from "../logger"; | |||
import isValidResult from "./isValidResult"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
there's still a default export remaining here.
@@ -3,10 +3,10 @@ import { BlockEditProps, BlockConfiguration } from "@wordpress/blocks"; | |||
import { createElement } from "@wordpress/element"; | |||
import { SelectControl } from "@wordpress/components"; | |||
// Internal imports. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
// Internal imports. |
|
||
import VariableTagRichText from "./VariableTagRichText"; | ||
|
||
export { VariableTagRichText }; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why import the rest if we're not exporting them?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For the BlockInstruction.register
side effects.
Without them the block instructions are not registered.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But yes, I will export them all.
import "./Schema"; | ||
import SchemaInstruction from "./Schema"; | ||
|
||
// Need to export something for the side-effects of the imports to work... |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
dank voor dit comment!
kunnen we de side effects expliciet maken / aanroepen?
@@ -1,13 +1,21 @@ | |||
import { dispatch, select } from "@wordpress/data"; | |||
import { BlockInstance } from "@wordpress/blocks"; | |||
|
|||
import { removeBlock, restoreBlock, getBlockType } from "../../src/functions/BlockHelper"; | |||
import { removeBlock, restoreBlock, getBlockType, getHumanReadableBlockName } from "../../src/functions/BlockHelper"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
rename the file from BlocksHelper.test.ts to BlockHelper.test.ts (singular)
@@ -1,8 +1,7 @@ | |||
import { BlockValidation, BlockValidationResult } from "../../../src/core/validation"; | |||
import getWarnings, { createAnalysisMessages, sanitizeBlockName } from "../../../src/functions/presenters/SidebarWarningPresenter"; | |||
import getWarnings, { createAnalysisMessages } from "../../../src/functions/presenters/SidebarWarningPresenter"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we un-default export the getWarnings?
Closed in favour of #1129. |
Summary
This PR can be summarized in the following changelog entry:
Relevant technical choices:
BlockValidationResult
s itself, rather than a separate result -> warning map.Test instructions
This PR can be tested by following these steps:
Impact check
UI changes
Quality assurance
Fixes #