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;
|
break;
|
||||||
case MailboxActions.markAsRead:
|
case MailboxActions.markAsRead:
|
||||||
|
case MailboxActions.confirmMailSpam:
|
||||||
markAsReadMailboxAction(
|
markAsReadMailboxAction(
|
||||||
context,
|
context,
|
||||||
mailbox,
|
mailbox,
|
||||||
|
|||||||
@@ -39,14 +39,16 @@ mixin MailboxWidgetMixin {
|
|||||||
if (PlatformInfo.isWeb)
|
if (PlatformInfo.isWeb)
|
||||||
MailboxActions.openInNewTab,
|
MailboxActions.openInNewTab,
|
||||||
MailboxActions.newSubfolder,
|
MailboxActions.newSubfolder,
|
||||||
if (mailbox.isSpam)
|
|
||||||
_mailboxActionForSpam(spamReportEnabled),
|
|
||||||
if (!mailbox.isTrash && mailbox.countUnReadEmailsAsString.isNotEmpty)
|
|
||||||
MailboxActions.markAsRead,
|
|
||||||
if (mailbox.isTrash)
|
if (mailbox.isTrash)
|
||||||
MailboxActions.emptyTrash,
|
MailboxActions.emptyTrash
|
||||||
if (PlatformInfo.isWeb && mailbox.isSpam)
|
else if (mailbox.isSpam)
|
||||||
MailboxActions.emptySpam,
|
...[
|
||||||
|
_mailboxActionForSpam(spamReportEnabled),
|
||||||
|
MailboxActions.confirmMailSpam,
|
||||||
|
MailboxActions.emptySpam
|
||||||
|
]
|
||||||
|
else if (mailbox.countUnReadEmailsAsString.isNotEmpty)
|
||||||
|
MailboxActions.markAsRead
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -22,7 +22,8 @@ enum MailboxActions {
|
|||||||
enableMailbox,
|
enableMailbox,
|
||||||
emptyTrash,
|
emptyTrash,
|
||||||
emptySpam,
|
emptySpam,
|
||||||
newSubfolder;
|
newSubfolder,
|
||||||
|
confirmMailSpam;
|
||||||
}
|
}
|
||||||
|
|
||||||
extension MailboxActionsExtension on MailboxActions {
|
extension MailboxActionsExtension on MailboxActions {
|
||||||
@@ -68,6 +69,8 @@ extension MailboxActionsExtension on MailboxActions {
|
|||||||
return AppLocalizations.of(context).emptyTrash;
|
return AppLocalizations.of(context).emptyTrash;
|
||||||
case MailboxActions.emptySpam:
|
case MailboxActions.emptySpam:
|
||||||
return AppLocalizations.of(context).deleteAllSpamEmails;
|
return AppLocalizations.of(context).deleteAllSpamEmails;
|
||||||
|
case MailboxActions.confirmMailSpam:
|
||||||
|
return AppLocalizations.of(context).confirmAllEmailHereAreSpam;
|
||||||
default:
|
default:
|
||||||
return '';
|
return '';
|
||||||
}
|
}
|
||||||
@@ -99,6 +102,8 @@ extension MailboxActionsExtension on MailboxActions {
|
|||||||
return imagePaths.icMailboxTrash;
|
return imagePaths.icMailboxTrash;
|
||||||
case MailboxActions.emptySpam:
|
case MailboxActions.emptySpam:
|
||||||
return imagePaths.icMailboxTrash;
|
return imagePaths.icMailboxTrash;
|
||||||
|
case MailboxActions.confirmMailSpam:
|
||||||
|
return imagePaths.icMarkAsRead;
|
||||||
default:
|
default:
|
||||||
return '';
|
return '';
|
||||||
}
|
}
|
||||||
@@ -171,6 +176,7 @@ extension MailboxActionsExtension on MailboxActions {
|
|||||||
case MailboxActions.delete:
|
case MailboxActions.delete:
|
||||||
case MailboxActions.emptyTrash:
|
case MailboxActions.emptyTrash:
|
||||||
case MailboxActions.emptySpam:
|
case MailboxActions.emptySpam:
|
||||||
|
case MailboxActions.confirmMailSpam:
|
||||||
return ContextMenuItemState.activated;
|
return ContextMenuItemState.activated;
|
||||||
case MailboxActions.markAsRead:
|
case MailboxActions.markAsRead:
|
||||||
return mailbox.countUnReadEmailsAsString.isNotEmpty
|
return mailbox.countUnReadEmailsAsString.isNotEmpty
|
||||||
|
|||||||
@@ -266,6 +266,7 @@ class SearchMailboxController extends BaseMailboxController with MailboxActionHa
|
|||||||
case MailboxActions.enableSpamReport:
|
case MailboxActions.enableSpamReport:
|
||||||
dashboardController.storeSpamReportStateAction();
|
dashboardController.storeSpamReportStateAction();
|
||||||
break;
|
break;
|
||||||
|
case MailboxActions.confirmMailSpam:
|
||||||
case MailboxActions.markAsRead:
|
case MailboxActions.markAsRead:
|
||||||
markAsReadMailboxAction(context, mailbox, dashboardController);
|
markAsReadMailboxAction(context, mailbox, dashboardController);
|
||||||
break;
|
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": "Initializing data...",
|
||||||
"@initializing_data": {
|
"@initializing_data": {
|
||||||
"type": "text",
|
"type": "text",
|
||||||
@@ -3409,5 +3409,11 @@
|
|||||||
"type": "text",
|
"type": "text",
|
||||||
"placeholders_order": [],
|
"placeholders_order": [],
|
||||||
"placeholders": {}
|
"placeholders": {}
|
||||||
|
},
|
||||||
|
"confirmAllEmailHereAreSpam": "Confirm all email here are Spam",
|
||||||
|
"@confirmAllEmailHereAreSpam": {
|
||||||
|
"type": "text",
|
||||||
|
"placeholders_order": [],
|
||||||
|
"placeholders": {}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -3526,4 +3526,11 @@ class AppLocalizations {
|
|||||||
name: 'notSelectedMailboxToMoveMessage',
|
name: 'notSelectedMailboxToMoveMessage',
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
String get confirmAllEmailHereAreSpam {
|
||||||
|
return Intl.message(
|
||||||
|
'Confirm all email here are Spam',
|
||||||
|
name: 'confirmAllEmailHereAreSpam'
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user