Skip to content

Commit

Permalink
update report action fragment
Browse files Browse the repository at this point in the history
  • Loading branch information
tienifr committed Jan 29, 2024
1 parent d15d989 commit 19839c2
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/pages/home/report/ReportActionItemFragment.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import convertToLTR from '@libs/convertToLTR';
import * as ReportUtils from '@libs/ReportUtils';
import CONST from '@src/CONST';
import type * as OnyxCommon from '@src/types/onyx/OnyxCommon';
import type {OriginalMessageSource} from '@src/types/onyx/OriginalMessage';
import type {DecisionName, OriginalMessageSource} from '@src/types/onyx/OriginalMessage';
import type {Message} from '@src/types/onyx/ReportAction';
import AttachmentCommentFragment from './comment/AttachmentCommentFragment';
import TextCommentFragment from './comment/TextCommentFragment';
Expand Down Expand Up @@ -55,6 +55,8 @@ type ReportActionItemFragmentProps = {

/** The pending action for the report action */
pendingAction?: OnyxCommon.PendingAction;

moderationDecision?: DecisionName
};

function ReportActionItemFragment({
Expand All @@ -71,6 +73,7 @@ function ReportActionItemFragment({
isApprovedOrSubmittedReportAction = false,
isFragmentContainingDisplayName = false,
displayAsGroup = false,
moderationDecision
}: ReportActionItemFragmentProps) {
const styles = useThemeStyles();
const {isOffline} = useNetwork();
Expand All @@ -88,6 +91,10 @@ function ReportActionItemFragment({
return <RenderHTML html={`<comment>${translate('parentReportAction.deletedMessage')}</comment>`} />;
}

if (isThreadParentMessage && moderationDecision === CONST.MODERATION.MODERATOR_DECISION_PENDING_REMOVE) {
return <RenderHTML html={`<comment>${translate('parentReportAction.hiddenMessage')}</comment>`} />;
}

if (ReportUtils.isReportMessageAttachment(fragment)) {
return (
<AttachmentCommentFragment
Expand Down
1 change: 1 addition & 0 deletions src/types/onyx/OriginalMessage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -284,4 +284,5 @@ export type {
OriginalMessageAddComment,
OriginalMessageSource,
OriginalMessageReimbursementDequeued,
DecisionName
};

0 comments on commit 19839c2

Please sign in to comment.