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

feat(Radio): Convert radio to TypeScript #1945

Merged
merged 2 commits into from May 17, 2019

Conversation

@rebeccaalpert
Copy link
Member

rebeccaalpert commented May 7, 2019

Converted to TypeScript. I made a small change to the behavior since it was triggering a React warning related to switching from an uncontrolled to a controlled component (and back again) when you clicked the controlled radio and one about defaultChecked and checked being applied at the same time.

Fixes #1997.

@rebeccaalpert rebeccaalpert force-pushed the rebeccaalpert:radio-typescript branch 3 times, most recently from db2ff4f to d2e9872 May 7, 2019
@patternfly-build

This comment has been minimized.

Copy link
Contributor

patternfly-build commented May 7, 2019

@rebeccaalpert rebeccaalpert force-pushed the rebeccaalpert:radio-typescript branch from d2e9872 to 91f03ef May 7, 2019
@codecov-io

This comment has been minimized.

Copy link

codecov-io commented May 7, 2019

Codecov Report

Merging #1945 into master will increase coverage by 0.03%.
The diff coverage is 89.65%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1945      +/-   ##
==========================================
+ Coverage   82.33%   82.36%   +0.03%     
==========================================
  Files         628      628              
  Lines        6980     6998      +18     
  Branches      136      143       +7     
==========================================
+ Hits         5747     5764      +17     
+ Misses       1161     1160       -1     
- Partials       72       74       +2
Flag Coverage Δ
#patternfly3 84.88% <ø> (ø) ⬆️
#patternfly4 78.83% <89.65%> (+0.09%) ⬆️
#patternflymisc 95.68% <ø> (ø) ⬆️
Impacted Files Coverage Δ
...ernfly-4/react-core/src/components/Radio/Radio.tsx 89.65% <89.65%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 236d1d5...5101bad. Read the comment docs.

@nicolethoen

This comment has been minimized.

Copy link
Contributor

nicolethoen commented May 8, 2019

@rebeccaalpert can you also add integration tests for this component as outlined on this README?

Copy link
Contributor

dlabaj left a comment

Should add integration tests for Radio and RadioProps.

@rebeccaalpert rebeccaalpert force-pushed the rebeccaalpert:radio-typescript branch 4 times, most recently from b7e15b1 to 42ac345 May 16, 2019
@rebeccaalpert

This comment has been minimized.

Copy link
Member Author

rebeccaalpert commented May 16, 2019

Added demo/tests and addressed PR feedback.

@rebeccaalpert rebeccaalpert force-pushed the rebeccaalpert:radio-typescript branch from 42ac345 to c4acd0e May 17, 2019
@rebeccaalpert rebeccaalpert force-pushed the rebeccaalpert:radio-typescript branch from c4acd0e to 5101bad May 17, 2019
Copy link
Contributor

tlabaj left a comment

Looks great. couple of comments.

@@ -0,0 +1,26 @@
describe('Radio Demo Test', () => {
it('Navigate to demo section', () => {

This comment has been minimized.

Copy link
@tlabaj

tlabaj May 17, 2019

Contributor

Can you add some interactive test for checking and unchecking the controlled and uncontrolled buttons?

This comment has been minimized.

Copy link
@rebeccaalpert

rebeccaalpert May 17, 2019

Author Member

It has one for the controlled button, but the uncontrolled buttons don't change at all HTML-wise when they're selected, so I don't know that you can write that kind of test for them.

@tlabaj
tlabaj approved these changes May 17, 2019
Copy link
Contributor

tlabaj left a comment

LGTM

@dlabaj
dlabaj approved these changes May 17, 2019
@dlabaj dlabaj merged commit 11a77d4 into patternfly:master May 17, 2019
2 checks passed
2 checks passed
ci/circleci: build Your tests passed on CircleCI!
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
7 participants
You can’t perform that action at this time.