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(select): typescript #540

Merged
merged 112 commits into from
Dec 21, 2018
Merged

feat(select): typescript #540

merged 112 commits into from
Dec 21, 2018

Conversation

moog16
Copy link

@moog16 moog16 commented Dec 17, 2018

related: #48

@codecov-io
Copy link

codecov-io commented Dec 19, 2018

Codecov Report

Merging #540 into feat/two-typescript will decrease coverage by 0.04%.
The diff coverage is 100%.

Impacted file tree graph

@@                   Coverage Diff                   @@
##           feat/two-typescript     #540      +/-   ##
=======================================================
- Coverage                96.02%   95.97%   -0.05%     
=======================================================
  Files                       60       60              
  Lines                     2315     2362      +47     
  Branches                   221      249      +28     
=======================================================
+ Hits                      2223     2267      +44     
- Misses                      47       48       +1     
- Partials                    45       47       +2
Impacted Files Coverage Δ
packages/select/NativeControl.tsx 100% <100%> (ø)
packages/select/index.tsx 100% <100%> (ø)
packages/tab-scroller/index.js
packages/tab-scroller/index.tsx 96.93% <0%> (ø)

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 c8d1597...f53c398. Read the comment docs.

nativeControlClassName: string;
notchedOutlineClassName: string;
outlined: boolean;
options: (string | React.HTMLProps<HTMLOptionElement>)[];

Choose a reason for hiding this comment

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

when would options be a string vs an element? Can it be restricted to make its handling easier?

Copy link
Author

Choose a reason for hiding this comment

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

If people just want to do

options = ['poodle', 'golden_retreiver', 'alaskan']

or

options = [{
  label: 'Poodle', value: 'poodle'
}, {
 label: 'Golden Retriever', value: 'golden_retriever'
}, ...]

Any suggestions? If we changed it, it would be a breaking change

Choose a reason for hiding this comment

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

Oh it seems fine, but maybe making a type alias for it?

const notchedOutlineAdapter = {
notchOutline: () => this.setState({outlineIsNotched: true}),
closeOutline: () => this.setState({outlineIsNotched: false}),
hasOutline: () => !!this.props.outlined,
};

return Object.assign({},
return Object.assign(

Choose a reason for hiding this comment

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

spread?

{disabled: true},
];

const variants = [{}, {box: true}, {outlined: true}];

Choose a reason for hiding this comment

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

This is a bit hard to follow.

The first 3 arrays of objects, as is, are not maps themselves. Should they be renamed?
Where is variantKey coming from?
Are any of the values being used (e.g. true or 'pomsky'?)

Copy link
Author

Choose a reason for hiding this comment

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

ya it is a bit hacked together. I wanted to programatically add:

<Select box ... />
<Select outlined ... />

in an array format.

Copy link
Author

Choose a reason for hiding this comment

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

variantKey is either '', box, or outlined

Copy link
Author

Choose a reason for hiding this comment

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

I updated the screenshot and moved the {value: pomsky} out, which in turn created a different screenshot. But I the maps make more sense.

@moog16 moog16 changed the base branch from fix/coverage-typescript to feat/two-typescript December 20, 2018 00:48
@googlebot
Copy link

So there's good news and bad news.

👍 The good news is that everyone that needs to sign a CLA (the pull request submitter and all commit authors) have done so. Everything is all good there.

😕 The bad news is that it appears that one or more commits were authored or co-authored by someone other than the pull request submitter. We need to confirm that all authors are ok with their commits being contributed to this project. Please have them confirm that here in the pull request.

Note to project maintainer: This is a terminal state, meaning the cla/google commit status will not change from this state. It's up to you to confirm consent of all the commit author(s), set the cla label to yes (if enabled on your project), and then merge this pull request when appropriate.

@moog16 moog16 merged commit 8050bdb into feat/two-typescript Dec 21, 2018
@moog16 moog16 deleted the feat/typescript-select branch December 21, 2018 17:43
moog16 pushed a commit that referenced this pull request Dec 27, 2018
moog16 pushed a commit that referenced this pull request Dec 28, 2018
moog16 pushed a commit that referenced this pull request Dec 28, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants