fix: created a block and reset the parent page#1312
Conversation
WalkthroughThe callback for the 'schemaImport' subscription in the RenderMain module was updated to introduce conditional logic. Now, when a schema is imported, the code retrieves the schema from Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant RenderMain
participant window.host
participant pageContext
User->>RenderMain: schemaImport event
RenderMain->>window.host: getSchema()
window.host-->>RenderMain: schema
RenderMain->>RenderMain: Check schema.componentName == constants.COMPONENT_NAME.Block
alt If componentName is 'Block'
RenderMain->>pageContext: pageId = ""
RenderMain->>RenderMain: updatePageAncestor()
end
RenderMain->>RenderMain: setSchema(schema)
Poem
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
⏰ Context from checks skipped due to timeout of 90000ms (1)
✨ Finishing Touches
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
| callback: () => { | ||
| setSchema(window.host.getSchema()) | ||
| const schema = window.host.getSchema() | ||
| if (schema.componentName === 'Block') { |
There was a problem hiding this comment.
建议使用定义的常量:
import { constants } from '@opentiny/tiny-engine-utils'
if (schema.componentName === constants.COMPONENT_NAME.Block) {
// ...
}
English | 简体中文
PR
PR Checklist
Please check if your PR fulfills the following requirements:
PR Type
What kind of change does this PR introduce?
Background and solution
What is the current behavior?
Issue Number: #1311
What is the new behavior?
Does this PR introduce a breaking change?
Other information
Summary by CodeRabbit