-
Notifications
You must be signed in to change notification settings - Fork 14
fix: override journey template autocomplete filter to trim #8592
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
fix: override journey template autocomplete filter to trim #8592
Conversation
…in-template-library
WalkthroughRenames the router query parameter from Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Suggested reviewers
🚥 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)
📜 Recent review detailsConfiguration used: Repository UI Review profile: CHILL Plan: Pro Disabled knowledge base sources:
📒 Files selected for processing (3)
🚧 Files skipped from review as they are similar to previous changes (1)
🧰 Additional context used📓 Path-based instructions (3)**/*.{ts,tsx,js,jsx}📄 CodeRabbit inference engine (.cursor/rules/base.mdc)
Files:
**/*.{ts,tsx}📄 CodeRabbit inference engine (.cursor/rules/base.mdc)
Files:
apps/**/*.{js,jsx,ts,tsx}📄 CodeRabbit inference engine (.cursor/rules/apps.mdc)
Files:
🧠 Learnings (5)📚 Learning: 2025-12-19T04:58:24.460ZApplied to files:
📚 Learning: 2025-12-19T04:58:24.460ZApplied to files:
📚 Learning: 2025-12-19T19:18:43.790ZApplied to files:
📚 Learning: 2025-12-19T04:58:24.460ZApplied to files:
📚 Learning: 2025-12-19T19:18:43.790ZApplied to files:
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (7)
🔇 Additional comments (2)
✏️ Tip: You can disable this entire section by setting 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 f799f26
☁️ Nx Cloud last updated this comment at |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (2)
apps/journeys-admin/src/components/StatusTabPanel/StatusTabPanel.tsx (1)
63-65: Inconsistent query parameter: readingtabbut writingstatus.Line 64 still reads from
router?.query?.tabto determine the initial tab index, but Line 91 now writesstatusto the URL. This breaks URL-driven tab state—users who refresh the page or share a link with?status=archivedwill always land on the Active tab because the component looks fortabinstead.🐛 Proposed fix
const tabIndex = - journeyStatusTabs.find((status) => status.queryParam === router?.query?.tab) + journeyStatusTabs.find((status) => status.queryParam === router?.query?.status) ?.tabIndex ?? 0apps/journeys-admin/src/components/StatusTabPanel/StatusTabPanel.spec.tsx (1)
16-19: Test mocks still usetabinstead ofstatus.The default mock and several test setups (lines 97, 127, 161) still use
tabinrouter.query, while line 197 correctly usesstatus. Once the component bug is fixed (reading fromstatusinstead oftab), these mocks should also be updated for consistency. Currently, tests pass because the component has the same inconsistency.🔧 Suggested mock updates (apply after fixing the component)
jest.mock('next/router', () => ({ __esModule: true, - useRouter: jest.fn(() => ({ query: { tab: undefined } })) + useRouter: jest.fn(() => ({ query: { status: undefined } })) }))And similarly update lines 97, 127, and 161 to use
statusinstead oftab.
🧹 Nitpick comments (1)
libs/journeys/ui/src/components/TemplateGallery/TagsFilter/TagsFilter.spec.tsx (1)
2-2: Unused import:screen.The
screenimport from@testing-library/reactis added but never used in the tests. All tests use destructured queries fromrender()instead.🔧 Remove unused import
-import { fireEvent, render, screen, waitFor } from '@testing-library/react' +import { fireEvent, render, waitFor } from '@testing-library/react'
📜 Review details
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro
Disabled knowledge base sources:
- Linear integration is disabled by default for public repositories
You can enable these sources in your CodeRabbit configuration.
📒 Files selected for processing (4)
apps/journeys-admin/src/components/StatusTabPanel/StatusTabPanel.spec.tsxapps/journeys-admin/src/components/StatusTabPanel/StatusTabPanel.tsxlibs/journeys/ui/src/components/TemplateGallery/TagsFilter/TagsFilter.spec.tsxlibs/journeys/ui/src/components/TemplateGallery/TagsFilter/TagsFilter.tsx
🧰 Additional context used
📓 Path-based instructions (3)
**/*.{ts,tsx,js,jsx}
📄 CodeRabbit inference engine (.cursor/rules/base.mdc)
**/*.{ts,tsx,js,jsx}: Use early returns whenever possible to make the code more readable.
Use descriptive variable and function/const names.
Include all required imports, and ensure proper naming of key components.
Files:
libs/journeys/ui/src/components/TemplateGallery/TagsFilter/TagsFilter.spec.tsxapps/journeys-admin/src/components/StatusTabPanel/StatusTabPanel.tsxlibs/journeys/ui/src/components/TemplateGallery/TagsFilter/TagsFilter.tsxapps/journeys-admin/src/components/StatusTabPanel/StatusTabPanel.spec.tsx
**/*.{ts,tsx}
📄 CodeRabbit inference engine (.cursor/rules/base.mdc)
Define a type if possible.
Files:
libs/journeys/ui/src/components/TemplateGallery/TagsFilter/TagsFilter.spec.tsxapps/journeys-admin/src/components/StatusTabPanel/StatusTabPanel.tsxlibs/journeys/ui/src/components/TemplateGallery/TagsFilter/TagsFilter.tsxapps/journeys-admin/src/components/StatusTabPanel/StatusTabPanel.spec.tsx
apps/**/*.{js,jsx,ts,tsx}
📄 CodeRabbit inference engine (.cursor/rules/apps.mdc)
apps/**/*.{js,jsx,ts,tsx}: Always use MUI over HTML elements; avoid using CSS or tags.
Use descriptive variable and function/const names. Also, event functions should be named with a “handle” prefix, like “handleClick” for onClick and “handleKeyDown” for onKeyDown.
Implement accessibility features on elements. For example, a tag should have a tabindex=“0”, aria-label, on:click, and on:keydown, and similar attributes.
Files:
apps/journeys-admin/src/components/StatusTabPanel/StatusTabPanel.tsxapps/journeys-admin/src/components/StatusTabPanel/StatusTabPanel.spec.tsx
🧠 Learnings (11)
📚 Learning: 2025-12-19T04:58:24.460Z
Learnt from: CR
Repo: JesusFilm/core PR: 0
File: apps/watch/AGENTS.md:0-0
Timestamp: 2025-12-19T04:58:24.460Z
Learning: Applies to apps/watch/src/**/*.spec.{ts,tsx} : Co-locate React Testing Library specs under `*.spec.ts(x)` and mock network traffic with MSW handlers in `apps/watch/test`.
Applied to files:
libs/journeys/ui/src/components/TemplateGallery/TagsFilter/TagsFilter.spec.tsxapps/journeys-admin/src/components/StatusTabPanel/StatusTabPanel.spec.tsx
📚 Learning: 2025-12-19T04:58:24.460Z
Learnt from: CR
Repo: JesusFilm/core PR: 0
File: apps/watch/AGENTS.md:0-0
Timestamp: 2025-12-19T04:58:24.460Z
Learning: Applies to apps/watch/src/**/*.spec.{ts,tsx} : Enclose SWR-based hooks in `TestSWRConfig` (`apps/watch/test/TestSWRConfig.tsx`) to isolate cache state between assertions in tests.
Applied to files:
libs/journeys/ui/src/components/TemplateGallery/TagsFilter/TagsFilter.spec.tsxapps/journeys-admin/src/components/StatusTabPanel/StatusTabPanel.spec.tsx
📚 Learning: 2025-12-19T19:18:43.790Z
Learnt from: CR
Repo: JesusFilm/core PR: 0
File: apps/resources/AGENTS.md:0-0
Timestamp: 2025-12-19T19:18:43.790Z
Learning: Applies to apps/resources/**/*.spec.ts?(x) : Enclose SWR-based hooks in `TestSWRConfig` (`apps/resources/test/TestSWRConfig.tsx`) to isolate cache state between assertions
Applied to files:
libs/journeys/ui/src/components/TemplateGallery/TagsFilter/TagsFilter.spec.tsxapps/journeys-admin/src/components/StatusTabPanel/StatusTabPanel.spec.tsx
📚 Learning: 2025-07-22T18:37:24.555Z
Learnt from: CR
Repo: JesusFilm/core PR: 0
File: .cursor/rules/base.mdc:0-0
Timestamp: 2025-07-22T18:37:24.555Z
Learning: Applies to **/*.{ts,tsx,js,jsx} : Include all required imports, and ensure proper naming of key components.
Applied to files:
libs/journeys/ui/src/components/TemplateGallery/TagsFilter/TagsFilter.spec.tsx
📚 Learning: 2025-12-19T19:18:43.790Z
Learnt from: CR
Repo: JesusFilm/core PR: 0
File: apps/resources/AGENTS.md:0-0
Timestamp: 2025-12-19T19:18:43.790Z
Learning: Applies to apps/resources/**/*.spec.ts?(x) : Co-locate React Testing Library specs under `*.spec.ts(x)` and mock network traffic with MSW handlers in `apps/resources/test`
Applied to files:
libs/journeys/ui/src/components/TemplateGallery/TagsFilter/TagsFilter.spec.tsxapps/journeys-admin/src/components/StatusTabPanel/StatusTabPanel.spec.tsx
📚 Learning: 2025-12-19T19:18:43.790Z
Learnt from: CR
Repo: JesusFilm/core PR: 0
File: apps/resources/AGENTS.md:0-0
Timestamp: 2025-12-19T19:18:43.790Z
Learning: Applies to apps/resources/**/*.spec.ts?(x) : Wrap component specs with `MockedProvider`, `VideoProvider`, and `WatchProvider` when the unit touches those contexts—`NewVideoContentPage.spec.tsx` shows the expected harness
Applied to files:
libs/journeys/ui/src/components/TemplateGallery/TagsFilter/TagsFilter.spec.tsx
📚 Learning: 2025-07-27T21:59:10.507Z
Learnt from: CR
Repo: JesusFilm/core PR: 0
File: .cursor/rules/watch-modern.mdc:0-0
Timestamp: 2025-07-27T21:59:10.507Z
Learning: Applies to apps/watch-modern/**/*.test.{tsx,jsx} : Use 'testing-library/react' npm package for frontend tests.
Applied to files:
libs/journeys/ui/src/components/TemplateGallery/TagsFilter/TagsFilter.spec.tsx
📚 Learning: 2025-11-16T21:30:53.412Z
Learnt from: Kneesal
Repo: JesusFilm/core PR: 8309
File: apps/journeys-admin/setupTests.tsx:47-51
Timestamp: 2025-11-16T21:30:53.412Z
Learning: In apps/journeys-admin/setupTests.tsx, the `document.clearImmediate` mock is required for tests involving the mux upload provider, as an underlying library uses clearImmediate for timeout management to prevent race conditions and unnecessary polling calls.
Applied to files:
libs/journeys/ui/src/components/TemplateGallery/TagsFilter/TagsFilter.spec.tsx
📚 Learning: 2025-07-27T21:59:04.362Z
Learnt from: CR
Repo: JesusFilm/core PR: 0
File: .cursor/rules/apps.mdc:0-0
Timestamp: 2025-07-27T21:59:04.362Z
Learning: Applies to apps/**/*.test.{js,jsx,ts,tsx} : Use 'testing-library/react' npm package for frontend tests.
Applied to files:
libs/journeys/ui/src/components/TemplateGallery/TagsFilter/TagsFilter.spec.tsx
📚 Learning: 2025-12-19T04:58:24.460Z
Learnt from: CR
Repo: JesusFilm/core PR: 0
File: apps/watch/AGENTS.md:0-0
Timestamp: 2025-12-19T04:58:24.460Z
Learning: Applies to apps/watch/src/**/*.spec.{ts,tsx} : Use the shared Jest setup in `apps/watch/setupTests.tsx` which already boots MSW, Next router mock, and has a longer async timeout.
Applied to files:
libs/journeys/ui/src/components/TemplateGallery/TagsFilter/TagsFilter.spec.tsxapps/journeys-admin/src/components/StatusTabPanel/StatusTabPanel.spec.tsx
📚 Learning: 2025-07-15T03:19:49.322Z
Learnt from: Kneesal
Repo: JesusFilm/core PR: 7171
File: apps/watch/src/components/LanguageSwitchDialog/SubtitlesSelect/SubtitlesSelect.spec.tsx:447-451
Timestamp: 2025-07-15T03:19:49.322Z
Learning: In the SubtitlesSelect component tests, the team intentionally uses integration tests that verify interactions work without errors rather than explicitly testing function calls, with explanatory comments to inform future developers of this testing strategy.
Applied to files:
libs/journeys/ui/src/components/TemplateGallery/TagsFilter/TagsFilter.spec.tsx
🧬 Code graph analysis (1)
libs/journeys/ui/src/components/TemplateGallery/TagsFilter/TagsFilter.spec.tsx (2)
libs/journeys/ui/src/components/TemplateGallery/data.ts (1)
getTagsMock(362-580)libs/journeys/ui/src/components/TemplateGallery/TagsFilter/TagsFilter.tsx (1)
TagsFilter(29-249)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (11)
- GitHub Check: Deploy Preview (resources, 8592/merge, pull_request, 22)
- GitHub Check: Deploy Preview (journeys-admin, 8592/merge, pull_request, 22)
- GitHub Check: Deploy Preview (videos-admin, 8592/merge, pull_request, 22)
- GitHub Check: Deploy Preview (watch, 8592/merge, pull_request, 22)
- GitHub Check: Deploy Preview (journeys, 8592/merge, pull_request, 22)
- GitHub Check: build (22)
- GitHub Check: lint (22)
- GitHub Check: test (22, 1/3)
- GitHub Check: test (22, 3/3)
- GitHub Check: test (22, 2/3)
- GitHub Check: Analyze (javascript)
🔇 Additional comments (8)
apps/journeys-admin/src/components/StatusTabPanel/StatusTabPanel.tsx (1)
146-171: LGTM on unmount logic.The
unmountUntilVisibleconditions correctly handle the default case (active tab whenstatusis undefined) and the explicit status cases for archived and trashed panels.apps/journeys-admin/src/components/StatusTabPanel/StatusTabPanel.spec.tsx (1)
150-154: Push assertions correctly verify thestatusparameter.The test expectations for
router.pushcalls are correctly updated to verify the newstatusquery parameter.Also applies to: 184-190, 220-226
libs/journeys/ui/src/components/TemplateGallery/TagsFilter/TagsFilter.tsx (2)
91-101: LGTM! The filter function correctly handles whitespace and case-insensitivity.The implementation properly addresses the spacebar bug by:
- Trimming leading/trailing whitespace before filtering
- Returning all options when input is only whitespace
- Performing case-insensitive substring matching
115-115: Good integration with Autocomplete.The
filterOptionsprop is correctly wired to override MUI's default filtering behavior.libs/journeys/ui/src/components/TemplateGallery/TagsFilter/TagsFilter.spec.tsx (4)
429-449: Good test coverage for leading/trailing space trimming.The test correctly verifies that input like
' Add 'filters to options containing "Add" after trimming.
451-467: Good test for whitespace-only input.Correctly verifies that typing only spaces returns all available options.
469-490: Good test for internal spaces preservation.Correctly verifies that spaces within the search term are not trimmed, ensuring exact substring matching after edge trimming.
492-528: Comprehensive case-insensitivity test.Good coverage of various case combinations (uppercase, mixed, lowercase) to verify the
toLowerCase()normalization works correctly.
✏️ Tip: You can disable this entire section by setting review_details to false in your review settings.
|
The latest updates on your projects.
|
|
The latest updates on your projects.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (5)
apps/journeys-admin/src/components/StatusTabPanel/StatusTabPanel.tsx (1)
63-65: Incomplete parameter rename: still reading fromtabinstead ofstatus.Line 64 reads from
router?.query?.tab, but the component now pushes tostatus(line 91) and checksstatusinunmountUntilVisible(lines 151, 161, 169). This inconsistency means URL-driven initial tab selection will fail when users navigate directly to a URL with?status=archived.🐛 Proposed fix
const tabIndex = - journeyStatusTabs.find((status) => status.queryParam === router?.query?.tab) + journeyStatusTabs.find((status) => status.queryParam === router?.query?.status) ?.tabIndex ?? 0apps/journeys-admin/src/components/StatusTabPanel/StatusTabPanel.spec.tsx (4)
16-19: Update default mock to usestatusinstead oftab.The default mock at line 18 still uses
tab, but the implementation (once fixed) will read fromstatus. Update for consistency.🐛 Proposed fix
jest.mock('next/router', () => ({ __esModule: true, - useRouter: jest.fn(() => ({ query: { tab: undefined } })) + useRouter: jest.fn(() => ({ query: { status: undefined } })) }))
94-120: Update mock to usestatusinstead oftab.This test verifies URL-driven initial tab selection. The mock at lines 96-98 uses
tab: 'archived', but should usestatus: 'archived'to match the renamed parameter.🐛 Proposed fix
mockedUseRouter.mockReturnValue({ query: { - tab: 'archived' + status: 'archived' } } as unknown as NextRouter)
122-158: Update mock to usestatusinstead oftab.Lines 126-127 mock
tab: 'archived', but should usestatus: 'archived'. The push expectation at lines 150-156 correctly expectsstatus.🐛 Proposed fix
mockedUseRouter.mockReturnValue({ query: { - tab: 'archived' + status: 'archived' }, push } as unknown as NextRouter)
160-194: Update mock to usestatusinstead oftab.Lines 164-165 mock
tab: 'active', but should usestatus: 'active'. The push expectation at lines 188-192 correctly expectsstatus.🐛 Proposed fix
mockedUseRouter.mockReturnValue({ query: { - tab: 'active' + status: 'active' }, push } as unknown as NextRouter)
📜 Review details
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro
Disabled knowledge base sources:
- Linear integration is disabled by default for public repositories
You can enable these sources in your CodeRabbit configuration.
📒 Files selected for processing (3)
apps/journeys-admin/src/components/StatusTabPanel/StatusTabPanel.spec.tsxapps/journeys-admin/src/components/StatusTabPanel/StatusTabPanel.tsxlibs/journeys/ui/src/components/TemplateGallery/TagsFilter/TagsFilter.spec.tsx
🚧 Files skipped from review as they are similar to previous changes (1)
- libs/journeys/ui/src/components/TemplateGallery/TagsFilter/TagsFilter.spec.tsx
🧰 Additional context used
📓 Path-based instructions (3)
**/*.{ts,tsx,js,jsx}
📄 CodeRabbit inference engine (.cursor/rules/base.mdc)
**/*.{ts,tsx,js,jsx}: Use early returns whenever possible to make the code more readable.
Use descriptive variable and function/const names.
Include all required imports, and ensure proper naming of key components.
Files:
apps/journeys-admin/src/components/StatusTabPanel/StatusTabPanel.tsxapps/journeys-admin/src/components/StatusTabPanel/StatusTabPanel.spec.tsx
**/*.{ts,tsx}
📄 CodeRabbit inference engine (.cursor/rules/base.mdc)
Define a type if possible.
Files:
apps/journeys-admin/src/components/StatusTabPanel/StatusTabPanel.tsxapps/journeys-admin/src/components/StatusTabPanel/StatusTabPanel.spec.tsx
apps/**/*.{js,jsx,ts,tsx}
📄 CodeRabbit inference engine (.cursor/rules/apps.mdc)
apps/**/*.{js,jsx,ts,tsx}: Always use MUI over HTML elements; avoid using CSS or tags.
Use descriptive variable and function/const names. Also, event functions should be named with a “handle” prefix, like “handleClick” for onClick and “handleKeyDown” for onKeyDown.
Implement accessibility features on elements. For example, a tag should have a tabindex=“0”, aria-label, on:click, and on:keydown, and similar attributes.
Files:
apps/journeys-admin/src/components/StatusTabPanel/StatusTabPanel.tsxapps/journeys-admin/src/components/StatusTabPanel/StatusTabPanel.spec.tsx
🧠 Learnings (5)
📚 Learning: 2025-12-19T04:58:24.460Z
Learnt from: CR
Repo: JesusFilm/core PR: 0
File: apps/watch/AGENTS.md:0-0
Timestamp: 2025-12-19T04:58:24.460Z
Learning: Applies to apps/watch/src/**/*.spec.{ts,tsx} : Co-locate React Testing Library specs under `*.spec.ts(x)` and mock network traffic with MSW handlers in `apps/watch/test`.
Applied to files:
apps/journeys-admin/src/components/StatusTabPanel/StatusTabPanel.spec.tsx
📚 Learning: 2025-12-19T04:58:24.460Z
Learnt from: CR
Repo: JesusFilm/core PR: 0
File: apps/watch/AGENTS.md:0-0
Timestamp: 2025-12-19T04:58:24.460Z
Learning: Applies to apps/watch/src/**/*.spec.{ts,tsx} : Enclose SWR-based hooks in `TestSWRConfig` (`apps/watch/test/TestSWRConfig.tsx`) to isolate cache state between assertions in tests.
Applied to files:
apps/journeys-admin/src/components/StatusTabPanel/StatusTabPanel.spec.tsx
📚 Learning: 2025-12-19T19:18:43.790Z
Learnt from: CR
Repo: JesusFilm/core PR: 0
File: apps/resources/AGENTS.md:0-0
Timestamp: 2025-12-19T19:18:43.790Z
Learning: Applies to apps/resources/**/*.spec.ts?(x) : Co-locate React Testing Library specs under `*.spec.ts(x)` and mock network traffic with MSW handlers in `apps/resources/test`
Applied to files:
apps/journeys-admin/src/components/StatusTabPanel/StatusTabPanel.spec.tsx
📚 Learning: 2025-12-19T04:58:24.460Z
Learnt from: CR
Repo: JesusFilm/core PR: 0
File: apps/watch/AGENTS.md:0-0
Timestamp: 2025-12-19T04:58:24.460Z
Learning: Applies to apps/watch/src/**/*.spec.{ts,tsx} : Use the shared Jest setup in `apps/watch/setupTests.tsx` which already boots MSW, Next router mock, and has a longer async timeout.
Applied to files:
apps/journeys-admin/src/components/StatusTabPanel/StatusTabPanel.spec.tsx
📚 Learning: 2025-12-19T19:18:43.790Z
Learnt from: CR
Repo: JesusFilm/core PR: 0
File: apps/resources/AGENTS.md:0-0
Timestamp: 2025-12-19T19:18:43.790Z
Learning: Applies to apps/resources/**/*.spec.ts?(x) : Enclose SWR-based hooks in `TestSWRConfig` (`apps/resources/test/TestSWRConfig.tsx`) to isolate cache state between assertions
Applied to files:
apps/journeys-admin/src/components/StatusTabPanel/StatusTabPanel.spec.tsx
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (7)
- GitHub Check: Deploy Preview (videos-admin, 8592/merge, pull_request, 22)
- GitHub Check: Deploy Preview (resources, 8592/merge, pull_request, 22)
- GitHub Check: Deploy Preview (watch, 8592/merge, pull_request, 22)
- GitHub Check: Deploy Preview (journeys, 8592/merge, pull_request, 22)
- GitHub Check: Deploy Preview (journeys-admin, 8592/merge, pull_request, 22)
- GitHub Check: lint (22)
- GitHub Check: build (22)
🔇 Additional comments (2)
apps/journeys-admin/src/components/StatusTabPanel/StatusTabPanel.tsx (1)
89-95: LGTM on thestatusparameter usage in push and unmountUntilVisible logic.The updated query parameter and mounting conditions are consistent with the rename to
status. Once line 64 is also updated to read fromstatus, the implementation will be fully consistent.Also applies to: 146-172
apps/journeys-admin/src/components/StatusTabPanel/StatusTabPanel.spec.tsx (1)
196-230: LGTM!This test correctly uses
statusin both the mock (line 201) and expectation (line 225). The other tests should follow this pattern.
✏️ Tip: You can disable this entire section by setting review_details to false in your review settings.
|
The latest updates on your projects.
|
|
The latest updates on your projects.
|
|
The latest updates on your projects.
|
| const filterOptions = (options: Tag[], state: { inputValue: string }) => { | ||
| const trimmedInput = state.inputValue.trim().toLowerCase() | ||
| if (trimmedInput === '') { | ||
| return options | ||
| } | ||
|
|
||
| return options.filter((option) => { | ||
| const label = option.name.find(({ primary }) => primary)?.value ?? '' | ||
| return label.toLowerCase().includes(trimmedInput) | ||
| }) | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems like MUI has a convenient way of doing this, can you investigate?
https://mui.com/material-ui/react-autocomplete/#custom-filter
Summary by CodeRabbit
Bug Fixes
Improvements
Tests
✏️ Tip: You can customize this high-level summary in your review settings.