Skip to content
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/lint onboarding slides #4240

Merged

Conversation

daningenthron
Copy link
Contributor

@daningenthron daningenthron commented Oct 5, 2019

What type of PR is this? (check all applicable)

  • [ X ] Refactor
  • Feature
  • Bug Fix
  • Documentation Update

Description

From #2470 - cleans up ESlint errors that weren't passing Husky. For the most part these were small edits (snake case to camel case etc), although two changes may need some attention:

  • EmailListTermsConditionsForm.jsx contained a dangerouslySetInnerHTML warning that wouldn't pass; this has been bypassed by disabling the ESLint rule for this line. I think a better fix could be adding the DOMPurify dependency and sanitizing the HTML here and adding via innerHTML vs dangerouslySetInnerHTML, but those changes didn't seem in line with this PR.

  • In SlideContent.jsx I set up a blank (non-validating) shape for the style PropType. Not sure if this is best practice, but it seemed to make sense as far as trying to appease ESLint without defining the CSS attributes (and their types) ahead of time.

Added to documentation?

  • docs.dev.to
  • readme
  • [ X ] no documentation needed

[optional] What gif best describes this PR or how it makes you feel?

image

alt_text Hand pulling lint out of a lint trap in a single super-thick sheet

@pr-triage pr-triage bot added the PR: unreviewed bot applied label for PR's with no review label Oct 5, 2019
@CLAassistant
Copy link

CLAassistant commented Oct 5, 2019

CLA assistant check
All committers have signed the CLA.

Copy link
Contributor

@jacobherrington jacobherrington left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for making a PR @daningenthron! 🎉

I made some of these changes in #4254, but I will rebase and take your changes in my branch after this has been merged.

Happy Hacktoberfest! 🎃

@pr-triage pr-triage bot added PR: reviewed-approved bot applied label for PR's where reviewer approves changes and removed PR: unreviewed bot applied label for PR's with no review labels Oct 7, 2019
checkedCodeOfConduct: false,
checkedTermsAndConditions: false,
emailMembershipNewsletter: true,
emailDigestPeriodic: true,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not that this will technically be breaking the onboard process, but it won't properly update user's preference. This is because the whole state is sent via fetch as param.

I still want to accept this and make changes to the controller to snake-case params but reverting this refactor could be more straight foward. Do you have any thought on this @jacobherrington ?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Firstly, we probably want a feature spec to validate that onboarding works, going forward. That's something I'm happy to tackle in another PR.

Secondly, I think we should revert these changes in this PR and handle that in a new PR; I believe there are quite a few ways to address this and I'm not sure the Rails community has settled on one. Having it in a separate PR will allow us to merge this one and discuss it at length.

It's definitely a little weird to see snake case in JavaScript, but it's also weird to see camel case in Ruby.

I found an answer to this on SO, but I'm not sure it's the best route.

@jacobherrington jacobherrington self-requested a review October 7, 2019 20:08
@jacobherrington jacobherrington removed the PR: reviewed-approved bot applied label for PR's where reviewer approves changes label Oct 7, 2019
Copy link
Contributor

@jacobherrington jacobherrington left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm going to dismiss my approval based on Mac's thoughts. We should probably approach this a bit differently.

checkedCodeOfConduct: false,
checkedTermsAndConditions: false,
emailMembershipNewsletter: true,
emailDigestPeriodic: true,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should avoid making these snake_case to camelCase changes in this PR and tackle it in another PR based on @maestromac's feedback. Would you mind undoing this change? I'd love to merge in the other linting changes.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No problem at all, thanks for reviewing @jacobherrington! Resubmitting now.

@pr-triage pr-triage bot added the PR: reviewed-changes-requested bot applied label for PR's where reviewer requests changes label Oct 7, 2019
@daningenthron daningenthron force-pushed the refactor/lint-onboarding-slides branch from 16e1784 to 3d0a774 Compare October 9, 2019 00:56
@pr-triage pr-triage bot added PR: unreviewed bot applied label for PR's with no review and removed PR: reviewed-changes-requested bot applied label for PR's where reviewer requests changes labels Oct 9, 2019
Copy link
Contributor

@jacobherrington jacobherrington left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we go ahead and undo all of the camel case changes? I'm still seeing some data not make it through the onboarding slides.

@@ -12,17 +17,17 @@ const SlideContent = ({ imageSource, imageAlt, content, style = { textAlign: 'ce
{content}
<p>
<strong>
<em>Let's get started...</em>
<em>Let`&apos;`s get started...</em>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't need the backticks here, if we leave them in, it shows up like this:
image

location,
employer_name,
employment_title,
employerName,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This information doesn't seem to be making it through, this probably needs to go back to snake case as well.

@pr-triage pr-triage bot added PR: reviewed-changes-requested bot applied label for PR's where reviewer requests changes and removed PR: unreviewed bot applied label for PR's with no review labels Oct 9, 2019
@daningenthron daningenthron force-pushed the refactor/lint-onboarding-slides branch from 3d0a774 to 7d09618 Compare October 12, 2019 20:36
@daningenthron daningenthron requested a review from a team October 12, 2019 20:36
@pr-triage pr-triage bot removed the PR: reviewed-changes-requested bot applied label for PR's where reviewer requests changes label Oct 12, 2019
@ghost ghost requested a review from maestromac October 12, 2019 20:36
@pr-triage pr-triage bot added the PR: unreviewed bot applied label for PR's with no review label Oct 12, 2019
@ghost ghost removed their request for review October 12, 2019 20:36
@daningenthron
Copy link
Contributor Author

Hi @jacobherrington, removed the additional camelCase changes, and the backticks as requested. PersonalInfoForm.jsx has merged changes that have gone in since the original commit, with the variable setupFormTextField declared outside the class. ESLint was throwing a 'missing PropTypes' error on this function's params; I added a second PropTypes validator, but this appears to be the only JSX file in the repo with 2 separate validators. Would you recommend a different fix?

@daningenthron
Copy link
Contributor Author

Hi @jacobherrington just wanted to check in one more time - should I go ahead and close this PR at this point?

@jacobherrington
Copy link
Contributor

Hey @daningenthron it looks like there are some conflicts. If you rebase this branch, we can see what changes should be merged.

@maestromac
Copy link
Contributor

Sorry for letting this sit @daningenthron . I'm going to resolve the merge conflict and do the necessary work to get this merged.

Copy link
Contributor

@maestromac maestromac left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

Sorry that some of your lost work because the time this PR has been sitting 🙇

@pr-triage pr-triage bot added PR: reviewed-approved bot applied label for PR's where reviewer approves changes and removed PR: unreviewed bot applied label for PR's with no review labels Dec 16, 2019
Copy link
Contributor

@jacobherrington jacobherrington left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM this got lost in the shuffle a little bit, but we are good to merge these changes imo.

Thanks for making this PR @daningenthron ❤️

@maestromac maestromac merged commit 12dae72 into forem:master Dec 16, 2019
@pr-triage pr-triage bot added PR: merged bot applied label for PR's that are merged and removed PR: reviewed-approved bot applied label for PR's where reviewer approves changes labels Dec 16, 2019
@daningenthron
Copy link
Contributor Author

Thanks so much @maestromac & @jacobherrington! Wasn't sure about moving this forward bc of the time and the refactor - thanks for finishing it up!

@daningenthron daningenthron deleted the refactor/lint-onboarding-slides branch December 16, 2019 23:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
PR: merged bot applied label for PR's that are merged
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants