-
Notifications
You must be signed in to change notification settings - Fork 36
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
fix: guard against missing data elements by using lodash.get #19
fix: guard against missing data elements by using lodash.get #19
Conversation
thanks for the PR, @fluffynuts ! we're on it :) |
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 am on it
Hello @fluffynuts, when I run the application and open articles. I got an error:
That is caused by the extraction of
Ideal caseHave a universal solver module that would resolve the path to an object or return the localized string. Lodash offers that functionality with combination with VueI18n from vue-i18n which is already used in application
And have the record in
I am OK to use this on article + articles as a showcase and I would raise the issue to implement is for the rest of the components. If anything is unclear, feel free to ask @fluffynuts! |
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.
see comment above
- require dateFormat and i18n functions from caller fix: add translations for fallback values
I hope this is more in line with what you'd prefer?
|
Hello @fluffynuts, for the testing purposes it is possible to generate your own project and then modify Client.js to use the preview API. Basically what you would do is:
Please see the inline comments in code. |
Hey @fluffynuts, we would like to thank you for contributing to Kentico's open-source project. As a sign of our appreciation, we would like to send you some Kentico Developer Community SWAG! Please fill out your postal address if you are interested. This comment was automatically generated. If you've submitted more than one pull request, it's OK to fill out the form just once. Kentico Developer Community If there’s anything we can do to help, please don’t hesitate to reach out to us at developerscommunity@kentico.com |
@Simply007 hey, thanks! I appreciate it & have filled out the form (: |
Hello @fluffynuts, I have gone through the changes you have made and I have tried to show you, how to implement guarding for all the occurrences of article data (home page, articles and article detail). I have created a pull request to your branch: Go through the changes I have made and then please polish the code:
I have also provided a vue.cli.config for easies debugging:
Hope that would be usefull! After you approve the pull request to your branch and remove hardcoded API keys I am more than happy to merge this pull request! |
Showcase how to handle articles is missing values on preview
@Simply007 I've merged in your branch -- I remember thinking that I needed to remember not to include client & project id's -- and then I did anyway facepalm. But that makes me think -- wouldn't it make sense to perhaps get those bits of information from another file which is mentioned in .gitignore? I would imagine that a company would really prefer not to make the mistake that I just did, letting their secrets out into the wild. |
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.
Could you please fix one error in LatestArticles.js component - incl. suggestion?
Then everything is OK to merge the pull requests!
About the extraction - I have summarized an issue and proposed a solution using dotenv library.
I have also created an issue #23 for API key extraction. |
I have decided to merge your pull request and then fix the latest articles in a separate one, to have the feature in place. Thanks @fluffynuts for the contribution! |
Motivation
Which issue does this fix? Fixes #18 (perhaps only partially -- I used lodash, which was already referenced by the project; if this approach is acceptable, it could be applied elsewhere)
Checklist
How to test
Should solve the problem with partial data causing dereference errors in Articles and Article components