TF-1100: Support display answered and forwarded
(cherry picked from commit cb67c81998264efbb75ae4543621a20522f3dbc4)
This commit is contained in:
@@ -0,0 +1,3 @@
|
||||
<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M9.90107 2.8618C8.94585 2.9297 8.19186 3.73184 8.19186 4.71139L8.191 6.53725L8.17351 6.54147C4.29331 7.35129 1.42847 10.815 1.42847 14.9015C1.42847 15.1984 1.44354 15.4943 1.47336 15.7878C1.54443 16.4874 2.42851 16.7388 2.85222 16.1799L3.01215 15.9759C4.26151 14.4352 6.04028 13.4245 8.00822 13.1598L8.191 13.1375L8.19186 15.2887C8.19186 15.7032 8.32986 16.106 8.58382 16.4324C9.21092 17.2384 10.3679 17.3797 11.168 16.7479L17.866 11.4594C17.9827 11.3673 18.0879 11.2613 18.1793 11.1438C18.8064 10.3378 18.6661 9.17229 17.866 8.54056L11.168 3.25199C10.844 2.99616 10.4442 2.85714 10.0325 2.85714L9.90107 2.8618ZM10.0325 4.40954C10.0995 4.40954 10.1646 4.43217 10.2174 4.47382L16.9154 9.76238C17.0457 9.86522 17.0685 10.055 16.9664 10.1862C16.9515 10.2053 16.9344 10.2225 16.9154 10.2375L10.2174 15.5261C10.0871 15.6289 9.89878 15.6059 9.79669 15.4747C9.75535 15.4216 9.73288 15.356 9.73288 15.2885L9.73203 12.3154C9.7319 11.8818 9.3792 11.5324 8.94885 11.5395L8.74924 11.5428L8.45626 11.5571C6.50935 11.6823 4.6921 12.4084 3.21802 13.5975L3.0688 13.7214L3.08918 13.6047C3.63951 10.659 6.02991 8.33913 9.05496 7.96751C9.44149 7.92002 9.7321 7.58949 9.7322 7.19723L9.73288 4.71161C9.73288 4.54468 9.86704 4.40954 10.0325 4.40954Z" fill="#007AFF"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 1.3 KiB |
@@ -0,0 +1,4 @@
|
||||
<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M8.57807 6.01178C8.57807 5.20223 7.95494 4.5393 7.1655 4.48318L7.05686 4.47934C6.71663 4.47934 6.38623 4.59423 6.11845 4.80566L0.582871 9.17638C-0.0783687 9.69847 -0.19427 10.6617 0.324 11.3278C0.399554 11.4249 0.486474 11.5125 0.582871 11.5886L6.11845 15.9593C6.77969 16.4814 7.73587 16.3647 8.25414 15.6985C8.46402 15.4288 8.57807 15.0959 8.57807 14.7534L8.57878 12.9755L8.72983 12.9939C10.3562 13.2127 11.8263 14.048 12.8588 15.3213L12.991 15.4899C13.3412 15.9518 14.0718 15.744 14.1306 15.1658C14.1552 14.9233 14.1677 14.6788 14.1677 14.4334C14.1677 11.0561 11.8 8.19351 8.59323 7.52424L8.57878 7.52075L8.57807 6.01178ZM6.90409 5.81543C6.94769 5.78101 7.00147 5.76231 7.05686 5.76231C7.19363 5.76231 7.3045 5.874 7.3045 6.01195L7.30506 8.06619C7.30515 8.39037 7.54532 8.66354 7.86476 8.70278C10.3648 9.00991 12.3403 10.9272 12.7952 13.3616L12.812 13.4581L12.6887 13.3557C11.4704 12.373 9.96857 11.7728 8.35956 11.6694L8.11742 11.6576L7.95246 11.6549C7.5968 11.649 7.30531 11.9377 7.30521 12.2961L7.3045 14.7532C7.3045 14.809 7.28593 14.8632 7.25176 14.9071C7.1674 15.0155 7.01174 15.0345 6.90409 14.9495L1.36852 10.5788C1.35282 10.5664 1.33867 10.5522 1.32637 10.5364C1.242 10.4279 1.26087 10.2711 1.36852 10.1861L6.90409 5.81543Z" fill="#007AFF"/>
|
||||
<path d="M14.4522 2.33238C14.7425 2.33238 15.0242 2.43049 15.2524 2.61067L19.4502 5.92513C20.0135 6.36984 20.1118 7.18958 19.6708 7.75649C19.6064 7.83919 19.5324 7.91379 19.4502 7.97865L15.2524 11.2931C15.1672 11.3604 15.076 11.4154 14.9811 11.4581C14.8211 11.5302 14.6571 11.4398 14.5952 11.3052C14.236 10.5235 13.761 9.80603 13.1921 9.17467L13.1116 9.08621L13.0612 9.03274C12.8653 8.82502 12.659 8.62722 12.4431 8.44018C12.2618 8.28306 12.3131 7.96449 12.5721 7.9084C12.8604 7.84595 13.1555 7.80448 13.4552 7.78521L13.4574 7.78507L13.6456 7.77593L13.7707 7.77393C14.1212 7.76813 14.4067 8.05245 14.4068 8.40298L14.4073 10.2663C14.4073 10.2769 14.4109 10.2872 14.4172 10.2953C14.4326 10.3152 14.4604 10.3183 14.4796 10.3031L18.6774 6.98866C18.6802 6.98641 18.6828 6.98379 18.6851 6.98087C18.701 6.96041 18.6972 6.93078 18.6774 6.91512L14.4796 3.60066C14.4716 3.5944 14.462 3.59111 14.4522 3.59111C14.4285 3.59111 14.4073 3.61079 14.4073 3.63756L14.4069 5.1954C14.4068 5.51257 14.1717 5.78124 13.857 5.8199C12.8761 5.94041 12.0051 6.39903 11.3559 7.07357C11.1595 7.27766 10.8503 7.34493 10.5883 7.21811C10.2456 7.05227 10.0908 6.59305 10.376 6.28374C11.1055 5.49271 12.0655 4.91666 13.1553 4.66701L13.1558 3.63743C13.1558 2.94894 13.686 2.38364 14.3597 2.33575L14.3648 2.33548L14.4522 2.33238Z" fill="#007AFF"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 2.7 KiB |
@@ -177,6 +177,8 @@ class ImagePaths {
|
||||
String get icShowMailbox => _getImagePath('ic_show_mailbox.svg');
|
||||
String get icMailboxVisibility => _getImagePath('ic_mailbox_visibility.svg');
|
||||
String get icToastSuccessMessage => _getImagePath('ic_toast_success_message.svg');
|
||||
String get icForwarded => _getImagePath('ic_forwarded.svg');
|
||||
String get icReplyAndForward => _getImagePath('ic_reply_and_forward.svg');
|
||||
|
||||
String _getImagePath(String imageName) {
|
||||
return AssetsPaths.images + imageName;
|
||||
|
||||
@@ -4,6 +4,7 @@ import 'package:jmap_dart_client/jmap/core/id.dart';
|
||||
import 'package:jmap_dart_client/jmap/identities/identity.dart';
|
||||
import 'package:jmap_dart_client/jmap/mail/email/email.dart';
|
||||
import 'package:jmap_dart_client/jmap/mail/mailbox/mailbox.dart';
|
||||
import 'package:model/email/email_action_type.dart';
|
||||
|
||||
class EmailRequest with EquatableMixin {
|
||||
|
||||
@@ -12,11 +13,13 @@ class EmailRequest with EquatableMixin {
|
||||
final MailboxId? sentMailboxId;
|
||||
final EmailId? emailIdDestroyed;
|
||||
final Identity? identity;
|
||||
final EmailActionType? emailActionType;
|
||||
|
||||
EmailRequest(this.email, this.submissionCreateId, {
|
||||
this.sentMailboxId,
|
||||
this.identity,
|
||||
this.emailIdDestroyed
|
||||
this.emailIdDestroyed,
|
||||
this.emailActionType
|
||||
});
|
||||
|
||||
@override
|
||||
@@ -25,6 +28,11 @@ class EmailRequest with EquatableMixin {
|
||||
submissionCreateId,
|
||||
sentMailboxId,
|
||||
identity,
|
||||
emailIdDestroyed
|
||||
emailIdDestroyed,
|
||||
emailActionType
|
||||
];
|
||||
|
||||
bool get isEmailAnswered => emailActionType == EmailActionType.reply;
|
||||
|
||||
bool get isEmailForwarded => emailActionType == EmailActionType.forward;
|
||||
}
|
||||
@@ -806,7 +806,8 @@ class ComposerController extends BaseController {
|
||||
identity: identitySelected.value,
|
||||
emailIdDestroyed: arguments.emailActionType == EmailActionType.edit
|
||||
? arguments.presentationEmail?.id
|
||||
: null
|
||||
: null,
|
||||
emailActionType: arguments.emailActionType
|
||||
);
|
||||
final mailboxRequest = outboxMailboxId == null
|
||||
? CreateNewMailboxRequest(Id(_uuid.v1()), PresentationMailbox.outboxMailboxName)
|
||||
|
||||
@@ -159,7 +159,9 @@ class EmailAPI with HandleSetErrorMixin {
|
||||
emailRequest.sentMailboxId!.generatePath() : true,
|
||||
outboxMailboxId!.generatePath() : null,
|
||||
KeyWordIdentifier.emailSeen.generatePath(): true,
|
||||
KeyWordIdentifier.emailDraft.generatePath(): null
|
||||
KeyWordIdentifier.emailDraft.generatePath(): null,
|
||||
KeyWordIdentifier.emailAnswered.generatePath(): emailRequest.isEmailAnswered ? true : null,
|
||||
KeyWordIdentifier.emailForwarded.generatePath(): emailRequest.isEmailForwarded ? true : null
|
||||
})
|
||||
});
|
||||
|
||||
|
||||
@@ -14,6 +14,7 @@ import 'package:model/extensions/presentation_email_extension.dart';
|
||||
import 'package:model/mailbox/presentation_mailbox.dart';
|
||||
import 'package:model/mailbox/select_mode.dart';
|
||||
import 'package:tmail_ui_user/features/thread/domain/model/search_query.dart';
|
||||
import 'package:tmail_ui_user/main/localizations/app_localizations.dart';
|
||||
|
||||
typedef OnPressEmailActionClick = void Function(EmailActionType, PresentationEmail);
|
||||
typedef OnMoreActionClick = void Function(PresentationEmail, RelativeRect?);
|
||||
@@ -274,4 +275,57 @@ mixin BaseEmailItemTile {
|
||||
width: 24, height: 24));
|
||||
}
|
||||
}
|
||||
|
||||
Widget buildIconAnsweredOrForwarded({
|
||||
required PresentationEmail presentationEmail,
|
||||
double? width,
|
||||
double? height
|
||||
}) {
|
||||
if (presentationEmail.isAnsweredAndForwarded) {
|
||||
return _iconAnsweredOrForwardedWidget(
|
||||
iconPath: imagePaths.icReplyAndForward,
|
||||
width: width,
|
||||
height: height
|
||||
);
|
||||
} else if (presentationEmail.isAnswered) {
|
||||
return _iconAnsweredOrForwardedWidget(
|
||||
iconPath: imagePaths.icReply,
|
||||
width: width,
|
||||
height: height
|
||||
);
|
||||
} else if (presentationEmail.isForwarded) {
|
||||
return _iconAnsweredOrForwardedWidget(
|
||||
iconPath: imagePaths.icForwarded,
|
||||
width: width,
|
||||
height: height
|
||||
);
|
||||
} else {
|
||||
return const SizedBox(width: 16, height: 16);
|
||||
}
|
||||
}
|
||||
|
||||
Widget _iconAnsweredOrForwardedWidget({
|
||||
required String iconPath,
|
||||
double? width,
|
||||
double? height
|
||||
}) {
|
||||
return SvgPicture.asset(
|
||||
iconPath,
|
||||
width: width ?? 20,
|
||||
height: height ?? 20,
|
||||
colorFilter: AppColor.colorAttachmentIcon.asFilter(),
|
||||
fit: BoxFit.fill);
|
||||
}
|
||||
|
||||
String? messageToolTipForAnsweredOrForwarded(BuildContext context, PresentationEmail presentationEmail) {
|
||||
if (presentationEmail.isAnsweredAndForwarded) {
|
||||
return AppLocalizations.of(context).repliedAndForwardedMessage;
|
||||
} else if (presentationEmail.isAnswered) {
|
||||
return AppLocalizations.of(context).repliedMessage;
|
||||
} else if (presentationEmail.isForwarded){
|
||||
return AppLocalizations.of(context).forwardedMessage;
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -86,6 +86,7 @@ class EmailTileBuilder with BaseEmailItemTile {
|
||||
mailboxContain,
|
||||
isSearchEmailRunning,
|
||||
_searchQuery)),
|
||||
buildIconAnsweredOrForwarded(width: 16, height: 16, presentationEmail: _presentationEmail),
|
||||
if (_presentationEmail.hasAttachment == true)
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(left: 8),
|
||||
|
||||
@@ -153,6 +153,7 @@ class EmailTileBuilder with BaseEmailItemTile {
|
||||
isSearchEmailRunning,
|
||||
_searchQuery
|
||||
)),
|
||||
buildIconAnsweredOrForwarded(width: 16, height: 16, presentationEmail: _presentationEmail),
|
||||
if (_presentationEmail.hasAttachment == true)
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(left: 8),
|
||||
@@ -345,6 +346,11 @@ class EmailTileBuilder with BaseEmailItemTile {
|
||||
? EmailActionType.unMarkAsStarred
|
||||
: EmailActionType.markAsStarred,
|
||||
_presentationEmail)),
|
||||
buildIconWeb(
|
||||
icon: buildIconAnsweredOrForwarded(presentationEmail: _presentationEmail),
|
||||
tooltip: messageToolTipForAnsweredOrForwarded(context, _presentationEmail),
|
||||
iconPadding: const EdgeInsets.only(right: 12),
|
||||
splashRadius: 1),
|
||||
InkWell(
|
||||
onTap: () {
|
||||
if (isHoverIcon) {
|
||||
@@ -382,7 +388,7 @@ class EmailTileBuilder with BaseEmailItemTile {
|
||||
Transform(
|
||||
transform: Matrix4.translationValues(0.0, 10, 0.0),
|
||||
child: const Padding(
|
||||
padding: EdgeInsets.only(left: 80),
|
||||
padding: EdgeInsets.only(left: 120),
|
||||
child: Divider(
|
||||
color: AppColor.lineItemListColor,
|
||||
height: 1,
|
||||
@@ -497,6 +503,7 @@ class EmailTileBuilder with BaseEmailItemTile {
|
||||
|
||||
Widget _buildDateTimeForMobileTabletScreen() {
|
||||
return Row(children: [
|
||||
buildIconAnsweredOrForwarded(width: 16, height: 16, presentationEmail: _presentationEmail),
|
||||
if (_presentationEmail.hasAttachment == true)
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(left: 8),
|
||||
|
||||
@@ -2833,4 +2833,22 @@ class AppLocalizations {
|
||||
'Please input at least one recipient',
|
||||
name: 'emptyListEmailForward');
|
||||
}
|
||||
|
||||
String get forwardedMessage {
|
||||
return Intl.message(
|
||||
'Forwarded message',
|
||||
name: 'forwardedMessage');
|
||||
}
|
||||
|
||||
String get repliedMessage {
|
||||
return Intl.message(
|
||||
'Replied message',
|
||||
name: 'repliedMessage');
|
||||
}
|
||||
|
||||
String get repliedAndForwardedMessage {
|
||||
return Intl.message(
|
||||
'Replied and Forwarded message',
|
||||
name: 'repliedAndForwardedMessage');
|
||||
}
|
||||
}
|
||||
@@ -78,6 +78,12 @@ class PresentationEmail with EquatableMixin {
|
||||
|
||||
bool get isDraft => keywords?.containsKey(KeyWordIdentifier.emailDraft) == true;
|
||||
|
||||
bool get isAnswered => keywords?.containsKey(KeyWordIdentifier.emailAnswered) == true;
|
||||
|
||||
bool get isForwarded => keywords?.containsKey(KeyWordIdentifier.emailForwarded) == true;
|
||||
|
||||
bool get isAnsweredAndForwarded => isAnswered && isForwarded;
|
||||
|
||||
bool get withAttachments => hasAttachment == true;
|
||||
|
||||
String get mailboxName {
|
||||
|
||||
Reference in New Issue
Block a user