Skip to content

Dynamic banner#3218

Open
osamasayed wants to merge 2 commits intoproductionfrom
dynamic-banner
Open

Dynamic banner#3218
osamasayed wants to merge 2 commits intoproductionfrom
dynamic-banner

Conversation

@osamasayed
Copy link
Member

Closes #QF-4818

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: cee94521ae

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR implements a dynamic banner system for the navbar that allows configurable announcements to be fetched from a backend API. The banner content, CTA text, and CTA URL can now be controlled dynamically rather than being hardcoded in the frontend.

Changes:

  • Added new UI section API integration to fetch dynamic banner content
  • Modified Banner component to support both plain text and HTML content formats
  • Updated proxy caching behavior to preserve upstream cache headers
  • Added comprehensive unit tests for new functionality

Reviewed changes

Copilot reviewed 11 out of 11 changed files in this pull request and generated 7 comments.

Show a summary per file
File Description
vitest.config.ts Added @/tests path alias for better test imports
types/UiSection.ts Defined TypeScript types for UI section API responses
types/ApiResponses.ts Added UiSectionResponse interface for API integration
src/utils/apiPaths.ts Created makeUiSectionUrl function to build UI section API URLs
src/utils/apiPaths.test.ts Added test coverage for makeUiSectionUrl function
src/pages/api/proxy/[...path].ts Removed explicit no-cache headers to allow upstream cache control
src/components/Navbar/NavbarBody/index.tsx Integrated dynamic banner with SWR data fetching and conditional rendering
src/components/Navbar/NavbarBody/index.test.tsx Added comprehensive tests for banner loading, error, and content states
src/components/Banner/Banner.tsx Enhanced Banner to support HTML content and configurable CTA URLs
src/components/Banner/Banner.test.tsx Added tests for CTA rendering and HTML content format
src/api.ts Added getUiSection function to fetch UI section data

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.

2 participants