-
Notifications
You must be signed in to change notification settings - Fork 8.2k
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
[UI Framework] Create Button React components in UI Framework. #10646
Merged
cjcenizal
merged 33 commits into
elastic:master
from
cjcenizal:feature/react-commponents-ui-framework
Mar 29, 2017
Merged
Changes from 32 commits
Commits
Show all changes
33 commits
Select commit
Hold shift + click to select a range
68e14a2
Create Button React components in UI Framework.
cjcenizal efa0a26
Integrate button icon variations into button_icon.js. Integrate butto…
cjcenizal c55ff13
Add KuiLoadingButtonIcon and isLoading prop for KuiButton.
cjcenizal b461275
Add Jest test coverage for UI Framework.
cjcenizal 933f8ec
Add tests for KuiButtonIcon and KuiButtonGroup.
cjcenizal 36e0ea6
Add both React and HTML examples for KuiButton.
cjcenizal 802f1ea
Update UI Framework README with instructions on creating and testing …
cjcenizal 0132a55
Move KuiButton isDisabled check from onClick handler to prop assginment.
cjcenizal 31219b3
Refactor kuiButton to not use createElement, and instead exit early a…
cjcenizal a8000c9
Redesign KuiButton and KuiButtonIcon to accept a type prop.
cjcenizal 020d94c
Break KuiButton apart into KuiButton, KuiLinkButton, and KuiSubmitBut…
cjcenizal 119abf5
Move KuiButtonIcon and KuiButtonGroup into their own directories.
cjcenizal 24a9a4f
Remove unused icon var from KuiSubmitButton.
cjcenizal 4119bfb
Use simpler rest parameter syntax instead of Object.assign for defini…
cjcenizal d50d081
Refactor KuiButton and KuiButtonIcon type prop to emphasize passing s…
cjcenizal f9c55fa
Add comment to explain role of nonVoidPropTypes in KuiButton.
cjcenizal 0c5d2fd
Dynamically define KuiButton and KuiButtonIcon tests for type prop.
cjcenizal 6d724fc
Fix Jest coverage configuration for deeply-nested dirs.
cjcenizal a9a4652
Rename prop testSubject to data-test-subj.
cjcenizal d1eed94
button idea
kimjoar a2d045e
Remove unnecessary onClick mentions
kimjoar 4016eba
- Update KuiLinkButton to preventDefault on click when disabled.
cjcenizal 05d934b
Update tests with HTML attributes group. Add test for aria-label.
cjcenizal 3bc5016
Add UI Framework to linting task.
cjcenizal 322a968
Refactor HTML attribute tests to be more succinct.
cjcenizal 2187260
Remove backticks from ui_framework_test task.
cjcenizal 94daf03
Add eslintrc file to ui_framework, for Jest-specific rules.
cjcenizal 2fa3cf7
Add UI Framework Jest tests to npm test script. Create separate scrip…
cjcenizal 8d4222a
Remove redundant kuiSubmitButton tests.
cjcenizal ad9616f
Document Enzyme-specific Webpack configuration.
cjcenizal c28bbd7
Fix appearance of kuiButtons with icons throughout Kibana, by adding …
cjcenizal 17e0838
Update JSX to not enclose prop arguments in whitespace. Update tests …
cjcenizal 98e1e38
Remove unused Jest stub files.
cjcenizal 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 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 |
---|---|---|
|
@@ -36,4 +36,5 @@ selenium | |
*.swo | ||
*.out | ||
ui_framework/doc_site/build/*.js* | ||
ui_framework/jest/report | ||
yarn.lock |
This file contains 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 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 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 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 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 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 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 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 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 @@ | ||
const platform = require('os').platform(); | ||
const config = require('./utils/ui_framework_test_config'); | ||
|
||
module.exports = function (grunt) { | ||
grunt.registerTask('uiFramework:test', function () { | ||
const done = this.async(); | ||
Promise.all([uiFrameworkTest()]).then(done); | ||
}); | ||
|
||
function uiFrameworkTest() { | ||
const serverCmd = { | ||
cmd: /^win/.test(platform) ? '.\\node_modules\\.bin\\jest.cmd' : './node_modules/.bin/jest', | ||
args: [ | ||
'--env=jsdom', | ||
`--config=${JSON.stringify(config)}`, | ||
], | ||
opts: { stdio: 'inherit' } | ||
}; | ||
|
||
return new Promise((resolve, reject) => { | ||
grunt.util.spawn(serverCmd, (error, result, code) => { | ||
if (error || code !== 0) { | ||
const message = result.stderr || result.stdout; | ||
|
||
grunt.log.error(message); | ||
|
||
return reject(); | ||
} | ||
|
||
grunt.log.writeln(result); | ||
|
||
resolve(); | ||
}); | ||
|
||
}); | ||
} | ||
}; |
This file contains 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,8 @@ | ||
const jest = require('jest'); | ||
const config = require('./ui_framework_test_config'); | ||
|
||
const argv = process.argv.slice(2); | ||
|
||
argv.push('--config', JSON.stringify(config)); | ||
|
||
jest.run(argv); |
This file contains 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,27 @@ | ||
const path = require('path'); | ||
const rootDir = 'ui_framework'; | ||
const resolve = relativePath => path.resolve(__dirname, '..', '', relativePath); | ||
|
||
module.exports = { | ||
rootDir, | ||
collectCoverageFrom: [ | ||
'components/**/*.js', | ||
// Seems to be a bug with jest or micromatch, in which the above glob doesn't match subsequent | ||
// levels of directories, making this glob necessary. | ||
'components/**/**/*.js', | ||
'!components/index.js', | ||
'!components/**/*/index.js', | ||
], | ||
coverageDirectory: '<rootDir>/jest/report', | ||
coverageReporters: ['html'], | ||
moduleFileExtensions: ['jsx', 'js', 'json'], | ||
moduleNameMapper: { | ||
'^.+\\.(jpg|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm)$': resolve('config/jest/FileStub.js'), | ||
'^.+\\.css$': resolve('config/jest/CSSStub.js'), | ||
'^.+\\.scss$': resolve('config/jest/CSSStub.js') | ||
}, | ||
testPathIgnorePatterns: ['<rootDir>/(dist|doc_site|jest)/'], | ||
testEnvironment: 'node', | ||
testRegex: '.*\.test\.(js|jsx)$', | ||
snapshotSerializers: ['<rootDir>/../node_modules/enzyme-to-json/serializer'] | ||
}; |
This file contains 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,3 @@ | ||
{ | ||
"presets": ["react", "@spalger/babel-presets"] | ||
} |
This file contains 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,13 @@ | ||
{ | ||
"plugins": [ | ||
"jest" | ||
], | ||
"rules": { | ||
"jest/no-disabled-tests": "error", | ||
"jest/no-focused-tests": "error", | ||
"jest/no-identical-title": "error" | ||
}, | ||
"env": { | ||
"jest/globals": true | ||
} | ||
} |
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think these files might be missing? Probably not importing any of them, so don't hit this problem in this PR. We can just remove this from here and add it later? (Just to get this PR in)