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(textinput): support passing a ref #3168

Merged
merged 1 commit into from Dec 2, 2019
Merged

Conversation

@boaz0
Copy link
Member

boaz0 commented Oct 20, 2019

What:

closes #3153

  • I had to update the tests because of enzyme snapshot (TextInput -> ForwardRef)
  • I added an example for react-hook-form. I am not sure we should have it.
  • I added withInnerRef to the helpers directory. This will make it easier to add support to ref in other component.

//cc @kmcfaul @ia3andy

@tlabaj tlabaj requested a review from kmcfaul Oct 22, 2019
@boaz0 boaz0 force-pushed the boaz0:closes_3153 branch from 65ed3da to 92a0a80 Oct 25, 2019
@codecov-io

This comment has been minimized.

Copy link

codecov-io commented Oct 25, 2019

Codecov Report

Merging #3168 into master will decrease coverage by <.01%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #3168      +/-   ##
==========================================
- Coverage   67.52%   67.52%   -0.01%     
==========================================
  Files         896      895       -1     
  Lines       25112    25057      -55     
  Branches     2173     2158      -15     
==========================================
- Hits        16958    16920      -38     
+ Misses       7141     7130      -11     
+ Partials     1013     1007       -6
Flag Coverage Δ
#misc 95.45% <ø> (ø) ⬆️
#patternfly3 69.28% <ø> (ø) ⬆️
#patternfly4 65% <100%> (-0.02%) ⬇️
Impacted Files Coverage Δ
...kages/patternfly-4/react-core/src/helpers/index.ts 100% <100%> (ø) ⬆️
.../react-core/src/components/TextInput/TextInput.tsx 95.55% <100%> (+0.43%) ⬆️
...tternfly-4/react-core/src/helpers/withInnerRef.tsx 100% <100%> (ø)
...mental/components/DataToolbar/DataToolbarGroup.tsx 93.75% <0%> (-6.25%) ⬇️
...nents/DataToolbar/DataToolbarExpandableContent.tsx 95.23% <0%> (-1.06%) ⬇️
...nfly-4/react-core/src/components/Select/Select.tsx 63.87% <0%> (-0.42%) ⬇️
...nfly-4/react-core/src/components/Dropdown/index.ts 100% <0%> (ø) ⬆️
...mental/components/DataToolbar/DataToolbarUtils.tsx 100% <0%> (ø) ⬆️
...ntal/components/DataToolbar/DataToolbarContent.tsx 100% <0%> (ø) ⬆️
...onents/DataToolbar/DataToolbarChipGroupContent.tsx 81.81% <0%> (ø) ⬆️
... and 11 more

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 78bd323...bad2b9a. Read the comment docs.

@boaz0 boaz0 force-pushed the boaz0:closes_3153 branch from 92a0a80 to 1a287c3 Oct 25, 2019
@patternfly-build

This comment has been minimized.

Copy link
Contributor

patternfly-build commented Oct 25, 2019

PatternFly-React preview: https://patternfly-react-pr-3168.surge.sh

Copy link
Contributor

nicolethoen left a comment

The PR description mentions updating the examples? Was that decided against? or was it overlooked?

I'm also noticing that all the props are missing from the documentation - but I dont think that's related to this PR, thats probably an issue with building the react docs.

@@ -0,0 +1,7 @@
import * as React from 'react';

export function withInnerRef<R, P extends { innerRef?: React.Ref<R> }>(

This comment has been minimized.

Copy link
@nicolethoen

nicolethoen Oct 25, 2019

Contributor

I can imagine this will be very helpful, thanks!

Copy link
Member

dlabrecq left a comment

We should have an example, similar to the tabs "separate content" ref example. I don't necessarily see a problem, but refs cannot be passed down as props, so it would be good to also have an example for users.

@boaz0 boaz0 force-pushed the boaz0:closes_3153 branch from 1a287c3 to 00af50d Nov 6, 2019
Copy link
Member

dlabrecq left a comment

The code looks good, but have a question about using a primary button to show functionality

@boaz0 boaz0 force-pushed the boaz0:closes_3153 branch from 00af50d to 5608288 Nov 22, 2019
Signed-off-by: Boaz Shuster <boaz.shuster.github@gmail.com>
@boaz0 boaz0 force-pushed the boaz0:closes_3153 branch from 5608288 to bad2b9a Nov 27, 2019
@kmcfaul
kmcfaul approved these changes Dec 2, 2019
@kmcfaul kmcfaul merged commit 1e1ca74 into patternfly:master Dec 2, 2019
8 checks passed
8 checks passed
ci/circleci: build Your tests passed on CircleCI!
Details
ci/circleci: build_integration Your tests passed on CircleCI!
Details
ci/circleci: build_pf3_docs Your tests passed on CircleCI!
Details
ci/circleci: build_pf4_docs Your tests passed on CircleCI!
Details
ci/circleci: lint Your tests passed on CircleCI!
Details
ci/circleci: test_jest_other Your tests passed on CircleCI!
Details
ci/circleci: test_jest_pf4 Your tests passed on CircleCI!
Details
ci/circleci: upload_docs Your tests passed on CircleCI!
Details
@patternfly-build

This comment has been minimized.

Copy link
Contributor

patternfly-build commented Dec 2, 2019

Your changes have been released in:

  • @patternfly/react-catalog-view-extension@1.1.41
  • @patternfly/react-core@3.125.0
  • @patternfly/react-docs@4.16.47
  • @patternfly/react-inline-edit-extension@2.14.0
  • demo-app-ts@3.13.4
  • @patternfly/react-table@2.24.44
  • @patternfly/react-topology@2.11.30
  • @patternfly/react-virtualized-extension@1.3.43

Thanks for your contribution! 🎉

@boaz0

This comment has been minimized.

Copy link
Member Author

boaz0 commented Dec 2, 2019

Thanks a lot 😄 🎊

@boaz0 boaz0 deleted the boaz0:closes_3153 branch Dec 2, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
6 participants
You can’t perform that action at this time.