Skip to content

#4198 export single calendar meeting#4201

Open
glickgNU wants to merge 5 commits into
developfrom
#4198-export-single-calendar-meeting
Open

#4198 export single calendar meeting#4201
glickgNU wants to merge 5 commits into
developfrom
#4198-export-single-calendar-meeting

Conversation

@glickgNU
Copy link
Copy Markdown
Contributor

@glickgNU glickgNU commented May 11, 2026

Changes

Added a button to the event modal in the calendar. This button creates a link to an exportable iCalendar with this event that is copied to clipboard. A message appears that this has been done to indicate this.

Notes

If the event is a recurring event, all events that are a part of this recurring will be added to the calendar.
This button is accessible to all members regardless of role, unlike edit or delete buttons.

Test Cases

  • Clicking the button on an unrecurring event will create a link to an iCalendar that only has this event.
  • Clicking the button on a recurring event will create a link to an iCalendar that has this event and any other event that is a part of this recurrence.
  • Both previous cases work with newly created events.

Screenshots

An event opened for someone in a leadership role:
Normal sized window:
image

Smallest possible window (that event is still visible):
image

An event copied to clipboard:
Normal sized window:
image

Smallest possible window (that event is still visible):
image

An event copied to clipboard for someone in member role:
Normal sized window:
image

Smallest possible window (that event is still visible):
image

Checklist

It can be helpful to check the Checks and Files changed tabs.
Please review the contributor guide and reach out to your Tech Lead if anything is unclear.
Please request reviewers and ping on slack only after you've gone through this whole checklist.

  • All commits are tagged with the ticket number
  • No linting errors / newline at end of file warnings
  • All code follows repository-configured prettier formatting
  • No merge conflicts
  • All checks passing
  • Screenshots of UI changes (see Screenshots section)
  • Remove any non-applicable sections of this template
  • Assign the PR to yourself
  • No yarn.lock changes (unless dependencies have changed)
  • Request reviewers & ping on Slack
  • PR is linked to the ticket (fill in the closes line below)

Closes #4198

Copy link
Copy Markdown
Contributor

@staysgt staysgt left a comment

Choose a reason for hiding this comment

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

Overall looks good and functionality worked, just left some comments on the code!

const [showSeriesDeleteModal, setShowSeriesDeleteModal] = useState(false);
const [selectedEvent, setSelectedEvent] = useState<EventInstance | null>(null);
const { data: tokenData } = useGetIcsToken();
const [, setCopied] = useState(false);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This can be removed, its not doing anything

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

These are needed for handleExport to work

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The setCopied useState can still be removed as well as its references in the handle export. In handle export, the only thing that its doing is setting a state value that is never read anywhere, since there was never a "copied" value destructured from the useState

Comment thread src/frontend/src/pages/CalendarPage/EventClickPopup.tsx
const [showSeriesDeleteModal, setShowSeriesDeleteModal] = useState(false);

const { data: tokenData } = useGetIcsToken();
const [, setCopied] = useState(false);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Again as above, this can be removed

Comment thread src/frontend/src/pages/CalendarPage/CalendarWeekView.tsx
Comment thread src/frontend/src/pages/CalendarPage/CalendarWeekView.tsx
Comment thread src/frontend/src/pages/CalendarPage/CalendarWeekView.tsx
@glickgNU
Copy link
Copy Markdown
Contributor Author

I implemented your suggested changes except for each instance of const { data: tokenData } = useGetIcsToken(); and const [, setCopied] = useState(false); . I decided to keep this due to needing to be used in handleExport.

Copy link
Copy Markdown
Contributor

@staysgt staysgt left a comment

Choose a reason for hiding this comment

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

Just some small things, looks really good!

const [showSeriesDeleteModal, setShowSeriesDeleteModal] = useState(false);
const [selectedEvent, setSelectedEvent] = useState<EventInstance | null>(null);
const { data: tokenData } = useGetIcsToken();
const [, setCopied] = useState(false);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The setCopied useState can still be removed as well as its references in the handle export. In handle export, the only thing that its doing is setting a state value that is never read anywhere, since there was never a "copied" value destructured from the useState

Comment thread src/frontend/src/pages/CalendarPage/CalendarDayCard.tsx Outdated
Comment thread src/frontend/src/pages/CalendarPage/CalendarDayCard.tsx
Comment thread src/frontend/src/pages/CalendarPage/CalendarDayCard.tsx
Comment thread src/frontend/src/pages/CalendarPage/CalendarDayCard.tsx
Comment thread src/frontend/src/pages/CalendarPage/CalendarWeekView.tsx Outdated
Comment thread src/frontend/src/pages/CalendarPage/CalendarWeekView.tsx
Comment thread src/frontend/src/pages/CalendarPage/CalendarWeekView.tsx
Comment thread src/frontend/src/pages/CalendarPage/CalendarWeekView.tsx
@glickgNU
Copy link
Copy Markdown
Contributor Author

Ok, I updated again. For const { data: tokenData } = useGetIcsToken(); and const [, setCopied] = useState(false);, I got rid of the latter line, but I kept the former. I am not sure if you want me to also remove/edit that line too, I tried to put it in handleExport, but since its a hook, it causes issues.

Copy link
Copy Markdown
Contributor

@staysgt staysgt left a comment

Choose a reason for hiding this comment

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

Good work!

@staysgt staysgt requested a review from wavehassman May 14, 2026 22:15
Copy link
Copy Markdown
Contributor

@wavehassman wavehassman left a comment

Choose a reason for hiding this comment

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

Great job! Just a couple changes

const events = await prisma.event.findMany({
where: {
dateDeleted: null,
eventId: { in: eventIds }
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

add an organization check

}
};

const handleExport = (event: EventInstance) => {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Instead of having handleExport and the hook 3 times, remove onExport from EventClickContentProps, move useGetIcsToken into EventClickContent, and put handleExport directly in EventClickContent. That was the logic is directly in EventClickContent and we avoid prop drilling

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.

[Maintenance] - Export Single Calendar Meeting

3 participants