-
Notifications
You must be signed in to change notification settings - Fork 3.7k
feat: skip participant step in create flow #56090
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
805d38c
feat: skip participant step in the create flow
nkdengineer 4473b2d
fix lint
nkdengineer 5d5779d
Merge branch 'main' into fix/55717
nkdengineer 9cefca8
add right icon
nkdengineer e8362fe
remove unnecessary condition
nkdengineer 9e3a994
Merge branch 'main' into fix/55717
nkdengineer 75a3fa5
remove unchange
nkdengineer 95378a4
Merge branch 'main' into fix/55717
nkdengineer d99cf55
fix navigate logic of To section
nkdengineer d11a361
Merge branch 'main' into fix/55717
nkdengineer 52b5cdb
remove setHover
nkdengineer 43cab68
prevent auto assign for send invoice
nkdengineer 17be045
Merge branch 'main' into fix/55717
nkdengineer File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -10,7 +10,8 @@ import {createDraftTransaction, removeDraftTransaction} from '@libs/actions/Tran | |
| import {convertToBackendAmount, isValidCurrencyCode} from '@libs/CurrencyUtils'; | ||
| import Navigation from '@libs/Navigation/Navigation'; | ||
| import {getParticipantsOption, getReportOption} from '@libs/OptionsListUtils'; | ||
| import {getBankAccountRoute, getTransactionDetails, isArchivedReport, isPolicyExpenseChat} from '@libs/ReportUtils'; | ||
| import {isPaidGroupPolicy} from '@libs/PolicyUtils'; | ||
| import {getBankAccountRoute, getPolicyExpenseChat, getTransactionDetails, isArchivedReport, isPolicyExpenseChat} from '@libs/ReportUtils'; | ||
| import playSound, {SOUNDS} from '@libs/Sound'; | ||
| import {calculateTaxAmount, getAmount, getCurrency, getDefaultTaxCode, getRequestType, getTaxValue} from '@libs/TransactionUtils'; | ||
| import MoneyRequestAmountForm from '@pages/iou/MoneyRequestAmountForm'; | ||
|
|
@@ -76,6 +77,8 @@ function IOURequestStepAmount({ | |
| const [draftTransaction] = useOnyx(`${ONYXKEYS.COLLECTION.TRANSACTION_DRAFT}${transactionID}`); | ||
| const [splitDraftTransaction] = useOnyx(`${ONYXKEYS.COLLECTION.SPLIT_TRANSACTION_DRAFT}${transactionID}`); | ||
| const [skipConfirmation] = useOnyx(`${ONYXKEYS.COLLECTION.SKIP_CONFIRMATION}${transactionID}`); | ||
| const [activePolicyID] = useOnyx(ONYXKEYS.NVP_ACTIVE_POLICY_ID); | ||
| const [activePolicy] = useOnyx(`${ONYXKEYS.COLLECTION.POLICY}${activePolicyID}`); | ||
|
|
||
| const isEditing = action === CONST.IOU.ACTION.EDIT; | ||
| const isSplitBill = iouType === CONST.IOU.TYPE.SPLIT; | ||
|
|
@@ -249,7 +252,20 @@ function IOURequestStepAmount({ | |
|
|
||
| // If there was no reportID, then that means the user started this flow from the global + menu | ||
| // and an optimistic reportID was generated. In that case, the next step is to select the participants for this expense. | ||
| navigateToParticipantPage(); | ||
| if (iouType === CONST.IOU.TYPE.CREATE && isPaidGroupPolicy(activePolicy) && activePolicy?.isPolicyExpenseChatEnabled) { | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You forgot to block users when they have expired WS. See #56829 |
||
| const activePolicyExpenseChat = getPolicyExpenseChat(currentUserPersonalDetails.accountID, activePolicy?.id); | ||
| setMoneyRequestParticipantsFromReport(transactionID, activePolicyExpenseChat); | ||
| Navigation.navigate( | ||
| ROUTES.MONEY_REQUEST_STEP_CONFIRMATION.getRoute( | ||
| CONST.IOU.ACTION.CREATE, | ||
| iouType === CONST.IOU.TYPE.CREATE ? CONST.IOU.TYPE.SUBMIT : iouType, | ||
| transactionID, | ||
| activePolicyExpenseChat?.reportID, | ||
| ), | ||
| ); | ||
| } else { | ||
| navigateToParticipantPage(); | ||
| } | ||
| }; | ||
|
|
||
| const saveAmountAndCurrency = ({amount, paymentMethod}: AmountParams) => { | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -35,7 +35,8 @@ import {shouldStartLocationPermissionFlow} from '@libs/IOUUtils'; | |
| import Log from '@libs/Log'; | ||
| import Navigation from '@libs/Navigation/Navigation'; | ||
| import {getParticipantsOption, getReportOption} from '@libs/OptionsListUtils'; | ||
| import {isArchivedReport, isPolicyExpenseChat} from '@libs/ReportUtils'; | ||
| import {isPaidGroupPolicy} from '@libs/PolicyUtils'; | ||
| import {getPolicyExpenseChat, isArchivedReport, isPolicyExpenseChat} from '@libs/ReportUtils'; | ||
| import playSound, {SOUNDS} from '@libs/Sound'; | ||
| import {getDefaultTaxCode} from '@libs/TransactionUtils'; | ||
| import ReceiptDropUI from '@pages/iou/ReceiptDropUI'; | ||
|
|
@@ -98,6 +99,8 @@ function IOURequestStepScan({ | |
| const policy = usePolicy(report?.policyID); | ||
| const [personalDetails] = useOnyx(ONYXKEYS.PERSONAL_DETAILS_LIST); | ||
| const [skipConfirmation] = useOnyx(`${ONYXKEYS.COLLECTION.SKIP_CONFIRMATION}${transactionID}`); | ||
| const [activePolicyID] = useOnyx(ONYXKEYS.NVP_ACTIVE_POLICY_ID); | ||
| const [activePolicy] = useOnyx(`${ONYXKEYS.COLLECTION.POLICY}${activePolicyID}`); | ||
| const [isLoadingReceipt, setIsLoadingReceipt] = useState(false); | ||
|
|
||
| const [videoConstraints, setVideoConstraints] = useState<MediaTrackConstraints>(); | ||
|
|
@@ -324,7 +327,20 @@ function IOURequestStepScan({ | |
| // If the user started this flow using the Create expense option (combined submit/track flow), they should be redirected to the participants page. | ||
| // eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing | ||
| if ((transaction?.isFromGlobalCreate && iouType !== CONST.IOU.TYPE.TRACK && !report?.reportID) || iouType === CONST.IOU.TYPE.CREATE) { | ||
nkdengineer marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| navigateToParticipantPage(); | ||
| if (isPaidGroupPolicy(activePolicy)) { | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You forgot to check for |
||
| const activePolicyExpenseChat = getPolicyExpenseChat(currentUserPersonalDetails.accountID, activePolicy?.id); | ||
| setMoneyRequestParticipantsFromReport(transactionID, activePolicyExpenseChat); | ||
| Navigation.navigate( | ||
| ROUTES.MONEY_REQUEST_STEP_CONFIRMATION.getRoute( | ||
| CONST.IOU.ACTION.CREATE, | ||
| iouType === CONST.IOU.TYPE.CREATE ? CONST.IOU.TYPE.SUBMIT : iouType, | ||
| transactionID, | ||
| activePolicyExpenseChat?.reportID, | ||
| ), | ||
| ); | ||
| } else { | ||
| navigateToParticipantPage(); | ||
| } | ||
| return; | ||
| } | ||
|
|
||
|
|
@@ -439,23 +455,24 @@ function IOURequestStepScan({ | |
| [ | ||
| backTo, | ||
| transaction?.isFromGlobalCreate, | ||
| transaction?.attendees, | ||
| transaction?.currency, | ||
| transaction?.created, | ||
| transaction?.attendees, | ||
| iouType, | ||
| report, | ||
| transactionID, | ||
| shouldSkipConfirmation, | ||
| navigateToConfirmationPage, | ||
| activePolicy, | ||
| currentUserPersonalDetails.accountID, | ||
| currentUserPersonalDetails.login, | ||
| navigateToParticipantPage, | ||
| personalDetails, | ||
| currentUserPersonalDetails.login, | ||
| currentUserPersonalDetails.accountID, | ||
| createTransaction, | ||
| reportID, | ||
| transactionTaxCode, | ||
| transactionTaxAmount, | ||
| policy, | ||
| createTransaction, | ||
| ], | ||
| ); | ||
|
|
||
|
|
||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.