Skip to content

Commit

Permalink
make sure all the links are deep links back to the specific comment i…
Browse files Browse the repository at this point in the history
…n the ancestry, both in the ancestry and the header
  • Loading branch information
rayane-djouah committed Mar 26, 2024
1 parent 9b0c3fe commit 242ead9
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 4 deletions.
7 changes: 5 additions & 2 deletions src/components/ParentNavigationSubtitle.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,14 @@ type ParentNavigationSubtitleProps = {
/** parent Report ID */
parentReportID?: string;

/** parent Report Action ID */
parentReportActionID?: string;

/** PressableWithoutFeedack additional styles */
pressableStyles?: StyleProp<ViewStyle>;
};

function ParentNavigationSubtitle({parentNavigationSubtitleData, parentReportID = '', pressableStyles}: ParentNavigationSubtitleProps) {
function ParentNavigationSubtitle({parentNavigationSubtitleData, parentReportActionID, parentReportID = '', pressableStyles}: ParentNavigationSubtitleProps) {
const styles = useThemeStyles();
const {workspaceName, reportName} = parentNavigationSubtitleData;

Expand All @@ -28,7 +31,7 @@ function ParentNavigationSubtitle({parentNavigationSubtitleData, parentReportID
return (
<PressableWithoutFeedback
onPress={() => {
Navigation.navigate(ROUTES.REPORT_WITH_ID.getRoute(parentReportID));
Navigation.navigate(ROUTES.REPORT_WITH_ID.getRoute(parentReportID, parentReportActionID));
}}
accessibilityLabel={translate('threads.parentNavigationSummary', {reportName, workspaceName})}
role={CONST.ROLE.LINK}
Expand Down
1 change: 1 addition & 0 deletions src/pages/home/HeaderView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -272,6 +272,7 @@ function HeaderView({report, personalDetails, parentReport, parentReportAction,
<ParentNavigationSubtitle
parentNavigationSubtitleData={parentNavigationSubtitleData}
parentReportID={report.parentReportID}
parentReportActionID={report.parentReportActionID}
pressableStyles={[styles.alignSelfStart, styles.mw100]}
/>
)}
Expand Down
2 changes: 1 addition & 1 deletion src/pages/home/report/ReportActionItemParentAction.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ function ReportActionItemParentAction({report, parentReportAction, index = 0, sh
>
<ThreadDivider ancestor={ancestor} />
<ReportActionItem
onPress={() => Navigation.navigate(ROUTES.REPORT_WITH_ID.getRoute(ancestor.report.parentReportID ?? ''))}
onPress={() => Navigation.navigate(ROUTES.REPORT_WITH_ID.getRoute(ancestor.report.parentReportID ?? '', ancestor.reportAction.reportActionID))}
parentReportAction={parentReportAction}
report={ancestor.report}
action={ancestor.reportAction}
Expand Down
2 changes: 1 addition & 1 deletion src/pages/home/report/ThreadDivider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ function ThreadDivider({ancestor}: ThreadDividerProps) {
return (
<View style={[styles.flexRow, styles.alignItemsCenter, styles.ml5, styles.mt3, styles.mb1]}>
<PressableWithoutFeedback
onPress={() => Navigation.navigate(ROUTES.REPORT_WITH_ID.getRoute(ancestor?.report?.parentReportID ?? ''))}
onPress={() => Navigation.navigate(ROUTES.REPORT_WITH_ID.getRoute(ancestor?.report?.parentReportID ?? '', ancestor.reportAction.reportActionID))}
accessibilityLabel={translate('threads.thread')}
role={CONST.ROLE.BUTTON}
style={[styles.flexRow, styles.alignItemsCenter, styles.gap1]}
Expand Down

0 comments on commit 242ead9

Please sign in to comment.