Skip to content

WS-2081 - Render navigation items from API#13652

Merged
holchris merged 13 commits intolatestfrom
WS-2081-use-navitems-from-props
Feb 3, 2026
Merged

WS-2081 - Render navigation items from API#13652
holchris merged 13 commits intolatestfrom
WS-2081-use-navitems-from-props

Conversation

@amoore108
Copy link
Contributor

@amoore108 amoore108 commented Jan 27, 2026

Resolves JIRA: https://bbc.atlassian.net/browse/WS-2081

Summary

Renders navigation items from the API response if they are available, falling back to the ServiceContext navigation values if they are not to allow migration of services to the API version

Code changes

  • Adds render logic and associated tests

Testing

  1. List the steps required to test this PR.

Useful Links

@amoore108 amoore108 self-assigned this Jan 27, 2026
@pvaliani pvaliani changed the base branch from WS-2080-fetch-config-function to latest January 28, 2026 14:10
@pvaliani pvaliani self-assigned this Jan 28, 2026
@holchris holchris marked this pull request as ready for review January 29, 2026 16:54
Copilot AI review requested due to automatic review settings January 29, 2026 16:54
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 rendering of navigation items from the API response for both Next.js and Express applications, with a fallback mechanism to service config values during the migration period.

Changes:

  • Fetches navigation data from the config API in both Next.js (_app.page.tsx) and Express (index.jsx) applications
  • Passes navigation items through the component hierarchy via props
  • Updates Navigation component to prefer API-sourced navigation over service config

Reviewed changes

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

Show a summary per file
File Description
ws-nextjs-app/pages/_app.page.tsx Fetches navigation config, extracts items, and passes to PageWrapper
ws-nextjs-app/pages/[service]/topics/[id]/[[...variant]].page.tsx Updates type import for GetServerSideProps
src/server/index.jsx Fetches navigation config and adds to data object
src/app/models/types/serviceConfig.ts Refactors navigation type to use shared Navigation type
src/app/models/types/global.ts Defines shared Navigation type
src/app/legacy/containers/Navigation/index.test.jsx Adds tests for navItems prop behavior
src/app/legacy/containers/Navigation/index.jsx Implements fallback logic from navItems prop to service config
src/app/legacy/containers/Header/index.jsx Passes navItems prop to NavigationContainer
src/app/legacy/containers/App/App.test.jsx Updates test with navItems data
src/app/legacy/containers/App/App.jsx Includes navItems in state mapping
src/app/components/PageLayoutWrapper/index.tsx Adds navItems prop and passes to HeaderContainer

holchris and others added 2 commits February 2, 2026 09:02
adds return null for navResults [CP]

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings February 2, 2026 12:36
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

Copilot reviewed 11 out of 11 changed files in this pull request and generated 1 comment.

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings February 2, 2026 12:37
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

Copilot reviewed 11 out of 11 changed files in this pull request and generated 1 comment.

Copilot AI review requested due to automatic review settings February 2, 2026 16:52
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

Copilot reviewed 11 out of 11 changed files in this pull request and generated 1 comment.

@holchris holchris self-assigned this Feb 2, 2026
@holchris holchris merged commit 5520d08 into latest Feb 3, 2026
13 of 15 checks passed
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.

4 participants