TF-2351 Fix missing body when read mail with ics attachment
Signed-off-by: dab246 <tdvu@linagora.com> (cherry picked from commit 521a10ee9b857b916cc1ce7eec38d4afe8a8020a)
This commit is contained in:
@@ -128,6 +128,8 @@ class SingleEmailController extends BaseController with AppLoaderMixin {
|
|||||||
|
|
||||||
PresentationEmail? get currentEmail => mailboxDashBoardController.selectedEmail.value;
|
PresentationEmail? get currentEmail => mailboxDashBoardController.selectedEmail.value;
|
||||||
|
|
||||||
|
EmailLoaded? get currentEmailLoaded => _currentEmailLoaded;
|
||||||
|
|
||||||
SingleEmailController(
|
SingleEmailController(
|
||||||
this._getEmailContentInteractor,
|
this._getEmailContentInteractor,
|
||||||
this._markAsEmailReadInteractor,
|
this._markAsEmailReadInteractor,
|
||||||
|
|||||||
@@ -355,8 +355,11 @@ class EmailView extends GetWidget<SingleEmailController> {
|
|||||||
CalendarEventDetailWidget(
|
CalendarEventDetailWidget(
|
||||||
calendarEvent: calendarEvent,
|
calendarEvent: calendarEvent,
|
||||||
eventActions: controller.eventActions,
|
eventActions: controller.eventActions,
|
||||||
|
emailContent: controller.currentEmailLoaded?.htmlContent ?? '',
|
||||||
|
isDraggableAppActive: controller.mailboxDashBoardController.isDraggableAppActive,
|
||||||
onOpenComposerAction: controller.openNewComposerAction,
|
onOpenComposerAction: controller.openNewComposerAction,
|
||||||
onOpenNewTabAction: controller.openNewTabAction,
|
onOpenNewTabAction: controller.openNewTabAction,
|
||||||
|
onMailtoDelegateAction: controller.openMailToLink,
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -3,7 +3,11 @@ import 'package:flutter/material.dart';
|
|||||||
|
|
||||||
class EventDescriptionDetailWidgetStyles {
|
class EventDescriptionDetailWidgetStyles {
|
||||||
static const double textSize = 16;
|
static const double textSize = 16;
|
||||||
|
static const double maxHeight = 200;
|
||||||
static const double borderRadius = 16;
|
static const double borderRadius = 16;
|
||||||
static const double contentPadding = 16;
|
static const double contentPadding = 16;
|
||||||
|
static const double quotedPadding = 8;
|
||||||
|
static const double webContentPadding = 4;
|
||||||
|
|
||||||
static const Color valueColor = Colors.black;
|
static const Color valueColor = Colors.black;
|
||||||
}
|
}
|
||||||
+17
@@ -1,4 +1,5 @@
|
|||||||
|
|
||||||
|
import 'package:core/core.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:jmap_dart_client/jmap/mail/calendar/calendar_event.dart';
|
import 'package:jmap_dart_client/jmap/mail/calendar/calendar_event.dart';
|
||||||
import 'package:tmail_ui_user/features/email/domain/model/event_action.dart';
|
import 'package:tmail_ui_user/features/email/domain/model/event_action.dart';
|
||||||
@@ -6,6 +7,7 @@ import 'package:tmail_ui_user/features/email/presentation/extensions/calendar_ev
|
|||||||
import 'package:tmail_ui_user/features/email/presentation/styles/calendar_event_detail_widget_styles.dart';
|
import 'package:tmail_ui_user/features/email/presentation/styles/calendar_event_detail_widget_styles.dart';
|
||||||
import 'package:tmail_ui_user/features/email/presentation/widgets/calendar_event/calendar_event_action_button_widget.dart';
|
import 'package:tmail_ui_user/features/email/presentation/widgets/calendar_event/calendar_event_action_button_widget.dart';
|
||||||
import 'package:tmail_ui_user/features/email/presentation/widgets/calendar_event/event_attendee_detail_widget.dart';
|
import 'package:tmail_ui_user/features/email/presentation/widgets/calendar_event/event_attendee_detail_widget.dart';
|
||||||
|
import 'package:tmail_ui_user/features/email/presentation/widgets/calendar_event/event_body_content_widget.dart';
|
||||||
import 'package:tmail_ui_user/features/email/presentation/widgets/calendar_event/event_description_detail_widget.dart';
|
import 'package:tmail_ui_user/features/email/presentation/widgets/calendar_event/event_description_detail_widget.dart';
|
||||||
import 'package:tmail_ui_user/features/email/presentation/widgets/calendar_event/event_link_detail_widget.dart';
|
import 'package:tmail_ui_user/features/email/presentation/widgets/calendar_event/event_link_detail_widget.dart';
|
||||||
import 'package:tmail_ui_user/features/email/presentation/widgets/calendar_event/event_location_detail_widget.dart';
|
import 'package:tmail_ui_user/features/email/presentation/widgets/calendar_event/event_location_detail_widget.dart';
|
||||||
@@ -16,15 +18,21 @@ class CalendarEventDetailWidget extends StatelessWidget {
|
|||||||
|
|
||||||
final CalendarEvent calendarEvent;
|
final CalendarEvent calendarEvent;
|
||||||
final List<EventAction> eventActions;
|
final List<EventAction> eventActions;
|
||||||
|
final String emailContent;
|
||||||
final OnOpenNewTabAction? onOpenNewTabAction;
|
final OnOpenNewTabAction? onOpenNewTabAction;
|
||||||
final OnOpenComposerAction? onOpenComposerAction;
|
final OnOpenComposerAction? onOpenComposerAction;
|
||||||
|
final bool? isDraggableAppActive;
|
||||||
|
final OnMailtoDelegateAction? onMailtoDelegateAction;
|
||||||
|
|
||||||
const CalendarEventDetailWidget({
|
const CalendarEventDetailWidget({
|
||||||
super.key,
|
super.key,
|
||||||
required this.calendarEvent,
|
required this.calendarEvent,
|
||||||
required this.eventActions,
|
required this.eventActions,
|
||||||
|
required this.emailContent,
|
||||||
|
this.isDraggableAppActive,
|
||||||
this.onOpenNewTabAction,
|
this.onOpenNewTabAction,
|
||||||
this.onOpenComposerAction,
|
this.onOpenComposerAction,
|
||||||
|
this.onMailtoDelegateAction,
|
||||||
});
|
});
|
||||||
|
|
||||||
@override
|
@override
|
||||||
@@ -59,6 +67,15 @@ class CalendarEventDetailWidget extends StatelessWidget {
|
|||||||
onOpenComposerAction: onOpenComposerAction,
|
onOpenComposerAction: onOpenComposerAction,
|
||||||
onOpenNewTabAction: onOpenNewTabAction,
|
onOpenNewTabAction: onOpenNewTabAction,
|
||||||
)
|
)
|
||||||
|
)
|
||||||
|
else
|
||||||
|
Padding(
|
||||||
|
padding: const EdgeInsets.only(top: CalendarEventDetailWidgetStyles.fieldTopPadding),
|
||||||
|
child: EventBodyContentWidget(
|
||||||
|
content: emailContent,
|
||||||
|
isDraggableAppActive: isDraggableAppActive,
|
||||||
|
onMailtoDelegateAction: onMailtoDelegateAction,
|
||||||
|
)
|
||||||
),
|
),
|
||||||
if (calendarEvent.dateTimeEventAsString.isNotEmpty)
|
if (calendarEvent.dateTimeEventAsString.isNotEmpty)
|
||||||
Padding(
|
Padding(
|
||||||
|
|||||||
@@ -0,0 +1,88 @@
|
|||||||
|
|
||||||
|
import 'package:core/presentation/extensions/color_extension.dart';
|
||||||
|
import 'package:core/presentation/resources/image_paths.dart';
|
||||||
|
import 'package:core/presentation/views/html_viewer/html_content_viewer_on_web_widget.dart';
|
||||||
|
import 'package:core/presentation/views/html_viewer/html_content_viewer_widget.dart';
|
||||||
|
import 'package:core/utils/platform_info.dart';
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:flutter_svg/flutter_svg.dart';
|
||||||
|
import 'package:get/get.dart';
|
||||||
|
import 'package:pointer_interceptor/pointer_interceptor.dart';
|
||||||
|
import 'package:tmail_ui_user/features/email/presentation/styles/event_description_detail_widget_styles.dart';
|
||||||
|
import 'package:tmail_ui_user/main/utils/app_utils.dart';
|
||||||
|
|
||||||
|
class EventBodyContentWidget extends StatelessWidget {
|
||||||
|
|
||||||
|
final String content;
|
||||||
|
final bool? isDraggableAppActive;
|
||||||
|
final OnMailtoDelegateAction? onMailtoDelegateAction;
|
||||||
|
|
||||||
|
const EventBodyContentWidget({
|
||||||
|
super.key,
|
||||||
|
required this.content,
|
||||||
|
this.isDraggableAppActive,
|
||||||
|
this.onMailtoDelegateAction,
|
||||||
|
});
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
final imagePath = Get.find<ImagePaths>();
|
||||||
|
return Container(
|
||||||
|
clipBehavior: Clip.antiAlias,
|
||||||
|
decoration: const BoxDecoration(
|
||||||
|
color: AppColor.colorEventDescriptionBackground,
|
||||||
|
borderRadius: BorderRadius.all(Radius.circular(EventDescriptionDetailWidgetStyles.borderRadius)),
|
||||||
|
),
|
||||||
|
width: double.infinity,
|
||||||
|
padding: const EdgeInsetsDirectional.only(
|
||||||
|
top: EventDescriptionDetailWidgetStyles.contentPadding,
|
||||||
|
bottom: EventDescriptionDetailWidgetStyles.contentPadding,
|
||||||
|
start: EventDescriptionDetailWidgetStyles.contentPadding,
|
||||||
|
end: EventDescriptionDetailWidgetStyles.quotedPadding
|
||||||
|
),
|
||||||
|
child: Stack(
|
||||||
|
children: [
|
||||||
|
if (PlatformInfo.isWeb)
|
||||||
|
Container(
|
||||||
|
constraints: const BoxConstraints(maxHeight: EventDescriptionDetailWidgetStyles.maxHeight),
|
||||||
|
padding: const EdgeInsetsDirectional.only(end: EventDescriptionDetailWidgetStyles.webContentPadding),
|
||||||
|
child: LayoutBuilder(builder: (context, constraints) {
|
||||||
|
return Stack(
|
||||||
|
children: [
|
||||||
|
HtmlContentViewerOnWeb(
|
||||||
|
widthContent: constraints.maxWidth,
|
||||||
|
heightContent: constraints.maxHeight,
|
||||||
|
contentHtml: content,
|
||||||
|
mailtoDelegate: onMailtoDelegateAction,
|
||||||
|
direction: AppUtils.getCurrentDirection(context),
|
||||||
|
),
|
||||||
|
if (isDraggableAppActive == true)
|
||||||
|
PointerInterceptor(
|
||||||
|
child: SizedBox(
|
||||||
|
width: constraints.maxWidth,
|
||||||
|
height: constraints.maxHeight,
|
||||||
|
)
|
||||||
|
)
|
||||||
|
],
|
||||||
|
);
|
||||||
|
})
|
||||||
|
)
|
||||||
|
else
|
||||||
|
LayoutBuilder(builder: (context, constraints) {
|
||||||
|
return HtmlContentViewer(
|
||||||
|
contentHtml: content,
|
||||||
|
initialWidth: constraints.maxWidth,
|
||||||
|
direction: AppUtils.getCurrentDirection(context),
|
||||||
|
onMailtoDelegateAction: onMailtoDelegateAction
|
||||||
|
);
|
||||||
|
}),
|
||||||
|
PositionedDirectional(
|
||||||
|
top: 0,
|
||||||
|
end: 0,
|
||||||
|
child: SvgPicture.asset(imagePath.icFormatQuote)
|
||||||
|
)
|
||||||
|
],
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user