TF-2945 Apply quick select for read receipt in composer on web
This commit is contained in:
@@ -1785,8 +1785,14 @@ class ComposerController extends BaseController with DragDropFileMixin implement
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void toggleRequestReadReceipt() {
|
void toggleRequestReadReceipt(BuildContext context) {
|
||||||
hasRequestReadReceipt.toggle();
|
hasRequestReadReceipt.toggle();
|
||||||
|
|
||||||
|
appToast.showToastSuccessMessage(
|
||||||
|
context,
|
||||||
|
hasRequestReadReceipt.isTrue
|
||||||
|
? AppLocalizations.of(context).requestReadReceiptHasBeenEnabled
|
||||||
|
: AppLocalizations.of(context).requestReadReceiptHasBeenDisabled);
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<void> _autoFocusFieldWhenLauncher() async {
|
Future<void> _autoFocusFieldWhenLauncher() async {
|
||||||
|
|||||||
@@ -440,7 +440,7 @@ class ComposerView extends GetWidget<ComposerController> {
|
|||||||
isSelected: controller.hasRequestReadReceipt.value,
|
isSelected: controller.hasRequestReadReceipt.value,
|
||||||
onCallbackAction: () {
|
onCallbackAction: () {
|
||||||
popBack();
|
popBack();
|
||||||
controller.toggleRequestReadReceipt();
|
controller.toggleRequestReadReceipt(context);
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
),
|
),
|
||||||
@@ -461,7 +461,7 @@ class ComposerView extends GetWidget<ComposerController> {
|
|||||||
isSelected: controller.hasRequestReadReceipt.value,
|
isSelected: controller.hasRequestReadReceipt.value,
|
||||||
onCallbackAction: () {
|
onCallbackAction: () {
|
||||||
popBack();
|
popBack();
|
||||||
controller.toggleRequestReadReceipt();
|
controller.toggleRequestReadReceipt(context);
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -467,6 +467,7 @@ class ComposerView extends GetWidget<ComposerController> {
|
|||||||
Obx(() => BottomBarComposerWidget(
|
Obx(() => BottomBarComposerWidget(
|
||||||
isCodeViewEnabled: controller.richTextWebController!.codeViewEnabled,
|
isCodeViewEnabled: controller.richTextWebController!.codeViewEnabled,
|
||||||
isFormattingOptionsEnabled: controller.richTextWebController!.isFormattingOptionsEnabled,
|
isFormattingOptionsEnabled: controller.richTextWebController!.isFormattingOptionsEnabled,
|
||||||
|
hasReadReceipt: controller.hasRequestReadReceipt.value,
|
||||||
openRichToolbarAction: controller.richTextWebController!.toggleFormattingOptions,
|
openRichToolbarAction: controller.richTextWebController!.toggleFormattingOptions,
|
||||||
attachFileAction: () => controller.openFilePickerByType(context, FileType.any),
|
attachFileAction: () => controller.openFilePickerByType(context, FileType.any),
|
||||||
insertImageAction: () => controller.insertImage(context, constraints.maxWidth),
|
insertImageAction: () => controller.insertImage(context, constraints.maxWidth),
|
||||||
@@ -474,14 +475,7 @@ class ComposerView extends GetWidget<ComposerController> {
|
|||||||
deleteComposerAction: () => controller.handleClickDeleteComposer(context),
|
deleteComposerAction: () => controller.handleClickDeleteComposer(context),
|
||||||
saveToDraftAction: () => controller.handleClickSaveAsDraftsButton(context),
|
saveToDraftAction: () => controller.handleClickSaveAsDraftsButton(context),
|
||||||
sendMessageAction: () => controller.handleClickSendButton(context),
|
sendMessageAction: () => controller.handleClickSendButton(context),
|
||||||
requestReadReceiptAction: (position) {
|
requestReadReceiptAction: () => controller.toggleRequestReadReceipt(context),
|
||||||
controller.openPopupMenuAction(
|
|
||||||
context,
|
|
||||||
position,
|
|
||||||
_createReadReceiptPopupItems(context),
|
|
||||||
radius: ComposerStyle.popupMenuRadius
|
|
||||||
);
|
|
||||||
},
|
|
||||||
)),
|
)),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
@@ -776,6 +770,7 @@ class ComposerView extends GetWidget<ComposerController> {
|
|||||||
Obx(() => BottomBarComposerWidget(
|
Obx(() => BottomBarComposerWidget(
|
||||||
isCodeViewEnabled: controller.richTextWebController!.codeViewEnabled,
|
isCodeViewEnabled: controller.richTextWebController!.codeViewEnabled,
|
||||||
isFormattingOptionsEnabled: controller.richTextWebController!.isFormattingOptionsEnabled,
|
isFormattingOptionsEnabled: controller.richTextWebController!.isFormattingOptionsEnabled,
|
||||||
|
hasReadReceipt: controller.hasRequestReadReceipt.value,
|
||||||
openRichToolbarAction: controller.richTextWebController!.toggleFormattingOptions,
|
openRichToolbarAction: controller.richTextWebController!.toggleFormattingOptions,
|
||||||
attachFileAction: () => controller.openFilePickerByType(context, FileType.any),
|
attachFileAction: () => controller.openFilePickerByType(context, FileType.any),
|
||||||
insertImageAction: () => controller.insertImage(context, constraints.maxWidth),
|
insertImageAction: () => controller.insertImage(context, constraints.maxWidth),
|
||||||
@@ -783,14 +778,7 @@ class ComposerView extends GetWidget<ComposerController> {
|
|||||||
deleteComposerAction: () => controller.handleClickDeleteComposer(context),
|
deleteComposerAction: () => controller.handleClickDeleteComposer(context),
|
||||||
saveToDraftAction: () => controller.handleClickSaveAsDraftsButton(context),
|
saveToDraftAction: () => controller.handleClickSaveAsDraftsButton(context),
|
||||||
sendMessageAction: () => controller.handleClickSendButton(context),
|
sendMessageAction: () => controller.handleClickSendButton(context),
|
||||||
requestReadReceiptAction: (position) {
|
requestReadReceiptAction: () => controller.toggleRequestReadReceipt(context),
|
||||||
controller.openPopupMenuAction(
|
|
||||||
context,
|
|
||||||
position,
|
|
||||||
_createReadReceiptPopupItems(context),
|
|
||||||
radius: ComposerStyle.popupMenuRadius
|
|
||||||
);
|
|
||||||
},
|
|
||||||
)),
|
)),
|
||||||
]),
|
]),
|
||||||
);
|
);
|
||||||
@@ -799,26 +787,6 @@ class ComposerView extends GetWidget<ComposerController> {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
List<PopupMenuEntry> _createReadReceiptPopupItems(BuildContext context) {
|
|
||||||
return [
|
|
||||||
PopupMenuItem(
|
|
||||||
padding: EdgeInsets.zero,
|
|
||||||
child: PopupItemWidget(
|
|
||||||
controller.imagePaths.icReadReceipt,
|
|
||||||
AppLocalizations.of(context).requestReadReceipt,
|
|
||||||
styleName: ComposerStyle.popupItemTextStyle,
|
|
||||||
padding: ComposerStyle.popupItemPadding,
|
|
||||||
selectedIcon: controller.imagePaths.icFilterSelected,
|
|
||||||
isSelected: controller.hasRequestReadReceipt.value,
|
|
||||||
onCallbackAction: () {
|
|
||||||
popBack();
|
|
||||||
controller.toggleRequestReadReceipt();
|
|
||||||
}
|
|
||||||
)
|
|
||||||
),
|
|
||||||
];
|
|
||||||
}
|
|
||||||
|
|
||||||
List<PopupMenuEntry> _createMoreOptionPopupItems(BuildContext context) {
|
List<PopupMenuEntry> _createMoreOptionPopupItems(BuildContext context) {
|
||||||
return [
|
return [
|
||||||
PopupMenuItem(
|
PopupMenuItem(
|
||||||
@@ -849,7 +817,7 @@ class ComposerView extends GetWidget<ComposerController> {
|
|||||||
isSelected: controller.hasRequestReadReceipt.value,
|
isSelected: controller.hasRequestReadReceipt.value,
|
||||||
onCallbackAction: () {
|
onCallbackAction: () {
|
||||||
popBack();
|
popBack();
|
||||||
controller.toggleRequestReadReceipt();
|
controller.toggleRequestReadReceipt(context);
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -11,6 +11,7 @@ class BottomBarComposerWidget extends StatelessWidget {
|
|||||||
|
|
||||||
final bool isCodeViewEnabled;
|
final bool isCodeViewEnabled;
|
||||||
final bool isFormattingOptionsEnabled;
|
final bool isFormattingOptionsEnabled;
|
||||||
|
final bool hasReadReceipt;
|
||||||
final VoidCallback openRichToolbarAction;
|
final VoidCallback openRichToolbarAction;
|
||||||
final VoidCallback attachFileAction;
|
final VoidCallback attachFileAction;
|
||||||
final VoidCallback insertImageAction;
|
final VoidCallback insertImageAction;
|
||||||
@@ -18,7 +19,7 @@ class BottomBarComposerWidget extends StatelessWidget {
|
|||||||
final VoidCallback deleteComposerAction;
|
final VoidCallback deleteComposerAction;
|
||||||
final VoidCallback saveToDraftAction;
|
final VoidCallback saveToDraftAction;
|
||||||
final VoidCallback sendMessageAction;
|
final VoidCallback sendMessageAction;
|
||||||
final OnRequestReadReceiptAction? requestReadReceiptAction;
|
final VoidCallback requestReadReceiptAction;
|
||||||
|
|
||||||
final _imagePaths = Get.find<ImagePaths>();
|
final _imagePaths = Get.find<ImagePaths>();
|
||||||
|
|
||||||
@@ -26,6 +27,7 @@ class BottomBarComposerWidget extends StatelessWidget {
|
|||||||
super.key,
|
super.key,
|
||||||
required this.isCodeViewEnabled,
|
required this.isCodeViewEnabled,
|
||||||
required this.isFormattingOptionsEnabled,
|
required this.isFormattingOptionsEnabled,
|
||||||
|
required this.hasReadReceipt,
|
||||||
required this.openRichToolbarAction,
|
required this.openRichToolbarAction,
|
||||||
required this.attachFileAction,
|
required this.attachFileAction,
|
||||||
required this.insertImageAction,
|
required this.insertImageAction,
|
||||||
@@ -33,7 +35,7 @@ class BottomBarComposerWidget extends StatelessWidget {
|
|||||||
required this.deleteComposerAction,
|
required this.deleteComposerAction,
|
||||||
required this.saveToDraftAction,
|
required this.saveToDraftAction,
|
||||||
required this.sendMessageAction,
|
required this.sendMessageAction,
|
||||||
this.requestReadReceiptAction,
|
required this.requestReadReceiptAction,
|
||||||
});
|
});
|
||||||
|
|
||||||
@override
|
@override
|
||||||
@@ -113,8 +115,13 @@ class BottomBarComposerWidget extends StatelessWidget {
|
|||||||
borderRadius: BottomBarComposerWidgetStyle.iconRadius,
|
borderRadius: BottomBarComposerWidgetStyle.iconRadius,
|
||||||
padding: BottomBarComposerWidgetStyle.iconPadding,
|
padding: BottomBarComposerWidgetStyle.iconPadding,
|
||||||
iconSize: BottomBarComposerWidgetStyle.iconSize,
|
iconSize: BottomBarComposerWidgetStyle.iconSize,
|
||||||
tooltipMessage: AppLocalizations.of(context).requestReadReceipt,
|
iconColor: hasReadReceipt
|
||||||
onTapActionAtPositionCallback: requestReadReceiptAction,
|
? BottomBarComposerWidgetStyle.selectedIconColor
|
||||||
|
: BottomBarComposerWidgetStyle.iconColor,
|
||||||
|
tooltipMessage: hasReadReceipt
|
||||||
|
? AppLocalizations.of(context).turnOffRequestReadReceipt
|
||||||
|
: AppLocalizations.of(context).turnOnRequestReadReceipt,
|
||||||
|
onTapActionCallback: requestReadReceiptAction,
|
||||||
),
|
),
|
||||||
const SizedBox(width: BottomBarComposerWidgetStyle.space),
|
const SizedBox(width: BottomBarComposerWidgetStyle.space),
|
||||||
TMailButtonWidget.fromIcon(
|
TMailButtonWidget.fromIcon(
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
{
|
{
|
||||||
"@@last_modified": "2024-03-19T12:10:23.549474",
|
"@@last_modified": "2024-07-10T13:53:40.940363",
|
||||||
"initializing_data": "Initializing data...",
|
"initializing_data": "Initializing data...",
|
||||||
"@initializing_data": {
|
"@initializing_data": {
|
||||||
"type": "text",
|
"type": "text",
|
||||||
@@ -3909,5 +3909,29 @@
|
|||||||
"type": "text",
|
"type": "text",
|
||||||
"placeholders_order": [],
|
"placeholders_order": [],
|
||||||
"placeholders": {}
|
"placeholders": {}
|
||||||
|
},
|
||||||
|
"turnOnRequestReadReceipt": "Turn on request read receipt",
|
||||||
|
"@turnOnRequestReadReceipt": {
|
||||||
|
"type": "text",
|
||||||
|
"placeholders_order": [],
|
||||||
|
"placeholders": {}
|
||||||
|
},
|
||||||
|
"turnOffRequestReadReceipt": "Turn off request read receipt",
|
||||||
|
"@turnOffRequestReadReceipt": {
|
||||||
|
"type": "text",
|
||||||
|
"placeholders_order": [],
|
||||||
|
"placeholders": {}
|
||||||
|
},
|
||||||
|
"requestReadReceiptHasBeenEnabled": "Request read receipt has been enabled",
|
||||||
|
"@requestReadReceiptHasBeenEnabled": {
|
||||||
|
"type": "text",
|
||||||
|
"placeholders_order": [],
|
||||||
|
"placeholders": {}
|
||||||
|
},
|
||||||
|
"requestReadReceiptHasBeenDisabled": "Request read receipt has been disabled",
|
||||||
|
"@requestReadReceiptHasBeenDisabled": {
|
||||||
|
"type": "text",
|
||||||
|
"placeholders_order": [],
|
||||||
|
"placeholders": {}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -4085,4 +4085,32 @@ class AppLocalizations {
|
|||||||
name: 'showNotifications',
|
name: 'showNotifications',
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
String get turnOnRequestReadReceipt {
|
||||||
|
return Intl.message(
|
||||||
|
'Turn on request read receipt',
|
||||||
|
name: 'turnOnRequestReadReceipt'
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
String get turnOffRequestReadReceipt {
|
||||||
|
return Intl.message(
|
||||||
|
'Turn off request read receipt',
|
||||||
|
name: 'turnOffRequestReadReceipt'
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
String get requestReadReceiptHasBeenEnabled {
|
||||||
|
return Intl.message(
|
||||||
|
'Request read receipt has been enabled',
|
||||||
|
name: 'requestReadReceiptHasBeenEnabled'
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
String get requestReadReceiptHasBeenDisabled {
|
||||||
|
return Intl.message(
|
||||||
|
'Request read receipt has been disabled',
|
||||||
|
name: 'requestReadReceiptHasBeenDisabled'
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user