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

Fix Prop Types Error #14837 #14889

Merged
merged 3 commits into from Oct 5, 2021
Merged

Fix Prop Types Error #14837 #14889

merged 3 commits into from Oct 5, 2021

Conversation

papuruth
Copy link
Contributor

@papuruth papuruth commented Oct 1, 2021

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

  • Refactor
  • Feature
  • Bug Fix
  • Optimization
  • Documentation Update

Description

As per issue no. #14837 I have fixed prop types errors for Button, ButtonGroup, Modal, and articlePage components.

Related Tickets & Documents

#14837

QA Instructions, Screenshots, Recordings

I don't believe any new tests would be required for these changes.

Added/updated tests?

  • No, as because it doesn't seem legit to write UT for these changes.

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

Two on Behance

Fixed prop types errors for Button, ButtonGroup, Modal and articlePage
@papuruth papuruth requested a review from a team October 1, 2021 23:57
@pr-triage pr-triage bot added the PR: unreviewed bot applied label for PR's with no review label Oct 1, 2021
@CLAassistant
Copy link

CLAassistant commented Oct 1, 2021

CLA assistant check
All committers have signed the CLA.

@papuruth papuruth requested review from aitchiss and msarit and removed request for a team October 1, 2021 23:58
@github-actions
Copy link
Contributor

github-actions bot commented Oct 1, 2021

Thank you for opening this PR! We appreciate you!

For all pull requests coming from third-party forks we will need to
review the PR before we can process it through our CI pipelines.

A Forem Team member will review this contribution and get back to
you as soon as possible!

Copy link
Contributor

@aitchiss aitchiss 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 taking this on! It's looking great, but I just have a couple of small change requests - let me know if I can assist at all!

Comment on lines 13 to 15
children: PropTypes.arrayOf(
PropTypes.oneOfType([PropTypes.object, PropTypes.bool]),
).isRequired,
Copy link
Contributor

Choose a reason for hiding this comment

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

refactor (blocking) - I'm not sure this is the correct fix, as we don't want booleans passed in as children of the ButtonGroup (we only want elements/Preact components 🙂 ).

Instead of changing this to silence the error, I would instead update the code using ButtonGroup and triggering the error:

{subscribed && (
<Button
id="subscription-settings-btn"
data-testid="subscription-settings"
variant="outlined"
icon={CogIcon}
contentType="icon"
/>
)}

We could use a ternary to avoid passing a false boolean into the component, e.g.:

{subscribed ? (
            <Button
              id="subscription-settings-btn"
              data-testid="subscription-settings"
              variant="outlined"
              icon={CogIcon}
              contentType="icon"
            />
          ) : null}

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Exactly we should pass null @aitchiss

@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 4, 2021
@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 4, 2021
Copy link
Contributor Author

@papuruth papuruth left a comment

Choose a reason for hiding this comment

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

I have pushed the changes please review

@papuruth papuruth requested a review from aitchiss October 4, 2021 08:34
Copy link
Contributor

@aitchiss aitchiss 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 those changes! ✨

@pr-triage pr-triage bot added PR: partially-approved bot applied label for PR's where a single reviewer approves changes and removed PR: unreviewed bot applied label for PR's with no review labels Oct 4, 2021
@pr-triage pr-triage bot added PR: unreviewed bot applied label for PR's with no review and removed PR: partially-approved bot applied label for PR's where a single reviewer approves changes labels Oct 4, 2021
@pr-triage pr-triage bot added PR: partially-approved bot applied label for PR's where a single reviewer approves changes and removed PR: unreviewed bot applied label for PR's with no review labels Oct 5, 2021
@rhymes rhymes merged commit 6da9007 into forem:main Oct 5, 2021
@pr-triage pr-triage bot added PR: merged bot applied label for PR's that are merged and removed PR: partially-approved bot applied label for PR's where a single reviewer approves changes labels Oct 5, 2021
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.

None yet

6 participants