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

[#Wave-Control: Add NetSuite]: Settings Configuration in NewDot: Import - Add Custom Records/Lists #44942

Merged
merged 122 commits into from
Jul 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
122 commits
Select commit Hold shift + click to select a range
05b5bdc
feat: list page route setup
mananjadhav Jul 2, 2024
b65100b
feat: list data setup
mananjadhav Jul 3, 2024
6d342a4
refactor: run prettier
mananjadhav Jul 3, 2024
5d9762a
feat: added empty section
mananjadhav Jul 3, 2024
76af921
fix: button size
mananjadhav Jul 3, 2024
5d4e85c
feat: route setup for view
mananjadhav Jul 3, 2024
80bd671
feat: add illustration
mananjadhav Jul 3, 2024
ad894e0
feat: added field view
mananjadhav Jul 3, 2024
eb8d226
fix: type errors
mananjadhav Jul 3, 2024
b3cc001
feat: added remove button
mananjadhav Jul 3, 2024
0ee4fc4
fix: styling
mananjadhav Jul 3, 2024
109b1f6
Merge branch 'mj-netsuite-import-field-pages' into mj-netsuite-custom…
mananjadhav Jul 3, 2024
07dbca6
feat: added remove modal
mananjadhav Jul 3, 2024
709f355
fix: rename file
mananjadhav Jul 3, 2024
556ba2a
fix: ui with delete modal
mananjadhav Jul 3, 2024
68113e7
feat: add custom lists api
mananjadhav Jul 3, 2024
9f0e5f3
feat: edit route setup added
mananjadhav Jul 4, 2024
ef64497
feat: form setup
mananjadhav Jul 4, 2024
f178092
feat: integrate with api
mananjadhav Jul 4, 2024
cc9301a
Merge branch 'main' of github.com:mananjadhav/App into mj-netsuite-cu…
mananjadhav Jul 4, 2024
2ef3645
fix: display
mananjadhav Jul 4, 2024
3639b48
fix: remove unncessary space
mananjadhav Jul 4, 2024
d9570bd
feat: added selection view for the edit
mananjadhav Jul 4, 2024
f0ef7d6
refactor: remove render html dependency
mananjadhav Jul 4, 2024
8502717
refactor: help link alignment
mananjadhav Jul 4, 2024
c50f048
Merge branch 'mj-netsuite-import-field-pages' into mj-netsuite-custom…
mananjadhav Jul 4, 2024
6ae5916
refactor: rename prop
mananjadhav Jul 4, 2024
3fcc6b1
fix: condition and connection name
mananjadhav Jul 4, 2024
9ec0bbe
Merge branch 'mj-netsuite-import-field-pages' into mj-netsuite-custom…
mananjadhav Jul 4, 2024
48ee00c
refactor: design cleanup
mananjadhav Jul 4, 2024
270f908
Merge branch 'main' of github.com:mananjadhav/App into mj-netsuite-cu…
mananjadhav Jul 4, 2024
2b52386
fix: remove unwanted change
mananjadhav Jul 4, 2024
ced69f7
refactor: update types
mananjadhav Jul 5, 2024
24ab30e
fix: redirect issue with updated internalID
mananjadhav Jul 5, 2024
21eeb14
Merge branch 'main' of github.com:mananjadhav/App into mj-netsuite-cu…
mananjadhav Jul 5, 2024
4157da2
refactor: run prettier
mananjadhav Jul 5, 2024
21c5515
fix: pluralize
mananjadhav Jul 5, 2024
ac94677
fix: safe padding
mananjadhav Jul 5, 2024
0c75cfe
refactor: use index for all routes
mananjadhav Jul 5, 2024
4647793
refactor: move segment name checks to util
mananjadhav Jul 5, 2024
160c301
feat: form setup for custom record
mananjadhav Jul 6, 2024
a6b5991
feat: added steps to custom lists
mananjadhav Jul 6, 2024
dae79bf
feat: finish custom list form ui
mananjadhav Jul 6, 2024
0dd225c
feat: integrate api call
mananjadhav Jul 6, 2024
8b798a8
refactor: internalID logic
mananjadhav Jul 6, 2024
c1c3c1d
feat: added pending changes for custom lists and route for custom seg…
mananjadhav Jul 7, 2024
6244f98
feat: segment type step and segment name step
mananjadhav Jul 7, 2024
246439e
refactor: update segment name field
mananjadhav Jul 7, 2024
1e0eff8
feat: pending form fields of custom segment
mananjadhav Jul 7, 2024
40d34b7
fix: field name and confirm step
mananjadhav Jul 7, 2024
16bc5d8
fix: default selection for lists
mananjadhav Jul 7, 2024
61c7368
fix: on select from list
mananjadhav Jul 7, 2024
fc67d7a
feat: fix error messages
mananjadhav Jul 7, 2024
b1afd22
refactor: replace input field with picker
mananjadhav Jul 7, 2024
d9d5bcd
fix: subtitle alignment
mananjadhav Jul 7, 2024
12629ee
fix: selection bug
mananjadhav Jul 7, 2024
ada8cb8
fix: padding for bottom
mananjadhav Jul 7, 2024
6b38f4c
fix: header height in native
mananjadhav Jul 7, 2024
fe72ba7
fix: default value selection
mananjadhav Jul 7, 2024
555be5c
fix: minor ui fixes
mananjadhav Jul 7, 2024
91eb969
feat: missing temp keys
mananjadhav Jul 7, 2024
b222ff1
refactor: change editable logic
mananjadhav Jul 8, 2024
24d11b0
fix: added unique validation
mananjadhav Jul 8, 2024
ea73256
fix: added unique validations in add flow
mananjadhav Jul 8, 2024
c7e401a
fix: added validation for edit
mananjadhav Jul 8, 2024
ed1a573
refactor: feedback comments
mananjadhav Jul 8, 2024
5695c02
fix: added spanish keys
mananjadhav Jul 8, 2024
0895a28
fix: remove extra key
mananjadhav Jul 8, 2024
016cd8a
fix: use const
mananjadhav Jul 8, 2024
0c1e68a
refactor: code cleanup and fix back url
mananjadhav Jul 8, 2024
a61e61e
refactor: run prettier
mananjadhav Jul 8, 2024
47c5d4f
fix: remove background
mananjadhav Jul 8, 2024
77ef671
refactor: modify form logic to not use draft
mananjadhav Jul 8, 2024
e69762f
refactor: run prettier
mananjadhav Jul 8, 2024
989db44
Merge branch 'main' of github.com:mananjadhav/App into mj-netsuite-ad…
mananjadhav Jul 8, 2024
27a5b4f
refactor: run prettier
mananjadhav Jul 8, 2024
5649650
fix: allow saving draft
mananjadhav Jul 8, 2024
4ee2bc7
fix: split form context
mananjadhav Jul 8, 2024
cfbe1df
refactor: code cleanup
mananjadhav Jul 8, 2024
22a4d4d
fix: remove next button and default selection
mananjadhav Jul 8, 2024
84dc149
feat: refacto list picker
mananjadhav Jul 8, 2024
661538c
Revert "feat: refacto list picker"
mananjadhav Jul 9, 2024
518cc94
refactor: form updates for list picker
mananjadhav Jul 9, 2024
2e2cbbc
fix: delete issue
mananjadhav Jul 9, 2024
bba9b6f
refactor: remove undefined
mananjadhav Jul 9, 2024
72a2f5b
fix: added back handler
mananjadhav Jul 9, 2024
7b26325
feat: added spanish translations
mananjadhav Jul 9, 2024
8142567
refactor: rename illustrations
mananjadhav Jul 9, 2024
1dc829d
refactor: run prettier
mananjadhav Jul 9, 2024
7935649
fix: delete op
mananjadhav Jul 9, 2024
aee9ce2
fix: remove unwanted change
mananjadhav Jul 9, 2024
472b690
docs: added jsdocs
mananjadhav Jul 9, 2024
f2009a3
Merge branch 'mj-netsuite-add-custom-records' of github.com:mananjadh…
mananjadhav Jul 9, 2024
f41131e
docs: added types
mananjadhav Jul 9, 2024
2786745
docs: added jsdocs
mananjadhav Jul 9, 2024
b008812
docs: added jsdocs
mananjadhav Jul 9, 2024
d0ce3ee
fix: added draft for transaction field id
mananjadhav Jul 9, 2024
187f9df
fix: add submit button
mananjadhav Jul 9, 2024
478bd50
fix: navigation go back fix
mananjadhav Jul 9, 2024
ee370f7
feat: added ofline behavior
mananjadhav Jul 9, 2024
e12ef92
fix: disable edit when update in progress
mananjadhav Jul 9, 2024
4e635e0
Merge branch 'main' of github.com:mananjadhav/App into mj-netsuite-ad…
mananjadhav Jul 9, 2024
a2fbbbb
fix: enableoffline for form
mananjadhav Jul 9, 2024
9989746
fix: remove disabled checks
mananjadhav Jul 9, 2024
67be3f9
Revert "fix: remove disabled checks"
mananjadhav Jul 9, 2024
fb90f4a
fix: added blocked when pending action
mananjadhav Jul 9, 2024
bb33ff2
refactor: replace parser import
mananjadhav Jul 9, 2024
7481199
feat: is disabled button for form
mananjadhav Jul 9, 2024
059c61b
fix: disable add button
mananjadhav Jul 9, 2024
be25ced
fix: added dependency
mananjadhav Jul 9, 2024
20ee1fc
refactor: run prettier
mananjadhav Jul 9, 2024
4df92ab
fix: add button flex
mananjadhav Jul 9, 2024
6778848
fix: hide internal id in custom list
mananjadhav Jul 9, 2024
9f4f23b
fix: remove draft logic
mananjadhav Jul 9, 2024
d6d9e4e
refactor: code clean up
mananjadhav Jul 9, 2024
0363247
refactor: code cleanup
mananjadhav Jul 9, 2024
21861e2
refactor: use const
mananjadhav Jul 9, 2024
886513e
refactor: rename type and field
mananjadhav Jul 9, 2024
1225927
refactor: rename type and field
mananjadhav Jul 9, 2024
0c5f67b
Merge branch 'main' of github.com:mananjadhav/App into mj-netsuite-ad…
mananjadhav Jul 9, 2024
8db3ff8
fix: variable names
mananjadhav Jul 9, 2024
121f247
refactor: run prettier
mananjadhav Jul 9, 2024
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
41 changes: 40 additions & 1 deletion src/CONST.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1447,7 +1447,12 @@ const CONST = {
3: 'createAccessToken',
4: 'enterCredentials',
},
IMPORT_CUSTOM_FIELDS: ['customSegments', 'customLists'],
IMPORT_CUSTOM_FIELDS: {
CUSTOM_SEGMENTS: 'customSegments',
CUSTOM_LISTS: 'customLists',
},
CUSTOM_SEGMENT_FIELDS: ['segmentName', 'internalID', 'scriptID', 'mapping'],
CUSTOM_LIST_FIELDS: ['listName', 'internalID', 'transactionFieldID', 'mapping'],
CUSTOM_FORM_ID_TYPE: {
REIMBURSABLE: 'reimbursable',
NON_REIMBURSABLE: 'nonReimbursable',
Expand All @@ -1466,6 +1471,40 @@ const CONST = {
JOBS: 'jobs',
},
},
NETSUITE_CUSTOM_LIST_LIMIT: 8,
NETSUITE_ADD_CUSTOM_LIST_STEP_NAMES: ['1', '2,', '3', '4'],
NETSUITE_ADD_CUSTOM_SEGMENT_STEP_NAMES: ['1', '2,', '3', '4', '5', '6,'],
},

NETSUITE_CUSTOM_FIELD_SUBSTEP_INDEXES: {
CUSTOM_LISTS: {
CUSTOM_LIST_PICKER: 0,
TRANSACTION_FIELD_ID: 1,
MAPPING: 2,
CONFIRM: 3,
},
CUSTOM_SEGMENTS: {
SEGMENT_TYPE: 0,
SEGMENT_NAME: 1,
INTERNAL_ID: 2,
SCRIPT_ID: 3,
MAPPING: 4,
CONFIRM: 5,
},
},

NETSUITE_CUSTOM_RECORD_TYPES: {
CUSTOM_SEGMENT: 'customSegment',
CUSTOM_RECORD: 'customRecord',
},

NETSUITE_FORM_STEPS_HEADER_HEIGHT: 40,

NETSUITE_IMPORT: {
HELP_LINKS: {
CUSTOM_SEGMENTS: 'https://help.expensify.com/articles/expensify-classic/integrations/accounting-integrations/NetSuite#custom-segments',
CUSTOM_LISTS: 'https://help.expensify.com/articles/expensify-classic/integrations/accounting-integrations/NetSuite#custom-lists',
},
},

NETSUITE_EXPORT_DATE: {
Expand Down
9 changes: 9 additions & 0 deletions src/ONYXKEYS.ts
Original file line number Diff line number Diff line change
Expand Up @@ -560,6 +560,12 @@ const ONYXKEYS = {
ISSUE_NEW_EXPENSIFY_CARD_FORM_DRAFT: 'issueNewExpensifyCardDraft',
SAGE_INTACCT_CREDENTIALS_FORM: 'sageIntacctCredentialsForm',
SAGE_INTACCT_CREDENTIALS_FORM_DRAFT: 'sageIntacctCredentialsFormDraft',
NETSUITE_CUSTOM_FIELD_FORM: 'netSuiteCustomFieldForm',
NETSUITE_CUSTOM_FIELD_FORM_DRAFT: 'netSuiteCustomFieldFormDraft',
NETSUITE_CUSTOM_SEGMENT_ADD_FORM: 'netSuiteCustomSegmentAddForm',
NETSUITE_CUSTOM_SEGMENT_ADD_FORM_DRAFT: 'netSuiteCustomSegmentAddFormDraft',
NETSUITE_CUSTOM_LIST_ADD_FORM: 'netSuiteCustomListAddForm',
NETSUITE_CUSTOM_LIST_ADD_FORM_DRAFT: 'netSuiteCustomListAddFormDraft',
NETSUITE_TOKEN_INPUT_FORM: 'netsuiteTokenInputForm',
NETSUITE_TOKEN_INPUT_FORM_DRAFT: 'netsuiteTokenInputFormDraft',
NETSUITE_CUSTOM_FORM_ID_FORM: 'netsuiteCustomFormIDForm',
Expand Down Expand Up @@ -629,6 +635,9 @@ type OnyxFormValuesMapping = {
[ONYXKEYS.FORMS.SUBSCRIPTION_SIZE_FORM]: FormTypes.SubscriptionSizeForm;
[ONYXKEYS.FORMS.ISSUE_NEW_EXPENSIFY_CARD_FORM]: FormTypes.IssueNewExpensifyCardForm;
[ONYXKEYS.FORMS.SAGE_INTACCT_CREDENTIALS_FORM]: FormTypes.SageIntactCredentialsForm;
[ONYXKEYS.FORMS.NETSUITE_CUSTOM_FIELD_FORM]: FormTypes.NetSuiteCustomFieldForm;
[ONYXKEYS.FORMS.NETSUITE_CUSTOM_LIST_ADD_FORM]: FormTypes.NetSuiteCustomFieldForm;
[ONYXKEYS.FORMS.NETSUITE_CUSTOM_SEGMENT_ADD_FORM]: FormTypes.NetSuiteCustomFieldForm;
[ONYXKEYS.FORMS.NETSUITE_TOKEN_INPUT_FORM]: FormTypes.NetSuiteTokenInputForm;
[ONYXKEYS.FORMS.NETSUITE_CUSTOM_FORM_ID_FORM]: FormTypes.NetSuiteCustomFormIDForm;
[ONYXKEYS.FORMS.SAGE_INTACCT_DIMENSION_TYPE_FORM]: FormTypes.SageIntacctDimensionForm;
Expand Down
23 changes: 23 additions & 0 deletions src/ROUTES.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1012,6 +1012,29 @@ const ROUTES = {
getRoute: (policyID: string, importField: TupleToUnion<typeof CONST.NETSUITE_CONFIG.IMPORT_FIELDS>) =>
`settings/workspaces/${policyID}/accounting/netsuite/import/mapping/${importField}` as const,
},
POLICY_ACCOUNTING_NETSUITE_IMPORT_CUSTOM_FIELD_MAPPING: {
route: 'settings/workspaces/:policyID/accounting/netsuite/import/custom/:importCustomField',
getRoute: (policyID: string, importCustomField: ValueOf<typeof CONST.NETSUITE_CONFIG.IMPORT_CUSTOM_FIELDS>) =>
`settings/workspaces/${policyID}/accounting/netsuite/import/custom/${importCustomField}` as const,
},
POLICY_ACCOUNTING_NETSUITE_IMPORT_CUSTOM_FIELD_VIEW: {
route: 'settings/workspaces/:policyID/accounting/netsuite/import/custom/:importCustomField/view/:valueIndex',
getRoute: (policyID: string, importCustomField: ValueOf<typeof CONST.NETSUITE_CONFIG.IMPORT_CUSTOM_FIELDS>, valueIndex: number) =>
`settings/workspaces/${policyID}/accounting/netsuite/import/custom/${importCustomField}/view/${valueIndex}` as const,
},
POLICY_ACCOUNTING_NETSUITE_IMPORT_CUSTOM_FIELD_EDIT: {
route: 'settings/workspaces/:policyID/accounting/netsuite/import/custom/:importCustomField/edit/:valueIndex/:fieldName',
getRoute: (policyID: string, importCustomField: ValueOf<typeof CONST.NETSUITE_CONFIG.IMPORT_CUSTOM_FIELDS>, valueIndex: number, fieldName: string) =>
`settings/workspaces/${policyID}/accounting/netsuite/import/custom/${importCustomField}/edit/${valueIndex}/${fieldName}` as const,
},
POLICY_ACCOUNTING_NETSUITE_IMPORT_CUSTOM_LIST_ADD: {
route: 'settings/workspaces/:policyID/accounting/netsuite/import/custom-list/new',
getRoute: (policyID: string) => `settings/workspaces/${policyID}/accounting/netsuite/import/custom-list/new` as const,
},
POLICY_ACCOUNTING_NETSUITE_IMPORT_CUSTOM_SEGMENT_ADD: {
route: 'settings/workspaces/:policyID/accounting/netsuite/import/custom-segment/new',
getRoute: (policyID: string) => `settings/workspaces/${policyID}/accounting/netsuite/import/custom-segment/new` as const,
},
POLICY_ACCOUNTING_NETSUITE_IMPORT_CUSTOMERS_OR_PROJECTS: {
route: 'settings/workspaces/:policyID/accounting/netsuite/import/customer-projects',
getRoute: (policyID: string) => `settings/workspaces/${policyID}/accounting/netsuite/import/customer-projects` as const,
Expand Down
5 changes: 5 additions & 0 deletions src/SCREENS.ts
Original file line number Diff line number Diff line change
Expand Up @@ -280,6 +280,11 @@ const SCREENS = {
XERO_BILL_PAYMENT_ACCOUNT_SELECTOR: 'Policy_Accounting_Xero_Bill_Payment_Account_Selector',
XERO_EXPORT_BANK_ACCOUNT_SELECT: 'Policy_Accounting_Xero_Export_Bank_Account_Select',
NETSUITE_IMPORT_MAPPING: 'Policy_Accounting_NetSuite_Import_Mapping',
NETSUITE_IMPORT_CUSTOM_FIELD: 'Policy_Accounting_NetSuite_Import_Custom_Field',
NETSUITE_IMPORT_CUSTOM_FIELD_VIEW: 'Policy_Accounting_NetSuite_Import_Custom_Field_View',
NETSUITE_IMPORT_CUSTOM_FIELD_EDIT: 'Policy_Accounting_NetSuite_Import_Custom_Field_Edit',
NETSUITE_IMPORT_CUSTOM_LIST_ADD: 'Policy_Accounting_NetSuite_Import_Custom_List_Add',
NETSUITE_IMPORT_CUSTOM_SEGMENT_ADD: 'Policy_Accounting_NetSuite_Import_Custom_Segment_Add',
NETSUITE_IMPORT_CUSTOMERS_OR_PROJECTS: 'Policy_Accounting_NetSuite_Import_CustomersOrProjects',
NETSUITE_IMPORT_CUSTOMERS_OR_PROJECTS_SELECT: 'Policy_Accounting_NetSuite_Import_CustomersOrProjects_Select',
NETSUITE_TOKEN_INPUT: 'Policy_Accounting_NetSuite_Token_Input',
Expand Down
10 changes: 6 additions & 4 deletions src/components/ConnectionLayout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,8 @@ type ConnectionLayoutProps = {
/** Name of the current connection */
connectionName: ConnectionName;

/** Block the screen when the connection is not empty */
reverseConnectionEmptyCheck?: boolean;
/** Whether the screen should load for an empty connection */
shouldLoadForEmptyConnection?: boolean;

/** Handler for back button press */
onBackButtonPress?: () => void;
Expand Down Expand Up @@ -100,7 +100,7 @@ function ConnectionLayout({
shouldUseScrollView = true,
headerTitleAlreadyTranslated,
titleAlreadyTranslated,
reverseConnectionEmptyCheck = false,
shouldLoadForEmptyConnection = false,
onBackButtonPress = () => Navigation.goBack(),
shouldBeBlocked = false,
}: ConnectionLayoutProps) {
Expand All @@ -122,12 +122,14 @@ function ConnectionLayout({
[title, titleStyle, children, titleAlreadyTranslated],
);

const shouldBlockByConnection = shouldLoadForEmptyConnection ? !isConnectionEmpty : isConnectionEmpty;

return (
<AccessOrNotFoundWrapper
policyID={policyID}
accessVariants={accessVariants}
featureName={featureName}
shouldBeBlocked={(reverseConnectionEmptyCheck ? !isConnectionEmpty : isConnectionEmpty) || shouldBeBlocked}
shouldBeBlocked={!!shouldBeBlocked || shouldBlockByConnection}
>
<ScreenWrapper
includeSafeAreaPaddingBottom={!!shouldIncludeSafeAreaPaddingBottom}
Expand Down
3 changes: 3 additions & 0 deletions src/components/Form/FormProvider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,9 @@ type FormProviderProps<TFormID extends OnyxFormKey = OnyxFormKey> = FormProvider

/** Whether to apply flex to the submit button */
submitFlexEnabled?: boolean;

/** Whether button is disabled */
isSubmitDisabled?: boolean;
};

function FormProvider(
Expand Down
11 changes: 11 additions & 0 deletions src/components/Form/FormWrapper.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,9 @@ type FormWrapperProps = ChildrenProps &
/** Assuming refs are React refs */
inputRefs: RefObject<InputRefs>;

/** Whether the submit button is disabled */
isSubmitDisabled?: boolean;

/** Callback to submit the form */
onSubmit: () => void;
};
Expand All @@ -57,9 +60,11 @@ function FormWrapper({
enabledWhenOffline,
isSubmitActionDangerous = false,
formID,
shouldUseScrollView = true,
scrollContextEnabled = false,
shouldHideFixErrorsAlert = false,
disablePressOnEnter = true,
isSubmitDisabled = false,
}: FormWrapperProps) {
const styles = useThemeStyles();
const formRef = useRef<RNScrollView>(null);
Expand Down Expand Up @@ -108,6 +113,7 @@ function FormWrapper({
{isSubmitButtonVisible && (
<FormAlertWithSubmitButton
buttonText={submitButtonText}
isDisabled={isSubmitDisabled}
isAlertVisible={((!isEmptyObject(errors) || !isEmptyObject(formState?.errorFields)) && !shouldHideFixErrorsAlert) || !!errorMessage}
isLoading={!!formState?.isLoading}
message={isEmptyObject(formState?.errorFields) ? errorMessage : undefined}
Expand All @@ -133,6 +139,7 @@ function FormWrapper({
children,
isSubmitButtonVisible,
submitButtonText,
isSubmitDisabled,
errors,
formState?.errorFields,
formState?.isLoading,
Expand All @@ -149,6 +156,10 @@ function FormWrapper({
],
);

if (!shouldUseScrollView) {
return scrollViewContent({});
}

return (
<SafeAreaConsumer>
{({safeAreaPaddingBottomStyle}) =>
Expand Down
2 changes: 1 addition & 1 deletion src/components/Form/InputWrapper.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ function computeComponentSpecificRegistrationParams({
shouldSetTouchedOnBlurOnly: false,
// Forward the originally provided value
blurOnSubmit,
shouldSubmitForm: false,
shouldSubmitForm: !!shouldSubmitForm,
};
}

Expand Down
11 changes: 10 additions & 1 deletion src/components/Form/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ import type TextPicker from '@components/TextPicker';
import type ValuePicker from '@components/ValuePicker';
import type BusinessTypePicker from '@pages/ReimbursementAccount/BusinessInfo/substeps/TypeBusiness/BusinessTypePicker';
import type DimensionTypeSelector from '@pages/workspace/accounting/intacct/import/DimensionTypeSelector';
import type NetSuiteCustomFieldMappingPicker from '@pages/workspace/accounting/netsuite/import/NetSuiteImportCustomFieldNew/NetSuiteCustomFieldMappingPicker';
import type NetSuiteCustomListPicker from '@pages/workspace/accounting/netsuite/import/NetSuiteImportCustomFieldNew/NetSuiteCustomListPicker';
import type NetSuiteMenuWithTopDescriptionForm from '@pages/workspace/accounting/netsuite/import/NetSuiteImportCustomFieldNew/NetSuiteMenuWithTopDescriptionForm';
import type {Country} from '@src/CONST';
import type {OnyxFormKey, OnyxValues} from '@src/ONYXKEYS';
import type {BaseForm} from '@src/types/form/Form';
Expand Down Expand Up @@ -49,7 +52,10 @@ type ValidInputs =
| typeof AmountPicker
| typeof TextPicker
| typeof AddPlaidBankAccount
| typeof EmojiPickerButtonDropdown;
| typeof EmojiPickerButtonDropdown
| typeof NetSuiteCustomListPicker
| typeof NetSuiteCustomFieldMappingPicker
| typeof NetSuiteMenuWithTopDescriptionForm;

type ValueTypeKey = 'string' | 'boolean' | 'date' | 'country' | 'reportFields' | 'disabledListValues';
type ValueTypeMap = {
Expand Down Expand Up @@ -128,6 +134,9 @@ type FormProps<TFormID extends OnyxFormKey = OnyxFormKey> = {
/** Whether ScrollWithContext should be used instead of regular ScrollView. Set to true when there's a nested Picker component in Form. */
scrollContextEnabled?: boolean;

/** Whether to use ScrollView */
shouldUseScrollView?: boolean;

/** Container styles */
style?: StyleProp<ViewStyle>;

Expand Down
9 changes: 6 additions & 3 deletions src/components/WorkspaceEmptyStateSection.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ type WorkspaceEmptyStateSectionProps = {
/** The text to display in the subtitle of the section */
subtitle?: string;

/** The component to show in the subtitle of the section */
subtitleComponent?: React.ReactNode;

/** The icon to display along with the title */
icon: IconAsset;

Expand All @@ -24,7 +27,7 @@ type WorkspaceEmptyStateSectionProps = {
shouldStyleAsCard?: boolean;
};

function WorkspaceEmptyStateSection({icon, subtitle, title, containerStyle, shouldStyleAsCard = true}: WorkspaceEmptyStateSectionProps) {
function WorkspaceEmptyStateSection({icon, subtitle, title, containerStyle, shouldStyleAsCard = true, subtitleComponent}: WorkspaceEmptyStateSectionProps) {
const styles = useThemeStyles();
const {shouldUseNarrowLayout} = useResponsiveLayout();

Expand All @@ -50,9 +53,9 @@ function WorkspaceEmptyStateSection({icon, subtitle, title, containerStyle, shou
<Text style={[styles.textHeadline, styles.emptyCardSectionTitle]}>{title}</Text>
</View>

{!!subtitle && (
{(!!subtitle || !!subtitleComponent) && (
<View style={[styles.flexRow, styles.justifyContentCenter, styles.w100, styles.mt1, styles.mh1]}>
<Text style={[styles.textNormal, styles.emptyCardSectionSubtitle]}>{subtitle}</Text>
{subtitleComponent ?? <Text style={[styles.textNormal, styles.emptyCardSectionSubtitle]}>{subtitle}</Text>}
</View>
)}
</View>
Expand Down
Loading
Loading