Repository navigation
Fix workspace change #71136
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
Fix workspace change #71136
Changes from all commits
Commits
Show all changes
23 commits
Select commit
Hold shift + click to select a range
75274d6
fix change workspace condition
luacmartins 12b5bea
fix workspace change
luacmartins 039caa3
Merge branch 'main' into cmartins-fixWorkspaceChange
luacmartins a0f1495
rm iou condition
luacmartins dbdd9c0
refactor method
luacmartins dba3412
update tests
luacmartins 51e4e8d
rm call to getPolicy
luacmartins ec812bd
update optimistic data
luacmartins 8506364
rm unused code
luacmartins deef747
rm comment
luacmartins 478ee8f
update moveIOUReportToPolicyAndInviteSubmitter
luacmartins 6b3475c
fix prettier
luacmartins 61db495
fix tests
luacmartins 964ee73
resolve conflicts
luacmartins 68b44cc
update param;
luacmartins 03153e6
fix error
luacmartins d8c06a9
dry code
luacmartins 3d6b529
fix lint
luacmartins 3aa34ad
fix onyx updates
luacmartins 86bebc0
fix eslint
luacmartins 2e8d637
rm getLoginByAccountID
luacmartins e396c6f
resolve conflicts
luacmartins 34d7692
fix error
luacmartins 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
Some comments aren't visible on the classic Files Changed page.
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -40,6 +40,11 @@ function ReportChangeWorkspacePage({report, route}: ReportChangeWorkspacePagePro | |
| const [session] = useOnyx(ONYXKEYS.SESSION, {canBeMissing: false}); | ||
| const [isLoadingApp] = useOnyx(ONYXKEYS.IS_LOADING_APP, {canBeMissing: false}); | ||
| const isReportLastVisibleArchived = useReportIsArchived(report?.parentReportID); | ||
| const [submitterEmail] = useOnyx( | ||
| ONYXKEYS.PERSONAL_DETAILS_LIST, | ||
| {canBeMissing: false, selector: (personalDetailsList) => personalDetailsList?.[report?.ownerAccountID ?? CONST.DEFAULT_NUMBER_ID]?.login}, | ||
|
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. @luacmartins Small Note: We don't use the inline selectors now as it is slower in performance. |
||
| [report?.ownerAccountID], | ||
| ); | ||
| const shouldShowLoadingIndicator = isLoadingApp && !isOffline; | ||
|
|
||
| const selectPolicy = useCallback( | ||
|
|
@@ -51,9 +56,9 @@ function ReportChangeWorkspacePage({report, route}: ReportChangeWorkspacePagePro | |
| const {backTo} = route.params; | ||
| Navigation.goBack(backTo); | ||
| if (isIOUReport(reportID)) { | ||
| const invite = moveIOUReportToPolicyAndInviteSubmitter(reportID, policy?.id, formatPhoneNumber); | ||
| const invite = moveIOUReportToPolicyAndInviteSubmitter(reportID, policy, formatPhoneNumber); | ||
| if (!invite?.policyExpenseChatReportID) { | ||
| moveIOUReportToPolicy(reportID, policy?.id); | ||
| moveIOUReportToPolicy(reportID, policy); | ||
| } | ||
| // This will be fixed as part of https://github.com/Expensify/Expensify/issues/507850 | ||
| // eslint-disable-next-line deprecation/deprecation | ||
|
|
@@ -67,8 +72,6 @@ function ReportChangeWorkspacePage({report, route}: ReportChangeWorkspacePagePro | |
| [route.params, report, reportID, reportNextStep, policies, formatPhoneNumber, isReportLastVisibleArchived], | ||
| ); | ||
|
|
||
| const submitterEmail = getLoginByAccountID(report?.ownerAccountID ?? CONST.DEFAULT_NUMBER_ID); | ||
|
|
||
| const {sections, shouldShowNoResultsFoundMessage, shouldShowSearchInput} = useWorkspaceList({ | ||
| policies, | ||
| currentUserLogin: session?.email, | ||
|
|
||
Oops, something went wrong.
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.