Skip to content

Conversation

@sudo87
Copy link
Collaborator

@sudo87 sudo87 commented Jun 4, 2025

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: apache/cloudstack-documentation#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)
  • 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):

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.

@codecov
Copy link

codecov bot commented Jun 4, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 16.57%. Comparing base (2d669db) to head (106757e).
⚠️ 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%) ⬇️
unittests 17.47% <ø> (-0.03%) ⬇️

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.

@sudo87 sudo87 marked this pull request as ready for review June 4, 2025 11:33
@sudo87 sudo87 requested a review from vishesh92 June 5, 2025 06:00
@sudo87
Copy link
Collaborator Author

sudo87 commented Jun 5, 2025

@blueorangutan ui

@blueorangutan
Copy link

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

@blueorangutan
Copy link

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

@sudo87
Copy link
Collaborator Author

sudo87 commented Jun 5, 2025

@blueorangutan package

@blueorangutan
Copy link

@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
Copy link

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

Copy link
Contributor

@shwstppr shwstppr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

code lgtm

@sudo87 can you please add some documentation regarding this, probably somewhere https://github.com/apache/cloudstack-documentation/blob/main/source/adminguide/ui.rst

Copy link
Member

@rohityadavcloud rohityadavcloud left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The floating banner hides the content behind it. I think it should instead be part of the page view/frame (or top global header component) & push the entire UI content down. See the banner on https://apisix.apache.org/ or https://docusaurus.io/ for example, where the announcement banner is pushing the entire content down, not floating on the UI.

The a-alert Ant Design Vue — An enterprise-class UI components based on Ant Design and Vue.js could be used, or a new component could be created.

@sudo87
Copy link
Collaborator Author

sudo87 commented Jun 9, 2025

@blueorangutan package

@blueorangutan
Copy link

@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
Copy link

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

@sudo87 sudo87 requested a review from rohityadavcloud June 10, 2025 09:29
@shwstppr
Copy link
Contributor

@blueorangutan ui

@blueorangutan
Copy link

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

@blueorangutan
Copy link

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

Copy link
Contributor

@shwstppr shwstppr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

image

@github-actions
Copy link

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

@vishesh92
Copy link
Member

@blueorangutan package

@blueorangutan
Copy link

@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
Copy link

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

@vishesh92
Copy link
Member

@blueorangutan package
@blueorangutan ui

@blueorangutan
Copy link

@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
Copy link

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

@blueorangutan
Copy link

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

@blueorangutan
Copy link

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

Copy link
Member

@vishesh92 vishesh92 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm. tested locally. works as expected.

Copy link
Contributor

@harikrishna-patnala harikrishna-patnala left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@vladimirpetrov
Copy link
Contributor

@blueorangutan package

@blueorangutan
Copy link

@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
Copy link

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

@sudo87
Copy link
Collaborator Author

sudo87 commented Jul 3, 2025

@blueorangutan package

@blueorangutan
Copy link

@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
Copy link

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

Copy link
Collaborator

@rosi-shapeblue rosi-shapeblue left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Verification passed.

@rohityadavcloud
Copy link
Member

LGTM, thanks.

@rohityadavcloud rohityadavcloud merged commit 8e4fe1c into apache:main Jul 7, 2025
25 of 26 checks passed
dhslove pushed a commit to ablecloud-team/ablestack-cloud that referenced this pull request Jul 16, 2025
* Allow configuring Announcement banner by admin

* add license

* revert un-necessary changes from package-lock.json

* banner should use 100% width and push down content down

* fix grey area issue

* show error page if config.json is not valid
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

No open projects
Status: Done

Development

Successfully merging this pull request may close these issues.

10 participants