[Customer Portal][Web] Improve Issue Flow with Create Case Fallback - #293
Conversation
When the support chat API call fails, surface a "Create Case" action so users can open a support case instead of chat. DescribeIssuePage: import PlusCircle icon; add hasApiFailed state and set it in the catch block; add handleCreateCase to navigate to the create-case route (skipChat=true); render a conditional "Create Case" Button with the PlusCircle icon, add gap between action buttons, and disable it when projectId is missing. TimeCardsDateFilter: adjust state filter box layout (marginLeft: auto) to right-align the control.
📝 WalkthroughWalkthroughThe PR makes two UI adjustments to the customer portal: realigning the state filter in TimeCardsDateFilter to right-align without flex expansion, and adding error handling with a Create Case button to DescribeIssuePage that appears when API submission fails. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes Possibly related PRs
Suggested labels
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
apps/customer-portal/webapp/src/pages/DescribeIssuePage.tsx (1)
195-203: Disable the Create Case action while submit is in progress.When
isSubmittingis true, users can still click Create Case, which can trigger competing actions during an active retry.Suggested tweak
{hasApiFailed && ( <Button variant="contained" color="primary" startIcon={<PlusCircle size={18} />} onClick={handleCreateCase} - disabled={!projectId} + disabled={!projectId || isSubmitting} > Create Case </Button> )}🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@apps/customer-portal/webapp/src/pages/DescribeIssuePage.tsx` around lines 195 - 203, The Create Case button allows clicks while a submission is in progress; update the Button rendering (the block guarded by hasApiFailed) to also disable when isSubmitting is true by adding isSubmitting to the disabled expression (e.g., disabled={!projectId || isSubmitting}) so that the Button (startIcon={<PlusCircle ... />} onClick={handleCreateCase}) is inactive during retries.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In `@apps/customer-portal/webapp/src/pages/DescribeIssuePage.tsx`:
- Around line 195-203: The Create Case button allows clicks while a submission
is in progress; update the Button rendering (the block guarded by hasApiFailed)
to also disable when isSubmitting is true by adding isSubmitting to the disabled
expression (e.g., disabled={!projectId || isSubmitting}) so that the Button
(startIcon={<PlusCircle ... />} onClick={handleCreateCase}) is inactive during
retries.
ℹ️ Review info
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
apps/customer-portal/webapp/src/components/project-details/time-tracking/TimeCardsDateFilter.tsxapps/customer-portal/webapp/src/pages/DescribeIssuePage.tsx
4fee000
into
wso2-open-operations:customer-portal-milestone-1
Description
This pull request introduces a user experience improvement to the issue description flow in the customer portal. The main enhancement is providing users with a clear "Create Case" option if the automated help API fails, making it easier to escalate issues. Additionally, there are minor UI adjustments for layout consistency.
User experience improvements:
PlusCircleicon) that appears when the automated help API fails, allowing users to directly create a support case. This button is disabled ifprojectIdis not available and triggers navigation to the case creation page, passing askipChatflag in state. [1] [2] [3] [4] [5]UI/layout adjustments:
TimeCardsDateFilterby removing theflex: 1property and addingmarginLeft: "auto"to ensure correct positioning.Summary by CodeRabbit
New Features
Style