Closed Omri-Levy closed 1 month ago
Latest commit: 2869b60613dbeed36982a6c14bb8136f335e9b32
Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.
Click here to learn what changesets are, and how to add one.
Click here if you're a maintainer who wants to add a changeset to this PR
The updates introduce new React components ReadOnlyDetail
and ReadOnlyDetailsCell
for efficiently displaying read-only information in the back-office application. Additionally, new types Json
and ExtendedJson
are established to standardize JSON handling across the application. This enhances the clarity and maintainability of the code by integrating structured data representation with user-friendly rendering.
File Path | Change Summary |
---|---|
apps/backoffice-v2/src/common/components/atoms/.../ReadOnlyDetail.tsx |
Added ReadOnlyDetail component to render various types of read-only data. |
apps/backoffice-v2/src/common/types.ts |
Introduced Json and ExtendedJson types for JSON-compatible structures. |
apps/backoffice-v2/src/lib/blocks/components/.../ReadOnlyDetailsCell.tsx |
Added ReadOnlyDetailsCell component to display read-only details in a structured format. |
apps/backoffice-v2/src/lib/blocks/create-blocks-typed/types.ts |
Updated type definitions to include new ExtendedJson and TReadOnlyDetailsCell types. |
sequenceDiagram
participant ParentComponent
participant ReadOnlyDetail
participant UtilityFunctions
ParentComponent->>ReadOnlyDetail: Render with props (value, parse, className)
ReadOnlyDetail->>UtilityFunctions: Check value type (date, boolean, URL, etc.)
UtilityFunctions-->>ReadOnlyDetail: Return formatted data
ReadOnlyDetail->>ParentComponent: Render formatted data
sequenceDiagram
participant ParentComponent
participant ReadOnlyDetailsCell
participant ReadOnlyDetail
ParentComponent->>ReadOnlyDetailsCell: Render with props (value, parse, className)
ReadOnlyDetailsCell->>ReadOnlyDetailsCell: Map over value array
ReadOnlyDetailsCell->>ReadOnlyDetail: Render each value with ReadOnlyDetail
ReadOnlyDetail-->>ReadOnlyDetailsCell: Return formatted detail component
ReadOnlyDetailsCell->>ParentComponent: Render list of formatted details
In the code where data lies,
A read-only world now complies,
Json, dates, and URLs,
Rendered neat in detailed cells.
Components new, and types refined,
In the back-office, brilliance shines.
🌟✨📜
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?
Summary by CodeRabbit
New Features
ReadOnlyDetail
component to render various data types in a read-only format.ReadOnlyDetailsCell
component for displaying structured read-only information in cells.Enhancements
Types
Json
andExtendedJson
for better handling of JSON structures.