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(templates): preserve cell colors on export/import #19700

Merged
merged 1 commit into from
Oct 7, 2020
Merged

Conversation

glinton
Copy link
Contributor

@glinton glinton commented Oct 7, 2020

Closes #19441

Something relies on the ID of the cell's color to be set (seems like "base" is a common id). This PR preserves that color ID accross import/export so one can now export and re-import a dashboard and any custom colors in cells should go unchanged.

@glinton glinton requested a review from a team October 7, 2020 19:45
@glinton glinton requested a review from a team as a code owner October 7, 2020 19:45
@glinton glinton requested review from hoorayimhelping, a team and kristinarobinson and removed request for a team and hoorayimhelping October 7, 2020 19:45
Copy link
Contributor

@asalem1 asalem1 left a comment

Choose a reason for hiding this comment

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

Quick question. Also, should the swagger file be updated with this?

@@ -977,6 +977,7 @@ const (
)

type color struct {
ID string `json:"id,omitempty" yaml:"id,omitempty"`
Copy link
Contributor

Choose a reason for hiding this comment

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

just checking that there shouldn't be a situation where the ID would empty / 0, right?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

swagger shouldn't need to be updated as this is only preserving the already present color id. it was previously getting dropped and it appears the ui relies on it (no console errors though) to be set to show that color (it's been base in every dashboard i looked at).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

if it is empty, it would be when applying an old export where the id was not set with the color information. the color would still appear broken because i didn't default empty id's to "base", but if the user fixes the color and re-exports, the color would be preserved by this change.

@glinton glinton merged commit 6219adc into master Oct 7, 2020
@glinton glinton deleted the fix/19441 branch October 7, 2020 20:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

UI cell configuration incomplete in template with CLI export/import
2 participants