[Customer Portal] Changes from the microapp - #609
Conversation
…for user edit page
…e flow - add project features API and wire into ProjectContext/Provider - enable feature-based UI rendering (tabs, stats, widgets, access control) - implement case edit mutation with menu actions (resolve, waiting, create related) - add "create related case" flow with prefilled and locked fields - include projectTypeId in case classification requests ui: - add MoreOptionsButton and integrate into case detail header - extend StickyCommentBar with bottomSlot support - add disabled prop to TextField - simplify ProjectCard layout - normalize RichText spacing (remove default margins) fix: - enforce non-null status in case DTO/model and update mappings - ensure stable keys and correct ordering in chat messages - handle project features loading state in MeProvider refactor: - propagate projectTypeId through context and usage - clean up unused constants and update constants file to tsx chore: - add PROJECT_FEATURES_ENDPOINT and update websocket version to v1.3
[Customer Portal Micro App] Integrate Backend APIs and Refine UI
…lPage - Introduced a function to map case state labels to their corresponding keys. - Updated menu options to utilize the new state keys for improved clarity and functionality. - Adjusted action handlers to ensure proper state transitions for case actions (resolve, accept/reject solution, mark waiting). - Improved UI logic for displaying menu options based on case status.
- Replaced dynamic case state retrieval with a constant mapping for improved readability and performance. - Simplified the logic for obtaining case state keys, enhancing maintainability of the code.
- Moved case state IDs to a dedicated constants file for better organization and reusability. - Updated CaseDetailPage to utilize the centralized case state constants, enhancing code clarity.
- Updated the menu option label from "Created Related Case" to "Create Related Case" for improved clarity and consistency in the user interface.
…ns in CaseDetailPage - Eliminated the 'Mark as Waiting on WSO2' action from the case menu options for improved clarity and reduced complexity. - Adjusted visibility logic for the 'Reject Solution' option to account for additional case states.
…actions feat: add solution proposed case actions in microapp
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (143)
📝 WalkthroughWalkthroughThe pull request transforms the customer portal microapp from a mock-data-driven prototype to a fully server-integrated application. It removes static mock datasets, integrates React Query for server-backed data fetching, adds support for new item types (engagements, SRA, change requests), implements WebSocket-driven Novera chat streaming, introduces comprehensive type definitions and services, refactors page layouts with dynamic data binding, and updates the native bridge integration for device-aware positioning and app lifecycle management. Changes
Sequence Diagram(s)sequenceDiagram
participant Client as Client (Chat UI)
participant Bridge as Native Bridge
participant WS as WebSocket (Novera)
participant BE as Backend (Cases)
Client->>Bridge: getAccessTokenFromBridge()
Bridge-->>Client: accessToken
Client->>Bridge: requestDeviceSafeAreaInsets()
Bridge-->>Client: { insets: EdgeInsets }
Client->>WS: connect with session/auth
Client->>WS: send ChatMessage { content, conversationId, envProducts }
WS-->>Client: ConversationCreatedNoveraResponse
WS-->>Client: ThinkingStartNoveraResponse
WS-->>Client: TokenNoveraResponse (streaming tokens)
WS-->>Client: ThinkingStepNoveraResponse
WS-->>Client: ThinkingEndNoveraResponse
WS-->>Client: FinalNoveraResponse { message, sessionId }
Client->>Client: onAnimationComplete() callback
Client->>BE: POST /cases/classify { conversationId, messages, envProducts }
BE-->>Client: { caseType, issue, severity, ... }
Client->>Client: navigate('/create', { state: { classifications } })
sequenceDiagram
participant Client as Client (Create Case Form)
participant RQ as React Query
participant BE as Backend (Cases/Projects)
participant Auth as Auth Bridge
Client->>RQ: useSuspenseQuery(projects.all())
RQ->>Auth: getAccessTokenFromBridge()
Auth-->>RQ: accessToken
RQ->>BE: GET /projects/search
BE-->>RQ: [ Project, ... ]
RQ-->>Client: projects[]
Client->>RQ: useQuery(projects.details(projectId))
RQ->>BE: GET /projects/{id}/details
BE-->>RQ: { deployments, ... }
RQ-->>Client: deploymentOptions[]
Client->>Client: if location.state.classifications, autofill form fields
Client->>Client: update Formik values { project, deployment, product, type, severity, ... }
Client->>RQ: useMutation(cases.create)
Client->>Client: user clicks Submit
RQ->>BE: POST /cases { projectId, type, severity, description, envProducts, relatedCaseId? }
BE-->>RQ: { caseId, ... }
RQ->>Client: onSuccess: navigate('/cases/{id}')
sequenceDiagram
participant Client as Client (Detail Page)
participant Comment as StickyCommentBar
participant RQ as React Query
participant BE as Backend (Cases)
Client->>RQ: useQuery(cases.comments(id))
RQ->>BE: GET /cases/{id}/comments
BE-->>RQ: [ Comment, ... ]
RQ-->>Client: comments[]
Client->>Client: render Comment list + sanitize HTML
Comment->>Comment: user types, input enabled
Client->>Comment: loading={mutation.isPending}
Comment->>Comment: user clicks Send
Comment->>RQ: useMutation(cases.createComment(id))
RQ->>BE: POST /cases/{id}/comments { content, ... }
BE-->>RQ: { commentId, ... }
RQ->>RQ: invalidateQueries(['case-comments', id])
RQ->>RQ: refetch comments
RQ-->>Client: updated comments[]
Client->>Client: scroll sentinel into view
Comment->>Comment: clear input
Estimated code review effort🎯 4 (Complex) | ⏱️ ~75 minutes Possibly related PRs
Suggested labels
Suggested reviewers
Poem
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
|
Summary by CodeRabbit
New Features
Bug Fixes
Improvements