TF-3449 Update Mark as Important state when edit as new email
Signed-off-by: dab246 <tdvu@linagora.com>
This commit is contained in:
@@ -608,18 +608,19 @@ class ComposerController extends BaseController
|
||||
);
|
||||
|
||||
switch(arguments.emailActionType) {
|
||||
case EmailActionType.composeFromPresentationEmail:
|
||||
case EmailActionType.editAsNewEmail:
|
||||
_initEmailAddress(
|
||||
presentationEmail: arguments.presentationEmail!,
|
||||
actionType: EmailActionType.composeFromPresentationEmail
|
||||
actionType: EmailActionType.editAsNewEmail
|
||||
);
|
||||
_initSubjectEmail(
|
||||
presentationEmail: arguments.presentationEmail!,
|
||||
actionType: EmailActionType.composeFromPresentationEmail
|
||||
actionType: EmailActionType.editAsNewEmail
|
||||
);
|
||||
_getEmailContentOfEmailDrafts(
|
||||
emailId: arguments.presentationEmail!.id!,
|
||||
);
|
||||
isMarkAsImportant.value = arguments.presentationEmail!.isMarkAsImportant;
|
||||
break;
|
||||
case EmailActionType.editDraft:
|
||||
_initEmailAddress(
|
||||
|
||||
@@ -32,7 +32,7 @@ extension EmailActionTypeExtension on EmailActionType {
|
||||
case EmailActionType.editDraft:
|
||||
case EmailActionType.editSendingEmail:
|
||||
case EmailActionType.reopenComposerBrowser:
|
||||
case EmailActionType.composeFromPresentationEmail:
|
||||
case EmailActionType.editAsNewEmail:
|
||||
return subject;
|
||||
default:
|
||||
return '';
|
||||
@@ -146,7 +146,7 @@ extension EmailActionTypeExtension on EmailActionType {
|
||||
return imagePaths.icMailboxArchived;
|
||||
case EmailActionType.downloadMessageAsEML:
|
||||
return imagePaths.icDownloadAttachment;
|
||||
case EmailActionType.composeFromPresentationEmail:
|
||||
case EmailActionType.editAsNewEmail:
|
||||
return imagePaths.icEdit;
|
||||
default:
|
||||
return '';
|
||||
@@ -169,7 +169,7 @@ extension EmailActionTypeExtension on EmailActionType {
|
||||
return AppLocalizations.of(context).archiveMessage;
|
||||
case EmailActionType.downloadMessageAsEML:
|
||||
return AppLocalizations.of(context).downloadMessageAsEML;
|
||||
case EmailActionType.composeFromPresentationEmail:
|
||||
case EmailActionType.editAsNewEmail:
|
||||
return AppLocalizations.of(context).editAsNewEmail;
|
||||
default:
|
||||
return '';
|
||||
|
||||
@@ -50,7 +50,7 @@ class MobileEditorView extends StatelessWidget with EditorViewMixin {
|
||||
case EmailActionType.reopenComposerBrowser:
|
||||
case EmailActionType.composeFromMailtoUri:
|
||||
case EmailActionType.composeFromUnsubscribeMailtoLink:
|
||||
case EmailActionType.composeFromPresentationEmail:
|
||||
case EmailActionType.editAsNewEmail:
|
||||
if (contentViewState == null) {
|
||||
return const SizedBox.shrink();
|
||||
}
|
||||
|
||||
@@ -91,7 +91,7 @@ class WebEditorView extends StatelessWidget with EditorViewMixin {
|
||||
case EmailActionType.reopenComposerBrowser:
|
||||
case EmailActionType.composeFromUnsubscribeMailtoLink:
|
||||
case EmailActionType.composeFromMailtoUri:
|
||||
case EmailActionType.composeFromPresentationEmail:
|
||||
case EmailActionType.editAsNewEmail:
|
||||
if (contentViewState == null) {
|
||||
return const SizedBox.shrink();
|
||||
}
|
||||
|
||||
@@ -1422,8 +1422,8 @@ class SingleEmailController extends BaseController with AppLoaderMixin {
|
||||
case EmailActionType.downloadMessageAsEML:
|
||||
_downloadMessageAsEML(presentationEmail);
|
||||
break;
|
||||
case EmailActionType.composeFromPresentationEmail:
|
||||
_composeFromPresentationEmail(presentationEmail);
|
||||
case EmailActionType.editAsNewEmail:
|
||||
_editAsNewEmail(presentationEmail);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
@@ -2145,11 +2145,11 @@ class SingleEmailController extends BaseController with AppLoaderMixin {
|
||||
downloadAttachmentForWeb(emlAttachment);
|
||||
}
|
||||
|
||||
void _composeFromPresentationEmail(PresentationEmail presentationEmail) {
|
||||
void _editAsNewEmail(PresentationEmail presentationEmail) {
|
||||
if (accountId == null || session == null) return;
|
||||
|
||||
mailboxDashBoardController.goToComposer(
|
||||
ComposerArguments.fromPresentationEmail(presentationEmail),
|
||||
ComposerArguments.editAsNewEmail(presentationEmail),
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -507,7 +507,7 @@ class EmailView extends GetWidget<SingleEmailController> {
|
||||
EmailActionType.archiveMessage,
|
||||
if (PlatformInfo.isWeb && PlatformInfo.isCanvasKit)
|
||||
EmailActionType.downloadMessageAsEML,
|
||||
EmailActionType.composeFromPresentationEmail,
|
||||
EmailActionType.editAsNewEmail,
|
||||
];
|
||||
|
||||
if (position == null) {
|
||||
|
||||
@@ -105,9 +105,9 @@ class ComposerArguments extends RouterArguments {
|
||||
presentationEmail: presentationEmail,
|
||||
);
|
||||
|
||||
factory ComposerArguments.fromPresentationEmail(PresentationEmail presentationEmail) =>
|
||||
factory ComposerArguments.editAsNewEmail(PresentationEmail presentationEmail) =>
|
||||
ComposerArguments(
|
||||
emailActionType: EmailActionType.composeFromPresentationEmail,
|
||||
emailActionType: EmailActionType.editAsNewEmail,
|
||||
presentationEmail: presentationEmail,
|
||||
);
|
||||
|
||||
|
||||
@@ -45,7 +45,7 @@ mixin EmailActionController {
|
||||
|
||||
void editAsNewEmail(PresentationEmail presentationEmail) {
|
||||
mailboxDashBoardController.goToComposer(
|
||||
ComposerArguments.fromPresentationEmail(presentationEmail),
|
||||
ComposerArguments.editAsNewEmail(presentationEmail),
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -16,7 +16,7 @@ enum EmailActionType {
|
||||
composeFromFileShared,
|
||||
composeFromEmailAddress,
|
||||
composeFromMailtoUri,
|
||||
composeFromPresentationEmail,
|
||||
editAsNewEmail,
|
||||
reopenComposerBrowser,
|
||||
moveToTrash,
|
||||
deletePermanently,
|
||||
|
||||
Reference in New Issue
Block a user