-
Notifications
You must be signed in to change notification settings - Fork 4k
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
Refactor listings/listings.jsx #6992
Refactor listings/listings.jsx #6992
Conversation
08d4c00
to
4cb3758
Compare
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.
Thanks so much for the PR @JulianoGTZ! This is looking good, but requires some changes.
Also, in regards to components, file names should be PascalCased and in regards to the folder called elements, rename it to components.
Thanks again for contributing!
Hi @nickytonline. Thanks a lot for the Code Review. I'm going to work on this. Do you have any tips to separate the responsibilities on the First, I thought about hooks, but for that I would need to update the version of the Preact. |
@JulianoGTZ, we cannot use hooks as you mentioned because it requires Preact X. I have a PR open for it, #5639, but it's blocked by the testing tools we use. We're looking into when we can schedule this upgrade as it's a little more involved than just upgrading Preact. In regards to |
1f859e0
to
aa7e0a2
Compare
I didn’t forget about this @JulianoGTZ . I’ll be getting to this this week. |
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.
@JulianoGTZ, an easy change to make, but one of the modal props is spelt incorrectly. You might also need to update some snapshots. To do that, run yarn test -u
.
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.
There was a regression created when the listings page got split into smaller components. I've suggested a fix.
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.
LGTM!
Thanks so much @JulianoGTZ for contributing to the DEV codebase and thanks for being patient during the PR review. 👏 |
What type of PR is this? (check all applicable)
Description
I'm trying to solve the issues on codeclimate about the app/javascript/listings/listings.jsx file
I have failed to eliminate the code-smells 😢 . I thought it was better to dive into refactoring and then try to decrease code-smells in a more specific pull-request.
I increased the maintainability of the file from D to C.
I have done the tests by a BDD approach. Only on some small components that I did a snapshot test
Related Tickets & Documents
Refactor CodeClimate Issues
Mobile & Desktop Screenshots/Recordings (if there are UI changes)
Added tests?
Added to documentation?
[optional] Are there any post deployment tasks we need to perform?
[optional] What gif best describes this PR or how it makes you feel?