jss icon indicating copy to clipboard operation
jss copied to clipboard

[sitecore-jss-react] [sitecore-jss-nextjs] Default Placeholder Content for empty fields in editMode metadata

Open yavorsk opened this issue 1 year ago • 0 comments

  • [x] This PR follows the Contribution Guide
  • [x] Changelog updated
  • [ ] Upgrade guide entry added

Description / Motivation

This PR enhances the rendering of fields in editing mode for editMode metadata. When a field value is empty, a placeholder content should be rendered to signify that the field has no value. The placeholder should be interactable, so user can add value to the field. Additionally developers can provide their own custom empty field placeholder component via the field's emptyValueEditingPlaceholder prop, which will be rendered instead of the default one. The fields with this functionality are:

  • [sitecore-jss-react] Date.tsx
  • [sitecore-jss-react] Image.tsx
  • [sitecore-jss-react] Link.tsx
  • [sitecore-jss-react] RichText.tsx
  • [sitecore-jss-react] Text.tsx
  • [sitecore-jss-nextjs] Link.tsx
  • [sitecore-jss-nextjs] NextImage.tsx
  • [sitecore-jss-nextjs] RichText.tsx

Testing Details

  • [x] Unit Test Added
  • [x] Manual Test/Other (Please elaborate): Test in XmCloud in editMode=metadata

Types of changes

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

yavorsk avatar Jun 24 '24 13:06 yavorsk