Skip to content

feat: updated the dj evening event #73

Open
kanchan0505 wants to merge 4 commits into
NexEvent:mainfrom
kanchan0505:main
Open

feat: updated the dj evening event #73
kanchan0505 wants to merge 4 commits into
NexEvent:mainfrom
kanchan0505:main

Conversation

@kanchan0505
Copy link
Copy Markdown
Collaborator

@kanchan0505 kanchan0505 commented Apr 7, 2026

Summary by CodeRabbit

  • New Features
    • Shows "Passes will be sold offline" beneath specific event titles to inform users about offline ticket availability.
  • Changes
    • Removed the DJ highlight section from the Home page.
    • Minor adjustment to the "View Details" button label rendering.

Copilot AI review requested due to automatic review settings April 7, 2026 18:00
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 7, 2026

Warning

Rate limit exceeded

@kanchan0505 has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 15 minutes and 39 seconds before requesting another review.

Your organization is not enrolled in usage-based pricing. Contact your admin to enable usage-based pricing to continue reviews beyond the rate limit, or try again in 15 minutes and 39 seconds.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 476518b6-a3bc-4ef2-81a4-155f0aa0c2df

📥 Commits

Reviewing files that changed from the base of the PR and between dd68c2e and c1e08ba.

📒 Files selected for processing (1)
  • src/views/home/DJHighlightSection.js
📝 Walkthrough

Walkthrough

DJHighlightSection now queries events by an encoded name (DJ_EVENT_NAME) instead of departmentId, shows “Passes will be sold offline” when the event name matches, and adds a trailing space to the "View Details " button text. The Home page no longer imports or renders DJHighlightSection.

Changes

Cohort / File(s) Summary
Event Query & UI Updates
src/views/home/DJHighlightSection.js
Switched API query parameter from departmentId to encoded name (DJ_EVENT_NAME); conditionally render “Passes will be sold offline” when event?.name === DJ_EVENT_NAME; appended trailing space to "View Details " button text.
Home Page Removal
src/pages/index.js
Removed DJHighlightSection import and its JSX rendering from the Home page, removing the section from the public homepage.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Suggested reviewers

  • Bhav-ikkk

Poem

🐇 I hopped through code with nimble feet,
Swapped an ID for a name so neat,
If the DJ's name rings true and clear,
A note appears for passes here. 🎶
Hooray — one space at the end, my dear!

🚥 Pre-merge checks | ✅ 1 | ❌ 2

❌ Failed checks (1 warning, 1 inconclusive)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Title check ❓ Inconclusive The title 'updated the dj evening event' is vague and generic, using non-descriptive language that doesn't convey the specific nature of the changes made to the codebase. Revise the title to be more specific and descriptive of the actual changes, such as 'feat: change DJ event query from departmentId to name and hide section from home page' or similar.
✅ Passed checks (1 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates the Home “DJ Evening” highlight card to target a specific DJ event and display an offline-sales notice for that event.

Changes:

  • Switches event fetching from department-based filtering to a hardcoded event name query.
  • Adds a conditional caption (“Passes will be sold offline”) when the highlighted event matches the configured DJ event name.
  • Minor UI text change in the CTA button label.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/views/home/DJHighlightSection.js Outdated
Comment on lines 34 to 36
axios
.get(`/api/events?departmentId=${DJ_DEPARTMENT_ID}&limit=1`)
.get(`/api/events?name=${encodeURIComponent(DJ_EVENT_NAME)}&limit=1`)
.then(res => {
Copy link

Copilot AI Apr 7, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/api/events does not support a name query parameter; the public handler only reads categoryId, departmentId, search, sort, page, and limit. As written, this request will behave like “no filters” and may return an unrelated event (or none, depending on ordering). Use the existing search parameter (e.g., search=DJ EVEONICS) and then select the correct event client-side, or add explicit name filtering support in the API/service layer.

Copilot uses AI. Check for mistakes.
Comment thread src/views/home/DJHighlightSection.js Outdated
}}
>
View Details
View Details
Copy link

Copilot AI Apr 7, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The button label has a trailing whitespace ('View Details '), which will get committed into the UI text and can cause snapshot/test diffs and inconsistent rendering. Remove the extra space.

Suggested change
View Details
View Details

Copilot uses AI. Check for mistakes.
Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a 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

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
src/views/home/DJHighlightSection.js (1)

35-40: ⚠️ Potential issue | 🔴 Critical

Unsupported name query parameter breaks DJ event selection.

Line 35 calls /api/events?name=..., but src/pages/api/events/index.js (Lines 24-70 in the provided snippet) does not parse or forward a name param. This makes the result non-targeted, and with limit=1 you can render the wrong event.

Suggested fix (align with current API contract)
-      .get(`/api/events?name=${encodeURIComponent(DJ_EVENT_NAME)}&limit=1`)
+      .get(`/api/events?search=${encodeURIComponent(DJ_EVENT_NAME)}&limit=10`)
       .then(res => {
         if (cancelled) return
         const events = res.data?.data || []
-        if (events.length > 0) setEvent(events[0])
+        const djEvent = events.find(e => (e.title || '').trim() === DJ_EVENT_NAME)
+        if (djEvent) setEvent(djEvent)
       })
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/views/home/DJHighlightSection.js` around lines 35 - 40, The GET request
in DJHighlightSection.js uses a unsupported name query param so replace the
targeted server-side query with client-side filtering: call
/api/events?limit=... without the name param (keep encodeURIComponent removed),
then in the .then handler use the DJ_EVENT_NAME constant to find the matching
event from res.data.data (e.g. events.find(e => e.name === DJ_EVENT_NAME))
before calling setEvent; preserve the cancelled guard and existing limit
behavior and update the variable references (events, setEvent, DJ_EVENT_NAME)
accordingly.
🧹 Nitpick comments (1)
src/views/home/DJHighlightSection.js (1)

223-223: Remove trailing space in button label.

Line 223 includes an unnecessary trailing space in "View Details ".

Suggested cleanup
-                  View Details 
+                  View Details
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/views/home/DJHighlightSection.js` at line 223, In the DJHighlightSection
component, remove the trailing space in the button label string ("View Details
") so it becomes "View Details"; locate the JSX element that renders the button
(the element containing the "View Details " text on line with that label) and
update the literal to drop the extra whitespace, ensuring any surrounding
concatenation or template usage also doesn't reintroduce the space.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@src/views/home/DJHighlightSection.js`:
- Around line 188-200: The condition is checking event?.name but the service
maps e.name to title, so DJ_EVENT_NAME will never match; update the conditional
in the JSX that renders the offline-pass caption to use the normalized title
field (e.g., event?.title) or a fallback (event?.name || event?.title) so the
check against DJ_EVENT_NAME succeeds; adjust the conditional where DJ_EVENT_NAME
is used and any related references in the DJHighlightSection component to rely
on the normalized title property.

---

Outside diff comments:
In `@src/views/home/DJHighlightSection.js`:
- Around line 35-40: The GET request in DJHighlightSection.js uses a unsupported
name query param so replace the targeted server-side query with client-side
filtering: call /api/events?limit=... without the name param (keep
encodeURIComponent removed), then in the .then handler use the DJ_EVENT_NAME
constant to find the matching event from res.data.data (e.g. events.find(e =>
e.name === DJ_EVENT_NAME)) before calling setEvent; preserve the cancelled guard
and existing limit behavior and update the variable references (events,
setEvent, DJ_EVENT_NAME) accordingly.

---

Nitpick comments:
In `@src/views/home/DJHighlightSection.js`:
- Line 223: In the DJHighlightSection component, remove the trailing space in
the button label string ("View Details ") so it becomes "View Details"; locate
the JSX element that renders the button (the element containing the "View
Details " text on line with that label) and update the literal to drop the extra
whitespace, ensuring any surrounding concatenation or template usage also
doesn't reintroduce the space.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 4c7f3dc8-1b76-4afb-807c-7860e6ca508e

📥 Commits

Reviewing files that changed from the base of the PR and between 24e54a3 and ef55bef.

📒 Files selected for processing (1)
  • src/views/home/DJHighlightSection.js

Comment thread src/views/home/DJHighlightSection.js Outdated
Comment on lines +188 to +200
{event?.name === DJ_EVENT_NAME && (
<Typography
variant='caption'
sx={{
color: alpha(accent, 0.7),
fontWeight: 600,
fontSize: '0.8rem',
letterSpacing: '0.5px'
}}
>
Passes will be sold offline
</Typography>
)}
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

event?.name condition never matches current API payload shape.

src/services/event-service.js selects e.name AS title, so event?.name is not populated. At Line 188 this prevents the offline-pass caption from rendering even when the DJ event is fetched.

Suggested fix (use a single normalized title field)
+  const eventTitle = event?.title || event?.name || 'DJ Evening'
...
-                alt={event?.name || 'DJ Evening'}
+                alt={eventTitle}
...
-                  {event?.name || 'DJ Evening'}
+                  {eventTitle}
...
-                {event?.name === DJ_EVENT_NAME && (
+                {eventTitle === DJ_EVENT_NAME && (
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/views/home/DJHighlightSection.js` around lines 188 - 200, The condition
is checking event?.name but the service maps e.name to title, so DJ_EVENT_NAME
will never match; update the conditional in the JSX that renders the
offline-pass caption to use the normalized title field (e.g., event?.title) or a
fallback (event?.name || event?.title) so the check against DJ_EVENT_NAME
succeeds; adjust the conditional where DJ_EVENT_NAME is used and any related
references in the DJHighlightSection component to rely on the normalized title
property.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants