Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
40 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
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
56 changes: 56 additions & 0 deletions assets/images/product-illustrations/emptystate__records.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
14 changes: 13 additions & 1 deletion src/CONST.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1387,7 +1387,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'],
SYNC_OPTIONS: {
SYNC_REIMBURSED_REPORTS: 'syncReimbursedReports',
SYNC_PEOPLE: 'syncPeople',
Expand All @@ -1404,6 +1409,13 @@ const CONST = {
},
},

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: {
LAST_EXPENSE: 'LAST_EXPENSE',
EXPORTED: 'EXPORTED',
Expand Down
3 changes: 3 additions & 0 deletions src/ONYXKEYS.ts
Original file line number Diff line number Diff line change
Expand Up @@ -560,6 +560,8 @@ const ONYXKEYS = {
ISSUE_NEW_EXPENSIFY_CARD_FORM_DRAFT: 'issueNewExpensifyCardFormDraft',
SAGE_INTACCT_CREDENTIALS_FORM: 'sageIntacctCredentialsForm',
SAGE_INTACCT_CREDENTIALS_FORM_DRAFT: 'sageIntacctCredentialsFormDraft',
NETSUITE_CUSTOM_FIELD_FORM: 'netSuiteCustomFieldForm',
NETSUITE_CUSTOM_FIELD_FORM_DRAFT: 'netSuiteCustomFieldFormDraft',
NETSUITE_TOKEN_INPUT_FORM: 'netsuiteTokenInputForm',
NETSUITE_TOKEN_INPUT_FORM_DRAFT: 'netsuiteTokenInputFormDraft',
},
Expand Down Expand Up @@ -625,6 +627,7 @@ 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_TOKEN_INPUT_FORM]: FormTypes.NetSuiteTokenInputForm;
};

Expand Down
15 changes: 15 additions & 0 deletions src/ROUTES.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1001,6 +1001,21 @@ 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_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
3 changes: 3 additions & 0 deletions src/SCREENS.ts
Original file line number Diff line number Diff line change
Expand Up @@ -280,6 +280,9 @@ 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_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
14 changes: 10 additions & 4 deletions src/components/ConnectionLayout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,11 @@ type ConnectionLayoutProps = {
/** Name of the current connection */
connectionName: ConnectionName;

/** Block the screen when the connection is not empty */
reverseConnectionEmptyCheck?: boolean;
/** Whether or not to block user from accessing the page */
shouldBeBlocked?: boolean;

/** Whether the screen should load for empty connection */
isForEmptyConnection?: boolean;

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

const shouldBlockByConnection = isForEmptyConnection ? !isConnectionEmpty : isConnectionEmpty;

return (
<AccessOrNotFoundWrapper
policyID={policyID}
accessVariants={accessVariants}
featureName={featureName}
shouldBeBlocked={reverseConnectionEmptyCheck ? !isConnectionEmpty : isConnectionEmpty}
shouldBeBlocked={!!shouldBeBlocked || shouldBlockByConnection}
>
<ScreenWrapper
includeSafeAreaPaddingBottom={!!shouldIncludeSafeAreaPaddingBottom}
Expand Down
2 changes: 2 additions & 0 deletions src/components/Icon/Illustrations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import ConciergeBlue from '@assets/images/product-illustrations/concierge--blue.
import ConciergeExclamation from '@assets/images/product-illustrations/concierge--exclamation.svg';
import CreditCardsBlue from '@assets/images/product-illustrations/credit-cards--blue.svg';
import EmptyStateExpenses from '@assets/images/product-illustrations/emptystate__expenses.svg';
import EmptyStateRecords from '@assets/images/product-illustrations/emptystate__records.svg';
import EmptyStateTravel from '@assets/images/product-illustrations/emptystate__travel.svg';
import GpsTrackOrange from '@assets/images/product-illustrations/gps-track--orange.svg';
import Hands from '@assets/images/product-illustrations/home-illustration-hands.svg';
Expand Down Expand Up @@ -196,4 +197,5 @@ export {
CheckmarkCircle,
CreditCardEyes,
LockClosedOrange,
EmptyStateRecords,
};
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
36 changes: 34 additions & 2 deletions src/languages/en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2400,8 +2400,40 @@ export default {
},
importTaxDescription: 'Import tax groups from NetSuite',
importCustomFields: {
customSegments: 'Custom segments/records',
customLists: 'Custom lists',
customSegments: {
title: 'Custom segments/records',
addButtonText: 'Add custom segment/record',
recordTitle: 'Custom segment',
helpLink: CONST.NETSUITE_IMPORT.HELP_LINKS.CUSTOM_SEGMENTS,
helpLinkText: 'View detailed instructions',
helpText: ' on configuring custom segements/records.',
emptyTitle: 'Add a custom segment or custom record',
fields: {
segmentName: 'Name',
internalID: 'Internal ID',
scriptID: 'Script ID',
mapping: 'Displayed as',
},
removeTitle: 'Remove custom segment/record',
removePrompt: 'Are you sure you want to remove this custom segment/record?',
},
customLists: {
title: 'Custom lists',
addButtonText: 'Add custom list',
recordTitle: 'Custom list',
helpLink: CONST.NETSUITE_IMPORT.HELP_LINKS.CUSTOM_LISTS,
helpLinkText: 'View detailed instructions',
helpText: ' on configuring custom lists.',
emptyTitle: 'Add a custom list',
fields: {
listName: 'Name',
internalID: 'Internal ID',
transactionFieldID: 'Transaction field ID',
mapping: 'Displayed as',
},
removeTitle: 'Remove custom list',
removePrompt: 'Are you sure you want to remove this custom list?',
},
},
importTypes: {
[CONST.INTEGRATION_ENTITY_MAP_TYPES.NETSUITE_DEFAULT]: {
Expand Down
36 changes: 34 additions & 2 deletions src/languages/es.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2441,8 +2441,40 @@ export default {
},
importTaxDescription: 'Importar grupos de impuestos desde NetSuite',
importCustomFields: {
customSegments: 'Segmentos/registros personalizados',
customLists: 'Listas personalizado',
customSegments: {
title: 'Segmentos/registros personalizados',
addButtonText: 'Añadir segmento/registro personalizado',
recordTitle: 'Segmento personalizado',
helpLink: CONST.NETSUITE_IMPORT.HELP_LINKS.CUSTOM_SEGMENTS,
helpLinkText: 'Ver instrucciones detalladas',
helpText: ' sobre la configuración de segmentos/registros personalizado.',
emptyTitle: 'Añadir un segmento personalizado o un registro personalizado',
fields: {
segmentName: 'Name',
internalID: 'Internal ID',
scriptID: 'Script ID',
mapping: 'Displayed as',
},
removeTitle: 'Eliminar segmento/registro personalizado',
removePrompt: '¿Está seguro de que desea eliminar este segmento/registro personalizado?',
},
customLists: {
title: 'Listas personalizados',
addButtonText: 'Añadir lista personalizado',
recordTitle: 'Lista personalizado',
helpLink: CONST.NETSUITE_IMPORT.HELP_LINKS.CUSTOM_LISTS,
helpLinkText: 'Ver instrucciones detalladas',
helpText: ' sobre cómo configurar listas personalizado.',
emptyTitle: 'Añadir una lista personalizado',
fields: {
listName: 'Name',
internalID: 'Internal ID',
transactionFieldID: 'Transaction field ID',
mapping: 'Displayed as',
},
removeTitle: 'Eliminar lista personalizado',
removePrompt: '¿Está seguro de que desea eliminar esta lista personalizado?',
},
},
importTypes: {
[CONST.INTEGRATION_ENTITY_MAP_TYPES.NETSUITE_DEFAULT]: {
Expand Down
5 changes: 5 additions & 0 deletions src/libs/API/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -257,6 +257,8 @@ const WRITE_COMMANDS = {
UPDATE_NETSUITE_TAX_POSTING_ACCOUNT: 'UpdateNetSuiteTaxPostingAccount',
UPDATE_NETSUITE_ALLOW_FOREIGN_CURRENCY: 'UpdateNetSuiteAllowForeignCurrency',
UPDATE_NETSUITE_EXPORT_TO_NEXT_OPEN_PERIOD: 'UpdateNetSuiteExportToNextOpenPeriod',
UPDATE_NETSUITE_CUSTOM_SEGMENTS: 'UpdateNetSuiteCustomSegments',
UPDATE_NETSUITE_CUSTOM_LISTS: 'UpdateNetSuiteCustomLists',
UPDATE_NETSUITE_AUTO_SYNC: 'UpdateNetSuiteAutoSync',
UPDATE_NETSUITE_SYNC_REIMBURSED_REPORTS: 'UpdateNetSuiteSyncReimbursedReports',
UPDATE_NETSUITE_SYNC_PEOPLE: 'UpdateNetSuiteSyncPeople',
Expand Down Expand Up @@ -534,6 +536,9 @@ type WriteCommandParameters = {
[WRITE_COMMANDS.UPDATE_NETSUITE_TAX_POSTING_ACCOUNT]: Parameters.UpdateNetSuiteGenericTypeParams<'bankAccountID', string>;
[WRITE_COMMANDS.UPDATE_NETSUITE_ALLOW_FOREIGN_CURRENCY]: Parameters.UpdateNetSuiteGenericTypeParams<'enabled', boolean>;
[WRITE_COMMANDS.UPDATE_NETSUITE_EXPORT_TO_NEXT_OPEN_PERIOD]: Parameters.UpdateNetSuiteGenericTypeParams<'enabled', boolean>;
[WRITE_COMMANDS.UPDATE_NETSUITE_EXPORT_TO_NEXT_OPEN_PERIOD]: Parameters.UpdateNetSuiteGenericTypeParams<'enabled', boolean>;
[WRITE_COMMANDS.UPDATE_NETSUITE_CUSTOM_SEGMENTS]: Parameters.UpdateNetSuiteGenericTypeParams<'customSegments', string>; // JSON string NetSuiteCustomSegment[]
[WRITE_COMMANDS.UPDATE_NETSUITE_CUSTOM_LISTS]: Parameters.UpdateNetSuiteGenericTypeParams<'customLists', string>; // JSON string NetSuiteCustomList[]
[WRITE_COMMANDS.UPDATE_NETSUITE_AUTO_SYNC]: Parameters.UpdateNetSuiteGenericTypeParams<'enabled', boolean>;
[WRITE_COMMANDS.UPDATE_NETSUITE_SYNC_REIMBURSED_REPORTS]: Parameters.UpdateNetSuiteGenericTypeParams<'enabled', boolean>;
[WRITE_COMMANDS.UPDATE_NETSUITE_SYNC_PEOPLE]: Parameters.UpdateNetSuiteGenericTypeParams<'enabled', boolean>;
Expand Down
Loading