#4198 export single calendar meeting#4201
Conversation
staysgt
left a comment
There was a problem hiding this comment.
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); |
There was a problem hiding this comment.
This can be removed, its not doing anything
There was a problem hiding this comment.
These are needed for handleExport to work
There was a problem hiding this comment.
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
| const [showSeriesDeleteModal, setShowSeriesDeleteModal] = useState(false); | ||
|
|
||
| const { data: tokenData } = useGetIcsToken(); | ||
| const [, setCopied] = useState(false); |
There was a problem hiding this comment.
Again as above, this can be removed
|
I implemented your suggested changes except for each instance of |
staysgt
left a comment
There was a problem hiding this comment.
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); |
There was a problem hiding this comment.
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
|
Ok, I updated again. For |
wavehassman
left a comment
There was a problem hiding this comment.
Great job! Just a couple changes
| const events = await prisma.event.findMany({ | ||
| where: { | ||
| dateDeleted: null, | ||
| eventId: { in: eventIds } |
There was a problem hiding this comment.
add an organization check
| } | ||
| }; | ||
|
|
||
| const handleExport = (event: EventInstance) => { |
There was a problem hiding this comment.
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
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
Screenshots
An event opened for someone in a leadership role:

Normal sized window:
Smallest possible window (that event is still visible):

An event copied to clipboard:

Normal sized window:
Smallest possible window (that event is still visible):

An event copied to clipboard for someone in member role:

Normal sized window:
Smallest possible window (that event is still visible):

Checklist
It can be helpful to check the
ChecksandFiles changedtabs.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.
yarn.lockchanges (unless dependencies have changed)Closes #4198