-
Notifications
You must be signed in to change notification settings - Fork 8.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[UI Framework] Create Button React components in UI Framework.
Backports PR #10646 **Commit 1:** Create Button React components in UI Framework. * Original sha: 68e14a2 * Authored by CJ Cenizal <[email protected]> on 2017-03-02T03:43:14Z **Commit 2:** Integrate button icon variations into button_icon.js. Integrate button variations inbot button.js. - Rename classes prop to className. * Original sha: efa0a26 * Authored by CJ Cenizal <[email protected]> on 2017-03-02T17:26:16Z **Commit 3:** Add KuiLoadingButtonIcon and isLoading prop for KuiButton. * Original sha: c55ff13 * Authored by CJ Cenizal <[email protected]> on 2017-03-02T19:11:52Z **Commit 4:** Add Jest test coverage for UI Framework. - Add tests for KuiButton. - Generate report in ui_framework/jest/report. * Original sha: b461275 * Authored by CJ Cenizal <[email protected]> on 2017-03-21T01:17:29Z **Commit 5:** Add tests for KuiButtonIcon and KuiButtonGroup. * Original sha: 933f8ec * Authored by CJ Cenizal <[email protected]> on 2017-03-21T18:20:57Z **Commit 6:** Add both React and HTML examples for KuiButton. * Original sha: 36e0ea6 * Authored by CJ Cenizal <[email protected]> on 2017-03-21T20:52:04Z **Commit 7:** Update UI Framework README with instructions on creating and testing React components. * Original sha: 802f1ea * Authored by CJ Cenizal <[email protected]> on 2017-03-21T23:52:29Z **Commit 8:** Move KuiButton isDisabled check from onClick handler to prop assginment. * Original sha: 0132a55 * Authored by CJ Cenizal <[email protected]> on 2017-03-21T23:58:34Z **Commit 9:** Refactor kuiButton to not use createElement, and instead exit early and return the correct element. * Original sha: 31219b3 * Authored by CJ Cenizal <[email protected]> on 2017-03-22T00:10:03Z **Commit 10:** Redesign KuiButton and KuiButtonIcon to accept a type prop. * Original sha: a8000c9 * Authored by CJ Cenizal <[email protected]> on 2017-03-22T04:13:29Z **Commit 11:** Break KuiButton apart into KuiButton, KuiLinkButton, and KuiSubmitButton. * Original sha: 020d94c * Authored by CJ Cenizal <[email protected]> on 2017-03-22T04:53:36Z **Commit 12:** Move KuiButtonIcon and KuiButtonGroup into their own directories. * Original sha: 119abf5 * Authored by CJ Cenizal <[email protected]> on 2017-03-22T05:01:59Z **Commit 13:** Remove unused icon var from KuiSubmitButton. * Original sha: 24a9a4f * Authored by CJ Cenizal <[email protected]> on 2017-03-22T05:05:32Z **Commit 14:** Use simpler rest parameter syntax instead of Object.assign for defining KuiButton propTypes. * Original sha: 4119bfb * Authored by CJ Cenizal <[email protected]> on 2017-03-22T18:42:31Z **Commit 15:** Refactor KuiButton and KuiButtonIcon type prop to emphasize passing string literals instead of enums. * Original sha: d50d081 * Authored by CJ Cenizal <[email protected]> on 2017-03-22T19:06:42Z **Commit 16:** Add comment to explain role of nonVoidPropTypes in KuiButton. * Original sha: f9c55fa * Authored by CJ Cenizal <[email protected]> on 2017-03-22T19:15:57Z **Commit 17:** Dynamically define KuiButton and KuiButtonIcon tests for type prop. * Original sha: 0c5d2fd * Authored by CJ Cenizal <[email protected]> on 2017-03-22T20:46:17Z **Commit 18:** Fix Jest coverage configuration for deeply-nested dirs. * Original sha: 6d724fc * Authored by CJ Cenizal <[email protected]> on 2017-03-22T21:27:30Z **Commit 19:** Rename prop testSubject to data-test-subj. * Original sha: a9a4652 * Authored by CJ Cenizal <[email protected]> on 2017-03-22T22:22:51Z **Commit 20:** button idea * Original sha: d1eed94 * Authored by Kim Joar Bekkelund <[email protected]> on 2017-03-23T12:57:03Z * Committed by CJ Cenizal <[email protected]> on 2017-03-28T15:21:03Z **Commit 21:** Remove unnecessary onClick mentions * Original sha: a2d045e * Authored by Kim Joar Bekkelund <[email protected]> on 2017-03-23T15:36:34Z * Committed by CJ Cenizal <[email protected]> on 2017-03-28T15:21:03Z **Commit 22:** - Update KuiLinkButton to preventDefault on click when disabled. - Update getClassName helper to accommodate loading icons. - Update tests. * Original sha: 4016eba * Authored by CJ Cenizal <[email protected]> on 2017-03-24T00:45:00Z **Commit 23:** Update tests with HTML attributes group. Add test for aria-label. * Original sha: 05d934b * Authored by CJ Cenizal <[email protected]> on 2017-03-24T17:08:29Z **Commit 24:** Add UI Framework to linting task. * Original sha: 3bc5016 * Authored by CJ Cenizal <[email protected]> on 2017-03-24T17:24:41Z **Commit 25:** Refactor HTML attribute tests to be more succinct. * Original sha: 322a968 * Authored by CJ Cenizal <[email protected]> on 2017-03-24T18:58:45Z **Commit 26:** Remove backticks from ui_framework_test task. * Original sha: 2187260 * Authored by CJ Cenizal <[email protected]> on 2017-03-24T19:00:24Z **Commit 27:** Add eslintrc file to ui_framework, for Jest-specific rules. * Original sha: 94daf03 * Authored by CJ Cenizal <[email protected]> on 2017-03-24T19:06:42Z **Commit 28:** Add UI Framework Jest tests to npm test script. Create separate scripts for watching and generating coverage reports. * Original sha: 2fa3cf7 * Authored by CJ Cenizal <[email protected]> on 2017-03-24T20:58:00Z **Commit 29:** Remove redundant kuiSubmitButton tests. * Original sha: 8d4222a * Authored by CJ Cenizal <[email protected]> on 2017-03-24T21:06:13Z **Commit 30:** Document Enzyme-specific Webpack configuration. * Original sha: ad9616f * Authored by CJ Cenizal <[email protected]> on 2017-03-24T21:09:07Z
- Loading branch information
Showing
57 changed files
with
1,916 additions
and
263 deletions.
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
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 | ||
} | ||
} |
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
Oops, something went wrong.