From cd0f980179033948e5555826fa3584f4bf3344ec Mon Sep 17 00:00:00 2001 From: dukenv0307 Date: Mon, 22 Apr 2024 11:51:32 +0700 Subject: [PATCH] add isGroupPolicyReport prop --- .../ComposerWithSuggestionsEdit.tsx | 3 +++ src/pages/home/report/ReportActionItem.tsx | 1 + src/pages/home/report/ReportActionItemMessageEdit.tsx | 6 +++++- 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/pages/home/report/ReportActionCompose/ComposerWithSuggestionsEdit/ComposerWithSuggestionsEdit.tsx b/src/pages/home/report/ReportActionCompose/ComposerWithSuggestionsEdit/ComposerWithSuggestionsEdit.tsx index ce8cfa1dc356..c7510710828d 100644 --- a/src/pages/home/report/ReportActionCompose/ComposerWithSuggestionsEdit/ComposerWithSuggestionsEdit.tsx +++ b/src/pages/home/report/ReportActionCompose/ComposerWithSuggestionsEdit/ComposerWithSuggestionsEdit.tsx @@ -21,6 +21,7 @@ type ComposerWithSuggestionsEditProps = ComposerProps & { measureParentContainer: (callback: MeasureInWindowOnSuccessCallback) => void; value: string; selection: Selection; + isGroupPolicyReport: boolean; }; function ComposerWithSuggestionsEdit( @@ -45,6 +46,7 @@ function ComposerWithSuggestionsEdit( updateDraft, measureParentContainer, id = undefined, + isGroupPolicyReport, }: ComposerWithSuggestionsEditProps, ref: ForwardedRef, ) { @@ -87,6 +89,7 @@ function ComposerWithSuggestionsEdit( selection={selection} setSelection={setSelection} resetKeyboardInput={resetKeyboardInput} + isGroupPolicyReport={isGroupPolicyReport} /> ); diff --git a/src/pages/home/report/ReportActionItem.tsx b/src/pages/home/report/ReportActionItem.tsx index 8d11744740bd..f4eb28414479 100644 --- a/src/pages/home/report/ReportActionItem.tsx +++ b/src/pages/home/report/ReportActionItem.tsx @@ -626,6 +626,7 @@ function ReportActionItem({ action={action} draftMessage={draftMessage} reportID={report.reportID} + isGroupChatPolicy={ReportUtils.isGroupPolicy(report)} index={index} ref={textInputRef} // Avoid defining within component due to an existing Onyx bug diff --git a/src/pages/home/report/ReportActionItemMessageEdit.tsx b/src/pages/home/report/ReportActionItemMessageEdit.tsx index bf96be52ff35..aeb870406adf 100644 --- a/src/pages/home/report/ReportActionItemMessageEdit.tsx +++ b/src/pages/home/report/ReportActionItemMessageEdit.tsx @@ -59,6 +59,9 @@ type ReportActionItemMessageEditProps = { /** ReportID that holds the comment we're editing */ reportID: string; + /** If current composer is connected with report from group policy */ + isGroupPolicyReport: boolean; + /** Position index of the report action in the overall report FlatList view */ index: number; @@ -77,7 +80,7 @@ const isMobileSafari = Browser.isMobileSafari(); const shouldUseForcedSelectionRange = shouldUseEmojiPickerSelection(); function ReportActionItemMessageEdit( - {action, draftMessage, reportID, index, shouldDisableEmojiPicker = false, preferredSkinTone = CONST.EMOJI_DEFAULT_SKIN_TONE}: ReportActionItemMessageEditProps, + {action, draftMessage, reportID, isGroupPolicyReport, index, shouldDisableEmojiPicker = false, preferredSkinTone = CONST.EMOJI_DEFAULT_SKIN_TONE}: ReportActionItemMessageEditProps, forwardedRef: ForwardedRef<(TextInput & HTMLTextAreaElement) | undefined>, ) { const theme = useTheme(); @@ -526,6 +529,7 @@ function ReportActionItemMessageEdit( suggestionsRef={suggestionsRef} updateDraft={updateDraft} measureParentContainer={measureContainer} + isGroupPolicyReport={isGroupPolicyReport} />