TF-1815 Move email improvement
(cherry picked from commit d7884423c0e14697ec2af29e55d39602aa7869f8)
This commit is contained in:
+10
-5
@@ -76,7 +76,7 @@ class DestinationPickerSearchMailboxItemBuilder extends StatelessWidget {
|
||||
}
|
||||
|
||||
void _onTapMailboxAction() {
|
||||
if (onClickOpenMailboxAction != null) {
|
||||
if (!_isSelectActionNoValid && onClickOpenMailboxAction != null) {
|
||||
onClickOpenMailboxAction?.call(_presentationMailbox);
|
||||
}
|
||||
}
|
||||
@@ -134,16 +134,14 @@ class DestinationPickerSearchMailboxItemBuilder extends StatelessWidget {
|
||||
}
|
||||
|
||||
Widget _buildSelectedIcon(BuildContext context) {
|
||||
if (_presentationMailbox.id == mailboxIdAlreadySelected &&
|
||||
(mailboxActions == MailboxActions.select ||
|
||||
mailboxActions == MailboxActions.create)) {
|
||||
if (_isSelectActionNoValid) {
|
||||
return Padding(
|
||||
padding: EdgeInsets.only(
|
||||
right: AppUtils.isDirectionRTL(context) ? 0 : 8,
|
||||
left: AppUtils.isDirectionRTL(context) ? 8 : 0,
|
||||
),
|
||||
child: SvgPicture.asset(
|
||||
_imagePaths.icFilterSelected,
|
||||
_imagePaths.icSelectedSB,
|
||||
width: 20,
|
||||
height: 20,
|
||||
fit: BoxFit.fill
|
||||
@@ -153,4 +151,11 @@ class DestinationPickerSearchMailboxItemBuilder extends StatelessWidget {
|
||||
return const SizedBox.shrink();
|
||||
}
|
||||
}
|
||||
|
||||
bool get _isSelectActionNoValid => _presentationMailbox.id == mailboxIdAlreadySelected &&
|
||||
(
|
||||
mailboxActions == MailboxActions.select ||
|
||||
mailboxActions == MailboxActions.create ||
|
||||
mailboxActions == MailboxActions.moveEmail
|
||||
);
|
||||
}
|
||||
@@ -619,7 +619,12 @@ class SingleEmailController extends BaseController with AppLoaderMixin {
|
||||
final session = mailboxDashBoardController.sessionCurrent;
|
||||
|
||||
if (currentMailbox != null && accountId != null) {
|
||||
final arguments = DestinationPickerArguments(accountId, MailboxActions.moveEmail, session);
|
||||
final arguments = DestinationPickerArguments(
|
||||
accountId,
|
||||
MailboxActions.moveEmail,
|
||||
session,
|
||||
mailboxIdSelected: currentMailbox.mailboxId
|
||||
);
|
||||
if (BuildUtils.isWeb) {
|
||||
showDialogDestinationPicker(
|
||||
context: context,
|
||||
|
||||
@@ -160,7 +160,9 @@ class MailBoxFolderTileBuilder {
|
||||
child: Material(
|
||||
color: Colors.transparent,
|
||||
child: InkWell(
|
||||
onTap: () => _onOpenMailboxFolderClick?.call(_mailboxNode),
|
||||
onTap: () => !_isSelectActionNoValid
|
||||
? _onOpenMailboxFolderClick?.call(_mailboxNode)
|
||||
: null,
|
||||
customBorder: const RoundedRectangleBorder(borderRadius: BorderRadius.all(Radius.circular(8))),
|
||||
hoverColor: AppColor.colorMailboxHovered,
|
||||
child: Container(
|
||||
@@ -172,7 +174,8 @@ class MailBoxFolderTileBuilder {
|
||||
_buildLeadingMailboxItem(context),
|
||||
const SizedBox(width: 8),
|
||||
Expanded(child: _buildTitleFolderItem(context, showTrailingItem: false)),
|
||||
_buildSelectedIcon()
|
||||
_buildSelectedIcon(),
|
||||
const SizedBox(width: 8),
|
||||
])
|
||||
),
|
||||
),
|
||||
@@ -400,17 +403,22 @@ class MailBoxFolderTileBuilder {
|
||||
}
|
||||
|
||||
Widget _buildSelectedIcon() {
|
||||
if (_mailboxNode.item.id == mailboxIdAlreadySelected &&
|
||||
mailboxDisplayed == MailboxDisplayed.destinationPicker &&
|
||||
(mailboxActions == MailboxActions.select ||
|
||||
mailboxActions == MailboxActions.create)) {
|
||||
if (_isSelectActionNoValid) {
|
||||
return SvgPicture.asset(
|
||||
_imagePaths.icFilterSelected,
|
||||
width: 20,
|
||||
height: 20,
|
||||
fit: BoxFit.fill);
|
||||
_imagePaths.icSelectedSB,
|
||||
width: 20,
|
||||
height: 20,
|
||||
fit: BoxFit.fill);
|
||||
} else {
|
||||
return const SizedBox.shrink();
|
||||
}
|
||||
}
|
||||
|
||||
bool get _isSelectActionNoValid => _mailboxNode.item.id == mailboxIdAlreadySelected &&
|
||||
mailboxDisplayed == MailboxDisplayed.destinationPicker &&
|
||||
(
|
||||
mailboxActions == MailboxActions.select ||
|
||||
mailboxActions == MailboxActions.create ||
|
||||
mailboxActions == MailboxActions.moveEmail
|
||||
);
|
||||
}
|
||||
+2
-1
@@ -750,7 +750,8 @@ class MailboxDashBoardController extends ReloadableController {
|
||||
final arguments = DestinationPickerArguments(
|
||||
accountId.value!,
|
||||
MailboxActions.moveEmail,
|
||||
sessionCurrent);
|
||||
sessionCurrent,
|
||||
mailboxIdSelected: currentMailbox.mailboxId);
|
||||
|
||||
if (BuildUtils.isWeb) {
|
||||
showDialogDestinationPicker(
|
||||
|
||||
@@ -125,7 +125,11 @@ mixin EmailActionController on ViewAsDialogActionMixin {
|
||||
final session = mailboxDashBoardController.sessionCurrent;
|
||||
|
||||
if (mailboxContain != null && accountId != null) {
|
||||
final arguments = DestinationPickerArguments(accountId, MailboxActions.moveEmail, session);
|
||||
final arguments = DestinationPickerArguments(
|
||||
accountId,
|
||||
MailboxActions.moveEmail,
|
||||
session,
|
||||
mailboxIdSelected: mailboxContain.mailboxId);
|
||||
|
||||
if (BuildUtils.isWeb) {
|
||||
showDialogDestinationPicker(
|
||||
|
||||
Reference in New Issue
Block a user