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

UiSession: fix theme initialization #1001

Merged

Conversation

bschwarzent
Copy link
Member

  • URL param (?theme=xyz) always takes precedence over the current theme
  • Otherwise, if the model already has a theme set, use that one.
  • Otherwise, use the "current theme" from the request (session attribute, cookie or default value).

A warning is only logged when the requested theme or the model theme is set but is not valid according to UiThemeHelper. When the model does not specify a theme, a default theme is assigned automatically without log message.

When the theme is determined, it is written back to the model, so the logo URL and potentially other things can be adjusted.

In Scout JS, we have no UiSession or ClientSession. For a similar functionality, the URL param is manually compared with the current theme (called "active theme").

270127

@bschwarzent bschwarzent self-assigned this May 8, 2024
@bschwarzent bschwarzent force-pushed the features/bschwarzent/24.2/270127_init_ui_theme branch from 22a8c00 to 9989bbe Compare May 10, 2024 06:46
@fschinkel fschinkel self-requested a review May 14, 2024 07:50
@bschwarzent bschwarzent force-pushed the features/bschwarzent/24.2/270127_init_ui_theme branch from 9989bbe to c809521 Compare May 14, 2024 14:41
- URL param (?theme=xyz) always takes precedence over the current theme
- Otherwise, if the model already has a theme set, use that one.
- Otherwise, use the "current theme" from the request (session
  attribute, cookie or default value).

A warning is only logged when the requested theme or the model theme is
set but is not valid according to UiThemeHelper. When the model does not
specify a theme, a default theme is assigned automatically without log
message.

When the theme is determined, it is written back to the model, so the
logo URL and potentially other things can be adjusted.

In Scout JS, we have no UiSession or ClientSession. For a similar
functionality, the URL param is manually compared with the current
theme (called "active theme").

270127
@bschwarzent bschwarzent force-pushed the features/bschwarzent/24.2/270127_init_ui_theme branch from c809521 to ab45107 Compare May 21, 2024 15:03
@bschwarzent bschwarzent merged commit ef728e2 into releases/24.2 May 21, 2024
2 checks passed
@bschwarzent bschwarzent deleted the features/bschwarzent/24.2/270127_init_ui_theme branch May 21, 2024 16:31
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.

None yet

2 participants