TF-1456 Enable Team-Mailbox when move message

This commit is contained in:
dab246
2023-02-22 00:32:51 +07:00
committed by Dat Vu
parent ac603f09af
commit 66beed7c15
2 changed files with 43 additions and 6 deletions
@@ -177,15 +177,26 @@ class DestinationPickerController extends BaseMailboxController {
void toggleMailboxCategories(MailboxCategories categories) { void toggleMailboxCategories(MailboxCategories categories) {
switch(categories) { switch(categories) {
case MailboxCategories.exchange: case MailboxCategories.exchange:
final newExpandMode = mailboxCategoriesExpandMode.value.defaultMailbox == ExpandMode.EXPAND ? ExpandMode.COLLAPSE : ExpandMode.EXPAND; final newExpandMode = mailboxCategoriesExpandMode.value.defaultMailbox == ExpandMode.EXPAND
? ExpandMode.COLLAPSE
: ExpandMode.EXPAND;
mailboxCategoriesExpandMode.value.defaultMailbox = newExpandMode; mailboxCategoriesExpandMode.value.defaultMailbox = newExpandMode;
mailboxCategoriesExpandMode.refresh(); mailboxCategoriesExpandMode.refresh();
break; break;
case MailboxCategories.personalMailboxes: case MailboxCategories.personalMailboxes:
final newExpandMode = mailboxCategoriesExpandMode.value.personalMailboxes == ExpandMode.EXPAND ? ExpandMode.COLLAPSE : ExpandMode.EXPAND; final newExpandMode = mailboxCategoriesExpandMode.value.personalMailboxes == ExpandMode.EXPAND
? ExpandMode.COLLAPSE
: ExpandMode.EXPAND;
mailboxCategoriesExpandMode.value.personalMailboxes = newExpandMode; mailboxCategoriesExpandMode.value.personalMailboxes = newExpandMode;
mailboxCategoriesExpandMode.refresh(); mailboxCategoriesExpandMode.refresh();
break; break;
case MailboxCategories.teamMailboxes:
final newExpandMode = mailboxCategoriesExpandMode.value.teamMailboxes == ExpandMode.EXPAND
? ExpandMode.COLLAPSE
: ExpandMode.EXPAND;
mailboxCategoriesExpandMode.value.teamMailboxes = newExpandMode;
mailboxCategoriesExpandMode.refresh();
break;
default: default:
return; return;
} }
@@ -280,10 +291,11 @@ class DestinationPickerController extends BaseMailboxController {
void searchMailbox(String value) { void searchMailbox(String value) {
searchQuery.value = SearchQuery(value); searchQuery.value = SearchQuery(value);
_searchMailboxAction( final searchableMailboxList = mailboxAction.value == MailboxActions.moveEmail
allMailboxes.listPersonalMailboxes, ? allMailboxes
searchQuery.value : allMailboxes.listPersonalMailboxes;
);
_searchMailboxAction(searchableMailboxList, searchQuery.value);
} }
void _searchMailboxAction(List<PresentationMailbox> allMailboxes, SearchQuery searchQuery) { void _searchMailboxAction(List<PresentationMailbox> allMailboxes, SearchQuery searchQuery) {
@@ -251,6 +251,31 @@ class DestinationPickerView extends GetWidget<DestinationPickerController>
return const SizedBox.shrink(); return const SizedBox.shrink();
} }
}), }),
Obx(() {
if (controller.teamMailboxesIsNotEmpty
&& controller.mailboxAction.value == MailboxActions.moveEmail) {
return Column(
mainAxisSize: MainAxisSize.min,
children: [
const Divider(
color: AppColor.colorDividerMailbox,
height: 0.5,
thickness: 0.2
),
const SizedBox(height: 8),
_buildMailboxCategory(
context,
MailboxCategories.teamMailboxes,
controller.teamMailboxesRootNode,
actions,
mailboxIdSelected
)
]
);
} else {
return const SizedBox.shrink();
}
}),
const SizedBox(height: 12) const SizedBox(height: 12)
]) ])
); );