TF-153 Mark as spam when open email
This commit is contained in:
@@ -0,0 +1,3 @@
|
||||
<svg width="56" height="56" viewBox="0 0 56 56" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M32.9733 16L40 23.0267V32.9733L32.9733 40H23.0267L16 32.9733V23.0267L23.0267 16H32.9733ZM28.3333 31.6667H27.6667C26.9303 31.6667 26.3333 32.2636 26.3333 33V33.6667C26.3333 34.403 26.9303 35 27.6667 35H28.3333C29.0697 35 29.6667 34.403 29.6667 33.6667V33C29.6667 32.2636 29.0697 31.6667 28.3333 31.6667ZM28 21.3333C27.2636 21.3333 26.6667 21.9303 26.6667 22.6667V28C26.6667 28.7364 27.2636 29.3333 28 29.3333C28.7364 29.3333 29.3333 28.7364 29.3333 28V22.6667C29.3333 21.9303 28.7364 21.3333 28 21.3333Z" fill="#99A2AD"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 633 B |
@@ -0,0 +1,3 @@
|
||||
<svg width="28" height="29" viewBox="0 0 28 29" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M4.73223 7.73223C4.26339 8.20107 4 8.83696 4 9.5V19.5C4 20.163 4.26339 20.7989 4.73223 21.2678C5.20107 21.7366 5.83696 22 6.5 22H21.5C22.163 22 22.7989 21.7366 23.2678 21.2678C23.7366 20.7989 24 20.163 24 19.5V12C24 11.337 23.7366 10.7011 23.2678 10.2322C22.7989 9.76339 22.163 9.5 21.5 9.5H15.25L12.75 7H6.5C5.83696 7 5.20107 7.26339 4.73223 7.73223ZM17.2118 15.8104H12.0842L13.8553 17.5815C14.1029 17.8292 14.1029 18.2307 13.8553 18.4783C13.6076 18.726 13.2061 18.726 12.9585 18.4783L10.1048 15.6247C9.85715 15.377 9.85715 14.9755 10.1048 14.7278L12.9585 11.8742C13.2061 11.6265 13.6076 11.6265 13.8553 11.8742C14.1029 12.1218 14.1029 12.5233 13.8553 12.771L12.0842 14.5421H17.2118C17.562 14.5421 17.8459 14.826 17.8459 15.1762C17.8459 15.5265 17.562 15.8104 17.2118 15.8104Z" fill="#007AFF"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 948 B |
@@ -1,3 +1,3 @@
|
||||
<svg width="21" height="20" viewBox="0 0 21 20" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M18.5 9.5C18.5 9.89783 18.342 10.2794 18.0607 10.5607C17.7794 10.842 17.3978 11 17 11C16.6022 11 16.2206 10.842 15.9393 10.5607C15.658 10.2794 15.5 9.89783 15.5 9.5V3.5C15.5 3.10218 15.658 2.72064 15.9393 2.43934C16.2206 2.15804 16.6022 2 17 2C17.3978 2 17.7794 2.15804 18.0607 2.43934C18.342 2.72064 18.5 3.10218 18.5 3.5V9.5ZM14.5 9.667V4.237C14.5003 3.86544 14.397 3.50116 14.2018 3.18499C14.0067 2.86882 13.7273 2.61327 13.395 2.447L13.345 2.422C12.7892 2.14422 12.1763 1.99973 11.555 2H6.14C5.67747 1.99982 5.22918 2.15995 4.87145 2.45314C4.51371 2.74633 4.26866 3.15444 4.178 3.608L2.978 9.608C2.91999 9.89821 2.92712 10.1977 2.99886 10.4848C3.0706 10.7719 3.20516 11.0396 3.39285 11.2684C3.58054 11.4972 3.81667 11.6815 4.08422 11.808C4.35176 11.9346 4.64405 12.0001 4.94 12H8.5V16C8.5 16.5304 8.71072 17.0391 9.08579 17.4142C9.46086 17.7893 9.96957 18 10.5 18C10.7652 18 11.0196 17.8946 11.2071 17.7071C11.3946 17.5196 11.5 17.2652 11.5 17V16.333C11.5 15.4675 11.7807 14.6254 12.3 13.933L13.7 12.067C14.2193 11.3746 14.5 10.5325 14.5 9.667Z" fill="#007AFF"/>
|
||||
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M20.228 11.4857C20.228 11.8949 20.0655 12.2873 19.7761 12.5767C19.4868 12.866 19.0944 13.0286 18.6852 13.0286C18.276 13.0286 17.8836 12.866 17.5942 12.5767C17.3049 12.2873 17.1423 11.8949 17.1423 11.4857V5.31428C17.1423 4.90509 17.3049 4.51266 17.5942 4.22332C17.8836 3.93397 18.276 3.77142 18.6852 3.77142C19.0944 3.77142 19.4868 3.93397 19.7761 4.22332C20.0655 4.51266 20.228 4.90509 20.228 5.31428V11.4857ZM16.1138 11.6575V6.07234C16.114 5.69016 16.0078 5.31547 15.8071 4.99027C15.6063 4.66507 15.319 4.40222 14.9772 4.2312L14.9258 4.20548C14.3541 3.91976 13.7237 3.77115 13.0846 3.77142H7.5149C7.03916 3.77124 6.57805 3.93595 6.2101 4.23751C5.84215 4.53907 5.59009 4.95885 5.49684 5.42537L4.26256 11.5968C4.20289 11.8953 4.21022 12.2033 4.28401 12.4986C4.3578 12.794 4.49621 13.0692 4.68926 13.3046C4.88231 13.54 5.12519 13.7296 5.40038 13.8597C5.67557 13.9898 5.97621 14.0573 6.28061 14.0571H9.94233V18.1714C9.94233 18.717 10.1591 19.2403 10.5449 19.626C10.9306 20.0118 11.4539 20.2286 11.9995 20.2286C12.2723 20.2286 12.5339 20.1202 12.7268 19.9273C12.9197 19.7344 13.028 19.4728 13.028 19.2V18.5139C13.028 17.6237 13.3168 16.7575 13.8509 16.0454L15.2909 14.1261C15.825 13.4139 16.1138 12.5477 16.1138 11.6575Z" fill="#007AFF"/>
|
||||
</svg>
|
||||
|
||||
|
Before Width: | Height: | Size: 1.2 KiB After Width: | Height: | Size: 1.3 KiB |
@@ -0,0 +1,4 @@
|
||||
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<rect width="24" height="24" rx="12" fill="#007AFF"/>
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M5.51256 7.48816C5.18437 7.80072 5 8.22464 5 8.66667V15.3333C5 15.7754 5.18437 16.1993 5.51256 16.5118C5.84075 16.8244 6.28587 17 6.75 17H17.25C17.7141 17 18.1592 16.8244 18.4874 16.5118C18.8156 16.1993 19 15.7754 19 15.3333V10.3333C19 9.89131 18.8156 9.46738 18.4874 9.15482C18.1592 8.84226 17.7141 8.66667 17.25 8.66667H12.875L11.125 7H6.75C6.28587 7 5.84075 7.17559 5.51256 7.48816ZM14.4758 12.9634H10.5232L11.8885 14.2636C12.0794 14.4454 12.0794 14.7402 11.8885 14.922C11.6976 15.1038 11.3881 15.1038 11.1972 14.922L8.99742 12.827C8.80652 12.6452 8.80652 12.3504 8.99742 12.1686L11.1972 10.0736C11.3881 9.8918 11.6976 9.8918 11.8885 10.0736C12.0794 10.2554 12.0794 10.5502 11.8885 10.732L10.5232 12.0323H14.4758C14.7458 12.0323 14.9647 12.2407 14.9647 12.4978C14.9647 12.7549 14.7458 12.9634 14.4758 12.9634Z" fill="white"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 1.0 KiB |
@@ -0,0 +1,4 @@
|
||||
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M24 12C24 18.6274 18.6274 24 12 24C5.37258 24 0 18.6274 0 12C0 5.37258 5.37258 0 12 0C18.6274 0 24 5.37258 24 12Z" fill="#007AFF"/>
|
||||
<path d="M17.6 12.6484C17.6 12.9269 17.4894 13.194 17.2925 13.3909C17.0956 13.5878 16.8285 13.6984 16.55 13.6984C16.2715 13.6984 16.0045 13.5878 15.8076 13.3909C15.6106 13.194 15.5 12.9269 15.5 12.6484V8.44844C15.5 8.16996 15.6106 7.90289 15.8076 7.70598C16.0045 7.50906 16.2715 7.39844 16.55 7.39844C16.8285 7.39844 17.0956 7.50906 17.2925 7.70598C17.4894 7.90289 17.6 8.16996 17.6 8.44844V12.6484ZM14.8 12.7653V8.96434C14.8002 8.70425 14.7279 8.44925 14.5913 8.22793C14.4547 8.00661 14.2591 7.82773 14.0265 7.71134L13.9915 7.69384C13.6025 7.49939 13.1735 7.39825 12.7385 7.39844H8.94801C8.62424 7.39831 8.31044 7.5104 8.06002 7.71564C7.80961 7.92087 7.63807 8.20655 7.57461 8.52404L6.73461 12.724C6.69401 12.9272 6.69899 13.1368 6.74921 13.3378C6.79943 13.5388 6.89363 13.7261 7.02501 13.8863C7.15639 14.0465 7.32168 14.1755 7.50896 14.2641C7.69625 14.3526 7.90085 14.3985 8.10801 14.3984H10.6V17.1984C10.6 17.5697 10.7475 17.9258 11.0101 18.1884C11.2726 18.4509 11.6287 18.5984 12 18.5984C12.1857 18.5984 12.3637 18.5247 12.495 18.3934C12.6263 18.2621 12.7 18.0841 12.7 17.8984V17.4315C12.7 16.8257 12.8965 16.2362 13.26 15.7515L14.24 14.4453C14.6035 13.9607 14.8 13.3712 14.8 12.7653Z" fill="white"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 1.4 KiB |
@@ -88,6 +88,10 @@ class ImagePaths {
|
||||
String get icNotConnection => _getImagePath('ic_not_connection.svg');
|
||||
String get icDeleteTrash => _getImagePath('ic_delete_trash.svg');
|
||||
String get icMenuDrawer => _getImagePath('ic_menu_drawer.svg');
|
||||
String get icToastSpam => _getImagePath('ic_toast_spam.svg');
|
||||
String get icToastNotSpam => _getImagePath('ic_toast_not_spam.svg');
|
||||
String get icNotSpam => _getImagePath('ic_not_spam.svg');
|
||||
String get icAvatarSpam => _getImagePath('ic_avatar_spam.svg');
|
||||
|
||||
String _getImagePath(String imageName) {
|
||||
return AssetsPaths.images + imageName;
|
||||
|
||||
@@ -32,6 +32,8 @@ extension EmailActionTypeExtension on EmailActionType {
|
||||
return AppLocalizations.of(context).moved_to_mailbox(destinationPath ?? '');
|
||||
case EmailActionType.moveToTrash:
|
||||
return AppLocalizations.of(context).moved_to_trash;
|
||||
case EmailActionType.moveToSpam:
|
||||
return AppLocalizations.of(context).marked_as_spam;
|
||||
default:
|
||||
return '';
|
||||
}
|
||||
|
||||
@@ -343,13 +343,20 @@ class EmailController extends BaseController {
|
||||
);
|
||||
|
||||
if (destinationMailbox != null && destinationMailbox is PresentationMailbox) {
|
||||
if (destinationMailbox.role == PresentationMailbox.roleTrash) {
|
||||
if (destinationMailbox.isTrash) {
|
||||
_moveToTrashAction(context, accountId, MoveToMailboxRequest(
|
||||
[email.id],
|
||||
currentMailbox.id,
|
||||
destinationMailbox.id,
|
||||
MoveAction.moving,
|
||||
EmailActionType.moveToTrash));
|
||||
} else if (destinationMailbox.isSpam) {
|
||||
_moveToSpamAction(context, accountId, MoveToMailboxRequest(
|
||||
[email.id],
|
||||
currentMailbox.id,
|
||||
destinationMailbox.id,
|
||||
MoveAction.moving,
|
||||
EmailActionType.moveToSpam));
|
||||
} else {
|
||||
_moveToMailbox(accountId, MoveToMailboxRequest(
|
||||
[email.id],
|
||||
@@ -375,7 +382,7 @@ class EmailController extends BaseController {
|
||||
currentOverlayContext!,
|
||||
success.emailActionType.getToastMessageMoveToMailboxSuccess(currentContext!, destinationPath: success.destinationPath),
|
||||
AppLocalizations.of(currentContext!).undo_action, () {
|
||||
_undoMoveToMailbox(MoveToMailboxRequest(
|
||||
_revertedToOriginalMailbox(MoveToMailboxRequest(
|
||||
[success.emailId],
|
||||
success.destinationMailboxId,
|
||||
success.currentMailboxId,
|
||||
@@ -386,7 +393,7 @@ class EmailController extends BaseController {
|
||||
}
|
||||
}
|
||||
|
||||
void _undoMoveToMailbox(MoveToMailboxRequest newMoveRequest) {
|
||||
void _revertedToOriginalMailbox(MoveToMailboxRequest newMoveRequest) {
|
||||
final accountId = mailboxDashBoardController.accountId.value;
|
||||
if (accountId != null) {
|
||||
_moveToMailbox(accountId, newMoveRequest);
|
||||
@@ -413,6 +420,26 @@ class EmailController extends BaseController {
|
||||
mailboxDashBoardController.moveToMailbox(accountId, moveRequest);
|
||||
}
|
||||
|
||||
void moveToSpam(BuildContext context, PresentationEmail email) async {
|
||||
final accountId = mailboxDashBoardController.accountId.value;
|
||||
final spamMailboxId = mailboxDashBoardController.getMailboxIdByRole(PresentationMailbox.roleSpam);
|
||||
|
||||
if (accountId != null && currentMailbox != null && spamMailboxId != null) {
|
||||
_moveToSpamAction(context, accountId, MoveToMailboxRequest(
|
||||
[email.id],
|
||||
currentMailbox!.id,
|
||||
spamMailboxId,
|
||||
MoveAction.moving,
|
||||
EmailActionType.moveToSpam)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
void _moveToSpamAction(BuildContext context, AccountId accountId, MoveToMailboxRequest moveRequest) {
|
||||
backToThreadView(context);
|
||||
mailboxDashBoardController.moveToMailbox(accountId, moveRequest);
|
||||
}
|
||||
|
||||
void markAsStarEmail(PresentationEmail presentationEmail, MarkStarAction markStarAction) async {
|
||||
final accountId = mailboxDashBoardController.accountId.value;
|
||||
final mailboxCurrent = mailboxDashBoardController.selectedMailbox.value;
|
||||
@@ -449,6 +476,10 @@ class EmailController extends BaseController {
|
||||
case EmailActionType.deletePermanently:
|
||||
deleteEmailPermanently(context, presentationEmail);
|
||||
break;
|
||||
case EmailActionType.moveToSpam:
|
||||
popBack();
|
||||
moveToSpam(context, presentationEmail);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -544,6 +544,7 @@ class EmailView extends GetView with UserSettingPopupMenuMixin, NetworkConnectio
|
||||
List<Widget> _emailActionMoreActionTile(BuildContext context, PresentationEmail email) {
|
||||
return <Widget>[
|
||||
_markAsEmailUnreadAction(context, email),
|
||||
_markAsEmailSpamOrUnSpamAction(context, email),
|
||||
];
|
||||
}
|
||||
|
||||
@@ -572,9 +573,31 @@ class EmailView extends GetView with UserSettingPopupMenuMixin, NetworkConnectio
|
||||
.build();
|
||||
}
|
||||
|
||||
Widget _markAsEmailSpamOrUnSpamAction(BuildContext context, PresentationEmail email) {
|
||||
return (EmailActionCupertinoActionSheetActionBuilder(
|
||||
Key('mark_as_spam_or_un_spam_action'),
|
||||
SvgPicture.asset(
|
||||
emailController.currentMailbox?.isSpam == true ? imagePaths.icNotSpam : imagePaths.icSpam,
|
||||
width: 28, height: 28, fit: BoxFit.fill, color: AppColor.colorTextButton),
|
||||
emailController.currentMailbox?.isSpam == true
|
||||
? AppLocalizations.of(context).remove_from_spam
|
||||
: AppLocalizations.of(context).mark_as_spam,
|
||||
email,
|
||||
iconLeftPadding: responsiveUtils.isMobile(context)
|
||||
? EdgeInsets.only(left: 12, right: 16)
|
||||
: EdgeInsets.only(right: 12),
|
||||
iconRightPadding: responsiveUtils.isMobile(context)
|
||||
? EdgeInsets.only(right: 12)
|
||||
: EdgeInsets.zero)
|
||||
..onActionClick((email) => emailController.handleEmailAction(context, email,
|
||||
emailController.currentMailbox?.isSpam == true ? EmailActionType.unSpam : EmailActionType.moveToSpam)))
|
||||
.build();
|
||||
}
|
||||
|
||||
List<PopupMenuEntry> _popupMenuEmailActionTile(BuildContext context, PresentationEmail email) {
|
||||
return [
|
||||
PopupMenuItem(padding: EdgeInsets.symmetric(horizontal: 8), child: _markAsEmailUnreadAction(context, email)),
|
||||
PopupMenuItem(padding: EdgeInsets.symmetric(horizontal: 8), child: _markAsEmailSpamOrUnSpamAction(context, email)),
|
||||
];
|
||||
}
|
||||
}
|
||||
@@ -1104,4 +1104,26 @@ class AppLocalizations {
|
||||
name: 'date',
|
||||
);
|
||||
}
|
||||
|
||||
String get mark_as_spam {
|
||||
return Intl.message(
|
||||
'Mark as spam',
|
||||
name: 'mark_as_spam',
|
||||
);
|
||||
}
|
||||
|
||||
String get remove_from_spam {
|
||||
return Intl.message(
|
||||
'Remove from spam',
|
||||
name: 'remove_from_spam',
|
||||
);
|
||||
}
|
||||
|
||||
String get marked_as_spam {
|
||||
return Intl.message(
|
||||
'Marked as spam',
|
||||
name: 'marked_as_spam',
|
||||
);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -15,4 +15,6 @@ enum EmailActionType {
|
||||
deletePermanently,
|
||||
preview,
|
||||
selection,
|
||||
moveToSpam,
|
||||
unSpam,
|
||||
}
|
||||
@@ -59,6 +59,10 @@ class PresentationMailbox with EquatableMixin {
|
||||
|
||||
bool get isSpam => role == roleSpam;
|
||||
|
||||
bool get isTrash => role == roleTrash;
|
||||
|
||||
bool get isDrafts => role == roleDrafts;
|
||||
|
||||
@override
|
||||
List<Object?> get props => [
|
||||
id,
|
||||
|
||||
Reference in New Issue
Block a user