-
Notifications
You must be signed in to change notification settings - Fork 11.6k
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
Datasource: fix a bug where deleting data source will trigger save an… #21300
Conversation
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.
@lzdw thank's for the fix. Looking into the code the problems lies in the fact that both Save & Test and Delete buttons have type submit
. Of course your fix is a correct one but it introduces some complexity. My suggestion is to change the code to use Button
component from grafana/ui instead of plain buttons. grafana/ui button has default type of button
which means that the submit will not happen and the event prevention will not be necessary.
public/app/features/datasources/settings/DataSourceSettingsPage.tsx
Outdated
Show resolved
Hide resolved
0ecb009
to
055b786
Compare
055b786
to
2fa301d
Compare
* origin/master: Build: package all binaries for enterprise (#21381) Datasource: fixes prometheus datasource tests - adds align range CircleCI: Testing upgrade to CircleCI 2.1 (#21374) Storybook: Remove reference to jquery.flot.pie file from storybook config (#21378) Cloudwatch: Fixed crash when switching from cloudwatch data source (#21376) Docs: Added Squadcast notifications (#21372) Chore: upgrade d3 (#21368) Datasource: fix a bug where deleting data source will trigger save and test events (#21300) Forms: revamped select (#21092) Toolkit: add git log info to the plugin build report (#21344)
* grafana/master: TimeZones: fix utc test (#21393) Build: package all binaries for enterprise (#21381) Datasource: fixes prometheus datasource tests - adds align range CircleCI: Testing upgrade to CircleCI 2.1 (#21374) Storybook: Remove reference to jquery.flot.pie file from storybook config (#21378) Cloudwatch: Fixed crash when switching from cloudwatch data source (#21376) Docs: Added Squadcast notifications (#21372) Chore: upgrade d3 (#21368) Datasource: fix a bug where deleting data source will trigger save and test events (#21300) Forms: revamped select (#21092) Toolkit: add git log info to the plugin build report (#21344) Docs: Use https scheme for Grafana playground links (#21360) fix docs links (#21359) AddDatasourcePage: Refactoring & more Phantom plugins (#21261) Chore: Remove empty flot.pie file (#21356) Docs: Fix link (#21358) Docs: Fix InfluxDB templated dashboard link (#21343) Rendering: Fix panel PNG rendering when using sub url & serve_from_sub_path = true (#21306)
…d test events
What this PR does / why we need it:
Fix a bug where deleting data source will trigger save and test events
Which issue(s) this PR fixes:
Fixes #21282
Special notes for your reviewer: