Skip to content

[Customer Portal][FE][Web] Add Project Hub, UI Shell, and Routing Infrastructure - #73

Merged
Rashmika998 merged 48 commits into
wso2-open-operations:customer-portal-milestone-1from
dileepapeiris:customer-portal-milestone-1
Feb 3, 2026
Merged

Rashmika998 merged 48 commits into
wso2-open-operations:customer-portal-milestone-1from
dileepapeiris:customer-portal-milestone-1

Conversation

@dileepapeiris

@dileepapeiris dileepapeiris commented Jan 29, 2026 •

Copy link
Copy Markdown
Contributor

Purpose

This PR implements the first milestone of the customer portal, establishing the foundational application structure with routing, layout components, and project management features.

Goals

  • Establish a robust routing infrastructure using react-router and @asgardeo/react-router.
  • Implement a core UI App Shell (Header, Sidebar, Footer) using the Oxygen UI design system.
  • Create a "Project Hub" to allow users to browse and select from available projects.
  • Provide a scalable project-specific view architecture.
  • Integrate mock data and API hooks for development and testing.

Approach

  • Routing: Implemented nested routing where / leads to the Project Hub, and /:projectId/* handles project-specific dashboards.
  • Data Fetching: Utilized React Query (useInfiniteQuery) for the useSearchProjects hook to support paginated project listing.
  • Layout: Developed an AppLayout component that conditionally renders the Sidebar only when a specific project is selected.
  • Testing: Achieved comprehensive unit test coverage for components, hooks, and utilities using Vitest.

User stories

  • Project Discovery: As a user, I can view a list of all my projects on a central landing page (Project Hub).
  • Project Context: As a user, I can select a project and see a dedicated sidebar and dashboard specific to that project.
  • Navigation: As a user, I can use the Header's project switcher to jump between projects or return to the hub.
  • Theme Preference: As a user, I can toggle between light and dark modes.

Walkthrough

Adds a router-based app structure for the customer portal: routing and App layout, header/sidebar/footer UI, project listing and pages, a paginated projects API hook with mocks, new constants/models, comprehensive tests, and updated test/vite config and package dependencies.

Changes

Cohort File(s) Summary
Dependencies & App Entry package.json, App.tsx, AppWithConfig.tsx Added react-router and @asgardeo/react-router; replaced placeholder App with a router implementation.
API Hook & Tests useSearchProjects.ts, useSearchProjects.test.tsx New useSearchProjects hook using useInfiniteQuery with paginated mock responses and tests.
Models & Mock Data requests.ts, responses.ts, mockData.ts Added request/response interfaces and mockProjects/mockUser test data.
Constants appLayoutConstants.ts, apiQueryKeys.ts Introduced APP_SHELL_NAV_ITEMS, footer/company constants, and ApiQueryKeys.
Layout & Pages AppLayout.tsx, ProjectHub.tsx, ProjectPage.tsx New AppLayout composing Header, SideBar, and Footer; ProjectHub page listing projects; ProjectPage template.
Header & Subcomponents Header.tsx, Brand.tsx, Actions.tsx, ProjectSwitcher.tsx, SearchBar.tsx, UserProfile.tsx Implemented Header integrating routing, project switching, and UI subcomponents with unit tests.
Sidebar & Widgets SideBar.tsx, SubscriptionWidget.tsx Added SideBar with project-aware links and collapsible SubscriptionWidget.
Footer & Logger Footer.tsx, LoggerContext.tsx, useLogger.ts New Footer using app constants; added runtime guards to useLogger.
Tests / Vite config vite.config.ts Configured CSS inclusion and inlining for @wso2/oxygen-ui dependencies in Vitest.

Sequence Diagram

sequenceDiagram
    participant User
    participant App as App (Router)
    participant Header
    participant ProjectSwitcher
    participant API as useSearchProjects
    participant Router as React Router
    participant ProjectPage

    User->>App: Load application
    App->>Header: Render with onToggleSidebar
    Header->>API: Fetch projects (infinite)
    API-->>Header: Return paginated projects
    Header->>ProjectSwitcher: Provide projects + selection

    User->>ProjectSwitcher: Select project
    ProjectSwitcher->>Header: onProjectChange(key)
    Header->>Router: Navigate to /{key}/dashboard
    Router->>ProjectPage: Render project page
    ProjectPage-->>User: Display project view

    User->>Header: Navigate to Project Hub
    Header->>Router: Navigate to /
    Router->>App: Render ProjectHub
    App-->>User: Show project list
Loading

Automation tests

  • Unit tests: Comprehensive coverage for all UI components (Header, SideBar, Footer, ProjectHub) and custom hooks.
image

ScreenRecordings and screenshots

ProjectHub Page

image

ProjectHub to Project Dashboard Navigation

Screen.Recording.2026-01-29.at.22.18.02.mov

Project Dashboard Page

Light mode:
Screenshot 2026-01-29 at 22 19 07

Dark Mode:
image

image

User Profile Dropdown

Light Mode
image

Dark Mode
image

Navigation between side nav bar tabs

Screen.Recording.2026-01-29.at.22.19.40.1.mov

Dark / Light / System mode toggle

Screen.Recording.2026-01-29.at.22.40.57.mov

Join Community Navigation

Screen.Recording.2026-01-29.at.22.44.50.mov

Terms and Conditions Navigation

Screen.Recording.2026-01-29.at.22.45.43.mov

Privacy Policy Navigation

Screen.Recording.2026-01-29.at.22.45.17.mov

Close(#49, #21)

Summary by CodeRabbit

  • New Features

    • Project-based routing and layout with a Project Hub, per-project pages, and redirects.
    • Header with brand, project switcher, search bar, theme toggle, and user profile menu.
    • Sidebar with navigation, subscription panel, and settings link.
    • Footer with company, legal, and community links.
    • Project search with paginated results, mock data, and typed request/response models.
  • Tests

    • Extensive unit tests covering pages, header, sidebar, footer, and search hook.
  • Documentation

    • Added logger JSDoc and context guard notes.

✏️ Tip: You can customize this high-level summary in your review settings.

Introduces a new Header component with sidebar toggle, brand, project switcher, search bar, and action buttons. Integrates project selection and navigation logic, and fetches project data using custom hooks.
Introduces a new Brand component in the header, displaying the WSO2 logo and 'Customer Portal' title using Oxygen UI components.
Introduces a new Actions component for the header, including a join community button, theme switcher, divider, and user profile menu. This modularizes header actions for improved maintainability and reusability.
Introduces a new ProjectSwitcher React component for the customer portal header, allowing users to switch between projects using a dropdown menu. The component displays project names and descriptions and notifies parent components when the selected project changes.
Introduces a new SearchBar component for the header using the Oxygen UI library. The component provides a small-sized search input with a placeholder for searching cases, tickets, or users.
Introduces a new UserProfile component that displays a user menu using the Oxygen UI library. The component handles profile, settings, and logout actions, integrating navigation for logout.
Introduces a new Footer component that utilizes the Oxygen UI Footer and pulls company name, terms, and privacy URLs from constants. This provides a reusable footer for the customer portal application.
Introduces tests for the Footer component to verify rendering of company name, terms of service, and privacy policy links with correct URLs. Mocks the @wso2/oxygen-ui Footer for isolated testing.
Introduces TypeScript interfaces for project list items, paginated project search responses, and user profile information. These models will be used to type API responses in the customer portal webapp.
Introduces TypeScript interfaces for pagination metadata and project search requests in the customer portal webapp. These models will help standardize request payloads for searching projects with pagination support.
Introduced mockProjects and mockUser exports in mockData.ts to provide sample data for project switcher and user menu components.
Introduces the ProjectHub component for displaying and navigating between projects. Handles loading, error, and empty states, and integrates logging for project loading events.
Introduces a new ProjectPage component that displays the project title and project ID from the URL. This component uses Oxygen UI components and is intended for the customer portal webapp.
Introduces the AppLayout component using Oxygen UI's AppShell. Integrates Header, Footer, and conditional SideBar components, and sets up routing with React Router's Outlet.
Adds empty CSS include array and configures server dependencies to inline '@wso2/oxygen-ui' and '@wso2/oxygen-ui-icons-react' for improved test environment setup.
Added inline documentation to the useLogger hook to clarify the purpose of context retrieval and error handling. This improves code readability and maintainability.
Added a JSDoc @returns annotation to the LoggerContext definition for improved documentation and type clarity.
Changed the import path from AppShellConstants to appLayoutConstants in Footer.tsx to reflect the updated file naming or structure.
Changed the import in Footer.test.tsx from AppShellConstants to appLayoutConstants to reflect the updated file naming or structure.
Introduces a new constants file defining navigation items, company information, and key URLs for the customer portal app layout.
Introduces a new constants file for API-related query keys, starting with the 'PROJECTS' key for project search API calls.
Replaces the placeholder App component with a full routing setup using react-router. Adds routes for ProjectHub, project-specific pages, and a fallback redirect. Wraps routes with AppLayout for consistent layout across pages.
Moved the import of the App component below other imports for improved readability and consistency with import grouping.
Introduces a new SideBar component with navigation and footer sections, supporting collapsed state, menu expansion, and project-based routing. Integrates navigation items from constants and includes a subscription widget and settings link.
Introduces a new SubscriptionWidget component for the side navigation bar. The widget displays subscription information and a 'View Details' button, and is hidden when the sidebar is collapsed.
Updated the import of JOIN_COMMUNITY_URL to use the correct path '@/constants/appLayoutConstants' instead of '@/constants/AppShellConstants'.
Refreshed pnpm-lock.yaml to include new and updated dependencies such as @asgardeo/react-router, react-router, esbuild, and related packages. This update ensures compatibility with recent package requirements and resolves dependency versions for the customer portal webapp.
Added @asgardeo/react-router@^1.0.31 and react-router@^7.1.5 to the dependencies in package.json to support routing and authentication integration.
Updated the SideBar component to render item icons without forcing a size of 20, allowing icons to use their default or inherited sizing.
Introduces unit tests for the SubscriptionWidget component to verify rendering behavior when collapsed and not collapsed, including UI elements and icon presence.
@dileepapeiris dileepapeiris changed the title Customer portal milestone 1 [Customer Portal] Add Project Hub, UI Shell, and Routing Infrastructure Jan 29, 2026
@dileepapeiris dileepapeiris added Type/New Feature Represents a request or task for a new feature Type/Task General task that does not fit into other categories Type/UX Refers to user experience-related tasks or issues App/Customer Portal Area/Frontend Platform/Web labels Jan 29, 2026
@dileepapeiris dileepapeiris self-assigned this Jan 29, 2026
@dileepapeiris dileepapeiris moved this from Todo to Done in Customer Portal Development Jan 29, 2026
@dileepapeiris dileepapeiris changed the title [Customer Portal] Add Project Hub, UI Shell, and Routing Infrastructure [Customer Portal][FE][Web] Add Project Hub, UI Shell, and Routing Infrastructure Jan 29, 2026
Changed the mock user's name, email, and avatar to generic values for improved anonymization and consistency in sample data.
Comment thread apps/customer-portal/webapp/src/models/mockData.ts Outdated
Comment thread apps/customer-portal/webapp/src/models/mockData.ts Outdated
Comment thread apps/customer-portal/webapp/src/api/useSearchProjects.ts Outdated
Explicitly types the 'results' object as SearchProjectsResponse in useSearchProjects to improve type safety and clarity.
@dileepapeiris
dileepapeiris requested a review from v15a1 January 30, 2026 05:12
@dileepapeiris

Copy link
Copy Markdown
Contributor Author

Note for reviewers:

The ProjectHub and ProjectPage.tsx files have been added temporarily.
The authentication part is currently disabled.
APIs are currently running with mock tests.

Comment thread apps/customer-portal/webapp/src/models/requests.ts

@Rashmika998 Rashmika998 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

App/Customer Portal Area/Frontend Platform/Web Type/New Feature Represents a request or task for a new feature Type/Task General task that does not fit into other categories Type/UX Refers to user experience-related tasks or issues

Projects

Status: Staging Deployed

Development

Successfully merging this pull request may close these issues.

5 participants