Skip to content

Commit

Permalink
Merge pull request #49389 from cretadn22/new-gbr
Browse files Browse the repository at this point in the history
Add new GBRs to task message
  • Loading branch information
aldo-expensify authored Sep 26, 2024
2 parents 99b4c5a + e27dbe4 commit 51c1fa8
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion src/components/ReportActionItem/TaskPreview.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import withCurrentUserPersonalDetails from '@components/withCurrentUserPersonalD
import type {WithCurrentUserPersonalDetailsProps} from '@components/withCurrentUserPersonalDetails';
import useLocalize from '@hooks/useLocalize';
import useStyleUtils from '@hooks/useStyleUtils';
import useTheme from '@hooks/useTheme';
import useThemeStyles from '@hooks/useThemeStyles';
import ControlSelection from '@libs/ControlSelection';
import * as DeviceCapabilities from '@libs/DeviceCapabilities';
Expand Down Expand Up @@ -58,7 +59,9 @@ function TaskPreview({taskReportID, action, contextMenuAnchor, chatReportID, che
const styles = useThemeStyles();
const StyleUtils = useStyleUtils();
const {translate} = useLocalize();
const theme = useTheme();
const [taskReport] = useOnyx(`${ONYXKEYS.COLLECTION.REPORT}${taskReportID}`);

// The reportAction might not contain details regarding the taskReport
// Only the direct parent reportAction will contain details about the taskReport
// Other linked reportActions will only contain the taskReportID and we will grab the details from there
Expand All @@ -71,7 +74,7 @@ function TaskPreview({taskReportID, action, contextMenuAnchor, chatReportID, che
const avatar = personalDetails?.[taskAssigneeAccountID]?.avatar ?? Expensicons.FallbackAvatar;
const htmlForTaskPreview = `<comment>${taskTitle}</comment>`;
const isDeletedParentAction = ReportUtils.isCanceledTaskReport(taskReport, action);

const shouldShowGreenDotIndicator = ReportUtils.isOpenTaskReport(taskReport, action) && ReportUtils.isReportManager(taskReport);
if (isDeletedParentAction) {
return <RenderHTML html={`<comment>${translate('parentReportAction.deletedTask')}</comment>`} />;
}
Expand Down Expand Up @@ -117,6 +120,14 @@ function TaskPreview({taskReportID, action, contextMenuAnchor, chatReportID, che
<RenderHTML html={isTaskCompleted ? `<completed-task>${htmlForTaskPreview}</completed-task>` : htmlForTaskPreview} />
</View>
</View>
{shouldShowGreenDotIndicator && (
<View style={styles.ml2}>
<Icon
src={Expensicons.DotIndicator}
fill={theme.success}
/>
</View>
)}
<Icon
src={Expensicons.ArrowRight}
fill={StyleUtils.getIconFillColor(getButtonState(isHovered))}
Expand Down

0 comments on commit 51c1fa8

Please sign in to comment.