-
Notifications
You must be signed in to change notification settings - Fork 1
Update RichText in tutorial and use macro processors #690 #692
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
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.
Pull Request Overview
This PR adds support for a new factbox
macro, updates existing content components to use the new RichText API, and bumps React component library versions.
- Registers and implements a
factbox
macro processor - Refactors
FactBox
,Person
, andArticle
components to consumeRichText
viacomponent
,meta
, andcommon
props - Updates dependencies
@enonic/react-components
and@enonic-types/lib-react4xp
to RC4
Reviewed Changes
Copilot reviewed 8 out of 10 changed files in this pull request and generated 1 comment.
Show a summary per file
File | Description |
---|---|
src/main/resources/react4xp/dataFetcher.ts | Imported factboxProcessor , added addMacro call |
src/main/resources/react4xp/components/macro/FactboxProcessor.ts | New macro processor for factbox |
src/main/resources/react4xp/components/macro/FactBox.tsx | Renamed config prop to data and updated usage in component |
src/main/resources/react4xp/components/content/PersonProcessor.ts | Passed dataFetcher and component into processHtml |
src/main/resources/react4xp/components/content/Person.tsx | Updated RichText calls to use meta , common , component |
src/main/resources/react4xp/components/content/ArticleProcessor.ts | Added dataFetcher and component parameters to processHtml |
src/main/resources/react4xp/components/content/Article.tsx | Switched RichText usage to new prop signature |
package.json | Bumped @enonic/react-components and @enonic-types/lib-react4xp versions |
Comments suppressed due to low confidence (2)
src/main/resources/react4xp/components/macro/FactBox.tsx:6
- [nitpick] The filename 'FactBox.tsx' uses 'Box' with an uppercase B, but the component is named 'Factbox' (lowercase b). Consider renaming one to maintain consistent casing.
export const Factbox = ({data, children}: MacroComponentParams) => {
src/main/resources/react4xp/components/macro/FactboxProcessor.ts:1
- There are no unit tests for the new FactboxProcessor; consider adding tests to validate behavior when
macro.config['factbox']
is present, missing, or malformed.
import type {ComponentProcessor, MacroProcessorParams} from '@enonic-types/lib-react4xp/DataFetcher';
@@ -18,3 +19,5 @@ dataFetcher.addPart('com.enonic.app.hmdb:child-list', {processor: childListProce | |||
dataFetcher.addContentType('com.enonic.app.hmdb:playlist', {processor: playlistProcessor}); | |||
dataFetcher.addContentType('com.enonic.app.hmdb:article', {processor: articleProcessor}); | |||
|
|||
// @ts-ignore update type in addMacro |
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.
Avoid using ts-ignore; consider updating the DataFetcher.addMacro type definitions to accept MacroProcessorParams so you can remove the ts-ignore directive.
Copilot uses AI. Check for mistakes.
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.
I approve of this :)
No description provided.