Added theme descriptions in the Admin UI

Closes #45909

Signed-off-by: Benjamin DeWeese <bdeweesevans@gmail.com>
Signed-off-by: Alexander Schwartz <alexander.schwartz@ibm.com>
Co-authored-by: Alexander Schwartz <alexander.schwartz@ibm.com>
This commit is contained in:
Benjamin DeWeese 2026-02-10 16:42:09 -05:00 committed by GitHub
parent d6e112fd85
commit 67bbdf3dd2
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
13 changed files with 48 additions and 2 deletions

View file

@ -27,6 +27,7 @@ public class ThemeInfoRepresentation {
private String name;
private String[] locales;
private String description;
public String getName() {
return name;
@ -43,4 +44,12 @@ public class ThemeInfoRepresentation {
public void setLocales(String[] locales) {
this.locales = locales;
}
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description;
}
}

View file

@ -2,5 +2,7 @@ parent=base
deprecatedMode=false
darkMode=true
description=Refined, v3 is more cohesive and dynamic. (Default for Account)
kcDarkModeClass=pf-v5-theme-dark
contentHashPattern=assets/.*

View file

@ -1,5 +1,7 @@
parent=base
darkMode=true
description=Cleaner and more modern, v2 supports automatic light/dark mode switching. (Default for Admin)
kcDarkModeClass=pf-v5-theme-dark
contentHashPattern=assets/.*

View file

@ -57,6 +57,7 @@ export const ThemeSettingsTab = ({ realm, save }: ThemeSettingsTabProps) => {
themeTypes.login.map((theme) => ({
key: theme.name,
value: theme.name,
description: theme.description,
})),
)}
/>
@ -71,6 +72,7 @@ export const ThemeSettingsTab = ({ realm, save }: ThemeSettingsTabProps) => {
themeTypes.account.map((theme) => ({
key: theme.name,
value: theme.name,
description: theme.description,
})),
)}
/>
@ -85,6 +87,7 @@ export const ThemeSettingsTab = ({ realm, save }: ThemeSettingsTabProps) => {
themeTypes.admin.map((theme) => ({
key: theme.name,
value: theme.name,
description: theme.description,
})),
)}
/>
@ -99,6 +102,7 @@ export const ThemeSettingsTab = ({ realm, save }: ThemeSettingsTabProps) => {
themeTypes.email.map((theme) => ({
key: theme.name,
value: theme.name,
description: theme.description,
})),
)}
/>

View file

@ -32,6 +32,7 @@ export interface ServerInfoRepresentation {
export interface ThemeInfoRepresentation {
name: string;
locales?: string[];
description?: string;
}
export interface SpiInfoRepresentation {

View file

@ -19,6 +19,7 @@ export enum SelectVariant {
export type SelectControlOption = {
key: string;
value: string;
description?: string;
};
export type OptionType = string[] | SelectControlOption[];

View file

@ -108,7 +108,15 @@ export const SingleSelectControl = <
>
<SelectList data-testid={`select-${name}`}>
{[...options, ...selectedOptions].map((option) => (
<SelectOption key={key(option)} value={key(option)}>
<SelectOption
key={key(option)}
value={key(option)}
description={
!isString(option) && "description" in option
? option.description
: undefined
}
>
{isString(option) ? option : option.value}
</SelectOption>
))}

View file

@ -304,6 +304,11 @@ export const TypeaheadSelectControl = <
value={key(option)}
isFocused={focusedItemIndex === index}
isActive={field.value.includes(getValue(option))}
description={
!isString(option) && "description" in option
? option.description
: undefined
}
>
{getValue(option)}
</SelectOption>

View file

@ -249,6 +249,8 @@ public class ServerInfoAdminResource {
ti.setLocales(locales.replaceAll(" ", "").split(","));
}
ti.setDescription(getThemeDescription(theme));
themes.add(ti);
}
} catch (IOException e) {
@ -258,6 +260,10 @@ public class ServerInfoAdminResource {
}
}
private String getThemeDescription(Theme theme) throws IOException {
return theme.getProperties().getProperty("description");
}
private LinkedList<String> filterThemes(Theme.Type type, LinkedList<String> themeNames) {
LinkedList<String> filteredNames = new LinkedList<>(themeNames);
boolean filterAdminV2 = (type == Theme.Type.ADMIN) &&

View file

@ -1,6 +1,8 @@
parent=base
import=common/keycloak
description=Cleaner and more modern, v2 supports automatic light/dark mode switching. (Default for Login)
styles=css/styles.css
stylesCommon=vendor/patternfly-v5/patternfly.min.css vendor/patternfly-v5/patternfly-addons.css

View file

@ -1 +1,3 @@
parent=base
parent=base
description=High contrast, sharp, utilitarian, basic. (Default for Email)

View file

@ -1,6 +1,8 @@
parent=base
import=common/keycloak
description=High contrast, sharp, utilitarian, basic.
styles=css/login.css
stylesCommon=vendor/patternfly-v4/patternfly.min.css vendor/patternfly-v3/css/patternfly.min.css vendor/patternfly-v3/css/patternfly-additions.min.css lib/pficon/pficon.css

View file

@ -1,5 +1,7 @@
import=common/keycloak
description=High contrast, sharp, utilitarian, basic.
stylesCommon=vendor/patternfly-v5/patternfly.min.css vendor/patternfly-v5/patternfly-addons.css
styles=css/welcome.css