-
Notifications
You must be signed in to change notification settings - Fork 53
feat(components): tags #3164
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
Merged
Merged
feat(components): tags #3164
Changes from 30 commits
Commits
Show all changes
31 commits
Select commit
Hold shift + click to select a range
ffb7bfe
feat: tags
00d3977
feat: tags
b963bd3
feat: tags
b32c3ff
feat: tags
00b4659
Merge branch 'master' into frassinier/feat/tags
4e09153
feat: tags
f3a32f8
chore(ci): prettier
823b36c
feat: tags
cb8d8eb
feat: tags
c65539c
chore(components): migrate react-popper to v2
dd69239
Update package.json
c54bc9a
feat: tags
118637e
feat: tags
810544b
Merge remote-tracking branch 'origin/master' into frassinier/feat/tags
9c8b9fd
upgrade yarn.lock after merge
27d4c29
ds 1.0.7
19ecb92
Extract Tag as new component
9ec7e50
chore(ci): update code style outputs
7afae1d
chore(ci): prettier
aa03860
revert
fd427b8
revert
9e9eefd
proptypes
06b91b3
chore(ci): update code style outputs
d76acb8
unit tests
8d3c755
chore(ci): update code style outputs
56e950f
chore(ci): prettier
f7d3aea
unit tests
a560b92
chore(ci): update code style outputs
e4d1bd7
Merge remote-tracking branch 'origin/master' into frassinier/feat/tags
ebe4a5e
yarn dedupe
103c57a
chore: dedup
jmfrancois File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,37 @@ | ||
| import React from 'react'; | ||
|
|
||
| const mocks = {}; | ||
|
|
||
| const Coral = jest.requireActual('@talend/design-system'); | ||
|
|
||
| function startsWithUpperCase(name) { | ||
| return name[0] === name[0].toUpperCase(); | ||
| } | ||
|
|
||
| function getFakeJSX(name) { | ||
| return props => ( | ||
| <div data-mock-module="@talend/design-system" data-mock-component={name} {...props} /> | ||
| ); | ||
| } | ||
|
|
||
| function mockComponentVariation(name) { | ||
| return variation => { | ||
| const variationName = `${name}.${variation}`; | ||
| mocks[name][variation] = getFakeJSX(variationName); | ||
| mocks[name][variation].displayName = variationName; | ||
| }; | ||
| } | ||
|
|
||
| function mockComponent(name) { | ||
| mocks[name] = getFakeJSX(name); | ||
| mocks[name].displayName = name; | ||
| Object.keys(Coral[name]) | ||
| .filter(startsWithUpperCase) | ||
| .forEach(mockComponentVariation(name)); | ||
| } | ||
|
|
||
| Object.keys(Coral) | ||
| .filter(startsWithUpperCase) | ||
| .forEach(mockComponent); | ||
|
|
||
| module.exports = mocks; | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.