Skip to content

Add support for new variables to the GUI whitelabel runtime system#12760

Open
hsato03 wants to merge 1 commit intoapache:mainfrom
scclouds:gui-whitelabel-new-variables
Open

Add support for new variables to the GUI whitelabel runtime system#12760
hsato03 wants to merge 1 commit intoapache:mainfrom
scclouds:gui-whitelabel-new-variables

Conversation

@hsato03
Copy link
Member

@hsato03 hsato03 commented Mar 6, 2026

Description

Currently, the GUI whitelabel theme management system supports the following variables defined in the jsonConfiguration parameter, following the ACS config.json file standard:

Current Variables
  • appTitle
  • favicon
  • footer
  • loginFooter
  • logo
  • minilogo
  • banner
  • error.403
  • error.404
  • error.500
  • plugins

This PR aims to add the following variables, which can be used to facilitate the customization of whitelabel themes.

New Variables
  • apidocs
  • docBase
  • docHelpMappings
  • keyboardOptions
  • keyboardOptions.us
  • keyboardOptions.uk
  • keyboardOptions.fr
  • keyboardOptions.jp
  • keyboardOptions.sc
  • userCard
  • userCard.title
  • userCard.icon
  • userCard.icon.links
  • userCard.icon.links[i].title
  • userCard.icon.links[i].text
  • userCard.icon.links[i].link
  • userCard.icon.links[i].icon
  • theme
  • theme.@layout-mode
  • theme.@logo-background-color
  • theme.@mini-logo-background-color
  • theme.@navigation-background-color
  • theme.@project-nav-background-color
  • theme.@project-nav-text-color
  • theme.@navigation-text-color
  • theme.@primary-color
  • theme.@link-color
  • theme.@link-hover-color
  • theme.@loading-color
  • theme.@processing-color
  • theme.@success-color
  • theme.@warning-color
  • theme.@error-color
  • theme.@font-size-base
  • theme.@heading-color
  • theme.@text-color
  • theme.@text-color-secondary
  • theme.@disabled-color
  • theme.@border-color-base
  • theme.@border-radius-base
  • theme.@box-shadow-base
  • theme.@logo-width
  • theme.@logo-height
  • theme.@mini-logo-width
  • theme.@mini-logo-height
  • theme.@banner-width
  • theme.@banner-height
  • theme.@error-width
  • theme.@error-height

Types of changes

  • Breaking change (fix or feature that would cause existing functionality to change)
  • New feature (non-breaking change which adds functionality)
  • Bug fix (non-breaking change which fixes an issue)
  • Enhancement (improves an existing feature and functionality)
  • Cleanup (Code refactoring and cleanup, that may add test cases)
  • Build/CI
  • Test (unit or integration test code)

Feature/Enhancement Scale or Bug Severity

Feature/Enhancement Scale

  • Major
  • Minor

Bug Severity

  • BLOCKER
  • Critical
  • Major
  • Minor
  • Trivial

Screenshots (if appropriate):

How Has This Been Tested?

I created a GUI theme via CloudMonkey using the new variables and specifying some invalid ones (like invalidKeyboardOption and invalidError).

(local) 👻 > create guitheme jsonconfiguration='{"keyboardOptions":{"us":"americano","uk":"ucraniano","jp":"japones","invalidKeyboardOption":"portugues"},"theme":{"@logo-background-color":"#000000","@mini-logo-background-color":"#000000","@navigation-background-color":"#000000","@navigation-text-color":"#FFFFFF","@link-color":"#9400ff","@link-hover-color":"#10ff00","@loading-color":"#ff0000","@primary-color":"#ff00d0","@processing-color":"#ff0000","@success-color":"#00f2ff","@warning-color":"#003fff","@error-color":"#752929","@font-size-base":"8px","@box-shadow-base":"0 12px 48px rgba(255, 0, 0, 0.8)","@logo-width":"100px","@logo-height":"40px","@mini-logo-width":"40px","@mini-logo-height":"30px","@banner-width":"200px","@banner-height":"40px","@error-width":"400px","@error-height":"300px","@border-color-base":"#a500ff","@text-color":"#ff0000","@text-color-secondary":"#ff0000","@border-radius-base":"16px","@disabled-color":"#ff0000","@project-nav-background-color":"#0000ff","@project-nav-text-color":"#00ff1d","@invalid-theme":"#00ff1d"},"apidocs":false,"docBase":"https://custom.doc/","error":{"404":"https://imgs.search.brave.com/O6r9WBn-9SyyEPclCdqnyMA70azESDiFTWb4yfiZVM4/rs:fit:500:0:0:0/g:ce/aHR0cHM6Ly93d3cu/cGV0ei5jb20uYnIv/YmxvZy93cC1jb250/ZW50L3VwbG9hZHMv/MjAyNS8wMS9jYXBp/dmFyYTItMS1zY2Fs/ZWQuanBn","500":"https://www.petz.com.br/blog/wp-content/uploads/2025/02/capivara-morde-interna1.jpg","invalidError":"https://www.petz.com.br/blog/wp-content/uploads/2025/02/capivara-morde-interna1.jpg"},"docHelpMappings":{"plugins/quota.html#quota-tariff":"tarifas","invalidDoc":"invalido"},"userCard":{"title":"Ayuda","icon":"exclamation-circle-outlined","links":[{"title":"Documentation","text":"Texto customizavel para documentacao","link":"https://custom.doc/","icon":"form-outlined","invalidUserCardLink":"Ayuda"},{"title":"API","text":"Documentação API","link":"https://cloudstack.apache.org/api.html","icon":"api-outlined"},{"title":"Report Issue","text":"Submit a bug or improvement request","link":"https://github.com/apache/cloudstack/issues/new","icon":"bug-outlined"},{"title":"Nova seção","text":"Descrição da nova seção","link":"https://www.petz.com.br/blog/wp-content/uploads/2025/02/capivara-morde-interna1.jpg","icon":"warning-outlined"}],"invalidUserCard":"Ayuda"},"invalida":"invalida"}' name=variables

Next, upon accessing the ACS GUI, I verified that the new variables were rendered correctly.

Furthermore, I verified that the invalid variables were shown in the management server logs and were not considered.

2026-03-06 19:51:17,010 WARN  [o.a.c.g.t.j.c.v.a.ThemeAttribute] (qtp2049051802-20:[ctx-6e73e5e1, ctx-7bac603b]) (logid:7d304f36) The JSON attribute [@invalid-theme] is not a valid option, therefore, it will be ignored.
2026-03-06 19:51:17,017 WARN  [o.a.c.g.t.j.c.v.a.ErrorAttribute] (qtp2049051802-20:[ctx-6e73e5e1, ctx-7bac603b]) (logid:7d304f36) The JSON attribute [invalidError] is not a valid option, therefore, it will be ignored.
2026-03-06 19:51:17,017 WARN  [o.a.c.g.t.j.c.v.a.UserCardAttribute] (qtp2049051802-20:[ctx-6e73e5e1, ctx-7bac603b]) (logid:7d304f36) The JSON attribute [invalidUserCardLink] is not a valid option, therefore, it will be ignored.
2026-03-06 19:51:17,017 WARN  [o.a.c.g.t.j.c.v.a.UserCardAttribute] (qtp2049051802-20:[ctx-6e73e5e1, ctx-7bac603b]) (logid:7d304f36) The JSON attribute [invalidUserCard] is not a valid option, therefore, it will be ignored.
2026-03-06 19:51:17,017 WARN  [o.a.c.g.t.j.c.v.JsonConfigValidator] (qtp2049051802-20:[ctx-6e73e5e1, ctx-7bac603b]) (logid:7d304f36) The JSON attribute [invalida] is not a valid option, therefore, it will be ignored.

How did you try to break this feature and the system with this change?

@hsato03
Copy link
Member Author

hsato03 commented Mar 6, 2026

@blueorangutan package

@blueorangutan
Copy link

@hsato03 a [SL] Jenkins job has been kicked to build packages. It will be bundled with no SystemVM templates. I'll keep you posted as I make progress.

@codecov
Copy link

codecov bot commented Mar 6, 2026

Codecov Report

❌ Patch coverage is 0% with 123 lines in your changes missing coverage. Please review.
✅ Project coverage is 17.92%. Comparing base (7ad68aa) to head (6c9bc4c).

Files with missing lines Patch % Lines
...config/validator/attributes/UserCardAttribute.java 0.00% 35 Missing ⚠️
...eme/json/config/validator/JsonConfigValidator.java 0.00% 27 Missing ⚠️
...son/config/validator/attributes/AttributeBase.java 0.00% 25 Missing ⚠️
.../config/validator/attributes/PluginsAttribute.java 0.00% 21 Missing ⚠️
...on/config/validator/attributes/ErrorAttribute.java 0.00% 7 Missing ⚠️
...on/config/validator/attributes/ThemeAttribute.java 0.00% 7 Missing ⚠️
...ache/cloudstack/gui/theme/GuiThemeServiceImpl.java 0.00% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##               main   #12760      +/-   ##
============================================
- Coverage     17.92%   17.92%   -0.01%     
- Complexity    16156    16161       +5     
============================================
  Files          5939     5945       +6     
  Lines        533192   533266      +74     
  Branches      65239    65244       +5     
============================================
+ Hits          95591    95604      +13     
- Misses       426859   426919      +60     
- Partials      10742    10743       +1     
Flag Coverage Δ
uitests 3.66% <ø> (-0.01%) ⬇️
unittests 19.03% <0.00%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@blueorangutan
Copy link

Packaging result [SF]: ✔️ el8 ✔️ el9 ✔️ el10 ✔️ debian ✔️ suse15. SL-JID 17027

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants