TF-3406 Add edit as new email feature
Signed-off-by: dab246 <tdvu@linagora.com>
This commit is contained in:
@@ -570,6 +570,19 @@ class ComposerController extends BaseController
|
||||
);
|
||||
|
||||
switch(arguments.emailActionType) {
|
||||
case EmailActionType.composeFromPresentationEmail:
|
||||
_initEmailAddress(
|
||||
presentationEmail: arguments.presentationEmail!,
|
||||
actionType: EmailActionType.composeFromPresentationEmail
|
||||
);
|
||||
_initSubjectEmail(
|
||||
presentationEmail: arguments.presentationEmail!,
|
||||
actionType: EmailActionType.composeFromPresentationEmail
|
||||
);
|
||||
_getEmailContentOfEmailDrafts(
|
||||
emailId: arguments.presentationEmail!.id!,
|
||||
);
|
||||
break;
|
||||
case EmailActionType.editDraft:
|
||||
_initEmailAddress(
|
||||
presentationEmail: arguments.presentationEmail!,
|
||||
|
||||
@@ -32,6 +32,7 @@ extension EmailActionTypeExtension on EmailActionType {
|
||||
case EmailActionType.editDraft:
|
||||
case EmailActionType.editSendingEmail:
|
||||
case EmailActionType.reopenComposerBrowser:
|
||||
case EmailActionType.composeFromPresentationEmail:
|
||||
return subject;
|
||||
default:
|
||||
return '';
|
||||
@@ -138,6 +139,8 @@ extension EmailActionTypeExtension on EmailActionType {
|
||||
return imagePaths.icMailboxArchived;
|
||||
case EmailActionType.downloadMessageAsEML:
|
||||
return imagePaths.icDownloadAttachment;
|
||||
case EmailActionType.composeFromPresentationEmail:
|
||||
return imagePaths.icEdit;
|
||||
default:
|
||||
return '';
|
||||
}
|
||||
@@ -159,6 +162,8 @@ extension EmailActionTypeExtension on EmailActionType {
|
||||
return AppLocalizations.of(context).archiveMessage;
|
||||
case EmailActionType.downloadMessageAsEML:
|
||||
return AppLocalizations.of(context).downloadMessageAsEML;
|
||||
case EmailActionType.composeFromPresentationEmail:
|
||||
return AppLocalizations.of(context).editAsNewEmail;
|
||||
default:
|
||||
return '';
|
||||
}
|
||||
|
||||
@@ -50,6 +50,7 @@ class MobileEditorView extends StatelessWidget with EditorViewMixin {
|
||||
case EmailActionType.reopenComposerBrowser:
|
||||
case EmailActionType.composeFromMailtoUri:
|
||||
case EmailActionType.composeFromUnsubscribeMailtoLink:
|
||||
case EmailActionType.composeFromPresentationEmail:
|
||||
if (contentViewState == null) {
|
||||
return const SizedBox.shrink();
|
||||
}
|
||||
@@ -64,9 +65,12 @@ class MobileEditorView extends StatelessWidget with EditorViewMixin {
|
||||
if (success is GetEmailContentLoading) {
|
||||
return const CupertinoLoadingWidget(padding: EdgeInsets.all(16.0));
|
||||
} else {
|
||||
var newContent = success is GetEmailContentSuccess
|
||||
? success.htmlEmailContent
|
||||
: HtmlExtension.editorStartTags;
|
||||
var newContent = HtmlExtension.editorStartTags;
|
||||
if (success is GetEmailContentSuccess) {
|
||||
newContent = success.htmlEmailContent;
|
||||
} else if (success is GetEmailContentFromCacheSuccess) {
|
||||
newContent = success.htmlEmailContent;
|
||||
}
|
||||
if (newContent.isEmpty) {
|
||||
newContent = HtmlExtension.editorStartTags;
|
||||
}
|
||||
|
||||
@@ -88,6 +88,7 @@ class WebEditorView extends StatelessWidget with EditorViewMixin {
|
||||
case EmailActionType.reopenComposerBrowser:
|
||||
case EmailActionType.composeFromUnsubscribeMailtoLink:
|
||||
case EmailActionType.composeFromMailtoUri:
|
||||
case EmailActionType.composeFromPresentationEmail:
|
||||
if (contentViewState == null) {
|
||||
return const SizedBox.shrink();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user