TF-4195 Add Label as to email context menu

This commit is contained in:
dab246
2025-12-11 12:25:49 +07:00
committed by Dat H. Pham
parent 5b94e23427
commit 03b3d1181f
9 changed files with 32 additions and 0 deletions
+3
View File
@@ -0,0 +1,3 @@
<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M7.91663 14.1668L12.0833 10.0002L7.91663 5.8335L7.91663 14.1668Z" fill="#55687D"/>
</svg>

After

Width:  |  Height:  |  Size: 195 B

@@ -277,6 +277,7 @@ class ImagePaths {
String get icAiMorePolite => _getImagePath('ic_ai_more_polite.svg');
String get icTag => _getImagePath('ic_tag.svg');
String get icColorPicker => _getImagePath('ic_color_picker.svg');
String get icThumbsUp => _getImagePath('ic_thumbs_up.svg');
String _getImagePath(String imageName) {
return AssetsPaths.images + imageName;
@@ -175,6 +175,8 @@ extension EmailActionTypeExtension on EmailActionType {
case EmailActionType.moveToTrash:
case EmailActionType.deletePermanently:
return imagePaths.icDeleteComposer;
case EmailActionType.labelAs:
return imagePaths.icTag;
default:
return '';
}
@@ -222,6 +224,8 @@ extension EmailActionTypeExtension on EmailActionType {
return appLocalizations.move_to_trash;
case EmailActionType.deletePermanently:
return appLocalizations.delete_permanently;
case EmailActionType.labelAs:
return appLocalizations.labelAs;
default:
return '';
}
@@ -1551,4 +1551,9 @@ class SingleEmailController extends BaseController with AppLoaderMixin {
_threadDetailController?.onNextMobile();
}
}
bool get isLabelFeatureEnabled {
return mailboxDashBoardController.isLabelCapabilitySupported &&
mailboxDashBoardController.labelController.isLabelSettingEnabled.isTrue;
}
}
@@ -102,6 +102,7 @@ class EmailView extends GetWidget<SingleEmailController> {
handleEmailAction: controller.handleEmailAction,
additionalActions: [],
emailIsRead: presentationEmail.hasRead,
isLabelFeatureEnabled: controller.isLabelFeatureEnabled,
openBottomSheetContextMenu: controller.mailboxDashBoardController.openBottomSheetContextMenu,
openPopupMenu: controller.mailboxDashBoardController.openPopupMenuActionGroup,
);
@@ -307,6 +308,7 @@ class EmailView extends GetWidget<SingleEmailController> {
EmailActionType.deletePermanently,
],
emailIsRead: presentationEmail.hasRead,
isLabelFeatureEnabled: controller.isLabelFeatureEnabled,
openBottomSheetContextMenu: controller.mailboxDashBoardController.openBottomSheetContextMenu,
openPopupMenu: controller.mailboxDashBoardController.openPopupMenuActionGroup,
),
@@ -483,6 +483,7 @@ class EmailActionReactor {
) handleEmailAction,
required List<EmailActionType> additionalActions,
required bool emailIsRead,
required bool isLabelFeatureEnabled,
required OpenBottomSheetContextMenuAction openBottomSheetContextMenu,
required OpenPopupMenuActionGroup openPopupMenu,
}) {
@@ -499,6 +500,8 @@ class EmailActionReactor {
if (EmailUtils.isReplyToListEnabled(presentationEmail.listPost ?? '') &&
additionalActions.contains(EmailActionType.replyToList))
EmailActionType.replyToList,
if (isLabelFeatureEnabled)
EmailActionType.labelAs,
if (PlatformInfo.isWeb &&
PlatformInfo.isCanvasKit &&
additionalActions.contains(EmailActionType.printAll))
+6
View File
@@ -5289,5 +5289,11 @@
"type": "text",
"placeholders_order": [],
"placeholders": {}
},
"labelAs": "Label as",
"@labelAs": {
"type": "text",
"placeholders_order": [],
"placeholders": {}
}
}
@@ -5619,4 +5619,11 @@ class AppLocalizations {
name: 'theLabelFeatureIsNowAvailable',
);
}
String get labelAs {
return Intl.message(
'Label as',
name: 'labelAs',
);
}
}
+1
View File
@@ -4,6 +4,7 @@ enum EmailActionType {
replyToList(1),
forward(1),
replyAll(1),
labelAs(1),
compose(),
markAsRead(2),
markAsUnread(2),