Skip to content

[sitecore-jss][sitecore-jss-react] Enhance withDatasourceCheck() to support dataSourceResolveFailed - #2219

Open
sc-naveenhedallaarachchi wants to merge 3 commits into
devfrom
JSS-10178-support-dataSourceResolveFailed
Open

[sitecore-jss][sitecore-jss-react] Enhance withDatasourceCheck() to support dataSourceResolveFailed#2219
sc-naveenhedallaarachchi wants to merge 3 commits into
devfrom
JSS-10178-support-dataSourceResolveFailed

Conversation

@sc-naveenhedallaarachchi

Copy link
Copy Markdown
Contributor

Description / Motivation

  • Add optional dataSourceResolveFailed to ComponentRendering.
  • Treat dataSourceResolveFailed: true the same as a missing datasource in withDatasourceCheck() (hide in normal mode, editing error in editing mode).
  • Preserve existing behavior when the property is false or omitted so older Layout Service versions keep working.
  • Document the automatic handling in the withDatasourceCheck() JSDoc example.

Testing Details

  • Unit Test Added
  • Manual Test/Other (Please elaborate)
  • Confirm dataSourceResolveFailed: false still renders the wrapped component.
  • Confirm dataSourceResolveFailed: true hides the component in normal mode and shows the editing error in editing mode.
  • Confirm omitted property (older Layout Service) still uses the original presence check.
  • Confirm nested placeholder renderings are evaluated independently.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

@art-alexeyenko art-alexeyenko left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good - but please double check whether SXP 10.5 will provide the isContentResolved field in layout data. If not - there's no usecase for this PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants