-
Notifications
You must be signed in to change notification settings - Fork 3.7k
Auto reporting: backward compatibility #70240
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
stitesExpensify
merged 62 commits into
Expensify:main
from
s77rt:add-SetWorkspaceAutoHarvesting
Oct 8, 2025
Merged
Changes from all commits
Commits
Show all changes
62 commits
Select commit
Hold shift + click to select a range
5a58af9
add setWorkspaceAutoHarvesting command
s77rt 596d9ea
update policy paramter type
s77rt 41d097e
call setWorkspaceAutoHarvesting on toggling delyed submission
s77rt 8162c2e
set pending field on autoReporting only
s77rt cb47073
Add Instantly to submission frequency options
s77rt 50f57c9
Rename “Delayed submission” to “Submission frequency”
s77rt 10f4dbe
translate
s77rt e5c9853
update report id and name based on autoreporting
s77rt 72fcc9b
Merge branch 'main' into add-SetWorkspaceAutoHarvesting
s77rt 55bb867
merge main
s77rt b128ea3
track expense: use money report only if chat is not selfDM
s77rt 36dc551
handle create unreported expense
s77rt dc4eb2e
Merge branch 'main' into add-SetWorkspaceAutoHarvesting
s77rt b8bebbf
merge main
s77rt 7bbea19
start flow with unreported report if autoreporting is off
s77rt 042d4a0
allow clearing report selection on create expense flow
s77rt 18b803c
set correct report when changing participants
s77rt 8006842
Revert "set correct report when changing participants"
s77rt 2b4cf14
set correct report when changing participants (2)
s77rt a8551fc
get self dm report
s77rt a224b9d
update transaction when coming back to amount step and updating parti…
s77rt 8ae68a2
Merge branch 'main' into add-SetWorkspaceAutoHarvesting
s77rt 93c59a9
handle report name and navigation in case no report is available
s77rt 023d88d
add s77rt comment
s77rt a9ae833
allow choosing no report if default option is 'New report'
s77rt 2ca3289
remove s77rt comment
s77rt 752992e
Fix "0" in param
s77rt 1ccc353
remove unnecessary picked field
s77rt dd9c5f6
set transaction report id after setting a participant in new flow
s77rt 292751a
clean up
s77rt edf7d3d
translate
s77rt 17fe33e
ts
s77rt 5a7d6c2
lint
s77rt a938564
spell fix
s77rt 9375448
lint
s77rt fba7b71
lint
s77rt 5d72cf6
lint
s77rt 00eb8d7
update translation
s77rt cae8d32
merge main
s77rt eee8170
optimisticaly build self dm report
s77rt 3c6151b
add comment
s77rt ea74d86
use usePersonalPolicy
s77rt 562ab2e
allow passing undefined report in TrackExpense
s77rt af74889
better type
s77rt 41a9c01
trackExpense default to self-DM if no report is passed
s77rt cea1f23
pass selfDMReportID and selfDMCreatedReportActionID to TrackExpense c…
s77rt 6552d5a
don't pass chatReportID if we are passing selfDMReportID to TrackExpense
s77rt e8be222
add optimistic onyx data for created self dm report
s77rt 86b8fc0
merge main
s77rt 3197216
TrackExpense: rename selfDMReportID/selfDMCreatedReportActionID to op…
s77rt 6ee3b06
revert unintentional change
s77rt 4070069
clean up and fix handling preexistingreport pattern
s77rt cf217f0
merge main
s77rt 898d024
merge main
s77rt 87e714b
revert report change logic
s77rt e59e005
ts + lint
s77rt cb9dde5
lint
s77rt eaaf8ac
merge main
s77rt 3080a2b
non-CREATE actions require a report
s77rt 83c7a18
fix lint
s77rt 88a175d
merge main
s77rt bb525d8
merge main
s77rt 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,24 @@ | ||
| import {useMemo} from 'react'; | ||
| import type {OnyxEntry} from 'react-native-onyx'; | ||
| import CONST from '@src/CONST'; | ||
| import ONYXKEYS from '@src/ONYXKEYS'; | ||
| import type Policy from '@src/types/onyx/Policy'; | ||
| import mapOnyxCollectionItems from '@src/utils/mapOnyxCollectionItems'; | ||
| import useOnyx from './useOnyx'; | ||
|
|
||
| type PolicySelector = Pick<Policy, 'id' | 'type' | 'autoReporting'>; | ||
|
|
||
| const policySelector = (policy: OnyxEntry<Policy>): PolicySelector => | ||
| (policy && { | ||
| id: policy.id, | ||
| type: policy.type, | ||
| autoReporting: policy.autoReporting, | ||
| }) as PolicySelector; | ||
|
|
||
| function usePersonalPolicy() { | ||
| const [allPolicies] = useOnyx(ONYXKEYS.COLLECTION.POLICY, {selector: (c) => mapOnyxCollectionItems(c, policySelector), canBeMissing: true}); | ||
| const personalPolicy = useMemo(() => Object.values(allPolicies ?? {}).find((policy) => policy?.type === CONST.POLICY.TYPE.PERSONAL), [allPolicies]); | ||
| return personalPolicy; | ||
| } | ||
|
|
||
| export default usePersonalPolicy; | ||
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
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
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
NAB: There was a discussion about sending the personal policy in Session Onyx Key so that it can be readily used. Not a blocker here but, perhaps, you can work later on the backend PR to send it to simplify this. Unrelated but same for self DM reportID too.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! I have replied there but we don't need to block on that
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's what I said too. 😃