-
-
Notifications
You must be signed in to change notification settings - Fork 1k
fixes: Refactor The Login and Registration Screens (#4818) #4951
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: develop
Are you sure you want to change the base?
fixes: Refactor The Login and Registration Screens (#4818) #4951
Conversation
|
No significant changes currently retry |
Our Pull Request Approval ProcessThis PR will be reviewed according to our: Your PR may be automatically closed if:
Thanks for contributing! |
WalkthroughRefactors authentication into reusable components: adds RegisterPage and RegistrationForm, replaces in-page register with composed LoginForm + AuthBranding, removes legacy UserPortal Register component and its tests/CSS, updates locale keys, introduces TypeScript interfaces, password validation util, style adjustments, and many new unit tests. Changes
Sequence Diagram(s)sequenceDiagram
actor User
participant Browser
participant RegisterPage
participant RegistrationForm
participant reCAPTCHA
participant GraphQL
participant Storage
participant Navigation
participant Toast
User->>Browser: Navigate to /register
Browser->>RegisterPage: Render (fetch orgs & community)
RegisterPage->>RegistrationForm: Provide role & org options
User->>RegistrationForm: Fill form & submit
RegistrationForm->>RegistrationForm: Validate inputs (PasswordValidator)
RegistrationForm->>reCAPTCHA: Request token (if enabled)
reCAPTCHA-->>RegistrationForm: Return token
RegistrationForm->>GraphQL: Call SIGNUP_MUTATION with form + token
GraphQL-->>RegistrationForm: Return success or error
alt Success
RegistrationForm->>Storage: Save token & user info
RegistrationForm->>Toast: Show success
RegisterPage->>Navigation: Redirect to invite or portal home
else Error
RegistrationForm->>Toast: Show error
end
Estimated code review effort🎯 4 (Complex) | ⏱️ ~45–60 minutes
Pre-merge checks and finishing touches❌ Failed checks (2 warnings)
✅ Passed checks (3 passed)
✨ 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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 22
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
src/assets/css/app.css (1)
413-420: Links are hard to distinguish from body text (WCAG affordance).With subdued gray and no underline, links can be indistinguishable from surrounding text, especially if rgba() fallback occurs. Add a persistent underline or a clearly distinct color to meet usability/AA expectations.
Consider:
a { - color: rgba(var(--bs-link-color-rgb), var(--bs-link-opacity, 1)); - text-decoration: none; + color: rgba(var(--bs-link-color-rgb), var(--bs-link-opacity, 1)); + text-decoration: underline; + text-underline-offset: 0.125em; } a:hover { - color: var(--bs-link-hover-color); + color: var(--bs-link-hover-color); + text-decoration-thickness: 2px; }
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro
📒 Files selected for processing (33)
public/locales/en/translation.json(2 hunks)public/locales/es/translation.json(1 hunks)public/locales/fr/translation.json(1 hunks)public/locales/hi/translation.json(1 hunks)public/locales/zh/translation.json(1 hunks)src/App.tsx(2 hunks)src/assets/css/app.css(5 hunks)src/components/UserPortal/Register/Register.module.css(0 hunks)src/components/UserPortal/Register/Register.spec.tsx(0 hunks)src/components/UserPortal/Register/Register.tsx(0 hunks)src/screens/LoginPage/LoginPage.tsx(3 hunks)src/screens/RegisterPage/RegisterPage.spec.tsx(1 hunks)src/screens/RegisterPage/RegisterPage.tsx(1 hunks)src/shared-components/AuthBranding/AuthBranding.spec.tsx(1 hunks)src/shared-components/AuthBranding/AuthBranding.tsx(1 hunks)src/shared-components/LoginForm/LoginForm.spec.tsx(1 hunks)src/shared-components/LoginForm/LoginForm.tsx(1 hunks)src/shared-components/OrganizationSelector/OrganizationSelector.spec.tsx(1 hunks)src/shared-components/OrganizationSelector/OrganizationSelector.tsx(1 hunks)src/shared-components/PasswordField/PasswordField.spec.tsx(1 hunks)src/shared-components/PasswordField/PasswordField.tsx(1 hunks)src/shared-components/PasswordValidator/PasswordValidator.spec.tsx(1 hunks)src/shared-components/PasswordValidator/PasswordValidator.tsx(1 hunks)src/shared-components/PasswordValidator/ValidationItem.tsx(1 hunks)src/shared-components/RegistrationForm/RegistrationForm.spec.tsx(1 hunks)src/shared-components/RegistrationForm/RegistrationForm.tsx(1 hunks)src/style/app-fixed.module.css(6 hunks)src/types/AuthBranding/interface.ts(1 hunks)src/types/LoginForm/interface.ts(1 hunks)src/types/OrganizationSelector/interface.ts(1 hunks)src/types/PasswordField/interface.ts(1 hunks)src/types/PasswordValidator/interface.ts(1 hunks)src/types/RegistrationForm/interface.ts(1 hunks)
💤 Files with no reviewable changes (3)
- src/components/UserPortal/Register/Register.spec.tsx
- src/components/UserPortal/Register/Register.tsx
- src/components/UserPortal/Register/Register.module.css
🧰 Additional context used
🧠 Learnings (45)
📓 Common learnings
Learnt from: JaiPannu-IITI
Repo: PalisadoesFoundation/talawa-admin PR: 3592
File: src/components/EventManagement/EventRegistrant/EventRegistrants.tsx:16-19
Timestamp: 2025-02-13T01:55:19.334Z
Learning: PR #3577 has already refactored components to ensure no duplicate interfaces and proper type management for both the components and their children. This is part of the systematic refactoring approach being followed.
Learnt from: PurnenduMIshra129th
Repo: PalisadoesFoundation/talawa-admin PR: 3814
File: public/locales/zh/translation.json:0-0
Timestamp: 2025-03-19T17:42:16.729Z
Learning: The PR #3814 focuses specifically on implementing sign up, sign in, sign out, and useSession in better auth (frontend), and translation changes in the Chinese localization file were not part of the intentional changes made by the author.
Learnt from: JaiPannu-IITI
Repo: PalisadoesFoundation/talawa-admin PR: 3592
File: src/components/UserPortal/ChatRoom/ChatRoom.tsx:23-23
Timestamp: 2025-02-14T21:04:11.392Z
Learning: The codebase is being refactored in alphabetical order, with components up to LoginPortalToggle already updated. Temporary type coexistence is maintained to prevent breaking changes until all related components are refactored.
Learnt from: bandhan-majumder
Repo: PalisadoesFoundation/talawa-admin PR: 3593
File: src/screens/UserPortal/Settings/Settings.tsx:1-1
Timestamp: 2025-02-14T07:49:53.498Z
Learning: The Settings component in talawa-admin should be split into smaller components and custom hooks to maintain code quality and meet line limit requirements. Key sections to extract: PersonalInfoSection, ContactInfoSection, and form logic hooks.
Learnt from: satyanvm
Repo: PalisadoesFoundation/talawa-admin PR: 0
File: :0-0
Timestamp: 2025-12-03T12:45:53.875Z
Learning: In talawa-admin reusable components, do not duplicate component prop interfaces in screens. Always import the shared interface from src/types/<Component>/interface.ts (e.g., InterfaceOrganizationCardProps) to keep usage in sync with the shared component.
Learnt from: Piyushk8
Repo: PalisadoesFoundation/talawa-admin PR: 3877
File: src/GraphQl/Queries/OrganizationQueries.ts:133-166
Timestamp: 2025-03-25T14:28:21.436Z
Learning: The user plans to address pagination inconsistencies and consolidate duplicate GraphQL queries (like USER_JOINED_ORGANIZATIONS_PG) in a future PR focused specifically on pagination fixes across the application.
📚 Learning: 2025-12-03T12:45:53.875Z
Learnt from: satyanvm
Repo: PalisadoesFoundation/talawa-admin PR: 0
File: :0-0
Timestamp: 2025-12-03T12:45:53.875Z
Learning: In talawa-admin reusable components, do not duplicate component prop interfaces in screens. Always import the shared interface from src/types/<Component>/interface.ts (e.g., InterfaceOrganizationCardProps) to keep usage in sync with the shared component.
Applied to files:
src/types/RegistrationForm/interface.tssrc/types/OrganizationSelector/interface.tssrc/types/AuthBranding/interface.tssrc/shared-components/RegistrationForm/RegistrationForm.tsxsrc/screens/RegisterPage/RegisterPage.tsxsrc/shared-components/OrganizationSelector/OrganizationSelector.tsxsrc/types/LoginForm/interface.tssrc/shared-components/AuthBranding/AuthBranding.tsx
📚 Learning: 2025-02-13T01:50:08.135Z
Learnt from: JaiPannu-IITI
Repo: PalisadoesFoundation/talawa-admin PR: 3592
File: src/components/EventManagement/EventRegistrant/EventRegistrants.tsx:16-19
Timestamp: 2025-02-13T01:50:08.135Z
Learning: The `InterfaceMember` and `InterfaceUser` interfaces are defined in centralized locations at `types/Event/interface.ts` and `types/User/interface.ts` respectively, as part of the refactoring to organize types by functionality.
Applied to files:
src/types/RegistrationForm/interface.tssrc/types/AuthBranding/interface.ts
📚 Learning: 2024-11-02T12:49:40.108Z
Learnt from: GlenDsza
Repo: PalisadoesFoundation/talawa-admin PR: 2397
File: src/utils/interfaces.ts:10-15
Timestamp: 2024-11-02T12:49:40.108Z
Learning: In the `src/utils/interfaces.ts` file of the Talawa Admin project, the `InterfaceUserInfo` interface should not include the `email` field, as it is generally not required on the frontend.
Applied to files:
src/types/RegistrationForm/interface.tssrc/types/AuthBranding/interface.tssrc/types/LoginForm/interface.ts
📚 Learning: 2024-10-30T12:01:40.366Z
Learnt from: meetulr
Repo: PalisadoesFoundation/talawa-admin PR: 2387
File: src/screens/ManageTag/ManageTagMockComponents/MockAddPeopleToTag.tsx:1-28
Timestamp: 2024-10-30T12:01:40.366Z
Learning: In the `MockAddPeopleToTag` component in `src/screens/ManageTag/ManageTagMockComponents/MockAddPeopleToTag.tsx`, it's acceptable to implement only the necessary props from `InterfaceAddPeopleToTagProps` and omit others like `refetchAssignedMembersData`, `t`, and `tCommon` that are tested separately.
Applied to files:
src/types/AuthBranding/interface.tssrc/shared-components/AuthBranding/AuthBranding.spec.tsxsrc/shared-components/OrganizationSelector/OrganizationSelector.spec.tsxsrc/shared-components/PasswordField/PasswordField.spec.tsxsrc/shared-components/RegistrationForm/RegistrationForm.spec.tsxsrc/screens/RegisterPage/RegisterPage.spec.tsxsrc/shared-components/LoginForm/LoginForm.spec.tsxsrc/shared-components/OrganizationSelector/OrganizationSelector.tsx
📚 Learning: 2025-02-14T21:04:11.392Z
Learnt from: JaiPannu-IITI
Repo: PalisadoesFoundation/talawa-admin PR: 3592
File: src/components/UserPortal/ChatRoom/ChatRoom.tsx:23-23
Timestamp: 2025-02-14T21:04:11.392Z
Learning: The codebase is being refactored in alphabetical order, with components up to LoginPortalToggle already updated. Temporary type coexistence is maintained to prevent breaking changes until all related components are refactored.
Applied to files:
src/shared-components/RegistrationForm/RegistrationForm.tsxsrc/screens/LoginPage/LoginPage.tsxsrc/shared-components/PasswordField/PasswordField.tsxsrc/shared-components/LoginForm/LoginForm.tsxsrc/screens/RegisterPage/RegisterPage.tsxsrc/shared-components/AuthBranding/AuthBranding.tsx
📚 Learning: 2024-10-08T16:13:41.996Z
Learnt from: Chaitanya1672
Repo: PalisadoesFoundation/talawa-admin PR: 2049
File: src/screens/OrganizationActionItems/ActionItemUpdateModal.tsx:112-138
Timestamp: 2024-10-08T16:13:41.996Z
Learning: The `istanbul ignore next` comments in the `ActionItemUpdateModal.tsx` file were added as part of a commit that introduced tests for the `ActionItemUpdateModal` component. Removing these comments and writing tests to cover the previously ignored lines is recommended to ensure code integrity and improve test coverage.
Applied to files:
src/shared-components/AuthBranding/AuthBranding.spec.tsxsrc/shared-components/OrganizationSelector/OrganizationSelector.spec.tsxsrc/shared-components/PasswordField/PasswordField.spec.tsxsrc/shared-components/RegistrationForm/RegistrationForm.spec.tsxsrc/shared-components/LoginForm/LoginForm.spec.tsxsrc/shared-components/PasswordValidator/PasswordValidator.spec.tsx
📚 Learning: 2025-11-28T16:02:31.814Z
Learnt from: rawadhossain
Repo: PalisadoesFoundation/talawa-admin PR: 4882
File: src/screens/UserPortal/Volunteer/UpcomingEvents/RecurringEventVolunteerModal.spec.tsx:69-109
Timestamp: 2025-11-28T16:02:31.814Z
Learning: In Talawa Admin test files (e.g., src/screens/UserPortal/Volunteer/UpcomingEvents/RecurringEventVolunteerModal.spec.tsx), developers prefer keeping date/time mocks (like vi.spyOn(Date.prototype, 'toLocaleDateString')) inline within individual test cases rather than consolidating them in beforeEach blocks, to maintain clarity and keep mocks close to the tests that use them, even if it results in some duplication.
Applied to files:
src/shared-components/AuthBranding/AuthBranding.spec.tsxsrc/shared-components/OrganizationSelector/OrganizationSelector.spec.tsxsrc/shared-components/PasswordField/PasswordField.spec.tsxsrc/shared-components/RegistrationForm/RegistrationForm.spec.tsxsrc/screens/RegisterPage/RegisterPage.spec.tsxsrc/shared-components/LoginForm/LoginForm.spec.tsx
📚 Learning: 2025-11-21T12:42:24.884Z
Learnt from: palisadoes
Repo: PalisadoesFoundation/talawa-admin PR: 4718
File: src/components/EventManagement/Dashboard/EventDashboard.mocks.ts:83-114
Timestamp: 2025-11-21T12:42:24.884Z
Learning: In talawa-admin mock files (e.g., EventDashboard.mocks.ts), mock constant names must accurately reflect what they test. Mock names suggesting role-based logic (e.g., MOCKS_WITH_ADMIN_ROLE) are misleading when the component derives role from localStorage rather than mock data. Name mocks based on their distinguishing data features (e.g., MOCKS_WITH_SINGLE_ATTENDEE) or test context (e.g., MOCKS_FOR_ADMIN_STORAGE_TEST).
Applied to files:
src/shared-components/AuthBranding/AuthBranding.spec.tsxsrc/shared-components/RegistrationForm/RegistrationForm.spec.tsx
📚 Learning: 2024-12-03T05:52:37.888Z
Learnt from: bitbard3
Repo: PalisadoesFoundation/talawa-admin PR: 2588
File: src/components/ChangeLanguageDropdown/ChangeLanguageDropdown.spec.tsx:155-162
Timestamp: 2024-12-03T05:52:37.888Z
Learning: In the `ChangeLanguageDropdown` component (`src/components/ChangeLanguageDropdown/ChangeLanguageDropdown.tsx`), error handling has not been implemented. Therefore, test cases in `src/components/ChangeLanguageDropdown/ChangeLanguageDropdown.spec.tsx` do not cover error scenarios related to error handling.
Applied to files:
src/shared-components/AuthBranding/AuthBranding.spec.tsxsrc/shared-components/OrganizationSelector/OrganizationSelector.spec.tsxsrc/shared-components/PasswordField/PasswordField.spec.tsxsrc/shared-components/RegistrationForm/RegistrationForm.spec.tsxsrc/shared-components/LoginForm/LoginForm.spec.tsxsrc/shared-components/PasswordValidator/PasswordValidator.spec.tsx
📚 Learning: 2025-04-20T06:45:57.175Z
Learnt from: bandhan-majumder
Repo: PalisadoesFoundation/talawa-admin PR: 3926
File: src/components/Advertisements/core/AdvertisementRegister/AdvertisementRegister.spec.tsx:403-421
Timestamp: 2025-04-20T06:45:57.175Z
Learning: In the talawa-admin project, the Advertisement component tests (3 files) use both ApolloProvider and MockedProvider together, though it's not a widespread pattern in the codebase. The maintainer has confirmed this approach is needed for these specific tests.
Applied to files:
src/shared-components/AuthBranding/AuthBranding.spec.tsxsrc/shared-components/OrganizationSelector/OrganizationSelector.spec.tsxsrc/shared-components/PasswordField/PasswordField.spec.tsxsrc/shared-components/RegistrationForm/RegistrationForm.spec.tsxsrc/screens/RegisterPage/RegisterPage.spec.tsxsrc/shared-components/LoginForm/LoginForm.spec.tsx
📚 Learning: 2025-08-17T07:39:34.255Z
Learnt from: syedali237
Repo: PalisadoesFoundation/talawa-admin PR: 4077
File: package.json:189-213
Timestamp: 2025-08-17T07:39:34.255Z
Learning: The Talawa Admin codebase primarily uses .spec.tsx/.spec.ts naming convention for unit tests, with Cypress tests using .cy.ts pattern. However, there is at least one .test.tsx file in the codebase, so NYC exclude patterns should include both .spec and .test patterns.
Applied to files:
src/shared-components/AuthBranding/AuthBranding.spec.tsxsrc/shared-components/OrganizationSelector/OrganizationSelector.spec.tsxsrc/shared-components/PasswordField/PasswordField.spec.tsxsrc/shared-components/RegistrationForm/RegistrationForm.spec.tsxsrc/shared-components/PasswordValidator/PasswordValidator.spec.tsx
📚 Learning: 2025-11-30T23:13:22.697Z
Learnt from: Ansingh0305
Repo: PalisadoesFoundation/talawa-admin PR: 0
File: :0-0
Timestamp: 2025-11-30T23:13:22.697Z
Learning: In talawa-admin PR #4908, increasing test concurrency from maxConcurrency: 1 to 6-12 with TOTAL_SHARDS: 12 exposed three critical latent bugs: (1) EventsAttendedByUser.spec.tsx used wrong GraphQL query mock (EVENT_DETAILS vs EVENT_DETAILS_BASIC with incorrect variable names), (2) User.mocks.ts missing search/reset refetch scenarios causing "No more mocked responses" errors, (3) EventCalendar.spec.tsx UTC timezone bug where new Date().toISOString() caused date calculation mismatches in non-UTC timezones. These bugs were masked at lower concurrency but surfaced consistently under parallel execution stress-testing. Fix involved aligning mocks with actual component queries and explicit timezone-aware date construction.
Applied to files:
src/shared-components/AuthBranding/AuthBranding.spec.tsxsrc/shared-components/OrganizationSelector/OrganizationSelector.spec.tsxsrc/shared-components/RegistrationForm/RegistrationForm.spec.tsxsrc/screens/RegisterPage/RegisterPage.spec.tsx
📚 Learning: 2024-11-02T07:48:36.443Z
Learnt from: meetulr
Repo: PalisadoesFoundation/talawa-admin PR: 2398
File: src/components/AddPeopleToTag/AddPeopleToTag.test.tsx:177-241
Timestamp: 2024-11-02T07:48:36.443Z
Learning: In `src/components/AddPeopleToTag/AddPeopleToTag.test.tsx`, prefer keeping test cases separate and more readable, even if it involves some duplication, instead of extracting common logic into helper functions.
Applied to files:
src/shared-components/AuthBranding/AuthBranding.spec.tsxsrc/shared-components/OrganizationSelector/OrganizationSelector.spec.tsxsrc/shared-components/PasswordField/PasswordField.spec.tsxsrc/shared-components/RegistrationForm/RegistrationForm.spec.tsxsrc/shared-components/LoginForm/LoginForm.spec.tsxsrc/shared-components/PasswordValidator/PasswordValidator.spec.tsx
📚 Learning: 2024-11-01T12:54:20.857Z
Learnt from: GlenDsza
Repo: PalisadoesFoundation/talawa-admin PR: 2397
File: src/screens/OrganizationActionItems/testObject.mocks.ts:184-402
Timestamp: 2024-11-01T12:54:20.857Z
Learning: In `src/screens/OrganizationActionItems/testObject.mocks.ts`, test failures are not dependent on the `createdAt` fields; hardcoded dates in `createdAt` fields do not cause test failures in this file.
Applied to files:
src/shared-components/AuthBranding/AuthBranding.spec.tsxsrc/shared-components/OrganizationSelector/OrganizationSelector.spec.tsxsrc/screens/RegisterPage/RegisterPage.spec.tsx
📚 Learning: 2025-01-26T12:32:45.867Z
Learnt from: IITI-tushar
Repo: PalisadoesFoundation/talawa-admin PR: 3400
File: src/screens/UserPortal/Organizations/Organizations.spec.tsx:19-19
Timestamp: 2025-01-26T12:32:45.867Z
Learning: In React test files, avoid using React hooks outside component scope (including in static objects like mock data). Instead, initialize hooks inside describe blocks or extract the needed functionality without using hooks.
Applied to files:
src/shared-components/AuthBranding/AuthBranding.spec.tsxsrc/shared-components/OrganizationSelector/OrganizationSelector.spec.tsxsrc/shared-components/PasswordField/PasswordField.spec.tsxsrc/shared-components/RegistrationForm/RegistrationForm.spec.tsxsrc/screens/RegisterPage/RegisterPage.spec.tsxsrc/shared-components/LoginForm/LoginForm.spec.tsxsrc/shared-components/PasswordValidator/PasswordValidator.spec.tsx
📚 Learning: 2025-03-11T17:45:54.621Z
Learnt from: PurnenduMIshra129th
Repo: PalisadoesFoundation/talawa-admin PR: 3814
File: src/components/UserPortal/OrganizationNavbar/OrganizationNavbar.spec.tsx:137-146
Timestamp: 2025-03-11T17:45:54.621Z
Learning: In OrganizationNavbar.spec.tsx, separate vi.mock implementations for react-router-dom are needed to avoid errors - one for useNavigate and another for useParams.
Applied to files:
src/shared-components/AuthBranding/AuthBranding.spec.tsxsrc/shared-components/OrganizationSelector/OrganizationSelector.spec.tsxsrc/shared-components/RegistrationForm/RegistrationForm.spec.tsxsrc/screens/RegisterPage/RegisterPage.spec.tsxsrc/App.tsxsrc/shared-components/LoginForm/LoginForm.spec.tsx
📚 Learning: 2024-11-27T06:37:47.871Z
Learnt from: adithyanotfound
Repo: PalisadoesFoundation/talawa-admin PR: 2482
File: src/components/AddOn/support/components/Action/Action.spec.tsx:1-8
Timestamp: 2024-11-27T06:37:47.871Z
Learning: In the Talawa-Admin project, the `testing-library/jest-dom` package is imported globally in `vitest.setup.ts`, so individual test files do not need to import it separately.
Applied to files:
src/shared-components/AuthBranding/AuthBranding.spec.tsx
📚 Learning: 2024-11-02T07:18:39.563Z
Learnt from: meetulr
Repo: PalisadoesFoundation/talawa-admin PR: 2398
File: src/screens/OrganizationTags/OrganizationTags.test.tsx:184-0
Timestamp: 2024-11-02T07:18:39.563Z
Learning: In the `talawa-admin` project, it's acceptable for test cases in `src/screens/OrganizationTags/OrganizationTags.test.tsx` to test multiple behaviors within a single test function without needing to split them into smaller, focused tests.
Applied to files:
src/shared-components/AuthBranding/AuthBranding.spec.tsxsrc/shared-components/OrganizationSelector/OrganizationSelector.spec.tsxsrc/shared-components/RegistrationForm/RegistrationForm.spec.tsxsrc/screens/RegisterPage/RegisterPage.spec.tsx
📚 Learning: 2024-11-11T07:47:39.266Z
Learnt from: meetulr
Repo: PalisadoesFoundation/talawa-admin PR: 2425
File: src/screens/MemberDetail/MemberDetail.test.tsx:100-100
Timestamp: 2024-11-11T07:47:39.266Z
Learning: In `src/screens/MemberDetail/MemberDetail.test.tsx`, using `await wait();` is acceptable to wait for the render to complete.
Applied to files:
src/shared-components/AuthBranding/AuthBranding.spec.tsxsrc/shared-components/RegistrationForm/RegistrationForm.spec.tsxsrc/screens/RegisterPage/RegisterPage.spec.tsxsrc/shared-components/LoginForm/LoginForm.spec.tsx
📚 Learning: 2025-02-20T13:35:01.218Z
Learnt from: syedali237
Repo: PalisadoesFoundation/talawa-admin PR: 3712
File: src/components/EventCalender/Yearly/YearlyEventCalender.spec.tsx:113-127
Timestamp: 2025-02-20T13:35:01.218Z
Learning: In React component tests, when testing window resize event handling, it's acceptable to only verify that the event is properly triggered without assertions if the test's focus is specifically on event handling rather than responsive behavior. Testing the actual responsive rendering would be a separate test case.
Applied to files:
src/shared-components/AuthBranding/AuthBranding.spec.tsxsrc/shared-components/PasswordField/PasswordField.spec.tsxsrc/shared-components/LoginForm/LoginForm.spec.tsxsrc/shared-components/PasswordValidator/PasswordValidator.spec.tsx
📚 Learning: 2025-10-22T22:00:53.943Z
Learnt from: Jashan32
Repo: PalisadoesFoundation/talawa-admin PR: 4524
File: src/screens/OrganizationDashboard/OrganizationDashboardMocks.ts:0-0
Timestamp: 2025-10-22T22:00:53.943Z
Learning: In src/screens/OrganizationDashboard/OrganizationDashboardMocks.ts (and similar mock files), avoid duplicating identical Apollo MockedProvider mocks for repeated query consumption. Prefer adding `maxUsageCount` to the existing mock or using `newData` for reusable responses to keep tests deterministic and reduce drift.
Applied to files:
src/shared-components/OrganizationSelector/OrganizationSelector.spec.tsxsrc/screens/RegisterPage/RegisterPage.spec.tsx
📚 Learning: 2024-10-30T13:18:56.627Z
Learnt from: meetulr
Repo: PalisadoesFoundation/talawa-admin PR: 2387
File: src/screens/OrganizationTags/OrganizationTags.tsx:350-376
Timestamp: 2024-10-30T13:18:56.627Z
Learning: In the `src/screens/OrganizationTags/OrganizationTags.tsx` file, the `OrganizationTags` component uses chunk size with the `InfiniteScroll` component and an outer parent div for handling data loading and scrolling.
Applied to files:
src/shared-components/OrganizationSelector/OrganizationSelector.spec.tsxsrc/shared-components/OrganizationSelector/OrganizationSelector.tsx
📚 Learning: 2025-11-27T11:41:54.843Z
Learnt from: rawadhossain
Repo: PalisadoesFoundation/talawa-admin PR: 4865
File: src/components/EventRegistrantsModal/Modal/EventRegistrantsModal.spec.tsx:302-328
Timestamp: 2025-11-27T11:41:54.843Z
Learning: In Talawa Admin tests (e.g., src/components/EventRegistrantsModal/Modal/EventRegistrantsModal.spec.tsx), using queryByLabelText with an HTMLElement cast for MUI Autocomplete inputs is acceptable because the Autocomplete input can mount asynchronously and isn't always available for strict getBy* queries at initial render. This pattern is stable for MUI Autocomplete components.
Applied to files:
src/shared-components/OrganizationSelector/OrganizationSelector.spec.tsxsrc/shared-components/RegistrationForm/RegistrationForm.spec.tsxsrc/screens/RegisterPage/RegisterPage.spec.tsxsrc/shared-components/LoginForm/LoginForm.spec.tsxsrc/shared-components/PasswordValidator/PasswordValidator.spec.tsx
📚 Learning: 2025-02-09T06:22:23.028Z
Learnt from: adithyanotfound
Repo: PalisadoesFoundation/talawa-admin PR: 3569
File: src/screens/UserPortal/Settings/Settings.spec.tsx:314-316
Timestamp: 2025-02-09T06:22:23.028Z
Learning: In the Settings component's tests, `fireEvent.change` should be used instead of `userEvent.type` for the address input field, as `userEvent` doesn't work correctly in this case.
Applied to files:
src/shared-components/PasswordField/PasswordField.spec.tsx
📚 Learning: 2024-12-22T17:58:17.818Z
Learnt from: IITI-tushar
Repo: PalisadoesFoundation/talawa-admin PR: 2718
File: src/screens/UserPortal/Settings/Settings.spec.tsx:0-0
Timestamp: 2024-12-22T17:58:17.818Z
Learning: The matchMedia mock implementation in `Settings.spec.tsx` no longer includes the deprecated addListener and removeListener methods, opting solely for addEventListener and removeEventListener.
Applied to files:
src/shared-components/RegistrationForm/RegistrationForm.spec.tsxsrc/shared-components/LoginForm/LoginForm.spec.tsx
📚 Learning: 2025-10-22T22:22:27.696Z
Learnt from: Jashan32
Repo: PalisadoesFoundation/talawa-admin PR: 4524
File: src/screens/Requests/Requests.spec.tsx:0-0
Timestamp: 2025-10-22T22:22:27.696Z
Learning: In talawa-admin tests using react-infinite-scroll-component (e.g., src/screens/Requests/Requests.spec.tsx), jsdom scroll is flaky. Prefer a resilient approach: try querying the container via document.querySelector('[data-testid="infinite-scroll-component"]') and fall back to window scroll if missing. Strengthen assertions by checking for page-2 items (e.g., "User9 Test") to ensure fetchMore actually ran instead of relying only on row counts.
Applied to files:
src/shared-components/RegistrationForm/RegistrationForm.spec.tsxsrc/screens/RegisterPage/RegisterPage.spec.tsxsrc/shared-components/LoginForm/LoginForm.spec.tsxsrc/shared-components/PasswordValidator/PasswordValidator.spec.tsx
📚 Learning: 2025-03-19T17:42:16.729Z
Learnt from: PurnenduMIshra129th
Repo: PalisadoesFoundation/talawa-admin PR: 3814
File: public/locales/zh/translation.json:0-0
Timestamp: 2025-03-19T17:42:16.729Z
Learning: The PR #3814 focuses specifically on implementing sign up, sign in, sign out, and useSession in better auth (frontend), and translation changes in the Chinese localization file were not part of the intentional changes made by the author.
Applied to files:
public/locales/zh/translation.jsonpublic/locales/fr/translation.jsonpublic/locales/hi/translation.jsonpublic/locales/es/translation.jsonsrc/shared-components/AuthBranding/AuthBranding.tsxpublic/locales/en/translation.json
📚 Learning: 2025-04-05T08:30:08.858Z
Learnt from: adithyanotfound
Repo: PalisadoesFoundation/talawa-admin PR: 3915
File: src/screens/LoginPage/LoginPage.tsx:458-459
Timestamp: 2025-04-05T08:30:08.858Z
Learning: The "adminLogin" translation key is used in LoginPage.tsx and should be present in translation.json files for all languages, not in common.json or errors.json files. The key is accessed using the t() function, not tCommon().
Applied to files:
public/locales/zh/translation.jsonpublic/locales/fr/translation.jsonsrc/screens/LoginPage/LoginPage.tsxsrc/shared-components/LoginForm/LoginForm.tsxpublic/locales/hi/translation.jsonpublic/locales/es/translation.jsonpublic/locales/en/translation.json
📚 Learning: 2025-11-11T11:51:09.236Z
Learnt from: Ansingh0305
Repo: PalisadoesFoundation/talawa-admin PR: 0
File: :0-0
Timestamp: 2025-11-11T11:51:09.236Z
Learning: In talawa-admin PR #4664 (continuation of PR #4565 sharding work), global mock cleanup was implemented via vi.clearAllMocks() in vitest.setup.ts afterEach, along with Apollo Client warning suppression (temporary, pending follow-up PR) and test suite refactoring to per-test StaticMockLink instances. This test isolation strategy addresses mock state leakage that forced maxConcurrency: 1 in PR #4565, enabling future parallel test execution improvements and 3-4x speedup potential.
Applied to files:
src/screens/RegisterPage/RegisterPage.spec.tsx
📚 Learning: 2025-11-12T00:28:53.713Z
Learnt from: Ansingh0305
Repo: PalisadoesFoundation/talawa-admin PR: 0
File: :0-0
Timestamp: 2025-11-12T00:28:53.713Z
Learning: In talawa-admin PR #4565 continuation (PR #4664 planned), Phase 2A mock isolation strategy uses global vi.clearAllMocks() in afterEach (vitest.setup.ts) plus refactoring module-level vi.fn() into per-test beforeEach blocks across 6 parallelizable issues (2A.0 foundation, 2A.1-2A.4 directory-based fixes, 2A.5 validation). This approach addresses mock call history accumulation enabling maxConcurrency: 2 and 2.3-2.5x speedup. vi.restoreAllMocks() alternative considered for spy restoration during validation phase. Phase 2A (mocks) correctly separated from Phase 2B (DOM/Apollo).
Applied to files:
src/screens/RegisterPage/RegisterPage.spec.tsx
📚 Learning: 2025-04-20T06:45:57.175Z
Learnt from: bandhan-majumder
Repo: PalisadoesFoundation/talawa-admin PR: 3926
File: src/components/Advertisements/core/AdvertisementRegister/AdvertisementRegister.spec.tsx:403-421
Timestamp: 2025-04-20T06:45:57.175Z
Learning: Using both ApolloProvider and MockedProvider together in tests is an established pattern in this codebase, even though it's technically redundant from Apollo Client's best practices perspective.
Applied to files:
src/screens/RegisterPage/RegisterPage.spec.tsx
📚 Learning: 2025-02-06T20:56:05.378Z
Learnt from: PurnenduMIshra129th
Repo: PalisadoesFoundation/talawa-admin PR: 3491
File: src/components/UserPortal/SecuredRouteForUser/SecuredRouteForUser.tsx:34-43
Timestamp: 2025-02-06T20:56:05.378Z
Learning: In SecuredRouteForUser component, token updates between role switches (e.g., user to superAdmin) are better handled using separate useEffect hooks - one for initial token setup (empty deps) and another for refetch on token changes, rather than combining them into a single effect.
Applied to files:
src/App.tsx
📚 Learning: 2025-08-20T18:04:23.118Z
Learnt from: Jashan32
Repo: PalisadoesFoundation/talawa-admin PR: 4094
File: src/screens/OrgList/OrgList.tsx:435-0
Timestamp: 2025-08-20T18:04:23.118Z
Learning: In the talawa-admin codebase, pagination logic for the admin orglist page in src/screens/OrgList/OrgList.tsx was directly extracted from the user's orglist page without modifications to maintain consistency between the two implementations.
Applied to files:
src/screens/RegisterPage/RegisterPage.tsxsrc/shared-components/OrganizationSelector/OrganizationSelector.tsx
📚 Learning: 2025-08-20T18:04:52.324Z
Learnt from: Jashan32
Repo: PalisadoesFoundation/talawa-admin PR: 4094
File: src/screens/OrgList/OrgList.tsx:0-0
Timestamp: 2025-08-20T18:04:52.324Z
Learning: In PR #4094, the user confirmed that the pagination logic in src/screens/OrgList/OrgList.tsx was directly extracted from the user's orglist page without modifications for initial implementation, with plans to refactor for consistency later.
Applied to files:
src/screens/RegisterPage/RegisterPage.tsxsrc/shared-components/OrganizationSelector/OrganizationSelector.tsx
📚 Learning: 2025-08-20T18:04:34.194Z
Learnt from: Jashan32
Repo: PalisadoesFoundation/talawa-admin PR: 4094
File: src/screens/OrgList/OrgList.tsx:409-0
Timestamp: 2025-08-20T18:04:34.194Z
Learning: In PR #4094, the pagination logic in src/screens/OrgList/OrgList.tsx was directly extracted from the user's orglist page without modification for initial implementation, with plans to refactor for consistency later.
Applied to files:
src/screens/RegisterPage/RegisterPage.tsxsrc/shared-components/OrganizationSelector/OrganizationSelector.tsx
📚 Learning: 2025-07-12T19:51:11.453Z
Learnt from: syedali237
Repo: PalisadoesFoundation/talawa-admin PR: 3988
File: cypress/e2e/login_spec/adminLogin.cy.ts:6-18
Timestamp: 2025-07-12T19:51:11.453Z
Learning: In the talawa-admin project, specifically in login test files like cypress/e2e/login_spec/adminLogin.cy.ts, the user syedali237 prefers keeping explicit UI login flows rather than using the custom `loginByApi` command to make the login functionality clearer and more demonstrative of how the actual login process works.
Applied to files:
src/shared-components/LoginForm/LoginForm.spec.tsx
📚 Learning: 2024-10-30T13:16:35.635Z
Learnt from: meetulr
Repo: PalisadoesFoundation/talawa-admin PR: 2387
File: src/screens/OrganizationTags/OrganizationTags.tsx:370-373
Timestamp: 2024-10-30T13:16:35.635Z
Learning: In `src/screens/OrganizationTags/OrganizationTags.tsx`, when mapping rows for the DataGrid, use `index + 1` as the `id` because the index number plus one is required.
Applied to files:
src/shared-components/OrganizationSelector/OrganizationSelector.tsx
📚 Learning: 2024-09-27T05:15:08.634Z
Learnt from: adithyanotfound
Repo: PalisadoesFoundation/talawa-admin PR: 2300
File: src/state/hooks.ts:4-4
Timestamp: 2024-09-27T05:15:08.634Z
Learning: In this project, `useSelector` is not required, and a custom `useAppSelector` hook is unnecessary.
Applied to files:
src/shared-components/OrganizationSelector/OrganizationSelector.tsx
📚 Learning: 2025-11-28T18:25:57.426Z
Learnt from: krikera
Repo: PalisadoesFoundation/talawa-admin PR: 4887
File: src/components/LoginPortalToggle/LoginPortalToggle.spec.tsx:57-59
Timestamp: 2025-11-28T18:25:57.426Z
Learning: In talawa-admin tests, when testing CSS module class names (imported as `styles from '*.module.css'`), prefer importing the styles module and using `toHaveClass(styles.className)` over `className.toContain('className')`. Vite hashes CSS module class names (e.g., activeLink → _activeLink_d8535b), so `toHaveClass('activeLink')` with plain strings will fail. The styles import approach is semantic, type-safe, and matches patterns in SideToggle.spec.tsx. Alternatively, `className.toContain()` is acceptable for substring matching without imports.
Applied to files:
src/shared-components/PasswordValidator/PasswordValidator.spec.tsxsrc/style/app-fixed.module.css
📚 Learning: 2025-01-07T10:16:15.158Z
Learnt from: IITI-tushar
Repo: PalisadoesFoundation/talawa-admin PR: 3041
File: .github/workflows/css_check.py:113-117
Timestamp: 2025-01-07T10:16:15.158Z
Learning: The talawa-admin codebase uses multiple CSS import patterns:
1. Component-specific module CSS files (ComponentName.module.css)
2. Global app styles (app.module.css) from the style directory
3. Third-party library CSS imports
Applied to files:
src/style/app-fixed.module.css
📚 Learning: 2025-01-07T09:50:29.019Z
Learnt from: IITI-tushar
Repo: PalisadoesFoundation/talawa-admin PR: 3041
File: .github/workflows/css_check.py:11-22
Timestamp: 2025-01-07T09:50:29.019Z
Learning: In the talawa-admin project, CSS validation in TypeScript files should only check for hex color codes using the pattern `#([0-9a-fA-F]{3}){1,2}` and ensure that files only reference the `src/style/app.module.css` stylesheet.
Applied to files:
src/style/app-fixed.module.css
📚 Learning: 2025-04-13T10:05:41.802Z
Learnt from: bandhan-majumder
Repo: PalisadoesFoundation/talawa-admin PR: 3926
File: src/style/app-fixed.module.css:8456-8463
Timestamp: 2025-04-13T10:05:41.802Z
Learning: For the Talawa Admin repository, focus feedback on substantive issues rather than minor styling suggestions, especially when the code follows established patterns in the codebase.
Applied to files:
src/style/app-fixed.module.css
📚 Learning: 2025-01-07T10:16:22.006Z
Learnt from: IITI-tushar
Repo: PalisadoesFoundation/talawa-admin PR: 3041
File: .github/workflows/css_check.py:73-82
Timestamp: 2025-01-07T10:16:22.006Z
Learning: In the talawa-admin project's CSS validation script, CSS imports should be validated using pattern matching (e.g., checking file extensions) rather than hardcoded full paths to maintain flexibility and easier maintenance.
Applied to files:
src/style/app-fixed.module.css
📚 Learning: 2025-01-18T09:54:57.554Z
Learnt from: prathmesh703
Repo: PalisadoesFoundation/talawa-admin PR: 3309
File: src/screens/UserPortal/Organizations/Organizations.module.css:19-19
Timestamp: 2025-01-18T09:54:57.554Z
Learning: In the Organizations screen of talawa-admin, use `height: 100vh` instead of `min-height: 100vh` for the `.content` class to ensure proper positioning of the pagination section at the bottom. The container uses `overflow: auto` to handle content that exceeds the viewport height.
Applied to files:
src/style/app-fixed.module.css
🧬 Code graph analysis (8)
src/shared-components/RegistrationForm/RegistrationForm.tsx (2)
src/types/RegistrationForm/interface.ts (2)
InterfaceRegistrationFormProps(4-13)IRegistrationData(15-22)src/Constant/constant.ts (2)
REACT_APP_USE_RECAPTCHA(4-4)RECAPTCHA_SITE_KEY(3-3)
src/screens/RegisterPage/RegisterPage.spec.tsx (2)
src/GraphQl/Queries/Queries.ts (2)
ORGANIZATION_LIST_NO_MEMBERS(87-95)GET_COMMUNITY_DATA_PG(1115-1136)src/GraphQl/Mutations/mutations.ts (1)
SIGNUP_MUTATION(122-143)
src/shared-components/PasswordField/PasswordField.tsx (1)
src/types/PasswordField/interface.ts (1)
InterfacePasswordFieldProps(4-14)
src/shared-components/PasswordValidator/PasswordValidator.tsx (1)
src/types/PasswordValidator/interface.ts (1)
InterfacePasswordValidatorProps(4-13)
src/shared-components/LoginForm/LoginForm.tsx (2)
src/types/LoginForm/interface.ts (1)
InterfaceLoginFormProps(4-14)src/Constant/constant.ts (2)
REACT_APP_USE_RECAPTCHA(4-4)RECAPTCHA_SITE_KEY(3-3)
src/screens/RegisterPage/RegisterPage.tsx (7)
src/utils/useLocalstorage.ts (4)
useLocalStorage(61-70)getItem(29-33)setItem(41-44)removeItem(51-54)src/GraphQl/Mutations/mutations.ts (2)
RECAPTCHA_MUTATION(255-259)SIGNUP_MUTATION(122-143)src/GraphQl/Queries/Queries.ts (2)
GET_COMMUNITY_DATA_PG(1115-1136)ORGANIZATION_LIST_NO_MEMBERS(87-95)src/utils/interfaces.ts (1)
InterfaceQueryOrganizationListObject(1375-1380)src/types/RegistrationForm/interface.ts (1)
IRegistrationData(15-22)src/Constant/constant.ts (1)
REACT_APP_USE_RECAPTCHA(4-4)src/utils/errorHandler.tsx (1)
errorHandler(10-32)
src/shared-components/OrganizationSelector/OrganizationSelector.tsx (1)
src/types/OrganizationSelector/interface.ts (1)
InterfaceOrganizationSelectorProps(4-10)
src/shared-components/AuthBranding/AuthBranding.tsx (3)
src/constants.ts (1)
socialMediaLinks(12-53)src/assets/svgs/social-icons/index.tsx (8)
FacebookLogo(11-11)XLogo(16-16)LinkedInLogo(14-14)GithubLogo(12-12)YoutubeLogo(17-17)SlackLogo(15-15)InstagramLogo(13-13)RedditLogo(18-18)src/types/AuthBranding/interface.ts (1)
InterfaceAuthBrandingProps(4-11)
🪛 Biome (2.1.2)
src/shared-components/RegistrationForm/RegistrationForm.spec.tsx
[error] 24-30: Enforce that elements with ARIA roles must use a valid, non-abstract ARIA role.
Check WAI-ARIA for valid roles or provide options accordingly.
Unsafe fix: Remove the invalid role attribute.
Check the list of all valid role attributes.
(lint/a11y/useValidAriaRole)
src/shared-components/LoginForm/LoginForm.spec.tsx
[error] 18-23: Enforce that elements with ARIA roles must use a valid, non-abstract ARIA role.
Check WAI-ARIA for valid roles or provide options accordingly.
Unsafe fix: Remove the invalid role attribute.
Check the list of all valid role attributes.
(lint/a11y/useValidAriaRole)
src/assets/css/app.css
Outdated
| --bs-body-font-family: 'Inter', Arial, Helvetica, sans-serif; | ||
| } |
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.
🧹 Nitpick | 🔵 Trivial
Place the body font variable where Bootstrap tokens are defined.
You override --bs-body-font-family far from the initial token block (Line 91). Move this override next to the main :root token definitions to avoid drift and surprises.
-:root {
- --bs-body-font-family: 'Inter', Arial, Helvetica, sans-serif;
-}
+/* near other :root tokens (around initial var block) */
+:root {
+ --bs-body-font-family: 'Inter', Arial, Helvetica, sans-serif;
+}Committable suggestion skipped: line range outside the PR's diff.
🤖 Prompt for AI Agents
In src/assets/css/app.css around lines 14177-14178, the override of
--bs-body-font-family is placed far from the main Bootstrap token block (around
line 91); remove this override at 14177-14178 and add the same
--bs-body-font-family declaration into the primary :root token definitions near
line 91 so all Bootstrap CSS custom properties live together and avoid drift.
src/shared-components/RegistrationForm/RegistrationForm.spec.tsx
Outdated
Show resolved
Hide resolved
palisadoes
left a comment
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.
- Please ensure code rabbit approves your work
- There are many serious deficiencies
|
@coderabbitai Evaluate this PR and determine whether the refactored files comply with the desired outcome outlined in this document. If they do not, provide guidance on how the files could be refactored to be compliant and give your review a “requested changes” status. https://docs-admin.talawa.io/docs/developer-resources/refactoring-guidelines Also do a full review and reevaluate all resolved items. If the PR requires any changes, even trivial ones, then give your review a “requested changes” status. If no changes are required then give the PR an “approved” status. |
|
Tip For best results, initiate chat on the files or code changes. 🧩 Analysis chain🏁 Script executed: Length of output: 9769 🌐 Web query: 💡 Result: I couldn't find any pages on docs-admin.talawa.io containing "refactoring guidelines." Possible next steps:
Which would you like? 🏁 Script executed: Length of output: 9640 🌐 Web query: 💡 Result: I couldn't find a page titled "Refactoring Guidelines" on docs.talawa.io. The docs do mention refactoring needs (e.g., "we need to refactor the code to be internationally acceptable") in the features/desired-features sections. See: [1], [2]. Sources:
🏁 Script executed: Length of output: 148 🌐 Web query: 💡 Result: Here are official Talawa refactoring/developer resources and where to find guidelines:
If you want, I can open any of those pages and extract the specific refactor/checklist rules (coding standards, linters, tests, branch/PR expectations) into a single actionable checklist. 🏁 Script executed: Length of output: 0 🌐 Web query: 💡 Result: I didn't find a page titled "Refactoring guidelines" on developer.palisadoes.org. Relevant pages that mention refactoring or development guidelines:
If you want, I can (a) search inside those pages for specific refactoring best-practices, (b) open CONTRIBUTING.md or PR_GUIDELINES.md on a specific repo, or (c) fetch any page in full. Which would you prefer? Citations:
🏁 Script executed: Length of output: 9923 🏁 Script executed: Length of output: 0 🌐 Web query: 💡 Result: I couldn't find a dedicated "Refactoring Guidelines" page on developer.palisadoes.org. Relevant pages that mention refactoring or refactor-related guidance are:
If you want, I can open any of those pages and extract the exact refactor-related passages. 🏁 Script executed: Length of output: 2295 🏁 Script executed: Length of output: 1466 🏁 Script executed: Length of output: 968 🏁 Script executed: Length of output: 673 🏁 Script executed: Length of output: 3156 🏁 Script executed: Length of output: 1802 🏁 Script executed: Length of output: 1466 🏁 Script executed: Length of output: 6146 🏁 Script executed: Length of output: 1955 @palisadoes, I attempted to fetch the refactoring guidelines document from the URL you provided (https://docs-admin.talawa.io/docs/developer-resources/refactoring-guidelines), but it returns a 404 error. I also searched developer.palisadoes.org and docs.talawa.io, but couldn't locate this specific document. However, I've conducted a comprehensive review of this PR based on general best practices and code quality standards. Here's my detailed analysis: ✅ Strengths of This Refactoring
❌ Critical Issue FoundMissing Test File:
🔧 Required Changes🧠 Learnings used |
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: 10
♻️ Duplicate comments (1)
src/shared-components/LoginForm/LoginForm.tsx (1)
100-109: ReCAPTCHA sitekey fallback addressed.The fallback has been updated from
'XXX'to an empty string, which is an improvement. However, an empty sitekey will still cause the ReCAPTCHA widget to fail silently. Consider adding a development-time warning or conditionally rendering the component only whenRECAPTCHA_SITE_KEYis present.- {REACT_APP_USE_RECAPTCHA === 'yes' && ( + {REACT_APP_USE_RECAPTCHA === 'yes' && RECAPTCHA_SITE_KEY && ( <div className="googleRecaptcha"> <ReCAPTCHA ref={loginRecaptchaRef} className="mt-2" - sitekey={RECAPTCHA_SITE_KEY || ''} + sitekey={RECAPTCHA_SITE_KEY} onChange={handleCaptcha} /> </div> )}
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro
📒 Files selected for processing (15)
public/locales/en/translation.json(3 hunks)src/assets/css/app.css(5 hunks)src/screens/LoginPage/LoginPage.tsx(3 hunks)src/screens/RegisterPage/RegisterPage.spec.tsx(1 hunks)src/screens/RegisterPage/RegisterPage.tsx(1 hunks)src/shared-components/AuthBranding/AuthBranding.spec.tsx(1 hunks)src/shared-components/LoginForm/LoginForm.spec.tsx(1 hunks)src/shared-components/LoginForm/LoginForm.tsx(1 hunks)src/shared-components/OrganizationSelector/OrganizationSelector.tsx(1 hunks)src/shared-components/PasswordValidator/PasswordValidator.spec.tsx(1 hunks)src/shared-components/PasswordValidator/PasswordValidator.tsx(1 hunks)src/shared-components/PasswordValidator/ValidationItem.tsx(1 hunks)src/shared-components/RegistrationForm/RegistrationForm.spec.tsx(1 hunks)src/shared-components/RegistrationForm/RegistrationForm.tsx(1 hunks)src/types/RegistrationForm/interface.ts(1 hunks)
🧰 Additional context used
🧠 Learnings (70)
📓 Common learnings
Learnt from: palisadoes
Repo: PalisadoesFoundation/talawa-admin PR: 0
File: :0-0
Timestamp: 2025-11-28T23:56:12.253Z
Learning: In the talawa-admin repository, when CodeRabbit identifies issues that require fixes in a PR review, the review status must be explicitly changed to "changes required" using GitHub CLI (gh pr review --request-changes), not just mentioned in the response text.
Learnt from: palisadoes
Repo: PalisadoesFoundation/talawa-admin PR: 0
File: :0-0
Timestamp: 2025-11-28T23:56:12.253Z
Learning: In the talawa-admin repository, when CodeRabbit identifies issues that require fixes in a PR review, the review status must be explicitly changed to "changes required" using GitHub CLI (gh pr review --request-changes), not just mentioned in the response text.
Learnt from: JaiPannu-IITI
Repo: PalisadoesFoundation/talawa-admin PR: 3592
File: src/components/EventManagement/EventRegistrant/EventRegistrants.tsx:16-19
Timestamp: 2025-02-13T01:55:19.334Z
Learning: PR #3577 has already refactored components to ensure no duplicate interfaces and proper type management for both the components and their children. This is part of the systematic refactoring approach being followed.
Learnt from: PurnenduMIshra129th
Repo: PalisadoesFoundation/talawa-admin PR: 3814
File: public/locales/zh/translation.json:0-0
Timestamp: 2025-03-19T17:42:16.729Z
Learning: The PR #3814 focuses specifically on implementing sign up, sign in, sign out, and useSession in better auth (frontend), and translation changes in the Chinese localization file were not part of the intentional changes made by the author.
Learnt from: JaiPannu-IITI
Repo: PalisadoesFoundation/talawa-admin PR: 3592
File: src/components/UserPortal/ChatRoom/ChatRoom.tsx:23-23
Timestamp: 2025-02-14T21:04:11.392Z
Learning: The codebase is being refactored in alphabetical order, with components up to LoginPortalToggle already updated. Temporary type coexistence is maintained to prevent breaking changes until all related components are refactored.
Learnt from: Ansingh0305
Repo: PalisadoesFoundation/talawa-admin PR: 0
File: :0-0
Timestamp: 2025-11-30T23:13:22.697Z
Learning: In talawa-admin PR #4908, increasing test concurrency from maxConcurrency: 1 to 6-12 with TOTAL_SHARDS: 12 exposed three critical latent bugs: (1) EventsAttendedByUser.spec.tsx used wrong GraphQL query mock (EVENT_DETAILS vs EVENT_DETAILS_BASIC with incorrect variable names), (2) User.mocks.ts missing search/reset refetch scenarios causing "No more mocked responses" errors, (3) EventCalendar.spec.tsx UTC timezone bug where new Date().toISOString() caused date calculation mismatches in non-UTC timezones. These bugs were masked at lower concurrency but surfaced consistently under parallel execution stress-testing. Fix involved aligning mocks with actual component queries and explicit timezone-aware date construction.
Learnt from: satyanvm
Repo: PalisadoesFoundation/talawa-admin PR: 0
File: :0-0
Timestamp: 2025-12-03T12:45:53.875Z
Learning: In talawa-admin reusable components, do not duplicate component prop interfaces in screens. Always import the shared interface from src/types/<Component>/interface.ts (e.g., InterfaceOrganizationCardProps) to keep usage in sync with the shared component.
Learnt from: adithyanotfound
Repo: PalisadoesFoundation/talawa-admin PR: 3915
File: src/screens/LoginPage/LoginPage.tsx:458-459
Timestamp: 2025-04-05T08:30:08.858Z
Learning: The "adminLogin" translation key is used in LoginPage.tsx and should be present in translation.json files for all languages, not in common.json or errors.json files. The key is accessed using the t() function, not tCommon().
Learnt from: adithyanotfound
Repo: PalisadoesFoundation/talawa-admin PR: 3915
File: src/screens/LoginPage/LoginPage.tsx:458-459
Timestamp: 2025-04-05T08:30:08.858Z
Learning: The "adminLogin" translation key is used in LoginPage.tsx and should be present in translation.json files for all languages, not in common.json or errors.json files. The key is accessed using the t() function, not tCommon().
Learnt from: bandhan-majumder
Repo: PalisadoesFoundation/talawa-admin PR: 3593
File: src/screens/UserPortal/Settings/Settings.tsx:1-1
Timestamp: 2025-02-14T07:49:53.498Z
Learning: The Settings component in talawa-admin should be split into smaller components and custom hooks to maintain code quality and meet line limit requirements. Key sections to extract: PersonalInfoSection, ContactInfoSection, and form logic hooks.
📚 Learning: 2025-11-30T23:13:22.697Z
Learnt from: Ansingh0305
Repo: PalisadoesFoundation/talawa-admin PR: 0
File: :0-0
Timestamp: 2025-11-30T23:13:22.697Z
Learning: In talawa-admin PR #4908, increasing test concurrency from maxConcurrency: 1 to 6-12 with TOTAL_SHARDS: 12 exposed three critical latent bugs: (1) EventsAttendedByUser.spec.tsx used wrong GraphQL query mock (EVENT_DETAILS vs EVENT_DETAILS_BASIC with incorrect variable names), (2) User.mocks.ts missing search/reset refetch scenarios causing "No more mocked responses" errors, (3) EventCalendar.spec.tsx UTC timezone bug where new Date().toISOString() caused date calculation mismatches in non-UTC timezones. These bugs were masked at lower concurrency but surfaced consistently under parallel execution stress-testing. Fix involved aligning mocks with actual component queries and explicit timezone-aware date construction.
Applied to files:
src/screens/RegisterPage/RegisterPage.spec.tsxsrc/shared-components/AuthBranding/AuthBranding.spec.tsxsrc/shared-components/RegistrationForm/RegistrationForm.spec.tsx
📚 Learning: 2025-10-22T22:22:27.696Z
Learnt from: Jashan32
Repo: PalisadoesFoundation/talawa-admin PR: 4524
File: src/screens/Requests/Requests.spec.tsx:0-0
Timestamp: 2025-10-22T22:22:27.696Z
Learning: In talawa-admin tests using react-infinite-scroll-component (e.g., src/screens/Requests/Requests.spec.tsx), jsdom scroll is flaky. Prefer a resilient approach: try querying the container via document.querySelector('[data-testid="infinite-scroll-component"]') and fall back to window scroll if missing. Strengthen assertions by checking for page-2 items (e.g., "User9 Test") to ensure fetchMore actually ran instead of relying only on row counts.
Applied to files:
src/screens/RegisterPage/RegisterPage.spec.tsxsrc/shared-components/AuthBranding/AuthBranding.spec.tsxsrc/shared-components/RegistrationForm/RegistrationForm.spec.tsxsrc/shared-components/PasswordValidator/PasswordValidator.spec.tsxsrc/shared-components/LoginForm/LoginForm.spec.tsx
📚 Learning: 2024-12-03T05:52:37.888Z
Learnt from: bitbard3
Repo: PalisadoesFoundation/talawa-admin PR: 2588
File: src/components/ChangeLanguageDropdown/ChangeLanguageDropdown.spec.tsx:155-162
Timestamp: 2024-12-03T05:52:37.888Z
Learning: In the `ChangeLanguageDropdown` component (`src/components/ChangeLanguageDropdown/ChangeLanguageDropdown.tsx`), error handling has not been implemented. Therefore, test cases in `src/components/ChangeLanguageDropdown/ChangeLanguageDropdown.spec.tsx` do not cover error scenarios related to error handling.
Applied to files:
src/screens/RegisterPage/RegisterPage.spec.tsxsrc/shared-components/AuthBranding/AuthBranding.spec.tsxsrc/shared-components/RegistrationForm/RegistrationForm.spec.tsxsrc/shared-components/PasswordValidator/PasswordValidator.spec.tsxsrc/shared-components/LoginForm/LoginForm.spec.tsx
📚 Learning: 2024-11-02T07:48:36.443Z
Learnt from: meetulr
Repo: PalisadoesFoundation/talawa-admin PR: 2398
File: src/components/AddPeopleToTag/AddPeopleToTag.test.tsx:177-241
Timestamp: 2024-11-02T07:48:36.443Z
Learning: In `src/components/AddPeopleToTag/AddPeopleToTag.test.tsx`, prefer keeping test cases separate and more readable, even if it involves some duplication, instead of extracting common logic into helper functions.
Applied to files:
src/screens/RegisterPage/RegisterPage.spec.tsxsrc/shared-components/LoginForm/LoginForm.tsxsrc/shared-components/AuthBranding/AuthBranding.spec.tsxsrc/shared-components/OrganizationSelector/OrganizationSelector.tsxsrc/shared-components/RegistrationForm/RegistrationForm.spec.tsxsrc/shared-components/PasswordValidator/PasswordValidator.spec.tsxsrc/shared-components/RegistrationForm/RegistrationForm.tsxsrc/shared-components/LoginForm/LoginForm.spec.tsx
📚 Learning: 2024-10-08T16:13:41.996Z
Learnt from: Chaitanya1672
Repo: PalisadoesFoundation/talawa-admin PR: 2049
File: src/screens/OrganizationActionItems/ActionItemUpdateModal.tsx:112-138
Timestamp: 2024-10-08T16:13:41.996Z
Learning: The `istanbul ignore next` comments in the `ActionItemUpdateModal.tsx` file were added as part of a commit that introduced tests for the `ActionItemUpdateModal` component. Removing these comments and writing tests to cover the previously ignored lines is recommended to ensure code integrity and improve test coverage.
Applied to files:
src/screens/RegisterPage/RegisterPage.spec.tsxsrc/shared-components/AuthBranding/AuthBranding.spec.tsxsrc/shared-components/RegistrationForm/RegistrationForm.spec.tsxsrc/shared-components/PasswordValidator/PasswordValidator.spec.tsxsrc/shared-components/LoginForm/LoginForm.spec.tsx
📚 Learning: 2025-10-22T22:00:53.943Z
Learnt from: Jashan32
Repo: PalisadoesFoundation/talawa-admin PR: 4524
File: src/screens/OrganizationDashboard/OrganizationDashboardMocks.ts:0-0
Timestamp: 2025-10-22T22:00:53.943Z
Learning: In src/screens/OrganizationDashboard/OrganizationDashboardMocks.ts (and similar mock files), avoid duplicating identical Apollo MockedProvider mocks for repeated query consumption. Prefer adding `maxUsageCount` to the existing mock or using `newData` for reusable responses to keep tests deterministic and reduce drift.
Applied to files:
src/screens/RegisterPage/RegisterPage.spec.tsxsrc/shared-components/AuthBranding/AuthBranding.spec.tsxsrc/shared-components/RegistrationForm/RegistrationForm.spec.tsxsrc/screens/LoginPage/LoginPage.tsxsrc/shared-components/LoginForm/LoginForm.spec.tsx
📚 Learning: 2024-11-02T07:18:39.563Z
Learnt from: meetulr
Repo: PalisadoesFoundation/talawa-admin PR: 2398
File: src/screens/OrganizationTags/OrganizationTags.test.tsx:184-0
Timestamp: 2024-11-02T07:18:39.563Z
Learning: In the `talawa-admin` project, it's acceptable for test cases in `src/screens/OrganizationTags/OrganizationTags.test.tsx` to test multiple behaviors within a single test function without needing to split them into smaller, focused tests.
Applied to files:
src/screens/RegisterPage/RegisterPage.spec.tsxsrc/shared-components/AuthBranding/AuthBranding.spec.tsxsrc/shared-components/RegistrationForm/RegistrationForm.spec.tsx
📚 Learning: 2025-11-28T16:02:31.814Z
Learnt from: rawadhossain
Repo: PalisadoesFoundation/talawa-admin PR: 4882
File: src/screens/UserPortal/Volunteer/UpcomingEvents/RecurringEventVolunteerModal.spec.tsx:69-109
Timestamp: 2025-11-28T16:02:31.814Z
Learning: In Talawa Admin test files (e.g., src/screens/UserPortal/Volunteer/UpcomingEvents/RecurringEventVolunteerModal.spec.tsx), developers prefer keeping date/time mocks (like vi.spyOn(Date.prototype, 'toLocaleDateString')) inline within individual test cases rather than consolidating them in beforeEach blocks, to maintain clarity and keep mocks close to the tests that use them, even if it results in some duplication.
Applied to files:
src/screens/RegisterPage/RegisterPage.spec.tsxsrc/shared-components/AuthBranding/AuthBranding.spec.tsxsrc/shared-components/RegistrationForm/RegistrationForm.spec.tsxsrc/shared-components/LoginForm/LoginForm.spec.tsx
📚 Learning: 2025-04-20T06:45:57.175Z
Learnt from: bandhan-majumder
Repo: PalisadoesFoundation/talawa-admin PR: 3926
File: src/components/Advertisements/core/AdvertisementRegister/AdvertisementRegister.spec.tsx:403-421
Timestamp: 2025-04-20T06:45:57.175Z
Learning: In the talawa-admin project, the Advertisement component tests (3 files) use both ApolloProvider and MockedProvider together, though it's not a widespread pattern in the codebase. The maintainer has confirmed this approach is needed for these specific tests.
Applied to files:
src/screens/RegisterPage/RegisterPage.spec.tsxsrc/shared-components/AuthBranding/AuthBranding.spec.tsxsrc/shared-components/LoginForm/LoginForm.spec.tsx
📚 Learning: 2025-08-17T07:39:34.255Z
Learnt from: syedali237
Repo: PalisadoesFoundation/talawa-admin PR: 4077
File: package.json:189-213
Timestamp: 2025-08-17T07:39:34.255Z
Learning: The Talawa Admin codebase primarily uses .spec.tsx/.spec.ts naming convention for unit tests, with Cypress tests using .cy.ts pattern. However, there is at least one .test.tsx file in the codebase, so NYC exclude patterns should include both .spec and .test patterns.
Applied to files:
src/screens/RegisterPage/RegisterPage.spec.tsxsrc/shared-components/AuthBranding/AuthBranding.spec.tsxsrc/shared-components/RegistrationForm/RegistrationForm.spec.tsxsrc/shared-components/PasswordValidator/PasswordValidator.spec.tsx
📚 Learning: 2025-04-27T04:35:39.472Z
Learnt from: MayankJha014
Repo: PalisadoesFoundation/talawa-admin PR: 3946
File: src/components/UserPortal/ChatRoom/ChatRoom.spec.tsx:0-0
Timestamp: 2025-04-27T04:35:39.472Z
Learning: In the talawa-admin codebase tests, to check whether toast notifications were called, use the imported toast object directly with waitFor (e.g., `expect(toast.error).toHaveBeenCalled()`). Do not use require() style imports within test assertions.
Applied to files:
src/screens/RegisterPage/RegisterPage.spec.tsx
📚 Learning: 2025-11-21T12:42:24.884Z
Learnt from: palisadoes
Repo: PalisadoesFoundation/talawa-admin PR: 4718
File: src/components/EventManagement/Dashboard/EventDashboard.mocks.ts:83-114
Timestamp: 2025-11-21T12:42:24.884Z
Learning: In talawa-admin mock files (e.g., EventDashboard.mocks.ts), mock constant names must accurately reflect what they test. Mock names suggesting role-based logic (e.g., MOCKS_WITH_ADMIN_ROLE) are misleading when the component derives role from localStorage rather than mock data. Name mocks based on their distinguishing data features (e.g., MOCKS_WITH_SINGLE_ATTENDEE) or test context (e.g., MOCKS_FOR_ADMIN_STORAGE_TEST).
Applied to files:
src/screens/RegisterPage/RegisterPage.spec.tsxsrc/shared-components/AuthBranding/AuthBranding.spec.tsxsrc/shared-components/RegistrationForm/RegistrationForm.spec.tsxsrc/shared-components/LoginForm/LoginForm.spec.tsx
📚 Learning: 2024-10-30T12:01:40.366Z
Learnt from: meetulr
Repo: PalisadoesFoundation/talawa-admin PR: 2387
File: src/screens/ManageTag/ManageTagMockComponents/MockAddPeopleToTag.tsx:1-28
Timestamp: 2024-10-30T12:01:40.366Z
Learning: In the `MockAddPeopleToTag` component in `src/screens/ManageTag/ManageTagMockComponents/MockAddPeopleToTag.tsx`, it's acceptable to implement only the necessary props from `InterfaceAddPeopleToTagProps` and omit others like `refetchAssignedMembersData`, `t`, and `tCommon` that are tested separately.
Applied to files:
src/screens/RegisterPage/RegisterPage.spec.tsxsrc/shared-components/AuthBranding/AuthBranding.spec.tsxsrc/shared-components/OrganizationSelector/OrganizationSelector.tsxsrc/shared-components/RegistrationForm/RegistrationForm.tsxsrc/shared-components/LoginForm/LoginForm.spec.tsx
📚 Learning: 2024-10-28T06:33:09.726Z
Learnt from: meetulr
Repo: PalisadoesFoundation/talawa-admin PR: 2362
File: src/components/TagActions/TagActions.test.tsx:251-274
Timestamp: 2024-10-28T06:33:09.726Z
Learning: In `TagActions.test.tsx`, negative test cases for tag operations can be deferred and added later if necessary, according to the team's plan.
Applied to files:
src/screens/RegisterPage/RegisterPage.spec.tsxsrc/shared-components/AuthBranding/AuthBranding.spec.tsxsrc/shared-components/PasswordValidator/PasswordValidator.spec.tsx
📚 Learning: 2025-10-18T18:54:40.093Z
Learnt from: syedali237
Repo: PalisadoesFoundation/talawa-admin PR: 4484
File: cypress/pageObjects/AdminPortal/PostPage.ts:33-33
Timestamp: 2025-10-18T18:54:40.093Z
Learning: In the Talawa Admin project, E2E test assertions (including toast messages) are intentionally hardcoded in English for developer experience, even though the application supports localization. This is an accepted practice for Cypress E2E tests in this codebase.
Applied to files:
src/screens/RegisterPage/RegisterPage.spec.tsx
📚 Learning: 2024-11-11T07:47:39.266Z
Learnt from: meetulr
Repo: PalisadoesFoundation/talawa-admin PR: 2425
File: src/screens/MemberDetail/MemberDetail.test.tsx:100-100
Timestamp: 2024-11-11T07:47:39.266Z
Learning: In `src/screens/MemberDetail/MemberDetail.test.tsx`, using `await wait();` is acceptable to wait for the render to complete.
Applied to files:
src/screens/RegisterPage/RegisterPage.spec.tsxsrc/shared-components/AuthBranding/AuthBranding.spec.tsxsrc/shared-components/RegistrationForm/RegistrationForm.spec.tsxsrc/shared-components/LoginForm/LoginForm.spec.tsx
📚 Learning: 2025-01-26T12:32:45.867Z
Learnt from: IITI-tushar
Repo: PalisadoesFoundation/talawa-admin PR: 3400
File: src/screens/UserPortal/Organizations/Organizations.spec.tsx:19-19
Timestamp: 2025-01-26T12:32:45.867Z
Learning: In React test files, avoid using React hooks outside component scope (including in static objects like mock data). Instead, initialize hooks inside describe blocks or extract the needed functionality without using hooks.
Applied to files:
src/screens/RegisterPage/RegisterPage.spec.tsxsrc/shared-components/AuthBranding/AuthBranding.spec.tsxsrc/shared-components/RegistrationForm/RegistrationForm.spec.tsxsrc/shared-components/PasswordValidator/PasswordValidator.spec.tsxsrc/shared-components/LoginForm/LoginForm.spec.tsx
📚 Learning: 2025-03-11T17:45:54.621Z
Learnt from: PurnenduMIshra129th
Repo: PalisadoesFoundation/talawa-admin PR: 3814
File: src/components/UserPortal/OrganizationNavbar/OrganizationNavbar.spec.tsx:137-146
Timestamp: 2025-03-11T17:45:54.621Z
Learning: In OrganizationNavbar.spec.tsx, separate vi.mock implementations for react-router-dom are needed to avoid errors - one for useNavigate and another for useParams.
Applied to files:
src/screens/RegisterPage/RegisterPage.spec.tsxsrc/shared-components/LoginForm/LoginForm.tsxsrc/shared-components/AuthBranding/AuthBranding.spec.tsxsrc/shared-components/RegistrationForm/RegistrationForm.spec.tsxsrc/shared-components/LoginForm/LoginForm.spec.tsx
📚 Learning: 2025-04-20T06:45:57.175Z
Learnt from: bandhan-majumder
Repo: PalisadoesFoundation/talawa-admin PR: 3926
File: src/components/Advertisements/core/AdvertisementRegister/AdvertisementRegister.spec.tsx:403-421
Timestamp: 2025-04-20T06:45:57.175Z
Learning: Using both ApolloProvider and MockedProvider together in tests is an established pattern in this codebase, even though it's technically redundant from Apollo Client's best practices perspective.
Applied to files:
src/screens/RegisterPage/RegisterPage.spec.tsx
📚 Learning: 2025-11-27T11:41:54.843Z
Learnt from: rawadhossain
Repo: PalisadoesFoundation/talawa-admin PR: 4865
File: src/components/EventRegistrantsModal/Modal/EventRegistrantsModal.spec.tsx:302-328
Timestamp: 2025-11-27T11:41:54.843Z
Learning: In Talawa Admin tests (e.g., src/components/EventRegistrantsModal/Modal/EventRegistrantsModal.spec.tsx), using queryByLabelText with an HTMLElement cast for MUI Autocomplete inputs is acceptable because the Autocomplete input can mount asynchronously and isn't always available for strict getBy* queries at initial render. This pattern is stable for MUI Autocomplete components.
Applied to files:
src/screens/RegisterPage/RegisterPage.spec.tsxsrc/shared-components/OrganizationSelector/OrganizationSelector.tsxsrc/shared-components/RegistrationForm/RegistrationForm.spec.tsxsrc/shared-components/LoginForm/LoginForm.spec.tsx
📚 Learning: 2025-12-03T12:45:53.875Z
Learnt from: satyanvm
Repo: PalisadoesFoundation/talawa-admin PR: 0
File: :0-0
Timestamp: 2025-12-03T12:45:53.875Z
Learning: In talawa-admin reusable components, do not duplicate component prop interfaces in screens. Always import the shared interface from src/types/<Component>/interface.ts (e.g., InterfaceOrganizationCardProps) to keep usage in sync with the shared component.
Applied to files:
src/types/RegistrationForm/interface.tssrc/shared-components/OrganizationSelector/OrganizationSelector.tsxsrc/shared-components/RegistrationForm/RegistrationForm.tsxsrc/screens/RegisterPage/RegisterPage.tsx
📚 Learning: 2024-11-02T12:49:40.108Z
Learnt from: GlenDsza
Repo: PalisadoesFoundation/talawa-admin PR: 2397
File: src/utils/interfaces.ts:10-15
Timestamp: 2024-11-02T12:49:40.108Z
Learning: In the `src/utils/interfaces.ts` file of the Talawa Admin project, the `InterfaceUserInfo` interface should not include the `email` field, as it is generally not required on the frontend.
Applied to files:
src/types/RegistrationForm/interface.ts
📚 Learning: 2025-02-13T01:50:08.135Z
Learnt from: JaiPannu-IITI
Repo: PalisadoesFoundation/talawa-admin PR: 3592
File: src/components/EventManagement/EventRegistrant/EventRegistrants.tsx:16-19
Timestamp: 2025-02-13T01:50:08.135Z
Learning: The `InterfaceMember` and `InterfaceUser` interfaces are defined in centralized locations at `types/Event/interface.ts` and `types/User/interface.ts` respectively, as part of the refactoring to organize types by functionality.
Applied to files:
src/types/RegistrationForm/interface.ts
📚 Learning: 2025-02-14T21:04:11.392Z
Learnt from: JaiPannu-IITI
Repo: PalisadoesFoundation/talawa-admin PR: 3592
File: src/components/UserPortal/ChatRoom/ChatRoom.tsx:23-23
Timestamp: 2025-02-14T21:04:11.392Z
Learning: The codebase is being refactored in alphabetical order, with components up to LoginPortalToggle already updated. Temporary type coexistence is maintained to prevent breaking changes until all related components are refactored.
Applied to files:
src/shared-components/LoginForm/LoginForm.tsxsrc/screens/LoginPage/LoginPage.tsxsrc/screens/RegisterPage/RegisterPage.tsx
📚 Learning: 2025-04-05T08:30:08.858Z
Learnt from: adithyanotfound
Repo: PalisadoesFoundation/talawa-admin PR: 3915
File: src/screens/LoginPage/LoginPage.tsx:458-459
Timestamp: 2025-04-05T08:30:08.858Z
Learning: The "adminLogin" translation key is used in LoginPage.tsx and should be present in translation.json files for all languages, not in common.json or errors.json files. The key is accessed using the t() function, not tCommon().
Applied to files:
src/shared-components/LoginForm/LoginForm.tsxsrc/screens/LoginPage/LoginPage.tsxpublic/locales/en/translation.json
📚 Learning: 2024-11-01T16:18:01.545Z
Learnt from: GlenDsza
Repo: PalisadoesFoundation/talawa-admin PR: 2397
File: src/screens/UserPortal/Volunteer/Actions/Actions.tsx:367-374
Timestamp: 2024-11-01T16:18:01.545Z
Learning: In the `src/screens/UserPortal/Volunteer/Actions/Actions.tsx` file, the search button intentionally includes `tabIndex={-1}`. This is acceptable for our application, and future reviews should not flag this as an accessibility concern.
Applied to files:
src/shared-components/LoginForm/LoginForm.tsx
📚 Learning: 2025-08-13T06:52:48.055Z
Learnt from: syedali237
Repo: PalisadoesFoundation/talawa-admin PR: 4040
File: cypress/pageObjects/AdminPortal/PeoplePage.ts:30-34
Timestamp: 2025-08-13T06:52:48.055Z
Learning: In the talawa-admin project's Cypress tests, specifically in cypress/pageObjects/AdminPortal/PeoplePage.ts, the element '[data-testid="existingUser"]' is a toggle control that requires .trigger('click') instead of .click() because it's not a standard button but a custom UI component that needs direct event triggering.
Applied to files:
src/shared-components/LoginForm/LoginForm.tsx
📚 Learning: 2024-10-28T06:38:43.765Z
Learnt from: meetulr
Repo: PalisadoesFoundation/talawa-admin PR: 2362
File: src/components/TagActions/TagActions.test.tsx:123-131
Timestamp: 2024-10-28T06:38:43.765Z
Learning: In `TagActions.test.tsx`, `link2` is the error link used to simulate errors, so the existing test cases sufficiently cover error handling.
Applied to files:
src/shared-components/LoginForm/LoginForm.tsxsrc/shared-components/AuthBranding/AuthBranding.spec.tsx
📚 Learning: 2025-11-27T11:40:30.747Z
Learnt from: rawadhossain
Repo: PalisadoesFoundation/talawa-admin PR: 4865
File: src/components/EventRegistrantsModal/Modal/EventRegistrantsModal.spec.tsx:261-280
Timestamp: 2025-11-27T11:40:30.747Z
Learning: In Talawa Admin tests (e.g., src/components/EventRegistrantsModal/Modal/EventRegistrantsModal.spec.tsx), react-bootstrap Modal header close buttons don't support custom test IDs, so using getAllByRole('button', { name: /close/i })[0] to select the modal's primary close action is acceptable and stable, as the Modal component consistently exposes "Close" as the accessible label.
Applied to files:
src/shared-components/LoginForm/LoginForm.tsx
📚 Learning: 2025-11-28T18:25:57.426Z
Learnt from: krikera
Repo: PalisadoesFoundation/talawa-admin PR: 4887
File: src/components/LoginPortalToggle/LoginPortalToggle.spec.tsx:57-59
Timestamp: 2025-11-28T18:25:57.426Z
Learning: In talawa-admin tests, when testing CSS module class names (imported as `styles from '*.module.css'`), prefer importing the styles module and using `toHaveClass(styles.className)` over `className.toContain('className')`. Vite hashes CSS module class names (e.g., activeLink → _activeLink_d8535b), so `toHaveClass('activeLink')` with plain strings will fail. The styles import approach is semantic, type-safe, and matches patterns in SideToggle.spec.tsx. Alternatively, `className.toContain()` is acceptable for substring matching without imports.
Applied to files:
src/shared-components/LoginForm/LoginForm.tsxsrc/shared-components/AuthBranding/AuthBranding.spec.tsx
📚 Learning: 2024-11-02T07:32:43.099Z
Learnt from: meetulr
Repo: PalisadoesFoundation/talawa-admin PR: 2398
File: src/components/TagActions/TagActions.tsx:367-0
Timestamp: 2024-11-02T07:32:43.099Z
Learning: In `src/components/TagActions/TagActions.tsx`, fragments around parentheses in the ancestor tags display are acceptable and should not be flagged as unnecessary.
Applied to files:
src/shared-components/LoginForm/LoginForm.tsxsrc/shared-components/OrganizationSelector/OrganizationSelector.tsxsrc/shared-components/PasswordValidator/ValidationItem.tsx
📚 Learning: 2024-11-02T07:31:50.788Z
Learnt from: meetulr
Repo: PalisadoesFoundation/talawa-admin PR: 2398
File: src/components/TagActions/TagActions.tsx:216-0
Timestamp: 2024-11-02T07:31:50.788Z
Learning: In `src/components/TagActions/TagActions.tsx`, the submit button should not be disabled when no tags are selected, as per the design preference.
Applied to files:
src/shared-components/LoginForm/LoginForm.tsxsrc/shared-components/OrganizationSelector/OrganizationSelector.tsx
📚 Learning: 2025-02-06T20:56:05.378Z
Learnt from: PurnenduMIshra129th
Repo: PalisadoesFoundation/talawa-admin PR: 3491
File: src/components/UserPortal/SecuredRouteForUser/SecuredRouteForUser.tsx:34-43
Timestamp: 2025-02-06T20:56:05.378Z
Learning: In SecuredRouteForUser component, token updates between role switches (e.g., user to superAdmin) are better handled using separate useEffect hooks - one for initial token setup (empty deps) and another for refetch on token changes, rather than combining them into a single effect.
Applied to files:
src/shared-components/LoginForm/LoginForm.tsxsrc/screens/LoginPage/LoginPage.tsxsrc/screens/RegisterPage/RegisterPage.tsx
📚 Learning: 2025-11-12T00:28:53.713Z
Learnt from: Ansingh0305
Repo: PalisadoesFoundation/talawa-admin PR: 0
File: :0-0
Timestamp: 2025-11-12T00:28:53.713Z
Learning: In talawa-admin PR #4565 continuation (PR #4664 planned), Phase 2A mock isolation strategy uses global vi.clearAllMocks() in afterEach (vitest.setup.ts) plus refactoring module-level vi.fn() into per-test beforeEach blocks across 6 parallelizable issues (2A.0 foundation, 2A.1-2A.4 directory-based fixes, 2A.5 validation). This approach addresses mock call history accumulation enabling maxConcurrency: 2 and 2.3-2.5x speedup. vi.restoreAllMocks() alternative considered for spy restoration during validation phase. Phase 2A (mocks) correctly separated from Phase 2B (DOM/Apollo).
Applied to files:
src/shared-components/AuthBranding/AuthBranding.spec.tsxsrc/shared-components/RegistrationForm/RegistrationForm.spec.tsxsrc/shared-components/LoginForm/LoginForm.spec.tsx
📚 Learning: 2025-11-11T11:51:09.236Z
Learnt from: Ansingh0305
Repo: PalisadoesFoundation/talawa-admin PR: 0
File: :0-0
Timestamp: 2025-11-11T11:51:09.236Z
Learning: In talawa-admin PR #4664 (continuation of PR #4565 sharding work), global mock cleanup was implemented via vi.clearAllMocks() in vitest.setup.ts afterEach, along with Apollo Client warning suppression (temporary, pending follow-up PR) and test suite refactoring to per-test StaticMockLink instances. This test isolation strategy addresses mock state leakage that forced maxConcurrency: 1 in PR #4565, enabling future parallel test execution improvements and 3-4x speedup potential.
Applied to files:
src/shared-components/AuthBranding/AuthBranding.spec.tsxsrc/shared-components/RegistrationForm/RegistrationForm.spec.tsxsrc/shared-components/LoginForm/LoginForm.spec.tsx
📚 Learning: 2024-11-27T06:37:47.871Z
Learnt from: adithyanotfound
Repo: PalisadoesFoundation/talawa-admin PR: 2482
File: src/components/AddOn/support/components/Action/Action.spec.tsx:1-8
Timestamp: 2024-11-27T06:37:47.871Z
Learning: In the Talawa-Admin project, the `testing-library/jest-dom` package is imported globally in `vitest.setup.ts`, so individual test files do not need to import it separately.
Applied to files:
src/shared-components/AuthBranding/AuthBranding.spec.tsx
📚 Learning: 2024-10-30T13:18:56.627Z
Learnt from: meetulr
Repo: PalisadoesFoundation/talawa-admin PR: 2387
File: src/screens/OrganizationTags/OrganizationTags.tsx:350-376
Timestamp: 2024-10-30T13:18:56.627Z
Learning: In the `src/screens/OrganizationTags/OrganizationTags.tsx` file, the `OrganizationTags` component uses chunk size with the `InfiniteScroll` component and an outer parent div for handling data loading and scrolling.
Applied to files:
src/shared-components/OrganizationSelector/OrganizationSelector.tsxsrc/screens/RegisterPage/RegisterPage.tsx
📚 Learning: 2025-08-20T18:04:23.118Z
Learnt from: Jashan32
Repo: PalisadoesFoundation/talawa-admin PR: 4094
File: src/screens/OrgList/OrgList.tsx:435-0
Timestamp: 2025-08-20T18:04:23.118Z
Learning: In the talawa-admin codebase, pagination logic for the admin orglist page in src/screens/OrgList/OrgList.tsx was directly extracted from the user's orglist page without modifications to maintain consistency between the two implementations.
Applied to files:
src/shared-components/OrganizationSelector/OrganizationSelector.tsxsrc/screens/LoginPage/LoginPage.tsxsrc/screens/RegisterPage/RegisterPage.tsx
📚 Learning: 2024-10-30T13:16:35.635Z
Learnt from: meetulr
Repo: PalisadoesFoundation/talawa-admin PR: 2387
File: src/screens/OrganizationTags/OrganizationTags.tsx:370-373
Timestamp: 2024-10-30T13:16:35.635Z
Learning: In `src/screens/OrganizationTags/OrganizationTags.tsx`, when mapping rows for the DataGrid, use `index + 1` as the `id` because the index number plus one is required.
Applied to files:
src/shared-components/OrganizationSelector/OrganizationSelector.tsx
📚 Learning: 2025-08-20T18:04:52.324Z
Learnt from: Jashan32
Repo: PalisadoesFoundation/talawa-admin PR: 4094
File: src/screens/OrgList/OrgList.tsx:0-0
Timestamp: 2025-08-20T18:04:52.324Z
Learning: In PR #4094, the user confirmed that the pagination logic in src/screens/OrgList/OrgList.tsx was directly extracted from the user's orglist page without modifications for initial implementation, with plans to refactor for consistency later.
Applied to files:
src/shared-components/OrganizationSelector/OrganizationSelector.tsxsrc/screens/LoginPage/LoginPage.tsxsrc/screens/RegisterPage/RegisterPage.tsx
📚 Learning: 2025-08-20T18:04:34.194Z
Learnt from: Jashan32
Repo: PalisadoesFoundation/talawa-admin PR: 4094
File: src/screens/OrgList/OrgList.tsx:409-0
Timestamp: 2025-08-20T18:04:34.194Z
Learning: In PR #4094, the pagination logic in src/screens/OrgList/OrgList.tsx was directly extracted from the user's orglist page without modification for initial implementation, with plans to refactor for consistency later.
Applied to files:
src/shared-components/OrganizationSelector/OrganizationSelector.tsxsrc/screens/RegisterPage/RegisterPage.tsx
📚 Learning: 2024-10-28T08:21:01.364Z
Learnt from: meetulr
Repo: PalisadoesFoundation/talawa-admin PR: 2362
File: src/components/TagActions/TagNode.tsx:129-137
Timestamp: 2024-10-28T08:21:01.364Z
Learning: When setting the aria-label for the checkbox in `TagNode.tsx`, it's acceptable to use `t('selectTag')` without including the tag name.
Applied to files:
src/shared-components/OrganizationSelector/OrganizationSelector.tsx
📚 Learning: 2025-08-08T08:17:00.638Z
Learnt from: Jashan32
Repo: PalisadoesFoundation/talawa-admin PR: 4068
File: src/components/OrgSettings/General/OrgUpdate/OrgUpdate.tsx:171-183
Timestamp: 2025-08-08T08:17:00.638Z
Learning: In talawa-admin, for forms like OrgUpdate, prefer retaining the removeEmptyFields helper usage for consistency across screens, even if conditional object construction could replace it.
Applied to files:
src/shared-components/OrganizationSelector/OrganizationSelector.tsx
📚 Learning: 2024-11-02T07:38:14.044Z
Learnt from: meetulr
Repo: PalisadoesFoundation/talawa-admin PR: 2398
File: src/screens/ManageTag/ManageTag.tsx:263-0
Timestamp: 2024-11-02T07:38:14.044Z
Learning: In `src/screens/ManageTag/ManageTag.tsx`, `currentTagName` is guaranteed to be non-empty when constructing the `orgUserTagAncestors` array for breadcrumbs.
Applied to files:
src/shared-components/OrganizationSelector/OrganizationSelector.tsx
📚 Learning: 2024-09-27T05:15:08.634Z
Learnt from: adithyanotfound
Repo: PalisadoesFoundation/talawa-admin PR: 2300
File: src/state/hooks.ts:4-4
Timestamp: 2024-09-27T05:15:08.634Z
Learning: In this project, `useSelector` is not required, and a custom `useAppSelector` hook is unnecessary.
Applied to files:
src/shared-components/OrganizationSelector/OrganizationSelector.tsx
📚 Learning: 2025-11-28T22:51:12.245Z
Learnt from: Ansingh0305
Repo: PalisadoesFoundation/talawa-admin PR: 0
File: :0-0
Timestamp: 2025-11-28T22:51:12.245Z
Learning: In talawa-admin PR #4826, mock cleanup implementation uses global vi.clearAllMocks() in vitest.setup.ts afterEach hook, combined with proper vi.hoisted() usage for module-level mocks. This strategy successfully achieved test isolation across 273 test files, passing the mock cleanup checker script with exit code 0. The implementation is ready for increasing maxConcurrency from conservative settings (CI: 1, local: 2) to higher concurrency levels (recommended gradual rollout: CI 1→2→4, local 2→4→8) to achieve Phase 2A goals of 2.3-2.5x speedup. Global cleanup strategy eliminates need for explicit afterEach blocks in every individual test file.
Applied to files:
src/shared-components/RegistrationForm/RegistrationForm.spec.tsxsrc/shared-components/LoginForm/LoginForm.spec.tsx
📚 Learning: 2025-11-17T22:18:09.680Z
Learnt from: Ansingh0305
Repo: PalisadoesFoundation/talawa-admin PR: 0
File: :0-0
Timestamp: 2025-11-17T22:18:09.680Z
Learning: Talawa Admin Phase 2A testing guideline: Allow vi.hoisted() + vi.mock() module-level mocks for shared dependencies; prefer afterEach(() => vi.clearAllMocks()) as default cleanup. Use afterEach(() => vi.restoreAllMocks()) only in suites that create vi.spyOn spies or patch real implementations. Avoid vi.resetAllMocks() globally. The generic “no module-level mocks” rule is updated to “no module-level vi.fn except vi.hoisted module mocks.”
Applied to files:
src/shared-components/RegistrationForm/RegistrationForm.spec.tsxsrc/shared-components/LoginForm/LoginForm.spec.tsx
📚 Learning: 2024-12-02T04:20:11.745Z
Learnt from: bitbard3
Repo: PalisadoesFoundation/talawa-admin PR: 2588
File: src/components/ChangeLanguageDropdown/ChangeLanguageDropdown.spec.tsx:145-155
Timestamp: 2024-12-02T04:20:11.745Z
Learning: In PRs focused solely on refactoring test cases from Jest to Vitest, avoid suggesting optimizations or changes outside the migration scope.
Applied to files:
src/shared-components/RegistrationForm/RegistrationForm.spec.tsx
📚 Learning: 2024-11-01T12:54:20.857Z
Learnt from: GlenDsza
Repo: PalisadoesFoundation/talawa-admin PR: 2397
File: src/screens/OrganizationActionItems/testObject.mocks.ts:184-402
Timestamp: 2024-11-01T12:54:20.857Z
Learning: In `src/screens/OrganizationActionItems/testObject.mocks.ts`, test failures are not dependent on the `createdAt` fields; hardcoded dates in `createdAt` fields do not cause test failures in this file.
Applied to files:
src/shared-components/RegistrationForm/RegistrationForm.spec.tsx
📚 Learning: 2025-04-27T10:59:45.144Z
Learnt from: MayankJha014
Repo: PalisadoesFoundation/talawa-admin PR: 3946
File: src/components/UserPortal/ChatRoom/ChatRoom.spec.tsx:5670-5693
Timestamp: 2025-04-27T10:59:45.144Z
Learning: When testing UI components that display user names, test for firstName and lastName separately rather than as a combined full name, as the UI might render these in separate DOM elements, making combined assertions brittle.
Applied to files:
src/shared-components/RegistrationForm/RegistrationForm.spec.tsxsrc/screens/RegisterPage/RegisterPage.tsx
📚 Learning: 2025-02-20T13:35:01.218Z
Learnt from: syedali237
Repo: PalisadoesFoundation/talawa-admin PR: 3712
File: src/components/EventCalender/Yearly/YearlyEventCalender.spec.tsx:113-127
Timestamp: 2025-02-20T13:35:01.218Z
Learning: In React component tests, when testing window resize event handling, it's acceptable to only verify that the event is properly triggered without assertions if the test's focus is specifically on event handling rather than responsive behavior. Testing the actual responsive rendering would be a separate test case.
Applied to files:
src/shared-components/PasswordValidator/PasswordValidator.spec.tsxsrc/shared-components/LoginForm/LoginForm.spec.tsx
📚 Learning: 2025-03-19T17:42:16.729Z
Learnt from: PurnenduMIshra129th
Repo: PalisadoesFoundation/talawa-admin PR: 3814
File: public/locales/zh/translation.json:0-0
Timestamp: 2025-03-19T17:42:16.729Z
Learning: The PR #3814 focuses specifically on implementing sign up, sign in, sign out, and useSession in better auth (frontend), and translation changes in the Chinese localization file were not part of the intentional changes made by the author.
Applied to files:
src/screens/LoginPage/LoginPage.tsxsrc/screens/RegisterPage/RegisterPage.tsxpublic/locales/en/translation.json
📚 Learning: 2025-01-12T16:24:16.293Z
Learnt from: Aad1tya27
Repo: PalisadoesFoundation/talawa-admin PR: 3255
File: src/screens/UserPortal/Chat/Chat.tsx:0-0
Timestamp: 2025-01-12T16:24:16.293Z
Learning: In React components where a useEffect triggers data fetching operations and a separate useEffect handles the state updates based on that data (e.g., watching query results), it's not necessary to include the data variables in the first useEffect's dependency array. This pattern helps prevent unnecessary re-runs while maintaining proper data flow.
Applied to files:
src/screens/LoginPage/LoginPage.tsx
📚 Learning: 2025-11-08T18:14:54.607Z
Learnt from: Jashan32
Repo: PalisadoesFoundation/talawa-admin PR: 4622
File: src/screens/OrgPost/OrgPost.tsx:109-122
Timestamp: 2025-11-08T18:14:54.607Z
Learning: In src/screens/OrgPost/OrgPost.tsx, the refetchPinnedPosts function from the ORGANIZATION_PINNED_POST_LIST query is intentionally left commented out because the entire page is set to reload when posts are deleted, unpinned, or pinned, making a separate refetch unnecessary.
Applied to files:
src/screens/LoginPage/LoginPage.tsx
📚 Learning: 2024-12-09T21:12:47.916Z
Learnt from: raggettii
Repo: PalisadoesFoundation/talawa-admin PR: 2629
File: src/screens/UserPortal/LeaveOrganization/LeaveOrganization.tsx:30-36
Timestamp: 2024-12-09T21:12:47.916Z
Learning: When modifying organization membership, prefer using Apollo's `refetchQueries` or cache updates to refresh the UI instead of using `window.location.reload()`.
Applied to files:
src/screens/LoginPage/LoginPage.tsx
📚 Learning: 2024-10-30T15:46:05.784Z
Learnt from: meetulr
Repo: PalisadoesFoundation/talawa-admin PR: 2387
File: src/components/AddPeopleToTag/AddPeopleToTag.tsx:78-104
Timestamp: 2024-10-30T15:46:05.784Z
Learning: In `src/components/AddPeopleToTag/AddPeopleToTag.tsx`, and similar components, the team prefers to keep the current implementation of the `updateQuery` logic in infinite scroll functionality consistent across all screens.
Applied to files:
src/screens/LoginPage/LoginPage.tsxsrc/screens/RegisterPage/RegisterPage.tsx
📚 Learning: 2024-11-01T16:20:31.293Z
Learnt from: GlenDsza
Repo: PalisadoesFoundation/talawa-admin PR: 2397
File: src/screens/UserPortal/Volunteer/UpcomingEvents/UpcomingEvents.tsx:94-115
Timestamp: 2024-11-01T16:20:31.293Z
Learning: In the TypeScript files of this project, avoid suggesting explicit response types for `useQuery` calls unless necessary, as the team prefers to rely on TypeScript's type inference.
Applied to files:
src/screens/LoginPage/LoginPage.tsx
📚 Learning: 2024-10-28T06:51:05.867Z
Learnt from: meetulr
Repo: PalisadoesFoundation/talawa-admin PR: 2362
File: src/components/TagActions/TagActions.tsx:110-147
Timestamp: 2024-10-28T06:51:05.867Z
Learning: When handling the `useEffect` hooks for `addAncestorTagsData` and `removeAncestorTagsData` in `TagActions.tsx`, it's preferred to keep them separate to avoid confusion and enhance readability.
Applied to files:
src/screens/LoginPage/LoginPage.tsx
📚 Learning: 2024-10-30T13:29:28.310Z
Learnt from: meetulr
Repo: PalisadoesFoundation/talawa-admin PR: 2387
File: src/screens/ManageTag/ManageTag.tsx:113-147
Timestamp: 2024-10-30T13:29:28.310Z
Learning: In the `src/screens/ManageTag/ManageTag.tsx` file, the `InfiniteScroll` component uses the `loadMoreAssignedMembers` function efficiently, and additional error handling is unnecessary.
Applied to files:
src/screens/LoginPage/LoginPage.tsx
📚 Learning: 2025-03-11T17:23:01.696Z
Learnt from: PurnenduMIshra129th
Repo: PalisadoesFoundation/talawa-admin PR: 3814
File: src/utils/useSession.tsx:29-30
Timestamp: 2025-03-11T17:23:01.696Z
Learning: In the useSession.tsx file, there's a commented-out session access hook that should remain in the codebase as an implementation example, but it's commented out to avoid unnecessary data fetching when the session data isn't immediately needed.
Applied to files:
src/screens/LoginPage/LoginPage.tsx
📚 Learning: 2024-12-22T17:58:17.818Z
Learnt from: IITI-tushar
Repo: PalisadoesFoundation/talawa-admin PR: 2718
File: src/screens/UserPortal/Settings/Settings.spec.tsx:0-0
Timestamp: 2024-12-22T17:58:17.818Z
Learning: The matchMedia mock implementation in `Settings.spec.tsx` no longer includes the deprecated addListener and removeListener methods, opting solely for addEventListener and removeEventListener.
Applied to files:
src/shared-components/LoginForm/LoginForm.spec.tsx
📚 Learning: 2025-08-08T08:14:51.613Z
Learnt from: Jashan32
Repo: PalisadoesFoundation/talawa-admin PR: 4068
File: src/GraphQl/Queries/Queries.ts:636-644
Timestamp: 2025-08-08T08:14:51.613Z
Learning: In the talawa-admin project, GraphQL queries that call organization(input: { id }) expect the variable $id to be typed as String! (not ID!). Keep $id: String! for queries like GET_ORGANIZATION_BASIC_DATA, GET_ORGANIZATION_MEMBERS_PG, and GET_ORGANIZATION_POSTS_PG in src/GraphQl/Queries/Queries.ts.
Applied to files:
src/screens/RegisterPage/RegisterPage.tsx
📚 Learning: 2024-10-26T15:50:00.394Z
Learnt from: VanshikaSabharwal
Repo: PalisadoesFoundation/talawa-admin PR: 2356
File: src/screens/UserPortal/Posts/Posts.tsx:211-229
Timestamp: 2024-10-26T15:50:00.394Z
Learning: The GraphQL schema and TypeScript interfaces in this project use `id` instead of `_id` for field names.
Applied to files:
src/screens/RegisterPage/RegisterPage.tsx
📚 Learning: 2025-02-13T20:43:05.966Z
Learnt from: hustlernik
Repo: PalisadoesFoundation/talawa-admin PR: 3595
File: src/screens/CommunityProfile/CommunityProfile.tsx:162-163
Timestamp: 2025-02-13T20:43:05.966Z
Learning: In the talawa-admin GraphQL schema, the LinkedIn URL field is defined as `linkedinURL` (lowercase 'in'), even though the state variable in the frontend uses `linkedInURL` (camelCase).
Applied to files:
src/screens/RegisterPage/RegisterPage.tsx
📚 Learning: 2025-04-13T10:19:37.112Z
Learnt from: bandhan-majumder
Repo: PalisadoesFoundation/talawa-admin PR: 3926
File: src/components/Advertisements/AdvertisementsMocks.ts:459-528
Timestamp: 2025-04-13T10:19:37.112Z
Learning: In the Talawa Admin project, the GraphQL server returns a field named `createAdvertisement` in response to the `UPDATE_ADVERTISEMENT_MUTATION`, rather than the expected `updateAdvertisement` field name that would typically match the mutation name.
Applied to files:
src/screens/RegisterPage/RegisterPage.tsx
📚 Learning: 2025-01-30T19:21:33.057Z
Learnt from: yugal07
Repo: PalisadoesFoundation/talawa-admin PR: 3489
File: schema.graphql:1540-1571
Timestamp: 2025-01-30T19:21:33.057Z
Learning: The field name `refrenceNumber` in the GraphQL schema, despite being a typo, should be maintained for backward compatibility as it is used consistently across the codebase. Any changes to this field name should be part of a dedicated breaking change PR.
Applied to files:
src/screens/RegisterPage/RegisterPage.tsx
📚 Learning: 2024-06-30T21:17:16.481Z
Learnt from: GlenDsza
Repo: PalisadoesFoundation/talawa-admin PR: 2064
File: src/screens/OrganizationFundCampaign/CampaignDeleteModal.tsx:4-5
Timestamp: 2024-06-30T21:17:16.481Z
Learning: The folder containing mutation queries in the codebase is named `GraphQl`, not `graphql`.
Applied to files:
src/screens/RegisterPage/RegisterPage.tsx
📚 Learning: 2025-11-25T20:17:39.986Z
Learnt from: palisadoes
Repo: PalisadoesFoundation/talawa-admin PR: 0
File: :0-0
Timestamp: 2025-11-25T20:17:39.986Z
Learning: In PR #4815, the ORGANIZATION_POST_LIST_WITH_VOTES GraphQL query in src/GraphQl/Queries/OrganizationQueries.ts is missing the `attachments` field (with mimeType, name, fileHash, objectName subfields) which is required for rendering post media (images/videos) in the PostCard component.
Applied to files:
src/screens/RegisterPage/RegisterPage.tsx
📚 Learning: 2024-11-02T07:39:51.950Z
Learnt from: meetulr
Repo: PalisadoesFoundation/talawa-admin PR: 2398
File: src/screens/ManageTag/ManageTag.tsx:108-0
Timestamp: 2024-11-02T07:39:51.950Z
Learning: In `src/screens/ManageTag/ManageTag.tsx`, when `assignedMemberSearchFirstName` or `assignedMemberSearchLastName` are empty strings, the query in the `useQuery` for `USER_TAGS_ASSIGNED_MEMBERS` intentionally includes filters with empty strings to match all entries.
Applied to files:
src/screens/RegisterPage/RegisterPage.tsx
🧬 Code graph analysis (5)
src/screens/RegisterPage/RegisterPage.spec.tsx (2)
src/GraphQl/Queries/Queries.ts (2)
ORGANIZATION_LIST_NO_MEMBERS(87-95)GET_COMMUNITY_DATA_PG(1115-1136)src/GraphQl/Mutations/mutations.ts (1)
SIGNUP_MUTATION(122-143)
src/shared-components/LoginForm/LoginForm.tsx (2)
src/types/LoginForm/interface.ts (1)
InterfaceLoginFormProps(4-14)src/Constant/constant.ts (2)
REACT_APP_USE_RECAPTCHA(4-4)RECAPTCHA_SITE_KEY(3-3)
src/shared-components/OrganizationSelector/OrganizationSelector.tsx (1)
src/types/OrganizationSelector/interface.ts (1)
InterfaceOrganizationSelectorProps(4-10)
src/shared-components/RegistrationForm/RegistrationForm.tsx (2)
src/types/RegistrationForm/interface.ts (2)
InterfaceRegistrationFormProps(4-13)IRegistrationData(15-22)src/Constant/constant.ts (2)
REACT_APP_USE_RECAPTCHA(4-4)RECAPTCHA_SITE_KEY(3-3)
src/shared-components/PasswordValidator/PasswordValidator.tsx (1)
src/types/PasswordValidator/interface.ts (1)
InterfacePasswordValidatorProps(4-13)
🪛 Biome (2.1.2)
src/shared-components/RegistrationForm/RegistrationForm.spec.tsx
[error] 24-30: Enforce that elements with ARIA roles must use a valid, non-abstract ARIA role.
Check WAI-ARIA for valid roles or provide options accordingly.
Unsafe fix: Remove the invalid role attribute.
Check the list of all valid role attributes.
(lint/a11y/useValidAriaRole)
src/shared-components/LoginForm/LoginForm.spec.tsx
[error] 18-23: Enforce that elements with ARIA roles must use a valid, non-abstract ARIA role.
Check WAI-ARIA for valid roles or provide options accordingly.
Unsafe fix: Remove the invalid role attribute.
Check the list of all valid role attributes.
(lint/a11y/useValidAriaRole)
| { | ||
| request: { | ||
| query: GET_COMMUNITY_DATA_PG, | ||
| }, | ||
| result: { | ||
| data: { | ||
| community: { | ||
| logoURL: 'https://example.com/logo.png', | ||
| name: 'Test Community', | ||
| websiteURL: 'https://example.com', | ||
| }, | ||
| }, | ||
| }, | ||
| }, |
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.
🧹 Nitpick | 🔵 Trivial
Mock community data is incomplete.
The GET_COMMUNITY_DATA_PG query returns many fields (createdAt, facebookURL, githubURL, etc.), but the mock only provides logoURL, name, and websiteURL. While Apollo with addTypename={false} may not strictly require all fields, incomplete mocks can hide bugs where the component accesses missing properties.
Consider providing a more complete mock or at least including fields the component actually uses:
result: {
data: {
community: {
+ id: 'community-1',
logoURL: 'https://example.com/logo.png',
+ logoMimeType: 'image/png',
name: 'Test Community',
websiteURL: 'https://example.com',
},
},
},📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| { | |
| request: { | |
| query: GET_COMMUNITY_DATA_PG, | |
| }, | |
| result: { | |
| data: { | |
| community: { | |
| logoURL: 'https://example.com/logo.png', | |
| name: 'Test Community', | |
| websiteURL: 'https://example.com', | |
| }, | |
| }, | |
| }, | |
| }, | |
| { | |
| request: { | |
| query: GET_COMMUNITY_DATA_PG, | |
| }, | |
| result: { | |
| data: { | |
| community: { | |
| id: 'community-1', | |
| logoURL: 'https://example.com/logo.png', | |
| logoMimeType: 'image/png', | |
| name: 'Test Community', | |
| websiteURL: 'https://example.com', | |
| }, | |
| }, | |
| }, | |
| }, |
🤖 Prompt for AI Agents
In src/screens/RegisterPage/RegisterPage.spec.tsx around lines 43 to 56, the
mocked GET_COMMUNITY_DATA_PG response only includes logoURL, name, and
websiteURL which is incomplete compared to the query and can mask runtime
errors; update the test mock to include all fields the component reads (at
minimum add id/slug, createdAt, contactEmail, description, facebookURL,
twitterURL, instagramURL, githubURL, termsURL, privacyURL and any other fields
your component accesses) and ensure the mock shape matches the GraphQL schema
(include __typename values if your tests or Apollo setup expect them) so the
component has the real data it expects.
| // Auto-login after registration if token returned | ||
| if (signUpData.signUp && signUpData.signUp.authenticationToken) { | ||
| const authToken = signUpData.signUp.authenticationToken; | ||
| setItem('token', authToken); | ||
| setItem('IsLoggedIn', 'TRUE'); | ||
| setItem('name', `${userData.firstName} ${userData.lastName}`); | ||
| setItem('email', userData.email); | ||
|
|
||
| if (pendingInvitationToken) { | ||
| removeItem('pendingInvitationToken'); | ||
| startSession(); | ||
| window.location.href = `/event/invitation/${pendingInvitationToken}`; | ||
| return true; | ||
| } | ||
| } | ||
|
|
||
| // Navigate to login | ||
| navigate(role === 'admin' ? '/admin' : '/'); | ||
| return true; |
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.
Post-registration navigation may be incorrect after auto-login.
When authenticationToken is returned and stored (lines 118-123), the user is effectively logged in. However, line 134 navigates to /admin or / (login pages), which would show the login form to an already-authenticated user.
If auto-login is intended, the user should be redirected to the appropriate dashboard (e.g., /orglist for admin or /user/organizations for user), similar to the login flow in LoginPage.tsx.
if (signUpData.signUp && signUpData.signUp.authenticationToken) {
const authToken = signUpData.signUp.authenticationToken;
setItem('token', authToken);
setItem('IsLoggedIn', 'TRUE');
setItem('name', `${userData.firstName} ${userData.lastName}`);
setItem('email', userData.email);
if (pendingInvitationToken) {
removeItem('pendingInvitationToken');
startSession();
window.location.href = `/event/invitation/${pendingInvitationToken}`;
return true;
}
+
+ startSession();
+ navigate(role === 'admin' ? '/orglist' : '/user/organizations');
+ return true;
}
// Navigate to login
navigate(role === 'admin' ? '/admin' : '/');
return true;📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| // Auto-login after registration if token returned | |
| if (signUpData.signUp && signUpData.signUp.authenticationToken) { | |
| const authToken = signUpData.signUp.authenticationToken; | |
| setItem('token', authToken); | |
| setItem('IsLoggedIn', 'TRUE'); | |
| setItem('name', `${userData.firstName} ${userData.lastName}`); | |
| setItem('email', userData.email); | |
| if (pendingInvitationToken) { | |
| removeItem('pendingInvitationToken'); | |
| startSession(); | |
| window.location.href = `/event/invitation/${pendingInvitationToken}`; | |
| return true; | |
| } | |
| } | |
| // Navigate to login | |
| navigate(role === 'admin' ? '/admin' : '/'); | |
| return true; | |
| // Auto-login after registration if token returned | |
| if (signUpData.signUp && signUpData.signUp.authenticationToken) { | |
| const authToken = signUpData.signUp.authenticationToken; | |
| setItem('token', authToken); | |
| setItem('IsLoggedIn', 'TRUE'); | |
| setItem('name', `${userData.firstName} ${userData.lastName}`); | |
| setItem('email', userData.email); | |
| if (pendingInvitationToken) { | |
| removeItem('pendingInvitationToken'); | |
| startSession(); | |
| window.location.href = `/event/invitation/${pendingInvitationToken}`; | |
| return true; | |
| } | |
| startSession(); | |
| navigate(role === 'admin' ? '/orglist' : '/user/organizations'); | |
| return true; | |
| } | |
| // Navigate to login | |
| navigate(role === 'admin' ? '/admin' : '/'); | |
| return true; |
| {isInputFocused && ( | ||
| <> | ||
| <ValidationItem | ||
| isValid={validation.lowercaseChar} | ||
| text={t('lowercase_check')} | ||
| className={styles.password_check_element} | ||
| /> | ||
| <ValidationItem | ||
| isValid={validation.uppercaseChar} | ||
| text={t('uppercase_check')} | ||
| className={styles.password_check_element} | ||
| /> | ||
| <ValidationItem | ||
| isValid={validation.numericValue} | ||
| text={t('numeric_value_check')} | ||
| className={styles.password_check_element} | ||
| /> | ||
| <ValidationItem | ||
| isValid={validation.specialChar} | ||
| text={t('special_char_check')} | ||
| className={`${styles.password_check_element} ${styles.password_check_element_bottom}`} | ||
| /> | ||
| </> | ||
| )} |
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.
Critical: Prop name mismatch with ValidationItem component.
Lines 70-89 pass isValid={validation.lowercaseChar} to ValidationItem, but ValidationItem expects a prop named failed (see ValidationItem.tsx line 14). This mismatch will cause TypeScript errors and inverted validation logic.
Update ValidationItem calls to use the correct prop name, or coordinate with the fix in ValidationItem.tsx to rename the prop to isValid:
<ValidationItem
- isValid={validation.lowercaseChar}
+ failed={!validation.lowercaseChar}
text={t('lowercase_check')}
className={styles.password_check_element}
/>Apply similar changes to all four ValidationItem calls (lines 70, 75, 80, 85). Alternatively, if ValidationItem is updated to use isValid prop name, no changes needed here.
📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| {isInputFocused && ( | |
| <> | |
| <ValidationItem | |
| isValid={validation.lowercaseChar} | |
| text={t('lowercase_check')} | |
| className={styles.password_check_element} | |
| /> | |
| <ValidationItem | |
| isValid={validation.uppercaseChar} | |
| text={t('uppercase_check')} | |
| className={styles.password_check_element} | |
| /> | |
| <ValidationItem | |
| isValid={validation.numericValue} | |
| text={t('numeric_value_check')} | |
| className={styles.password_check_element} | |
| /> | |
| <ValidationItem | |
| isValid={validation.specialChar} | |
| text={t('special_char_check')} | |
| className={`${styles.password_check_element} ${styles.password_check_element_bottom}`} | |
| /> | |
| </> | |
| )} | |
| {isInputFocused && ( | |
| <> | |
| <ValidationItem | |
| failed={!validation.lowercaseChar} | |
| text={t('lowercase_check')} | |
| className={styles.password_check_element} | |
| /> | |
| <ValidationItem | |
| failed={!validation.uppercaseChar} | |
| text={t('uppercase_check')} | |
| className={styles.password_check_element} | |
| /> | |
| <ValidationItem | |
| failed={!validation.numericValue} | |
| text={t('numeric_value_check')} | |
| className={styles.password_check_element} | |
| /> | |
| <ValidationItem | |
| failed={!validation.specialChar} | |
| text={t('special_char_check')} | |
| className={`${styles.password_check_element} ${styles.password_check_element_bottom}`} | |
| /> | |
| </> | |
| )} |
🤖 Prompt for AI Agents
In src/shared-components/PasswordValidator/PasswordValidator.tsx around lines 68
to 91, the ValidationItem props use isValid but the component expects a failed
prop, causing type errors and inverted logic; update each ValidationItem call to
pass failed={!validation.<field>} instead of isValid={validation.<field>} (i.e.,
replace isValid with failed and invert the boolean) for lowercaseChar,
uppercaseChar, numericValue, and specialChar so the prop names and truthiness
align with ValidationItem.tsx.
| import React from 'react'; | ||
| import { Check, Clear } from '@mui/icons-material'; | ||
|
|
||
| interface IValidationItemProps { | ||
| failed: boolean; | ||
| text: string; | ||
| className?: string; | ||
| } | ||
|
|
||
| /** | ||
| * ValidationItem Component | ||
| * Displays individual password validation check | ||
| */ | ||
| const ValidationItem = ({ failed, text, className }: IValidationItemProps) => ( | ||
| <p | ||
| className={`form-text ${failed ? 'text-danger' : 'text-success'} ${className || ''}`} | ||
| > | ||
| <span>{failed ? <Clear /> : <Check />}</span> | ||
| {text} | ||
| </p> | ||
| ); | ||
|
|
||
| export default ValidationItem; |
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.
Critical: Missing test file for ValidationItem component.
As noted in the PR objectives, this component lacks a corresponding test file (ValidationItem.spec.tsx). The PR aims for 100% test coverage for new code, and this is currently the only new shared component without tests.
Add a test file covering:
- Rendering with
failed=true(danger styling, Clear icon) - Rendering with
failed=false(success styling, Check icon) - Custom className application
Would you like me to generate the test implementation?
🤖 Prompt for AI Agents
In src/shared-components/PasswordValidator/ValidationItem.tsx around lines 1 to
23, the component is missing its test file; create ValidationItem.spec.tsx that
mounts/renders the component and asserts: when failed=true it has the
'text-danger' class and shows the Clear icon, when failed=false it has
'text-success' and shows the Check icon, and a custom className prop is appended
to the element; use your project's test utilities (React Testing Library/Jest),
query by role/text/class and assert presence of correct icon elements and
classes.
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: 4
♻️ Duplicate comments (2)
src/assets/css/app.css (1)
112-116: Scope link‑token overrides to auth UI only (don’t change :root).If grey links are only for the new auth screens, wrap those pages with a class (e.g., .auth-theme) and move the link tokens inside it to avoid app‑wide drift.
/* example */ .auth-theme { --bs-link-color: #555555; --bs-link-color-rgb: 85, 85, 85; --bs-link-hover-color: #555555; --bs-link-hover-color-rgb: 85, 85, 85; }Apply the wrapper at the auth page container.
src/shared-components/PasswordValidator/PasswordValidator.tsx (1)
68-91: Fix ValidationItem prop name and use the correct validation flags for each ruleTwo issues here need correction:
Prop name mismatch with ValidationItem
ValidationItemnow expects anisValidprop, but this file still passesfailed. This will cause TypeScript errors and prevent compilation.All four checks use
validation.lowercaseChar
Uppercase, numeric, and special‑char rows currently ignore their respective flags and only reflectlowercaseChar, so the UI will misreport validation status.Update the calls to align with the component API and the intended semantics, e.g.:
- {isInputFocused && ( - <> - <ValidationItem - failed={!validation.lowercaseChar} - text={t('lowercase_check')} - className={styles.password_check_element} - /> - <ValidationItem - failed={!validation.lowercaseChar} - text={t('uppercase_check')} - className={styles.password_check_element} - /> - <ValidationItem - failed={!validation.lowercaseChar} - text={t('numeric_value_check')} - className={styles.password_check_element} - /> - <ValidationItem - failed={!validation.lowercaseChar} - text={t('special_char_check')} - className={`${styles.password_check_element} ${styles.password_check_element_bottom}`} - /> - </> - )} + {isInputFocused && ( + <> + <ValidationItem + isValid={validation.lowercaseChar} + text={t('lowercase_check')} + className={styles.password_check_element} + /> + <ValidationItem + isValid={validation.uppercaseChar} + text={t('uppercase_check')} + className={styles.password_check_element} + /> + <ValidationItem + isValid={validation.numericValue} + text={t('numeric_value_check')} + className={styles.password_check_element} + /> + <ValidationItem + isValid={validation.specialChar} + text={t('special_char_check')} + className={`${styles.password_check_element} ${styles.password_check_element_bottom}`} + /> + </> + )}
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro
📒 Files selected for processing (13)
public/locales/en/translation.json(4 hunks)public/locales/es/translation.json(2 hunks)public/locales/fr/translation.json(2 hunks)public/locales/hi/translation.json(2 hunks)public/locales/zh/translation.json(2 hunks)src/assets/css/app.css(5 hunks)src/screens/LoginPage/LoginPage.tsx(3 hunks)src/screens/RegisterPage/RegisterPage.spec.tsx(1 hunks)src/shared-components/PasswordValidator/PasswordValidator.tsx(1 hunks)src/shared-components/PasswordValidator/ValidationItem.spec.tsx(1 hunks)src/shared-components/PasswordValidator/ValidationItem.tsx(1 hunks)src/shared-components/RegistrationForm/RegistrationForm.spec.tsx(1 hunks)src/shared-components/RegistrationForm/RegistrationForm.tsx(1 hunks)
🧰 Additional context used
🧠 Learnings (53)
📓 Common learnings
Learnt from: palisadoes
Repo: PalisadoesFoundation/talawa-admin PR: 0
File: :0-0
Timestamp: 2025-11-28T23:56:12.253Z
Learning: In the talawa-admin repository, when CodeRabbit identifies issues that require fixes in a PR review, the review status must be explicitly changed to "changes required" using GitHub CLI (gh pr review --request-changes), not just mentioned in the response text.
Learnt from: palisadoes
Repo: PalisadoesFoundation/talawa-admin PR: 0
File: :0-0
Timestamp: 2025-11-28T23:56:12.253Z
Learning: In the talawa-admin repository, when CodeRabbit identifies issues that require fixes in a PR review, the review status must be explicitly changed to "changes required" using GitHub CLI (gh pr review --request-changes), not just mentioned in the response text.
Learnt from: JaiPannu-IITI
Repo: PalisadoesFoundation/talawa-admin PR: 3592
File: src/components/EventManagement/EventRegistrant/EventRegistrants.tsx:16-19
Timestamp: 2025-02-13T01:55:19.334Z
Learning: PR #3577 has already refactored components to ensure no duplicate interfaces and proper type management for both the components and their children. This is part of the systematic refactoring approach being followed.
Learnt from: PurnenduMIshra129th
Repo: PalisadoesFoundation/talawa-admin PR: 3814
File: public/locales/zh/translation.json:0-0
Timestamp: 2025-03-19T17:42:16.729Z
Learning: The PR #3814 focuses specifically on implementing sign up, sign in, sign out, and useSession in better auth (frontend), and translation changes in the Chinese localization file were not part of the intentional changes made by the author.
Learnt from: JaiPannu-IITI
Repo: PalisadoesFoundation/talawa-admin PR: 3592
File: src/components/UserPortal/ChatRoom/ChatRoom.tsx:23-23
Timestamp: 2025-02-14T21:04:11.392Z
Learning: The codebase is being refactored in alphabetical order, with components up to LoginPortalToggle already updated. Temporary type coexistence is maintained to prevent breaking changes until all related components are refactored.
Learnt from: bandhan-majumder
Repo: PalisadoesFoundation/talawa-admin PR: 3926
File: src/style/app-fixed.module.css:8456-8463
Timestamp: 2025-04-13T10:05:41.802Z
Learning: For the Talawa Admin repository, focus feedback on substantive issues rather than minor styling suggestions, especially when the code follows established patterns in the codebase.
Learnt from: Ansingh0305
Repo: PalisadoesFoundation/talawa-admin PR: 0
File: :0-0
Timestamp: 2025-11-30T23:13:22.697Z
Learning: In talawa-admin PR #4908, increasing test concurrency from maxConcurrency: 1 to 6-12 with TOTAL_SHARDS: 12 exposed three critical latent bugs: (1) EventsAttendedByUser.spec.tsx used wrong GraphQL query mock (EVENT_DETAILS vs EVENT_DETAILS_BASIC with incorrect variable names), (2) User.mocks.ts missing search/reset refetch scenarios causing "No more mocked responses" errors, (3) EventCalendar.spec.tsx UTC timezone bug where new Date().toISOString() caused date calculation mismatches in non-UTC timezones. These bugs were masked at lower concurrency but surfaced consistently under parallel execution stress-testing. Fix involved aligning mocks with actual component queries and explicit timezone-aware date construction.
Learnt from: syedali237
Repo: PalisadoesFoundation/talawa-admin PR: 3988
File: cypress/e2e/login_spec/adminLogin.cy.ts:6-18
Timestamp: 2025-07-12T19:51:11.453Z
Learning: In the talawa-admin project, specifically in login test files like cypress/e2e/login_spec/adminLogin.cy.ts, the user syedali237 prefers keeping explicit UI login flows rather than using the custom `loginByApi` command to make the login functionality clearer and more demonstrative of how the actual login process works.
Learnt from: satyanvm
Repo: PalisadoesFoundation/talawa-admin PR: 0
File: :0-0
Timestamp: 2025-12-03T12:45:53.875Z
Learning: In talawa-admin reusable components, do not duplicate component prop interfaces in screens. Always import the shared interface from src/types/<Component>/interface.ts (e.g., InterfaceOrganizationCardProps) to keep usage in sync with the shared component.
Learnt from: adithyanotfound
Repo: PalisadoesFoundation/talawa-admin PR: 3915
File: src/screens/LoginPage/LoginPage.tsx:458-459
Timestamp: 2025-04-05T08:30:08.858Z
Learning: The "adminLogin" translation key is used in LoginPage.tsx and should be present in translation.json files for all languages, not in common.json or errors.json files. The key is accessed using the t() function, not tCommon().
Learnt from: adithyanotfound
Repo: PalisadoesFoundation/talawa-admin PR: 3915
File: src/screens/LoginPage/LoginPage.tsx:458-459
Timestamp: 2025-04-05T08:30:08.858Z
Learning: The "adminLogin" translation key is used in LoginPage.tsx and should be present in translation.json files for all languages, not in common.json or errors.json files. The key is accessed using the t() function, not tCommon().
Learnt from: bandhan-majumder
Repo: PalisadoesFoundation/talawa-admin PR: 3593
File: src/screens/UserPortal/Settings/Settings.tsx:1-1
Timestamp: 2025-02-14T07:49:53.498Z
Learning: The Settings component in talawa-admin should be split into smaller components and custom hooks to maintain code quality and meet line limit requirements. Key sections to extract: PersonalInfoSection, ContactInfoSection, and form logic hooks.
📚 Learning: 2025-11-30T23:13:22.697Z
Learnt from: Ansingh0305
Repo: PalisadoesFoundation/talawa-admin PR: 0
File: :0-0
Timestamp: 2025-11-30T23:13:22.697Z
Learning: In talawa-admin PR #4908, increasing test concurrency from maxConcurrency: 1 to 6-12 with TOTAL_SHARDS: 12 exposed three critical latent bugs: (1) EventsAttendedByUser.spec.tsx used wrong GraphQL query mock (EVENT_DETAILS vs EVENT_DETAILS_BASIC with incorrect variable names), (2) User.mocks.ts missing search/reset refetch scenarios causing "No more mocked responses" errors, (3) EventCalendar.spec.tsx UTC timezone bug where new Date().toISOString() caused date calculation mismatches in non-UTC timezones. These bugs were masked at lower concurrency but surfaced consistently under parallel execution stress-testing. Fix involved aligning mocks with actual component queries and explicit timezone-aware date construction.
Applied to files:
src/screens/RegisterPage/RegisterPage.spec.tsxsrc/shared-components/RegistrationForm/RegistrationForm.spec.tsx
📚 Learning: 2025-11-28T16:02:31.814Z
Learnt from: rawadhossain
Repo: PalisadoesFoundation/talawa-admin PR: 4882
File: src/screens/UserPortal/Volunteer/UpcomingEvents/RecurringEventVolunteerModal.spec.tsx:69-109
Timestamp: 2025-11-28T16:02:31.814Z
Learning: In Talawa Admin test files (e.g., src/screens/UserPortal/Volunteer/UpcomingEvents/RecurringEventVolunteerModal.spec.tsx), developers prefer keeping date/time mocks (like vi.spyOn(Date.prototype, 'toLocaleDateString')) inline within individual test cases rather than consolidating them in beforeEach blocks, to maintain clarity and keep mocks close to the tests that use them, even if it results in some duplication.
Applied to files:
src/screens/RegisterPage/RegisterPage.spec.tsxsrc/shared-components/RegistrationForm/RegistrationForm.spec.tsx
📚 Learning: 2025-10-22T22:00:53.943Z
Learnt from: Jashan32
Repo: PalisadoesFoundation/talawa-admin PR: 4524
File: src/screens/OrganizationDashboard/OrganizationDashboardMocks.ts:0-0
Timestamp: 2025-10-22T22:00:53.943Z
Learning: In src/screens/OrganizationDashboard/OrganizationDashboardMocks.ts (and similar mock files), avoid duplicating identical Apollo MockedProvider mocks for repeated query consumption. Prefer adding `maxUsageCount` to the existing mock or using `newData` for reusable responses to keep tests deterministic and reduce drift.
Applied to files:
src/screens/RegisterPage/RegisterPage.spec.tsxsrc/shared-components/RegistrationForm/RegistrationForm.spec.tsxsrc/screens/LoginPage/LoginPage.tsx
📚 Learning: 2024-12-03T05:52:37.888Z
Learnt from: bitbard3
Repo: PalisadoesFoundation/talawa-admin PR: 2588
File: src/components/ChangeLanguageDropdown/ChangeLanguageDropdown.spec.tsx:155-162
Timestamp: 2024-12-03T05:52:37.888Z
Learning: In the `ChangeLanguageDropdown` component (`src/components/ChangeLanguageDropdown/ChangeLanguageDropdown.tsx`), error handling has not been implemented. Therefore, test cases in `src/components/ChangeLanguageDropdown/ChangeLanguageDropdown.spec.tsx` do not cover error scenarios related to error handling.
Applied to files:
src/screens/RegisterPage/RegisterPage.spec.tsxsrc/shared-components/PasswordValidator/PasswordValidator.tsxsrc/shared-components/PasswordValidator/ValidationItem.tsxsrc/shared-components/RegistrationForm/RegistrationForm.spec.tsxsrc/shared-components/PasswordValidator/ValidationItem.spec.tsx
📚 Learning: 2024-11-01T12:54:20.857Z
Learnt from: GlenDsza
Repo: PalisadoesFoundation/talawa-admin PR: 2397
File: src/screens/OrganizationActionItems/testObject.mocks.ts:184-402
Timestamp: 2024-11-01T12:54:20.857Z
Learning: In `src/screens/OrganizationActionItems/testObject.mocks.ts`, test failures are not dependent on the `createdAt` fields; hardcoded dates in `createdAt` fields do not cause test failures in this file.
Applied to files:
src/screens/RegisterPage/RegisterPage.spec.tsxsrc/shared-components/RegistrationForm/RegistrationForm.spec.tsx
📚 Learning: 2025-08-17T07:39:34.255Z
Learnt from: syedali237
Repo: PalisadoesFoundation/talawa-admin PR: 4077
File: package.json:189-213
Timestamp: 2025-08-17T07:39:34.255Z
Learning: The Talawa Admin codebase primarily uses .spec.tsx/.spec.ts naming convention for unit tests, with Cypress tests using .cy.ts pattern. However, there is at least one .test.tsx file in the codebase, so NYC exclude patterns should include both .spec and .test patterns.
Applied to files:
src/screens/RegisterPage/RegisterPage.spec.tsxsrc/shared-components/PasswordValidator/ValidationItem.tsxsrc/shared-components/RegistrationForm/RegistrationForm.spec.tsx
📚 Learning: 2025-03-11T17:45:54.621Z
Learnt from: PurnenduMIshra129th
Repo: PalisadoesFoundation/talawa-admin PR: 3814
File: src/components/UserPortal/OrganizationNavbar/OrganizationNavbar.spec.tsx:137-146
Timestamp: 2025-03-11T17:45:54.621Z
Learning: In OrganizationNavbar.spec.tsx, separate vi.mock implementations for react-router-dom are needed to avoid errors - one for useNavigate and another for useParams.
Applied to files:
src/screens/RegisterPage/RegisterPage.spec.tsxsrc/shared-components/RegistrationForm/RegistrationForm.spec.tsx
📚 Learning: 2025-04-20T06:45:57.175Z
Learnt from: bandhan-majumder
Repo: PalisadoesFoundation/talawa-admin PR: 3926
File: src/components/Advertisements/core/AdvertisementRegister/AdvertisementRegister.spec.tsx:403-421
Timestamp: 2025-04-20T06:45:57.175Z
Learning: In the talawa-admin project, the Advertisement component tests (3 files) use both ApolloProvider and MockedProvider together, though it's not a widespread pattern in the codebase. The maintainer has confirmed this approach is needed for these specific tests.
Applied to files:
src/screens/RegisterPage/RegisterPage.spec.tsx
📚 Learning: 2024-10-08T16:13:41.996Z
Learnt from: Chaitanya1672
Repo: PalisadoesFoundation/talawa-admin PR: 2049
File: src/screens/OrganizationActionItems/ActionItemUpdateModal.tsx:112-138
Timestamp: 2024-10-08T16:13:41.996Z
Learning: The `istanbul ignore next` comments in the `ActionItemUpdateModal.tsx` file were added as part of a commit that introduced tests for the `ActionItemUpdateModal` component. Removing these comments and writing tests to cover the previously ignored lines is recommended to ensure code integrity and improve test coverage.
Applied to files:
src/screens/RegisterPage/RegisterPage.spec.tsxsrc/shared-components/PasswordValidator/PasswordValidator.tsxsrc/shared-components/PasswordValidator/ValidationItem.tsxsrc/shared-components/RegistrationForm/RegistrationForm.spec.tsxsrc/shared-components/PasswordValidator/ValidationItem.spec.tsx
📚 Learning: 2025-11-11T11:51:09.236Z
Learnt from: Ansingh0305
Repo: PalisadoesFoundation/talawa-admin PR: 0
File: :0-0
Timestamp: 2025-11-11T11:51:09.236Z
Learning: In talawa-admin PR #4664 (continuation of PR #4565 sharding work), global mock cleanup was implemented via vi.clearAllMocks() in vitest.setup.ts afterEach, along with Apollo Client warning suppression (temporary, pending follow-up PR) and test suite refactoring to per-test StaticMockLink instances. This test isolation strategy addresses mock state leakage that forced maxConcurrency: 1 in PR #4565, enabling future parallel test execution improvements and 3-4x speedup potential.
Applied to files:
src/screens/RegisterPage/RegisterPage.spec.tsxsrc/shared-components/RegistrationForm/RegistrationForm.spec.tsx
📚 Learning: 2025-04-27T04:35:39.472Z
Learnt from: MayankJha014
Repo: PalisadoesFoundation/talawa-admin PR: 3946
File: src/components/UserPortal/ChatRoom/ChatRoom.spec.tsx:0-0
Timestamp: 2025-04-27T04:35:39.472Z
Learning: In the talawa-admin codebase tests, to check whether toast notifications were called, use the imported toast object directly with waitFor (e.g., `expect(toast.error).toHaveBeenCalled()`). Do not use require() style imports within test assertions.
Applied to files:
src/screens/RegisterPage/RegisterPage.spec.tsx
📚 Learning: 2025-11-21T12:42:24.884Z
Learnt from: palisadoes
Repo: PalisadoesFoundation/talawa-admin PR: 4718
File: src/components/EventManagement/Dashboard/EventDashboard.mocks.ts:83-114
Timestamp: 2025-11-21T12:42:24.884Z
Learning: In talawa-admin mock files (e.g., EventDashboard.mocks.ts), mock constant names must accurately reflect what they test. Mock names suggesting role-based logic (e.g., MOCKS_WITH_ADMIN_ROLE) are misleading when the component derives role from localStorage rather than mock data. Name mocks based on their distinguishing data features (e.g., MOCKS_WITH_SINGLE_ATTENDEE) or test context (e.g., MOCKS_FOR_ADMIN_STORAGE_TEST).
Applied to files:
src/screens/RegisterPage/RegisterPage.spec.tsxsrc/shared-components/RegistrationForm/RegistrationForm.spec.tsx
📚 Learning: 2025-10-22T22:22:27.696Z
Learnt from: Jashan32
Repo: PalisadoesFoundation/talawa-admin PR: 4524
File: src/screens/Requests/Requests.spec.tsx:0-0
Timestamp: 2025-10-22T22:22:27.696Z
Learning: In talawa-admin tests using react-infinite-scroll-component (e.g., src/screens/Requests/Requests.spec.tsx), jsdom scroll is flaky. Prefer a resilient approach: try querying the container via document.querySelector('[data-testid="infinite-scroll-component"]') and fall back to window scroll if missing. Strengthen assertions by checking for page-2 items (e.g., "User9 Test") to ensure fetchMore actually ran instead of relying only on row counts.
Applied to files:
src/screens/RegisterPage/RegisterPage.spec.tsxsrc/shared-components/PasswordValidator/ValidationItem.tsxsrc/shared-components/RegistrationForm/RegistrationForm.spec.tsxsrc/shared-components/PasswordValidator/ValidationItem.spec.tsx
📚 Learning: 2024-10-30T12:01:40.366Z
Learnt from: meetulr
Repo: PalisadoesFoundation/talawa-admin PR: 2387
File: src/screens/ManageTag/ManageTagMockComponents/MockAddPeopleToTag.tsx:1-28
Timestamp: 2024-10-30T12:01:40.366Z
Learning: In the `MockAddPeopleToTag` component in `src/screens/ManageTag/ManageTagMockComponents/MockAddPeopleToTag.tsx`, it's acceptable to implement only the necessary props from `InterfaceAddPeopleToTagProps` and omit others like `refetchAssignedMembersData`, `t`, and `tCommon` that are tested separately.
Applied to files:
src/screens/RegisterPage/RegisterPage.spec.tsxsrc/shared-components/RegistrationForm/RegistrationForm.tsx
📚 Learning: 2025-11-12T00:28:53.713Z
Learnt from: Ansingh0305
Repo: PalisadoesFoundation/talawa-admin PR: 0
File: :0-0
Timestamp: 2025-11-12T00:28:53.713Z
Learning: In talawa-admin PR #4565 continuation (PR #4664 planned), Phase 2A mock isolation strategy uses global vi.clearAllMocks() in afterEach (vitest.setup.ts) plus refactoring module-level vi.fn() into per-test beforeEach blocks across 6 parallelizable issues (2A.0 foundation, 2A.1-2A.4 directory-based fixes, 2A.5 validation). This approach addresses mock call history accumulation enabling maxConcurrency: 2 and 2.3-2.5x speedup. vi.restoreAllMocks() alternative considered for spy restoration during validation phase. Phase 2A (mocks) correctly separated from Phase 2B (DOM/Apollo).
Applied to files:
src/screens/RegisterPage/RegisterPage.spec.tsxsrc/shared-components/RegistrationForm/RegistrationForm.spec.tsx
📚 Learning: 2024-10-25T19:31:37.405Z
Learnt from: meetulr
Repo: PalisadoesFoundation/talawa-admin PR: 2355
File: src/screens/ManageTag/ManageTagMocks.ts:187-269
Timestamp: 2024-10-25T19:31:37.405Z
Learning: In `src/screens/ManageTag/ManageTagMocks.ts`, when mocking data for `USER_TAGS_ASSIGNED_MEMBERS` and `USER_TAGS_MEMBERS_TO_ASSIGN_TO`, it's acceptable for user IDs to overlap because the queries serve different purposes and the overlapping IDs can represent realistic scenarios in tests.
Applied to files:
src/screens/RegisterPage/RegisterPage.spec.tsx
📚 Learning: 2024-11-01T13:26:46.088Z
Learnt from: GlenDsza
Repo: PalisadoesFoundation/talawa-admin PR: 2397
File: src/screens/UserPortal/Volunteer/Actions/Actions.mocks.ts:3-119
Timestamp: 2024-11-01T13:26:46.088Z
Learning: In `src/screens/UserPortal/Volunteer/Actions/Actions.mocks.ts`, the `dueDate` fields in mock data do not determine any test process status, so using future dates is acceptable.
Applied to files:
src/screens/RegisterPage/RegisterPage.spec.tsx
📚 Learning: 2025-11-13T18:07:48.621Z
Learnt from: Ansingh0305
Repo: PalisadoesFoundation/talawa-admin PR: 0
File: :0-0
Timestamp: 2025-11-13T18:07:48.621Z
Learning: In talawa-admin, Apollo Client pinned to 3.11.10 (not 3.14.0) to avoid deprecation warnings during test isolation work (PR #4565 Phase 2A-2B). Apollo 3.14.0's MockedProvider internally uses deprecated options causing console noise that interferes with debugging. Upgrade to 4.x blocked by dependency conflicts with apollo-upload-client and apollo/link-error. All addTypename props removed from 115+ test files for future compatibility. Will upgrade when dependencies support Apollo 4.x.
Applied to files:
src/screens/RegisterPage/RegisterPage.spec.tsx
📚 Learning: 2025-01-15T05:39:30.480Z
Learnt from: arpit-chakraborty
Repo: PalisadoesFoundation/talawa-admin PR: 3158
File: src/screens/OrganizationTags/OrganizationTagsMocks.ts:384-524
Timestamp: 2025-01-15T05:39:30.480Z
Learning: In OrganizationTagsMocks.ts, MOCKS_NULL_END_CURSOR and MOCKS_NO_MORE_PAGES are designed to test UI handling of edge cases where pagination data is inconsistent (e.g., hasNextPage is true but endCursor is null, or next page returns undefined data).
Applied to files:
src/screens/RegisterPage/RegisterPage.spec.tsx
📚 Learning: 2024-11-11T07:47:39.266Z
Learnt from: meetulr
Repo: PalisadoesFoundation/talawa-admin PR: 2425
File: src/screens/MemberDetail/MemberDetail.test.tsx:100-100
Timestamp: 2024-11-11T07:47:39.266Z
Learning: In `src/screens/MemberDetail/MemberDetail.test.tsx`, using `await wait();` is acceptable to wait for the render to complete.
Applied to files:
src/screens/RegisterPage/RegisterPage.spec.tsxsrc/shared-components/RegistrationForm/RegistrationForm.spec.tsx
📚 Learning: 2025-01-26T12:32:45.867Z
Learnt from: IITI-tushar
Repo: PalisadoesFoundation/talawa-admin PR: 3400
File: src/screens/UserPortal/Organizations/Organizations.spec.tsx:19-19
Timestamp: 2025-01-26T12:32:45.867Z
Learning: In React test files, avoid using React hooks outside component scope (including in static objects like mock data). Instead, initialize hooks inside describe blocks or extract the needed functionality without using hooks.
Applied to files:
src/screens/RegisterPage/RegisterPage.spec.tsxsrc/shared-components/RegistrationForm/RegistrationForm.spec.tsxsrc/shared-components/PasswordValidator/ValidationItem.spec.tsx
📚 Learning: 2024-11-02T07:18:39.563Z
Learnt from: meetulr
Repo: PalisadoesFoundation/talawa-admin PR: 2398
File: src/screens/OrganizationTags/OrganizationTags.test.tsx:184-0
Timestamp: 2024-11-02T07:18:39.563Z
Learning: In the `talawa-admin` project, it's acceptable for test cases in `src/screens/OrganizationTags/OrganizationTags.test.tsx` to test multiple behaviors within a single test function without needing to split them into smaller, focused tests.
Applied to files:
src/screens/RegisterPage/RegisterPage.spec.tsxsrc/shared-components/RegistrationForm/RegistrationForm.spec.tsx
📚 Learning: 2025-04-20T06:45:57.175Z
Learnt from: bandhan-majumder
Repo: PalisadoesFoundation/talawa-admin PR: 3926
File: src/components/Advertisements/core/AdvertisementRegister/AdvertisementRegister.spec.tsx:403-421
Timestamp: 2025-04-20T06:45:57.175Z
Learning: Using both ApolloProvider and MockedProvider together in tests is an established pattern in this codebase, even though it's technically redundant from Apollo Client's best practices perspective.
Applied to files:
src/screens/RegisterPage/RegisterPage.spec.tsx
📚 Learning: 2025-11-27T11:41:54.843Z
Learnt from: rawadhossain
Repo: PalisadoesFoundation/talawa-admin PR: 4865
File: src/components/EventRegistrantsModal/Modal/EventRegistrantsModal.spec.tsx:302-328
Timestamp: 2025-11-27T11:41:54.843Z
Learning: In Talawa Admin tests (e.g., src/components/EventRegistrantsModal/Modal/EventRegistrantsModal.spec.tsx), using queryByLabelText with an HTMLElement cast for MUI Autocomplete inputs is acceptable because the Autocomplete input can mount asynchronously and isn't always available for strict getBy* queries at initial render. This pattern is stable for MUI Autocomplete components.
Applied to files:
src/screens/RegisterPage/RegisterPage.spec.tsxsrc/shared-components/RegistrationForm/RegistrationForm.spec.tsx
📚 Learning: 2025-01-23T14:09:29.505Z
Learnt from: yugal07
Repo: PalisadoesFoundation/talawa-admin PR: 3379
File: src/screens/OrganizationActionItems/ItemModal.tsx:0-0
Timestamp: 2025-01-23T14:09:29.505Z
Learning: In form state management for the `allottedHours` field in `ItemModal.tsx`, it's crucial to maintain type checking using `typeof value !== 'number'` along with `Number.isNaN` to ensure proper validation of numeric values while preserving the form state integrity.
Applied to files:
src/shared-components/PasswordValidator/PasswordValidator.tsx
📚 Learning: 2025-02-14T21:04:11.392Z
Learnt from: JaiPannu-IITI
Repo: PalisadoesFoundation/talawa-admin PR: 3592
File: src/components/UserPortal/ChatRoom/ChatRoom.tsx:23-23
Timestamp: 2025-02-14T21:04:11.392Z
Learning: The codebase is being refactored in alphabetical order, with components up to LoginPortalToggle already updated. Temporary type coexistence is maintained to prevent breaking changes until all related components are refactored.
Applied to files:
src/shared-components/PasswordValidator/PasswordValidator.tsxsrc/shared-components/PasswordValidator/ValidationItem.tsxsrc/screens/LoginPage/LoginPage.tsx
📚 Learning: 2025-11-28T18:25:57.426Z
Learnt from: krikera
Repo: PalisadoesFoundation/talawa-admin PR: 4887
File: src/components/LoginPortalToggle/LoginPortalToggle.spec.tsx:57-59
Timestamp: 2025-11-28T18:25:57.426Z
Learning: In talawa-admin tests, when testing CSS module class names (imported as `styles from '*.module.css'`), prefer importing the styles module and using `toHaveClass(styles.className)` over `className.toContain('className')`. Vite hashes CSS module class names (e.g., activeLink → _activeLink_d8535b), so `toHaveClass('activeLink')` with plain strings will fail. The styles import approach is semantic, type-safe, and matches patterns in SideToggle.spec.tsx. Alternatively, `className.toContain()` is acceptable for substring matching without imports.
Applied to files:
src/shared-components/PasswordValidator/ValidationItem.tsxsrc/shared-components/RegistrationForm/RegistrationForm.spec.tsxsrc/shared-components/PasswordValidator/ValidationItem.spec.tsxsrc/assets/css/app.css
📚 Learning: 2024-10-28T06:33:09.726Z
Learnt from: meetulr
Repo: PalisadoesFoundation/talawa-admin PR: 2362
File: src/components/TagActions/TagActions.test.tsx:251-274
Timestamp: 2024-10-28T06:33:09.726Z
Learning: In `TagActions.test.tsx`, negative test cases for tag operations can be deferred and added later if necessary, according to the team's plan.
Applied to files:
src/shared-components/PasswordValidator/ValidationItem.tsx
📚 Learning: 2024-11-02T07:48:36.443Z
Learnt from: meetulr
Repo: PalisadoesFoundation/talawa-admin PR: 2398
File: src/components/AddPeopleToTag/AddPeopleToTag.test.tsx:177-241
Timestamp: 2024-11-02T07:48:36.443Z
Learning: In `src/components/AddPeopleToTag/AddPeopleToTag.test.tsx`, prefer keeping test cases separate and more readable, even if it involves some duplication, instead of extracting common logic into helper functions.
Applied to files:
src/shared-components/PasswordValidator/ValidationItem.tsxsrc/shared-components/RegistrationForm/RegistrationForm.tsxsrc/shared-components/RegistrationForm/RegistrationForm.spec.tsxsrc/shared-components/PasswordValidator/ValidationItem.spec.tsx
📚 Learning: 2025-04-05T08:30:08.858Z
Learnt from: adithyanotfound
Repo: PalisadoesFoundation/talawa-admin PR: 3915
File: src/screens/LoginPage/LoginPage.tsx:458-459
Timestamp: 2025-04-05T08:30:08.858Z
Learning: The "adminLogin" translation key is used in LoginPage.tsx and should be present in translation.json files for all languages, not in common.json or errors.json files. The key is accessed using the t() function, not tCommon().
Applied to files:
public/locales/fr/translation.jsonpublic/locales/hi/translation.jsonsrc/screens/LoginPage/LoginPage.tsxpublic/locales/zh/translation.jsonpublic/locales/es/translation.jsonpublic/locales/en/translation.json
📚 Learning: 2025-03-19T17:42:16.729Z
Learnt from: PurnenduMIshra129th
Repo: PalisadoesFoundation/talawa-admin PR: 3814
File: public/locales/zh/translation.json:0-0
Timestamp: 2025-03-19T17:42:16.729Z
Learning: The PR #3814 focuses specifically on implementing sign up, sign in, sign out, and useSession in better auth (frontend), and translation changes in the Chinese localization file were not part of the intentional changes made by the author.
Applied to files:
public/locales/fr/translation.jsonpublic/locales/hi/translation.jsonsrc/screens/LoginPage/LoginPage.tsxpublic/locales/zh/translation.jsonpublic/locales/es/translation.jsonpublic/locales/en/translation.json
📚 Learning: 2025-12-03T12:45:53.875Z
Learnt from: satyanvm
Repo: PalisadoesFoundation/talawa-admin PR: 0
File: :0-0
Timestamp: 2025-12-03T12:45:53.875Z
Learning: In talawa-admin reusable components, do not duplicate component prop interfaces in screens. Always import the shared interface from src/types/<Component>/interface.ts (e.g., InterfaceOrganizationCardProps) to keep usage in sync with the shared component.
Applied to files:
src/shared-components/RegistrationForm/RegistrationForm.tsx
📚 Learning: 2025-11-28T22:51:12.245Z
Learnt from: Ansingh0305
Repo: PalisadoesFoundation/talawa-admin PR: 0
File: :0-0
Timestamp: 2025-11-28T22:51:12.245Z
Learning: In talawa-admin PR #4826, mock cleanup implementation uses global vi.clearAllMocks() in vitest.setup.ts afterEach hook, combined with proper vi.hoisted() usage for module-level mocks. This strategy successfully achieved test isolation across 273 test files, passing the mock cleanup checker script with exit code 0. The implementation is ready for increasing maxConcurrency from conservative settings (CI: 1, local: 2) to higher concurrency levels (recommended gradual rollout: CI 1→2→4, local 2→4→8) to achieve Phase 2A goals of 2.3-2.5x speedup. Global cleanup strategy eliminates need for explicit afterEach blocks in every individual test file.
Applied to files:
src/shared-components/RegistrationForm/RegistrationForm.spec.tsx
📚 Learning: 2025-11-17T22:18:09.680Z
Learnt from: Ansingh0305
Repo: PalisadoesFoundation/talawa-admin PR: 0
File: :0-0
Timestamp: 2025-11-17T22:18:09.680Z
Learning: Talawa Admin Phase 2A testing guideline: Allow vi.hoisted() + vi.mock() module-level mocks for shared dependencies; prefer afterEach(() => vi.clearAllMocks()) as default cleanup. Use afterEach(() => vi.restoreAllMocks()) only in suites that create vi.spyOn spies or patch real implementations. Avoid vi.resetAllMocks() globally. The generic “no module-level mocks” rule is updated to “no module-level vi.fn except vi.hoisted module mocks.”
Applied to files:
src/shared-components/RegistrationForm/RegistrationForm.spec.tsx
📚 Learning: 2024-12-02T04:20:11.745Z
Learnt from: bitbard3
Repo: PalisadoesFoundation/talawa-admin PR: 2588
File: src/components/ChangeLanguageDropdown/ChangeLanguageDropdown.spec.tsx:145-155
Timestamp: 2024-12-02T04:20:11.745Z
Learning: In PRs focused solely on refactoring test cases from Jest to Vitest, avoid suggesting optimizations or changes outside the migration scope.
Applied to files:
src/shared-components/RegistrationForm/RegistrationForm.spec.tsx
📚 Learning: 2025-08-13T06:52:48.055Z
Learnt from: syedali237
Repo: PalisadoesFoundation/talawa-admin PR: 4040
File: cypress/pageObjects/AdminPortal/PeoplePage.ts:30-34
Timestamp: 2025-08-13T06:52:48.055Z
Learning: In the talawa-admin project's Cypress tests, specifically in cypress/pageObjects/AdminPortal/PeoplePage.ts, the element '[data-testid="existingUser"]' is a toggle control that requires .trigger('click') instead of .click() because it's not a standard button but a custom UI component that needs direct event triggering.
Applied to files:
src/shared-components/RegistrationForm/RegistrationForm.spec.tsx
📚 Learning: 2025-11-27T11:40:30.747Z
Learnt from: rawadhossain
Repo: PalisadoesFoundation/talawa-admin PR: 4865
File: src/components/EventRegistrantsModal/Modal/EventRegistrantsModal.spec.tsx:261-280
Timestamp: 2025-11-27T11:40:30.747Z
Learning: In Talawa Admin tests (e.g., src/components/EventRegistrantsModal/Modal/EventRegistrantsModal.spec.tsx), react-bootstrap Modal header close buttons don't support custom test IDs, so using getAllByRole('button', { name: /close/i })[0] to select the modal's primary close action is acceptable and stable, as the Modal component consistently exposes "Close" as the accessible label.
Applied to files:
src/shared-components/RegistrationForm/RegistrationForm.spec.tsx
📚 Learning: 2024-10-28T06:38:43.765Z
Learnt from: meetulr
Repo: PalisadoesFoundation/talawa-admin PR: 2362
File: src/components/TagActions/TagActions.test.tsx:123-131
Timestamp: 2024-10-28T06:38:43.765Z
Learning: In `TagActions.test.tsx`, `link2` is the error link used to simulate errors, so the existing test cases sufficiently cover error handling.
Applied to files:
src/shared-components/RegistrationForm/RegistrationForm.spec.tsx
📚 Learning: 2025-07-12T19:51:11.453Z
Learnt from: syedali237
Repo: PalisadoesFoundation/talawa-admin PR: 3988
File: cypress/e2e/login_spec/adminLogin.cy.ts:6-18
Timestamp: 2025-07-12T19:51:11.453Z
Learning: In the talawa-admin project, specifically in login test files like cypress/e2e/login_spec/adminLogin.cy.ts, the user syedali237 prefers keeping explicit UI login flows rather than using the custom `loginByApi` command to make the login functionality clearer and more demonstrative of how the actual login process works.
Applied to files:
src/shared-components/RegistrationForm/RegistrationForm.spec.tsx
📚 Learning: 2025-04-27T10:59:45.144Z
Learnt from: MayankJha014
Repo: PalisadoesFoundation/talawa-admin PR: 3946
File: src/components/UserPortal/ChatRoom/ChatRoom.spec.tsx:5670-5693
Timestamp: 2025-04-27T10:59:45.144Z
Learning: When testing UI components that display user names, test for firstName and lastName separately rather than as a combined full name, as the UI might render these in separate DOM elements, making combined assertions brittle.
Applied to files:
src/shared-components/RegistrationForm/RegistrationForm.spec.tsx
📚 Learning: 2025-04-20T07:34:29.946Z
Learnt from: bandhan-majumder
Repo: PalisadoesFoundation/talawa-admin PR: 3926
File: src/components/Advertisements/core/AdvertisementEntry/AdvertisementEntry.spec.tsx:155-157
Timestamp: 2025-04-20T07:34:29.946Z
Learning: The user prefers to structure tests by first checking if components render any elements at all (using general assertions), before proceeding to test specific content.
Applied to files:
src/shared-components/PasswordValidator/ValidationItem.spec.tsx
📚 Learning: 2025-02-20T13:35:01.218Z
Learnt from: syedali237
Repo: PalisadoesFoundation/talawa-admin PR: 3712
File: src/components/EventCalender/Yearly/YearlyEventCalender.spec.tsx:113-127
Timestamp: 2025-02-20T13:35:01.218Z
Learning: In React component tests, when testing window resize event handling, it's acceptable to only verify that the event is properly triggered without assertions if the test's focus is specifically on event handling rather than responsive behavior. Testing the actual responsive rendering would be a separate test case.
Applied to files:
src/shared-components/PasswordValidator/ValidationItem.spec.tsx
📚 Learning: 2025-08-20T18:04:52.324Z
Learnt from: Jashan32
Repo: PalisadoesFoundation/talawa-admin PR: 4094
File: src/screens/OrgList/OrgList.tsx:0-0
Timestamp: 2025-08-20T18:04:52.324Z
Learning: In PR #4094, the user confirmed that the pagination logic in src/screens/OrgList/OrgList.tsx was directly extracted from the user's orglist page without modifications for initial implementation, with plans to refactor for consistency later.
Applied to files:
src/screens/LoginPage/LoginPage.tsx
📚 Learning: 2025-08-20T18:04:23.118Z
Learnt from: Jashan32
Repo: PalisadoesFoundation/talawa-admin PR: 4094
File: src/screens/OrgList/OrgList.tsx:435-0
Timestamp: 2025-08-20T18:04:23.118Z
Learning: In the talawa-admin codebase, pagination logic for the admin orglist page in src/screens/OrgList/OrgList.tsx was directly extracted from the user's orglist page without modifications to maintain consistency between the two implementations.
Applied to files:
src/screens/LoginPage/LoginPage.tsx
📚 Learning: 2025-11-08T18:14:54.607Z
Learnt from: Jashan32
Repo: PalisadoesFoundation/talawa-admin PR: 4622
File: src/screens/OrgPost/OrgPost.tsx:109-122
Timestamp: 2025-11-08T18:14:54.607Z
Learning: In src/screens/OrgPost/OrgPost.tsx, the refetchPinnedPosts function from the ORGANIZATION_PINNED_POST_LIST query is intentionally left commented out because the entire page is set to reload when posts are deleted, unpinned, or pinned, making a separate refetch unnecessary.
Applied to files:
src/screens/LoginPage/LoginPage.tsx
📚 Learning: 2025-01-12T16:24:16.293Z
Learnt from: Aad1tya27
Repo: PalisadoesFoundation/talawa-admin PR: 3255
File: src/screens/UserPortal/Chat/Chat.tsx:0-0
Timestamp: 2025-01-12T16:24:16.293Z
Learning: In React components where a useEffect triggers data fetching operations and a separate useEffect handles the state updates based on that data (e.g., watching query results), it's not necessary to include the data variables in the first useEffect's dependency array. This pattern helps prevent unnecessary re-runs while maintaining proper data flow.
Applied to files:
src/screens/LoginPage/LoginPage.tsx
📚 Learning: 2025-02-06T20:56:05.378Z
Learnt from: PurnenduMIshra129th
Repo: PalisadoesFoundation/talawa-admin PR: 3491
File: src/components/UserPortal/SecuredRouteForUser/SecuredRouteForUser.tsx:34-43
Timestamp: 2025-02-06T20:56:05.378Z
Learning: In SecuredRouteForUser component, token updates between role switches (e.g., user to superAdmin) are better handled using separate useEffect hooks - one for initial token setup (empty deps) and another for refetch on token changes, rather than combining them into a single effect.
Applied to files:
src/screens/LoginPage/LoginPage.tsx
📚 Learning: 2024-12-09T21:12:47.916Z
Learnt from: raggettii
Repo: PalisadoesFoundation/talawa-admin PR: 2629
File: src/screens/UserPortal/LeaveOrganization/LeaveOrganization.tsx:30-36
Timestamp: 2024-12-09T21:12:47.916Z
Learning: When modifying organization membership, prefer using Apollo's `refetchQueries` or cache updates to refresh the UI instead of using `window.location.reload()`.
Applied to files:
src/screens/LoginPage/LoginPage.tsx
📚 Learning: 2024-10-30T15:46:05.784Z
Learnt from: meetulr
Repo: PalisadoesFoundation/talawa-admin PR: 2387
File: src/components/AddPeopleToTag/AddPeopleToTag.tsx:78-104
Timestamp: 2024-10-30T15:46:05.784Z
Learning: In `src/components/AddPeopleToTag/AddPeopleToTag.tsx`, and similar components, the team prefers to keep the current implementation of the `updateQuery` logic in infinite scroll functionality consistent across all screens.
Applied to files:
src/screens/LoginPage/LoginPage.tsx
📚 Learning: 2024-11-01T16:20:31.293Z
Learnt from: GlenDsza
Repo: PalisadoesFoundation/talawa-admin PR: 2397
File: src/screens/UserPortal/Volunteer/UpcomingEvents/UpcomingEvents.tsx:94-115
Timestamp: 2024-11-01T16:20:31.293Z
Learning: In the TypeScript files of this project, avoid suggesting explicit response types for `useQuery` calls unless necessary, as the team prefers to rely on TypeScript's type inference.
Applied to files:
src/screens/LoginPage/LoginPage.tsx
📚 Learning: 2024-10-28T06:51:05.867Z
Learnt from: meetulr
Repo: PalisadoesFoundation/talawa-admin PR: 2362
File: src/components/TagActions/TagActions.tsx:110-147
Timestamp: 2024-10-28T06:51:05.867Z
Learning: When handling the `useEffect` hooks for `addAncestorTagsData` and `removeAncestorTagsData` in `TagActions.tsx`, it's preferred to keep them separate to avoid confusion and enhance readability.
Applied to files:
src/screens/LoginPage/LoginPage.tsx
📚 Learning: 2024-10-30T13:29:28.310Z
Learnt from: meetulr
Repo: PalisadoesFoundation/talawa-admin PR: 2387
File: src/screens/ManageTag/ManageTag.tsx:113-147
Timestamp: 2024-10-30T13:29:28.310Z
Learning: In the `src/screens/ManageTag/ManageTag.tsx` file, the `InfiniteScroll` component uses the `loadMoreAssignedMembers` function efficiently, and additional error handling is unnecessary.
Applied to files:
src/screens/LoginPage/LoginPage.tsx
🧬 Code graph analysis (4)
src/screens/RegisterPage/RegisterPage.spec.tsx (2)
src/GraphQl/Queries/Queries.ts (2)
ORGANIZATION_LIST_NO_MEMBERS(87-95)GET_COMMUNITY_DATA_PG(1115-1136)src/GraphQl/Mutations/mutations.ts (1)
SIGNUP_MUTATION(122-143)
src/shared-components/PasswordValidator/PasswordValidator.tsx (1)
src/types/PasswordValidator/interface.ts (1)
InterfacePasswordValidatorProps(4-13)
src/shared-components/RegistrationForm/RegistrationForm.tsx (2)
src/types/RegistrationForm/interface.ts (2)
InterfaceRegistrationFormProps(4-13)IRegistrationData(15-22)src/Constant/constant.ts (2)
REACT_APP_USE_RECAPTCHA(4-4)RECAPTCHA_SITE_KEY(3-3)
src/screens/LoginPage/LoginPage.tsx (5)
src/utils/useLocalstorage.ts (4)
useLocalStorage(61-70)getItem(29-33)setItem(41-44)removeItem(51-54)src/GraphQl/Queries/Queries.ts (2)
GET_COMMUNITY_DATA_PG(1115-1136)SIGNIN_QUERY(1138-1152)src/GraphQl/Mutations/mutations.ts (1)
RECAPTCHA_MUTATION(255-259)src/Constant/constant.ts (1)
REACT_APP_USE_RECAPTCHA(4-4)src/utils/errorHandler.tsx (1)
errorHandler(10-32)
🪛 Biome (2.1.2)
src/shared-components/RegistrationForm/RegistrationForm.spec.tsx
[error] 24-30: Enforce that elements with ARIA roles must use a valid, non-abstract ARIA role.
Check WAI-ARIA for valid roles or provide options accordingly.
Unsafe fix: Remove the invalid role attribute.
Check the list of all valid role attributes.
(lint/a11y/useValidAriaRole)
src/assets/css/app.css
[error] 212-212: Invalid color
(parse)
🔇 Additional comments (11)
src/assets/css/app.css (1)
79-81: Nice: font stack now correctly quotes ‘Inter’.LGTM.
src/screens/RegisterPage/RegisterPage.spec.tsx (1)
15-80: RegisterPage tests now align well with GraphQL schema and toast behaviorMocked queries/mutations, organization/branding data, and toast stubs look consistent with the actual schema and component logic, and the happy‑path registration flow is covered end‑to‑end.
Also applies to: 95-155
public/locales/es/translation.json (1)
19-21: ES login/register i18n additions look consistent across flowsThe updated
loginPage.userLogin, newloginPage.loginSubHead, and the addeduserRegistervalidation keys mirror the English and other locale structures and should work cleanly with the refactored login/registration components.Also applies to: 989-994
src/shared-components/PasswordValidator/ValidationItem.spec.tsx (1)
5-79: Good, comprehensive coverage for ValidationItemThe spec exercises both valid/invalid states, icon swapping, custom classes, and rerendered content, matching the current
isValidAPI and ensuring regressions are unlikely here.public/locales/zh/translation.json (1)
17-18: ZH login/registration translations match new validation surfaceThe new
loginPage.loginSubHeadanduserRegistervalidation keys are consistent with other locales and should support the shared password validation and registration UX without missing keys.Also applies to: 989-994
public/locales/fr/translation.json (1)
17-18: FR login/userRegister translations are consistent with the refactored auth flowThe new
loginPage.loginSubHeadand addeduserRegistervalidation messages match the structure and semantics used in other locales and in the shared password/registration components.Also applies to: 989-994
src/shared-components/PasswordValidator/ValidationItem.tsx (1)
4-21: ValidationItem API and behavior now match intended semantics
isValidcorrectly drives success vs danger styling and Check vs Clear icons, and the structure is simple and test‑friendly.public/locales/hi/translation.json (1)
17-18: HI login/register validation keys are correctly wiredThe updated
loginPage.userLogin, newloginPage.loginSubHead, and addeduserRegistervalidation messages are consistent with other locales and will support the shared registration/password validation components without missing translations.Also applies to: 989-994
src/shared-components/RegistrationForm/RegistrationForm.spec.tsx (1)
1-190: RegistrationForm tests thoroughly cover the new component behavior.The suite exercises all key flows (valid submit with org, reset vs no-reset, login link toggle, disabled state, email normalization, and password mismatch message) and matches the component’s prop contract and routing/i18n setup. No issues from the test side.
public/locales/en/translation.json (1)
14-27: English login/registration copy changes look consistent with the refactor.The new/updated strings (login heading/subhead, email label, and userRegister validation messages) are coherent and line up with how the RegistrationForm/LoginForm now behave. Once the component-side key names are aligned (see RegistrationForm.tsx comment), the i18n wiring should work as intended.
Also applies to: 45-45, 1015-1034
src/screens/LoginPage/LoginPage.tsx (1)
1-167: LoginPage refactor cleanly composes shared components and preserves auth behavior.The new implementation keeps the existing auth flow (Apollo queries/mutations, localStorage, session handling, admin-role checks, optional reCAPTCHA) while delegating UI concerns to
AuthBrandingandLoginForm. Thedocument.titleside effect and role derivation fromlocation.pathnameare handled idiomatically, and there’s no longer a refetch loop on community data. This looks good.
|
should i keep that org selector in register? (because its not there in figma design) |
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: 1
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro
⛔ Files ignored due to path filters (1)
index.htmlis excluded by!*.html
📒 Files selected for processing (4)
docs/src/css/custom.css(0 hunks)src/assets/css/app.css(3 hunks)src/shared-components/RegistrationForm/RegistrationForm.tsx(1 hunks)src/style/app-fixed.module.css(6 hunks)
💤 Files with no reviewable changes (1)
- docs/src/css/custom.css
🧰 Additional context used
🧠 Learnings (13)
📓 Common learnings
Learnt from: palisadoes
Repo: PalisadoesFoundation/talawa-admin PR: 0
File: :0-0
Timestamp: 2025-11-28T23:56:12.253Z
Learning: In the talawa-admin repository, when CodeRabbit identifies issues that require fixes in a PR review, the review status must be explicitly changed to "changes required" using GitHub CLI (gh pr review --request-changes), not just mentioned in the response text.
Learnt from: palisadoes
Repo: PalisadoesFoundation/talawa-admin PR: 0
File: :0-0
Timestamp: 2025-11-28T23:56:12.253Z
Learning: In the talawa-admin repository, when CodeRabbit identifies issues that require fixes in a PR review, the review status must be explicitly changed to "changes required" using GitHub CLI (gh pr review --request-changes), not just mentioned in the response text.
Learnt from: JaiPannu-IITI
Repo: PalisadoesFoundation/talawa-admin PR: 3592
File: src/components/EventManagement/EventRegistrant/EventRegistrants.tsx:16-19
Timestamp: 2025-02-13T01:55:19.334Z
Learning: PR #3577 has already refactored components to ensure no duplicate interfaces and proper type management for both the components and their children. This is part of the systematic refactoring approach being followed.
Learnt from: PurnenduMIshra129th
Repo: PalisadoesFoundation/talawa-admin PR: 3814
File: public/locales/zh/translation.json:0-0
Timestamp: 2025-03-19T17:42:16.729Z
Learning: The PR #3814 focuses specifically on implementing sign up, sign in, sign out, and useSession in better auth (frontend), and translation changes in the Chinese localization file were not part of the intentional changes made by the author.
Learnt from: JaiPannu-IITI
Repo: PalisadoesFoundation/talawa-admin PR: 3592
File: src/components/UserPortal/ChatRoom/ChatRoom.tsx:23-23
Timestamp: 2025-02-14T21:04:11.392Z
Learning: The codebase is being refactored in alphabetical order, with components up to LoginPortalToggle already updated. Temporary type coexistence is maintained to prevent breaking changes until all related components are refactored.
Learnt from: bandhan-majumder
Repo: PalisadoesFoundation/talawa-admin PR: 3926
File: src/style/app-fixed.module.css:8456-8463
Timestamp: 2025-04-13T10:05:41.802Z
Learning: For the Talawa Admin repository, focus feedback on substantive issues rather than minor styling suggestions, especially when the code follows established patterns in the codebase.
Learnt from: Ansingh0305
Repo: PalisadoesFoundation/talawa-admin PR: 0
File: :0-0
Timestamp: 2025-11-12T00:28:53.713Z
Learning: In talawa-admin PR #4565 continuation (PR #4664 planned), Phase 2A mock isolation strategy uses global vi.clearAllMocks() in afterEach (vitest.setup.ts) plus refactoring module-level vi.fn() into per-test beforeEach blocks across 6 parallelizable issues (2A.0 foundation, 2A.1-2A.4 directory-based fixes, 2A.5 validation). This approach addresses mock call history accumulation enabling maxConcurrency: 2 and 2.3-2.5x speedup. vi.restoreAllMocks() alternative considered for spy restoration during validation phase. Phase 2A (mocks) correctly separated from Phase 2B (DOM/Apollo).
Learnt from: syedali237
Repo: PalisadoesFoundation/talawa-admin PR: 3988
File: cypress/e2e/login_spec/adminLogin.cy.ts:6-18
Timestamp: 2025-07-12T19:51:11.453Z
Learning: In the talawa-admin project, specifically in login test files like cypress/e2e/login_spec/adminLogin.cy.ts, the user syedali237 prefers keeping explicit UI login flows rather than using the custom `loginByApi` command to make the login functionality clearer and more demonstrative of how the actual login process works.
Learnt from: satyanvm
Repo: PalisadoesFoundation/talawa-admin PR: 0
File: :0-0
Timestamp: 2025-12-03T12:45:53.875Z
Learning: In talawa-admin reusable components, do not duplicate component prop interfaces in screens. Always import the shared interface from src/types/<Component>/interface.ts (e.g., InterfaceOrganizationCardProps) to keep usage in sync with the shared component.
Learnt from: bandhan-majumder
Repo: PalisadoesFoundation/talawa-admin PR: 3593
File: src/screens/UserPortal/Settings/Settings.tsx:1-1
Timestamp: 2025-02-14T07:49:53.498Z
Learning: The Settings component in talawa-admin should be split into smaller components and custom hooks to maintain code quality and meet line limit requirements. Key sections to extract: PersonalInfoSection, ContactInfoSection, and form logic hooks.
Learnt from: adithyanotfound
Repo: PalisadoesFoundation/talawa-admin PR: 3915
File: src/screens/LoginPage/LoginPage.tsx:458-459
Timestamp: 2025-04-05T08:30:08.858Z
Learning: The "adminLogin" translation key is used in LoginPage.tsx and should be present in translation.json files for all languages, not in common.json or errors.json files. The key is accessed using the t() function, not tCommon().
Learnt from: adithyanotfound
Repo: PalisadoesFoundation/talawa-admin PR: 3915
File: src/screens/LoginPage/LoginPage.tsx:458-459
Timestamp: 2025-04-05T08:30:08.858Z
Learning: The "adminLogin" translation key is used in LoginPage.tsx and should be present in translation.json files for all languages, not in common.json or errors.json files. The key is accessed using the t() function, not tCommon().
Learnt from: PurnenduMIshra129th
Repo: PalisadoesFoundation/talawa-admin PR: 3491
File: src/components/UserPortal/SecuredRouteForUser/SecuredRouteForUser.tsx:34-43
Timestamp: 2025-02-06T20:56:05.378Z
Learning: In SecuredRouteForUser component, token updates between role switches (e.g., user to superAdmin) are better handled using separate useEffect hooks - one for initial token setup (empty deps) and another for refetch on token changes, rather than combining them into a single effect.
📚 Learning: 2025-01-07T09:50:29.019Z
Learnt from: IITI-tushar
Repo: PalisadoesFoundation/talawa-admin PR: 3041
File: .github/workflows/css_check.py:11-22
Timestamp: 2025-01-07T09:50:29.019Z
Learning: In the talawa-admin project, CSS validation in TypeScript files should only check for hex color codes using the pattern `#([0-9a-fA-F]{3}){1,2}` and ensure that files only reference the `src/style/app.module.css` stylesheet.
Applied to files:
src/assets/css/app.csssrc/style/app-fixed.module.css
📚 Learning: 2025-03-09T07:58:18.934Z
Learnt from: palisadoes
Repo: PalisadoesFoundation/talawa-admin PR: 3788
File: src/style/app-fixed.module.css:4091-4094
Timestamp: 2025-03-09T07:58:18.934Z
Learning: In CSS, border properties should include width, style, and color (e.g., `border: 1px solid black`) rather than just color (e.g., `border: black`) to ensure consistent rendering across browsers.
Applied to files:
src/assets/css/app.css
📚 Learning: 2024-11-02T07:48:36.443Z
Learnt from: meetulr
Repo: PalisadoesFoundation/talawa-admin PR: 2398
File: src/components/AddPeopleToTag/AddPeopleToTag.test.tsx:177-241
Timestamp: 2024-11-02T07:48:36.443Z
Learning: In `src/components/AddPeopleToTag/AddPeopleToTag.test.tsx`, prefer keeping test cases separate and more readable, even if it involves some duplication, instead of extracting common logic into helper functions.
Applied to files:
src/shared-components/RegistrationForm/RegistrationForm.tsx
📚 Learning: 2025-04-05T08:30:08.858Z
Learnt from: adithyanotfound
Repo: PalisadoesFoundation/talawa-admin PR: 3915
File: src/screens/LoginPage/LoginPage.tsx:458-459
Timestamp: 2025-04-05T08:30:08.858Z
Learning: The "adminLogin" translation key is used in LoginPage.tsx and should be present in translation.json files for all languages, not in common.json or errors.json files. The key is accessed using the t() function, not tCommon().
Applied to files:
src/shared-components/RegistrationForm/RegistrationForm.tsx
📚 Learning: 2025-03-19T17:42:16.729Z
Learnt from: PurnenduMIshra129th
Repo: PalisadoesFoundation/talawa-admin PR: 3814
File: public/locales/zh/translation.json:0-0
Timestamp: 2025-03-19T17:42:16.729Z
Learning: The PR #3814 focuses specifically on implementing sign up, sign in, sign out, and useSession in better auth (frontend), and translation changes in the Chinese localization file were not part of the intentional changes made by the author.
Applied to files:
src/shared-components/RegistrationForm/RegistrationForm.tsx
📚 Learning: 2025-12-03T12:45:53.875Z
Learnt from: satyanvm
Repo: PalisadoesFoundation/talawa-admin PR: 0
File: :0-0
Timestamp: 2025-12-03T12:45:53.875Z
Learning: In talawa-admin reusable components, do not duplicate component prop interfaces in screens. Always import the shared interface from src/types/<Component>/interface.ts (e.g., InterfaceOrganizationCardProps) to keep usage in sync with the shared component.
Applied to files:
src/shared-components/RegistrationForm/RegistrationForm.tsx
📚 Learning: 2024-10-30T12:01:40.366Z
Learnt from: meetulr
Repo: PalisadoesFoundation/talawa-admin PR: 2387
File: src/screens/ManageTag/ManageTagMockComponents/MockAddPeopleToTag.tsx:1-28
Timestamp: 2024-10-30T12:01:40.366Z
Learning: In the `MockAddPeopleToTag` component in `src/screens/ManageTag/ManageTagMockComponents/MockAddPeopleToTag.tsx`, it's acceptable to implement only the necessary props from `InterfaceAddPeopleToTagProps` and omit others like `refetchAssignedMembersData`, `t`, and `tCommon` that are tested separately.
Applied to files:
src/shared-components/RegistrationForm/RegistrationForm.tsx
📚 Learning: 2025-01-07T10:16:15.158Z
Learnt from: IITI-tushar
Repo: PalisadoesFoundation/talawa-admin PR: 3041
File: .github/workflows/css_check.py:113-117
Timestamp: 2025-01-07T10:16:15.158Z
Learning: The talawa-admin codebase uses multiple CSS import patterns:
1. Component-specific module CSS files (ComponentName.module.css)
2. Global app styles (app.module.css) from the style directory
3. Third-party library CSS imports
Applied to files:
src/style/app-fixed.module.css
📚 Learning: 2025-11-28T18:25:57.426Z
Learnt from: krikera
Repo: PalisadoesFoundation/talawa-admin PR: 4887
File: src/components/LoginPortalToggle/LoginPortalToggle.spec.tsx:57-59
Timestamp: 2025-11-28T18:25:57.426Z
Learning: In talawa-admin tests, when testing CSS module class names (imported as `styles from '*.module.css'`), prefer importing the styles module and using `toHaveClass(styles.className)` over `className.toContain('className')`. Vite hashes CSS module class names (e.g., activeLink → _activeLink_d8535b), so `toHaveClass('activeLink')` with plain strings will fail. The styles import approach is semantic, type-safe, and matches patterns in SideToggle.spec.tsx. Alternatively, `className.toContain()` is acceptable for substring matching without imports.
Applied to files:
src/style/app-fixed.module.css
📚 Learning: 2025-04-13T10:05:41.802Z
Learnt from: bandhan-majumder
Repo: PalisadoesFoundation/talawa-admin PR: 3926
File: src/style/app-fixed.module.css:8456-8463
Timestamp: 2025-04-13T10:05:41.802Z
Learning: For the Talawa Admin repository, focus feedback on substantive issues rather than minor styling suggestions, especially when the code follows established patterns in the codebase.
Applied to files:
src/style/app-fixed.module.css
📚 Learning: 2025-02-14T21:04:11.392Z
Learnt from: JaiPannu-IITI
Repo: PalisadoesFoundation/talawa-admin PR: 3592
File: src/components/UserPortal/ChatRoom/ChatRoom.tsx:23-23
Timestamp: 2025-02-14T21:04:11.392Z
Learning: The codebase is being refactored in alphabetical order, with components up to LoginPortalToggle already updated. Temporary type coexistence is maintained to prevent breaking changes until all related components are refactored.
Applied to files:
src/style/app-fixed.module.css
📚 Learning: 2025-01-18T09:54:57.554Z
Learnt from: prathmesh703
Repo: PalisadoesFoundation/talawa-admin PR: 3309
File: src/screens/UserPortal/Organizations/Organizations.module.css:19-19
Timestamp: 2025-01-18T09:54:57.554Z
Learning: In the Organizations screen of talawa-admin, use `height: 100vh` instead of `min-height: 100vh` for the `.content` class to ensure proper positioning of the pagination section at the bottom. The container uses `overflow: auto` to handle content that exceeds the viewport height.
Applied to files:
src/style/app-fixed.module.css
🧬 Code graph analysis (1)
src/shared-components/RegistrationForm/RegistrationForm.tsx (2)
src/types/RegistrationForm/interface.ts (2)
InterfaceRegistrationFormProps(4-13)IRegistrationData(15-22)src/Constant/constant.ts (2)
REACT_APP_USE_RECAPTCHA(4-4)RECAPTCHA_SITE_KEY(3-3)
🔇 Additional comments (12)
src/assets/css/app.css (2)
76-78: LGTM: font stack corrected.Using 'Inter' (quoted) first in the sans-serif stack is good.
415-415: LGTM: hover now uses the hover token.Switching a:hover to color: var(--bs-link-hover-color) is correct and avoids the prior -rgb misuse.
src/style/app-fixed.module.css (5)
7212-7217: New branding class added for AuthBranding component integration.The
.fromPalisadoesclass is a clean addition that centers content with appropriate margins and uses the existing--primaryText-colorvariable. This aligns with the AuthBranding component mentioned in the PR summary.
7271-7271: Logo sizing substantially increased; verify no layout breakage on edge viewports.The
talawa_logoheight increased fromclamp(3rem, 8vw, 5rem)toclamp(3rem, 20vw, 8rem), making it significantly larger across all viewport sizes. On desktop (1920px), this grows from ~80px to ~128px; on mobile (375px), from ~48px to ~75px. While the AI summary documents this as intentional "expanded responsive logo sizing," please verify this aligns with the Figma design and doesn't cause layout shifts or overflow in the LoginPage/RegisterPage composition.
7303-7307: New forgot-password link styling with appropriate underline and color.The
.forgot_linkclass correctly applies semantic styling (text-decoration: underline,text-underline-offset, and--secondText-color). This integrates well with the LoginForm component and matches modern link design patterns.
7319-7319: Button color refactored for semantic consistency (no visual change).The
.reg_btncolor changed fromvar(--register-button-color)tovar(--secondText-color). Both variables resolve to#555555, so this is a semantic consistency improvement rather than a visual change. Good practice for maintainability—using a more generic variable name for a commonly used color.Also applies to: 7327-7327
7613-7614: Change Language button sizing reduced from 49px/160px to 40px/150px.The
.changeLanguageBtndimensions decreased slightly. Verify this sizing change is intentional and doesn't reduce clickability or readability on mobile/touch devices. The height reduction from 49px to 40px is meaningful for touch targets (typically 44px is recommended minimum).Also applies to: 7630-7631
src/shared-components/RegistrationForm/RegistrationForm.tsx (5)
1-18: LGTM! Imports are well-organized.The imports are properly structured, and the
validatePasswordutility import (line 17) shows the password validation logic has been extracted to a shared utility as previously requested.
123-257: LGTM! Form structure and field handling are well-implemented.The form fields are properly structured with:
- Appropriate
disabled,required, andautoCompleteattributes- Email normalization via
toLowerCase()(line 188)- Shared components (
PasswordField,PasswordValidator,OrganizationSelector)- Consistent error messaging: the inline password mismatch message (line 241) uses the same i18n key as the validation toast (line 103)
- Proper test IDs for testing
259-291: LGTM! ReCAPTCHA, submit button, and navigation link are correctly implemented.
- The reCAPTCHA
sitekeynow uses a safe fallback (RECAPTCHA_SITE_KEY || '') instead of the problematic'XXX'literal ✓- The submit button is properly disabled during loading
- The login link correctly routes based on the
roleprop (/adminfor admin,/for user)
70-121: Validation flow and form reset logic are correctly implemented.The
handleSubmitfunction properly:
- Validates names with a reasonable regex pattern (lines 76-78)
- Uses email regex validation instead of length check (line 92) ✓
- Calls the
validatePasswordutility for password validation (line 97)- Checks password confirmation match (line 102)
- Only resets the form and reCAPTCHA when
onSubmitreturnstrue(lines 107-120) ✓This addresses the previous review concerns about email validation and unconditional form reset.
Ensure the i18n keys used in the validation warnings exist in your translation files:
firstName_invalidlastName_invalidemail_invalidpassword_invalidPassword_and_Confirm_password_mismatchesThese should be present in the
userRegisternamespace ofpublic/locales/*/translation.jsonfiles.
57-64: Verify consistency between inline regexes and the validatePassword utility.The
handlePasswordCheckfunction uses inline regexes (lines 59-62) for real-time UI validation, whilevalidatePasswordutility is called at line 97 for submit validation. If these patterns diverge, users experience mismatched validation feedback (UI passes but submit fails, or vice versa).The special character regex at line 62 (
/[!@#$%^&*(),.?":{}|<>]/) may differ from the utility's pattern, creating maintenance risk and potential UX issues.Recommended fix: Export individual validation rules from
utils/passwordValidatorand reuse them inhandlePasswordCheckto ensure UI and submit validation use identical patterns:// In utils/passwordValidator.ts: export const getPasswordValidationRules = (password: string) => ({ lowercaseChar: /[a-z]/.test(password), uppercaseChar: /[A-Z]/.test(password), numericValue: /\d/.test(password), specialChar: /[!@#$%^&*()_+{}\[\]:;<>,.?~\\/-]/.test(password), }); // In RegistrationForm.tsx: const handlePasswordCheck = (pass: string): void => { const rules = getPasswordValidationRules(pass); setShowAlert({ lowercaseChar: !rules.lowercaseChar, uppercaseChar: !rules.uppercaseChar, numericValue: !rules.numericValue, specialChar: !rules.specialChar, }); };
|
|
@coderabbitai Evaluate this PR and determine whether the refactored files comply with the desired outcome outlined in this document. If they do not, provide guidance on how the files could be refactored to be compliant and give your review a “requested changes” status. https://docs-admin.talawa.io/docs/developer-resources/refactoring-guidelines Also do a full review and reevaluate all resolved items. If the PR requires any changes, even trivial ones, then give your review a “requested changes” status. If no changes are required then give the PR an “approved” status. |
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.
Requesting minor consistency improvement: ValidationItem component should use React.FC typing pattern to match all other shared components in this PR (LoginForm, RegistrationForm, PasswordField, PasswordValidator, AuthBranding, OrganizationSelector).
Both typing patterns are valid per modern TypeScript/React standards, but consistency within the codebase is important.
Otherwise, this is excellent refactoring work with comprehensive test coverage, proper code organization, and successful elimination of code duplication.
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.
Requested changes:
- Fix PasswordValidator to pass isValid and use the correct flags for each rule (lowercase/uppercase/numeric/special), not lowercase for all.
- Export and reuse password validation rules to keep UI and submit validation consistent.
- Unify i18n key for password mismatch across locales/usages (recommend key without trailing period).
- Gate reCAPTCHA rendering on both REACT_APP_USE_RECAPTCHA==="yes" and RECAPTCHA_SITE_KEY in LoginForm and RegistrationForm.
- Scope link color tokens in app.css to auth pages (e.g., .auth-theme) to avoid global style drift; also fix the invalid color at app.css:212.
- Remove Reddit link/icon from AuthBranding/social constants per maintainer directive.
- Fix invalid ARIA role attributes in new spec files flagged by Biome.
Great work otherwise—shared components, routes, tests, and i18n are solid.
🧩 Analysis chain🏁 Script executed: Length of output: 1506 🏁 Script executed: Length of output: 1579 🏁 Script executed: Length of output: 859 🏁 Script executed: Length of output: 1800 🏁 Script executed: Length of output: 2412 🏁 Script executed: Length of output: 3514 🏁 Script executed: Length of output: 2973 🏁 Script executed: Length of output: 878 @palisadoes, I've completed a comprehensive review of PR #4951. Here's my detailed analysis: 🔍 Refactoring Guidelines Document StatusThe URL you provided (https://docs-admin.talawa.io/docs/developer-resources/refactoring-guidelines) returns a 404 error. I searched both docs-admin.talawa.io and developer.palisadoes.org but couldn't locate this specific document. Therefore, I've evaluated the PR based on general React/TypeScript best practices and code quality standards. ✅ Excellent Refactoring AchievementsThis PR demonstrates high-quality refactoring work: 1. Complete Test Coverage ✅
2. Code Organization ✅
3. Type Safety ✅
4. Component Reusability ✅
5. i18n & Best Practices ✅
6. Code Quality ✅
|
|
@coderabbitai Evaluate this PR and determine whether the refactored files comply with the desired outcome outlined in this document. If they do not, provide guidance on how the files could be refactored to be compliant and give your review a “requested changes” status. https://docs-admin.talawa.io/docs/developer-resources/reusable-components |
🧩 Analysis chain🏁 Script executed: Length of output: 9888 🏁 Script executed: Length of output: 2208 🏁 Script executed: Length of output: 43235 🌐 Web query: 💡 Result: I couldn't find a page titled "reusable components guidelines" on docs-admin.talawa.io. Relevant Talawa Admin docs I found (may be helpful) include the main docs index, plugin architecture/implementation, configuration, installation, and developer testing pages. (docs-admin.talawa.io) Would you like me to:
Citations: 🌐 Web query: 💡 Result: Here are developer resources and guidance for Talawa Admin (including notes on reusable components):
Sources: Want direct links or a quick checklist for creating reusable components in Talawa‑Admin (file locations, coding style, component examples)? Citations:
🏁 Script executed: Length of output: 277823 Compliance review against “Reusable Components” guide (https://docs-admin.talawa.io/docs/developer-resources/reusable-components) Summary
Non-compliance and exact fixes
Additional maintainer directives (outside the guide but relevant to this PR)
Approval path
Setting status
🏁 Script executed: Unrecoverable error: Stream setup permanently failed: 14 UNAVAILABLE: read ECONNRESET 🏁 Script executed: Unrecoverable error: Stream setup permanently failed: 14 UNAVAILABLE: read ECONNRESET I reviewed the refactored auth screens against the “Reusable Components” guide (Reusable Components | Talawa‑Admin Documentation). Summary: the refactor largely complies, but two small items need updating to meet the guide strictly. Compliant with the guide
Required to comply with the guide
Maintainer directives acknowledged
Once you push these minor updates, I’ll re-review for approval. 🏁 Script executed: Unrecoverable error: Stream setup permanently failed: 14 UNAVAILABLE: read ECONNRESET Evaluated against “Reusable Components” (docs-admin.talawa.io → Developer Resources → Reusable Components). The refactor is close, but a few small items need updating to strictly comply. Required changes to meet the guide
File: src/types/PasswordValidator/interface.ts // add this alongside existing InterfacePasswordValidatorProps
export interface InterfaceValidationItemProps {
isValid: boolean;
text: string;
className?: string;
}File: src/shared-components/PasswordValidator/ValidationItem.tsx import { InterfaceValidationItemProps } from 'types/PasswordValidator/interface';
const ValidationItem: React.FC<InterfaceValidationItemProps> = ({ isValid, text, className }) => {
// existing JSX unchanged
};
export default ValidationItem;
Example to replicate (adjust names/props per file): /**
* RegistrationForm
* Reusable form for user/admin registration. Accepts `role` to toggle behavior and appearance.
* @param {InterfaceRegistrationFormProps} props
* @returns {JSX.Element}
*/
Maintainer directives (verify while you’re here)
Once these are pushed I’ll re-review immediately; I expect approval after these updates. I’m setting the PR to “changes requested” per repository policy while these edits are made. 🏁 Script executed: Unrecoverable error: Stream setup permanently failed: 14 UNAVAILABLE: read ECONNRESET Reviewed against “Reusable Components” (docs-admin.talawa.io → Developer Resources → Reusable Components). The refactor is close; a few small updates are needed to strictly comply with the guide. Required to comply with the guide
export interface InterfaceValidationItemProps {
isValid: boolean;
text: string;
className?: string;
}
import { InterfaceValidationItemProps } from 'types/PasswordValidator/interface';
const ValidationItem: React.FC<InterfaceValidationItemProps> = ({ isValid, text, className }) => {
// existing JSX unchanged
};
export default ValidationItem;
/**
* RegistrationForm
* Reusable form for user/admin registration. Accepts `role` to toggle behavior and appearance.
* @param {InterfaceRegistrationFormProps} props
* @returns {JSX.Element}
*/
Maintainer directives (quick verification)
Once these are pushed, I’ll re-review quickly; I expect to approve after these small changes. 🏁 Script executed: Unrecoverable error: Stream setup permanently failed: 14 UNAVAILABLE: read ECONNRESET Assessed PR #4951 against “Reusable Components” (Developer Resources → Reusable Components). Overall the refactor is strong and mostly compliant; a few small updates are needed to strictly meet the guide. Required changes to comply with the guide
// alongside InterfacePasswordValidatorProps
export interface InterfaceValidationItemProps {
isValid: boolean;
text: string;
className?: string;
}
import { InterfaceValidationItemProps } from 'types/PasswordValidator/interface';
const ValidationItem: React.FC<InterfaceValidationItemProps> = ({ isValid, text, className }) => {
/* existing JSX unchanged */
};
export default ValidationItem;
/**
* RegistrationForm
* Reusable form for user/admin registration. Accepts `role` to toggle behavior and appearance.
* @param {InterfaceRegistrationFormProps} props
* @returns {JSX.Element}
*/
// src/types/Navbar/interface.ts
export interface InterfaceNavbarProps {
/* add the actual props your Navbar uses */
}Then in Navbar.tsx: import { InterfaceNavbarProps } from 'types/Navbar/interface';
export default function Navbar(props: InterfaceNavbarProps): JSX.Element {
/* ... */
}Maintainer directives (verify while here)
Notes on other guide points reviewed
Once these are pushed, I’ll re-review promptly; I expect to approve after these minor updates. I attempted to set the PR to “changes requested” via gh CLI, but the run environment returned a transient connection error. If helpful, you (or I on next pass) can run: ✏️ Learnings added
🧠 Learnings used✅ Actions performedReview triggered.
|
palisadoes
left a comment
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.
Please apply these changes
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.
Exclude this file from the PR. It is not relevant
- docs/src/css/custom.css
palisadoes
left a comment
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.
Exclude this file from the PR
- index.html
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: 14
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
src/utils/passwordValidator.ts (1)
1-21: Centralize password rules to avoid mismatch between UI and submit-time validation
validatePasswordandgetPasswordValidationRulescurrently use different special‑character regexes, andvalidatePassworddoesn’t reuse the new helper. This can cause the PasswordValidator UI to report a rule as satisfied whilevalidatePasswordstill fails (or the opposite).Consider centralizing the rules, e.g.:
const SPECIAL_CHAR_REGEX = /[!@#$%^&*()_+{}\[\]:;<>,.?~\\/-]/; export const getPasswordValidationRules = (password: string) => ({ lowercaseChar: /[a-z]/.test(password), uppercaseChar: /[A-Z]/.test(password), numericValue: /\d/.test(password), specialChar: SPECIAL_CHAR_REGEX.test(password), }); export const validatePassword = (password: string): boolean => { const minLength = 8; const rules = getPasswordValidationRules(password); return ( password.length >= minLength && rules.lowercaseChar && rules.uppercaseChar && rules.numericValue && rules.specialChar ); };(Adjust
SPECIAL_CHAR_REGEXto whichever set of characters the backend expects so both functions stay in sync.)
♻️ Duplicate comments (2)
public/locales/en/translation.json (1)
1019-1019: LGTM: grammar fixed"Log in to your account" is the correct form.
src/screens/RegisterPage/RegisterPage.tsx (1)
117-135: Major: Navigation after auto-login sends authenticated users to login pages.Lines 117-123 store the authentication token and set
IsLoggedInto'TRUE', effectively logging the user in. However, line 134 then navigates to login pages (/adminor/), which will likely redirect them again or show a confusing state.After auto-login, users should be directed to their respective dashboards:
if (signUpData.signUp && signUpData.signUp.authenticationToken) { const authToken = signUpData.signUp.authenticationToken; setItem('token', authToken); setItem('IsLoggedIn', 'TRUE'); setItem('name', `${userData.firstName} ${userData.lastName}`); setItem('email', userData.email); if (pendingInvitationToken) { removeItem('pendingInvitationToken'); startSession(); window.location.href = `/event/invitation/${pendingInvitationToken}`; return true; } + + startSession(); + navigate(role === 'admin' ? '/orglist' : '/user/organizations'); + return true; } - // Navigate to login - navigate(role === 'admin' ? '/admin' : '/'); + // Fallback: Navigate to login if no token was returned + if (!signUpData.signUp?.authenticationToken) { + navigate(role === 'admin' ? '/admin' : '/'); + } return true;
| "password_invalid": "Password should contain atleast one lowercase letter, one uppercase letter, one numeric value and one special character", | ||
| "email_invalid": "Email should have atleast 8 characters", | ||
| "Password_and_Confirm_password_mismatches.": "Password and Confirm password mismatches.", | ||
| "Password_and_Confirm_password_mismatches": "Password and Confirm password mismatches.", |
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.
Use one canonical key for password mismatch.
Remove "Password_and_Confirm_password_mismatches" in favor of "passwordMismatches" across loginPage and userRegister to prevent duplicate keys and missed updates.
- "Password_and_Confirm_password_mismatches": "Password and Confirm password mismatches.",As per coding guidelines and prior learnings, standardize i18n keys.
Committable suggestion skipped: line range outside the PR's diff.
🤖 Prompt for AI Agents
In public/locales/en/translation.json around line 26, the key
"Password_and_Confirm_password_mismatches" should be removed and replaced by
using the canonical key "passwordMismatches"; delete the existing entry, add or
ensure an entry "passwordMismatches": "Password and Confirm password
mismatches." exists, then update all references in loginPage and userRegister to
use "passwordMismatches" (search for the old key and replace it), and run a
quick i18n key check or tests to confirm no remaining references to the old key.
| "userLogin": "Acceso", | ||
| "loginSubHead": "Inicio de sesión", | ||
| "adminLogin": "Inicio de sesión de administrador", |
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.
🧹 Nitpick | 🔵 Trivial
OK: “userLogin” → “Acceso” and added subhead
Consistent with the refactor. Optional: more natural subhead could be “Inicia sesión en tu cuenta”.
🤖 Prompt for AI Agents
In public/locales/es/translation.json around lines 19 to 21, the "loginSubHead"
value is currently "Inicio de sesión" which is fine but the reviewer suggests a
more natural subhead; update the "loginSubHead" translation to "Inicia sesión en
tu cuenta" (or another preferred natural phrasing) to improve UX consistency
while keeping "userLogin": "Acceso" and "adminLogin": "Inicio de sesión de
administrador" unchanged.
| "password_invalid": "La contraseña debe contener al menos una letra minúscula, una letra mayúscula, un valor numérico y un carácter especial.", | ||
| "email_invalid": "El correo electrónico debe tener al menos 8 caracteres.", | ||
| "Password_and_Confirm_password_mismatches.": "Contraseña y Confirmar contraseña no coinciden.", | ||
| "Password_and_Confirm_password_mismatches": "Contraseña y Confirmar contraseña no coinciden.", |
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.
Consolidate password mismatch key.
Prefer single key "passwordMismatches"; remove "Password_and_Confirm_password_mismatches".
- "Password_and_Confirm_password_mismatches": "Contraseña y Confirmar contraseña no coinciden.",Ensure usages updated. Based on learnings, standardize i18n keys.
Committable suggestion skipped: line range outside the PR's diff.
🤖 Prompt for AI Agents
In public/locales/es/translation.json around line 33, the key
"Password_and_Confirm_password_mismatches" should be removed and replaced by a
single standardized key "passwordMismatches" with the same Spanish value
("Contraseña y Confirmar contraseña no coinciden."). Update all code references
to use "passwordMismatches" instead of the old key, and apply the same key
change across other locale files to keep i18n keys consistent.
| "firstName_invalid": "El nombre debe contener solo letras minúsculas y mayúsculas.", | ||
| "lastName_invalid": "El apellido debe contener solo letras minúsculas y mayúsculas.", | ||
| "password_invalid": "La contraseña debe contener al menos una letra minúscula, una letra mayúscula, un valor numérico y un carácter especial.", | ||
| "email_invalid": "El correo electrónico debe tener al menos 8 caracteres.", | ||
| "passwordMismatches": "Contraseña y Confirmar contraseña no coinciden.", | ||
| "Password_and_Confirm_password_mismatches": "Contraseña y Confirmar contraseña no coinciden.", | ||
| "register": "Registro", |
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.
Remove duplicate keys for the same error.
Keep only "passwordMismatches".
- "passwordMismatches": "Contraseña y Confirmar contraseña no coinciden.",
- "Password_and_Confirm_password_mismatches": "Contraseña y Confirmar contraseña no coinciden.",
+ "passwordMismatches": "Contraseña y Confirmar contraseña no coinciden.",📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| "firstName_invalid": "El nombre debe contener solo letras minúsculas y mayúsculas.", | |
| "lastName_invalid": "El apellido debe contener solo letras minúsculas y mayúsculas.", | |
| "password_invalid": "La contraseña debe contener al menos una letra minúscula, una letra mayúscula, un valor numérico y un carácter especial.", | |
| "email_invalid": "El correo electrónico debe tener al menos 8 caracteres.", | |
| "passwordMismatches": "Contraseña y Confirmar contraseña no coinciden.", | |
| "Password_and_Confirm_password_mismatches": "Contraseña y Confirmar contraseña no coinciden.", | |
| "register": "Registro", | |
| "firstName_invalid": "El nombre debe contener solo letras minúsculas y mayúsculas.", | |
| "lastName_invalid": "El apellido debe contener solo letras minúsculas y mayúsculas.", | |
| "password_invalid": "La contraseña debe contener al menos una letra minúscula, una letra mayúscula, un valor numérico y un carácter especial.", | |
| "email_invalid": "El correo electrónico debe tener al menos 8 caracteres.", | |
| "passwordMismatches": "Contraseña y Confirmar contraseña no coinciden.", | |
| "register": "Registro", |
🤖 Prompt for AI Agents
In public/locales/es/translation.json around lines 991 to 997 there are
duplicate keys for the same error ("passwordMismatches" and
"Password_and_Confirm_password_mismatches"); remove the duplicate
"Password_and_Confirm_password_mismatches" entry and keep only
"passwordMismatches", ensuring the JSON remains valid (no trailing commas) and
that the retained key's value is the expected Spanish string.
| "password_invalid": "Le mot de passe doit contenir au moins une lettre minuscule, une lettre majuscule, une valeur numérique et un caractère spécial", | ||
| "email_invalid": "L'e-mail doit contenir au moins 8 caractères", | ||
| "Password_and_Confirm_password_mismatches.": "Mot de passe et Confirmer les incompatibilités de mot de passe.", | ||
| "Password_and_Confirm_password_mismatches": "Mot de passe et Confirmer les incompatibilités de mot de passe.", |
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.
Unify password‑mismatch key across app.
Remove "Password_and_Confirm_password_mismatches"; use "passwordMismatches" everywhere to avoid duplicated strings and usage.
- "Password_and_Confirm_password_mismatches": "Mot de passe et Confirmer les incompatibilités de mot de passe.",Ensure components reference t('...passwordMismatches'). Based on learnings, standardize i18n keys.
Committable suggestion skipped: line range outside the PR's diff.
🤖 Prompt for AI Agents
In public/locales/fr/translation.json around line 26, remove the redundant key
"Password_and_Confirm_password_mismatches" and replace it with the standardized
key "passwordMismatches" (keeping the French string value), then scan the
codebase for any references to the old key and update them to
t('passwordMismatches') so all components use the unified i18n key.
| "firstName_invalid": "名字只能包含小写和大写字母", | ||
| "lastName_invalid": "姓氏只能包含小写和大写字母", | ||
| "password_invalid": "密码应至少包含1个小写字母、1个大写字母、1个数字和1个特殊字符", | ||
| "email_invalid": "电子邮件应至少包含 8 个字符", | ||
| "Password_and_Confirm_password_mismatches": "密码和确认密码不匹配。", | ||
| "passwordMismatches": "密码和确认密码不匹配。", | ||
| "enterFirstName": "输入您的名字", |
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.
Deduplicate mismatch translations.
Keep only "passwordMismatches".
- "Password_and_Confirm_password_mismatches": "密码和确认密码不匹配。",
- "passwordMismatches": "密码和确认密码不匹配。",
+ "passwordMismatches": "密码和确认密码不匹配。",📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| "firstName_invalid": "名字只能包含小写和大写字母", | |
| "lastName_invalid": "姓氏只能包含小写和大写字母", | |
| "password_invalid": "密码应至少包含1个小写字母、1个大写字母、1个数字和1个特殊字符", | |
| "email_invalid": "电子邮件应至少包含 8 个字符", | |
| "Password_and_Confirm_password_mismatches": "密码和确认密码不匹配。", | |
| "passwordMismatches": "密码和确认密码不匹配。", | |
| "enterFirstName": "输入您的名字", | |
| "firstName_invalid": "名字只能包含小写和大写字母", | |
| "lastName_invalid": "姓氏只能包含小写和大写字母", | |
| "password_invalid": "密码应至少包含1个小写字母、1个大写字母、1个数字和1个特殊字符", | |
| "email_invalid": "电子邮件应至少包含 8 个字符", | |
| "passwordMismatches": "密码和确认密码不匹配。", | |
| "enterFirstName": "输入您的名字", |
🤖 Prompt for AI Agents
In public/locales/zh/translation.json around lines 991 to 997, there are
duplicate entries for the same message; remove the
"Password_and_Confirm_password_mismatches" key and keep only
"passwordMismatches" to deduplicate, ensuring the JSON remains valid (no
trailing commas) and that the remaining "passwordMismatches" value is the
intended Chinese translation.
| a:hover { | ||
| --bs-link-color-rgb: var(--bs-link-hover-color-rgb); | ||
| color: var(--bs-link-hover-color); | ||
| } |
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.
🧹 Nitpick | 🔵 Trivial
Hover color now references the hover token.
Good switch to var(--bs-link-hover-color). Optionally mirror this for a:focus-visible for parity.
a:focus-visible { color: var(--bs-link-hover-color); }🤖 Prompt for AI Agents
In src/assets/css/app.css around lines 414 to 416, the a:hover rule now uses
var(--bs-link-hover-color) but the :focus-visible state is not covered; add a
matching a:focus-visible selector that sets color to var(--bs-link-hover-color)
(place it adjacent to the a:hover block for parity and accessibility) so
keyboard-focused links get the same hover color.
| } | ||
| import { InterfacePageHeaderProps } from 'types/Navbar/interface'; | ||
|
|
||
| export default function PageHeader({ |
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.
🧹 Nitpick | 🔵 Trivial
Consider renaming file to match component name.
The component is named PageHeader but the file is Navbar.tsx. For consistency, consider renaming the file to PageHeader.tsx to match the component name.
🤖 Prompt for AI Agents
In src/shared-components/Navbar/Navbar.tsx at line 67, the default exported
component is named PageHeader but the file is named Navbar.tsx; rename the file
to PageHeader.tsx and update all imports/exports to use the new path (including
barrel/index files and any relative imports across the repo) to avoid broken
imports; run a repo-wide search for "Navbar" imports to replace with
"PageHeader" where appropriate and update any story/tests or style files that
reference the old filename.
| export interface InterfacePageHeaderProps { | ||
| title?: string; | ||
| search?: { | ||
| placeholder: string; | ||
| onSearch: (value: string) => void; | ||
| inputTestId?: string; | ||
| buttonTestId?: string; | ||
| }; | ||
| sorting?: Array<{ | ||
| title: string; | ||
| options: { label: string; value: string | number }[]; | ||
| selected: string | number; | ||
| onChange: (value: string | number) => void; | ||
| testIdPrefix: string; | ||
| }>; | ||
| showEventTypeFilter?: boolean; | ||
| actions?: React.ReactNode; | ||
| } |
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.
🛠️ Refactor suggestion | 🟠 Major
Add TSDoc header to document the interface.
The interface is missing a TSDoc header. Per project guidelines, shared component prop interfaces should include a brief description of their purpose.
Based on learnings: Talawa Admin reusable components require TSDoc headers for prop interfaces defined in src/types/<Component>/interface.ts.
Apply this diff to add documentation:
+/**
+ * Props for the PageHeader component.
+ *
+ * Defines the configuration for a flexible page header with optional title,
+ * search bar, sorting controls, event type filter, and action buttons.
+ */
export interface InterfacePageHeaderProps {
title?: string;📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| export interface InterfacePageHeaderProps { | |
| title?: string; | |
| search?: { | |
| placeholder: string; | |
| onSearch: (value: string) => void; | |
| inputTestId?: string; | |
| buttonTestId?: string; | |
| }; | |
| sorting?: Array<{ | |
| title: string; | |
| options: { label: string; value: string | number }[]; | |
| selected: string | number; | |
| onChange: (value: string | number) => void; | |
| testIdPrefix: string; | |
| }>; | |
| showEventTypeFilter?: boolean; | |
| actions?: React.ReactNode; | |
| } | |
| /** | |
| * Props for the PageHeader component. | |
| * | |
| * Defines the configuration for a flexible page header with optional title, | |
| * search bar, sorting controls, event type filter, and action buttons. | |
| */ | |
| export interface InterfacePageHeaderProps { | |
| title?: string; | |
| search?: { | |
| placeholder: string; | |
| onSearch: (value: string) => void; | |
| inputTestId?: string; | |
| buttonTestId?: string; | |
| }; | |
| sorting?: Array<{ | |
| title: string; | |
| options: { label: string; value: string | number }[]; | |
| selected: string | number; | |
| onChange: (value: string | number) => void; | |
| testIdPrefix: string; | |
| }>; | |
| showEventTypeFilter?: boolean; | |
| actions?: React.ReactNode; | |
| } |
🤖 Prompt for AI Agents
In src/types/Navbar/interface.ts lines 1 to 18, the InterfacePageHeaderProps
interface lacks a TSDoc header; add a concise TSDoc comment above the interface
describing its purpose as the prop types for the PageHeader/Navbar component,
briefly documenting key properties (title, search, sorting, showEventTypeFilter,
actions) and any important behavior or expectations (optional vs required,
callback signatures), following project TSDoc style and formatting conventions
used elsewhere in src/types.
| testIdPrefix: string; | ||
| }>; | ||
| showEventTypeFilter?: boolean; | ||
| actions?: React.ReactNode; |
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.
Import ReactNode type from React.
Line 17 uses React.ReactNode but doesn't import the React types. Add an import statement to ensure type safety.
Apply this diff to add the import:
+import { ReactNode } from 'react';
+
export interface InterfacePageHeaderProps {
title?: string;
search?: {
placeholder: string;
onSearch: (value: string) => void;
inputTestId?: string;
buttonTestId?: string;
};
sorting?: Array<{
title: string;
options: { label: string; value: string | number }[];
selected: string | number;
onChange: (value: string | number) => void;
testIdPrefix: string;
}>;
showEventTypeFilter?: boolean;
- actions?: React.ReactNode;
+ actions?: ReactNode;
}📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| actions?: React.ReactNode; | |
| import { ReactNode } from 'react'; | |
| export interface InterfacePageHeaderProps { | |
| title?: string; | |
| search?: { | |
| placeholder: string; | |
| onSearch: (value: string) => void; | |
| inputTestId?: string; | |
| buttonTestId?: string; | |
| }; | |
| sorting?: Array<{ | |
| title: string; | |
| options: { label: string; value: string | number }[]; | |
| selected: string | number; | |
| onChange: (value: string | number) => void; | |
| testIdPrefix: string; | |
| }>; | |
| showEventTypeFilter?: boolean; | |
| actions?: ReactNode; | |
| } |
🤖 Prompt for AI Agents
In src/types/Navbar/interface.ts around line 17, the file uses the type
React.ReactNode for the actions prop but does not import React types; add an
import for React (or directly import ReactNode) at the top of the file (e.g.,
import React from 'react' or import { ReactNode } from 'react') and update the
type usage if you import ReactNode directly (actions?: ReactNode;) to ensure
type safety and eliminate the missing-import error.
What kind of change does this PR introduce?
refactoring Login and Registration Screens
Issue Number:
Fixes #4818
Snapshots/Videos:


If relevant, did you update the documentation?
No
Summary
Does this PR introduce a breaking change?
No
Checklist
CodeRabbit AI Review
Test Coverage
Other information
Have you read the contributing guide?
Yes
Summary by CodeRabbit
New Features
UI/UX Updates
Tests
✏️ Tip: You can customize this high-level summary in your review settings.