refactor: remove labels on languagescreen and fix stepper#8937
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
✅ Files skipped from review due to trivial changes (1)
🚧 Files skipped from review as they are similar to previous changes (1)
WalkthroughIntroduce STEPPER_EXCLUDED_SCREENS and STEPPER_HIDDEN_SCREENS, adjust totalSteps/step indexing to exclude hidden screens, update stepper rendering/visibility logic, change language/team inputs to use adornments and remove duplicate labels, and update tests/locale strings accordingly. Changes
Sequence Diagram(s)sequenceDiagram
participant Config as getCustomizeFlowConfig
participant Form as MultiStepForm
participant Stepper as ProgressStepper
participant Screen as ScreenRenderer
Config->>Form: provide screens[], totalSteps (excludes STEPPER_EXCLUDED_SCREENS)
Form->>Form: compute stepperScreens (filter STEPPER_EXCLUDED_SCREENS)
Form->>Stepper: render with totalSteps, activeStepNumber (index in stepperScreens)
Stepper->>Screen: indicate current step / checkmarks
Form->>Screen: render active screen (e.g., Language, Done)
Screen-->>Form: user actions (next, select language/team)
Form->>Stepper: update activeStepNumber / visibility (hide if STEPPER_HIDDEN_SCREENS has active)
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes 🚥 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 docstrings
🧪 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 |
|
View your CI Pipeline Execution ↗ for commit badc253
☁️ Nx Cloud last updated this comment at |
…abels-on-languagescreen-and-fix
There was a problem hiding this comment.
🧹 Nitpick comments (1)
apps/journeys-admin/src/components/TemplateCustomization/MultiStepForm/ProgressStepper/ProgressStepper.spec.tsx (1)
27-40: Test values represent an unusual edge case.With
activeStepNumber=1andtotalSteps=1, the active step index exceeds the valid range (0). The check icon renders becausestepIndex < activeStepNumber(0 < 1) is true, not becauseisLastScreenis true. While this works, consider usingactiveStepNumber=0andtotalSteps=1to test the actual "on last step" scenario whereisLastScreenevaluates to true.🔧 Optional: Test the actual last-step scenario
it('should render checkmark for all steps when on the last step', () => { - const activeStepNumber = 1 + const activeStepNumber = 0 const totalSteps = 1 render( <ProgressStepper activeStepNumber={activeStepNumber} totalSteps={totalSteps} /> ) const checkIcons = screen.getAllByTestId('CheckIcon') expect(checkIcons).toHaveLength(totalSteps) })🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@apps/journeys-admin/src/components/TemplateCustomization/MultiStepForm/ProgressStepper/ProgressStepper.spec.tsx` around lines 27 - 40, The test uses activeStepNumber=1 and totalSteps=1 which makes stepIndex < activeStepNumber true instead of exercising the ProgressStepper's isLastScreen logic; update the test for ProgressStepper to use activeStepNumber=0 and totalSteps=1 so the component is actually on the last step (isLastScreen path) and assert that the CheckIcon(s) render as expected; keep the same assertion on screen.getAllByTestId('CheckIcon') length.
🤖 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/journeys-admin/src/components/TemplateCustomization/MultiStepForm/ProgressStepper/ProgressStepper.spec.tsx`:
- Around line 27-40: The test uses activeStepNumber=1 and totalSteps=1 which
makes stepIndex < activeStepNumber true instead of exercising the
ProgressStepper's isLastScreen logic; update the test for ProgressStepper to use
activeStepNumber=0 and totalSteps=1 so the component is actually on the last
step (isLastScreen path) and assert that the CheckIcon(s) render as expected;
keep the same assertion on screen.getAllByTestId('CheckIcon') length.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro
Run ID: 32927236-d960-4c20-b44e-97ac567b386a
📒 Files selected for processing (10)
apps/journeys-admin/src/components/TemplateCustomization/MultiStepForm/MultiStepForm.spec.tsxapps/journeys-admin/src/components/TemplateCustomization/MultiStepForm/MultiStepForm.tsxapps/journeys-admin/src/components/TemplateCustomization/MultiStepForm/ProgressStepper/ProgressStepper.spec.tsxapps/journeys-admin/src/components/TemplateCustomization/MultiStepForm/ProgressStepper/ProgressStepper.tsxapps/journeys-admin/src/components/TemplateCustomization/MultiStepForm/Screens/LanguageScreen/JourneyCustomizeTeamSelect/JourneyCustomizeTeamSelect.tsxapps/journeys-admin/src/components/TemplateCustomization/MultiStepForm/Screens/LanguageScreen/LanguageScreen.spec.tsxapps/journeys-admin/src/components/TemplateCustomization/MultiStepForm/Screens/LanguageScreen/LanguageScreen.tsxapps/journeys-admin/src/components/TemplateCustomization/utils/getCustomizeFlowConfig/getCustomizeFlowConfig.spec.tsapps/journeys-admin/src/components/TemplateCustomization/utils/getCustomizeFlowConfig/getCustomizeFlowConfig.tsapps/journeys-admin/src/components/TemplateCustomization/utils/getCustomizeFlowConfig/index.ts
|
The latest updates on your projects.
|
|
The latest updates on your projects.
|
|
The latest updates on your projects.
|
|
The latest updates on your projects.
|
|
The latest updates on your projects.
|
|
The latest updates on your projects.
|
|
The latest updates on your projects.
|
…abels-on-languagescreen-and-fix
This comment has been minimized.
This comment has been minimized.
…abels-on-languagescreen-and-fix
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Summary by CodeRabbit
New Features
Bug Fixes
Tests