-
Notifications
You must be signed in to change notification settings - Fork 11.8k
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
Dashboards: It always detect changes when saving an existing dashboard #76116
Conversation
5d36b36
to
4ee00d0
Compare
Hello @ivanortegaalba!
Please, if the current pull request addresses a bug fix, label it with the |
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.
tried opening a bunch of old dashboards and seems to not crash :)
The backport to
To backport manually, run these commands in your terminal: # Fetch latest updates from GitHub
git fetch
# Create a new branch
git switch --create backport-76116-to-v9.5.x origin/v9.5.x
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x 1a96f3742f84284e64f48fb52f0ef6a78dad1ac0
# When the conflicts are resolved, stage and commit the changes
git add . && git cherry-pick --continue If you have the GitHub CLI installed: # Push the branch to GitHub:
git push --set-upstream origin backport-76116-to-v9.5.x
# Create the PR body template
PR_BODY=$(gh pr view 76116 --json body --template 'Backport 1a96f3742f84284e64f48fb52f0ef6a78dad1ac0 from #76116{{ "\n\n---\n\n" }}{{ index . "body" }}')
# Create the PR on GitHub
echo "${PR_BODY}" | gh pr create --title "[v9.5.x] Dashboards: It always detect changes when saving an existing dashboard " --body-file - --label "type/bug" --label "area/frontend" --label "add to changelog" --label "backport" --base v9.5.x --milestone 9.5.x --web Or, if you don't have the GitHub CLI installed (we recommend you install it!): # Push the branch to GitHub:
git push --set-upstream origin backport-76116-to-v9.5.x
# Create a pull request where the `base` branch is `v9.5.x` and the `compare`/`head` branch is `backport-76116-to-v9.5.x`.
# Remove the local backport branch
git switch main
git branch -D backport-76116-to-v9.5.x |
The backport to
To backport manually, run these commands in your terminal: # Fetch latest updates from GitHub
git fetch
# Create a new branch
git switch --create backport-76116-to-v10.1.x origin/v10.1.x
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x 1a96f3742f84284e64f48fb52f0ef6a78dad1ac0
# When the conflicts are resolved, stage and commit the changes
git add . && git cherry-pick --continue If you have the GitHub CLI installed: # Push the branch to GitHub:
git push --set-upstream origin backport-76116-to-v10.1.x
# Create the PR body template
PR_BODY=$(gh pr view 76116 --json body --template 'Backport 1a96f3742f84284e64f48fb52f0ef6a78dad1ac0 from #76116{{ "\n\n---\n\n" }}{{ index . "body" }}')
# Create the PR on GitHub
echo "${PR_BODY}" | gh pr create --title "[v10.1.x] Dashboards: It always detect changes when saving an existing dashboard " --body-file - --label "type/bug" --label "area/frontend" --label "add to changelog" --label "backport" --base v10.1.x --milestone 10.1.x --web Or, if you don't have the GitHub CLI installed (we recommend you install it!): # Push the branch to GitHub:
git push --set-upstream origin backport-76116-to-v10.1.x
# Create a pull request where the `base` branch is `v10.1.x` and the `compare`/`head` branch is `backport-76116-to-v10.1.x`.
# Remove the local backport branch
git switch main
git branch -D backport-76116-to-v10.1.x |
Problem
No matter if you make changes in a dashboard, it always contains changes.
The issue seems to be the mutation of the values of the model that they still point to the original object passed as data to DashboardModel. So, during the initDashboard, the
this.originalDashboard
is modified because the assigned object to the different Model props shares the object reference.Solution
Clone the original object stored in
originalDashboard
to avoid this issue in the future by accidental mutations.How to test it: