cloudstack icon indicating copy to clipboard operation
cloudstack copied to clipboard

Allow configuring Announcement banner by admin

Open sudo87 opened this issue 6 months ago • 23 comments

Description

This PR enables Admin to configure UI Announcement banner containing message through config.json. HTML based message is supported apart from regular text

It can be configured by defining following section in config.json:

"announcementBanner": {
    "enabled": true,
    "showIcon": true,
    "closable": true,
    "persistDismissal": true,
    "type": "warning",
    "message": "<strong>Performance Notice:</strong> We're experiencing high load. Some operations may be slower than usual.",
    "startDate": "2025-06-01T00:00:00Z",
    "endDate": "2025-07-16T00:00:00Z"
}

Following types are supported:

  1. info
  2. warning
  3. error

To ensure banner is shown only once, enable the following config:

persistDismissal: true

Doc PR: https://github.com/apache/cloudstack-documentation/pull/517

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)
  • [x] 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
  • [x] Minor
  • [ ] Trivial

Screenshots (if appropriate):

Screenshot from 2025-06-09 17-57-49 Screenshot from 2025-06-09 17-56-57 Screenshot from 2025-06-09 17-56-12 Screenshot from 2025-06-09 17-38-44

How Has This Been Tested?

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

New npm dep (dompurify) is included to sanitize the html.

sudo87 avatar Jun 04 '25 09:06 sudo87

Codecov Report

:white_check_mark: All modified and coverable lines are covered by tests. :white_check_mark: Project coverage is 16.57%. Comparing base (2d669db) to head (106757e). :warning: Report is 225 commits behind head on main.

Additional details and impacted files
@@             Coverage Diff              @@
##               main   #10951      +/-   ##
============================================
- Coverage     16.60%   16.57%   -0.04%     
- Complexity    13924    13969      +45     
============================================
  Files          5730     5744      +14     
  Lines        508082   510698    +2616     
  Branches      61770    62118     +348     
============================================
+ Hits          84388    84647     +259     
- Misses       414259   416580    +2321     
- Partials       9435     9471      +36     
Flag Coverage Δ
uitests 3.90% <ø> (-0.04%) :arrow_down:
unittests 17.47% <ø> (-0.03%) :arrow_down:

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

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

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

codecov[bot] avatar Jun 04 '25 09:06 codecov[bot]

@blueorangutan ui

sudo87 avatar Jun 05 '25 06:06 sudo87

@sudo87 a Jenkins job has been kicked to build UI QA env. I'll keep you posted as I make progress.

blueorangutan avatar Jun 05 '25 06:06 blueorangutan

UI build: :heavy_check_mark: Live QA URL: https://qa.cloudstack.cloud/simulator/pr/10951 (QA-JID-637)

blueorangutan avatar Jun 05 '25 07:06 blueorangutan

@blueorangutan package

sudo87 avatar Jun 05 '25 11:06 sudo87

@sudo87 a [SL] Jenkins job has been kicked to build packages. It will be bundled with KVM, XenServer and VMware SystemVM templates. I'll keep you posted as I make progress.

blueorangutan avatar Jun 05 '25 11:06 blueorangutan

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

blueorangutan avatar Jun 05 '25 13:06 blueorangutan

@blueorangutan package

sudo87 avatar Jun 09 '25 13:06 sudo87

@sudo87 a [SL] Jenkins job has been kicked to build packages. It will be bundled with KVM, XenServer and VMware SystemVM templates. I'll keep you posted as I make progress.

blueorangutan avatar Jun 09 '25 13:06 blueorangutan

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

blueorangutan avatar Jun 09 '25 14:06 blueorangutan

@blueorangutan ui

shwstppr avatar Jun 11 '25 06:06 shwstppr

@shwstppr a Jenkins job has been kicked to build UI QA env. I'll keep you posted as I make progress.

blueorangutan avatar Jun 11 '25 06:06 blueorangutan

UI build: :heavy_check_mark: Live QA URL: https://qa.cloudstack.cloud/simulator/pr/10951 (QA-JID-643)

blueorangutan avatar Jun 11 '25 06:06 blueorangutan

@sudo87 Found an issue. When the banner is not closed,

  1. Open a list view (e.g. projects) or details page (e.g. Public IP Address)
  2. On scrolling down, there is a gray area on top. image

vishesh92 avatar Jun 11 '25 10:06 vishesh92

This pull request has merge conflicts. Dear author, please fix the conflicts and sync your branch with the base branch.

github-actions[bot] avatar Jun 12 '25 07:06 github-actions[bot]

@blueorangutan package

vishesh92 avatar Jun 12 '25 08:06 vishesh92

@vishesh92 a [SL] Jenkins job has been kicked to build packages. It will be bundled with KVM, XenServer and VMware SystemVM templates. I'll keep you posted as I make progress.

blueorangutan avatar Jun 12 '25 08:06 blueorangutan

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

blueorangutan avatar Jun 12 '25 10:06 blueorangutan

@blueorangutan package @blueorangutan ui

vishesh92 avatar Jun 12 '25 10:06 vishesh92

@vishesh92 a [SL] Jenkins job has been kicked to build packages. It will be bundled with@blueorangutan ui SystemVM template(s). I'll keep you posted as I make progress.

blueorangutan avatar Jun 12 '25 10:06 blueorangutan

@vishesh92 a Jenkins job has been kicked to build UI QA env. I'll keep you posted as I make progress.

blueorangutan avatar Jun 12 '25 10:06 blueorangutan

UI build: :heavy_check_mark: Live QA URL: https://qa.cloudstack.cloud/simulator/pr/10951 (QA-JID-646)

blueorangutan avatar Jun 12 '25 11:06 blueorangutan

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

blueorangutan avatar Jun 12 '25 11:06 blueorangutan

@blueorangutan package

vladimirpetrov avatar Jun 27 '25 15:06 vladimirpetrov

@vladimirpetrov a [SL] Jenkins job has been kicked to build packages. It will be bundled with KVM, XenServer and VMware SystemVM templates. I'll keep you posted as I make progress.

blueorangutan avatar Jun 27 '25 15:06 blueorangutan

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

blueorangutan avatar Jun 27 '25 18:06 blueorangutan

@blueorangutan package

sudo87 avatar Jul 03 '25 08:07 sudo87

@sudo87 a [SL] Jenkins job has been kicked to build packages. It will be bundled with KVM, XenServer and VMware SystemVM templates. I'll keep you posted as I make progress.

blueorangutan avatar Jul 03 '25 08:07 blueorangutan

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

blueorangutan avatar Jul 03 '25 11:07 blueorangutan

LGTM, thanks.

rohityadavcloud avatar Jul 07 '25 08:07 rohityadavcloud