-
Notifications
You must be signed in to change notification settings - Fork 24
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
Extend RichText resolver by component flag #198
Comments
I would love to help with this |
Hello @Emeka-Ugbanu-hub, thanks for your interest :) I am assigning you this issue. |
I need more info on this issue. It's kind of confusing |
The rich text element could contain some external items like image, component, and linked items. RichText component is built to resolve the HTML value containing external objects. An example of the rich text element structure could be found here: https://kontent.ai/learn/reference/delivery-api#section/Rich-text-element. So this issue is about adding information for |
what information are we adding for resolveLinkedItem |
At least pass the |
Yes, and include the test for it and showcase getting the information from Basically getting the information whether the linked item is a component or linked item:
So you can extend tests on https://github.com/Kentico/kontent-gatsby-packages/blob/master/packages/gatsby-kontent-components/tests/rich-text-emelemt.spec.tsx after you extend the callback. You can use i.e. this string as a value of the rich text (the same as it is already in the tests, but one component is added at the end)
And extend {
"__typename": "kontent_item_repository",
"system": {
"codename": "n5b76e971_4709_01f2_e8ea_36a9716d7b42"
},
"elements": {
"name": {
"name": "Name"
},
"slug": {
"value": ""
},
"summary": {
"value": "Gatsby packages repository containing the source plugin, components package, and a bunch of Gatsby examples."
},
"url": {
"value": "https://github.com/Kentico/kontent-gatsby-packages"
}
}
} |
Thanks am still new to the open source world so I need alot of guidance, I get the test I can do that but how do I showcase the information from domNode |
Everything seems fine. Just in the quoted bit, you need to use I guess, just try to submit a PR and we can iterate on the solution. It is much easier to reference the actual code parts than to reference the screenshots. |
Ok Thanks I'll do that |
just created the pull request |
Just completed the changes |
Thanks, please use re-request review next time, so that I get a notification to take a look at the PR. |
OK Thanks didn't know about that, Thanks for letting me know |
So is there still anymore changes for me to work on |
I have just finished the review - #204 (review) |
Ok I'll Work On the changes |
Any update on this? If you are stuck I am open to merging this into a separate branch, then make the last touches myself and merge this with master . |
am sorry but have been facing some issues and not been able to code for weeks but it would all be resolved, and I would start working on the changes |
Problem
Currently, it is hard to distinguish it an item is a component. And there is no information in
resolveLinkedItem
if an item is a component.Workarounds
workflow_step
codename being setSubstring(14, 2).Equals("01")
of an item ID -> then it is componentEnhancement
Extend
resolveLinkedItem
handler with the information if item is component or content item, or just passdomNode
as a second parameter, so that user has access to all attributes (as It is forresolveLink
callback).This information is being stored in
data-rel
attribute in Richtextvalue
property.data-rel="link"
-> linked itemdata-rel="component"
-> componenthttps://github.com/Kentico/kontent-gatsby-packages/blob/cb491dc14092e33a9259b99a28a46d55d733b259/packages/gatsby-kontent-components/src/rich-text-element/index.tsx#L43-L48
The text was updated successfully, but these errors were encountered: