Skip to content
This repository has been archived by the owner on Jan 15, 2024. It is now read-only.

Add omitempty to Preferences theme #170

Merged
merged 1 commit into from
Nov 8, 2023
Merged

Add omitempty to Preferences theme #170

merged 1 commit into from
Nov 8, 2023

Conversation

jaehnri
Copy link
Contributor

@jaehnri jaehnri commented Nov 7, 2023

Right now, the theme attribute from Preferences does not have omitempty. That way, whenever it gets marshaled to JSON, the JSON body receives a "theme": "".

This makes it impossible to use the Grafana Preferences PATCH endpoint without specifying/updating theme because Grafana validates if the given theme is valid, as it is not null:
https://github.com/grafana/grafana/blob/1d38edc483570e4767a6ef1800dfdc1b576838c1/pkg/api/preferences.go#L124-L127

@CLAassistant
Copy link

CLAassistant commented Nov 7, 2023

CLA assistant check
All committers have signed the CLA.

@jaehnri
Copy link
Contributor Author

jaehnri commented Nov 8, 2023

@inkel, could you review it, please? Thanks! LMK if I should ask someone else.

Copy link
Contributor

@inkel inkel left a comment

Choose a reason for hiding this comment

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

Good catch! Thank you.

@inkel
Copy link
Contributor

inkel commented Nov 8, 2023

@jaehnri I've rebased the branch with latest master but now CI is failing, could you fetch the changes on your end (git pull --rebase) and re-push? Thanks.

Signed-off-by: João Henri <joao.henri@suse.com>
@jaehnri
Copy link
Contributor Author

jaehnri commented Nov 8, 2023

@inkel, it should be properly rebased now.

@inkel inkel merged commit 40fb537 into grafana:master Nov 8, 2023
2 checks passed
@inkel
Copy link
Contributor

inkel commented Nov 8, 2023

Thank you for your contribution!

@jaehnri
Copy link
Contributor Author

jaehnri commented Nov 20, 2023

Hi, @inkel! I hope you're doing well.
Are there any plans for a new release with this fix? Thanks!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
3 participants