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

Datasource: fix a bug where deleting data source will trigger save an… #21300

Merged
merged 1 commit into from
Jan 7, 2020

Conversation

lzdw
Copy link
Contributor

@lzdw lzdw commented Dec 31, 2019

…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:

Copy link
Member

@dprokop dprokop left a 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.

@dprokop dprokop added this to In Review in Frontend Platform Backlog via automation Jan 2, 2020
@dprokop dprokop requested review from a team, torkelo and peterholmberg and removed request for a team and torkelo January 2, 2020 10:04
@torkelo torkelo merged commit ee77e1a into grafana:master Jan 7, 2020
Frontend Platform Backlog automation moved this from In Review to Done Jan 7, 2020
ryantxu added a commit that referenced this pull request Jan 7, 2020
* 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)
ryantxu added a commit that referenced this pull request Jan 8, 2020
* 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)
@ying-jeanne ying-jeanne added the pr/external This PR is from external contributor label Apr 29, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Deleting datasource will trigger save and test events
4 participants