-
Notifications
You must be signed in to change notification settings - Fork 3.7k
[#Wave-Control: Add NetSuite]: Added NetSuite connect button and fixed copies
#44218
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
yuwenmemon
merged 32 commits into
Expensify:main
from
mananjadhav:mj-netsuite-connect-button
Jun 27, 2024
Merged
Changes from all commits
Commits
Show all changes
32 commits
Select commit
Hold shift + click to select a range
22f38a2
Merge branch 'main' of github.com:mananjadhav/App into mj-netsuite-to…
mananjadhav a50e94f
Merge branch 'mj-netsuite-subsidiary-select' of github.com:mananjadha…
mananjadhav 8584f97
Merge branch 'mj-netsuite-subsidiary-select' into mj-netsuite-token-i…
mananjadhav 0c1f040
feat: added connect button
mananjadhav 221f0ef
fix: add current integration name
mananjadhav c300257
fix: disconnect prompt text
mananjadhav 5f3f526
fix: added current integration name
mananjadhav 2ecec42
fix: added comment
mananjadhav 4cd240d
refactor: lint fixes
mananjadhav 4c72b52
Merge branch 'mj-netsuite-subsidiary-select' into mj-netsuite-connect…
mananjadhav ab7997e
feat: create generic confirmation modal
mananjadhav 4a4783f
refactor: use accounting confirmation modal
mananjadhav 6c84302
refactor: prettier fixes
mananjadhav abac11b
refactor: clean up props
mananjadhav 432e443
refactor: clean up translations
mananjadhav de1919d
refactor: add es translations
mananjadhav 499d31f
refactor: run prettier
mananjadhav c282904
refactor: use modal for qbo
mananjadhav 14dfbdc
fix: integration name
mananjadhav 32d85e8
fix: rollback to danger for modal
mananjadhav 61578a4
Merge branch 'main' of github.com:mananjadhav/App into mj-netsuite-co…
mananjadhav 2984b26
Merge branch 'main' of github.com:mananjadhav/App into mj-netsuite-co…
mananjadhav e10eb65
Merge branch 'main' of github.com:mananjadhav/App into mj-netsuite-co…
mananjadhav 0f6e35f
fix: update modal to success
mananjadhav db05635
fix: update content
mananjadhav 4cfa704
fix: update spacing
mananjadhav 8287fd5
fix: remove unwanted file
mananjadhav 0c17ae0
docs: added todo
mananjadhav a600231
fix: update copy and variable
mananjadhav 26fe29a
refactor: run prettier
mananjadhav 05c92d0
refactor: simplify condition with ??
mananjadhav 6a3037c
refactor: fix typo
mananjadhav 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,30 @@ | ||
| import React from 'react'; | ||
| import useLocalize from '@hooks/useLocalize'; | ||
| import type {ConnectionName} from '@src/types/onyx/Policy'; | ||
| import ConfirmModal from './ConfirmModal'; | ||
|
|
||
| type AccountingConnectionConfirmationModalProps = { | ||
| integrationToConnect: ConnectionName; | ||
| onConfirm: () => void; | ||
| onCancel: () => void; | ||
| }; | ||
|
|
||
| function AccountingConnectionConfirmationModal({integrationToConnect, onCancel, onConfirm}: AccountingConnectionConfirmationModalProps) { | ||
| const {translate} = useLocalize(); | ||
|
|
||
| return ( | ||
| <ConfirmModal | ||
| title={translate('workspace.accounting.connectTitle', integrationToConnect)} | ||
| isVisible | ||
| onConfirm={onConfirm} | ||
| onCancel={onCancel} | ||
| prompt={translate('workspace.accounting.connectPrompt', integrationToConnect)} | ||
| confirmText={translate('workspace.accounting.setup')} | ||
| cancelText={translate('common.cancel')} | ||
| success | ||
| /> | ||
| ); | ||
| } | ||
|
|
||
| AccountingConnectionConfirmationModal.displayName = 'AccountingConnectionConfirmationModal'; | ||
| export default AccountingConnectionConfirmationModal; |
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,54 @@ | ||
| import React, {useState} from 'react'; | ||
| import AccountingConnectionConfirmationModal from '@components/AccountingConnectionConfirmationModal'; | ||
| import Button from '@components/Button'; | ||
| import useLocalize from '@hooks/useLocalize'; | ||
| import useNetwork from '@hooks/useNetwork'; | ||
| import useThemeStyles from '@hooks/useThemeStyles'; | ||
| import {removePolicyConnection} from '@libs/actions/connections'; | ||
| import Navigation from '@libs/Navigation/Navigation'; | ||
| import CONST from '@src/CONST'; | ||
| import ROUTES from '@src/ROUTES'; | ||
| import type {ConnectToNetSuiteButtonProps} from './types'; | ||
|
|
||
| function ConnectToNetSuiteButton({policyID, shouldDisconnectIntegrationBeforeConnecting, integrationToDisconnect}: ConnectToNetSuiteButtonProps) { | ||
| const styles = useThemeStyles(); | ||
| const {translate} = useLocalize(); | ||
| const {isOffline} = useNetwork(); | ||
|
|
||
| const [isDisconnectModalOpen, setIsDisconnectModalOpen] = useState(false); | ||
|
|
||
| return ( | ||
| <> | ||
| <Button | ||
| onPress={() => { | ||
| if (shouldDisconnectIntegrationBeforeConnecting && integrationToDisconnect) { | ||
| setIsDisconnectModalOpen(true); | ||
| return; | ||
| } | ||
|
|
||
| // TODO: Will be updated to new token input page | ||
| Navigation.navigate(ROUTES.POLICY_ACCOUNTING_NETSUITE_SUBSIDIARY_SELECTOR.getRoute(policyID)); | ||
| }} | ||
| text={translate('workspace.accounting.setup')} | ||
| style={styles.justifyContentCenter} | ||
| small | ||
| isDisabled={isOffline} | ||
| /> | ||
| {shouldDisconnectIntegrationBeforeConnecting && isDisconnectModalOpen && integrationToDisconnect && ( | ||
| <AccountingConnectionConfirmationModal | ||
| onConfirm={() => { | ||
| removePolicyConnection(policyID, integrationToDisconnect); | ||
|
|
||
| // TODO: Will be updated to new token input page | ||
| Navigation.navigate(ROUTES.POLICY_ACCOUNTING_NETSUITE_SUBSIDIARY_SELECTOR.getRoute(policyID)); | ||
| setIsDisconnectModalOpen(false); | ||
| }} | ||
| integrationToConnect={CONST.POLICY.CONNECTIONS.NAME.NETSUITE} | ||
| onCancel={() => setIsDisconnectModalOpen(false)} | ||
| /> | ||
| )} | ||
| </> | ||
| ); | ||
| } | ||
|
|
||
| export default ConnectToNetSuiteButton; | ||
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,10 @@ | ||
| import type {PolicyConnectionName} from '@src/types/onyx/Policy'; | ||
|
|
||
| type ConnectToNetSuiteButtonProps = { | ||
| policyID: string; | ||
| shouldDisconnectIntegrationBeforeConnecting?: boolean; | ||
| integrationToDisconnect?: PolicyConnectionName; | ||
| }; | ||
|
|
||
| // eslint-disable-next-line import/prefer-default-export | ||
| export type {ConnectToNetSuiteButtonProps}; |
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.
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.