Skip to content

Commit

Permalink
Merge branch 'main' of github.com:Expensify/App into reapply-onyx-upg…
Browse files Browse the repository at this point in the history
…rade-use-cache-with-fixes
  • Loading branch information
hannojg committed Aug 14, 2023
2 parents 6f9da52 + 8e799df commit 53323f0
Show file tree
Hide file tree
Showing 10 changed files with 19 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ function BaseAnchorForCommentsOnly({onPressIn, onPressOut, href = '', rel = '',
event.preventDefault();
linkProps.onPress();
}}
suppressHighlighting
// Add testID so it gets selected as an anchor tag by SelectionScraper
testID="a"
// eslint-disable-next-line react/jsx-props-no-spreading
Expand Down
1 change: 1 addition & 0 deletions src/components/Banner.js
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ function Banner(props) {
<Text
style={[...props.textStyles]}
onPress={props.onPress}
suppressHighlighting
>
{props.text}
</Text>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ function AnchorRenderer(props) {
<Text
style={styles.link}
onPress={navigateToLink}
suppressHighlighting
>
<TNodeChildrenRenderer tnode={props.tnode} />
</Text>
Expand Down
2 changes: 2 additions & 0 deletions src/components/ReportWelcomeText.js
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ function ReportWelcomeText(props) {
<Text
style={[styles.textStrong]}
onPress={() => Navigation.navigate(ROUTES.getReportDetailsRoute(props.report.reportID))}
suppressHighlighting
>
{ReportUtils.getReportName(props.report)}
</Text>
Expand All @@ -105,6 +106,7 @@ function ReportWelcomeText(props) {
<Text
style={[styles.textStrong]}
onPress={() => Navigation.navigate(ROUTES.getProfileRoute(accountID))}
suppressHighlighting
>
{displayName}
</Text>
Expand Down
1 change: 1 addition & 0 deletions src/components/TextLink.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ function TextLink(props) {
onMouseDown={props.onMouseDown}
onKeyDown={openLinkIfEnterKeyPressed}
ref={props.forwardedRef}
suppressHighlighting
// eslint-disable-next-line react/jsx-props-no-spreading
{...rest}
>
Expand Down
5 changes: 3 additions & 2 deletions src/libs/ReportUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -459,7 +459,7 @@ function isConciergeChatReport(report) {
function shouldDisableDetailPage(report) {
const participantAccountIDs = lodashGet(report, 'participantAccountIDs', []);

if (isChatRoom(report) || isPolicyExpenseChat(report) || isChatThread(report)) {
if (isChatRoom(report) || isPolicyExpenseChat(report) || isChatThread(report) || isTaskReport(report)) {
return false;
}
if (participantAccountIDs.length === 1) {
Expand Down Expand Up @@ -1451,7 +1451,7 @@ function getReport(reportID) {
function navigateToDetailsPage(report) {
const participantAccountIDs = lodashGet(report, 'participantAccountIDs', []);

if (isChatRoom(report) || isPolicyExpenseChat(report) || isChatThread(report)) {
if (isChatRoom(report) || isPolicyExpenseChat(report) || isChatThread(report) || isTaskReport(report)) {
Navigation.navigate(ROUTES.getReportDetailsRoute(report.reportID));
return;
}
Expand Down Expand Up @@ -2208,6 +2208,7 @@ function buildOptimisticTaskReport(ownerAccountID, assigneeAccountID = 0, parent
reportName: title,
description,
ownerAccountID,
participantAccountIDs: assigneeAccountID && assigneeAccountID !== ownerAccountID ? [assigneeAccountID] : [],
managerID: assigneeAccountID,
type: CONST.REPORT.TYPE.TASK,
parentReportID,
Expand Down
2 changes: 1 addition & 1 deletion src/pages/ReportDetailsPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ function ReportDetailsPage(props) {
const policy = useMemo(() => props.policies[`${ONYXKEYS.COLLECTION.POLICY}${props.report.policyID}`], [props.policies, props.report.policyID]);
const isPolicyAdmin = useMemo(() => PolicyUtils.isPolicyAdmin(policy), [policy]);
const shouldDisableSettings = useMemo(() => ReportUtils.shouldDisableSettings(props.report), [props.report]);
const shouldUseFullTitle = !shouldDisableSettings;
const shouldUseFullTitle = !shouldDisableSettings || ReportUtils.isTaskReport(props.report);
const isChatRoom = useMemo(() => ReportUtils.isChatRoom(props.report), [props.report]);
const isThread = useMemo(() => ReportUtils.isChatThread(props.report), [props.report]);
const isUserCreatedPolicyRoom = useMemo(() => ReportUtils.isUserCreatedPolicyRoom(props.report), [props.report]);
Expand Down
5 changes: 4 additions & 1 deletion src/pages/ReportParticipantsPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,10 @@ function ReportParticipantsPage(props) {
<FullPageNotFoundView shouldShow={_.isEmpty(props.report) || ReportUtils.isArchivedRoom(props.report)}>
<HeaderWithBackButton
title={props.translate(
ReportUtils.isChatRoom(props.report) || ReportUtils.isPolicyExpenseChat(props.report) || ReportUtils.isChatThread(props.report)
ReportUtils.isChatRoom(props.report) ||
ReportUtils.isPolicyExpenseChat(props.report) ||
ReportUtils.isChatThread(props.report) ||
ReportUtils.isTaskReport(props.report)
? 'common.members'
: 'common.details',
)}
Expand Down
2 changes: 1 addition & 1 deletion src/pages/home/HeaderView.js
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ function HeaderView(props) {
<PressableWithoutFeedback
onPress={() => ReportUtils.navigateToDetailsPage(props.report)}
style={[styles.flexRow, styles.alignItemsCenter, styles.flex1]}
disabled={(isTaskReport && !ReportUtils.isOpenTaskReport(props.report)) || shouldDisableDetailPage}
disabled={shouldDisableDetailPage}
accessibilityLabel={title}
accessibilityRole={CONST.ACCESSIBILITY_ROLE.BUTTON}
>
Expand Down
6 changes: 4 additions & 2 deletions tests/unit/SidebarFilterTest.js
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ describe('Sidebar', () => {
.then(() =>
Onyx.multiSet({
[`${ONYXKEYS.COLLECTION.REPORT}${report.reportID}`]: report,
[ONYXKEYS.IS_LOADING_REPORT_DATA]: false,
}),
)

Expand All @@ -100,7 +101,7 @@ describe('Sidebar', () => {
it('includes an empty chat report if it has a draft', () => {
LHNTestUtils.getDefaultRenderedSidebarLinks();

// Given a new report
// Given a new report with a draft text
const report = {
...LHNTestUtils.getFakeReport([1, 2], 0),
hasDraft: true,
Expand All @@ -113,10 +114,11 @@ describe('Sidebar', () => {
Onyx.multiSet({
[`${ONYXKEYS.COLLECTION.REPORT}${report.reportID}`]: report,
[ONYXKEYS.PERSONAL_DETAILS_LIST]: LHNTestUtils.fakePersonalDetails,
[ONYXKEYS.IS_LOADING_REPORT_DATA]: false,
}),
)

// Then no reports are rendered in the LHN
// Then the report should be rendered in the LHN since it has a draft
.then(() => {
const hintText = Localize.translateLocal('accessibilityHints.chatUserDisplayNames');
const displayNames = screen.queryAllByLabelText(hintText);
Expand Down

0 comments on commit 53323f0

Please sign in to comment.