diff --git a/lib/features/email/presentation/email_view.dart b/lib/features/email/presentation/email_view.dart index f509c7799..8f83fde7d 100644 --- a/lib/features/email/presentation/email_view.dart +++ b/lib/features/email/presentation/email_view.dart @@ -304,6 +304,7 @@ class EmailView extends GetWidget { children: [ Obx(() => CalendarEventInformationWidget( calendarEvent: calendarEvent, + imagePaths: controller.imagePaths, onOpenComposerAction: controller.openNewComposerAction, onOpenNewTabAction: controller.openNewTabAction, onCalendarEventReplyActionClick: (eventActionType) => diff --git a/lib/features/email/presentation/widgets/calendar_event/calendar_event_information_widget.dart b/lib/features/email/presentation/widgets/calendar_event/calendar_event_information_widget.dart index 0fa8cd6ec..aba5a5de7 100644 --- a/lib/features/email/presentation/widgets/calendar_event/calendar_event_information_widget.dart +++ b/lib/features/email/presentation/widgets/calendar_event/calendar_event_information_widget.dart @@ -1,4 +1,5 @@ import 'package:core/presentation/extensions/color_extension.dart'; +import 'package:core/presentation/resources/image_paths.dart'; import 'package:core/presentation/utils/theme_utils.dart'; import 'package:flutter/material.dart'; import 'package:jmap_dart_client/jmap/mail/calendar/calendar_event.dart'; @@ -24,6 +25,7 @@ typedef OnOpenComposerAction = void Function(String emailAddress); class CalendarEventInformationWidget extends StatelessWidget { final CalendarEvent calendarEvent; + final ImagePaths imagePaths; final OnOpenNewTabAction? onOpenNewTabAction; final OnOpenComposerAction? onOpenComposerAction; final OnCalendarEventReplyActionClick onCalendarEventReplyActionClick; @@ -39,6 +41,7 @@ class CalendarEventInformationWidget extends StatelessWidget { const CalendarEventInformationWidget({ super.key, required this.calendarEvent, + required this.imagePaths, required this.onCalendarEventReplyActionClick, required this.calendarEventReplying, required this.isFreeBusyEnabled, @@ -96,7 +99,11 @@ class CalendarEventInformationWidget extends StatelessWidget { ), children: [ TextSpan( - text: calendarEvent.organizerName, + text: calendarEvent.getUserNameEventAction( + context: context, + imagePaths: imagePaths, + listEmailAddressSender: listEmailAddressSender, + ), style: ThemeUtils.defaultTextStyleInterFont.copyWith( color: CalendarEventInformationWidgetStyles .invitationMessageColor, diff --git a/test/features/email/presentation/widgets/calendar_event/calendar_event_information_widget_test.dart b/test/features/email/presentation/widgets/calendar_event/calendar_event_information_widget_test.dart index 2f555d316..fbdab1a47 100644 --- a/test/features/email/presentation/widgets/calendar_event/calendar_event_information_widget_test.dart +++ b/test/features/email/presentation/widgets/calendar_event/calendar_event_information_widget_test.dart @@ -1,3 +1,4 @@ +import 'package:core/presentation/resources/image_paths.dart'; import 'package:flutter/material.dart'; import 'package:flutter_test/flutter_test.dart'; import 'package:jmap_dart_client/jmap/mail/calendar/calendar_event.dart'; @@ -12,6 +13,8 @@ import '../../../../../fixtures/widget_fixtures.dart'; void main() { group('CalendarEventInformationWidget::', () { + final imagePaths = ImagePaths(); + testWidgets( 'Should show warning message\n' 'when user is not in the participants\n' @@ -36,6 +39,7 @@ void main() { child: Scaffold( body: CalendarEventInformationWidget( calendarEvent: calendarEvent, + imagePaths: imagePaths, onCalendarEventReplyActionClick: (_) {}, calendarEventReplying: false, isFreeBusyEnabled: false, @@ -79,6 +83,7 @@ void main() { child: Scaffold( body: CalendarEventInformationWidget( calendarEvent: calendarEvent, + imagePaths: imagePaths, onCalendarEventReplyActionClick: (_) {}, calendarEventReplying: false, isFreeBusyEnabled: false, @@ -119,6 +124,7 @@ void main() { child: Scaffold( body: CalendarEventInformationWidget( calendarEvent: calendarEvent, + imagePaths: imagePaths, onCalendarEventReplyActionClick: (_) {}, calendarEventReplying: false, isFreeBusyEnabled: false,