Skip to content
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

feat(expensify-card): add get physical card button and routes #28453

Merged
Changes from 1 commit
Commits
Show all changes
55 commits
Select commit Hold shift + click to select a range
a147db2
feat(expensify-card): add get physical card button and routes
pac-guerreiro Sep 29, 2023
ed99be3
style: apply prettier
pac-guerreiro Oct 12, 2023
2f21fbb
refactor(get physical card): rename translation keys to match onyx pr…
pac-guerreiro Oct 17, 2023
0f29db9
feat(get physical card): add missing spanish translations
pac-guerreiro Oct 17, 2023
2096411
refactor(get physical card): reuse UI from personal details address page
pac-guerreiro Oct 17, 2023
88e280b
fix(get physical card): wrong params passed to Navigation.goToNextPhy…
pac-guerreiro Oct 17, 2023
5c382ee
fix(get physical card): missing testID error on console
pac-guerreiro Oct 17, 2023
3993850
fix(get physical card): wrong data accessed during flow
pac-guerreiro Oct 17, 2023
3ea88a7
fix(wallet): wrong naming for domain card route
pac-guerreiro Oct 18, 2023
014f0bc
fix(get physical card): top margin on address page step
pac-guerreiro Oct 18, 2023
6530e75
fix(get physical card): wrong prop type supplied to children
pac-guerreiro Oct 18, 2023
4ff162d
refactor(get physical card): rename routes
pac-guerreiro Oct 18, 2023
53afcf3
fix(get physical card): wrong data sent through final API request
pac-guerreiro Oct 18, 2023
be37b21
refactor(get physical card): replace manual solution with existing util
pac-guerreiro Oct 18, 2023
d80f3d5
fix(get physical card): wrong layout on confirm page step
pac-guerreiro Oct 18, 2023
63a4de9
feat(get physical card): complete Spanish translation
pac-guerreiro Oct 19, 2023
28a309c
refactor: code style
pac-guerreiro Oct 23, 2023
53bfa83
feat(get physical card): use draft data for temporary modifications a…
pac-guerreiro Oct 23, 2023
5f5f158
refactor(get physical card): phone number validation logic
pac-guerreiro Oct 23, 2023
c69825c
fix(get physical card): wrong address displayed on confirmation page
pac-guerreiro Oct 24, 2023
2d61f54
chore(get physical card): add expensify card mock for testing purposes
pac-guerreiro Oct 24, 2023
8bbf4ab
fix(get physical card): formatted address showing undefined
pac-guerreiro Oct 24, 2023
6e28feb
fix(get physical card): wrong condition to render get physical card b…
pac-guerreiro Oct 24, 2023
d6b9d52
fix(get physical card): wrong mock data
pac-guerreiro Oct 24, 2023
d3772fe
fix(get physical card): wrong validation of address while getting nex…
pac-guerreiro Oct 25, 2023
f51068d
fix(get physical card): validate callback not returning an object cau…
pac-guerreiro Oct 25, 2023
1290c7c
fix(TextInput): container styles not applied to text input help message
pac-guerreiro Oct 26, 2023
456c7c9
fix(get physical card): broken phone number validation
pac-guerreiro Oct 26, 2023
f777b38
chore(get physical card): apply prettier
pac-guerreiro Oct 31, 2023
a9559f4
refactor(get physical card): separate utils from core navigation
pac-guerreiro Nov 6, 2023
d6b86f7
fix(get physical card): RHP getting closed on back button pressed
pac-guerreiro Nov 6, 2023
db37d3b
fix(get physical card): being able to access a step before completing…
pac-guerreiro Nov 6, 2023
67449d7
fix(get physical card): navigating from confirmation page not pushing…
pac-guerreiro Nov 6, 2023
d2576bb
fix(get physical card): user getting redirected to confirm page when …
pac-guerreiro Nov 6, 2023
2d09ef7
fix(get physical card): redirect not replacing current screen on navi…
pac-guerreiro Nov 6, 2023
bbaea03
fix(get physical card): draft values initialization
pac-guerreiro Nov 6, 2023
16f8494
fix: invalid types on setDraftValues
pac-guerreiro Nov 8, 2023
26f0ac7
refactor: migrate FormActions to Typescript
pac-guerreiro Nov 8, 2023
314c7b7
fix: add missing getPhysicalCardFormDraft
pac-guerreiro Nov 8, 2023
a9f18aa
fix(get physical card): add missing onyx value types
pac-guerreiro Nov 8, 2023
8d11d57
chore(get physical card): removed mock data
pac-guerreiro Nov 13, 2023
40acd98
doc(get physical card): add better comments to address fields
pac-guerreiro Nov 13, 2023
218f194
chore(get physical card): remove unused import
pac-guerreiro Nov 13, 2023
6fe8995
Merge branch 'main' into feature/add-get-physical-card-button-and-nec…
pac-guerreiro Nov 15, 2023
47ad65e
chore: remove unused file
pac-guerreiro Nov 15, 2023
3172f9a
refactor: use form utils to get draft key
pac-guerreiro Nov 15, 2023
8bb38f4
feat(get physical card): enable physical card request to API
pac-guerreiro Nov 16, 2023
e600b84
Merge branch 'main' into feature/add-get-physical-card-button-and-nec…
pac-guerreiro Nov 16, 2023
f213505
fix(get physical card): being able to access the flow with the draft …
pac-guerreiro Nov 18, 2023
41b7976
fix(get physical card): being able to access the flow when the domain…
pac-guerreiro Nov 18, 2023
e831853
fix(get physical card): ability to access the flow when there is no p…
pac-guerreiro Nov 18, 2023
57cf5e5
fix(expensify card): pressing go back button on not found state close…
pac-guerreiro Nov 18, 2023
d0ea79a
fix(get physical card): wrong accessibility prop names
pac-guerreiro Nov 18, 2023
1054b16
Merge branch 'main' into feature/add-get-physical-card-button-and-nec…
pac-guerreiro Nov 18, 2023
56554f6
style: apply linter
pac-guerreiro Nov 18, 2023
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
Prev Previous commit
Next Next commit
refactor: migrate FormActions to Typescript
pac-guerreiro committed Nov 14, 2023

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
commit 26f0ac775839a136ff9c55dfd4215305c36c9edb
7 changes: 6 additions & 1 deletion src/libs/FormUtils.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
function getDraftKey(formID: string) {
import {OnyxFormKey} from '@src/ONYXKEYS';

type ExcludeDraft<T> = T extends `${string}Draft` ? never : T;
type OnyxFormKeyWithoutDraft = ExcludeDraft<OnyxFormKey>;

function getDraftKey(formID: OnyxFormKeyWithoutDraft): `${OnyxFormKeyWithoutDraft}Draft` {
return `${formID}Draft`;
}

10 changes: 9 additions & 1 deletion src/libs/actions/FormActions.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import Onyx from 'react-native-onyx';
import {KeyValueMapping, NullishDeep} from 'react-native-onyx/lib/types';
import FormUtils from '@libs/FormUtils';
import {OnyxFormKey} from '@src/ONYXKEYS';
import {Form} from '@src/types/onyx';
import * as OnyxCommon from '@src/types/onyx/OnyxCommon';
@@ -23,4 +24,11 @@ function setDraftValues(formID: OnyxFormKeyWithoutDraft, draftValues: NullishDee
Onyx.merge(`${formID}Draft`, draftValues);
}

export {setDraftValues, setErrorFields, setErrors, setIsLoading};
/**
* @param formID
*/
function clearDraftValues(formID: OnyxFormKeyWithoutDraft) {
Onyx.merge(FormUtils.getDraftKey(formID), undefined);
}

export {setDraftValues, setErrorFields, setErrors, setIsLoading, clearDraftValues};