-
-
Notifications
You must be signed in to change notification settings - Fork 895
Event crud feature and Recurrence events removed #3981
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
Event crud feature and Recurrence events removed #3981
Conversation
Important Review skippedReview was skipped due to path filters ⛔ Files ignored due to path filters (300)
CodeRabbit blocks several paths by default. You can override this behavior by explicitly including those paths in the path filters. For example, including You can disable this status message by setting the """ WalkthroughThis change removes all support for recurring events and recurrence rules across the codebase, including schema, queries, mutations, types, utilities, and UI components. All event-related logic, data structures, and user interfaces are updated to align with a simplified, non-recurring event model, reflecting the requirements of the Postgres migration for the Events section. Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant UI
participant GraphQL API
User->>UI: Create/Update/Delete Event (no recurrence)
UI->>GraphQL API: send input object (MutationCreateEventInput/MutationUpdateEventInput)
GraphQL API-->>UI: Event object (no recurrence fields)
UI-->>User: Render event (single-instance only)
Assessment against linked issues
Assessment against linked issues: Out-of-scope changes
(No out-of-scope changes found.) Possibly related PRs
Suggested reviewers
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. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
Documentation and Community
|
Our Pull Request Approval ProcessThanks for contributing! Testing Your CodeRemember, your PRs won't be reviewed until these criteria are met:
Our policies make our code better. ReviewersDo not assign reviewers. Our Queue Monitors will review your PR and assign them.
Reviewing Your CodeYour reviewer(s) will have the following roles:
CONTRIBUTING.mdRead our CONTRIBUTING.md file. Most importantly:
Other
|
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: 24
🔭 Outside diff range comments (9)
src/components/OrganizationScreen/OrganizationScreen.spec.tsx (1)
37-57
:⚠️ Potential issueCritical mock data structure mismatch.
The mock request was updated to use
GET_ORGANIZATION_EVENTS_PG
, but the mock response data structure still uses the old format (eventsByOrganization
) instead of the new paginated structure expected by this query.Based on the new query structure in
src/GraphQl/Queries/Queries.ts
, update the mock data:result: { data: { - eventsByOrganization: [ - { - _id: 'event123', - title: 'Test Event Title', - description: 'Test Description', - startDate: '2024-01-01', - endDate: '2024-01-02', - location: 'Test Location', - startTime: '09:00', - endTime: '17:00', - allDay: false, - isPublic: true, - isRegisterable: true, - }, - ], + organization: { + events: { + edges: [ + { + node: { + id: 'event123', + name: 'Test Event Title', + description: 'Test Description', + startAt: '2024-01-01T09:00:00Z', + endAt: '2024-01-02T17:00:00Z', + location: 'Test Location', + allDay: false, + isPublic: true, + isRegisterable: true, + creator: { + id: 'creator123', + name: 'Test Creator' + } + }, + cursor: 'cursor123' + } + ], + pageInfo: { + hasNextPage: false, + endCursor: 'cursor123' + } + } + } }, },src/components/EventListCard/Modal/EventListCardModals.tsx (1)
99-139
: 🧹 Nitpick (assertive)Update event handler correctly uses new mutation structure.
The refactored
handleEventUpdate
properly implements:
- Nested
input
object structure- ISO datetime formatting with dayjs
- Proper handling of all-day vs specific time events
However, there's a code quality improvement needed.
Replace
parseInt
withNumber.parseInt
for ES2015+ consistency:- .hour(parseInt(formState.startTime.split(':')[0])) - .minute(parseInt(formState.startTime.split(':')[1])) - .second(parseInt(formState.startTime.split(':')[2])) + .hour(Number.parseInt(formState.startTime.split(':')[0])) + .minute(Number.parseInt(formState.startTime.split(':')[1])) + .second(Number.parseInt(formState.startTime.split(':')[2]))And similarly for the endTime parsing:
- .hour(parseInt(formState.endTime.split(':')[0])) - .minute(parseInt(formState.endTime.split(':')[1])) - .second(parseInt(formState.endTime.split(':')[2])) + .hour(Number.parseInt(formState.endTime.split(':')[0])) + .minute(Number.parseInt(formState.endTime.split(':')[1])) + .second(Number.parseInt(formState.endTime.split(':')[2]))🧰 Tools
🪛 Biome (1.9.4)
[error] 113-113: Use Number.parseInt instead of the equivalent global.
ES2015 moved some globals into the Number namespace for consistency.
Safe fix: Use Number.parseInt instead.(lint/style/useNumberNamespace)
[error] 114-114: Use Number.parseInt instead of the equivalent global.
ES2015 moved some globals into the Number namespace for consistency.
Safe fix: Use Number.parseInt instead.(lint/style/useNumberNamespace)
[error] 115-115: Use Number.parseInt instead of the equivalent global.
ES2015 moved some globals into the Number namespace for consistency.
Safe fix: Use Number.parseInt instead.(lint/style/useNumberNamespace)
[error] 120-120: Use Number.parseInt instead of the equivalent global.
ES2015 moved some globals into the Number namespace for consistency.
Safe fix: Use Number.parseInt instead.(lint/style/useNumberNamespace)
[error] 121-121: Use Number.parseInt instead of the equivalent global.
ES2015 moved some globals into the Number namespace for consistency.
Safe fix: Use Number.parseInt instead.(lint/style/useNumberNamespace)
[error] 122-122: Use Number.parseInt instead of the equivalent global.
ES2015 moved some globals into the Number namespace for consistency.
Safe fix: Use Number.parseInt instead.(lint/style/useNumberNamespace)
src/components/EventCalender/Yearly/YearlyEventCalender.tsx (1)
229-261
:⚠️ Potential issueAdd explicit type prop to button elements.
The button elements are missing the
type
prop, which defaults to "submit". This could cause unintended form submissions if the component is ever placed inside a form.Apply this diff to add the type prop:
{eventsForDate.length > 0 ? ( <button + type="button" className={styles.btn__more} onClick={() => toggleExpand(expandKey)} data-testid={`expand-btn-${expandKey}`} > {expandedY === expandKey ? ( <div className={styles.closebtnYearlyEventCalender}> <br /> <p>Close</p> </div> ) : ( <div className={styles.circularButton}></div> )} </button> ) : ( <button + type="button" className={styles.btn__more} onClick={() => toggleExpand(expandKey)} data-testid={`no-events-btn-${expandKey}`} >🧰 Tools
🪛 Biome (1.9.4)
[error] 240-240: JSX elements without children should be marked as self-closing. In JSX, it is valid for any element to be self-closing.
Unsafe fix: Use a SelfClosingElement instead
(lint/style/useSelfClosingElements)
[error] 258-258: JSX elements without children should be marked as self-closing. In JSX, it is valid for any element to be self-closing.
Unsafe fix: Use a SelfClosingElement instead
(lint/style/useSelfClosingElements)
[error] 229-233: Provide an explicit type prop for the button element.
The default type of a button is submit, which causes the submission of a form when placed inside a
form
element. This is likely not the behaviour that you want inside a React application.
Allowed button types are: submit, button or reset(lint/a11y/useButtonType)
[error] 244-248: Provide an explicit type prop for the button element.
The default type of a button is submit, which causes the submission of a form when placed inside a
form
element. This is likely not the behaviour that you want inside a React application.
Allowed button types are: submit, button or reset(lint/a11y/useButtonType)
src/components/EventManagement/Dashboard/EventDashboard.tsx (1)
138-168
: 🧹 Nitpick (assertive)Consider removing statistics sections for unavailable data.
The registrations count, attendees count, and feedback rating sections now always display "N/A" since this data is no longer provided by the updated GraphQL query. Consider removing these sections entirely rather than showing placeholder values.
Would you like me to help refactor the UI to remove these sections or implement an alternative solution to fetch this data if still needed?
src/components/EventCalender/Yearly/YearlyEventCalender.spec.tsx (2)
41-50
: 🧹 Nitpick (assertive)Remove unused
renderWithRouter
function.The
renderWithRouter
function is defined but never used in the test file. TherenderWithRouterAndPath
function is used instead.Remove the entire
renderWithRouter
function (lines 41-50) to keep the test file clean.🧰 Tools
🪛 ESLint
[error] 41-41: 'renderWithRouter' is assigned a value but never used.
(@typescript-eslint/no-unused-vars)
[error] 43-43: 'route' is assigned a value but never used.
(@typescript-eslint/no-unused-vars)
200-234
:⚠️ Potential issueFix duplicate test titles.
Both test cases have the same title "filters events correctly for ADMINISTRATOR role", which makes it difficult to identify failing tests.
The second test (lines 215-234) should have a different title. Consider renaming it to something like:
- it('filters events correctly for ADMINISTRATOR role', async () => { + it('displays events correctly for ADMINISTRATOR role with specific date', async () => {🧰 Tools
🪛 ESLint
[error] 215-234: Test is used multiple times in the same describe(suite) block
(vitest/no-identical-title)
src/components/EventCalender/Monthly/EventCalender.tsx (1)
453-461
:⚠️ Potential issueAdd type prop to the View all/less button.
Similar to the previous button, this one also needs an explicit type.
Apply this diff:
{shouldShowViewMore && ( <button className={styles.btn__more} data-testid="more" onClick={() => toggleExpand(index)} + type="button" > {expanded === index ? 'View less' : 'View all'} </button> )}
🧰 Tools
🪛 Biome (1.9.4)
[error] 454-458: Provide an explicit type prop for the button element.
The default type of a button is submit, which causes the submission of a form when placed inside a
form
element. This is likely not the behaviour that you want inside a React application.
Allowed button types are: submit, button or reset(lint/a11y/useButtonType)
schema.graphql (2)
2006-2021
:⚠️ Potential issueRemove recurrence fields from UpdateEventInput.
This input type still contains
recurrance
andrecurring
fields that should be removed as part of eliminating recurrence functionality.Apply this diff to remove the obsolete fields:
input UpdateEventInput { allDay: Boolean description: String endDate: Date endTime: Time isPublic: Boolean isRegisterable: Boolean latitude: Latitude location: String longitude: Longitude - recurrance: Recurrance - recurring: Boolean startDate: Date startTime: Time title: String }
296-312
: 💡 Verification agent🧩 Analysis chain
Remove obsolete EventInput type.
This input type still references the removed
Recurrance
enum andrecurring
field. Since mutations now useMutationCreateEventInput
andMutationUpdateEventInput
, this type appears to be obsolete.Should the
EventInput
type be removed entirely from the schema? Let me verify if it's still being used:
🏁 Script executed:
#!/bin/bash # Check if EventInput is still referenced anywhere in the schema or codebase echo "Checking for EventInput usage in schema..." rg -A 2 -B 2 "EventInput" echo -e "\nChecking for EventInput usage in GraphQL operations..." fd -e ts -e tsx | xargs rg "EventInput" || echo "No references found in TypeScript files"Length of output: 2908
Clean up obsolete
EventInput
schema and TypeScript typeThe
EventInput
input inschema.graphql
isn’t referenced by any queries or mutations (all mutations now useMutationCreateEventInput
/MutationUpdateEventInput
), and it still refers to the removedRecurrance
enum andrecurring
field. Likewise, theEventInput
TS type insrc/types/Event/type.ts
isn’t used anywhere.Please remove both definitions:
- schema.graphql: delete the
input EventInput { … }
block (lines 296–312).- src/types/Event/type.ts: remove the
export type EventInput = { … }
declaration.
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro
📒 Files selected for processing (37)
schema.graphql
(4 hunks)src/GraphQl/Mutations/mutations.ts
(2 hunks)src/GraphQl/Queries/Queries.ts
(3 hunks)src/components/EventCalender/EventCalenderMocks.ts
(0 hunks)src/components/EventCalender/Monthly/EventCalendar.spec.tsx
(0 hunks)src/components/EventCalender/Monthly/EventCalender.tsx
(16 hunks)src/components/EventCalender/Yearly/YearlyEventCalender.spec.tsx
(15 hunks)src/components/EventCalender/Yearly/YearlyEventCalender.tsx
(8 hunks)src/components/EventListCard/EventListCard.spec.tsx
(8 hunks)src/components/EventListCard/EventListCard.tsx
(1 hunks)src/components/EventListCard/EventListCardProps.ts
(6 hunks)src/components/EventListCard/Modal/Delete/EventListCardDeleteModal.tsx
(2 hunks)src/components/EventListCard/Modal/EventListCardMocks.ts
(3 hunks)src/components/EventListCard/Modal/EventListCardModals.tsx
(7 hunks)src/components/EventListCard/Modal/Preview/EventListCardPreviewModal.tsx
(15 hunks)src/components/EventListCard/Modal/Update/EventListCardUpdateModal.tsx
(0 hunks)src/components/EventManagement/Dashboard/EventDashboard.mocks.ts
(2 hunks)src/components/EventManagement/Dashboard/EventDashboard.spec.tsx
(1 hunks)src/components/EventManagement/Dashboard/EventDashboard.tsx
(6 hunks)src/components/EventManagement/EventAttendance/Statistics/EventStatistics.tsx
(0 hunks)src/components/LeftDrawerOrg/LeftDrawerOrg.tsx
(4 hunks)src/components/MemberActivity/Modal/CustomCell/customTableCell.tsx
(1 hunks)src/components/OrganizationScreen/OrganizationScreen.spec.tsx
(4 hunks)src/components/OrganizationScreen/OrganizationScreen.tsx
(3 hunks)src/components/RecurrenceOptions/Modal/CustomRecurrence.spec.tsx
(0 hunks)src/components/RecurrenceOptions/Modal/CustomRecurrenceModal.tsx
(0 hunks)src/components/RecurrenceOptions/RecurrenceOptions.spec.tsx
(0 hunks)src/components/RecurrenceOptions/RecurrenceOptions.tsx
(0 hunks)src/screens/OrganizationEvents/OrganizationEvents.spec.tsx
(4 hunks)src/screens/OrganizationEvents/OrganizationEvents.tsx
(14 hunks)src/screens/OrganizationEvents/OrganizationEventsMocks.ts
(2 hunks)src/types/Event/interface.ts
(3 hunks)src/utils/recurrenceUtils/index.ts
(0 hunks)src/utils/recurrenceUtils/recurrenceConstants.ts
(0 hunks)src/utils/recurrenceUtils/recurrenceTypes.ts
(0 hunks)src/utils/recurrenceUtils/recurrenceUtilityFunctions.ts
(0 hunks)src/utils/timezoneUtils/dateTimeConfig.ts
(1 hunks)
💤 Files with no reviewable changes (12)
- src/components/EventManagement/EventAttendance/Statistics/EventStatistics.tsx
- src/utils/recurrenceUtils/index.ts
- src/components/EventCalender/Monthly/EventCalendar.spec.tsx
- src/utils/recurrenceUtils/recurrenceTypes.ts
- src/components/EventListCard/Modal/Update/EventListCardUpdateModal.tsx
- src/utils/recurrenceUtils/recurrenceConstants.ts
- src/components/RecurrenceOptions/RecurrenceOptions.spec.tsx
- src/components/EventCalender/EventCalenderMocks.ts
- src/utils/recurrenceUtils/recurrenceUtilityFunctions.ts
- src/components/RecurrenceOptions/Modal/CustomRecurrenceModal.tsx
- src/components/RecurrenceOptions/Modal/CustomRecurrence.spec.tsx
- src/components/RecurrenceOptions/RecurrenceOptions.tsx
🧰 Additional context used
🧠 Learnings (3)
src/components/EventCalender/Yearly/YearlyEventCalender.tsx (1)
Learnt from: syedali237
PR: PalisadoesFoundation/talawa-admin#3712
File: src/components/EventCalender/Yearly/YearlyEventCalender.spec.tsx:156-238
Timestamp: 2025-02-24T14:08:23.162Z
Learning: In YearlyEventCalender component, event filtering based on user roles (SUPERADMIN, ADMIN, USER) is handled internally through the userRole prop, and separate test cases with role-specific data validate this filtering.
src/components/OrganizationScreen/OrganizationScreen.spec.tsx (3)
Learnt from: GlenDsza
PR: PalisadoesFoundation/talawa-admin#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.
Learnt from: PurnenduMIshra129th
PR: PalisadoesFoundation/talawa-admin#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.
Learnt from: syedali237
PR: PalisadoesFoundation/talawa-admin#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.
src/components/EventCalender/Yearly/YearlyEventCalender.spec.tsx (2)
Learnt from: PurnenduMIshra129th
PR: PalisadoesFoundation/talawa-admin#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.
Learnt from: syedali237
PR: PalisadoesFoundation/talawa-admin#3712
File: src/components/EventCalender/Yearly/YearlyEventCalender.spec.tsx:156-238
Timestamp: 2025-02-24T14:08:23.162Z
Learning: In YearlyEventCalender component, event filtering based on user roles (SUPERADMIN, ADMIN, USER) is handled internally through the userRole prop, and separate test cases with role-specific data validate this filtering.
🧬 Code Graph Analysis (5)
src/components/EventListCard/EventListCard.tsx (2)
src/types/Event/interface.ts (1)
InterfaceEvent
(44-63)src/components/EventListCard/EventListCardProps.ts (1)
props
(7-164)
src/components/OrganizationScreen/OrganizationScreen.tsx (1)
src/GraphQl/Queries/Queries.ts (1)
GET_ORGANIZATION_EVENTS_PG
(493-522)
src/components/EventListCard/Modal/EventListCardModals.tsx (1)
src/GraphQl/Mutations/mutations.ts (1)
REGISTER_EVENT
(514-520)
src/components/EventManagement/Dashboard/EventDashboard.tsx (4)
src/utils/useLocalstorage.ts (2)
useLocalStorage
(61-70)getItem
(29-33)src/GraphQl/Queries/Queries.ts (1)
EVENT_DETAILS
(284-314)src/types/Event/interface.ts (1)
InterfaceEvent
(44-63)src/utils/dateFormatter.ts (1)
formatDate
(1-33)
src/components/LeftDrawerOrg/LeftDrawerOrg.tsx (2)
src/utils/useLocalstorage.ts (1)
getItem
(29-33)src/GraphQl/Queries/Queries.ts (1)
GET_ORGANIZATION_DATA_PG
(545-587)
🪛 ESLint
src/components/EventListCard/EventListCard.tsx
[error] 46-46: 'JSX' is not defined.
(no-undef)
src/components/EventManagement/Dashboard/EventDashboard.tsx
[error] 49-49: 'JSX' is not defined.
(no-undef)
[error] 98-98: 'error' is defined but never used.
(@typescript-eslint/no-unused-vars)
src/components/EventCalender/Monthly/EventCalender.tsx
[error] 13-13: tsdoc-param-tag-with-invalid-name: The @param block should be followed by a valid parameter name: The identifier cannot non-word characters
(tsdoc/syntax)
[error] 13-13: tsdoc-param-tag-with-invalid-type: The @param block should not include a JSDoc-style '{type}'
(tsdoc/syntax)
[error] 13-13: tsdoc-malformed-inline-tag: Expecting a TSDoc tag starting with "{@"
(tsdoc/syntax)
[error] 13-13: tsdoc-escape-right-brace: The "}" character should be escaped using a backslash to avoid confusion with a TSDoc inline tag
(tsdoc/syntax)
src/components/EventCalender/Yearly/YearlyEventCalender.spec.tsx
[error] 19-19: 'to' is defined but never used.
(@typescript-eslint/no-unused-vars)
[error] 19-19: 'replace' is defined but never used.
(@typescript-eslint/no-unused-vars)
[error] 41-41: 'renderWithRouter' is assigned a value but never used.
(@typescript-eslint/no-unused-vars)
[error] 43-43: 'route' is assigned a value but never used.
(@typescript-eslint/no-unused-vars)
[error] 215-234: Test is used multiple times in the same describe(suite) block
(vitest/no-identical-title)
[error] 382-384: Declare only one React component per file
(react/no-multi-comp)
[error] 386-405: Declare only one React component per file
(react/no-multi-comp)
[error] 400-400: Must use destructuring state assignment
(react/destructuring-assignment)
[error] 400-400: Must use destructuring state assignment
(react/destructuring-assignment)
[error] 401-401: Must use destructuring state assignment
(react/destructuring-assignment)
[error] 403-403: Must use destructuring props assignment
(react/destructuring-assignment)
[error] 409-409: 'mockExpand' is assigned a value but never used.
(@typescript-eslint/no-unused-vars)
🪛 Biome (1.9.4)
src/components/EventCalender/Yearly/YearlyEventCalender.tsx
[error] 229-233: Provide an explicit type prop for the button element.
The default type of a button is submit, which causes the submission of a form when placed inside a form
element. This is likely not the behaviour that you want inside a React application.
Allowed button types are: submit, button or reset
(lint/a11y/useButtonType)
[error] 244-248: Provide an explicit type prop for the button element.
The default type of a button is submit, which causes the submission of a form when placed inside a form
element. This is likely not the behaviour that you want inside a React application.
Allowed button types are: submit, button or reset
(lint/a11y/useButtonType)
src/components/EventListCard/Modal/EventListCardModals.tsx
[error] 113-113: Use Number.parseInt instead of the equivalent global.
ES2015 moved some globals into the Number namespace for consistency.
Safe fix: Use Number.parseInt instead.
(lint/style/useNumberNamespace)
[error] 114-114: Use Number.parseInt instead of the equivalent global.
ES2015 moved some globals into the Number namespace for consistency.
Safe fix: Use Number.parseInt instead.
(lint/style/useNumberNamespace)
[error] 115-115: Use Number.parseInt instead of the equivalent global.
ES2015 moved some globals into the Number namespace for consistency.
Safe fix: Use Number.parseInt instead.
(lint/style/useNumberNamespace)
[error] 120-120: Use Number.parseInt instead of the equivalent global.
ES2015 moved some globals into the Number namespace for consistency.
Safe fix: Use Number.parseInt instead.
(lint/style/useNumberNamespace)
[error] 121-121: Use Number.parseInt instead of the equivalent global.
ES2015 moved some globals into the Number namespace for consistency.
Safe fix: Use Number.parseInt instead.
(lint/style/useNumberNamespace)
[error] 122-122: Use Number.parseInt instead of the equivalent global.
ES2015 moved some globals into the Number namespace for consistency.
Safe fix: Use Number.parseInt instead.
(lint/style/useNumberNamespace)
src/screens/OrganizationEvents/OrganizationEvents.tsx
[error] 217-217: Use Number.parseInt instead of the equivalent global.
ES2015 moved some globals into the Number namespace for consistency.
Safe fix: Use Number.parseInt instead.
(lint/style/useNumberNamespace)
[error] 218-218: Use Number.parseInt instead of the equivalent global.
ES2015 moved some globals into the Number namespace for consistency.
Safe fix: Use Number.parseInt instead.
(lint/style/useNumberNamespace)
[error] 219-219: Use Number.parseInt instead of the equivalent global.
ES2015 moved some globals into the Number namespace for consistency.
Safe fix: Use Number.parseInt instead.
(lint/style/useNumberNamespace)
[error] 224-224: Use Number.parseInt instead of the equivalent global.
ES2015 moved some globals into the Number namespace for consistency.
Safe fix: Use Number.parseInt instead.
(lint/style/useNumberNamespace)
[error] 225-225: Use Number.parseInt instead of the equivalent global.
ES2015 moved some globals into the Number namespace for consistency.
Safe fix: Use Number.parseInt instead.
(lint/style/useNumberNamespace)
[error] 226-226: Use Number.parseInt instead of the equivalent global.
ES2015 moved some globals into the Number namespace for consistency.
Safe fix: Use Number.parseInt instead.
(lint/style/useNumberNamespace)
src/components/LeftDrawerOrg/LeftDrawerOrg.tsx
[error] 190-190: Avoid the words "image", "picture", or "photo" in img element alt text.
Screen readers announce img elements as "images", so it is not necessary to redeclare this in alternative text.
(lint/a11y/noRedundantAlt)
[error] 168-171: Provide an explicit type prop for the button element.
The default type of a button is submit, which causes the submission of a form when placed inside a form
element. This is likely not the behaviour that you want inside a React application.
Allowed button types are: submit, button or reset
(lint/a11y/useButtonType)
[error] 174-177: Provide an explicit type prop for the button element.
The default type of a button is submit, which causes the submission of a form when placed inside a form
element. This is likely not the behaviour that you want inside a React application.
Allowed button types are: submit, button or reset
(lint/a11y/useButtonType)
[error] 185-185: Provide an explicit type prop for the button element.
The default type of a button is submit, which causes the submission of a form when placed inside a form
element. This is likely not the behaviour that you want inside a React application.
Allowed button types are: submit, button or reset
(lint/a11y/useButtonType)
[error] 226-232: Provide an explicit type prop for the button element.
The default type of a button is submit, which causes the submission of a form when placed inside a form
element. This is likely not the behaviour that you want inside a React application.
Allowed button types are: submit, button or reset
(lint/a11y/useButtonType)
src/components/EventCalender/Monthly/EventCalender.tsx
[error] 300-304: Provide an explicit type prop for the button element.
The default type of a button is submit, which causes the submission of a form when placed inside a form
element. This is likely not the behaviour that you want inside a React application.
Allowed button types are: submit, button or reset
(lint/a11y/useButtonType)
🪛 GitHub Actions: PR Workflow
schema.graphql
[error] 1-1: Parsing error: [graphql-eslint] Unknown type "EventAgendaFoldersConnection". Did you mean "EventAgendaFoldersConnectionPg", "EventAgendaFoldersConnectionEdgePg", "AgendaFolderItemsConnectionPg", or "EventVenuesConnectionPg"?
[error] 1-1: Parsing error: [graphql-eslint] Unknown type "EventAttachment". Did you mean "EventAttachmentPg", "VenueAttachmentPg", "PostAttachmentPg", or "EventAttendeeInput"?
[error] 1-1: Parsing error: [graphql-eslint] Unknown type "EventVenuesConnection". Did you mean "EventVenuesConnectionPg", "EventVenuesConnectionEdgePg", "UserTagsConnection", "VenueEventsConnectionPg", or "AdvertisementsConnection"?
[error] 1-1: Parsing error: [graphql-eslint] Unknown type "Recurrance".
[error] 1-1: Parsing error: [graphql-eslint] Unknown type "Recurrance".
🔇 Additional comments (57)
src/utils/timezoneUtils/dateTimeConfig.ts (1)
8-8
: LGTM! Recurrence fields properly removed.The removal of
recurrenceStartDate
andrecurrenceEndDate
from thedirectFields
array correctly aligns with the broader removal of recurrence functionality across the codebase.src/components/MemberActivity/Modal/CustomCell/customTableCell.tsx (1)
19-20
:⚠️ Potential issueInconsistency between documentation and implementation.
The documentation was updated to remove mention of rendering "recurrence status," but line 96 still renders
event.recurring ? 'Yes' : 'No'
. This creates an inconsistency.Either:
- Remove the recurrence rendering logic from line 96 to match the updated documentation, or
- Update the documentation to accurately reflect what the component still renders
- * - Renders event details including title, start date, + * - Renders event details including title, start date, recurrence status,If recurrence functionality is being completely removed, then line 96 should also be updated:
- <TableCell align="left">{event.recurring ? 'Yes' : 'No'}</TableCell> + <TableCell align="left">N/A</TableCell>Likely an incorrect or invalid review comment.
src/components/OrganizationScreen/OrganizationScreen.tsx (1)
54-54
: Good addition of JSX type import.Adding the JSX type import improves type safety for the component return type.
src/components/EventListCard/EventListCard.tsx (3)
39-41
: Good addition of JSDoc documentation.The JSDoc comment for the
InterfaceEventListCard
interface improves code clarity and maintainability.
47-49
: Improved code formatting.The reformatted
useTranslation
hook call with proper line breaks enhances readability.
46-46
:⚠️ Potential issueFix missing JSX type import.
The component function returns
JSX.Element
but JSX is not imported, causing the ESLint error.Add the JSX import at the top of the file:
-import React, { useState } from 'react'; +import React, { useState } from 'react'; +import type { JSX } from 'react';Or update the existing import:
-import React, { useState } from 'react'; +import React, { useState, type JSX } from 'react';Likely an incorrect or invalid review comment.
🧰 Tools
🪛 ESLint
[error] 46-46: 'JSX' is not defined.
(no-undef)
src/components/OrganizationScreen/OrganizationScreen.spec.tsx (3)
10-10
: Correct query import update.The import update to
GET_ORGANIZATION_EVENTS_PG
properly aligns with the component changes.
28-31
: Improved type safety for Navigate component mock.Using proper
NavigateProps
type instead ofany
enhances type safety in the test.
130-130
: Improved event creation in fireEvent call.Using
new window.Event('resize')
is more explicit and follows best practices for creating events in tests.src/components/EventManagement/Dashboard/EventDashboard.mocks.ts (5)
14-14
: LGTM: Field rename from title to name.The field rename from
title
toname
is consistent with the schema changes mentioned in the summary.Also applies to: 47-47
16-17
: LGTM: ISO datetime format adoption.The change from separate
startDate
/endDate
fields to unifiedstartAt
/endAt
ISO datetime strings is a good improvement for standardization.Also applies to: 49-50
22-23
: LGTM: Addition of new event flags.The addition of
isPublic
andisRegisterable
boolean flags aligns with the simplified event model replacing recurring event properties.Also applies to: 55-56
12-13
:❓ Verification inconclusive
Clarify the need for dual ID fields.
Both
_id
andid
fields are present in the mock data. This duplication might indicate a transition period or specific GraphQL requirements.Also applies to: 45-46
🏁 Script executed:
#!/bin/bash # Description: Check if the Event type requires both _id and id fields # Expected: Should clarify the schema requirements ast-grep --pattern $'type Event { $$$ _id: $_ $$$ id: $_ $$$ }'Length of output: 74
Clarify dual ID fields in mock data
The mock file
src/components/EventManagement/Dashboard/EventDashboard.mocks.ts
defines both_id
andid
for events:
- Lines 12–13
- Also on lines 45–46
Could you confirm whether your backend GraphQL schema actually exposes both fields, or if one is a client-side alias/derived field? Ensuring the mock matches the real API schema will prevent confusion down the line.
7-7
:❓ Verification inconclusive
Verify GraphQL query variable name change.
The query variable has been changed from
id
toeventId
. Ensure this matches the updatedEVENT_DETAILS
query signature in the GraphQL schema.Also applies to: 40-40
🏁 Script executed:
#!/bin/bash # Description: Verify the EVENT_DETAILS query uses eventId parameter # Expected: Query should use eventId as the variable name ast-grep --pattern $'query EVENT_DETAILS($eventId: $_) { $$$ }'Length of output: 66
To locate the
EVENT_DETAILS
operation and confirm its variable signature, let’s search the repo for its definition:
🏁 Script executed:
#!/bin/bash # 1) Find where EVENT_DETAILS is defined rg "query EVENT_DETAILS" -n . # 2) Show surrounding lines to inspect the parameter list rg -A3 "query EVENT_DETAILS" -n .Length of output: 67
Verify
EVENT_DETAILS
query variable matches mockI couldn’t locate the
EVENT_DETAILS
query definition in the codebase. Please manually confirm that the GraphQL operation signature uses($eventId: …)
(notid
) so the mock’svariables: { eventId: 'event123' }aligns with your schema.
src/components/EventListCard/EventListCardProps.ts (1)
112-113
: LGTM: Time format standardization.The change to full ISO time format (
09:00:00
) is consistent and improves standardization across the application.src/components/EventListCard/Modal/Delete/EventListCardDeleteModal.tsx (3)
34-34
: LGTM: Simplified imports.The removal of recurrence-related imports aligns with the simplified deletion functionality.
64-64
: LGTM: Simplified modal body.The change to a single static deletion confirmation message makes the component much cleaner and easier to understand.
38-45
:✅ Verification successful
Verify interface props are updated.
Ensure that the
InterfaceDeleteEventModalProps
interface has been updated to remove any recurring event deletion properties that are no longer used.
🏁 Script executed:
#!/bin/bash # Description: Check the DeleteEventModalProps interface definition # Expected: Should not contain recurrence-related properties ast-grep --pattern $'interface InterfaceDeleteEventModalProps { $$$ }'Length of output: 612
Resolved: Interface props are up to date
The
InterfaceDeleteEventModalProps
definition insrc/types/Event/interface.ts
contains only the six expected properties and no unused recurrence-related fields.src/components/EventManagement/Dashboard/EventDashboard.spec.tsx (4)
70-75
: LGTM: Enhanced test assertions.The addition of explicit text content verification for event details provides better test coverage and makes test failures more informative.
77-82
: LGTM: Comprehensive time and date verification.The detailed assertions for time and date elements ensure the component correctly displays both time-specific and all-day events.
83-87
: LGTM: Statistics card verification.Testing the presence of statistics cards ensures the dashboard displays all required components.
115-127
: LGTM: Improved loader state testing.The explicit verification of loader visibility and content rendering states before and after loading provides robust test coverage.
src/components/EventListCard/EventListCard.spec.tsx (3)
97-98
: LGTM! Time format standardization looks good.The update to use 24-hour time format ('09:00:00', '17:00:00') aligns with the ISO datetime standardization across the codebase.
292-292
: Good consolidation of test cases to use non-recurring event fixture.The consistent use of
props[4]
across all these test cases aligns with the removal of recurrence functionality, ensuring tests focus on non-recurring events.Also applies to: 327-327, 370-370, 424-424, 486-486
406-409
: Good addition of clarifying comment.The comment clearly explains the toggle behavior for
isPublic
andisRegisterable
, improving test maintainability.src/components/EventListCard/Modal/EventListCardMocks.ts (2)
6-6
: LGTM! Mock structure aligns with updated GraphQL schema.The changes correctly implement:
- Nested
input
object structure for mutations- Import of
dayjs
for datetime handling- Proper variable structure for the DELETE_EVENT_MUTATION
Also applies to: 12-16
26-182
: Excellent mock coverage for different update scenarios.The mocks comprehensively cover:
- All-day event updates with proper start/end of day calculations
- Non-all-day events with specific time handling
- Different combinations of
isPublic
andisRegisterable
states- Complete response data including creator, updater, and organization metadata
src/screens/OrganizationEvents/OrganizationEvents.spec.tsx (2)
56-56
: Significant increase in default wait time.The wait time increased from 100ms to 2000ms. While this ensures test stability, consider if this is masking performance issues or if the async operations genuinely need more time after the refactoring.
264-280
: Good defensive approach for modal handling in tests.The pattern of waiting, manually closing the modal if still present, and then verifying closure with extended timeout ensures test reliability. This is a practical solution for potential timing issues in the test environment.
Also applies to: 452-468
src/components/EventListCard/Modal/EventListCardModals.tsx (2)
147-150
: LGTM! Mutation variables properly updated.Both mutations correctly use the new variable structure:
DELETE_EVENT_MUTATION
: Uses nestedinput
objectREGISTER_EVENT
: Uses directeventId
parameter as defined in the GraphQL schemaAlso applies to: 180-182
32-32
:✅ Verification successful
Verify UserRole enum usage across the codebase.
The change from
Role.USER
toUserRole.REGULAR
appears correct, but let's ensure this enum change is consistent throughout the codebase.Also applies to: 199-200
🏁 Script executed:
#!/bin/bash # Description: Verify UserRole enum usage and check for any remaining Role.USER references # Search for UserRole enum definition and usage echo "=== UserRole enum definition and usage ===" ast-grep --pattern 'enum UserRole { $$$ }' # Search for any remaining Role.USER references echo -e "\n=== Checking for remaining Role.USER references ===" rg "Role\.USER" -A 2 -B 2 # Search for UserRole.REGULAR usage to confirm consistency echo -e "\n=== UserRole.REGULAR usage ===" rg "UserRole\.REGULAR" -A 2 -B 2Length of output: 3377
✅ UserRole enum fully applied, no Role.USER references remain
- No occurrences of
Role.USER
found.UserRole.REGULAR
usage confirmed in:
- src/screens/OrganizationEvents/OrganizationEvents.tsx
- src/components/EventListCard/Modal/EventListCardModals.tsx
- src/components/EventListCard/Modal/Preview/EventListCardPreviewModal.tsx
- src/components/EventManagement/Dashboard/EventDashboard.tsx
- src/components/EventCalender/Yearly/YearlyEventCalender.spec.tsx
- Enum definitions located in:
- src/types/Event/interface.ts (ADMINISTRATOR, REGULAR)
- src/utils/interfaces.ts (Administrator, Regular)
All references are consistent—no further changes needed.
src/components/EventCalender/Yearly/YearlyEventCalender.tsx (2)
55-59
: LGTM! Good state management improvements.The state initialization is clean and follows React best practices. The separation of concerns with dedicated state variables for year navigation, filtered events, and expansion state improves component maintainability.
132-137
: LGTM! Proper use of functional setState.Using functional updates for
setCurrentYear
ensures the state updates are based on the most recent value, preventing potential race conditions.src/components/EventListCard/Modal/Preview/EventListCardPreviewModal.tsx (1)
75-79
: LGTM! Clean permission logic implementation.The consolidated
canEditEvent
check elegantly handles both creator and administrator permissions. This approach improves code maintainability and ensures consistent permission enforcement across all form fields.src/components/LeftDrawerOrg/LeftDrawerOrg.tsx (9)
59-85
: Well-structured interface definition!The new
InterfaceOrganizationData
interface provides excellent type safety for the GraphQL query response, with proper handling of optional fields and nested objects.
48-48
: LGTM: CSS import path updated correctly.The relative import path change from
./../../style/app-fixed.module.css
aligns with proper module organization.
59-85
: Well-structured TypeScript interface for organization data.The
InterfaceOrganizationData
interface provides strong typing for the GraphQL query response, which improves type safety and developer experience. The interface structure matches the expected GraphQL schema fields.
106-106
: Good explicit typing for localStorage value.Explicitly typing
userId
asstring | null
provides better type safety when handling localStorage values, which can be null.
117-121
: Function refactored but logic preserved.The
getIdFromPath
function has been moved and reformatted but maintains the same logic for extracting IDs from URL paths.
132-132
: Improved useEffect dependency array.Adding
hideDrawer
andsetHideDrawer
to the dependency array follows React best practices for exhaustive dependencies.
138-138
: More precise useEffect dependencies.Changing from
location
topathId
as a dependency is more precise and efficient, as it only re-runs when the relevant path segment changes.
147-255
: Well-structured JSX with improved organization.The JSX has been well-refactored with:
- Proper conditional rendering for loading and error states
- Clear separation of branding, organization, and options sections
- Consistent styling and data attributes for testing
- Fallback handling for missing organization city data
The overall structure is clean and maintainable.
🧰 Tools
🪛 Biome (1.9.4)
[error] 190-190: Avoid the words "image", "picture", or "photo" in img element alt text.
Screen readers announce img elements as "images", so it is not necessary to redeclare this in alternative text.
(lint/a11y/noRedundantAlt)
[error] 168-171: Provide an explicit type prop for the button element.
The default type of a button is submit, which causes the submission of a form when placed inside a
form
element. This is likely not the behaviour that you want inside a React application.
Allowed button types are: submit, button or reset(lint/a11y/useButtonType)
[error] 174-177: Provide an explicit type prop for the button element.
The default type of a button is submit, which causes the submission of a form when placed inside a
form
element. This is likely not the behaviour that you want inside a React application.
Allowed button types are: submit, button or reset(lint/a11y/useButtonType)
[error] 185-185: Provide an explicit type prop for the button element.
The default type of a button is submit, which causes the submission of a form when placed inside a
form
element. This is likely not the behaviour that you want inside a React application.
Allowed button types are: submit, button or reset(lint/a11y/useButtonType)
[error] 226-232: Provide an explicit type prop for the button element.
The default type of a button is submit, which causes the submission of a form when placed inside a
form
element. This is likely not the behaviour that you want inside a React application.
Allowed button types are: submit, button or reset(lint/a11y/useButtonType)
111-115
:❓ Verification inconclusive
Verify pagination defaults align with backend capabilities.
The GraphQL query is properly typed with the new interface and includes pagination variables. However, ensure the hardcoded defaults (
first: 10, after: null
) align with your backend's pagination capabilities and requirements.
🏁 Script executed:
#!/bin/bash # Description: Verify the pagination implementation in the GraphQL schema # Expected: Find pagination field definitions and limits rg -A 10 -B 5 "first.*Int.*after.*String" --type tsLength of output: 4337
Verify pagination defaults align with backend capabilities
The GraphQL query is properly typed with the new interface and includes pagination variables, but there are a couple of things to double-check:
- In
src/components/LeftDrawerOrg/LeftDrawerOrg.tsx
(lines 111–115), you’re passingtovariables: { id: orgId, first: 10, after: null }GET_ORGANIZATION_DATA_PG
.- In
src/GraphQl/Queries/Queries.ts
,GET_ORGANIZATION_DATA_PG
declaresbut the query currently returns only top-level organization fields (no paginated connections).query getOrganizationData($id: String!, $first: Int, $after: String) { … }Please confirm with your backend or schema docs whether:
- This query should be fetching a paginated connection (e.g., members, events) using these variables.
- The default
first: 10
does not exceed any server-side max page size.- If pagination isn’t needed here, remove the unused variables to avoid confusion.
src/screens/OrganizationEvents/OrganizationEvents.tsx (1)
195-195
: Consider removing or properly implementing the attendees field.The
attendees
field is hardcoded as an empty array with a comment suggesting it's not in the schema. This could be misleading if theInterfaceEvent
type expects actual attendee data.Is the
attendees
field still required in theInterfaceEvent
interface? If not, consider removing it to avoid confusion.src/GraphQl/Mutations/mutations.ts (1)
326-345
: Well-structured mutation updates!The event mutations have been properly updated to:
- Use single input objects following GraphQL best practices
- Return comprehensive response data including nested relationships
- Align with the simplified event model without recurrence
This improves API consistency and reduces the chance of missing required fields.
Also applies to: 351-355, 469-495
src/components/EventManagement/Dashboard/EventDashboard.tsx (4)
37-37
: LGTM!The style import path correction looks good.
56-63
: User role handling implementation looks good.The logic correctly determines the user role based on localStorage values, consistent with the OrganizationEvents component pattern.
67-69
: Query variable update is correct.The change from
{ id: eventId }
to{ eventId }
aligns with the updated GraphQL query signature.
103-125
: Event data mapping correctly updated for new schema.The props mapping properly uses the new field names (
id
,name
,startAt
,endAt
) and handles time extraction appropriately for both all-day and timed events.src/components/EventCalender/Yearly/YearlyEventCalender.spec.tsx (1)
109-142
: Mock organization data correctly updated for pagination.The mock data structure properly reflects the new paginated member structure with edges, nodes, and pageInfo.
src/types/Event/interface.ts (2)
44-63
: InterfaceEvent updates look good.The interface correctly removes all recurrence-related properties and adds the optional
userId
field for user-specific features.
65-82
: Pagination structure correctly implemented.The
InterfaceIOrgList
interface properly implements the GraphQL pagination pattern with edges, nodes, and pageInfo, matching the updated GraphQL schema.src/components/EventCalender/Monthly/EventCalender.tsx (2)
86-111
: Simplified filtering logic looks good!The new event filtering logic is cleaner and more maintainable. It correctly handles:
- Public events for unauthenticated users
- All events for administrators
- Public events plus member-only events for regular users
182-182
: Good fix for month indexing!Correctly using 1-based month for Date constructor since JavaScript months are 0-indexed.
src/GraphQl/Queries/Queries.ts (2)
284-314
: Query updates correctly align with new schema.The EVENT_DETAILS query has been properly updated to:
- Use the new query name
GetEvent
- Accept input as an object with
id
field- Return the updated Event fields matching the new schema
544-587
: Great addition of pagination support!The enhanced GET_ORGANIZATION_DATA_PG query now properly supports:
- Paginated member retrieval with cursor-based pagination
- Additional organization fields for comprehensive data fetching
- Proper nested creator/updater information
schema.graphql (1)
2080-2091
: New event input types properly structured.The new
MutationCreateEventInput
andMutationUpdateEventInput
types correctly:
- Use ISO DateTime format for temporal fields
- Support file attachments via Upload scalar
- Include all necessary event fields without recurrence
- Follow consistent naming patterns
fe0d577
to
b21becf
Compare
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: 9
🔭 Outside diff range comments (6)
src/components/OrganizationScreen/OrganizationScreen.spec.tsx (1)
37-57
:⚠️ Potential issueFix mock data structure to match GraphQL query.
The mock request uses
GET_ORGANIZATION_EVENTS_PG
but the mock result still uses the old data structure (eventsByOrganization
). It should match the actual query structure.Update the mock data structure to match the GraphQL query:
result: { data: { - eventsByOrganization: [ - { - _id: 'event123', - title: 'Test Event Title', + organization: { + events: { + edges: [ + { + node: { + id: 'event123', + name: 'Test Event Title', description: 'Test Description', - startDate: '2024-01-01', - endDate: '2024-01-02', + startAt: '2024-01-01T09:00:00Z', + endAt: '2024-01-02T17:00:00Z', location: 'Test Location', - startTime: '09:00', - endTime: '17:00', allDay: false, isPublic: true, isRegisterable: true, - }, - ], + }, + cursor: 'cursor1' + } + ], + pageInfo: { + hasNextPage: false, + endCursor: 'cursor1' + } + } + } }, },src/components/EventListCard/Modal/EventListCardMocks.ts (2)
19-25
:⚠️ Potential issueFix field name inconsistency in DELETE_EVENT_MUTATION result.
The result uses
_id
while the schema and other mutations useid
. This inconsistency could cause issues.Apply this diff to fix the inconsistency:
result: { data: { removeEvent: { - _id: '1', + id: '1', }, }, },
188-197
:⚠️ Potential issueFix field name inconsistency in REGISTER_EVENT result.
The result uses
_id
while the schema has moved toid
.Apply this diff to fix the inconsistency:
result: { data: { registerForEvent: [ { - _id: '123', + id: '123', }, ], }, },src/components/EventCalender/Yearly/YearlyEventCalender.tsx (1)
1-8
:⚠️ Potential issueRemove or configure the undefined TSDoc tag.
The
@component
TSDoc tag on line 8 is not defined in your TSDoc configuration, causing a pipeline failure.Either remove the tag or configure it in your TSDoc configuration:
/** * Yearly Event Calendar Component * * This component renders a yearly calendar view with events displayed * for each day. It allows navigation between years and provides * functionality to expand and view events for specific days. * - * @component * @param {InterfaceCalendarProps} props - The props for the calendar component.
🧰 Tools
🪛 GitHub Check: Performs linting, formatting, type-checking, checking for different source and target branch
[failure] 8-8:
tsdoc-undefined-tag: The TSDoc tag "@component" is not defined in this configuration🪛 ESLint
[error] 8-8: tsdoc-undefined-tag: The TSDoc tag "@component" is not defined in this configuration
(tsdoc/syntax)
🪛 GitHub Actions: PR Workflow
[error] 8-8: tsdoc-undefined-tag: The TSDoc tag "@component" is not defined in this configuration (tsdoc/syntax)
src/components/EventManagement/Dashboard/EventDashboard.tsx (1)
130-160
: 🧹 Nitpick (assertive)Consider removing or updating the statistics section.
All statistics (registrations, attendees, feedback) are now showing "N/A". If these features are permanently removed, consider removing these sections entirely to avoid confusion. If they're planned for future implementation, add a TODO comment.
Would you like me to help refactor this section to either remove it completely or add appropriate TODO comments for future implementation?
schema.graphql (1)
296-312
: 💡 Verification agent🧩 Analysis chain
Remove references to undefined Recurrance enum.
The
EventInput
andUpdateEventInput
types still reference the removedRecurrance
enum, which will cause schema validation errors.Remove the
recurrance
andrecurring
fields from both input types to complete the recurrence removal.Also applies to: 2006-2021
🏁 Script executed:
#!/bin/bash # Check for any remaining references to Recurrance or recurrence-related types rg "Recurrance|RecurrenceRule|recurrence|recurring" schema.graphqlLength of output: 161
Remove undefined Recurrance references from schema.graphql
The schema still contains two pairs of fields that reference the non-existent
Recurrance
enum. Please remove bothrecurrance
and their accompanyingrecurring
fields:• In
EventInput
(around line 307):- recurrance: Recurrance - recurring: Boolean!• In
UpdateEventInput
(around line 2016):- recurrance: Recurrance - recurring: Boolean
♻️ Duplicate comments (15)
src/components/OrganizationScreen/OrganizationScreen.tsx (2)
77-79
: Query usage updated but data access logic needs fixing.The
useQuery
hook correctly uses the newGET_ORGANIZATION_EVENTS_PG
query, but the data access logic in the useEffect (lines 82-93) still uses the old data structure.This is the same issue identified in the past review comment regarding the data structure mismatch with the new GraphQL query.
82-93
:⚠️ Potential issueCritical data structure mismatch with new GraphQL query.
The data access logic still uses the old structure (
eventsData.eventsByOrganization
,event._id
,event.title
) but the new queryGET_ORGANIZATION_EVENTS_PG
returns data in the formatorganization.events.edges[].node
withid
instead of_id
andname
instead oftitle
.Update the data access logic as indicated in the previous review comment:
- if (isEventPath?.params.eventId && eventsData?.eventsByOrganization) { + if (isEventPath?.params.eventId && eventsData?.organization?.events?.edges) { const eventId = isEventPath.params.eventId; - const event = eventsData.eventsByOrganization.find( - (e: InterfaceEvent) => e._id === eventId, + const event = eventsData.organization.events.edges.find( + (edge: any) => edge.node.id === eventId, ); - if (!event) { + if (!event?.node) { console.warn(`Event with id ${eventId} not found`); setEventName(null); return; } - setEventName(event.title); + setEventName(event.node.name);src/components/EventManagement/Dashboard/EventDashboard.spec.tsx (1)
93-110
: Consider adding the error handling test case suggested in the previous review.The negative test case for error handling when event data is unavailable or malformed would improve test coverage and ensure graceful error handling.
src/components/EventCalender/Yearly/YearlyEventCalender.tsx (2)
104-119
: Add null check for orgData before accessing members.The filtering logic for REGULAR users accesses
orgData?.members?.edges
but the function could be called withundefined
orgData. Consider adding an explicit check to prevent potential issues.
39-39
: Standardize CSS module imports using baseUrlYour tsconfig.json defines
baseUrl: "src"
, so you can import global style files with an absolute path (e.g.style/app-fixed.module.css
) instead of deep relative paths. Many components already follow this convention.src/components/EventListCard/Modal/Preview/EventListCardPreviewModal.tsx (1)
282-282
: Use translation for button text.The button text "Show Event Dashboard" is hardcoded. For consistency with the rest of the application and to support internationalization, this should use the translation function.
src/screens/OrganizationEvents/OrganizationEvents.tsx (3)
142-149
: Incomplete pagination implementation for events query.The query is hardcoded to fetch only the first 10 events without implementing
fetchMore
functionality or UI controls to load additional pages. Organizations with more than 10 events will have an incomplete list.
215-226
: 🧹 Nitpick (assertive)Use Number.parseInt for ES2015 consistency.
Replace
parseInt
withNumber.parseInt
to follow ES2015 best practices.- .hour(parseInt(startTimeParts[0])) - .minute(parseInt(startTimeParts[1])) - .second(parseInt(startTimeParts[2])) + .hour(Number.parseInt(startTimeParts[0])) + .minute(Number.parseInt(startTimeParts[1])) + .second(Number.parseInt(startTimeParts[2]))Apply the same change to lines 222-224.
🧰 Tools
🪛 Biome (1.9.4)
[error] 215-215: Use Number.parseInt instead of the equivalent global.
ES2015 moved some globals into the Number namespace for consistency.
Safe fix: Use Number.parseInt instead.(lint/style/useNumberNamespace)
[error] 216-216: Use Number.parseInt instead of the equivalent global.
ES2015 moved some globals into the Number namespace for consistency.
Safe fix: Use Number.parseInt instead.(lint/style/useNumberNamespace)
[error] 217-217: Use Number.parseInt instead of the equivalent global.
ES2015 moved some globals into the Number namespace for consistency.
Safe fix: Use Number.parseInt instead.(lint/style/useNumberNamespace)
[error] 222-222: Use Number.parseInt instead of the equivalent global.
ES2015 moved some globals into the Number namespace for consistency.
Safe fix: Use Number.parseInt instead.(lint/style/useNumberNamespace)
[error] 223-223: Use Number.parseInt instead of the equivalent global.
ES2015 moved some globals into the Number namespace for consistency.
Safe fix: Use Number.parseInt instead.(lint/style/useNumberNamespace)
[error] 224-224: Use Number.parseInt instead of the equivalent global.
ES2015 moved some globals into the Number namespace for consistency.
Safe fix: Use Number.parseInt instead.(lint/style/useNumberNamespace)
261-267
: 🛠️ Refactor suggestionUse translations for validation messages.
The validation messages are hardcoded in English. For consistency with the application's internationalization, use the translation system.
- if (formState.title.trim().length === 0) - toast.warning('Title can not be blank!'); - if (formState.eventdescrip.trim().length === 0) - toast.warning('Description can not be blank!'); - if (formState.location.trim().length === 0) - toast.warning('Location can not be blank!'); + if (formState.title.trim().length === 0) + toast.warning(t('titleRequired')); + if (formState.eventdescrip.trim().length === 0) + toast.warning(t('descriptionRequired')); + if (formState.location.trim().length === 0) + toast.warning(t('locationRequired'));Remember to add the corresponding translation keys to your translation files.
src/screens/OrganizationEvents/OrganizationEventsMocks.ts (1)
8-18
:⚠️ Potential issueFix undefined organizationId in mock inputs.
The
organizationId
field is set toundefined
in both mock requests, which would likely cause the mutation to fail. Events must be associated with an organization.Apply this diff to provide a valid organization ID:
input: { name: 'Dummy Org', location: 'New Delhi', description: 'This is a dummy organization', isPublic: false, isRegisterable: true, - organizationId: undefined, + organizationId: '1', startAt: '2022-03-27T18:30:00.000Z', endAt: '2022-03-30T18:29:59.999Z', allDay: true, },And similarly for the second mock:
input: { name: 'Dummy Org', location: 'New Delhi', description: 'This is a dummy organization', isPublic: true, isRegisterable: false, - organizationId: undefined, + organizationId: '1', startAt: '2022-03-28T03:30:00.540Z', endAt: '2022-03-30T11:30:00.540Z', allDay: false, },Also applies to: 48-58
src/components/LeftDrawerOrg/LeftDrawerOrg.tsx (3)
107-108
: Pagination logic needs to be fully implemented.The query includes pagination variables (
first: 10, after: null
) but there's no mechanism to load additional members beyond the first 10. Organizations with more than 10 members will only display the first page.#!/bin/bash # Description: Check if any organization in the test data has more than 10 members # Search for mock organization data in test files rg -A 20 "members.*edges" src/components/LeftDrawerOrg/__tests__/
161-164
:⚠️ Potential issueAdd explicit type="button" to all button elements.
Multiple button elements are missing the
type
attribute, which defaults to "submit" and can cause unintended form submissions.Apply this diff to fix the accessibility issues:
<button + type="button" className={`${styles.profileContainer} shimmer`} data-testid="orgBtn" />
<button + type="button" className={`${styles.profileContainer} ${styles.bgDanger} text-start text-white`} disabled >
- <button className={styles.profileContainer} data-testid="OrgBtn"> + <button type="button" className={styles.profileContainer} data-testid="OrgBtn"><button + type="button" className={ isActive ? styles.leftDrawerActiveButton : styles.leftDrawerInactiveButton } >
Also applies to: 167-175, 178-207, 219-236
🧰 Tools
🪛 Biome (1.9.4)
[error] 161-164: Provide an explicit type prop for the button element.
The default type of a button is submit, which causes the submission of a form when placed inside a
form
element. This is likely not the behaviour that you want inside a React application.
Allowed button types are: submit, button or reset(lint/a11y/useButtonType)
183-183
: 🧹 Nitpick (assertive)Remove redundant "picture" from alt text.
Screen readers already announce images, so including "picture" in the alt text is redundant.
- alt={`${data.organization.name} profile picture`} + alt={`${data.organization.name} profile`}🧰 Tools
🪛 Biome (1.9.4)
[error] 183-183: Avoid the words "image", "picture", or "photo" in img element alt text.
Screen readers announce img elements as "images", so it is not necessary to redeclare this in alternative text.
(lint/a11y/noRedundantAlt)
src/types/Event/interface.ts (1)
6-10
:⚠️ Potential issueRemove the unused Role constant to avoid confusion.
The old
Role
constant is not used anywhere in the codebase and should be removed to prevent confusion with the newUserRole
enum.-export const Role = { - USER: 'USER', - SUPERADMIN: 'SUPERADMIN', - ADMIN: 'ADMIN', -}; -schema.graphql (1)
261-289
:⚠️ Potential issueFix incorrect type references in Event type.
The Event type references non-existent types causing GraphQL validation errors. All referenced types should use the "Pg" suffix to match existing definitions.
Apply this diff to fix the type references:
type Event { agendaFolders( after: String before: String first: Int last: Int - ): EventAgendaFoldersConnection + ): EventAgendaFoldersConnectionPg allDay: Boolean - attachments: [EventAttachment!] + attachments: [EventAttachmentPg!] createdAt: DateTime - creator: User + creator: UserPg description: String endAt: DateTime id: ID! isPublic: Boolean! isRegisterable: Boolean! location: String name: String - organization: Organization + organization: OrganizationPg startAt: DateTime updatedAt: DateTime - updater: User + updater: UserPg venues( after: String before: String first: Int last: Int - ): EventVenuesConnection + ): EventVenuesConnectionPg }
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro
📒 Files selected for processing (38)
schema.graphql
(4 hunks)src/GraphQl/Mutations/mutations.ts
(2 hunks)src/GraphQl/Queries/Queries.ts
(3 hunks)src/components/EventCalender/EventCalenderMocks.ts
(0 hunks)src/components/EventCalender/Monthly/EventCalendar.spec.tsx
(13 hunks)src/components/EventCalender/Monthly/EventCalender.tsx
(17 hunks)src/components/EventCalender/Yearly/YearlyEventCalender.spec.tsx
(13 hunks)src/components/EventCalender/Yearly/YearlyEventCalender.tsx
(8 hunks)src/components/EventListCard/EventListCard.spec.tsx
(8 hunks)src/components/EventListCard/EventListCard.tsx
(1 hunks)src/components/EventListCard/EventListCardProps.ts
(6 hunks)src/components/EventListCard/Modal/Delete/EventListCardDeleteModal.tsx
(3 hunks)src/components/EventListCard/Modal/EventListCardMocks.ts
(3 hunks)src/components/EventListCard/Modal/EventListCardModals.tsx
(8 hunks)src/components/EventListCard/Modal/Preview/EventListCardPreviewModal.tsx
(15 hunks)src/components/EventListCard/Modal/Update/EventListCardUpdateModal.tsx
(0 hunks)src/components/EventManagement/Dashboard/EventDashboard.mocks.ts
(2 hunks)src/components/EventManagement/Dashboard/EventDashboard.spec.tsx
(2 hunks)src/components/EventManagement/Dashboard/EventDashboard.tsx
(7 hunks)src/components/EventManagement/EventAttendance/Statistics/EventStatistics.tsx
(2 hunks)src/components/LeftDrawerOrg/LeftDrawerOrg.spec.tsx
(4 hunks)src/components/LeftDrawerOrg/LeftDrawerOrg.tsx
(3 hunks)src/components/MemberActivity/Modal/CustomCell/customTableCell.tsx
(1 hunks)src/components/OrganizationScreen/OrganizationScreen.spec.tsx
(4 hunks)src/components/OrganizationScreen/OrganizationScreen.tsx
(3 hunks)src/components/RecurrenceOptions/Modal/CustomRecurrence.spec.tsx
(0 hunks)src/components/RecurrenceOptions/Modal/CustomRecurrenceModal.tsx
(0 hunks)src/components/RecurrenceOptions/RecurrenceOptions.spec.tsx
(0 hunks)src/components/RecurrenceOptions/RecurrenceOptions.tsx
(0 hunks)src/screens/OrganizationEvents/OrganizationEvents.spec.tsx
(7 hunks)src/screens/OrganizationEvents/OrganizationEvents.tsx
(12 hunks)src/screens/OrganizationEvents/OrganizationEventsMocks.ts
(2 hunks)src/types/Event/interface.ts
(6 hunks)src/utils/recurrenceUtils/index.ts
(0 hunks)src/utils/recurrenceUtils/recurrenceConstants.ts
(0 hunks)src/utils/recurrenceUtils/recurrenceTypes.ts
(0 hunks)src/utils/recurrenceUtils/recurrenceUtilityFunctions.ts
(0 hunks)src/utils/timezoneUtils/dateTimeConfig.ts
(1 hunks)
💤 Files with no reviewable changes (10)
- src/components/EventCalender/EventCalenderMocks.ts
- src/utils/recurrenceUtils/index.ts
- src/components/RecurrenceOptions/RecurrenceOptions.spec.tsx
- src/utils/recurrenceUtils/recurrenceTypes.ts
- src/components/RecurrenceOptions/Modal/CustomRecurrence.spec.tsx
- src/components/EventListCard/Modal/Update/EventListCardUpdateModal.tsx
- src/utils/recurrenceUtils/recurrenceConstants.ts
- src/components/RecurrenceOptions/RecurrenceOptions.tsx
- src/utils/recurrenceUtils/recurrenceUtilityFunctions.ts
- src/components/RecurrenceOptions/Modal/CustomRecurrenceModal.tsx
🧰 Additional context used
🧠 Learnings (7)
src/components/EventCalender/Monthly/EventCalendar.spec.tsx (1)
Learnt from: syedali237
PR: PalisadoesFoundation/talawa-admin#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.
src/components/OrganizationScreen/OrganizationScreen.spec.tsx (3)
Learnt from: GlenDsza
PR: PalisadoesFoundation/talawa-admin#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.
Learnt from: PurnenduMIshra129th
PR: PalisadoesFoundation/talawa-admin#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.
Learnt from: syedali237
PR: PalisadoesFoundation/talawa-admin#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.
src/components/EventCalender/Yearly/YearlyEventCalender.tsx (1)
Learnt from: syedali237
PR: PalisadoesFoundation/talawa-admin#3712
File: src/components/EventCalender/Yearly/YearlyEventCalender.spec.tsx:156-238
Timestamp: 2025-02-24T14:08:23.162Z
Learning: In YearlyEventCalender component, event filtering based on user roles (SUPERADMIN, ADMIN, USER) is handled internally through the userRole prop, and separate test cases with role-specific data validate this filtering.
src/screens/OrganizationEvents/OrganizationEventsMocks.ts (1)
Learnt from: GlenDsza
PR: PalisadoesFoundation/talawa-admin#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.
src/components/EventCalender/Yearly/YearlyEventCalender.spec.tsx (2)
Learnt from: PurnenduMIshra129th
PR: PalisadoesFoundation/talawa-admin#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.
Learnt from: syedali237
PR: PalisadoesFoundation/talawa-admin#3712
File: src/components/EventCalender/Yearly/YearlyEventCalender.spec.tsx:156-238
Timestamp: 2025-02-24T14:08:23.162Z
Learning: In YearlyEventCalender component, event filtering based on user roles (SUPERADMIN, ADMIN, USER) is handled internally through the userRole prop, and separate test cases with role-specific data validate this filtering.
src/components/EventCalender/Monthly/EventCalender.tsx (1)
Learnt from: syedali237
PR: PalisadoesFoundation/talawa-admin#3712
File: src/components/EventCalender/Yearly/YearlyEventCalender.spec.tsx:156-238
Timestamp: 2025-02-24T14:08:23.162Z
Learning: In YearlyEventCalender component, event filtering based on user roles (SUPERADMIN, ADMIN, USER) is handled internally through the userRole prop, and separate test cases with role-specific data validate this filtering.
src/types/Event/interface.ts (1)
Learnt from: JaiPannu-IITI
PR: PalisadoesFoundation/talawa-admin#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.
🧬 Code Graph Analysis (8)
src/components/EventListCard/EventListCard.tsx (2)
src/types/Event/interface.ts (1)
InterfaceEvent
(191-191)src/components/EventListCard/EventListCardProps.ts (1)
props
(7-162)
src/components/OrganizationScreen/OrganizationScreen.tsx (1)
src/GraphQl/Queries/Queries.ts (1)
GET_ORGANIZATION_EVENTS_PG
(493-522)
src/components/LeftDrawerOrg/LeftDrawerOrg.spec.tsx (1)
src/components/LeftDrawerOrg/LeftDrawerOrg.tsx (1)
ILeftDrawerProps
(45-50)
src/components/OrganizationScreen/OrganizationScreen.spec.tsx (2)
src/components/EventListCard/EventListCardProps.ts (1)
props
(7-162)src/GraphQl/Queries/Queries.ts (1)
GET_ORGANIZATION_EVENTS_PG
(493-522)
src/components/EventListCard/EventListCard.spec.tsx (1)
src/components/EventListCard/EventListCardProps.ts (1)
props
(7-162)
src/components/EventListCard/Modal/EventListCardMocks.ts (1)
src/GraphQl/Mutations/mutations.ts (2)
DELETE_EVENT_MUTATION
(350-356)UPDATE_EVENT_MUTATION
(468-496)
src/components/EventListCard/Modal/EventListCardModals.tsx (2)
src/types/Event/interface.ts (1)
InterfaceEvent
(191-191)src/GraphQl/Mutations/mutations.ts (1)
REGISTER_EVENT
(514-520)
src/components/EventListCard/EventListCardProps.ts (1)
src/types/Event/interface.ts (1)
InterfaceEvent
(191-191)
🪛 ESLint
src/components/EventListCard/EventListCard.tsx
[error] 46-46: 'JSX' is not defined.
(no-undef)
🪛 Biome (1.9.4)
src/screens/OrganizationEvents/OrganizationEvents.tsx
[error] 215-215: Use Number.parseInt instead of the equivalent global.
ES2015 moved some globals into the Number namespace for consistency.
Safe fix: Use Number.parseInt instead.
(lint/style/useNumberNamespace)
[error] 216-216: Use Number.parseInt instead of the equivalent global.
ES2015 moved some globals into the Number namespace for consistency.
Safe fix: Use Number.parseInt instead.
(lint/style/useNumberNamespace)
[error] 217-217: Use Number.parseInt instead of the equivalent global.
ES2015 moved some globals into the Number namespace for consistency.
Safe fix: Use Number.parseInt instead.
(lint/style/useNumberNamespace)
[error] 222-222: Use Number.parseInt instead of the equivalent global.
ES2015 moved some globals into the Number namespace for consistency.
Safe fix: Use Number.parseInt instead.
(lint/style/useNumberNamespace)
[error] 223-223: Use Number.parseInt instead of the equivalent global.
ES2015 moved some globals into the Number namespace for consistency.
Safe fix: Use Number.parseInt instead.
(lint/style/useNumberNamespace)
[error] 224-224: Use Number.parseInt instead of the equivalent global.
ES2015 moved some globals into the Number namespace for consistency.
Safe fix: Use Number.parseInt instead.
(lint/style/useNumberNamespace)
src/components/EventCalender/Yearly/YearlyEventCalender.tsx
[error] 229-233: Provide an explicit type prop for the button element.
The default type of a button is submit, which causes the submission of a form when placed inside a form
element. This is likely not the behaviour that you want inside a React application.
Allowed button types are: submit, button or reset
(lint/a11y/useButtonType)
[error] 244-248: Provide an explicit type prop for the button element.
The default type of a button is submit, which causes the submission of a form when placed inside a form
element. This is likely not the behaviour that you want inside a React application.
Allowed button types are: submit, button or reset
(lint/a11y/useButtonType)
src/components/EventListCard/Modal/EventListCardModals.tsx
[error] 106-106: Use Number.parseInt instead of the equivalent global.
ES2015 moved some globals into the Number namespace for consistency.
Safe fix: Use Number.parseInt instead.
(lint/style/useNumberNamespace)
[error] 107-107: Use Number.parseInt instead of the equivalent global.
ES2015 moved some globals into the Number namespace for consistency.
Safe fix: Use Number.parseInt instead.
(lint/style/useNumberNamespace)
[error] 108-108: Use Number.parseInt instead of the equivalent global.
ES2015 moved some globals into the Number namespace for consistency.
Safe fix: Use Number.parseInt instead.
(lint/style/useNumberNamespace)
[error] 113-113: Use Number.parseInt instead of the equivalent global.
ES2015 moved some globals into the Number namespace for consistency.
Safe fix: Use Number.parseInt instead.
(lint/style/useNumberNamespace)
[error] 114-114: Use Number.parseInt instead of the equivalent global.
ES2015 moved some globals into the Number namespace for consistency.
Safe fix: Use Number.parseInt instead.
(lint/style/useNumberNamespace)
[error] 115-115: Use Number.parseInt instead of the equivalent global.
ES2015 moved some globals into the Number namespace for consistency.
Safe fix: Use Number.parseInt instead.
(lint/style/useNumberNamespace)
src/components/LeftDrawerOrg/LeftDrawerOrg.tsx
[error] 183-183: Avoid the words "image", "picture", or "photo" in img element alt text.
Screen readers announce img elements as "images", so it is not necessary to redeclare this in alternative text.
(lint/a11y/noRedundantAlt)
[error] 161-164: Provide an explicit type prop for the button element.
The default type of a button is submit, which causes the submission of a form when placed inside a form
element. This is likely not the behaviour that you want inside a React application.
Allowed button types are: submit, button or reset
(lint/a11y/useButtonType)
[error] 167-170: Provide an explicit type prop for the button element.
The default type of a button is submit, which causes the submission of a form when placed inside a form
element. This is likely not the behaviour that you want inside a React application.
Allowed button types are: submit, button or reset
(lint/a11y/useButtonType)
[error] 178-178: Provide an explicit type prop for the button element.
The default type of a button is submit, which causes the submission of a form when placed inside a form
element. This is likely not the behaviour that you want inside a React application.
Allowed button types are: submit, button or reset
(lint/a11y/useButtonType)
[error] 219-225: Provide an explicit type prop for the button element.
The default type of a button is submit, which causes the submission of a form when placed inside a form
element. This is likely not the behaviour that you want inside a React application.
Allowed button types are: submit, button or reset
(lint/a11y/useButtonType)
src/components/EventCalender/Monthly/EventCalender.tsx
[error] 303-307: Provide an explicit type prop for the button element.
The default type of a button is submit, which causes the submission of a form when placed inside a form
element. This is likely not the behaviour that you want inside a React application.
Allowed button types are: submit, button or reset
(lint/a11y/useButtonType)
🪛 GitHub Actions: PR Workflow
src/components/EventCalender/Yearly/YearlyEventCalender.tsx
[error] 8-8: tsdoc-undefined-tag: The TSDoc tag "@component" is not defined in this configuration (tsdoc/syntax)
schema.graphql
[error] 1-1: Parsing error: [graphql-eslint] Unknown type "EventAgendaFoldersConnection". Did you mean "EventAgendaFoldersConnectionPg", "EventAgendaFoldersConnectionEdgePg", "AgendaFolderItemsConnectionPg", or "EventVenuesConnectionPg"?
[error] 1-1: Parsing error: [graphql-eslint] Unknown type "EventAttachment". Did you mean "EventAttachmentPg", "VenueAttachmentPg", "PostAttachmentPg", or "EventAttendeeInput"?
[error] 1-1: Parsing error: [graphql-eslint] Unknown type "EventVenuesConnection". Did you mean "EventVenuesConnectionPg", "EventVenuesConnectionEdgePg", "UserTagsConnection", "VenueEventsConnectionPg", or "AdvertisementsConnection"?
[error] 1-1: Parsing error: [graphql-eslint] Unknown type "Recurrance".
[error] 1-1: Parsing error: [graphql-eslint] Unknown type "Recurrance".
🔇 Additional comments (50)
src/utils/timezoneUtils/dateTimeConfig.ts (1)
8-8
: LGTM! Recurrence fields correctly removed.The removal of
'recurrenceStartDate'
and'recurrenceEndDate'
from thedirectFields
array aligns perfectly with the PR objective of removing recurrence events functionality.src/components/EventListCard/EventListCard.tsx (2)
39-41
: Good documentation improvement.The JSDoc comment clearly describes the interface purpose and improves code documentation.
47-49
: LGTM! Formatting improvement.The multi-line formatting of the useTranslation hook improves readability.
src/components/OrganizationScreen/OrganizationScreen.tsx (2)
23-23
: LGTM! JSX import correctly added.The JSX type import resolves the type annotation issue for the component return type.
41-41
: LGTM! Query import updated correctly.The import change from
ORGANIZATION_EVENT_LIST
toGET_ORGANIZATION_EVENTS_PG
aligns with the new GraphQL schema structure.src/components/OrganizationScreen/OrganizationScreen.spec.tsx (3)
10-10
: LGTM! Query import updated correctly.The import change to
GET_ORGANIZATION_EVENTS_PG
aligns with the updated component.
28-28
: LGTM! Improved type safety.Adding proper typing for Navigate props with
NavigateProps
improves type safety.
130-130
: LGTM! Improved event dispatch.Using
new window.Event('resize')
provides better event dispatch compatibility.src/components/MemberActivity/Modal/CustomCell/customTableCell.tsx (1)
8-19
:⚠️ Potential issueInconsistent documentation and implementation.
The JSDoc comment was updated to remove mention of "recurrence status," but the actual rendering code on line 89 still displays
{event.recurring ? 'Yes' : 'No'}
. This creates an inconsistency between the documentation and implementation.Either update the JSDoc to reflect that recurrence status is still displayed, or remove the recurrence column from the implementation to align with the PR objective of removing recurrence functionality.
Likely an incorrect or invalid review comment.
src/components/EventManagement/Dashboard/EventDashboard.mocks.ts (2)
7-7
: Query variable updated correctly.The change from
id
toeventId
aligns with the new GraphQL schema.Also applies to: 40-40
22-23
: New event properties align with schema changes.The replacement of
recurring
withisPublic
andisRegisterable
correctly reflects the removal of recurrence functionality.Also applies to: 55-56
src/components/LeftDrawerOrg/LeftDrawerOrg.spec.tsx (3)
9-9
: Interface renaming aligns with naming conventions.The change from
InterfaceLeftDrawerProps
toILeftDrawerProps
follows modern TypeScript naming conventions where interfaces are prefixed withI
.Also applies to: 22-22
255-255
: Improved event firing syntax.The updated
fireEvent.resize(window)
syntax is more explicit and follows current testing best practices.
360-360
: Direct window property access is cleaner.Using
window.location.pathname
directly instead ofglobal.window.location.pathname
is more straightforward and consistent with modern testing patterns.src/components/EventListCard/EventListCardProps.ts (2)
3-3
: Interface naming follows conventions.The rename from
InterfaceEventListCard
toIEventListCardProps
aligns with modern TypeScript naming conventions and better describes the purpose as props for the component.
111-112
: Time format includes seconds for consistency.The time values now include seconds (
09:00:00
,17:00:00
) which provides better consistency with ISO time formats.src/components/EventCalender/Monthly/EventCalendar.spec.tsx (3)
11-11
: LGTM: Proper vitest imports addedThe addition of vitest testing utilities is appropriate and follows modern testing practices.
308-308
: LGTM: Modern event dispatching implementationThe use of
new globalThis.Event('resize')
is the correct modern approach for dispatching synthetic events in tests. This is compatible across different environments and follows current best practices.Also applies to: 333-333, 350-350
135-163
: LGTM: Comprehensive test coverage for current day eventsThe test properly validates event list card rendering for current day events with appropriate mock data structure that aligns with the new non-recurring event schema.
src/components/EventListCard/Modal/Delete/EventListCardDeleteModal.tsx (2)
6-14
: LGTM: JSDoc updated to reflect simplified componentThe documentation correctly reflects the removal of recurring event parameters and provides clear parameter descriptions for the simplified component interface.
63-63
: LGTM: Simplified modal body for non-recurring eventsThe static deletion confirmation message is appropriate for the simplified event model without recurring event options. This maintains a clean user experience while removing complexity.
src/components/EventManagement/EventAttendance/Statistics/EventStatistics.tsx (1)
84-84
: LGTM: Modern TypeScript return typeThe change from
JSX.Element
toReact.JSX.Element
is the correct modern TypeScript return type annotation for React components and improves type safety.src/components/EventListCard/EventListCard.spec.tsx (4)
97-98
: LGTM: Standardized to 24-hour ISO time formatThe time format standardization to 24-hour ISO format (
09:00:00
,17:00:00
) improves consistency and aligns with international standards.
292-292
: LGTM: Updated to use administrator role test dataThe change from
props[1]
toprops[4]
switches the tests to use an event withuserRole: 'ADMINISTRATOR'
, which is appropriate for tests that require administrative privileges like event management, updates, and deletion. This aligns with the proper role-based access control testing.Also applies to: 327-327, 370-370, 424-424
469-469
: LGTM: Consistent test data referenceThe test correctly uses the delete event button test ID and maintains consistency with the simplified deletion flow for non-recurring events.
486-486
: LGTM: Proper destructuring for error scenario testThe destructuring of
props[4]
correctly separates the key from other props for the error scenario test, maintaining proper component rendering while testing failure cases.src/components/EventManagement/Dashboard/EventDashboard.spec.tsx (1)
3-3
: Good cleanup - removing unused import.Removing the unused
fireEvent
import helps keep the codebase clean.src/components/EventListCard/Modal/EventListCardModals.tsx (1)
92-132
: LGTM! Event update mutation properly uses nested input structure.The refactored
handleEventUpdate
function correctly:
- Uses the new nested
input
structure matching the GraphQL schema- Properly handles date/time conversion to ISO format for both all-day and timed events
- Maintains proper error handling
🧰 Tools
🪛 Biome (1.9.4)
[error] 106-106: Use Number.parseInt instead of the equivalent global.
ES2015 moved some globals into the Number namespace for consistency.
Safe fix: Use Number.parseInt instead.(lint/style/useNumberNamespace)
[error] 107-107: Use Number.parseInt instead of the equivalent global.
ES2015 moved some globals into the Number namespace for consistency.
Safe fix: Use Number.parseInt instead.(lint/style/useNumberNamespace)
[error] 108-108: Use Number.parseInt instead of the equivalent global.
ES2015 moved some globals into the Number namespace for consistency.
Safe fix: Use Number.parseInt instead.(lint/style/useNumberNamespace)
[error] 113-113: Use Number.parseInt instead of the equivalent global.
ES2015 moved some globals into the Number namespace for consistency.
Safe fix: Use Number.parseInt instead.(lint/style/useNumberNamespace)
[error] 114-114: Use Number.parseInt instead of the equivalent global.
ES2015 moved some globals into the Number namespace for consistency.
Safe fix: Use Number.parseInt instead.(lint/style/useNumberNamespace)
[error] 115-115: Use Number.parseInt instead of the equivalent global.
ES2015 moved some globals into the Number namespace for consistency.
Safe fix: Use Number.parseInt instead.(lint/style/useNumberNamespace)
src/components/EventListCard/Modal/Preview/EventListCardPreviewModal.tsx (1)
74-78
: Well-implemented permission logic!The consolidated
canEditEvent
boolean provides a clean and consistent way to control edit permissions throughout the component. This approach improves maintainability and reduces the chance of permission check inconsistencies.src/screens/OrganizationEvents/OrganizationEvents.tsx (2)
173-196
: Well-structured event data normalization.The transformation from GraphQL edges to
InterfaceEvent
objects is properly implemented with appropriate null handling and date formatting.
209-235
: Properly structured event creation with new schema.The event creation logic correctly uses the new nested input structure and handles all event fields appropriately, including proper ISO date formatting and boolean flags.
🧰 Tools
🪛 Biome (1.9.4)
[error] 215-215: Use Number.parseInt instead of the equivalent global.
ES2015 moved some globals into the Number namespace for consistency.
Safe fix: Use Number.parseInt instead.(lint/style/useNumberNamespace)
[error] 216-216: Use Number.parseInt instead of the equivalent global.
ES2015 moved some globals into the Number namespace for consistency.
Safe fix: Use Number.parseInt instead.(lint/style/useNumberNamespace)
[error] 217-217: Use Number.parseInt instead of the equivalent global.
ES2015 moved some globals into the Number namespace for consistency.
Safe fix: Use Number.parseInt instead.(lint/style/useNumberNamespace)
[error] 222-222: Use Number.parseInt instead of the equivalent global.
ES2015 moved some globals into the Number namespace for consistency.
Safe fix: Use Number.parseInt instead.(lint/style/useNumberNamespace)
[error] 223-223: Use Number.parseInt instead of the equivalent global.
ES2015 moved some globals into the Number namespace for consistency.
Safe fix: Use Number.parseInt instead.(lint/style/useNumberNamespace)
[error] 224-224: Use Number.parseInt instead of the equivalent global.
ES2015 moved some globals into the Number namespace for consistency.
Safe fix: Use Number.parseInt instead.(lint/style/useNumberNamespace)
src/GraphQl/Mutations/mutations.ts (3)
325-346
: CREATE_EVENT_MUTATION properly updated for new schema.The mutation correctly uses the single input parameter pattern and returns comprehensive event data including nested organization and creator information.
350-356
: DELETE_EVENT_MUTATION correctly simplified.The mutation properly uses the input pattern and returns minimal data appropriate for delete operations.
468-496
: UPDATE_EVENT_MUTATION comprehensively structured.The mutation correctly uses the input pattern and returns detailed event data including audit fields (creator, updater, timestamps) which is excellent for tracking changes.
src/components/EventManagement/Dashboard/EventDashboard.tsx (1)
80-93
: LGTM! Good UTC time handling implementation.The
formatTimeFromDateTime
function correctly extracts time from ISO datetime strings and maintains UTC consistency, which aligns with test expectations.src/components/EventCalender/Yearly/YearlyEventCalender.spec.tsx (2)
97-130
: LGTM! Well-structured mock data with pagination support.The updated mock organization data properly reflects the new paginated member structure with edges and nodes, aligning with the GraphQL schema changes.
14-38
: LGTM! Comprehensive router mocking implementation.The router mocking setup correctly handles all necessary hooks and preserves actual router components, addressing the learning about separate mock implementations for different hooks.
src/types/Event/interface.ts (1)
189-202
: LGTM! Good backward compatibility approach.The legacy interface exports provide a smooth migration path for existing code while encouraging the use of new naming conventions.
src/components/EventCalender/Monthly/EventCalender.tsx (7)
79-110
: Well-structured event filtering logic!The refactored
filterData
function provides clear role-based filtering with proper handling of the paginated members structure. The logic is much more readable and maintainable than before.
138-144
: Good practice: Environment-aware console logging.The conditional console warning properly avoids logging in test environments while maintaining helpful debugging information in development.
182-200
: Correct fix for JavaScript month indexing.The changes properly handle JavaScript's zero-based month indexing (0-11) in the date navigation logic. This fixes potential bugs when navigating between months, especially around year boundaries.
221-251
: Clean implementation of non-recurring event rendering.The event rendering logic has been appropriately simplified with the removal of recurrence support. The addition of the
userId
prop toEventListCard
enables proper user-specific functionality.
253-295
: Responsive event display with proper mobile handling.Good implementation of the expandable event list with responsive behavior for mobile devices (windowWidth <= 700). The logic appropriately limits displayed events to improve UI on smaller screens.
🧰 Tools
🪛 Biome (1.9.4)
[error] 267-267: JSX elements without children should be marked as self-closing. In JSX, it is valid for any element to be self-closing.
Unsafe fix: Use a SelfClosingElement instead
(lint/style/useSelfClosingElements)
530-536
: Consistent prop propagation to YearlyEventCalender.Good practice passing all necessary props to maintain feature parity between monthly and yearly calendar views.
41-41
:❓ Verification inconclusive
Consider using consistent import paths.
The import path for styles has been changed from a relative path to an absolute path. Ensure this aligns with the project's import conventions for consistency across the codebase.
🏁 Script executed:
#!/bin/bash # Check the import pattern used across the codebase for style modules rg -A 1 "import.*styles.*from.*\.module\.css" --type ts --type tsx | head -20Length of output: 107
🏁 Script executed:
#!/bin/bash # Search for CSS module imports across .ts and .tsx files to check path conventions rg -A1 "import.*styles.*from.*\\.module\\.css" -g "*.ts" -g "*.tsx" | head -20Length of output: 1488
Mixed CSS module import paths detected
Across the codebase,app-fixed.module.css
is imported both relatively and absolutely. Please confirm the project’s preferred convention and align this file accordingly.Files and import styles found:
- src/screens/SubTags/SubTags.tsx
import styles from 'style/app-fixed.module.css';- src/screens/UserPortal/Campaigns/PledgeModal.tsx
import styles from '../../../style/app-fixed.module.css';- src/screens/UserPortal/Volunteer/UpcomingEvents/UpcomingEvents.tsx
import styles from 'style/app-fixed.module.css';- src/screens/UserPortal/Volunteer/VolunteerManagement.tsx
import styles from 'style/app-fixed.module.css';- src/screens/UserPortal/Pledges/Pledges.tsx
import styles from 'style/app-fixed.module.css';- src/screens/UserPortal/Campaigns/Campaigns.tsx
import styles from '../../../style/app-fixed.module.css';- src/screens/UserPortal/Volunteer/Groups/Groups.tsx
import styles from 'style/app-fixed.module.css';- This file (
src/components/EventCalender/Monthly/EventCalender.tsx
)import styles from '../../../style/app-fixed.module.css';Adjust
EventCalender.tsx
to use the same import style as the rest of the codebase.src/GraphQl/Queries/Queries.ts (4)
284-314
: Well-structured query refactoring following GraphQL best practices.The EVENT_DETAILS query has been properly updated to:
- Use input object pattern for better extensibility
- Align with the new Event schema fields
- Include comprehensive nested data for creator, updater, and organization
493-522
: Essential event fields added for complete event data.The addition of
allDay
,location
,isPublic
, andisRegisterable
fields ensures the paginated events query returns all necessary data for proper UI rendering and filtering.
545-587
: Comprehensive organization data query with proper pagination support.Excellent enhancements to the organization query:
- Proper pagination support for members
- Complete organization details including address and timestamps
- Nested creator/updater information
- Consistent with the paginated connection pattern used throughout the codebase
589-616
: Query accurately renamed to reflect its list operation.The ORGANIZATIONS_LIST query now correctly fetches multiple organizations with comprehensive data, matching its name and intended purpose.
schema.graphql (1)
2080-2103
: Well-designed event mutation inputs with simplified datetime handling.The new mutation input types effectively implement the non-recurring event model:
- Consolidated
startAt
/endAt
DateTime fields are cleaner than separate date/time fields- Proper use of optional fields in
MutationUpdateEventInput
for partial updates- Clean removal of all recurrence-related fields
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
♻️ Duplicate comments (3)
src/components/EventListCard/EventListCard.tsx (1)
33-33
: JSX import properly added.The JSX type is now correctly imported, resolving the compilation error mentioned in the previous review.
src/components/EventCalender/Yearly/YearlyEventCalender.tsx (2)
38-38
: 🧹 Nitpick (assertive)Use absolute path for CSS module import.
Since your tsconfig.json defines
baseUrl: "src"
, use the absolute path for consistency with other components.-import styles from '../../../style/app-fixed.module.css'; +import styles from 'style/app-fixed.module.css';
228-232
: 🧹 Nitpick (assertive)Add explicit type attribute to buttons.
Buttons default to
type="submit"
which could cause unintended form submissions if placed inside a form.<button className={styles.btn__more} onClick={() => toggleExpand(expandKey)} data-testid={`expand-btn-${expandKey}`} + type="button" >
And for the second button:
<button className={styles.btn__more} onClick={() => toggleExpand(expandKey)} data-testid={`no-events-btn-${expandKey}`} + type="button" >
Also applies to: 243-247
🧰 Tools
🪛 Biome (1.9.4)
[error] 228-232: Provide an explicit type prop for the button element.
The default type of a button is submit, which causes the submission of a form when placed inside a
form
element. This is likely not the behaviour that you want inside a React application.
Allowed button types are: submit, button or reset(lint/a11y/useButtonType)
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro
📒 Files selected for processing (2)
src/components/EventCalender/Yearly/YearlyEventCalender.tsx
(9 hunks)src/components/EventListCard/EventListCard.tsx
(2 hunks)
🧰 Additional context used
🧠 Learnings (1)
src/components/EventCalender/Yearly/YearlyEventCalender.tsx (1)
Learnt from: syedali237
PR: PalisadoesFoundation/talawa-admin#3712
File: src/components/EventCalender/Yearly/YearlyEventCalender.spec.tsx:156-238
Timestamp: 2025-02-24T14:08:23.162Z
Learning: In YearlyEventCalender component, event filtering based on user roles (SUPERADMIN, ADMIN, USER) is handled internally through the userRole prop, and separate test cases with role-specific data validate this filtering.
🧬 Code Graph Analysis (1)
src/components/EventListCard/EventListCard.tsx (2)
src/types/Event/interface.ts (1)
InterfaceEvent
(191-191)src/components/EventListCard/EventListCardProps.ts (1)
props
(7-162)
🪛 Biome (1.9.4)
src/components/EventCalender/Yearly/YearlyEventCalender.tsx
[error] 228-232: Provide an explicit type prop for the button element.
The default type of a button is submit, which causes the submission of a form when placed inside a form
element. This is likely not the behaviour that you want inside a React application.
Allowed button types are: submit, button or reset
(lint/a11y/useButtonType)
[error] 243-247: Provide an explicit type prop for the button element.
The default type of a button is submit, which causes the submission of a form when placed inside a form
element. This is likely not the behaviour that you want inside a React application.
Allowed button types are: submit, button or reset
(lint/a11y/useButtonType)
🔇 Additional comments (4)
src/components/EventListCard/EventListCard.tsx (1)
9-13
: Good improvements to JSDoc and interface naming!The simplified parameter descriptions and the interface rename to
IEventListCard
improve code clarity and follow TypeScript conventions.Also applies to: 40-44
src/components/EventCalender/Yearly/YearlyEventCalender.tsx (3)
44-44
: Good migration to UserRole enum!The consistent use of
UserRole
enum instead of string literals improves type safety and aligns with the codebase refactoring.Also applies to: 87-87, 98-99
90-118
: Well-structured event filtering logic.The filtering implementation correctly handles different user roles and edge cases. The use of optional chaining (
orgData?.members?.edges
) properly handles the case when orgData is undefined.
54-57
: Clean implementation of state management and event rendering.The simplified state management and the use of default values for attendees (
attendees || []
) improve code reliability.Also applies to: 183-202
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## develop #3981 +/- ##
===========================================
- Coverage 87.20% 86.46% -0.74%
===========================================
Files 363 357 -6
Lines 9371 9083 -288
Branches 1998 1916 -82
===========================================
- Hits 8172 7854 -318
- Misses 828 852 +24
- Partials 371 377 +6 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
@palisadoes @meetulr @duplixx Please merge this PR |
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.
Looks good.
What kind of change does this PR introduce?
Issue Number:
Fixes #3587
Snapshots/Videos:
If relevant, did you update the documentation?
Summary
Does this PR introduce a breaking change?
Summary by CodeRabbit
New Features
Bug Fixes
Refactor
Style
Documentation
Tests