-
Notifications
You must be signed in to change notification settings - Fork 73
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
Handle missing values in the preview #115
Comments
@petrsvihlik .. I see this is a new issue. Can i take it up. Or if you have already existing priority issues do let me know ! Thanks :) |
Hi @pavan-krishna-v, you can certainly pick it up! I've just sent you an invitation to the project. I'll be able to assign the issue to you once you accept it. |
Done. Thanks ! |
Assigned. Let us know if you need anything :) |
Hi @petrpyszko ,
The url which i checked is, http://localhost:3000/en-us/store/brewers. And i notice that all article pages are failing on clicking of preview. Do let me know if i got the issue right. |
Hi @pavan-krishna-v , yes, you are right, the App should be working even for the new (completely blank) items (brewers, articles ....). I am not sure which other fields can cause similar issues - but after creating blank items of each content type, you should be able to quickly identify other problematic areas :) |
Hi @pavan-krishna-v, since this is a sample application, it is completely fine to have just a show case, how to implement missing values. So it will be OK to protect only articles or products and not to implement all the cases where we could face missing values. Take a look to the solution in our Vue sample app for inspiration. Hope it helps 😄 |
Hello @pavan-krishna-v , do you have any update on this issue? |
If efforts to solve this issue have been abandoned, I'd like to take it. However, I don't see the issue for this page. Please provide information on how to reproduce error. |
Hi @Karl-EdwardFPJeanMehu , I've just sent you an invitation to the project. I'll be able to assign the issue to you once you accept it. You should be able to reproduce the issue if you turn on the preview functionality as described at https://github.com/Kentico/cloud-sample-app-react#previewing-content-from-your-project You can generate a sample project at https://app.kenticocloud.com/sample-project-generator and turn on the preview functionality as described at https://developer.kenticocloud.com/docs/previewing-content-in-a-separate-environment#section-using-the-delivery-preview-api |
in the related task (basically the same but in Vue application), there is a description how to reproduce the error step by step). But instead of |
Thanks @Simply007 ! I'll check it out |
If you have any question, feel free to ask! If you want to assign this issue to you, just accept the invitation @petrsvihlik has sent you: |
I had found the issue but just took some time to make sure. The metaData state variable is initially undefined. That is causing the typeError in the MetaData comp for all given prop values (ie metadataMetaTitle). I would like to know is there a set of preferred default values I may consult to set them to? |
I would use the same default values that are in Vue sample app at least for Article: The other values are not strictly defined, so would use the same pattern:
|
Thanks! |
What should I use as a default image? I'm currently using a simple svg image with the text "product has no image" at its center. Otherwise, simply returning |
In a Vue.js there is an image omited. I would be more for the placeholder div with the text: |
Ok, I see it. |
Nearly complete. Please advise for meta OG images. These can only be replaced by a default image. |
I assume you mean the OG image that is passed to the Metadata component. |
Yes, the implementation as you described is ok but I've tested it and the app throws an error when those SSO tags are left empty in the app. |
I will take a look at the #125 pull request and let you know! |
I have gone through the pull request and everything works fine. According to the metadata (i.e. ogImage) I would recommend using the lodash for the value check:
But I am completely fine to accept the pull request without it. Great jop @Karl-EdwardFPJeanMehu, thanks! |
Thanks @Simply007 ! |
Handle missing values in the preview #115
Motivation
The app crashes unexpectedly in the preview mode for articles without the image or products without the price. Preview Delivery API returns items in the draft step and some values can be missing (even required fields).
Proposed solution
Additional context
The text was updated successfully, but these errors were encountered: