TF-2269 Add a new action "Confirm all email here are Spam" for spam mailbox
Signed-off-by: dab246 <tdvu@linagora.com> (cherry picked from commit 1d4ef573e525681028d46d7c9d92cb6127eab757)
This commit is contained in:
@@ -930,6 +930,7 @@ class MailboxController extends BaseMailboxController with MailboxActionHandlerM
|
||||
);
|
||||
break;
|
||||
case MailboxActions.markAsRead:
|
||||
case MailboxActions.confirmMailSpam:
|
||||
markAsReadMailboxAction(
|
||||
context,
|
||||
mailbox,
|
||||
|
||||
@@ -39,14 +39,16 @@ mixin MailboxWidgetMixin {
|
||||
if (PlatformInfo.isWeb)
|
||||
MailboxActions.openInNewTab,
|
||||
MailboxActions.newSubfolder,
|
||||
if (mailbox.isSpam)
|
||||
_mailboxActionForSpam(spamReportEnabled),
|
||||
if (!mailbox.isTrash && mailbox.countUnReadEmailsAsString.isNotEmpty)
|
||||
MailboxActions.markAsRead,
|
||||
if (mailbox.isTrash)
|
||||
MailboxActions.emptyTrash,
|
||||
if (PlatformInfo.isWeb && mailbox.isSpam)
|
||||
MailboxActions.emptySpam,
|
||||
MailboxActions.emptyTrash
|
||||
else if (mailbox.isSpam)
|
||||
...[
|
||||
_mailboxActionForSpam(spamReportEnabled),
|
||||
MailboxActions.confirmMailSpam,
|
||||
MailboxActions.emptySpam
|
||||
]
|
||||
else if (mailbox.countUnReadEmailsAsString.isNotEmpty)
|
||||
MailboxActions.markAsRead
|
||||
];
|
||||
}
|
||||
|
||||
|
||||
@@ -22,7 +22,8 @@ enum MailboxActions {
|
||||
enableMailbox,
|
||||
emptyTrash,
|
||||
emptySpam,
|
||||
newSubfolder;
|
||||
newSubfolder,
|
||||
confirmMailSpam;
|
||||
}
|
||||
|
||||
extension MailboxActionsExtension on MailboxActions {
|
||||
@@ -68,6 +69,8 @@ extension MailboxActionsExtension on MailboxActions {
|
||||
return AppLocalizations.of(context).emptyTrash;
|
||||
case MailboxActions.emptySpam:
|
||||
return AppLocalizations.of(context).deleteAllSpamEmails;
|
||||
case MailboxActions.confirmMailSpam:
|
||||
return AppLocalizations.of(context).confirmAllEmailHereAreSpam;
|
||||
default:
|
||||
return '';
|
||||
}
|
||||
@@ -99,6 +102,8 @@ extension MailboxActionsExtension on MailboxActions {
|
||||
return imagePaths.icMailboxTrash;
|
||||
case MailboxActions.emptySpam:
|
||||
return imagePaths.icMailboxTrash;
|
||||
case MailboxActions.confirmMailSpam:
|
||||
return imagePaths.icMarkAsRead;
|
||||
default:
|
||||
return '';
|
||||
}
|
||||
@@ -171,6 +176,7 @@ extension MailboxActionsExtension on MailboxActions {
|
||||
case MailboxActions.delete:
|
||||
case MailboxActions.emptyTrash:
|
||||
case MailboxActions.emptySpam:
|
||||
case MailboxActions.confirmMailSpam:
|
||||
return ContextMenuItemState.activated;
|
||||
case MailboxActions.markAsRead:
|
||||
return mailbox.countUnReadEmailsAsString.isNotEmpty
|
||||
|
||||
@@ -266,6 +266,7 @@ class SearchMailboxController extends BaseMailboxController with MailboxActionHa
|
||||
case MailboxActions.enableSpamReport:
|
||||
dashboardController.storeSpamReportStateAction();
|
||||
break;
|
||||
case MailboxActions.confirmMailSpam:
|
||||
case MailboxActions.markAsRead:
|
||||
markAsReadMailboxAction(context, mailbox, dashboardController);
|
||||
break;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"@@last_modified": "2023-09-29T10:43:27.382543",
|
||||
"@@last_modified": "2023-11-06T13:06:33.363526",
|
||||
"initializing_data": "Initializing data...",
|
||||
"@initializing_data": {
|
||||
"type": "text",
|
||||
@@ -3409,5 +3409,11 @@
|
||||
"type": "text",
|
||||
"placeholders_order": [],
|
||||
"placeholders": {}
|
||||
},
|
||||
"confirmAllEmailHereAreSpam": "Confirm all email here are Spam",
|
||||
"@confirmAllEmailHereAreSpam": {
|
||||
"type": "text",
|
||||
"placeholders_order": [],
|
||||
"placeholders": {}
|
||||
}
|
||||
}
|
||||
@@ -3526,4 +3526,11 @@ class AppLocalizations {
|
||||
name: 'notSelectedMailboxToMoveMessage',
|
||||
);
|
||||
}
|
||||
|
||||
String get confirmAllEmailHereAreSpam {
|
||||
return Intl.message(
|
||||
'Confirm all email here are Spam',
|
||||
name: 'confirmAllEmailHereAreSpam'
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user