-
-
Notifications
You must be signed in to change notification settings - Fork 360
feat: warn when calendar or calendar event wasn't created #2371
feat: warn when calendar or calendar event wasn't created #2371
Conversation
Hey @gikf, I like the Warning that the Chapter does not have a calendar seems good. People may forget to authenticate with Google, after all. Also, only instance owners will see this warning and it's reasonable to expect them to have understand how Chapter works. However, I'm not sure the warning 'Calendar event was not created.' is appropriate unless there's a calendar. If someone chooses not to make use of the integration (due to rate limits, say, #2373) then showing warnings on every event creation is likely to make people think something has gone wrong with Chapter. If that makes sense, I think the simplest implementation would be to pull |
Co-authored-by: Oliver Eyton-Williams <[email protected]>
Good ideas @ojeytonwilliams! |
let hasChapterCalendar = chapterData?.dashboardChapter.has_calendar; | ||
if (chapter_id !== chapterId) { | ||
const { data: currentChapter } = await refetch({ | ||
chapterId: chapter_id, | ||
}); | ||
hasChapterCalendar = currentChapter.dashboardChapter.has_calendar; | ||
} |
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.
The fact this is necessary, got me to thinking: why not use the same source of truth for chapter name when on dashboard/chapters/[id]/new-event
and dashboard/events/new
? Namely admined_chapters
.
Reason being, we only care about three things: id
, name
and has_calendar
. If admined_chapters
gets has_calendar
we don't need to make (let alone pass around) an additional query. As a side benefit, it should be possible to simplify NewEventPage
a little.
What do you reckon?
Co-authored-by: Oliver Eyton-Williams <[email protected]>
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.
Sorry for the delay getting to this, @gikf
Everything looks great, though, cheers!
Update README.md
).main
branch of Chapter.has_calendar_event
customFieldResolver
onEvent
graphql-type.