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

[FLI-538] feat: add an ENV variable to default theme #1952

Closed
markphelps opened this issue Aug 4, 2023 · 2 comments · Fixed by #2062
Closed

[FLI-538] feat: add an ENV variable to default theme #1952

markphelps opened this issue Aug 4, 2023 · 2 comments · Fixed by #2062

Comments

@markphelps
Copy link
Collaborator

markphelps commented Aug 4, 2023

          Would it make sense to add an ENV variable to force a specific theme for everyone?

Originally posted by @gaby in #1933 (comment)

FLI-538

@markphelps markphelps changed the title feat: add an ENV variable to default theme [FLI-538] feat: add an ENV variable to default theme Aug 4, 2023
@markphelps
Copy link
Collaborator Author

This would be a good first issue for anyone interested in implementing

I think it would require the following changes:

  1. Add a field here ui.default_theme
    Enabled bool `json:"enabled" mapstructure:"enabled"`
    with enum options of system, dark, light
  2. Populate the local storage item (
    localStorage.getItem(preferencesKey) || '{}'
    ) from this selector https:/flipt-io/flipt/blob/4a8352ae9bb4d854d4e04022ccbba5dd99f4553a/ui/src/app/meta/metaSlice.ts#L51C17-L51C17 for `theme.

The flow would be:

  1. Flipt UI reads the ui.default_theme property from the JSON response of the /config endpoint call
  2. Flipt UI sets that value in localstorage if it doesn't exist, which then the UI will use as the default theme

@Jamess-Lucass
Copy link
Contributor

I'd be interested in taking this one to get acquainted with the repo.

@markphelps markphelps linked a pull request Aug 31, 2023 that will close this issue
@markphelps markphelps added this to the v.24 milestone Aug 31, 2023
@markphelps markphelps removed this from the v.24 milestone Dec 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants