From 2a862e5a0566de9b5ed955b5598497103503f957 Mon Sep 17 00:00:00 2001 From: dab246 Date: Wed, 5 Jun 2024 16:19:03 +0700 Subject: [PATCH] Migrate `v0.11.3-patch4-dev` to `master` branch --- contact/pubspec.lock | 4 +- contact/pubspec.yaml | 4 +- email_recovery/pubspec.lock | 4 +- email_recovery/pubspec.yaml | 4 +- fcm/pubspec.lock | 4 +- fcm/pubspec.yaml | 4 +- forward/pubspec.lock | 4 +- forward/pubspec.yaml | 4 +- .../mixin/drag_drog_file_mixin.dart | 4 +- .../email/domain/model/event_action.dart | 4 ++ .../controller/single_email_controller.dart | 24 ++++++- .../email/presentation/email_view.dart | 67 +++++++++---------- .../extensions/attachment_extension.dart | 2 + .../calendar_event_action_button_widget.dart | 8 +++ .../calendar_event_detail_widget.dart | 10 +++ .../calendar_event_information_widget.dart | 10 +++ .../widgets/user_information_widget.dart | 2 - model/pubspec.lock | 4 +- model/pubspec.yaml | 4 +- pubspec.lock | 10 +-- pubspec.yaml | 10 ++- rule_filter/pubspec.lock | 4 +- rule_filter/pubspec.yaml | 4 +- server_settings/pubspec.yaml | 4 +- .../single_email_controller_test.dart | 15 +++++ .../presentation/home_controller_test.dart | 5 ++ .../presentation/login_controller_test.dart | 5 ++ .../mailbox_dashboard_controller_test.dart | 9 +-- 28 files changed, 161 insertions(+), 76 deletions(-) diff --git a/contact/pubspec.lock b/contact/pubspec.lock index afc4ca7524..9b5c6e164a 100644 --- a/contact/pubspec.lock +++ b/contact/pubspec.lock @@ -571,8 +571,8 @@ packages: dependency: "direct main" description: path: "." - ref: master - resolved-ref: "21d15bc1a6a75e048ee1e3cd751dd0815492ce20" + ref: migrate_cnb_to_master_5Jun + resolved-ref: "49305a382ca77211a0668fd9fe196a3c057cdc8e" url: "https://github.com/linagora/jmap-dart-client.git" source: git version: "0.0.1" diff --git a/contact/pubspec.yaml b/contact/pubspec.yaml index 97466ee95c..04932b60a9 100644 --- a/contact/pubspec.yaml +++ b/contact/pubspec.yaml @@ -15,10 +15,12 @@ dependencies: path: ../model ### Dependencies from git ### + # TODO: We will change it when the PR in upstream repository will be merged + # https://github.com/linagora/jmap-dart-client/pull/87 jmap_dart_client: git: url: https://github.com/linagora/jmap-dart-client.git - ref: master + ref: migrate_cnb_to_master_5Jun ### Dependencies from pub.dev ### equatable: 2.0.5 diff --git a/email_recovery/pubspec.lock b/email_recovery/pubspec.lock index 3924f67c6b..5047fd12e7 100644 --- a/email_recovery/pubspec.lock +++ b/email_recovery/pubspec.lock @@ -295,8 +295,8 @@ packages: dependency: "direct main" description: path: "." - ref: master - resolved-ref: "21d15bc1a6a75e048ee1e3cd751dd0815492ce20" + ref: migrate_cnb_to_master_5Jun + resolved-ref: "49305a382ca77211a0668fd9fe196a3c057cdc8e" url: "https://github.com/linagora/jmap-dart-client.git" source: git version: "0.0.1" diff --git a/email_recovery/pubspec.yaml b/email_recovery/pubspec.yaml index 1cb39b9c3c..c5bb9b1c8b 100644 --- a/email_recovery/pubspec.yaml +++ b/email_recovery/pubspec.yaml @@ -12,10 +12,12 @@ dependencies: sdk: flutter ### Dependencies from git ### + # TODO: We will change it when the PR in upstream repository will be merged + # https://github.com/linagora/jmap-dart-client/pull/87 jmap_dart_client: git: url: https://github.com/linagora/jmap-dart-client.git - ref: master + ref: migrate_cnb_to_master_5Jun ### Dependencies from pub.dev ### equatable: 2.0.5 diff --git a/fcm/pubspec.lock b/fcm/pubspec.lock index 54a8878c9c..f3f4194524 100644 --- a/fcm/pubspec.lock +++ b/fcm/pubspec.lock @@ -295,8 +295,8 @@ packages: dependency: "direct main" description: path: "." - ref: master - resolved-ref: "21d15bc1a6a75e048ee1e3cd751dd0815492ce20" + ref: migrate_cnb_to_master_5Jun + resolved-ref: "49305a382ca77211a0668fd9fe196a3c057cdc8e" url: "https://github.com/linagora/jmap-dart-client.git" source: git version: "0.0.1" diff --git a/fcm/pubspec.yaml b/fcm/pubspec.yaml index fc1464a52a..bc1e35188b 100644 --- a/fcm/pubspec.yaml +++ b/fcm/pubspec.yaml @@ -12,10 +12,12 @@ dependencies: sdk: flutter ### Dependencies from git ### + # TODO: We will change it when the PR in upstream repository will be merged + # https://github.com/linagora/jmap-dart-client/pull/87 jmap_dart_client: git: url: https://github.com/linagora/jmap-dart-client.git - ref: master + ref: migrate_cnb_to_master_5Jun ### Dependencies from pub.dev ### equatable: 2.0.5 diff --git a/forward/pubspec.lock b/forward/pubspec.lock index 54a8878c9c..f3f4194524 100644 --- a/forward/pubspec.lock +++ b/forward/pubspec.lock @@ -295,8 +295,8 @@ packages: dependency: "direct main" description: path: "." - ref: master - resolved-ref: "21d15bc1a6a75e048ee1e3cd751dd0815492ce20" + ref: migrate_cnb_to_master_5Jun + resolved-ref: "49305a382ca77211a0668fd9fe196a3c057cdc8e" url: "https://github.com/linagora/jmap-dart-client.git" source: git version: "0.0.1" diff --git a/forward/pubspec.yaml b/forward/pubspec.yaml index 94181ea0ca..351f8916cb 100644 --- a/forward/pubspec.yaml +++ b/forward/pubspec.yaml @@ -12,10 +12,12 @@ dependencies: sdk: flutter ### Dependencies from git ### + # TODO: We will change it when the PR in upstream repository will be merged + # https://github.com/linagora/jmap-dart-client/pull/87 jmap_dart_client: git: url: https://github.com/linagora/jmap-dart-client.git - ref: master + ref: migrate_cnb_to_master_5Jun ### Dependencies from pub.dev ### equatable: 2.0.5 diff --git a/lib/features/composer/presentation/mixin/drag_drog_file_mixin.dart b/lib/features/composer/presentation/mixin/drag_drog_file_mixin.dart index 44b763109c..1d27758307 100644 --- a/lib/features/composer/presentation/mixin/drag_drog_file_mixin.dart +++ b/lib/features/composer/presentation/mixin/drag_drog_file_mixin.dart @@ -1,6 +1,6 @@ import 'dart:async' as async; import 'package:async/async.dart'; -import 'package:core/domain/extensions/media_type_extension.dart'; +import 'package:core/data/constants/constant.dart'; import 'package:desktop_drop/desktop_drop.dart'; import 'package:flutter/material.dart'; import 'package:future_loading_dialog/future_loading_dialog.dart'; @@ -43,7 +43,7 @@ mixin DragDropFileMixin { fileName: details.files[i].name, type: details.files[i].mimeType, fileSize: bytesList.result![i].length, - isInline: details.files[i].mimeType?.startsWith(MediaTypeExtension.imageType) == true + isInline: details.files[i].mimeType?.startsWith(Constant.imageType) == true ), ); } diff --git a/lib/features/email/domain/model/event_action.dart b/lib/features/email/domain/model/event_action.dart index adf04ec476..a14a5ebdb3 100644 --- a/lib/features/email/domain/model/event_action.dart +++ b/lib/features/email/domain/model/event_action.dart @@ -44,6 +44,8 @@ enum EventActionType { KeyWordIdentifierExtension.tentativelyAcceptedEventAttendance.generatePath(): null, KeyWordIdentifierExtension.rejectedEventAttendance.generatePath(): true, }); + case EventActionType.mailToAttendees: + return PatchObject({}); } } @@ -55,6 +57,8 @@ enum EventActionType { return AppLocalizations.of(context).youMayAttendThisMeeting; case EventActionType.no: return AppLocalizations.of(context).youWillNotAttendThisMeeting; + case EventActionType.mailToAttendees: + return ''; } } } diff --git a/lib/features/email/presentation/controller/single_email_controller.dart b/lib/features/email/presentation/controller/single_email_controller.dart index 5911c02d5c..68fdcf9e20 100644 --- a/lib/features/email/presentation/controller/single_email_controller.dart +++ b/lib/features/email/presentation/controller/single_email_controller.dart @@ -74,8 +74,8 @@ import 'package:tmail_ui_user/features/email/domain/usecases/store_opened_email_ import 'package:tmail_ui_user/features/email/presentation/action/email_ui_action.dart'; import 'package:tmail_ui_user/features/email/presentation/bindings/calendar_event_interactor_bindings.dart'; import 'package:tmail_ui_user/features/email/presentation/controller/email_supervisor_controller.dart'; -import 'package:tmail_ui_user/features/email/presentation/model/blob_calendar_event.dart'; import 'package:tmail_ui_user/features/email/presentation/extensions/attachment_extension.dart'; +import 'package:tmail_ui_user/features/email/presentation/model/blob_calendar_event.dart'; import 'package:tmail_ui_user/features/email/presentation/model/composer_arguments.dart'; import 'package:tmail_ui_user/features/email/presentation/model/email_loaded.dart'; import 'package:tmail_ui_user/features/email/presentation/model/email_unsubscribe.dart'; @@ -1800,7 +1800,7 @@ class SingleEmailController extends BaseController with AppLoaderMixin { void handleViewAttachmentAction(BuildContext context, Attachment attachment) { if (PlatformInfo.isWeb) { - if (PlatformInfo.isCanvasKit && attachment.isDisplayedPDFIcon) { + if (PlatformInfo.isCanvasKit && attachment.validatePDFIcon()) { previewPDFFileAction(context, attachment); } else { downloadAttachmentForWeb(attachment); @@ -1839,4 +1839,24 @@ class SingleEmailController extends BaseController with AppLoaderMixin { }, ); } + + void handleMailToAttendees(CalendarOrganizer? organizer, List? attendees) { + final listEmailAddressAttendees = attendees + ?.map((attendee) => EmailAddress(attendee.name?.name, attendee.mailto?.mailAddress.value)) + .toList() ?? []; + + if (organizer != null) { + listEmailAddressAttendees.add(EmailAddress(organizer.name, organizer.mailto?.value)); + } + + final listEmailAddressMailTo = listEmailAddressAttendees + .where((emailAddress) => emailAddress.emailAddress.isNotEmpty && emailAddress.emailAddress != mailboxDashBoardController.sessionCurrent?.username.value) + .toSet() + .toList(); + + log('SingleEmailController::handleMailToAttendees: listEmailAddressMailTo = $listEmailAddressMailTo'); + mailboxDashBoardController.goToComposer( + ComposerArguments.fromMailtoUri(listEmailAddress: listEmailAddressMailTo) + ); + } } \ No newline at end of file diff --git a/lib/features/email/presentation/email_view.dart b/lib/features/email/presentation/email_view.dart index 49d80ba001..a64fa314aa 100644 --- a/lib/features/email/presentation/email_view.dart +++ b/lib/features/email/presentation/email_view.dart @@ -16,7 +16,6 @@ import 'package:model/extensions/presentation_mailbox_extension.dart'; import 'package:model/mailbox/presentation_mailbox.dart'; import 'package:pointer_interceptor/pointer_interceptor.dart'; import 'package:tmail_ui_user/features/base/widget/popup_item_widget.dart'; -import 'package:tmail_ui_user/features/base/widget/scrollbar_list_view.dart'; import 'package:tmail_ui_user/features/composer/presentation/extensions/email_action_type_extension.dart'; import 'package:tmail_ui_user/features/email/presentation/controller/single_email_controller.dart'; import 'package:tmail_ui_user/features/email/presentation/extensions/calendar_event_extension.dart'; @@ -148,33 +147,30 @@ class EmailView extends GetWidget { child: Obx(() => _buildEmailMessage( context: context, presentationEmail: currentEmail, - calendarEvent: controller.calendarEvent.value, + calendarEvent: controller.calendarEvent, maxBodyHeight: constraints.maxHeight )) ) ); } else { return Obx(() { - final calendarEvent = controller.calendarEvent.value; + final calendarEvent = controller.calendarEvent; if (currentEmail.hasCalendarEvent && calendarEvent != null) { return Padding( padding: const EdgeInsetsDirectional.symmetric(horizontal: 4), - child: ScrollbarListView( - scrollController: controller.emailContentScrollController, - child: SingleChildScrollView( - physics : const ClampingScrollPhysics(), - child: Container( - width: double.infinity, - alignment: Alignment.center, - color: Colors.white, - child: _buildEmailMessage( - context: context, - presentationEmail: currentEmail, - calendarEvent: calendarEvent, - emailAddressSender: currentEmail.listEmailAddressSender.getListAddress(), - ) + child: SingleChildScrollView( + physics : const ClampingScrollPhysics(), + child: Container( + width: double.infinity, + alignment: Alignment.center, + color: Colors.white, + child: _buildEmailMessage( + context: context, + presentationEmail: currentEmail, + calendarEvent: calendarEvent, + emailAddressSender: currentEmail.listEmailAddressSender.getListAddress(), ) - ), + ) ), ); } else { @@ -199,34 +195,31 @@ class EmailView extends GetWidget { child: Obx(() => _buildEmailMessage( context: context, presentationEmail: currentEmail, - calendarEvent: controller.calendarEvent.value, + calendarEvent: controller.calendarEvent, maxBodyHeight: constraints.maxHeight )) ) ); } else { return Obx(() { - final calendarEvent = controller.calendarEvent.value; + final calendarEvent = controller.calendarEvent; if (currentEmail.hasCalendarEvent && calendarEvent != null) { return Padding( padding: const EdgeInsetsDirectional.symmetric(horizontal: 4), - child: ScrollbarListView( - scrollController: controller.emailContentScrollController, - child: SingleChildScrollView( - physics : const ClampingScrollPhysics(), - child: Container( - width: double.infinity, - alignment: Alignment.center, - color: Colors.white, - child: _buildEmailMessage( - context: context, - presentationEmail: currentEmail, - calendarEvent: calendarEvent, - emailAddressSender: currentEmail.listEmailAddressSender.getListAddress(), - maxBodyHeight: constraints.maxHeight - ) + child: SingleChildScrollView( + physics : const ClampingScrollPhysics(), + child: Container( + width: double.infinity, + alignment: Alignment.center, + color: Colors.white, + child: _buildEmailMessage( + context: context, + presentationEmail: currentEmail, + calendarEvent: calendarEvent, + emailAddressSender: currentEmail.listEmailAddressSender.getListAddress(), + maxBodyHeight: constraints.maxHeight ) - ), + ) ), ); } else { @@ -367,6 +360,7 @@ class EmailView extends GetWidget { controller.onCalendarEventReplyAction(eventActionType, presentationEmail.id!), calendarEventReplying: controller.calendarEventProcessing, presentationEmail: controller.currentEmail, + onMailtoAttendeesAction: controller.handleMailToAttendees, )), if (calendarEvent.getTitleEventAction(context, emailAddressSender ?? []).isNotEmpty) CalendarEventActionBannerWidget( @@ -384,6 +378,7 @@ class EmailView extends GetWidget { controller.onCalendarEventReplyAction(eventActionType, presentationEmail.id!), calendarEventReplying: controller.calendarEventProcessing, presentationEmail: controller.currentEmail, + onMailtoAttendeesAction: controller.handleMailToAttendees, )), ], ) diff --git a/lib/features/email/presentation/extensions/attachment_extension.dart b/lib/features/email/presentation/extensions/attachment_extension.dart index 27087a60da..64fc09d289 100644 --- a/lib/features/email/presentation/extensions/attachment_extension.dart +++ b/lib/features/email/presentation/extensions/attachment_extension.dart @@ -4,4 +4,6 @@ import 'package:tmail_ui_user/features/upload/domain/extensions/media_type_exten extension AttachmentExtension on Attachment { String getIcon(ImagePaths imagePaths) => type?.getIcon(imagePaths, fileName: name) ?? imagePaths.icFileEPup; + + bool validatePDFIcon() => type?.validatePDFIcon(fileName: name) ?? false; } \ No newline at end of file diff --git a/lib/features/email/presentation/widgets/calendar_event/calendar_event_action_button_widget.dart b/lib/features/email/presentation/widgets/calendar_event/calendar_event_action_button_widget.dart index eb3df766b7..73dd1e37c4 100644 --- a/lib/features/email/presentation/widgets/calendar_event/calendar_event_action_button_widget.dart +++ b/lib/features/email/presentation/widgets/calendar_event/calendar_event_action_button_widget.dart @@ -97,6 +97,8 @@ class CalendarEventActionButtonWidget extends StatelessWidget { return CalendarEventActionButtonWidgetStyles.loadingBackgroundColor; } + return CalendarEventActionButtonWidgetStyles.backgroundColor; + case EventActionType.mailToAttendees: return CalendarEventActionButtonWidgetStyles.backgroundColor; } } @@ -120,6 +122,8 @@ class CalendarEventActionButtonWidget extends StatelessWidget { return CalendarEventActionButtonWidgetStyles.selectedTextColor; } + return CalendarEventActionButtonWidgetStyles.textColor; + case EventActionType.mailToAttendees: return CalendarEventActionButtonWidgetStyles.textColor; } } @@ -143,6 +147,8 @@ class CalendarEventActionButtonWidget extends StatelessWidget { return CalendarEventActionButtonWidgetStyles.selectedBackgroundColor; } + return CalendarEventActionButtonWidgetStyles.textColor; + case EventActionType.mailToAttendees: return CalendarEventActionButtonWidgetStyles.textColor; } } @@ -164,6 +170,8 @@ class CalendarEventActionButtonWidget extends StatelessWidget { return null; } return () => onCalendarEventReplyActionClick(eventActionType); + case EventActionType.mailToAttendees: + return onMailToAttendeesAction; } } } \ No newline at end of file diff --git a/lib/features/email/presentation/widgets/calendar_event/calendar_event_detail_widget.dart b/lib/features/email/presentation/widgets/calendar_event/calendar_event_detail_widget.dart index c571072b55..748bb307c3 100644 --- a/lib/features/email/presentation/widgets/calendar_event/calendar_event_detail_widget.dart +++ b/lib/features/email/presentation/widgets/calendar_event/calendar_event_detail_widget.dart @@ -1,6 +1,8 @@ import 'package:core/presentation/views/html_viewer/html_content_viewer_widget.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/properties/attendee/calendar_attendee.dart'; +import 'package:jmap_dart_client/jmap/mail/calendar/properties/calendar_organizer.dart'; import 'package:model/email/presentation_email.dart'; import 'package:tmail_ui_user/features/email/presentation/extensions/calendar_event_extension.dart'; import 'package:tmail_ui_user/features/email/presentation/styles/calendar_event_detail_widget_styles.dart'; @@ -13,6 +15,8 @@ import 'package:tmail_ui_user/features/email/presentation/widgets/calendar_event import 'package:tmail_ui_user/features/email/presentation/widgets/calendar_event/event_title_widget.dart'; import 'package:tmail_ui_user/main/utils/app_utils.dart'; +typedef OnMailtoAttendeesAction = Function(CalendarOrganizer? organizer, List? participants); + class CalendarEventDetailWidget extends StatelessWidget { final CalendarEvent calendarEvent; @@ -24,6 +28,7 @@ class CalendarEventDetailWidget extends StatelessWidget { final OnCalendarEventReplyActionClick onCalendarEventReplyActionClick; final bool calendarEventReplying; final PresentationEmail? presentationEmail; + final OnMailtoAttendeesAction? onMailtoAttendeesAction; const CalendarEventDetailWidget({ super.key, @@ -36,6 +41,7 @@ class CalendarEventDetailWidget extends StatelessWidget { this.onOpenComposerAction, this.onMailtoDelegateAction, this.presentationEmail, + this.onMailtoAttendeesAction, }); @override @@ -99,6 +105,10 @@ class CalendarEventDetailWidget extends StatelessWidget { onCalendarEventReplyActionClick: onCalendarEventReplyActionClick, calendarEventReplying: calendarEventReplying, presentationEmail: presentationEmail, + onMailToAttendeesAction: () => onMailtoAttendeesAction?.call( + calendarEvent.organizer, + calendarEvent.participants, + ), ), ], ), 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 f73562fd50..fb65d3f25f 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 @@ -25,6 +25,7 @@ class CalendarEventInformationWidget extends StatelessWidget { final OnCalendarEventReplyActionClick onCalendarEventReplyActionClick; final bool calendarEventReplying; final PresentationEmail? presentationEmail; + final OnMailtoAttendeesAction? onMailtoAttendeesAction; final _responsiveUtils = Get.find(); @@ -36,6 +37,7 @@ class CalendarEventInformationWidget extends StatelessWidget { this.onOpenNewTabAction, this.onOpenComposerAction, this.presentationEmail, + this.onMailtoAttendeesAction, }); @override @@ -123,6 +125,10 @@ class CalendarEventInformationWidget extends StatelessWidget { onCalendarEventReplyActionClick: onCalendarEventReplyActionClick, calendarEventReplying: calendarEventReplying, presentationEmail: presentationEmail, + onMailToAttendeesAction: () => onMailtoAttendeesAction?.call( + calendarEvent.organizer, + calendarEvent.participants, + ), ), ], ), @@ -194,6 +200,10 @@ class CalendarEventInformationWidget extends StatelessWidget { onCalendarEventReplyActionClick: onCalendarEventReplyActionClick, calendarEventReplying: calendarEventReplying, presentationEmail: presentationEmail, + onMailToAttendeesAction: () => onMailtoAttendeesAction?.call( + calendarEvent.organizer, + calendarEvent.participants, + ), ), ], ), diff --git a/lib/features/mailbox/presentation/widgets/user_information_widget.dart b/lib/features/mailbox/presentation/widgets/user_information_widget.dart index 45d7122ecf..6f378e66cf 100644 --- a/lib/features/mailbox/presentation/widgets/user_information_widget.dart +++ b/lib/features/mailbox/presentation/widgets/user_information_widget.dart @@ -4,8 +4,6 @@ import 'package:core/presentation/views/image/avatar_builder.dart'; import 'package:core/presentation/views/text/text_overflow_builder.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:jmap_dart_client/jmap/core/user_name.dart'; import 'package:model/extensions/username_extension.dart'; import 'package:tmail_ui_user/features/base/widget/material_text_button.dart'; diff --git a/model/pubspec.lock b/model/pubspec.lock index aee232529b..fb784ca817 100644 --- a/model/pubspec.lock +++ b/model/pubspec.lock @@ -563,8 +563,8 @@ packages: dependency: "direct main" description: path: "." - ref: master - resolved-ref: "21d15bc1a6a75e048ee1e3cd751dd0815492ce20" + ref: migrate_cnb_to_master_5Jun + resolved-ref: "49305a382ca77211a0668fd9fe196a3c057cdc8e" url: "https://github.com/linagora/jmap-dart-client.git" source: git version: "0.0.1" diff --git a/model/pubspec.yaml b/model/pubspec.yaml index a37203b6ca..b8eef5797d 100644 --- a/model/pubspec.yaml +++ b/model/pubspec.yaml @@ -30,10 +30,12 @@ dependencies: path: ../core ### Dependencies from git ### + # TODO: We will change it when the PR in upstream repository will be merged + # https://github.com/linagora/jmap-dart-client/pull/87 jmap_dart_client: git: url: https://github.com/linagora/jmap-dart-client.git - ref: master + ref: migrate_cnb_to_master_5Jun ### Dependencies from pub.dev ### cupertino_icons: 1.0.6 diff --git a/pubspec.lock b/pubspec.lock index 1e131f8fe6..942919c5a5 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -521,7 +521,7 @@ packages: source: hosted version: "6.1.4" file_picker: - dependency: "direct overridden" + dependency: "direct main" description: path: "." ref: "email_supported_5.3.1" @@ -1058,8 +1058,8 @@ packages: dependency: "direct main" description: path: "." - ref: "bugfix/composer-reply-memory-leak" - resolved-ref: "7a20f8e924e403eb54f4a6177c3c8ecb0c7b3687" + ref: cnb_supported + resolved-ref: "978886d768e6540fc7dbe016dd83733c56ffb220" url: "https://github.com/linagora/html-editor-enhanced.git" source: git version: "2.5.1" @@ -1147,8 +1147,8 @@ packages: dependency: "direct main" description: path: "." - ref: master - resolved-ref: "21d15bc1a6a75e048ee1e3cd751dd0815492ce20" + ref: migrate_cnb_to_master_5Jun + resolved-ref: "49305a382ca77211a0668fd9fe196a3c057cdc8e" url: "https://github.com/linagora/jmap-dart-client.git" source: git version: "0.0.1" diff --git a/pubspec.yaml b/pubspec.yaml index 3b82ed9479..dd8335bff2 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -55,17 +55,19 @@ dependencies: rich_text_composer: git: url: https://github.com/linagora/rich-text-composer.git - ref: master + ref: cnb_supported html_editor_enhanced: git: url: https://github.com/linagora/html-editor-enhanced.git - ref: bugfix/composer-reply-memory-leak + ref: cnb_supported + # TODO: We will change it when the PR in upstream repository will be merged + # https://github.com/linagora/jmap-dart-client/pull/87 jmap_dart_client: git: url: https://github.com/linagora/jmap-dart-client.git - ref: master + ref: migrate_cnb_to_master_5Jun contacts_service: git: @@ -240,6 +242,8 @@ dependencies: future_loading_dialog: 0.3.0 + file_picker: 5.3.1 + dev_dependencies: flutter_test: sdk: flutter diff --git a/rule_filter/pubspec.lock b/rule_filter/pubspec.lock index 54a8878c9c..f3f4194524 100644 --- a/rule_filter/pubspec.lock +++ b/rule_filter/pubspec.lock @@ -295,8 +295,8 @@ packages: dependency: "direct main" description: path: "." - ref: master - resolved-ref: "21d15bc1a6a75e048ee1e3cd751dd0815492ce20" + ref: migrate_cnb_to_master_5Jun + resolved-ref: "49305a382ca77211a0668fd9fe196a3c057cdc8e" url: "https://github.com/linagora/jmap-dart-client.git" source: git version: "0.0.1" diff --git a/rule_filter/pubspec.yaml b/rule_filter/pubspec.yaml index 3406395aad..ac8d6dd110 100644 --- a/rule_filter/pubspec.yaml +++ b/rule_filter/pubspec.yaml @@ -12,10 +12,12 @@ dependencies: sdk: flutter ### Dependencies from git ### + # TODO: We will change it when the PR in upstream repository will be merged + # https://github.com/linagora/jmap-dart-client/pull/87 jmap_dart_client: git: url: https://github.com/linagora/jmap-dart-client.git - ref: master + ref: migrate_cnb_to_master_5Jun ### Dependencies from pub.dev ### equatable: 2.0.5 diff --git a/server_settings/pubspec.yaml b/server_settings/pubspec.yaml index d4570b6a55..6d263ac4e1 100644 --- a/server_settings/pubspec.yaml +++ b/server_settings/pubspec.yaml @@ -11,10 +11,12 @@ dependencies: sdk: flutter ### Dependencies from git ### + # TODO: We will change it when the PR in upstream repository will be merged + # https://github.com/linagora/jmap-dart-client/pull/87 jmap_dart_client: git: url: https://github.com/linagora/jmap-dart-client.git - ref: master + ref: migrate_cnb_to_master_5Jun ### Dependencies from pub.dev ### equatable: 2.0.5 diff --git a/test/features/email/presentation/controller/single_email_controller_test.dart b/test/features/email/presentation/controller/single_email_controller_test.dart index 79491b7136..82ae55253c 100644 --- a/test/features/email/presentation/controller/single_email_controller_test.dart +++ b/test/features/email/presentation/controller/single_email_controller_test.dart @@ -3,6 +3,7 @@ import 'dart:ui'; import 'package:core/core.dart'; import 'package:core/utils/application_manager.dart'; import 'package:dartz/dartz.dart' hide State; +import 'package:flutter/foundation.dart'; import 'package:flutter_test/flutter_test.dart'; import 'package:get/get.dart'; import 'package:jmap_dart_client/jmap/account_id.dart'; @@ -185,6 +186,7 @@ void main() { setUp(() { Get.locale = locale; + debugDefaultTargetPlatformOverride = TargetPlatform.macOS; }); group('accept test:', () { @@ -270,9 +272,18 @@ void main() { verify(rejectCalendarEventInteractor.execute(testAccountId, {blobId}, emailId, locale.languageCode)).called(1); }); }); + + tearDown(() { + debugDefaultTargetPlatformOverride = null; + }); }); group('StoreEventAttendanceStatusInteractor test', () { + + setUp(() { + debugDefaultTargetPlatformOverride = TargetPlatform.macOS; + }); + group('calendarEventSuccess method test', () { test( 'SHOULD call execute on StoreEventAttendanceStatusInteractor\n' @@ -343,5 +354,9 @@ void main() { )).called(1); }); }); + + tearDown(() { + debugDefaultTargetPlatformOverride = null; + }); }); } diff --git a/test/features/home/presentation/home_controller_test.dart b/test/features/home/presentation/home_controller_test.dart index 77f089ec21..fff4bf85f7 100644 --- a/test/features/home/presentation/home_controller_test.dart +++ b/test/features/home/presentation/home_controller_test.dart @@ -4,6 +4,7 @@ import 'package:core/presentation/state/failure.dart'; import 'package:core/presentation/state/success.dart'; import 'package:core/presentation/utils/app_toast.dart'; import 'package:core/presentation/utils/responsive_utils.dart'; +import 'package:core/utils/application_manager.dart'; import 'package:dartz/dartz.dart'; import 'package:flutter_test/flutter_test.dart'; import 'package:get/get.dart'; @@ -51,6 +52,7 @@ import 'home_controller_test.mocks.dart'; MockSpec(), MockSpec(), MockSpec(), + MockSpec(), ]) void main() { TestWidgetsFlutterBinding.ensureInitialized(); @@ -77,6 +79,7 @@ void main() { late MockImagePaths mockImagePaths; late MockResponsiveUtils mockResponsiveUtils; late MockUuid mockUuid; + late MockApplicationManager mockApplicationManager; setUpAll(() { cleanupEmailCacheInteractor = MockCleanupEmailCacheInteractor(); @@ -102,6 +105,7 @@ void main() { mockImagePaths = MockImagePaths(); mockResponsiveUtils = MockResponsiveUtils(); mockUuid = MockUuid(); + mockApplicationManager = MockApplicationManager(); Get.put(mockGetSessionInteractor); Get.put(mockGetAuthenticatedAccountInteractor); @@ -122,6 +126,7 @@ void main() { Get.put(mockImagePaths); Get.put(mockResponsiveUtils); Get.put(mockUuid); + Get.put(mockApplicationManager); Get.testMode = true; homeController = HomeController( diff --git a/test/features/login/presentation/login_controller_test.dart b/test/features/login/presentation/login_controller_test.dart index 745551b988..0c9750e576 100644 --- a/test/features/login/presentation/login_controller_test.dart +++ b/test/features/login/presentation/login_controller_test.dart @@ -3,6 +3,7 @@ import 'package:core/data/network/config/dynamic_url_interceptors.dart'; import 'package:core/presentation/resources/image_paths.dart'; import 'package:core/presentation/utils/app_toast.dart'; import 'package:core/presentation/utils/responsive_utils.dart'; +import 'package:core/utils/application_manager.dart'; import 'package:flutter_test/flutter_test.dart'; import 'package:get/get.dart'; import 'package:mockito/annotations.dart'; @@ -65,6 +66,7 @@ import 'login_controller_test.mocks.dart'; MockSpec(), MockSpec(), MockSpec(), + MockSpec(), ]) void main() { late MockAuthenticationInteractor mockAuthenticationInteractor; @@ -94,6 +96,7 @@ void main() { late MockImagePaths mockImagePaths; late MockResponsiveUtils mockResponsiveUtils; late MockUuid mockUuid; + late MockApplicationManager mockApplicationManager; late LoginController loginController; @@ -130,6 +133,7 @@ void main() { mockImagePaths = MockImagePaths(); mockResponsiveUtils = MockResponsiveUtils(); mockUuid = MockUuid(); + mockApplicationManager = MockApplicationManager(); Get.put(mockGetSessionInteractor); Get.put(mockGetAuthenticatedAccountInteractor); @@ -149,6 +153,7 @@ void main() { Get.put(mockImagePaths); Get.put(mockResponsiveUtils); Get.put(mockUuid); + Get.put(mockApplicationManager); Get.testMode = true; loginController = LoginController( diff --git a/test/features/mailbox_dashboard/presentation/controller/mailbox_dashboard_controller_test.dart b/test/features/mailbox_dashboard/presentation/controller/mailbox_dashboard_controller_test.dart index 73ec7ad79a..dd1cc34f96 100644 --- a/test/features/mailbox_dashboard/presentation/controller/mailbox_dashboard_controller_test.dart +++ b/test/features/mailbox_dashboard/presentation/controller/mailbox_dashboard_controller_test.dart @@ -17,7 +17,6 @@ import 'package:jmap_dart_client/jmap/mail/mailbox/mailbox.dart'; import 'package:mockito/annotations.dart'; import 'package:mockito/mockito.dart'; import 'package:model/mailbox/presentation_mailbox.dart'; -import 'package:package_info_plus/package_info_plus.dart'; import 'package:rxdart/subjects.dart'; import 'package:tmail_ui_user/features/caching/caching_manager.dart'; import 'package:tmail_ui_user/features/composer/domain/usecases/send_email_interactor.dart'; @@ -168,6 +167,8 @@ const fallbackGenerators = { MockSpec(), MockSpec(), MockSpec(), + MockSpec(), + MockSpec(), ]) void main() { // mock mailbox dashboard controller direct dependencies @@ -303,12 +304,6 @@ void main() { Get.put(removeComposerCacheOnWebInteractor); Get.testMode = true; - PackageInfo.setMockInitialValues( - appName: '', - packageName: '', - version: '', - buildNumber: '', - buildSignature: ''); when(emailReceiveManager.pendingEmailAddressInfo).thenAnswer((_) => BehaviorSubject.seeded(null)); when(emailReceiveManager.pendingEmailContentInfo).thenAnswer((_) => BehaviorSubject.seeded(null));