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

fix: prevent updates to provisioned dashboards to avoid overwriting user modifications #7792

Merged
merged 1 commit into from
Jul 30, 2024

Conversation

klesh
Copy link
Contributor

@klesh klesh commented Jul 30, 2024

Summary

Currently, users may edit the provisioned dashboards and save them to the database, this may look nice but the modification from the user will get overwritten if the dashboards have been changed in the newer version of Apache DevLake during an upgrade.

To address the problem, we came to a conclusion: All provisioned dashboards can be edited but should not be saved, it makes more sense for users to save the edited dashboard as a new one.

This PR achieves the goal by simply forbidding updating the provisioned dashboards according to https://grafana.com/docs/grafana/latest/administration/provisioning/

Screenshots

I tested it on my local machine and it seems to be working as expected:

  1. When users click on the "Save" button, a window pops up instead of saving it to the database
    image
  2. Users may go to dashboard settings and click the "Save as" to make a copy
    image
    image
  3. The provisioned dashboard was updated as expected while the copied one stayed intact
    image
    image

@dosubot dosubot bot added size:XS This PR changes 0-9 lines, ignoring generated files. component/ext This issue or PR relates to external components, such as Grafana needs-cherrypick-v1.0 type/bug This issue is a bug labels Jul 30, 2024
Copy link
Contributor

@abeizn abeizn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@dosubot dosubot bot added the lgtm This PR has been approved by a maintainer label Jul 30, 2024
@abeizn abeizn merged commit 0f799be into main Jul 30, 2024
12 checks passed
@abeizn abeizn deleted the kw-fix-provisioned-dashboards-update branch July 30, 2024 08:13
github-actions bot pushed a commit that referenced this pull request Jul 30, 2024
Copy link
Contributor

🤖 Target: #release-v1.0 cherry pick finished successfully 🎉!

@github-actions github-actions bot added the bot/auto-cherry-pick-completed auto cherry pick completed label Jul 30, 2024
klesh added a commit that referenced this pull request Jul 30, 2024
…ser modifications (#7792) (#7793)

Co-authored-by: Klesh Wong <zhenmian.huang@merico.dev>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bot/auto-cherry-pick-completed auto cherry pick completed component/ext This issue or PR relates to external components, such as Grafana lgtm This PR has been approved by a maintainer needs-cherrypick-v1.0 size:XS This PR changes 0-9 lines, ignoring generated files. type/bug This issue is a bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants