TF-2907 Disable YES/NO/MAYBE action for events when missing METHOD/ORGANIZER/ATTENDEES

This commit is contained in:
dab246
2024-06-07 17:06:40 +07:00
committed by Dat H. Pham
parent e27a696886
commit 3aabee59da
3 changed files with 33 additions and 26 deletions
@@ -356,4 +356,8 @@ extension CalendarEventExtension on CalendarEvent {
} }
return []; return [];
} }
bool get isDisplayedEventReplyAction => method != null
&& organizer != null
&& participants?.isNotEmpty == true;
} }
@@ -101,15 +101,16 @@ class CalendarEventDetailWidget extends StatelessWidget {
organizer: calendarEvent.organizer!, organizer: calendarEvent.organizer!,
), ),
), ),
CalendarEventActionButtonWidget( if (calendarEvent.isDisplayedEventReplyAction)
onCalendarEventReplyActionClick: onCalendarEventReplyActionClick, CalendarEventActionButtonWidget(
calendarEventReplying: calendarEventReplying, onCalendarEventReplyActionClick: onCalendarEventReplyActionClick,
presentationEmail: presentationEmail, calendarEventReplying: calendarEventReplying,
onMailToAttendeesAction: () => onMailtoAttendeesAction?.call( presentationEmail: presentationEmail,
calendarEvent.organizer, onMailToAttendeesAction: () => onMailtoAttendeesAction?.call(
calendarEvent.participants, calendarEvent.organizer,
calendarEvent.participants,
),
), ),
),
], ],
), ),
); );
@@ -120,16 +120,17 @@ class CalendarEventInformationWidget extends StatelessWidget {
organizer: calendarEvent.organizer!, organizer: calendarEvent.organizer!,
), ),
), ),
CalendarEventActionButtonWidget( if (calendarEvent.isDisplayedEventReplyAction)
margin: EdgeInsetsDirectional.zero, CalendarEventActionButtonWidget(
onCalendarEventReplyActionClick: onCalendarEventReplyActionClick, margin: EdgeInsetsDirectional.zero,
calendarEventReplying: calendarEventReplying, onCalendarEventReplyActionClick: onCalendarEventReplyActionClick,
presentationEmail: presentationEmail, calendarEventReplying: calendarEventReplying,
onMailToAttendeesAction: () => onMailtoAttendeesAction?.call( presentationEmail: presentationEmail,
calendarEvent.organizer, onMailToAttendeesAction: () => onMailtoAttendeesAction?.call(
calendarEvent.participants, calendarEvent.organizer,
calendarEvent.participants,
),
), ),
),
], ],
), ),
) )
@@ -195,16 +196,17 @@ class CalendarEventInformationWidget extends StatelessWidget {
organizer: calendarEvent.organizer!, organizer: calendarEvent.organizer!,
), ),
), ),
CalendarEventActionButtonWidget( if (calendarEvent.isDisplayedEventReplyAction)
margin: EdgeInsetsDirectional.zero, CalendarEventActionButtonWidget(
onCalendarEventReplyActionClick: onCalendarEventReplyActionClick, margin: EdgeInsetsDirectional.zero,
calendarEventReplying: calendarEventReplying, onCalendarEventReplyActionClick: onCalendarEventReplyActionClick,
presentationEmail: presentationEmail, calendarEventReplying: calendarEventReplying,
onMailToAttendeesAction: () => onMailtoAttendeesAction?.call( presentationEmail: presentationEmail,
calendarEvent.organizer, onMailToAttendeesAction: () => onMailtoAttendeesAction?.call(
calendarEvent.participants, calendarEvent.organizer,
calendarEvent.participants,
),
), ),
),
], ],
), ),
)) ))