-
-
Notifications
You must be signed in to change notification settings - Fork 889
Events CRUD feature #3959
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
Events CRUD feature #3959
Conversation
""" WalkthroughThis set of changes removes all logic, types, UI, and utilities related to recurring events and recurrence rules throughout the codebase. Event types, interfaces, and GraphQL schemas are refactored to eliminate recurrence-related fields, consolidating date and time fields into single DateTime properties. Event mutations and queries are updated to use unified input objects and return more detailed nested data. UI components, including event calendars and modals, are simplified to remove recurrence options and controls, and event filtering is updated to use a new Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant UI
participant GraphQL
participant DB
User->>UI: Initiate Event Create/Update/Delete
UI->>GraphQL: send {input: EventInputObject}
GraphQL->>DB: Create/Update/Delete Event (no recurrence)
DB-->>GraphQL: Event data (id, name, startAt, endAt, etc.)
GraphQL-->>UI: Event data (with nested creator, organization)
UI-->>User: Show updated event info
Assessment against linked issues
Possibly related PRs
Suggested labels
Suggested reviewers
📜 Recent review detailsConfiguration used: .coderabbit.yaml 📒 Files selected for processing (3)
💤 Files with no reviewable changes (3)
⏰ Context from checks skipped due to timeout of 90000ms (1)
✨ Finishing Touches
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: 30
🔭 Outside diff range comments (20)
src/components/OrganizationScreen/OrganizationScreen.spec.tsx (1)
37-58
:⚠️ Potential issueMismatch between query structure and mock data.
The mock is using the new paginated query
GET_ORGANIZATION_EVENTS_PG
but still contains the old data structure. Based on the query definition, the data should follow a connection pattern withorganization.events.edges.node
structure, not a flateventsByOrganization
array.This will cause test failures. Apply this correction:
request: { query: GET_ORGANIZATION_EVENTS_PG, variables: { id: '123' } }, 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, - recurring: 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: 'Creator Name' + } + }, + cursor: 'cursor1' + } + ], + pageInfo: { + hasNextPage: false, + endCursor: 'cursor1' + } + } + } }, },src/components/OrganizationScreen/OrganizationScreen.tsx (1)
111-127
: 💡 Verification agent🧩 Analysis chain
Data access needs to be updated for the new paginated structure.
The event lookup logic needs to be updated to work with the new connection-based data structure from the paginated query. The current implementation will fail as it expects the old flat array structure.
Run this script to verify the actual structure returned by the server:
🏁 Script executed:
#!/bin/bash # Find places where the eventsData is being accessed to understand the expected structure rg -A 5 -B 5 "eventsData\." src/components/OrganizationScreen/OrganizationScreen.tsx # Find all usages of the new query to see if there are any working examples rg "GET_ORGANIZATION_EVENTS_PG" --type tsLength of output: 2019
🏁 Script executed:
#!/bin/bash # Display the GET_ORGANIZATION_EVENTS_PG query to inspect its structure rg -A10 -B1 "export const GET_ORGANIZATION_EVENTS_PG" -n src/GraphQl/Queries/Queries.tsLength of output: 471
Update event lookup to use paginated connection structure
The
GET_ORGANIZATION_EVENTS_PG
query now returnsdata.organization.events.edges[].node
—not a flat
eventsByOrganization
array. You’ll need to:
- Drill into
eventsData.organization.events.edges
- Extract each
node
(which containsid
, not_id
)- Then
.find()
bynode.id
For example, in
src/components/OrganizationScreen/OrganizationScreen.tsx
(lines ~111–127):- if (isEventPath?.params.eventId && eventsData?.eventsByOrganization) { - const event = eventsData.eventsByOrganization.find( - (e: InterfaceEvent) => e._id === eventId, - ); + if ( + isEventPath?.params.eventId && + eventsData?.organization?.events?.edges + ) { + const nodes = eventsData.organization.events.edges.map(edge => edge.node); + const event = nodes.find((e: { id: string }) => e.id === eventId);Be sure to update:
- The property name from
_id
toid
- Any related typings (e.g.
InterfaceEvent
) to matchnode
shapesrc/components/EventCalender/Yearly/YearlyEventCalender.spec.tsx (2)
158-168
:⚠️ Potential issueDuplicate test name → hard to spot failing case
There are two tests called “filters events correctly for ADMINISTRATOR role”.
Rename one of them (e.g., “filters events for ADMINISTRATOR when viewer is attendee”) to avoid Vitest’s duplicate-title warning.🧰 Tools
🪛 ESLint
[error] 158-158: 'it' is not defined.
(no-undef)
194-214
: 🧹 Nitpick (assertive)Minor wording: “regular REGULAR”
-it('filters events correctly for regular REGULAR role', ... +it('filters events correctly for REGULAR role', ...🧰 Tools
🪛 ESLint
[error] 194-194: 'it' is not defined.
(no-undef)
src/screens/OrganizationEvents/OrganizationEventsMocks.ts (1)
18-34
: 🛠️ Refactor suggestion
⚠️ Potential issueList-query mocks still use deprecated fields
The schema refactor removed
title
,startDate
,recurring
, etc., yet these mocks still return them.
Tests relying on up-to-date data will start failing once the query’s TypeScript types are regenerated.Suggested minimal update:
- title: 'Event', + name: 'Event', @@ - startDate: '', - endDate: '', + startAt: '', + endAt: '', @@ - recurring: false, - recurrenceRule: null, - isRecurringEventException: false, + // recurrence fields removed by schema updateApply the same cleanup in the block below (lines 50-66).
src/screens/OrganizationEvents/OrganizationEvents.tsx (1)
94-97
:⚠️ Potential issueIncorrect Day.js parsing API usage will create invalid dates
dayjs()
expects the format string as its second parameter, not an object.
Passing an object silently falls back to the default parser and may yield an invalid date that breaks the<TimePicker>
.- return dayjs(dateTimeString, { format: 'YYYY-MM-DD HH:mm:ss' }); + return dayjs(dateTimeString, 'YYYY-MM-DD HH:mm:ss');🧰 Tools
🪛 Biome (1.9.4)
[error] 95-95: Template literals are preferred over string concatenation.
Unsafe fix: Use a template literal.
(lint/style/useTemplate)
src/components/EventListCard/Modal/Preview/EventListCardPreviewModal.tsx (2)
70-73
:⚠️ Potential issueSame Day.js misuse as in
OrganizationEvents
Replicate the fix here to keep both components consistent and bug-free.
- return dayjs(dateTimeString, { format: 'YYYY-MM-DD HH:mm:ss' }); + return dayjs(dateTimeString, 'YYYY-MM-DD HH:mm:ss');🧰 Tools
🪛 Biome (1.9.4)
[error] 71-71: Template literals are preferred over string concatenation.
Unsafe fix: Use a template literal.
(lint/style/useTemplate)
101-107
: 🧹 Nitpick (assertive)Truncating the bound input value leads to data loss on edit
Displaying a shortened value inside a controlled
<input>
mutates the source of truth; users editing the field will overwrite the original text.Consider either:
- Removing the truncation and letting the input scroll, or
- Showing the full value in a read-only
<Form.Control plaintext>
when!canEditEvent
.No diff provided because two alternative UX directions exist.
🧰 Tools
🪛 Biome (1.9.4)
[error] 104-104: Template literals are preferred over string concatenation.
Unsafe fix: Use a template literal.
(lint/style/useTemplate)
src/components/EventManagement/Dashboard/EventDashboard.tsx (2)
160-165
: 🧹 Nitpick (assertive)Add
type="button"
to non-form buttonsWithout an explicit
type
, the default is"submit"
.
If this component is ever rendered inside a<form>
(e.g. in a modal),
clicking the edit icon will inadvertently submit the parent form.-<button +<button + type="button"
124-155
: 🧹 Nitpick (assertive)Consider hiding placeholder KPI cards when data is unavailable
Rendering three separate “N/A” cards clutters the UI and may confuse users.
Either:
- hide the cards until the corresponding fields are supplied by the API, or
- display a short helper text such as “Metrics coming soon”.
No code change required now, but worth tracking.
src/components/EventCalender/Yearly/YearlyEventCalender.tsx (2)
229-248
: 🧹 Nitpick (assertive)Explicit button types required (accessibility & unintended form submit)
Both branches render
<button>
elements without atype
attribute:-<button +<button type="button"Apply to lines 229 and 244.
This addresses the Biomea11y/useButtonType
error.🧰 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] 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)
142-178
: 🧹 Nitpick (assertive)Inefficient day-level event filtering inside render loop
events?.filter(...)
is executed for every rendered day (≈ 42 × 12 = 504
times/year view). Pre-group events by date once (e.g.Map<string, Event[]>
)
inuseMemo
or duringsetEvents
, then look up with
map.get(dayjs(date).format('YYYY-MM-DD'))
to cut repeated iterations.This will noticeably improve performance on large data sets.
src/types/Event/interface.ts (3)
44-57
:⚠️ Potential issueType mismatch:
userRole
is declared asstring
instead of the newUserRole
enum.
InterfaceEvent.userRole?: string
should leverage the strongly-typed enum you just introduced. Leaving it asstring
nullifies the benefit of the enum and will break the comparison infilterData
(userRole === UserRole.ADMINISTRATOR
), which relies on a discriminated union.- userRole?: string; + userRole?: UserRole;Apply the same change wherever a role appears (e.g. organisation members, props, helpers).
93-100
:⚠️ Potential issueProp leak –
InterfaceCalendarProps.userRole
still usesstring
.The Calendar component is already comparing the value against
UserRole.ADMINISTRATOR
; therefore its prop should be typed as that enum to prevent invalid inputs.- userRole?: string; + userRole?: UserRole;
159-166
: 🧹 Nitpick (assertive)Stale prop name references removed recurrence feature.
recurringEventUpdateModalIsOpen
&toggleRecurringEventUpdateModal
still contain “Recurring”.
Since recurrence has been removed, rename these props to avoid confusion (e.g.eventUpdateModalIsOpen
,toggleEventUpdateModal
).src/components/EventCalender/Monthly/EventCalender.tsx (2)
80-88
:⚠️ Potential issue
filterData
signature mis-typed –userRole
should beUserRole
.The function receives
userRole?: string
but later compares it to the enum, which will never be equal under strict type-checking. Update the parameter (and call sites) to:- userRole?: string, + userRole?: UserRole,This also eliminates the need for
// @ts-ignore
style work-arounds elsewhere.
71-77
: 🧹 Nitpick (assertive)
window.screen.width
gives stale values on high-DPI/zoomed displays.
window.innerWidth
is the canonical responsive measure;screen.width
can stay constant under browser zoom. Replace both the initial state and the resize handler to useinnerWidth
.src/GraphQl/Queries/Queries.ts (3)
316-328
:⚠️ Potential issueObsolete
RECURRING_EVENTS
query – backend fields were removed.The recurrence feature is gone, yet this query still requests it. Keeping the query will break the build once the schema is updated.
Either delete the query or migrate callers to the new non-recurring endpoints.
824-877
:⚠️ Potential issue
ORGANIZATION_EVENT_CONNECTION_LIST
still asks for legacy fields (startDate
,recurring
, …).These fields no longer exist (
startAt
,endAt
, etc.). Any component executing this query will fail at runtime.Refactor or remove the query:
- startDate - endDate - startTime - endTime - allDay - recurring + startAt + endAt + allDay…and drop
recurrenceRule
/isRecurringEventException
entirely.
494-508
: 🧹 Nitpick (assertive)Consistency:
GET_ORGANIZATION_EVENTS_PG
now includesallDay
,location
,isPublic
,isRegisterable
, but missingupdatedAt
.Most event detail queries return both
createdAt
andupdatedAt
. Consider addingupdatedAt
for uniformity and UI refresh triggers.
♻️ Duplicate comments (2)
src/components/EventCalender/Yearly/YearlyEventCalender.spec.tsx (2)
173-192
: Same duplicate-title issue as aboveChange this title as well; otherwise only the second definition will be executed.
-it('filters events correctly for ADMINISTRATOR role', ... +it('filters ADMINISTRATOR-created events for ADMINISTRATOR viewer', ...🧰 Tools
🪛 ESLint
[error] 173-192: Test is used multiple times in the same describe(suite) block
(vitest/no-identical-title)
[error] 173-173: 'it' is not defined.
(no-undef)
305-325
: Private-event test duplicates ADMINISTRATOR scenario titleSame duplicate-title issue; rename accordingly (e.g., “…with private events”).
🧰 Tools
🪛 ESLint
[error] 305-305: 'it' is not defined.
(no-undef)
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro
⛔ Files ignored due to path filters (111)
docs/docs/auto-docs/GraphQl/Mutations/mutations/variables/ADD_ADMIN_MUTATION.md
is excluded by!**/docs/docs/**
docs/docs/auto-docs/GraphQl/Mutations/mutations/variables/ADD_MEMBER_MUTATION.md
is excluded by!**/docs/docs/**
docs/docs/auto-docs/GraphQl/Mutations/mutations/variables/CREATE_POST_MUTATION.md
is excluded by!**/docs/docs/**
docs/docs/auto-docs/GraphQl/Mutations/mutations/variables/DELETE_EVENT_MUTATION.md
is excluded by!**/docs/docs/**
docs/docs/auto-docs/GraphQl/Mutations/mutations/variables/DELETE_POST_MUTATION.md
is excluded by!**/docs/docs/**
docs/docs/auto-docs/GraphQl/Mutations/mutations/variables/DONATE_TO_ORGANIZATION.md
is excluded by!**/docs/docs/**
docs/docs/auto-docs/GraphQl/Mutations/mutations/variables/FORGOT_PASSWORD_MUTATION.md
is excluded by!**/docs/docs/**
docs/docs/auto-docs/GraphQl/Mutations/mutations/variables/GENERATE_OTP_MUTATION.md
is excluded by!**/docs/docs/**
docs/docs/auto-docs/GraphQl/Mutations/mutations/variables/GET_FILE_PRESIGNEDURL.md
is excluded by!**/docs/docs/**
docs/docs/auto-docs/GraphQl/Mutations/mutations/variables/LIKE_POST.md
is excluded by!**/docs/docs/**
docs/docs/auto-docs/GraphQl/Mutations/mutations/variables/PRESIGNED_URL.md
is excluded by!**/docs/docs/**
docs/docs/auto-docs/GraphQl/Mutations/mutations/variables/REGISTER_EVENT.md
is excluded by!**/docs/docs/**
docs/docs/auto-docs/GraphQl/Mutations/mutations/variables/REMOVE_ADMIN_MUTATION.md
is excluded by!**/docs/docs/**
docs/docs/auto-docs/GraphQl/Mutations/mutations/variables/REMOVE_MEMBER_MUTATION.md
is excluded by!**/docs/docs/**
docs/docs/auto-docs/GraphQl/Mutations/mutations/variables/REMOVE_MEMBER_MUTATION_PG.md
is excluded by!**/docs/docs/**
docs/docs/auto-docs/GraphQl/Mutations/mutations/variables/RESET_COMMUNITY.md
is excluded by!**/docs/docs/**
docs/docs/auto-docs/GraphQl/Mutations/mutations/variables/UNLIKE_POST.md
is excluded by!**/docs/docs/**
docs/docs/auto-docs/GraphQl/Mutations/mutations/variables/UPDATE_COMMUNITY_PG.md
is excluded by!**/docs/docs/**
docs/docs/auto-docs/GraphQl/Mutations/mutations/variables/UPDATE_EVENT_MUTATION.md
is excluded by!**/docs/docs/**
docs/docs/auto-docs/GraphQl/Mutations/mutations/variables/UPDATE_POST_MUTATION.md
is excluded by!**/docs/docs/**
docs/docs/auto-docs/GraphQl/Mutations/mutations/variables/UPDATE_SESSION_TIMEOUT_PG.md
is excluded by!**/docs/docs/**
docs/docs/auto-docs/GraphQl/Queries/Queries/variables/ADMIN_LIST.md
is excluded by!**/docs/docs/**
docs/docs/auto-docs/GraphQl/Queries/Queries/variables/BLOCK_PAGE_MEMBER_LIST.md
is excluded by!**/docs/docs/**
docs/docs/auto-docs/GraphQl/Queries/Queries/variables/EVENT_ATTENDEES.md
is excluded by!**/docs/docs/**
docs/docs/auto-docs/GraphQl/Queries/Queries/variables/EVENT_CHECKINS.md
is excluded by!**/docs/docs/**
docs/docs/auto-docs/GraphQl/Queries/Queries/variables/EVENT_FEEDBACKS.md
is excluded by!**/docs/docs/**
docs/docs/auto-docs/GraphQl/Queries/Queries/variables/EVENT_REGISTRANTS.md
is excluded by!**/docs/docs/**
docs/docs/auto-docs/GraphQl/Queries/Queries/variables/GET_COMMUNITY_DATA.md
is excluded by!**/docs/docs/**
docs/docs/auto-docs/GraphQl/Queries/Queries/variables/GET_COMMUNITY_DATA_PG.md
is excluded by!**/docs/docs/**
docs/docs/auto-docs/GraphQl/Queries/Queries/variables/GET_COMMUNITY_SESSION_TIMEOUT_DATA_PG.md
is excluded by!**/docs/docs/**
docs/docs/auto-docs/GraphQl/Queries/Queries/variables/GET_ORGANIZATION_BLOCKED_USERS_PG.md
is excluded by!**/docs/docs/**
docs/docs/auto-docs/GraphQl/Queries/Queries/variables/GET_ORGANIZATION_DATA_PG.md
is excluded by!**/docs/docs/**
docs/docs/auto-docs/GraphQl/Queries/Queries/variables/GET_ORGANIZATION_EVENTS.md
is excluded by!**/docs/docs/**
docs/docs/auto-docs/GraphQl/Queries/Queries/variables/GET_ORGANIZATION_EVENTS_PG.md
is excluded by!**/docs/docs/**
docs/docs/auto-docs/GraphQl/Queries/Queries/variables/GET_ORGANIZATION_MEMBERS_PG.md
is excluded by!**/docs/docs/**
docs/docs/auto-docs/GraphQl/Queries/Queries/variables/GET_ORGANIZATION_POSTS_COUNT_PG.md
is excluded by!**/docs/docs/**
docs/docs/auto-docs/GraphQl/Queries/Queries/variables/GET_ORGANIZATION_POSTS_PG.md
is excluded by!**/docs/docs/**
docs/docs/auto-docs/GraphQl/Queries/Queries/variables/GET_POSTS_BY_ORG.md
is excluded by!**/docs/docs/**
docs/docs/auto-docs/GraphQl/Queries/Queries/variables/GET_USER_BY_ID.md
is excluded by!**/docs/docs/**
docs/docs/auto-docs/GraphQl/Queries/Queries/variables/IS_USER_BLOCKED.md
is excluded by!**/docs/docs/**
docs/docs/auto-docs/GraphQl/Queries/Queries/variables/MEMBERSHIP_REQUEST.md
is excluded by!**/docs/docs/**
docs/docs/auto-docs/GraphQl/Queries/Queries/variables/MEMBERS_LIST.md
is excluded by!**/docs/docs/**
docs/docs/auto-docs/GraphQl/Queries/Queries/variables/MEMBERS_LIST_PG.md
is excluded by!**/docs/docs/**
docs/docs/auto-docs/GraphQl/Queries/Queries/variables/ORGANIZATIONS_LIST.md
is excluded by!**/docs/docs/**
docs/docs/auto-docs/GraphQl/Queries/Queries/variables/ORGANIZATIONS_MEMBER_CONNECTION_LIST.md
is excluded by!**/docs/docs/**
docs/docs/auto-docs/GraphQl/Queries/Queries/variables/ORGANIZATION_DONATION_CONNECTION_LIST.md
is excluded by!**/docs/docs/**
docs/docs/auto-docs/GraphQl/Queries/Queries/variables/ORGANIZATION_EVENT_CONNECTION_LIST.md
is excluded by!**/docs/docs/**
docs/docs/auto-docs/GraphQl/Queries/Queries/variables/ORGANIZATION_EVENT_LIST.md
is excluded by!**/docs/docs/**
docs/docs/auto-docs/GraphQl/Queries/Queries/variables/RECURRING_EVENTS.md
is excluded by!**/docs/docs/**
docs/docs/auto-docs/GraphQl/Queries/Queries/variables/SIGNIN_QUERY.md
is excluded by!**/docs/docs/**
docs/docs/auto-docs/GraphQl/Queries/Queries/variables/USERS_CONNECTION_LIST.md
is excluded by!**/docs/docs/**
docs/docs/auto-docs/GraphQl/Queries/Queries/variables/USER_DETAILS.md
is excluded by!**/docs/docs/**
docs/docs/auto-docs/GraphQl/Queries/Queries/variables/USER_ORGANIZATION_LIST.md
is excluded by!**/docs/docs/**
docs/docs/auto-docs/components/EventCalender/Monthly/EventCalender/functions/default.md
is excluded by!**/docs/docs/**
docs/docs/auto-docs/components/EventCalender/Yearly/YearlyEventCalender/functions/default.md
is excluded by!**/docs/docs/**
docs/docs/auto-docs/components/EventListCard/EventListCard/functions/default.md
is excluded by!**/docs/docs/**
docs/docs/auto-docs/components/EventListCard/EventListCardProps/variables/props.md
is excluded by!**/docs/docs/**
docs/docs/auto-docs/components/EventListCard/Modal/Delete/EventListCardDeleteModal/functions/default.md
is excluded by!**/docs/docs/**
docs/docs/auto-docs/components/EventListCard/Modal/EventListCardModals/functions/default.md
is excluded by!**/docs/docs/**
docs/docs/auto-docs/components/EventListCard/Modal/Preview/EventListCardPreviewModal/functions/default.md
is excluded by!**/docs/docs/**
docs/docs/auto-docs/components/EventListCard/Modal/Update/EventListCardUpdateModal/functions/default.md
is excluded by!**/docs/docs/**
docs/docs/auto-docs/components/EventManagement/Dashboard/EventDashboard.mocks/variables/MOCKS_WITHOUT_TIME.md
is excluded by!**/docs/docs/**
docs/docs/auto-docs/components/EventManagement/Dashboard/EventDashboard.mocks/variables/MOCKS_WITH_TIME.md
is excluded by!**/docs/docs/**
docs/docs/auto-docs/components/EventManagement/Dashboard/EventDashboard/functions/default.md
is excluded by!**/docs/docs/**
docs/docs/auto-docs/components/EventManagement/EventAttendance/Statistics/EventStatistics/functions/AttendanceStatisticsModal.md
is excluded by!**/docs/docs/**
docs/docs/auto-docs/components/LeftDrawerOrg/LeftDrawerOrg/functions/default.md
is excluded by!**/docs/docs/**
docs/docs/auto-docs/components/RecurrenceOptions/RecurrenceOptions/functions/default.md
is excluded by!**/docs/docs/**
docs/docs/auto-docs/screens/OrganizationEvents/OrganizationEvents/enumerations/ViewType.md
is excluded by!**/docs/docs/**
docs/docs/auto-docs/screens/OrganizationEvents/OrganizationEvents/functions/default.md
is excluded by!**/docs/docs/**
docs/docs/auto-docs/screens/OrganizationEvents/OrganizationEventsMocks/variables/MOCKS.md
is excluded by!**/docs/docs/**
docs/docs/auto-docs/types/Event/interface/enumerations/UserRole.md
is excluded by!**/docs/docs/**
docs/docs/auto-docs/types/Event/interface/interfaces/InterfaceAttendanceStatisticsModalProps.md
is excluded by!**/docs/docs/**
docs/docs/auto-docs/types/Event/interface/interfaces/InterfaceCalendarProps.md
is excluded by!**/docs/docs/**
docs/docs/auto-docs/types/Event/interface/interfaces/InterfaceDeleteEventModalProps.md
is excluded by!**/docs/docs/**
docs/docs/auto-docs/types/Event/interface/interfaces/InterfaceEvent.md
is excluded by!**/docs/docs/**
docs/docs/auto-docs/types/Event/interface/interfaces/InterfaceEventHeaderProps.md
is excluded by!**/docs/docs/**
docs/docs/auto-docs/types/Event/interface/interfaces/InterfaceEventsAttendedMemberModalProps.md
is excluded by!**/docs/docs/**
docs/docs/auto-docs/types/Event/interface/interfaces/InterfaceIOrgList.md
is excluded by!**/docs/docs/**
docs/docs/auto-docs/types/Event/interface/interfaces/InterfaceMember.md
is excluded by!**/docs/docs/**
docs/docs/auto-docs/types/Event/interface/interfaces/InterfacePreviewEventModalProps.md
is excluded by!**/docs/docs/**
docs/docs/auto-docs/types/Event/interface/interfaces/InterfaceRecurringEvent.md
is excluded by!**/docs/docs/**
docs/docs/auto-docs/types/Event/interface/interfaces/InterfaceStatsModal.md
is excluded by!**/docs/docs/**
docs/docs/auto-docs/types/Event/interface/interfaces/InterfaceUpdateEventModalProps.md
is excluded by!**/docs/docs/**
docs/docs/auto-docs/types/Event/interface/variables/FilterPeriod.md
is excluded by!**/docs/docs/**
docs/docs/auto-docs/types/Event/interface/variables/Role.md
is excluded by!**/docs/docs/**
docs/docs/auto-docs/utils/recurrenceUtils/recurrenceConstants/variables/Days.md
is excluded by!**/docs/docs/**
docs/docs/auto-docs/utils/recurrenceUtils/recurrenceConstants/variables/allInstances.md
is excluded by!**/docs/docs/**
docs/docs/auto-docs/utils/recurrenceUtils/recurrenceConstants/variables/dayNames.md
is excluded by!**/docs/docs/**
docs/docs/auto-docs/utils/recurrenceUtils/recurrenceConstants/variables/daysOptions.md
is excluded by!**/docs/docs/**
docs/docs/auto-docs/utils/recurrenceUtils/recurrenceConstants/variables/endsAfter.md
is excluded by!**/docs/docs/**
docs/docs/auto-docs/utils/recurrenceUtils/recurrenceConstants/variables/endsNever.md
is excluded by!**/docs/docs/**
docs/docs/auto-docs/utils/recurrenceUtils/recurrenceConstants/variables/endsOn.md
is excluded by!**/docs/docs/**
docs/docs/auto-docs/utils/recurrenceUtils/recurrenceConstants/variables/frequencies.md
is excluded by!**/docs/docs/**
docs/docs/auto-docs/utils/recurrenceUtils/recurrenceConstants/variables/mondayToFriday.md
is excluded by!**/docs/docs/**
docs/docs/auto-docs/utils/recurrenceUtils/recurrenceConstants/variables/monthNames.md
is excluded by!**/docs/docs/**
docs/docs/auto-docs/utils/recurrenceUtils/recurrenceConstants/variables/recurrenceEndOptions.md
is excluded by!**/docs/docs/**
docs/docs/auto-docs/utils/recurrenceUtils/recurrenceConstants/variables/recurringEventMutationOptions.md
is excluded by!**/docs/docs/**
docs/docs/auto-docs/utils/recurrenceUtils/recurrenceConstants/variables/thisAndFollowingInstances.md
is excluded by!**/docs/docs/**
docs/docs/auto-docs/utils/recurrenceUtils/recurrenceConstants/variables/thisInstance.md
is excluded by!**/docs/docs/**
docs/docs/auto-docs/utils/recurrenceUtils/recurrenceConstants/variables/weekDayOccurences.md
is excluded by!**/docs/docs/**
docs/docs/auto-docs/utils/recurrenceUtils/recurrenceTypes/enumerations/Frequency.md
is excluded by!**/docs/docs/**
docs/docs/auto-docs/utils/recurrenceUtils/recurrenceTypes/enumerations/RecurrenceEndOption.md
is excluded by!**/docs/docs/**
docs/docs/auto-docs/utils/recurrenceUtils/recurrenceTypes/enumerations/RecurringEventMutationType.md
is excluded by!**/docs/docs/**
docs/docs/auto-docs/utils/recurrenceUtils/recurrenceTypes/enumerations/WeekDays.md
is excluded by!**/docs/docs/**
docs/docs/auto-docs/utils/recurrenceUtils/recurrenceTypes/interfaces/InterfaceRecurrenceRule.md
is excluded by!**/docs/docs/**
docs/docs/auto-docs/utils/recurrenceUtils/recurrenceTypes/interfaces/InterfaceRecurrenceRuleState.md
is excluded by!**/docs/docs/**
docs/docs/auto-docs/utils/recurrenceUtils/recurrenceUtilityFunctions/functions/getRecurrenceRuleText.md
is excluded by!**/docs/docs/**
docs/docs/auto-docs/utils/recurrenceUtils/recurrenceUtilityFunctions/functions/getWeekDayOccurenceInMonth.md
is excluded by!**/docs/docs/**
docs/docs/auto-docs/utils/recurrenceUtils/recurrenceUtilityFunctions/functions/hasRecurrenceRuleChanged.md
is excluded by!**/docs/docs/**
docs/docs/auto-docs/utils/recurrenceUtils/recurrenceUtilityFunctions/functions/haveInstanceDatesChanged.md
is excluded by!**/docs/docs/**
docs/docs/auto-docs/utils/recurrenceUtils/recurrenceUtilityFunctions/functions/isLastOccurenceOfWeekDay.md
is excluded by!**/docs/docs/**
📒 Files selected for processing (29)
schema.graphql
(4 hunks)src/GraphQl/Mutations/mutations.ts
(2 hunks)src/GraphQl/Queries/Queries.ts
(3 hunks)src/components/EventCalender/Monthly/EventCalender.tsx
(16 hunks)src/components/EventCalender/Yearly/YearlyEventCalender.spec.tsx
(9 hunks)src/components/EventCalender/Yearly/YearlyEventCalender.tsx
(9 hunks)src/components/EventListCard/EventListCard.spec.tsx
(0 hunks)src/components/EventListCard/EventListCard.tsx
(1 hunks)src/components/EventListCard/EventListCardProps.ts
(2 hunks)src/components/EventListCard/Modal/Delete/EventListCardDeleteModal.tsx
(2 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/OrganizationScreen/OrganizationScreen.spec.tsx
(2 hunks)src/components/OrganizationScreen/OrganizationScreen.tsx
(2 hunks)src/components/RecurrenceOptions/RecurrenceOptions.tsx
(0 hunks)src/screens/OrganizationEvents/OrganizationEvents.spec.tsx
(6 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)
💤 Files with no reviewable changes (8)
- src/components/EventListCard/EventListCard.spec.tsx
- src/utils/recurrenceUtils/index.ts
- src/utils/recurrenceUtils/recurrenceTypes.ts
- src/components/EventManagement/EventAttendance/Statistics/EventStatistics.tsx
- src/components/EventListCard/Modal/Update/EventListCardUpdateModal.tsx
- src/components/RecurrenceOptions/RecurrenceOptions.tsx
- src/utils/recurrenceUtils/recurrenceConstants.ts
- src/utils/recurrenceUtils/recurrenceUtilityFunctions.ts
🧰 Additional context used
🧠 Learnings (5)
src/components/OrganizationScreen/OrganizationScreen.spec.tsx (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 (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/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/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 (9)
src/components/OrganizationScreen/OrganizationScreen.spec.tsx (1)
src/GraphQl/Queries/Queries.ts (1)
GET_ORGANIZATION_EVENTS_PG
(493-522)
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/EventManagement/Dashboard/EventDashboard.spec.tsx (1)
src/components/Advertisements/AdvertisementsMocks.ts (1)
wait
(153-159)
src/components/EventListCard/Modal/EventListCardModals.tsx (1)
src/GraphQl/Mutations/mutations.ts (1)
REGISTER_EVENT
(514-520)
src/screens/OrganizationEvents/OrganizationEvents.spec.tsx (1)
src/components/Advertisements/AdvertisementsMocks.ts (1)
wait
(153-159)
src/screens/OrganizationEvents/OrganizationEvents.tsx (6)
src/GraphQl/Queries/Queries.ts (2)
GET_ORGANIZATION_EVENTS_PG
(493-522)GET_ORGANIZATION_DATA_PG
(545-587)src/utils/useLocalstorage.ts (1)
getItem
(29-33)src/GraphQl/Mutations/mutations.ts (1)
CREATE_EVENT_MUTATION
(325-346)src/screens/UserPortal/Events/Events.tsx (1)
events
(75-451)src/types/Event/interface.ts (1)
InterfaceEvent
(44-63)src/utils/errorHandler.tsx (1)
errorHandler
(10-32)
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)
src/components/EventCalender/Yearly/YearlyEventCalender.tsx (3)
src/screens/UserPortal/Events/Events.tsx (1)
events
(75-451)src/types/Event/interface.ts (2)
InterfaceEvent
(44-63)InterfaceIOrgList
(65-82)src/components/EventCalender/EventCalenderMocks.ts (1)
eventData
(7-45)
🪛 ESLint
src/components/EventListCard/EventListCard.tsx
[error] 46-46: 'JSX' is not defined.
(no-undef)
src/components/EventCalender/Yearly/YearlyEventCalender.spec.tsx
[error] 158-158: 'it' is not defined.
(no-undef)
[error] 173-192: Test is used multiple times in the same describe(suite) block
(vitest/no-identical-title)
[error] 173-173: 'it' is not defined.
(no-undef)
[error] 194-194: 'it' is not defined.
(no-undef)
[error] 305-305: 'it' is not defined.
(no-undef)
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)
[error] 211-211: 'JSX' is not defined.
(no-undef)
[error] 225-225: 'JSX' is not defined.
(no-undef)
[error] 390-390: 'JSX' is not defined.
(no-undef)
[error] 417-417: 'JSX' is not defined.
(no-undef)
src/components/EventCalender/Yearly/YearlyEventCalender.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)
[error] 139-139: 'JSX' is not defined.
(no-undef)
[error] 140-140: 'JSX' is not defined.
(no-undef)
src/components/EventManagement/Dashboard/EventDashboard.tsx
[error] 49-49: 'JSX' is not defined.
(no-undef)
🪛 Biome (1.9.4)
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/components/EventCalender/Monthly/EventCalender.tsx
[error] 299-303: 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/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/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)
🪛 GitHub Actions: PR Workflow
schema.graphql
[error] 1-1: Unauthorized change/delete detected for this file. To override, apply the 'ignore-sensitive-files-pr' label.
⏰ Context from checks skipped due to timeout of 90000ms (1)
- GitHub Check: Analyse Code With CodeQL (javascript)
🔇 Additional comments (14)
src/components/OrganizationScreen/OrganizationScreen.spec.tsx (1)
10-10
: Query import change is part of pagination migration.The import statement has been updated to use the new paginated query
GET_ORGANIZATION_EVENTS_PG
instead of the deprecatedORGANIZATION_EVENT_LIST
query, consistent with the changes in the implementation file.src/components/OrganizationScreen/OrganizationScreen.tsx (1)
71-71
: Query import updated for pagination.The import has been updated to use the new paginated query
GET_ORGANIZATION_EVENTS_PG
instead of the previousORGANIZATION_EVENT_LIST
query.src/components/EventListCard/EventListCard.tsx (2)
39-41
: Added JSDoc comment for the interface.Good addition of documentation for the
InterfaceEventListCard
interface which improves code readability and makes the purpose of the interface clear.
47-49
: Improved formatting for useTranslation hook.The formatting change for the
useTranslation
hook call improves readability by separating the namespace and keyPrefix parameters on different lines.src/components/EventListCard/EventListCardProps.ts (2)
19-19
: Recurrence-related properties removed.The removal of recurring event properties aligns with the broader refactoring to eliminate recurrence functionality throughout the codebase.
115-115
: Recurrence-related properties removed.The removal of recurring event properties in this event object is consistent with the codebase-wide effort to remove recurrence functionality.
src/components/EventCalender/Yearly/YearlyEventCalender.spec.tsx (1)
70-101
: Role strings inside mocks drift from newUserRole
enum
'MEMBER'
/'ADMIN'
literals will fail type-checking once those nodes are consumed.
Align with the enum to guarantee consistency:- role: 'MEMBER', + role: UserRole.REGULAR, ... - role: 'ADMIN', + role: UserRole.ADMINISTRATOR,(Don’t forget the import.)
src/screens/OrganizationEvents/OrganizationEventsMocks.ts (1)
75-86
: Great! variables now use the newinput
signature
No issues spotted here.src/components/EventManagement/Dashboard/EventDashboard.spec.tsx (1)
78-82
: Fragile time assertions – rely on semantic queries
toHaveTextContent('09:00')
will fail if localisation, leading zeros, or AM/PM formats change.
Consider asserting on a normalised value or querying the underlying date object instead of raw text.
Example:expect(dayjs(getByTestId('start-time').textContent).format('HH:mm')) .toBe('09:00')src/screens/OrganizationEvents/OrganizationEvents.spec.tsx (1)
310-325
: Manual modal handling indicates missing behaviour in the componentThe test forcibly closes the modal because “automatic closing may not happen”.
That means either:
- The component is missing a
onCompleted
handler → bug, or- The mock does not simulate the completion path correctly.
Investigate the root cause instead of patching the test; otherwise production code may leak the modal.
src/components/EventListCard/Modal/EventListCardModals.tsx (2)
175-183
: GraphQL variable name differs from backend specYou send
{ eventId }
, but the mutation shown inmutations.ts
expectsid
.
Confirm the server schema; mismatched names will result inVariable "$eventId" is not defined
errors.-variables: { eventId: eventListCardProps._id } +variables: { id: eventListCardProps._id }
170-174
:⚠️ Potential issue
some()
on possibly undefinedattendees
eventListCardProps?.attendees
is optional but later you assume it’s an array.
If the API stops sending this field the code will throw.const isInitiallyRegistered = (eventListCardProps.attendees ?? []).some(Likely an incorrect or invalid review comment.
src/GraphQl/Mutations/mutations.ts (1)
350-356
: Missing success indicator onDELETE_EVENT_MUTATION
The mutation returns only
id
; consumers cannot distinguish between “event not
found” and “deleted”. Consider returning a booleansuccess
or an
{ success, message }
payload like other mutations (RejectMembershipRequest
,
AcceptMembershipRequest
).schema.graphql (1)
260-289
: Review the refactoredEvent
type for nullability and schema consistency
You’ve unified date/time intostartAt
/endAt
and replaced flat lists with paginated connections (agendaFolders
,venues
). A few follow-ups:
allDay: Boolean
is now nullable—should this remain optional or be made non-nullable (Boolean!
) to avoid ambiguity?name: String
is nullable, but your create/update inputs requirename: String!
. Consider aligning field-level nullability with input requirements.- Verify that
EventAgendaFoldersConnection
andEventVenuesConnection
types are defined and that your resolvers correctly handle pagination args.- Ensure any deprecated fields (e.g., legacy
title
or recurrence-related fields) are fully removed to prevent confusion.
const { data: eventsData } = useQuery(GET_ORGANIZATION_EVENTS_PG, { | ||
variables: { id: orgId }, | ||
}); |
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.
Query migration incomplete - data structure mismatch.
While the query has been updated to use GET_ORGANIZATION_EVENTS_PG
, the code still expects the old data structure with eventsData.eventsByOrganization
. The new query returns data in a connection pattern with organization.events.edges
containing nodes of event data.
This will cause runtime errors. Update the usage like this:
const { data: eventsData } = useQuery(GET_ORGANIZATION_EVENTS_PG, {
variables: { id: orgId },
});
useEffect(() => {
- 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,
)?.node;
if (!event) {
console.warn(`Event with id ${eventId} not found`);
setEventName(null);
return;
}
- setEventName(event.title);
+ setEventName(event.name);
|
||
/** | ||
* Props for the EventListCard component. | ||
*/ | ||
interface InterfaceEventListCard extends InterfaceEvent { | ||
refetchEvents?: () => void; | ||
} | ||
|
||
function eventListCard(props: InterfaceEventListCard): JSX.Element { |
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.
ESLint error: 'JSX' is not defined.
The static analysis tool detected an undefined JSX type in the return type of the function.
This can be fixed by adding the correct import for React JSX types:
import React, { useState } from 'react';
+import type { JSX } from 'react';
import { useTranslation } from 'react-i18next';
Alternatively, you can use the React namespace:
-function eventListCard(props: InterfaceEventListCard): JSX.Element {
+function eventListCard(props: InterfaceEventListCard): React.JSX.Element {
📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
function eventListCard(props: InterfaceEventListCard): JSX.Element { | |
import React, { useState } from 'react'; | |
import type { JSX } from 'react'; | |
import { useTranslation } from 'react-i18next'; | |
// … | |
function eventListCard(props: InterfaceEventListCard): JSX.Element { | |
// existing implementation… | |
} |
function eventListCard(props: InterfaceEventListCard): JSX.Element { | |
import React, { useState } from 'react'; | |
import { useTranslation } from 'react-i18next'; | |
// … | |
function eventListCard(props: InterfaceEventListCard): React.JSX.Element { | |
// existing implementation… | |
} |
🧰 Tools
🪛 ESLint
[error] 46-46: 'JSX' is not defined.
(no-undef)
_id: 'event123', | ||
title: 'Test Event', | ||
id: 'event123', | ||
name: 'Test Event', | ||
description: 'Test Description', | ||
startDate: '2024-01-01', | ||
endDate: '2024-01-02', | ||
startAt: '2024-01-01T09:00:00Z', | ||
endAt: '2024-01-02T17:00:00Z', | ||
startTime: '09:00:00', | ||
endTime: '17:00:00', | ||
allDay: false, |
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.
💡 Verification agent
🧩 Analysis chain
Remove legacy / duplicated event-key fields to keep mocks aligned with the new schema
The mock now contains both legacy and new-schema keys (_id
and id
, startTime
/endTime
and startAt
/endAt
).
Keeping both increases cognitive load and risks silent test-only “green” paths that will never happen in production where only the new keys are returned.
_id: 'event123',
- id: 'event123',
- name: 'Test Event',
+ id: 'event123', // keep either _id OR id – not both
+ name: 'Test Event',
@@
- startAt: '2024-01-01T09:00:00Z',
- endAt: '2024-01-02T17:00:00Z',
- startTime: '09:00:00',
- endTime: '17:00:00',
+ startAt: '2024-01-01T09:00:00Z',
+ endAt: '2024-01-02T17:00:00Z',
allDay: false,
Do the same clean-up for MOCKS_WITHOUT_TIME
.
If the UI still expects startTime
/endTime
, consider deriving them inside the component instead of storing redundant data in the mocks.
Let’s pull in the actual mock contents to confirm exactly which fields exist and where they need cleanup:
🏁 Script executed:
#!/bin/bash
# Locate and display the first 200 lines of the EventDashboard mocks file
file=$(fd --type f 'EventDashboard.mocks.ts')
echo "Found mock file at: $file"
sed -n '1,200p' "$file"
Length of output: 2029
Clean up duplicated event keys in mocks
The mocks currently include both legacy and new-schema fields (_id
+ id
, startTime
/endTime
+ startAt
/endAt
), which doesn’t reflect production responses and can mask real bugs. Please update both MOCKS_WITH_TIME
and MOCKS_WITHOUT_TIME
in src/components/EventManagement/Dashboard/EventDashboard.mocks.ts
:
- Remove the
_id
properties and keep onlyid
. - Remove the redundant
startTime
/endTime
and rely onstartAt
/endAt
. - If the UI needs discrete time strings, derive them in the component rather than hard-coding them in mocks.
Proposed diffs:
--- a/src/components/EventManagement/Dashboard/EventDashboard.mocks.ts
+++ b/src/components/EventManagement/Dashboard/EventDashboard.mocks.ts
@@ export const MOCKS_WITH_TIME = [
- _id: 'event123',
id: 'event123',
@@
- startTime: '09:00:00',
- endTime: '17:00:00',
startAt: '2024-01-01T09:00:00Z',
endAt: '2024-01-02T17:00:00Z',
--- a/src/components/EventManagement/Dashboard/EventDashboard.mocks.ts
+++ b/src/components/EventManagement/Dashboard/EventDashboard.mocks.ts
@@ export const MOCKS_WITHOUT_TIME = [
- _id: 'event123',
id: 'event123',
@@
- startTime: null,
- endTime: null,
startAt: '2024-01-01T00:00:00Z',
endAt: '2024-01-02T00:00:00Z',
📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
_id: 'event123', | |
title: 'Test Event', | |
id: 'event123', | |
name: 'Test Event', | |
description: 'Test Description', | |
startDate: '2024-01-01', | |
endDate: '2024-01-02', | |
startAt: '2024-01-01T09:00:00Z', | |
endAt: '2024-01-02T17:00:00Z', | |
startTime: '09:00:00', | |
endTime: '17:00:00', | |
allDay: false, | |
// --- a/src/components/EventManagement/Dashboard/EventDashboard.mocks.ts | |
// +++ b/src/components/EventManagement/Dashboard/EventDashboard.mocks.ts | |
export const MOCKS_WITH_TIME = [ | |
{ | |
id: 'event123', | |
name: 'Test Event', | |
description: 'Test Description', | |
startAt: '2024-01-01T09:00:00Z', | |
endAt: '2024-01-02T17:00:00Z', | |
allDay: false, | |
}, | |
// …other mocks | |
]; | |
export const MOCKS_WITHOUT_TIME = [ | |
{ | |
id: 'event123', | |
name: 'Test Event', | |
description: 'Test Description', | |
startAt: '2024-01-01T00:00:00Z', | |
endAt: '2024-01-02T00:00:00Z', | |
allDay: false, | |
}, | |
// …other mocks | |
]; |
<Modal.Body>{t('deleteEventMsg')}</Modal.Body> | ||
<Modal.Footer> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧹 Nitpick (assertive)
Improve UX by referencing the event name in the confirmation message
A generic “deleteEventMsg” gives users no reassurance that they are deleting the intended record—especially now that the recurrence options are gone (there is no second prompt).
- <Modal.Body>{t('deleteEventMsg')}</Modal.Body>
+ <Modal.Body>
+ {t('deleteEventMsg', { name: eventListCardProps.name ?? eventListCardProps.title })}
+ </Modal.Body>
(Adjust the i18n key as needed.)
📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
<Modal.Body>{t('deleteEventMsg')}</Modal.Body> | |
<Modal.Footer> | |
<Modal.Body> | |
{t('deleteEventMsg', { name: eventListCardProps.name ?? eventListCardProps.title })} | |
</Modal.Body> | |
<Modal.Footer> |
import { BrowserRouter } from 'react-router-dom'; | ||
import { UserRole } from 'types/Event/interface'; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧹 Nitpick (assertive)
Missing ESLint env → it
/ describe
flagged as undefined
ESLint is complaining because the file is not in a recognised test environment.
Add the Vitest env header (or import the globals) to silence false positives:
+/* eslint-env vitest */
or
import { describe, it, expect, vi } from 'vitest';
const timezoneString = `UTC${new Date().getTimezoneOffset() > 0 ? '-' : '+'}${String( | ||
Math.floor(Math.abs(new Date().getTimezoneOffset()) / 60), | ||
).padStart( | ||
2, | ||
'0', | ||
)}:${String(Math.abs(new Date().getTimezoneOffset()) % 60).padStart(2, '0')}`; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧹 Nitpick (assertive)
Micro-optimisation: compute timezoneString
once, not on every render.
new Date()
plus formatting is executed on every render. Wrap it in useMemo
with an empty dependency array to avoid needless work:
- const timezoneString = `UTC${...}`;
+ const timezoneString = useMemo(() => {
+ const offset = new Date().getTimezoneOffset();
+ return `UTC${offset > 0 ? '-' : '+'}${String(Math.floor(Math.abs(offset) / 60)).padStart(2, '0')}:${String(Math.abs(offset) % 60).padStart(2, '0')}`;
+ }, []);
📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
const timezoneString = `UTC${new Date().getTimezoneOffset() > 0 ? '-' : '+'}${String( | |
Math.floor(Math.abs(new Date().getTimezoneOffset()) / 60), | |
).padStart( | |
2, | |
'0', | |
)}:${String(Math.abs(new Date().getTimezoneOffset()) % 60).padStart(2, '0')}`; | |
const timezoneString = useMemo(() => { | |
const offset = new Date().getTimezoneOffset(); | |
return `UTC${offset > 0 ? '-' : '+'}${String(Math.floor(Math.abs(offset) / 60)).padStart(2, '0')}:${String(Math.abs(offset) % 60).padStart(2, '0')}`; | |
}, []); |
input MutationCreateEventInput { | ||
allDay: Boolean! | ||
attachments: [Upload!] | ||
description: String | ||
endAt: DateTime! | ||
isPublic: Boolean | ||
isRegisterable: Boolean | ||
location: String | ||
name: String! | ||
organizationId: ID! | ||
startAt: DateTime! | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧹 Nitpick (assertive)
Harden MutationCreateEventInput
nullability & defaults
Your new input is well scoped, but consider tightening:
- Should optional booleans (
isPublic
,isRegisterable
) default tofalse
? If so, declare asBoolean!
with default value. attachments: [Upload!]
is required—do you intend to always receive >0 uploads? If optional, wrap inattachments: [Upload!]
and handle empty lists gracefully.- To prevent client confusion, add descriptions or default directives.
@@ -862,7 +862,7 @@ | |||
input: UpdateAgendaCategoryInput! | |||
): AgendaCategory | |||
updateCurrentUser(input: MutationUpdateCurrentUserInput!): UserPg | |||
updateEvent(data: UpdateEventInput, id: ID!): Event! | |||
updateEvent(data: MutationUpdateEventInput, id: ID!): Event! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧹 Nitpick (assertive)
Consolidate/update the updateEvent
argument pattern
Currently:
updateEvent(data: MutationUpdateEventInput, id: ID!): Event!
Recommendations:
- Flip to use a single input named
input
to mirrorcreateEvent
, e.g.:updateEvent(input: MutationUpdateEventInput!): Event!
- At minimum, make
data: MutationUpdateEventInput!
non-nullable for clarity.
This will improve consistency across your mutations.
input MutationUpdateEventInput { | ||
id: ID! | ||
name: String | ||
description: String | ||
startAt: DateTime | ||
endAt: DateTime | ||
allDay: Boolean | ||
location: String | ||
isPublic: Boolean | ||
isRegisterable: Boolean | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧹 Nitpick (assertive)
Extend MutationUpdateEventInput
to match feature set or simplify
Your update input covers core event fields, but:
- If attachments can be modified, you may want
attachments: [Upload!]
here too. - The field
name
differs from the oldtitle
—ensure this naming is consistent across all types/queries. - Consider renaming the argument to
input: MutationUpdateEventInput!
per mutation convention. - Ensure
id: ID!
is the first or only non-input field if you keep dual-arg style.
data: EventInput! | ||
recurrenceRuleData: RecurrenceRuleInput | ||
): Event! | ||
createEvent(input: MutationCreateEventInput!): Event |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧹 Nitpick (assertive)
Ensure createEvent
return type is non-nullable
The mutation signature now accepts a single input object—which is great for future extensibility—but the return type is Event
(nullable). For consistency with other create mutations (e.g., createVenue: Venue!
), consider changing to:
-createEvent(input: MutationCreateEventInput!): Event
+createEvent(input: MutationCreateEventInput!): Event!
📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
createEvent(input: MutationCreateEventInput!): Event | |
createEvent(input: MutationCreateEventInput!): Event! |
Please fix the linting |
This pull request did not get any activity in the past 10 days and will be closed in 180 days if no update occurs. Please verify it has no conflicts with the develop branch and rebase if needed. Mention it now if you need help or give permission to other people to finish your work. |
@gautam-divyanshu Are you still working on this? |
|
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?
Checklist
CodeRabbit AI Review
Test Coverage
Other information
Have you read the contributing guide?
Summary by CodeRabbit
New Features
Bug Fixes
Refactor
Chores
Documentation