Skip to content

feat: add configurable global UI banner visibility setting - #12

Open
lucas4790 wants to merge 1 commit into
SonarSource:masterfrom
lucas4790:feat/configurable-banner-visibility
Open

feat: add configurable global UI banner visibility setting#12
lucas4790 wants to merge 1 commit into
SonarSource:masterfrom
lucas4790:feat/configurable-banner-visibility

Conversation

@lucas4790

@lucas4790 lucas4790 commented May 27, 2026

Copy link
Copy Markdown

What problem does this solve?

Administrators have no way to control who sees global update/upgrade notification banners. This adds a configurable setting to give admins that control.

What does this change?

Adds a new setting sonar.ui.banners.visibility that controls who sees global update/upgrade notification banners.

Value Behaviour
ALL All logged-in users see update/upgrade banners
ADMINS_ONLY (default) Only users with global Admin permission see banners
DISABLED No users see banners, and the system upgrades API call is skipped entirely

Files changed

  • libs/sq-server-commons/src/types/settings.ts — adds BannersVisibility to GlobalSettingKeys
  • apps/sq-server/src/main/js/app/components/update-notification/UpdateNotification.tsx — reads the setting and gates visibility accordingly
  • apps/sq-server/src/main/js/app/components/__tests__/UpdateNotification-it.tsx — adds tests covering all three modes

Note: The backend counterpart (property registration in CorePropertyDefinitions and exposure via api/navigation/global) is in a separate PR against the sonarqube repository.

Add a new setting sonar.ui.banners.visibility that controls who sees
global update/upgrade notification banners.

- ALL (default): all logged-in users see banners
- ADMINS_ONLY: only users with global Admin permission see banners
- DISABLED: no users see banners

The setting is read from appState.settings and gates the
UpdateNotification component. When DISABLED, the system upgrades
API call is also skipped entirely.
@lucas4790
lucas4790 force-pushed the feat/configurable-banner-visibility branch from aae68bc to 9f857a6 Compare May 27, 2026 08:50
@gitar-bot

gitar-bot Bot commented May 27, 2026

Copy link
Copy Markdown
Code Review ✅ Approved 1 resolved / 1 findings

Implements the sonar.ui.banners.visibility setting to control global notification banner access for administrators. The default 'ALL' fallback maintains existing behavior for non-admin users, and no issues were found.

✅ 1 resolved
Bug: Default fallback 'ALL' changes existing behavior for non-admin users

📄 apps/sq-server/src/main/js/app/components/update-notification/UpdateNotification.tsx:43
The previous code only showed update/upgrade banners to logged-in admins. With the fallback ?? 'ALL' on line 43, if the backend setting (sonar.ui.banners.visibility) is not yet deployed or not included in the appState.settings response, the value will be undefined and default to 'ALL'. This means all logged-in users will start seeing update banners immediately — a behavioral regression during the rollout window when the frontend is deployed before the backend counterpart.

Consider defaulting to 'ADMINS_ONLY' to preserve backward compatibility until the backend explicitly provides the setting:

const visibility = appState.settings[GlobalSettingKeys.BannersVisibility] ?? 'ADMINS_ONLY';

Alternatively, coordinate deployment so the backend property is guaranteed to be present before this frontend change ships.

Options

Auto-apply is off → Gitar will not commit updates to this branch.
Display: compact → Showing less information.

Comment with these commands to change:

Auto-apply Compact
gitar auto-apply:on         
gitar display:verbose         

Was this helpful? React with 👍 / 👎 | Gitar

@matteo-mara-sonarsource

Copy link
Copy Markdown
Contributor

The associated PR on the sonarqube repository was closed since it does not match with the PM roadmap.

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.

3 participants