-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Add type='button' to buttons in system console, to prevent unintentional button clicks #6600
Conversation
@outofgamut thanks for contributing! |
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.
Hey! Code looks good to me. Just small changes to styling otherwise all else looks good to me.
Lets make the styling of the code consistent across the code. You make also want to run a make check-style
to fix the linting error that the CI build is showing below.
components/admin_console/admin_sidebar_header/admin_sidebar_header.tsx
Outdated
Show resolved
Hide resolved
Co-authored-by: Hossein Ahmadian-Yazdi <[email protected]>
@hahmadia Thanks for the feedback! It looks like the tests are failing. Anything I need to do on my end to update those snapshots? |
@outofgamut |
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.
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.
Looks good, thanks for the great work @outofgamut!!
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.
Looks good to me. I didn't know that <button>
elements were treated as submit buttons by default, so that's good to know for the future.
/update-branch |
Repro steps can be found in the issue's description. The test will need to be run on every page of the system console that has a button within its form, such as the One side effect of this change is that pressing |
@mickmister Heads up that there is a merge conflict to resolve |
/update-branch |
Error trying to update the PR. |
@mickmister |
/update-branch |
@hahmadia I've put some qa test steps in the Jira ticket https://mattermost.atlassian.net/browse/MM-29178 Feel free to ask me any questions |
Thank you for the test steps @hahmadia and @mickmister! I tested the said form in the environment/web_server page as well as a couple other forms in admin console that I could recognize. |
@prapti I don't think it would break them, as we are just adding an attribute to the buttons. I'd be very surprised if any existing document element queries in the cypress tests are affected. The only tests I can think would be affected are snapshot tests, which have been updated in this PR. |
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.
Thank you for confirming Michael!
Thank you for this contribution @outofgamut! Looks great 🎉
Test server destroyed |
Summary
Add types to buttons in admin_console, so that actions are not unintentionally triggered.
Ticket Link
mattermost/mattermost#15682
Jira ticket: https://mattermost.atlassian.net/browse/MM-29178
Related Pull Requests
None
Screenshots
None