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

[UI Framework] Button component needs to support "type" HTML attribute #11871

Closed
6 tasks
cjcenizal opened this issue May 17, 2017 · 1 comment
Closed
6 tasks
Assignees
Labels
release_note:enhancement Team:Platform-Design Team Label for Kibana Design Team. Support the Analyze group of plugins.

Comments

@cjcenizal
Copy link
Contributor

cjcenizal commented May 17, 2017

The KuiButton React component currently uses the type prop to specify whether it's a primary button, warning button, etc. We need to rename this prop so that people can use type to specify the HTML attribute, e.g. type="button" or type="submit".

Steps

  • Rename the "type" prop to "buttonType". In ui_framework/components/button/button.js, this change will be on lines 66 and 96. Make sure that all of the references to this prop within the KuiButton definition are updated to the new name as well. Apply the same changes to KuiLinkButton and KuiSubmitButton in that file.
  • Update the examples. In ui_framework/doc_site/src/views/button, update every example file here to use the new prop name. You can verify that your change has had the desired result by [running the UI Framework locally]
  • Update the other examples. This component is used by other components in their examples, so grep the ui_framework directory for other instances in which the KuiButton, KuiLinkButton, and KuiSubmitButton React components are used, and update them with the new prop name.
  • Update the tests. In ui_framework/components/button/button.test.js, on line 37, update the test suite description and the tests themselves to reflect the changes to this prop. Run the tests. The tests will fail, so just follow the command-line instructions for updating them with the new snapshots. Do the same for link_button.test.js and submit_button.test.js.
  • Update the tests to assert that the "type" HTML attribute is supported. In that same file, for the test on line 21, add type="submit" as an attribute, make sure it gets rendered in the snapshot, and update the test. Do the same for link_button.test.js and submit_button.test.js.
  • Update production code dependents. Grep the Kibana and X-Pack codebases for instances in which the KuiButton, KuiLinkButton, and KuiSubmitButton React components are used, and update them with the new prop name.
@cjcenizal cjcenizal added Team:Platform-Design Team Label for Kibana Design Team. Support the Analyze group of plugins. release_note:enhancement labels May 17, 2017
@cjcenizal cjcenizal self-assigned this May 17, 2017
@cjcenizal
Copy link
Contributor Author

CC @nreese

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release_note:enhancement Team:Platform-Design Team Label for Kibana Design Team. Support the Analyze group of plugins.
Projects
None yet
Development

No branches or pull requests

2 participants