TF-3793 Hide warning message when use is organizer
Signed-off-by: dab246 <tdvu@linagora.com>
This commit is contained in:
@@ -383,21 +383,31 @@ extension CalendarEventExtension on CalendarEvent {
|
|||||||
return [];
|
return [];
|
||||||
}
|
}
|
||||||
|
|
||||||
bool isDisplayedEventReplyAction(String ownerEmailAddress) => method != null
|
bool isDisplayedEventReplyAction(String ownerEmailAddress) =>
|
||||||
&& _methodIsRepliable
|
method != null &&
|
||||||
&& organizer != null
|
_methodIsRepliable &&
|
||||||
&& participants?.isNotEmpty == true
|
organizer != null &&
|
||||||
&& !validateUserIsNotListedInParticipants(ownerEmailAddress);
|
participants?.isNotEmpty == true &&
|
||||||
|
userIsListedInParticipants(ownerEmailAddress);
|
||||||
|
|
||||||
bool get _methodIsRepliable =>
|
bool get _methodIsRepliable =>
|
||||||
method == EventMethod.request ||
|
method == EventMethod.request ||
|
||||||
method == EventMethod.add ||
|
method == EventMethod.add ||
|
||||||
method == EventMethod.counter;
|
method == EventMethod.counter;
|
||||||
|
|
||||||
bool validateUserIsNotListedInParticipants(String ownEmailAddress) {
|
bool userIsListedInParticipants(String ownEmailAddress) {
|
||||||
final participant = participants?.firstWhereOrNull((participant) =>
|
final participant = participants?.firstWhereOrNull((participant) =>
|
||||||
participant.mailto?.mailAddress.value == ownEmailAddress);
|
participant.mailto?.mailAddress.value == ownEmailAddress);
|
||||||
return participant == null;
|
return participant != null;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool userIsOrganizer(String ownEmailAddress) {
|
||||||
|
return organizer?.mailto?.value == ownEmailAddress;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool isDisplayedWarningMessage(String ownerEmailAddress) {
|
||||||
|
return !userIsListedInParticipants(ownerEmailAddress) &&
|
||||||
|
!userIsOrganizer(ownerEmailAddress);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool get isDisplayedMailToAttendees =>
|
bool get isDisplayedMailToAttendees =>
|
||||||
|
|||||||
+1
-3
@@ -149,9 +149,7 @@ class CalendarEventInformationWidget extends StatelessWidget {
|
|||||||
openEmailAddressDetailAction: openEmailAddressDetailAction,
|
openEmailAddressDetailAction: openEmailAddressDetailAction,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
if (calendarEvent.validateUserIsNotListedInParticipants(
|
if (calendarEvent.isDisplayedWarningMessage(ownEmailAddress))
|
||||||
ownEmailAddress,
|
|
||||||
))
|
|
||||||
Padding(
|
Padding(
|
||||||
padding: EdgeInsetsDirectional.only(
|
padding: EdgeInsetsDirectional.only(
|
||||||
top: CalendarEventInformationWidgetStyles.fieldTopPadding,
|
top: CalendarEventInformationWidgetStyles.fieldTopPadding,
|
||||||
|
|||||||
Reference in New Issue
Block a user