Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
8ab23f4
Allow creating time expenses from global menu
mhawryluk Jan 16, 2026
34a3e84
Refactor and fixes
mhawryluk Jan 19, 2026
f6d3ab9
Merge branch 'main' into feat/time-expense-global-create
mhawryluk Jan 19, 2026
49e4c39
Merge branch 'feat/time-confirmation-hours-rate-edit' into feat/time-…
mhawryluk Jan 19, 2026
5eb6205
Fix eslint
mhawryluk Jan 19, 2026
52d9c44
Fix setting reportID on transaction in setMoneyRequestParticipantAsPo…
mhawryluk Jan 19, 2026
704325d
Merge branch 'main' into feat/time-expense-global-create
mhawryluk Jan 19, 2026
eb00d06
Implement review suggestions
mhawryluk Jan 20, 2026
f94caa3
Remove async from saveTime declaration
mhawryluk Jan 20, 2026
97a75f2
Fix reportID
mhawryluk Jan 20, 2026
f35e93e
Fix navigation on iOS when one workspace available in global time tab
mhawryluk Jan 20, 2026
a2579fa
Implement AI reviewer's suggestions
mhawryluk Jan 20, 2026
3f9b62d
Fix prettier
mhawryluk Jan 20, 2026
74a112f
Change IOURequestStepHours headerTitle
mhawryluk Jan 20, 2026
c8ffb45
Remove setMoneyRequestParticipantAsPolicyExpenseChat and refactor
mhawryluk Jan 20, 2026
9638050
Fix polish translation for "rate"
mhawryluk Jan 21, 2026
b18ae23
Merge branch 'main' into feat/time-expense-global-create
mhawryluk Jan 22, 2026
c4d5329
Replace two hours step routes with one route with a url parameter
mhawryluk Jan 22, 2026
9a8f960
Fix eslint
mhawryluk Jan 22, 2026
27b3ef2
Revert "Replace two hours step routes with one route with a url param…
mhawryluk Jan 23, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions src/ROUTES.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1322,6 +1322,11 @@ const ROUTES = {
getRoute: (action: IOUAction, iouType: IOUType, transactionID: string | undefined, reportID: string | undefined, reportActionID?: string) =>
`${action as string}/${iouType as string}/hours/${transactionID}/${reportID}${reportActionID ? `/${reportActionID}` : ''}` as const,
},
MONEY_REQUEST_STEP_HOURS_EDIT: {
route: ':action/:iouType/hours-edit/:transactionID/:reportID/:reportActionID?',
getRoute: (action: IOUAction, iouType: IOUType, transactionID: string | undefined, reportID: string | undefined, reportActionID?: string) =>
`${action as string}/${iouType as string}/hours-edit/${transactionID}/${reportID}${reportActionID ? `/${reportActionID}` : ''}` as const,
},
DISTANCE_REQUEST_CREATE: {
route: ':action/:iouType/start/:transactionID/:reportID/distance-new/:backToReport?',
getRoute: (action: IOUAction, iouType: IOUType, transactionID: string, reportID: string, backToReport?: string) =>
Expand Down
1 change: 1 addition & 0 deletions src/SCREENS.ts
Original file line number Diff line number Diff line change
Expand Up @@ -335,6 +335,7 @@ const SCREENS = {
RECEIPT_PREVIEW: 'Money_Request_Receipt_preview',
STEP_TIME_RATE: 'Money_Request_Step_Time_Rate',
STEP_HOURS: 'Money_Request_Step_Hours',
STEP_HOURS_EDIT: 'Money_Request_Step_Hours_Edit',
},

TRANSACTION_DUPLICATE: {
Expand Down
2 changes: 1 addition & 1 deletion src/components/MoneyRequestConfirmationListFooter.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -624,7 +624,7 @@ function MoneyRequestConfirmationListFooter({
if (!transactionID) {
return;
}
Navigation.navigate(ROUTES.MONEY_REQUEST_STEP_HOURS.getRoute(action, iouType, transactionID, reportID, reportActionID));
Navigation.navigate(ROUTES.MONEY_REQUEST_STEP_HOURS_EDIT.getRoute(action, iouType, transactionID, reportID, reportActionID));
}}
disabled={didConfirm}
interactive={!isReadOnly}
Expand Down
2 changes: 1 addition & 1 deletion src/languages/pl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -500,7 +500,7 @@ const translations: TranslationDeepObject<typeof en> = {
role: 'Rola',
currency: 'Waluta',
groupCurrency: 'Waluta grupy',
rate: 'Oceń',
rate: 'Stawka',
emptyLHN: {
title: 'Juhu! Wszystko nadrobione.',
subtitleText1: 'Znajdź czat za pomocą',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,7 @@ const MoneyRequestModalStackNavigator = createModalStackNavigator<MoneyRequestNa
[SCREENS.SET_DEFAULT_WORKSPACE]: () => require<ReactComponentModule>('../../../../pages/SetDefaultWorkspacePage').default,
[SCREENS.MONEY_REQUEST.STEP_TIME_RATE]: () => require<ReactComponentModule>('../../../../pages/iou/request/step/IOURequestStepTimeRate').default,
[SCREENS.MONEY_REQUEST.STEP_HOURS]: () => require<ReactComponentModule>('../../../../pages/iou/request/step/IOURequestStepHours').default,
[SCREENS.MONEY_REQUEST.STEP_HOURS_EDIT]: () => require<ReactComponentModule>('../../../../pages/iou/request/step/IOURequestStepHours').default,
});

const TravelModalStackNavigator = createModalStackNavigator<TravelNavigatorParamList>({
Expand Down
1 change: 1 addition & 0 deletions src/libs/Navigation/linkingConfig/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1524,6 +1524,7 @@ const config: LinkingOptions<RootNavigatorParamList>['config'] = {
[SCREENS.MONEY_REQUEST.STEP_SUBRATE_EDIT]: ROUTES.MONEY_REQUEST_STEP_SUBRATE_EDIT.route,
[SCREENS.MONEY_REQUEST.STEP_TIME_RATE]: ROUTES.MONEY_REQUEST_STEP_TIME_RATE.route,
[SCREENS.MONEY_REQUEST.STEP_HOURS]: ROUTES.MONEY_REQUEST_STEP_HOURS.route,
[SCREENS.MONEY_REQUEST.STEP_HOURS_EDIT]: ROUTES.MONEY_REQUEST_STEP_HOURS_EDIT.route,
[SCREENS.IOU_SEND.ENABLE_PAYMENTS]: ROUTES.IOU_SEND_ENABLE_PAYMENTS,
[SCREENS.IOU_SEND.ADD_BANK_ACCOUNT]: ROUTES.IOU_SEND_ADD_BANK_ACCOUNT,
[SCREENS.IOU_SEND.ADD_DEBIT_CARD]: ROUTES.IOU_SEND_ADD_DEBIT_CARD,
Expand Down
7 changes: 7 additions & 0 deletions src/libs/Navigation/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1958,6 +1958,13 @@ type MoneyRequestNavigatorParamList = {
reportID: string;
reportActionID: string;
};
[SCREENS.MONEY_REQUEST.STEP_HOURS_EDIT]: {
action: IOUAction;
iouType: Exclude<IOUType, typeof CONST.IOU.TYPE.REQUEST | typeof CONST.IOU.TYPE.SEND>;
transactionID: string;
reportID: string;
reportActionID: string;
};
};

type WorkspaceConfirmationNavigatorParamList = {
Expand Down
5 changes: 5 additions & 0 deletions src/libs/PolicyUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@

let allPolicies: OnyxCollection<Policy>;

Onyx.connect({

Check warning on line 63 in src/libs/PolicyUtils.ts

View workflow job for this annotation

GitHub Actions / Changed files ESLint check

Onyx.connect() is deprecated. Use useOnyx() hook instead and pass the data as parameters to a pure function
key: ONYXKEYS.COLLECTION.POLICY,
waitForCollectionCallback: true,
callback: (value) => (allPolicies = value),
Expand Down Expand Up @@ -107,6 +107,10 @@
});
}

function getActivePoliciesWithExpenseChatAndTimeEnabled(policies: OnyxCollection<Policy> | null, currentUserLogin: string | undefined): Policy[] {
return getActivePoliciesWithExpenseChat(policies, currentUserLogin).filter(isTimeTrackingEnabled);
}

/**
* Checks if the current user is an admin of the policy.
*/
Expand Down Expand Up @@ -1853,6 +1857,7 @@
isDefaultTagName,
isTimeTrackingEnabled,
getDefaultTimeTrackingRate,
getActivePoliciesWithExpenseChatAndTimeEnabled,
};

export type {MemberEmailsToAccountIDs};
27 changes: 22 additions & 5 deletions src/pages/iou/request/IOURequestStartPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ import {getIsUserSubmittedExpenseOrScannedReceipt} from '@libs/OptionsListUtils'
import Performance from '@libs/Performance';
import {
getActivePoliciesWithExpenseChatAndPerDiemEnabledAndHasRates,
getActivePoliciesWithExpenseChatAndTimeEnabled,
getPerDiemCustomUnit,
hasOnlyPersonalPolicies as hasOnlyPersonalPoliciesUtil,
isTimeTrackingEnabled,
Expand All @@ -51,6 +52,7 @@ import IOURequestStepDistance from './step/IOURequestStepDistance';
import IOURequestStepHours from './step/IOURequestStepHours';
import IOURequestStepPerDiemWorkspace from './step/IOURequestStepPerDiemWorkspace';
import IOURequestStepScan from './step/IOURequestStepScan';
import IOURequestStepTimeWorkspace from './step/IOURequestStepTimeWorkspace';
import type {WithWritableReportOrNotFoundProps} from './step/withWritableReportOrNotFound';

type IOURequestStartPageProps = WithWritableReportOrNotFoundProps<typeof SCREENS.MONEY_REQUEST.CREATE> & {
Expand Down Expand Up @@ -126,6 +128,10 @@ function IOURequestStartPage({
() => getActivePoliciesWithExpenseChatAndPerDiemEnabledAndHasRates(allPolicies, currentUserPersonalDetails.login),
[allPolicies, currentUserPersonalDetails.login],
);
const policiesWithTimeEnabled = useMemo(
() => getActivePoliciesWithExpenseChatAndTimeEnabled(allPolicies, currentUserPersonalDetails.login),
[allPolicies, currentUserPersonalDetails.login],
);
const doesPerDiemPolicyExist = policiesWithPerDiemEnabledAndHasRates.length > 0;
const moreThanOnePerDiemExist = policiesWithPerDiemEnabledAndHasRates.length > 1;
const hasCurrentPolicyPerDiemEnabled = !!policy?.arePerDiemRatesEnabled;
Expand Down Expand Up @@ -262,7 +268,10 @@ function IOURequestStartPage({
},
},
);
const shouldShowTimeOption = isBetaEnabled(CONST.BETAS.TIME_TRACKING) && iouType === CONST.IOU.TYPE.SUBMIT && !isFromGlobalCreate && hasCurrentPolicyTimeTrackingEnabled;
const shouldShowTimeOption =
isBetaEnabled(CONST.BETAS.TIME_TRACKING) &&
(iouType === CONST.IOU.TYPE.SUBMIT || iouType === CONST.IOU.TYPE.CREATE) &&
((!isFromGlobalCreate && hasCurrentPolicyTimeTrackingEnabled) || (isFromGlobalCreate && !!policiesWithTimeEnabled.length));

const onBackButtonPress = () => {
navigateBack();
Expand Down Expand Up @@ -380,10 +389,18 @@ function IOURequestStartPage({
<TopTab.Screen name={CONST.TAB_REQUEST.TIME}>
{() => (
<TabScreenWithFocusTrapWrapper>
<IOURequestStepHours
route={route}
navigation={navigation}
/>
{isFromGlobalCreate && policiesWithTimeEnabled.length > 1 ? (
<IOURequestStepTimeWorkspace
route={route}
navigation={navigation}
/>
) : (
<IOURequestStepHours
route={route}
navigation={navigation}
explicitPolicyID={isFromGlobalCreate ? policiesWithTimeEnabled.at(0)?.id : undefined}
/>
)}
</TabScreenWithFocusTrapWrapper>
)}
</TopTab.Screen>
Expand Down
106 changes: 106 additions & 0 deletions src/pages/iou/request/step/BaseRequestStepWorkspace.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
import React from 'react';
import {View} from 'react-native';
import type {OnyxCollection, OnyxEntry} from 'react-native-onyx';
import SearchBar from '@components/SearchBar';
import SelectionList from '@components/SelectionList';
import type {ListItem} from '@components/SelectionList/ListItem/types';
import UserListItem from '@components/SelectionList/ListItem/UserListItem';
import Text from '@components/Text';
import useCurrentUserPersonalDetails from '@hooks/useCurrentUserPersonalDetails';
import {useMemoizedLazyExpensifyIcons} from '@hooks/useLazyAsset';
import useLocalize from '@hooks/useLocalize';
import useOnyx from '@hooks/useOnyx';
import useSearchResults from '@hooks/useSearchResults';
import useThemeStyles from '@hooks/useThemeStyles';
import {sortWorkspacesBySelected} from '@libs/PolicyUtils';
import {getDefaultWorkspaceAvatar} from '@libs/ReportUtils';
import tokenizedSearch from '@libs/tokenizedSearch';
import CONST from '@src/CONST';
import ONYXKEYS from '@src/ONYXKEYS';
import type SCREENS from '@src/SCREENS';
import type {Policy} from '@src/types/onyx';
import type {WithFullTransactionOrNotFoundProps} from './withFullTransactionOrNotFound';
import withFullTransactionOrNotFound from './withFullTransactionOrNotFound';

type WorkspaceListItem = ListItem & {
value: string;
};

type BaseRequestStepWorkspaceProps = WithFullTransactionOrNotFoundProps<typeof SCREENS.MONEY_REQUEST.CREATE> & {
/** Function returning available workspaces for the list. */
getPolicies: (allPolicies: OnyxCollection<Policy>, currentUserLogin: string | undefined) => Policy[];

/** Function to run after selecting a workspace. */
onSelectWorkspace: (policy: OnyxEntry<Policy>) => void;
};

function BaseRequestStepWorkspace({transaction, getPolicies, onSelectWorkspace}: BaseRequestStepWorkspaceProps) {
const icons = useMemoizedLazyExpensifyIcons(['FallbackWorkspaceAvatar']);
const styles = useThemeStyles();
const {translate, localeCompare} = useLocalize();

const {login: currentUserLogin} = useCurrentUserPersonalDetails();
const [allPolicies] = useOnyx(ONYXKEYS.COLLECTION.POLICY, {canBeMissing: true});
const selectedWorkspace = transaction?.participants?.[0];
const availableWorkspaces = getPolicies(allPolicies, currentUserLogin);
const workspaceOptions: WorkspaceListItem[] = availableWorkspaces
.sort((policy1, policy2) =>
sortWorkspacesBySelected(
{policyID: policy1.id, name: policy1.name},
{policyID: policy2.id, name: policy2.name},
selectedWorkspace?.policyID ? [selectedWorkspace?.policyID] : [],
localeCompare,
),
)
.map((policy) => ({
text: policy.name,
value: policy.id,
keyForList: policy.id,
icons: [
{
id: policy.id,
source: policy?.avatarURL ? policy.avatarURL : getDefaultWorkspaceAvatar(policy.name),
fallbackIcon: icons.FallbackWorkspaceAvatar,
name: policy.name,
type: CONST.ICON_TYPE_WORKSPACE,
},
],
isSelected: selectedWorkspace?.policyID === policy.id,
}));

const filterWorkspace = (workspaceOption: WorkspaceListItem, searchInput: string) => {
const results = tokenizedSearch([workspaceOption], searchInput, (option) => [option.text ?? '']);
return results.length > 0;
};
const sortWorkspaces = (data: WorkspaceListItem[]) => data.sort((a, b) => localeCompare(a.text ?? '', b?.text ?? ''));
const [inputValue, setInputValue, filteredWorkspaceOptions] = useSearchResults(workspaceOptions, filterWorkspace, sortWorkspaces);

const selectWorkspace = (item: WorkspaceListItem) => onSelectWorkspace(allPolicies?.[`${ONYXKEYS.COLLECTION.POLICY}${item.value}`]);

return (
<>
{workspaceOptions.length > CONST.SEARCH_ITEM_LIMIT ? (
<SearchBar
label={translate('workspace.common.findWorkspace')}
inputValue={inputValue}
onChangeText={setInputValue}
shouldShowEmptyState={workspaceOptions.length > 0 && filteredWorkspaceOptions.length === 0}
/>
) : (
<View style={[styles.optionsListSectionHeader]}>
<Text style={[styles.ph5, styles.textLabelSupporting]}>{translate('iou.chooseWorkspace')}</Text>
</View>
)}
<SelectionList
key={selectedWorkspace?.policyID}
data={filteredWorkspaceOptions}
onSelectRow={selectWorkspace}
shouldSingleExecuteRowSelect
ListItem={UserListItem}
initiallyFocusedItemKey={selectedWorkspace?.policyID}
/>
</>
);
}

export default withFullTransactionOrNotFound(BaseRequestStepWorkspace);
51 changes: 36 additions & 15 deletions src/pages/iou/request/step/IOURequestStepHours.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,12 @@ import useOnyx from '@hooks/useOnyx';
import useResponsiveLayout from '@hooks/useResponsiveLayout';
import useShowNotFoundPageInIOUStep from '@hooks/useShowNotFoundPageInIOUStep';
import useThemeStyles from '@hooks/useThemeStyles';
import {setTransactionReport} from '@libs/actions/Transaction';
import {canUseTouchScreen as canUseTouchScreenUtil} from '@libs/DeviceCapabilities';
import {shouldUseTransactionDraft} from '@libs/IOUUtils';
import Navigation from '@libs/Navigation/Navigation';
import {getDefaultTimeTrackingRate} from '@libs/PolicyUtils';
import {getPolicyExpenseChat} from '@libs/ReportUtils';
import {computeTimeAmount, formatTimeMerchant} from '@libs/TimeTrackingUtils';
import variables from '@styles/variables';
import {setMoneyRequestAmount, setMoneyRequestMerchant, setMoneyRequestParticipantsFromReport, setMoneyRequestTimeCount, setMoneyRequestTimeRate} from '@userActions/IOU';
Expand All @@ -27,8 +29,12 @@ import withFullTransactionOrNotFound from './withFullTransactionOrNotFound';
import type {WithWritableReportOrNotFoundProps} from './withWritableReportOrNotFound';
import withWritableReportOrNotFound from './withWritableReportOrNotFound';

type IOURequestStepHoursProps = WithWritableReportOrNotFoundProps<typeof SCREENS.MONEY_REQUEST.CREATE | typeof SCREENS.MONEY_REQUEST.STEP_HOURS> &
WithFullTransactionOrNotFoundProps<typeof SCREENS.MONEY_REQUEST.CREATE | typeof SCREENS.MONEY_REQUEST.STEP_HOURS>;
type IOURequestStepHoursProps = WithWritableReportOrNotFoundProps<
typeof SCREENS.MONEY_REQUEST.CREATE | typeof SCREENS.MONEY_REQUEST.STEP_HOURS | typeof SCREENS.MONEY_REQUEST.STEP_HOURS_EDIT
> &
WithFullTransactionOrNotFoundProps<typeof SCREENS.MONEY_REQUEST.CREATE | typeof SCREENS.MONEY_REQUEST.STEP_HOURS | typeof SCREENS.MONEY_REQUEST.STEP_HOURS_EDIT> & {
explicitPolicyID?: string;
};

function IOURequestStepHours({
report,
Expand All @@ -37,9 +43,11 @@ function IOURequestStepHours({
name: routeName,
},
transaction,
explicitPolicyID,
}: IOURequestStepHoursProps) {
const isEditingConfirmation = routeName === SCREENS.MONEY_REQUEST.STEP_HOURS;
const policyID = report?.policyID;
const isEditingConfirmation = routeName === SCREENS.MONEY_REQUEST.STEP_HOURS_EDIT;
const isEmbeddedInStartPage = routeName === SCREENS.MONEY_REQUEST.CREATE;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This check looks outdated, now

Copy link
Contributor Author

@mhawryluk mhawryluk Jan 22, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it's not, this is for when the component is used directly in the "time" tab in the create expense RHP. so when starting to create an expense in a workspace chat or from global create, but when there is just one workspace

const policyID = explicitPolicyID ?? report?.policyID;
const isTransactionDraft = shouldUseTransactionDraft(action);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we can't edit the time expense, does that mean isTransactionDraft will always be true?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, I think isTransactionDraft is always true in this step, but I thought I would use the util anyways to make sure it's correct. but I can remove it if you want

const [selectedTab] = useOnyx(`${ONYXKEYS.COLLECTION.SELECTED_TAB}${CONST.TAB.IOU_REQUEST_TYPE}`, {canBeMissing: true});
const {accountID} = useCurrentUserPersonalDetails();
Expand Down Expand Up @@ -96,18 +104,36 @@ function IOURequestStepHours({
navigateBack();
return;
}

setMoneyRequestTimeRate(transactionID, rate, isTransactionDraft);
setMoneyRequestParticipantsFromReport(transactionID, report, accountID).then(() =>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should we remove this .then?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

that's a very good question. I first implemented it using .then cause this is how it's done in the manual step. but then @blazejkustra noticed that this doesn't follow our best practices, as we shouldn't return promises from actions and then wait for their completion. however this approach introduced a bug I noticed on iOS (although for setMoneyRequestParticipantAsPolicyExpenseChat, not setMoneyRequestParticipantsFromReport), navigation was incorrect when Onyx update hadn't completed yet and I fixed it (hopefully) by using Navigation.setNavigationActionToMicrotaskQueue which should ensure the navigation happens after onyx updates

Navigation.navigate(ROUTES.MONEY_REQUEST_STEP_CONFIRMATION.getRoute(CONST.IOU.ACTION.CREATE, iouType, transactionID, reportID)),
);

if (isEmbeddedInStartPage) {
if (explicitPolicyID) {
const policyExpenseChat = getPolicyExpenseChat(accountID, policyID);
if (!policyExpenseChat) {
console.error(`Couldn't find policy expense chat for policyID: ${policyID}`);
return;
}

setTransactionReport(transactionID, {reportID: policyExpenseChat.reportID}, isTransactionDraft);
setMoneyRequestParticipantsFromReport(transactionID, policyExpenseChat, accountID);

return Navigation.setNavigationActionToMicrotaskQueue(() =>
Navigation.navigate(ROUTES.MONEY_REQUEST_STEP_CONFIRMATION.getRoute(CONST.IOU.ACTION.CREATE, iouType, transactionID, policyExpenseChat.reportID)),
);
}
setMoneyRequestParticipantsFromReport(transactionID, report, accountID);
}
Comment on lines +110 to +126
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a reason we're setting report and participant here? I would expect this to happen when the user selects the workspace.

Copy link
Contributor Author

@mhawryluk mhawryluk Jan 23, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, we set it in IOURequestStepTimeWorkspace too for when there are multiple workspaces. here in IOURequestStepHours it is set for when the hours step is shown directly in the "time" tab in create expense RHP (in that case we don't go to the TimeWorkspace step at all, but instead to confirmation page directly)

creating an expense in workspace chat/report: isEmbeddedInStartPage: true, explicitPolicyID: undefined
creating from global menu, but there is one workspace only: isEmbeddedInStartPage: true, explicitPolicyID: defined
creating from global menu and there are multiple workspaces: isEmbeddedInStartPage: false


Navigation.navigate(ROUTES.MONEY_REQUEST_STEP_CONFIRMATION.getRoute(CONST.IOU.ACTION.CREATE, iouType, transactionID, reportID));
};

return (
<StepScreenWrapper
headerTitle={translate('iou.time')}
headerTitle={translate(isEditingConfirmation ? 'iou.timeTracking.hours' : 'iou.createExpense')}
onBackButtonPress={navigateBack}
testID="IOURequestStepHours"
shouldShowWrapper={isEditingConfirmation}
shouldShowWrapper={!isEmbeddedInStartPage}
includeSafeAreaPaddingBottom
shouldShowNotFoundPage={shouldShowNotFoundPage}
>
Expand Down Expand Up @@ -146,9 +172,4 @@ function IOURequestStepHours({
);
}

// eslint-disable-next-line rulesdir/no-negated-variables
const IOURequestStepHoursWithWritableReportOrNotFound = withWritableReportOrNotFound(IOURequestStepHours);
// eslint-disable-next-line rulesdir/no-negated-variables
const IOURequestStepHoursWithFullTransactionOrNotFound = withFullTransactionOrNotFound(IOURequestStepHoursWithWritableReportOrNotFound);

export default IOURequestStepHoursWithFullTransactionOrNotFound;
export default withFullTransactionOrNotFound(withWritableReportOrNotFound(IOURequestStepHours));
Loading
Loading