From a0187248f6ea95aa1f79a3e4b95d54c069d14ea4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lucien=20Akchot=C3=A9?= Date: Mon, 28 Oct 2024 17:10:05 +0100 Subject: [PATCH 1/4] remove NEW_DOT_QBD beta --- src/CONST.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/src/CONST.ts b/src/CONST.ts index 9f7940e17c23..eea8f72aeba2 100755 --- a/src/CONST.ts +++ b/src/CONST.ts @@ -509,7 +509,6 @@ const CONST = { WORKSPACE_RULES: 'workspaceRules', COMBINED_TRACK_SUBMIT: 'combinedTrackSubmit', CATEGORY_AND_TAG_APPROVERS: 'categoryAndTagApprovers', - NEW_DOT_QBD: 'quickbooksDesktopOnNewDot', }, BUTTON_STATES: { DEFAULT: 'default', From 989542b1b40512763782f83031e575fef685250c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lucien=20Akchot=C3=A9?= Date: Mon, 28 Oct 2024 17:10:19 +0100 Subject: [PATCH 2/4] remove canUseNewDotQBD() --- src/libs/Permissions.ts | 5 ----- 1 file changed, 5 deletions(-) diff --git a/src/libs/Permissions.ts b/src/libs/Permissions.ts index 24de2e612208..45203c1db5b6 100644 --- a/src/libs/Permissions.ts +++ b/src/libs/Permissions.ts @@ -53,10 +53,6 @@ function canUseCombinedTrackSubmit(betas: OnyxEntry): boolean { return !!betas?.includes(CONST.BETAS.COMBINED_TRACK_SUBMIT); } -function canUseNewDotQBD(betas: OnyxEntry): boolean { - return !!betas?.includes(CONST.BETAS.NEW_DOT_QBD) || canUseAllBetas(betas); -} - /** * Link previews are temporarily disabled. */ @@ -77,5 +73,4 @@ export default { canUseWorkspaceRules, canUseCombinedTrackSubmit, canUseCategoryAndTagApprovers, - canUseNewDotQBD, }; From bd271b75f28ce474755a305a771b6ec1834e3ae7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lucien=20Akchot=C3=A9?= Date: Mon, 28 Oct 2024 17:10:37 +0100 Subject: [PATCH 3/4] remove QBD todos --- src/pages/workspace/accounting/PolicyAccountingPage.tsx | 4 +--- .../qbd/advanced/QuickbooksDesktopAdvancedPage.tsx | 5 +---- .../QuickbooksDesktopCompanyCardExpenseAccountPage.tsx | 5 +---- ...kbooksDesktopCompanyCardExpenseAccountSelectCardPage.tsx | 5 +---- ...QuickbooksDesktopCompanyCardExpenseAccountSelectPage.tsx | 5 +---- .../qbd/export/QuickbooksDesktopExportDateSelectPage.tsx | 6 +----- .../accounting/qbd/export/QuickbooksDesktopExportPage.tsx | 5 +---- ...ckbooksDesktopNonReimbursableDefaultVendorSelectPage.tsx | 5 +---- ...QuickbooksDesktopOutOfPocketExpenseAccountSelectPage.tsx | 6 +----- ...QuickbooksDesktopOutOfPocketExpenseConfigurationPage.tsx | 5 +---- .../QuickbooksDesktopOutOfPocketExpenseEntitySelectPage.tsx | 5 +---- .../QuickbooksDesktopPreferredExporterConfigurationPage.tsx | 5 +---- .../qbd/import/QuickbooksDesktopChartOfAccountsPage.tsx | 4 +--- .../qbd/import/QuickbooksDesktopClassesDisplayedAsPage.tsx | 5 +---- .../accounting/qbd/import/QuickbooksDesktopClassesPage.tsx | 4 +--- .../import/QuickbooksDesktopCustomersDisplayedAsPage.tsx | 5 +---- .../qbd/import/QuickbooksDesktopCustomersPage.tsx | 4 +--- .../accounting/qbd/import/QuickbooksDesktopImportPage.tsx | 5 +---- .../accounting/qbd/import/QuickbooksDesktopItemsPage.tsx | 5 +---- src/pages/workspace/accounting/utils.tsx | 1 - 20 files changed, 19 insertions(+), 75 deletions(-) diff --git a/src/pages/workspace/accounting/PolicyAccountingPage.tsx b/src/pages/workspace/accounting/PolicyAccountingPage.tsx index 3e1117d4a12a..9a22583c0026 100644 --- a/src/pages/workspace/accounting/PolicyAccountingPage.tsx +++ b/src/pages/workspace/accounting/PolicyAccountingPage.tsx @@ -73,7 +73,6 @@ function PolicyAccountingPage({policy}: PolicyAccountingPageProps) { const [isDisconnectModalOpen, setIsDisconnectModalOpen] = useState(false); const [datetimeToRelative, setDateTimeToRelative] = useState(''); const threeDotsMenuContainerRef = useRef(null); - const {canUseNewDotQBD} = usePermissions(); const {startIntegrationFlow, popoverAnchorRefs} = useAccountingContext(); const route = useRoute(); @@ -84,8 +83,7 @@ function PolicyAccountingPage({policy}: PolicyAccountingPageProps) { const isSyncInProgress = isConnectionInProgress(connectionSyncProgress, policy); - const {QBD: qbdConnectionName, ...allConnectionNamesWithoutQBD} = CONST.POLICY.CONNECTIONS.NAME; - const connectionNames = canUseNewDotQBD ? CONST.POLICY.CONNECTIONS.NAME : allConnectionNamesWithoutQBD; + const connectionNames = CONST.POLICY.CONNECTIONS.NAME; const accountingIntegrations = Object.values(connectionNames); const connectedIntegration = getConnectedIntegration(policy, accountingIntegrations) ?? connectionSyncProgress?.connectionName; const synchronizationError = connectedIntegration && getSynchronizationErrorMessage(policy, connectedIntegration, isSyncInProgress, translate, styles); diff --git a/src/pages/workspace/accounting/qbd/advanced/QuickbooksDesktopAdvancedPage.tsx b/src/pages/workspace/accounting/qbd/advanced/QuickbooksDesktopAdvancedPage.tsx index cd54127d3a44..298f26105505 100644 --- a/src/pages/workspace/accounting/qbd/advanced/QuickbooksDesktopAdvancedPage.tsx +++ b/src/pages/workspace/accounting/qbd/advanced/QuickbooksDesktopAdvancedPage.tsx @@ -1,7 +1,6 @@ import React from 'react'; import ConnectionLayout from '@components/ConnectionLayout'; import useLocalize from '@hooks/useLocalize'; -import usePermissions from '@hooks/usePermissions'; import useThemeStyles from '@hooks/useThemeStyles'; import * as QuickbooksDesktop from '@libs/actions/connections/QuickbooksDesktop'; import * as ErrorUtils from '@libs/ErrorUtils'; @@ -19,7 +18,6 @@ function QuickbooksDesktopAdvancedPage({policy}: WithPolicyConnectionsProps) { const {translate} = useLocalize(); const policyID = policy?.id ?? '-1'; const qbdConfig = policy?.connections?.quickbooksDesktop?.config; - const {canUseNewDotQBD} = usePermissions(); const qbdToggleSettingItems = [ { @@ -50,9 +48,8 @@ function QuickbooksDesktopAdvancedPage({policy}: WithPolicyConnectionsProps) { vendor.id === qbdConfig?.export?.nonReimbursableBillDefaultVendor); - const {canUseNewDotQBD} = usePermissions(); const nonReimbursable = qbdConfig?.export?.nonReimbursable; const nonReimbursableAccount = qbdConfig?.export?.nonReimbursableAccount; @@ -58,8 +56,7 @@ function QuickbooksDesktopCompanyCardExpenseAccountPage({policy}: WithPolicyConn displayName={QuickbooksDesktopCompanyCardExpenseAccountPage.displayName} headerTitle="workspace.accounting.exportCompanyCard" title="workspace.qbd.exportCompanyCardsDescription" - accessVariants={[CONST.POLICY.ACCESS_VARIANTS.ADMIN]} - shouldBeBlocked={!canUseNewDotQBD} // TODO: [QBD] remove it once the QBD beta is done + accessVariants={[CONST.POLICY.ACCESS_VARIANTS.ADMIN, CONST.POLICY.ACCESS_VARIANTS.CONTROL]} featureName={CONST.POLICY.MORE_FEATURES.ARE_CONNECTIONS_ENABLED} contentContainerStyle={styles.pb2} titleStyle={styles.ph5} diff --git a/src/pages/workspace/accounting/qbd/export/QuickbooksDesktopCompanyCardExpenseAccountSelectCardPage.tsx b/src/pages/workspace/accounting/qbd/export/QuickbooksDesktopCompanyCardExpenseAccountSelectCardPage.tsx index 285d50e77022..8b7ea59bac80 100644 --- a/src/pages/workspace/accounting/qbd/export/QuickbooksDesktopCompanyCardExpenseAccountSelectCardPage.tsx +++ b/src/pages/workspace/accounting/qbd/export/QuickbooksDesktopCompanyCardExpenseAccountSelectCardPage.tsx @@ -4,7 +4,6 @@ import type {ListItem} from '@components/SelectionList/types'; import SelectionScreen from '@components/SelectionScreen'; import type {SelectorType} from '@components/SelectionScreen'; import useLocalize from '@hooks/useLocalize'; -import usePermissions from '@hooks/usePermissions'; import useThemeStyles from '@hooks/useThemeStyles'; import * as QuickbooksDesktop from '@libs/actions/connections/QuickbooksDesktop'; import * as ErrorUtils from '@libs/ErrorUtils'; @@ -29,7 +28,6 @@ function QuickbooksDesktopCompanyCardExpenseAccountSelectCardPage({policy}: With const policyID = policy?.id ?? '-1'; const qbdConfig = policy?.connections?.quickbooksDesktop?.config; const {creditCardAccounts, payableAccounts, vendors, bankAccounts} = policy?.connections?.quickbooksDesktop?.data ?? {}; - const {canUseNewDotQBD} = usePermissions(); const nonReimbursable = qbdConfig?.export?.nonReimbursable; const nonReimbursableAccount = qbdConfig?.export?.nonReimbursableAccount; const nonReimbursableBillDefaultVendor = qbdConfig?.export?.nonReimbursableBillDefaultVendor; @@ -88,12 +86,11 @@ function QuickbooksDesktopCompanyCardExpenseAccountSelectCardPage({policy}: With return ( selectExportCompanyCard(selection as MenuItem)} shouldSingleExecuteRowSelect diff --git a/src/pages/workspace/accounting/qbd/export/QuickbooksDesktopCompanyCardExpenseAccountSelectPage.tsx b/src/pages/workspace/accounting/qbd/export/QuickbooksDesktopCompanyCardExpenseAccountSelectPage.tsx index c8da940f5209..d7cbf62c6d8b 100644 --- a/src/pages/workspace/accounting/qbd/export/QuickbooksDesktopCompanyCardExpenseAccountSelectPage.tsx +++ b/src/pages/workspace/accounting/qbd/export/QuickbooksDesktopCompanyCardExpenseAccountSelectPage.tsx @@ -6,7 +6,6 @@ import type {ListItem} from '@components/SelectionList/types'; import SelectionScreen from '@components/SelectionScreen'; import Text from '@components/Text'; import useLocalize from '@hooks/useLocalize'; -import usePermissions from '@hooks/usePermissions'; import useThemeStyles from '@hooks/useThemeStyles'; import * as QuickbooksDesktop from '@libs/actions/connections/QuickbooksDesktop'; import * as ConnectionUtils from '@libs/ConnectionUtils'; @@ -31,7 +30,6 @@ function QuickbooksDesktopCompanyCardExpenseAccountSelectPage({policy}: WithPoli const styles = useThemeStyles(); const policyID = policy?.id ?? '-1'; const qbdConfig = policy?.connections?.quickbooksDesktop?.config; - const {canUseNewDotQBD} = usePermissions(); const nonReimbursable = qbdConfig?.export?.nonReimbursable; const nonReimbursableAccount = qbdConfig?.export?.nonReimbursableAccount; @@ -71,12 +69,11 @@ function QuickbooksDesktopCompanyCardExpenseAccountSelectPage({policy}: WithPoli return ( {translate(`workspace.qbd.accounts.${nonReimbursable}AccountDescription`)} : null} - shouldBeBlocked={!canUseNewDotQBD} // TODO: [QBD] remove it once the QBD beta is done sections={data.length ? [{data}] : []} listItem={RadioListItem} onSelectRow={selectExportAccount} diff --git a/src/pages/workspace/accounting/qbd/export/QuickbooksDesktopExportDateSelectPage.tsx b/src/pages/workspace/accounting/qbd/export/QuickbooksDesktopExportDateSelectPage.tsx index c4f648283338..ac4c8bbb4e39 100644 --- a/src/pages/workspace/accounting/qbd/export/QuickbooksDesktopExportDateSelectPage.tsx +++ b/src/pages/workspace/accounting/qbd/export/QuickbooksDesktopExportDateSelectPage.tsx @@ -5,7 +5,6 @@ import type {ListItem} from '@components/SelectionList/types'; import SelectionScreen from '@components/SelectionScreen'; import Text from '@components/Text'; import useLocalize from '@hooks/useLocalize'; -import usePermissions from '@hooks/usePermissions'; import useThemeStyles from '@hooks/useThemeStyles'; import * as QuickbooksDesktop from '@libs/actions/connections/QuickbooksDesktop'; import * as ErrorUtils from '@libs/ErrorUtils'; @@ -39,8 +38,6 @@ function QuickbooksDesktopExportDateSelectPage({policy}: WithPolicyConnectionsPr [exportDate, translate], ); - const {canUseNewDotQBD} = usePermissions(); - const selectExportDate = useCallback( (row: CardListItem) => { if (row.value !== exportDate) { @@ -54,7 +51,7 @@ function QuickbooksDesktopExportDateSelectPage({policy}: WithPolicyConnectionsPr return ( mode.isSelected)?.keyForList} title="workspace.qbd.exportDate.label" - shouldBeBlocked={!canUseNewDotQBD} // TODO: remove it once the QBD beta is done connectionName={CONST.POLICY.CONNECTIONS.NAME.QBD} pendingAction={PolicyUtils.settingsPendingAction([CONST.QUICKBOOKS_DESKTOP_CONFIG.EXPORT_DATE], qbdConfig?.pendingFields)} errors={ErrorUtils.getLatestErrorField(qbdConfig, CONST.QUICKBOOKS_DESKTOP_CONFIG.EXPORT_DATE)} diff --git a/src/pages/workspace/accounting/qbd/export/QuickbooksDesktopExportPage.tsx b/src/pages/workspace/accounting/qbd/export/QuickbooksDesktopExportPage.tsx index 72d4c75b761c..e4a9099ac66a 100644 --- a/src/pages/workspace/accounting/qbd/export/QuickbooksDesktopExportPage.tsx +++ b/src/pages/workspace/accounting/qbd/export/QuickbooksDesktopExportPage.tsx @@ -5,7 +5,6 @@ import OfflineWithFeedback from '@components/OfflineWithFeedback'; import Text from '@components/Text'; import TextLink from '@components/TextLink'; import useLocalize from '@hooks/useLocalize'; -import usePermissions from '@hooks/usePermissions'; import useThemeStyles from '@hooks/useThemeStyles'; import * as PolicyUtils from '@libs/PolicyUtils'; import Navigation from '@navigation/Navigation'; @@ -22,7 +21,6 @@ function QuickbooksDesktopExportPage({policy}: WithPolicyConnectionsProps) { const policyOwner = policy?.owner ?? ''; const qbdConfig = policy?.connections?.quickbooksDesktop?.config; const errorFields = qbdConfig?.errorFields; - const {canUseNewDotQBD} = usePermissions(); const shouldShowVendorMenuItems = useMemo( () => qbdConfig?.export?.nonReimbursable === CONST.QUICKBOOKS_DESKTOP_NON_REIMBURSABLE_EXPORT_ACCOUNT_TYPE.VENDOR_BILL, @@ -77,12 +75,11 @@ function QuickbooksDesktopExportPage({policy}: WithPolicyConnectionsProps) { displayName={QuickbooksDesktopExportPage.displayName} headerTitle="workspace.accounting.export" title="workspace.qbd.exportDescription" - accessVariants={[CONST.POLICY.ACCESS_VARIANTS.ADMIN]} + accessVariants={[CONST.POLICY.ACCESS_VARIANTS.ADMIN, CONST.POLICY.ACCESS_VARIANTS.CONTROL]} policyID={policyID} featureName={CONST.POLICY.MORE_FEATURES.ARE_CONNECTIONS_ENABLED} contentContainerStyle={styles.pb2} titleStyle={styles.ph5} - shouldBeBlocked={!canUseNewDotQBD} // TODO: [QBD] remove it once the QBD beta is done connectionName={CONST.POLICY.CONNECTIONS.NAME.QBD} onBackButtonPress={() => Navigation.goBack(ROUTES.POLICY_ACCOUNTING.getRoute(policyID))} > diff --git a/src/pages/workspace/accounting/qbd/export/QuickbooksDesktopNonReimbursableDefaultVendorSelectPage.tsx b/src/pages/workspace/accounting/qbd/export/QuickbooksDesktopNonReimbursableDefaultVendorSelectPage.tsx index b1f2823795c1..bac01ce70ef1 100644 --- a/src/pages/workspace/accounting/qbd/export/QuickbooksDesktopNonReimbursableDefaultVendorSelectPage.tsx +++ b/src/pages/workspace/accounting/qbd/export/QuickbooksDesktopNonReimbursableDefaultVendorSelectPage.tsx @@ -5,7 +5,6 @@ import RadioListItem from '@components/SelectionList/RadioListItem'; import type {ListItem} from '@components/SelectionList/types'; import SelectionScreen from '@components/SelectionScreen'; import useLocalize from '@hooks/useLocalize'; -import usePermissions from '@hooks/usePermissions'; import useThemeStyles from '@hooks/useThemeStyles'; import * as QuickbooksDesktop from '@libs/actions/connections/QuickbooksDesktop'; import * as ErrorUtils from '@libs/ErrorUtils'; @@ -28,7 +27,6 @@ function QuickbooksDesktopNonReimbursableDefaultVendorSelectPage({policy}: WithP const {vendors} = policy?.connections?.quickbooksDesktop?.data ?? {}; const qbdConfig = policy?.connections?.quickbooksDesktop?.config; const nonReimbursableBillDefaultVendor = qbdConfig?.export?.nonReimbursableBillDefaultVendor; - const {canUseNewDotQBD} = usePermissions(); const policyID = policy?.id ?? '-1'; const sections = useMemo(() => { @@ -69,13 +67,12 @@ function QuickbooksDesktopNonReimbursableDefaultVendorSelectPage({policy}: WithP return ( mode.isSelected)?.keyForList} diff --git a/src/pages/workspace/accounting/qbd/export/QuickbooksDesktopOutOfPocketExpenseAccountSelectPage.tsx b/src/pages/workspace/accounting/qbd/export/QuickbooksDesktopOutOfPocketExpenseAccountSelectPage.tsx index 73665cb3823b..86b30b52142f 100644 --- a/src/pages/workspace/accounting/qbd/export/QuickbooksDesktopOutOfPocketExpenseAccountSelectPage.tsx +++ b/src/pages/workspace/accounting/qbd/export/QuickbooksDesktopOutOfPocketExpenseAccountSelectPage.tsx @@ -6,7 +6,6 @@ import type {ListItem} from '@components/SelectionList/types'; import SelectionScreen from '@components/SelectionScreen'; import Text from '@components/Text'; import useLocalize from '@hooks/useLocalize'; -import usePermissions from '@hooks/usePermissions'; import useThemeStyles from '@hooks/useThemeStyles'; import * as QuickbooksDesktop from '@libs/actions/connections/QuickbooksDesktop'; import * as ErrorUtils from '@libs/ErrorUtils'; @@ -30,8 +29,6 @@ function QuickbooksDesktopOutOfPocketExpenseAccountSelectPage({policy}: WithPoli const styles = useThemeStyles(); const qbdConfig = policy?.connections?.quickbooksDesktop?.config; - const {canUseNewDotQBD} = usePermissions(); - const [title, description] = useMemo(() => { let titleText: TranslationPaths | undefined; let descriptionText: string | undefined; @@ -94,7 +91,7 @@ function QuickbooksDesktopOutOfPocketExpenseAccountSelectPage({policy}: WithPoli return ( mode.isSelected)?.keyForList} title={title} - shouldBeBlocked={!canUseNewDotQBD} // TODO: [QBD] remove it once the QBD beta is done connectionName={CONST.POLICY.CONNECTIONS.NAME.QBD} pendingAction={PolicyUtils.settingsPendingAction([CONST.QUICKBOOKS_DESKTOP_CONFIG.REIMBURSABLE_ACCOUNT], qbdConfig?.pendingFields)} errors={ErrorUtils.getLatestErrorField(qbdConfig, CONST.QUICKBOOKS_DESKTOP_CONFIG.REIMBURSABLE_ACCOUNT)} diff --git a/src/pages/workspace/accounting/qbd/export/QuickbooksDesktopOutOfPocketExpenseConfigurationPage.tsx b/src/pages/workspace/accounting/qbd/export/QuickbooksDesktopOutOfPocketExpenseConfigurationPage.tsx index f12d70afc0e7..08092465159b 100644 --- a/src/pages/workspace/accounting/qbd/export/QuickbooksDesktopOutOfPocketExpenseConfigurationPage.tsx +++ b/src/pages/workspace/accounting/qbd/export/QuickbooksDesktopOutOfPocketExpenseConfigurationPage.tsx @@ -4,7 +4,6 @@ import ConnectionLayout from '@components/ConnectionLayout'; import MenuItemWithTopDescription from '@components/MenuItemWithTopDescription'; import OfflineWithFeedback from '@components/OfflineWithFeedback'; import useLocalize from '@hooks/useLocalize'; -import usePermissions from '@hooks/usePermissions'; import useThemeStyles from '@hooks/useThemeStyles'; import * as QuickbooksDesktop from '@libs/actions/connections/QuickbooksDesktop'; import * as ErrorUtils from '@libs/ErrorUtils'; @@ -40,7 +39,6 @@ function QuickbooksDesktopOutOfPocketExpenseConfigurationPage({policy}: WithPoli const policyID = policy?.id ?? '-1'; const qbdConfig = policy?.connections?.quickbooksDesktop?.config; const reimbursable = qbdConfig?.export.reimbursable; - const {canUseNewDotQBD} = usePermissions(); const [exportHintText, accountDescription, accountsList] = useMemo(() => { let hintText: string | undefined; let description: string | undefined; @@ -90,12 +88,11 @@ function QuickbooksDesktopOutOfPocketExpenseConfigurationPage({policy}: WithPoli displayName={QuickbooksDesktopOutOfPocketExpenseConfigurationPage.displayName} headerTitle="workspace.accounting.exportOutOfPocket" title="workspace.qbd.exportOutOfPocketExpensesDescription" - accessVariants={[CONST.POLICY.ACCESS_VARIANTS.ADMIN]} + accessVariants={[CONST.POLICY.ACCESS_VARIANTS.ADMIN, CONST.POLICY.ACCESS_VARIANTS.CONTROL]} policyID={policyID} featureName={CONST.POLICY.MORE_FEATURES.ARE_CONNECTIONS_ENABLED} contentContainerStyle={styles.pb2} titleStyle={styles.ph5} - shouldBeBlocked={!canUseNewDotQBD} // TODO: [QBD] remove it once the QBD beta is done connectionName={CONST.POLICY.CONNECTIONS.NAME.QBD} onBackButtonPress={() => Navigation.goBack(ROUTES.POLICY_ACCOUNTING_QUICKBOOKS_DESKTOP_EXPORT.getRoute(policyID))} > diff --git a/src/pages/workspace/accounting/qbd/export/QuickbooksDesktopOutOfPocketExpenseEntitySelectPage.tsx b/src/pages/workspace/accounting/qbd/export/QuickbooksDesktopOutOfPocketExpenseEntitySelectPage.tsx index a9e29db7c88c..930d26f0a796 100644 --- a/src/pages/workspace/accounting/qbd/export/QuickbooksDesktopOutOfPocketExpenseEntitySelectPage.tsx +++ b/src/pages/workspace/accounting/qbd/export/QuickbooksDesktopOutOfPocketExpenseEntitySelectPage.tsx @@ -4,7 +4,6 @@ import type {ListItem} from '@components/SelectionList/types'; import SelectionScreen from '@components/SelectionScreen'; import type {SelectorType} from '@components/SelectionScreen'; import useLocalize from '@hooks/useLocalize'; -import usePermissions from '@hooks/usePermissions'; import useThemeStyles from '@hooks/useThemeStyles'; import * as QuickbooksDesktop from '@libs/actions/connections/QuickbooksDesktop'; import * as ErrorUtils from '@libs/ErrorUtils'; @@ -30,7 +29,6 @@ function QuickbooksDesktopOutOfPocketExpenseEntitySelectPage({policy}: WithPolic const reimbursable = qbdConfig?.export.reimbursable; const hasErrors = !!qbdConfig?.errorFields?.reimbursable; const policyID = policy?.id ?? '-1'; - const {canUseNewDotQBD} = usePermissions(); const data: MenuItem[] = useMemo( () => [ @@ -87,7 +85,7 @@ function QuickbooksDesktopOutOfPocketExpenseEntitySelectPage({policy}: WithPolic return ( mode.isSelected)?.keyForList} title="workspace.accounting.exportAs" - shouldBeBlocked={!canUseNewDotQBD} // TODO: [QBD] remove it once the QBD beta is done connectionName={CONST.POLICY.CONNECTIONS.NAME.QBD} pendingAction={PolicyUtils.settingsPendingAction([CONST.QUICKBOOKS_DESKTOP_CONFIG.REIMBURSABLE, CONST.QUICKBOOKS_DESKTOP_CONFIG.REIMBURSABLE_ACCOUNT], qbdConfig?.pendingFields)} errors={ diff --git a/src/pages/workspace/accounting/qbd/export/QuickbooksDesktopPreferredExporterConfigurationPage.tsx b/src/pages/workspace/accounting/qbd/export/QuickbooksDesktopPreferredExporterConfigurationPage.tsx index 00b57ca4fd9c..eef48ee04dcf 100644 --- a/src/pages/workspace/accounting/qbd/export/QuickbooksDesktopPreferredExporterConfigurationPage.tsx +++ b/src/pages/workspace/accounting/qbd/export/QuickbooksDesktopPreferredExporterConfigurationPage.tsx @@ -5,7 +5,6 @@ import SelectionScreen from '@components/SelectionScreen'; import Text from '@components/Text'; import useCurrentUserPersonalDetails from '@hooks/useCurrentUserPersonalDetails'; import useLocalize from '@hooks/useLocalize'; -import usePermissions from '@hooks/usePermissions'; import useThemeStyles from '@hooks/useThemeStyles'; import * as QuickbooksDesktop from '@libs/actions/connections/QuickbooksDesktop'; import * as ErrorUtils from '@libs/ErrorUtils'; @@ -28,7 +27,6 @@ function QuickbooksDesktopPreferredExporterConfigurationPage({policy}: WithPolic const qbdConfig = policy?.connections?.quickbooksDesktop?.config; const exporters = getAdminEmployees(policy); const {login: currentUserLogin} = useCurrentUserPersonalDetails(); - const {canUseNewDotQBD} = usePermissions(); const currentExporter = qbdConfig?.export?.exporter; const policyID = policy?.id ?? '-1'; @@ -77,7 +75,7 @@ function QuickbooksDesktopPreferredExporterConfigurationPage({policy}: WithPolic return ( mode.isSelected)?.keyForList} title="workspace.accounting.preferredExporter" - shouldBeBlocked={!canUseNewDotQBD} // TODO: [QBD] Remove it once the QBD beta is done connectionName={CONST.POLICY.CONNECTIONS.NAME.QBD} pendingAction={PolicyUtils.settingsPendingAction([CONST.QUICKBOOKS_DESKTOP_CONFIG.EXPORTER], qbdConfig?.pendingFields)} errors={ErrorUtils.getLatestErrorField(qbdConfig, CONST.QUICKBOOKS_DESKTOP_CONFIG.EXPORTER)} diff --git a/src/pages/workspace/accounting/qbd/import/QuickbooksDesktopChartOfAccountsPage.tsx b/src/pages/workspace/accounting/qbd/import/QuickbooksDesktopChartOfAccountsPage.tsx index 8e6cd895c435..90a7478f0e64 100644 --- a/src/pages/workspace/accounting/qbd/import/QuickbooksDesktopChartOfAccountsPage.tsx +++ b/src/pages/workspace/accounting/qbd/import/QuickbooksDesktopChartOfAccountsPage.tsx @@ -20,7 +20,6 @@ function QuickbooksDesktopChartOfAccountsPage({policy}: WithPolicyProps) { const {translate} = useLocalize(); const styles = useThemeStyles(); const policyID = policy?.id ?? '-1'; - const {canUseNewDotQBD} = usePermissions(); const qbdConfig = policy?.connections?.quickbooksDesktop?.config; return ( @@ -29,11 +28,10 @@ function QuickbooksDesktopChartOfAccountsPage({policy}: WithPolicyProps) { displayName={QuickbooksDesktopChartOfAccountsPage.displayName} headerTitle="workspace.accounting.accounts" title="workspace.qbd.accountsDescription" - accessVariants={[CONST.POLICY.ACCESS_VARIANTS.ADMIN]} + accessVariants={[CONST.POLICY.ACCESS_VARIANTS.ADMIN, CONST.POLICY.ACCESS_VARIANTS.CONTROL]} featureName={CONST.POLICY.MORE_FEATURES.ARE_CONNECTIONS_ENABLED} contentContainerStyle={[styles.pb2, styles.ph5]} connectionName={CONST.POLICY.CONNECTIONS.NAME.QBD} - shouldBeBlocked={!canUseNewDotQBD} // TODO: [QBD] Will be removed when release onBackButtonPress={() => Navigation.goBack(ROUTES.POLICY_ACCOUNTING_QUICKBOOKS_DESKTOP_IMPORT.getRoute(policyID))} > mode.isSelected)?.keyForList} title="workspace.common.displayedAs" - shouldBeBlocked={!canUseNewDotQBD} // TODO: [QBD] remove it once the QBD beta is done connectionName={CONST.POLICY.CONNECTIONS.NAME.QBD} pendingAction={PolicyUtils.settingsPendingAction([CONST.QUICKBOOKS_DESKTOP_CONFIG.MAPPINGS.CLASSES], qbdConfig?.pendingFields)} errors={ErrorUtils.getLatestErrorField(qbdConfig, CONST.QUICKBOOKS_DESKTOP_CONFIG.MAPPINGS.CLASSES)} diff --git a/src/pages/workspace/accounting/qbd/import/QuickbooksDesktopClassesPage.tsx b/src/pages/workspace/accounting/qbd/import/QuickbooksDesktopClassesPage.tsx index b480b442bd88..63a14cf34236 100644 --- a/src/pages/workspace/accounting/qbd/import/QuickbooksDesktopClassesPage.tsx +++ b/src/pages/workspace/accounting/qbd/import/QuickbooksDesktopClassesPage.tsx @@ -19,7 +19,6 @@ import ROUTES from '@src/ROUTES'; function QuickbooksDesktopClassesPage({policy}: WithPolicyProps) { const {translate} = useLocalize(); const styles = useThemeStyles(); - const {canUseNewDotQBD} = usePermissions(); const policyID = policy?.id ?? '-1'; const qbdConfig = policy?.connections?.quickbooksDesktop?.config; const isSwitchOn = !!(qbdConfig?.mappings?.classes && qbdConfig.mappings.classes !== CONST.INTEGRATION_ENTITY_MAP_TYPES.NONE); @@ -30,11 +29,10 @@ function QuickbooksDesktopClassesPage({policy}: WithPolicyProps) { displayName={QuickbooksDesktopClassesPage.displayName} headerTitle="workspace.qbd.classes" title="workspace.qbd.classesDescription" - accessVariants={[CONST.POLICY.ACCESS_VARIANTS.ADMIN]} + accessVariants={[CONST.POLICY.ACCESS_VARIANTS.ADMIN, CONST.POLICY.ACCESS_VARIANTS.CONTROL]} policyID={policyID} featureName={CONST.POLICY.MORE_FEATURES.ARE_CONNECTIONS_ENABLED} contentContainerStyle={[styles.pb2, styles.ph5]} - shouldBeBlocked={!canUseNewDotQBD} // TODO: [QBD] Will be removed when release connectionName={CONST.POLICY.CONNECTIONS.NAME.QBD} onBackButtonPress={() => Navigation.goBack(ROUTES.POLICY_ACCOUNTING_QUICKBOOKS_DESKTOP_IMPORT.getRoute(policyID))} > diff --git a/src/pages/workspace/accounting/qbd/import/QuickbooksDesktopCustomersDisplayedAsPage.tsx b/src/pages/workspace/accounting/qbd/import/QuickbooksDesktopCustomersDisplayedAsPage.tsx index a4b0a94bfd5e..4d088ed67e8d 100644 --- a/src/pages/workspace/accounting/qbd/import/QuickbooksDesktopCustomersDisplayedAsPage.tsx +++ b/src/pages/workspace/accounting/qbd/import/QuickbooksDesktopCustomersDisplayedAsPage.tsx @@ -3,7 +3,6 @@ import RadioListItem from '@components/SelectionList/RadioListItem'; import type {ListItem} from '@components/SelectionList/types'; import SelectionScreen from '@components/SelectionScreen'; import useLocalize from '@hooks/useLocalize'; -import usePermissions from '@hooks/usePermissions'; import useThemeStyles from '@hooks/useThemeStyles'; import * as QuickbooksDesktop from '@libs/actions/connections/QuickbooksDesktop'; import * as ErrorUtils from '@libs/ErrorUtils'; @@ -21,7 +20,6 @@ type CardListItem = ListItem & { function QuickbooksDesktopCustomersDisplayedAsPage({policy}: WithPolicyConnectionsProps) { const {translate} = useLocalize(); - const {canUseNewDotQBD} = usePermissions(); const styles = useThemeStyles(); const policyID = policy?.id ?? '-1'; const qbdConfig = policy?.connections?.quickbooksDesktop?.config; @@ -56,7 +54,7 @@ function QuickbooksDesktopCustomersDisplayedAsPage({policy}: WithPolicyConnectio return ( mode.isSelected)?.keyForList} title="workspace.common.displayedAs" - shouldBeBlocked={!canUseNewDotQBD} // TODO: [QBD] remove it once the QBD beta is done connectionName={CONST.POLICY.CONNECTIONS.NAME.QBD} pendingAction={PolicyUtils.settingsPendingAction([CONST.QUICKBOOKS_DESKTOP_CONFIG.MAPPINGS.CUSTOMERS], qbdConfig?.pendingFields)} errors={ErrorUtils.getLatestErrorField(qbdConfig, CONST.QUICKBOOKS_DESKTOP_CONFIG.MAPPINGS.CUSTOMERS)} diff --git a/src/pages/workspace/accounting/qbd/import/QuickbooksDesktopCustomersPage.tsx b/src/pages/workspace/accounting/qbd/import/QuickbooksDesktopCustomersPage.tsx index e58826a12703..528749b967f4 100644 --- a/src/pages/workspace/accounting/qbd/import/QuickbooksDesktopCustomersPage.tsx +++ b/src/pages/workspace/accounting/qbd/import/QuickbooksDesktopCustomersPage.tsx @@ -19,7 +19,6 @@ import ROUTES from '@src/ROUTES'; function QuickbooksDesktopCustomersPage({policy}: WithPolicyProps) { const {translate} = useLocalize(); const styles = useThemeStyles(); - const {canUseNewDotQBD} = usePermissions(); const policyID = policy?.id ?? '-1'; const qbdConfig = policy?.connections?.quickbooksDesktop?.config; const isSwitchOn = !!(qbdConfig?.mappings?.customers && qbdConfig.mappings.customers !== CONST.INTEGRATION_ENTITY_MAP_TYPES.NONE); @@ -30,11 +29,10 @@ function QuickbooksDesktopCustomersPage({policy}: WithPolicyProps) { displayName={QuickbooksDesktopCustomersPage.displayName} headerTitle="workspace.qbd.customers" title="workspace.qbd.customersDescription" - accessVariants={[CONST.POLICY.ACCESS_VARIANTS.ADMIN]} + accessVariants={[CONST.POLICY.ACCESS_VARIANTS.ADMIN, CONST.POLICY.ACCESS_VARIANTS.CONTROL]} policyID={policyID} featureName={CONST.POLICY.MORE_FEATURES.ARE_CONNECTIONS_ENABLED} contentContainerStyle={[styles.pb2, styles.ph5]} - shouldBeBlocked={!canUseNewDotQBD} // TODO: [QBD] Will be removed when release connectionName={CONST.POLICY.CONNECTIONS.NAME.QBD} onBackButtonPress={() => Navigation.goBack(ROUTES.POLICY_ACCOUNTING_QUICKBOOKS_DESKTOP_IMPORT.getRoute(policyID))} > diff --git a/src/pages/workspace/accounting/qbd/import/QuickbooksDesktopImportPage.tsx b/src/pages/workspace/accounting/qbd/import/QuickbooksDesktopImportPage.tsx index 1f8a4dde2bbd..c83ec9f85b1b 100644 --- a/src/pages/workspace/accounting/qbd/import/QuickbooksDesktopImportPage.tsx +++ b/src/pages/workspace/accounting/qbd/import/QuickbooksDesktopImportPage.tsx @@ -3,7 +3,6 @@ import ConnectionLayout from '@components/ConnectionLayout'; import MenuItemWithTopDescription from '@components/MenuItemWithTopDescription'; import OfflineWithFeedback from '@components/OfflineWithFeedback'; import useLocalize from '@hooks/useLocalize'; -import usePermissions from '@hooks/usePermissions'; import useThemeStyles from '@hooks/useThemeStyles'; import * as PolicyUtils from '@libs/PolicyUtils'; import Navigation from '@navigation/Navigation'; @@ -24,7 +23,6 @@ function QuickbooksDesktopImportPage({policy}: WithPolicyProps) { const styles = useThemeStyles(); const policyID = policy?.id ?? '-1'; const {mappings, pendingFields, errorFields} = policy?.connections?.quickbooksDesktop?.config ?? {}; - const {canUseNewDotQBD} = usePermissions(); const sections: QBDSectionType[] = [ { @@ -57,12 +55,11 @@ function QuickbooksDesktopImportPage({policy}: WithPolicyProps) { displayName={QuickbooksDesktopImportPage.displayName} headerTitle="workspace.accounting.import" title="workspace.qbd.importDescription" - accessVariants={[CONST.POLICY.ACCESS_VARIANTS.ADMIN]} + accessVariants={[CONST.POLICY.ACCESS_VARIANTS.ADMIN, CONST.POLICY.ACCESS_VARIANTS.CONTROL]} policyID={policyID} featureName={CONST.POLICY.MORE_FEATURES.ARE_CONNECTIONS_ENABLED} contentContainerStyle={styles.pb2} titleStyle={styles.ph5} - shouldBeBlocked={!canUseNewDotQBD} // TODO: [QBD] Will be removed when release connectionName={CONST.POLICY.CONNECTIONS.NAME.QBD} onBackButtonPress={() => Navigation.goBack(ROUTES.POLICY_ACCOUNTING.getRoute(policyID))} > diff --git a/src/pages/workspace/accounting/qbd/import/QuickbooksDesktopItemsPage.tsx b/src/pages/workspace/accounting/qbd/import/QuickbooksDesktopItemsPage.tsx index c73ae2d8e754..1bb2af69eda1 100644 --- a/src/pages/workspace/accounting/qbd/import/QuickbooksDesktopItemsPage.tsx +++ b/src/pages/workspace/accounting/qbd/import/QuickbooksDesktopItemsPage.tsx @@ -1,7 +1,6 @@ import React from 'react'; import ConnectionLayout from '@components/ConnectionLayout'; import useLocalize from '@hooks/useLocalize'; -import usePermissions from '@hooks/usePermissions'; import useThemeStyles from '@hooks/useThemeStyles'; import * as QuickbooksDesktop from '@libs/actions/connections/QuickbooksDesktop'; import * as ErrorUtils from '@libs/ErrorUtils'; @@ -17,7 +16,6 @@ import ROUTES from '@src/ROUTES'; function QuickbooksDesktopItemsPage({policy}: WithPolicyProps) { const {translate} = useLocalize(); const styles = useThemeStyles(); - const {canUseNewDotQBD} = usePermissions(); const policyID = policy?.id ?? '-1'; const qbdConfig = policy?.connections?.quickbooksDesktop?.config; @@ -26,11 +24,10 @@ function QuickbooksDesktopItemsPage({policy}: WithPolicyProps) { displayName={QuickbooksDesktopItemsPage.displayName} headerTitle="workspace.qbd.items" title="workspace.qbd.itemsDescription" - accessVariants={[CONST.POLICY.ACCESS_VARIANTS.ADMIN]} + accessVariants={[CONST.POLICY.ACCESS_VARIANTS.ADMIN, CONST.POLICY.ACCESS_VARIANTS.CONTROL]} policyID={policyID} featureName={CONST.POLICY.MORE_FEATURES.ARE_CONNECTIONS_ENABLED} contentContainerStyle={[styles.pb2, styles.ph5]} - shouldBeBlocked={!canUseNewDotQBD} // TODO: [QBD] Will be removed when release connectionName={CONST.POLICY.CONNECTIONS.NAME.QBD} onBackButtonPress={() => Navigation.goBack(ROUTES.POLICY_ACCOUNTING_QUICKBOOKS_DESKTOP_IMPORT.getRoute(policyID))} > diff --git a/src/pages/workspace/accounting/utils.tsx b/src/pages/workspace/accounting/utils.tsx index aadb8806f67f..5b20b522ac23 100644 --- a/src/pages/workspace/accounting/utils.tsx +++ b/src/pages/workspace/accounting/utils.tsx @@ -271,7 +271,6 @@ function getAccountingIntegrationData( onExportPagePress: () => Navigation.navigate(ROUTES.POLICY_ACCOUNTING_QUICKBOOKS_DESKTOP_EXPORT.getRoute(policyID)), onCardReconciliationPagePress: () => {}, onAdvancedPagePress: () => Navigation.navigate(ROUTES.WORKSPACE_ACCOUNTING_QUICKBOOKS_DESKTOP_ADVANCED.getRoute(policyID)), - // TODO: [QBD] Make sure all values are passed to subscribedSettings subscribedImportSettings: [ CONST.QUICKBOOKS_DESKTOP_CONFIG.ENABLE_NEW_CATEGORIES, CONST.QUICKBOOKS_DESKTOP_CONFIG.MAPPINGS.CLASSES, From 4a129b103fda0750a9e87159c61209502ec8f4b0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lucien=20Akchot=C3=A9?= Date: Mon, 28 Oct 2024 17:18:50 +0100 Subject: [PATCH 4/4] remove unneeded imports --- .../qbd/import/QuickbooksDesktopChartOfAccountsPage.tsx | 1 - .../accounting/qbd/import/QuickbooksDesktopClassesPage.tsx | 1 - .../accounting/qbd/import/QuickbooksDesktopCustomersPage.tsx | 1 - 3 files changed, 3 deletions(-) diff --git a/src/pages/workspace/accounting/qbd/import/QuickbooksDesktopChartOfAccountsPage.tsx b/src/pages/workspace/accounting/qbd/import/QuickbooksDesktopChartOfAccountsPage.tsx index 90a7478f0e64..45335ad759be 100644 --- a/src/pages/workspace/accounting/qbd/import/QuickbooksDesktopChartOfAccountsPage.tsx +++ b/src/pages/workspace/accounting/qbd/import/QuickbooksDesktopChartOfAccountsPage.tsx @@ -3,7 +3,6 @@ import ConnectionLayout from '@components/ConnectionLayout'; import MenuItemWithTopDescription from '@components/MenuItemWithTopDescription'; import Text from '@components/Text'; import useLocalize from '@hooks/useLocalize'; -import usePermissions from '@hooks/usePermissions'; import useThemeStyles from '@hooks/useThemeStyles'; import * as QuickbooksDesktop from '@libs/actions/connections/QuickbooksDesktop'; import * as ErrorUtils from '@libs/ErrorUtils'; diff --git a/src/pages/workspace/accounting/qbd/import/QuickbooksDesktopClassesPage.tsx b/src/pages/workspace/accounting/qbd/import/QuickbooksDesktopClassesPage.tsx index 63a14cf34236..6ce56c44c680 100644 --- a/src/pages/workspace/accounting/qbd/import/QuickbooksDesktopClassesPage.tsx +++ b/src/pages/workspace/accounting/qbd/import/QuickbooksDesktopClassesPage.tsx @@ -3,7 +3,6 @@ import ConnectionLayout from '@components/ConnectionLayout'; import MenuItemWithTopDescription from '@components/MenuItemWithTopDescription'; import OfflineWithFeedback from '@components/OfflineWithFeedback'; import useLocalize from '@hooks/useLocalize'; -import usePermissions from '@hooks/usePermissions'; import useThemeStyles from '@hooks/useThemeStyles'; import * as QuickbooksDesktop from '@libs/actions/connections/QuickbooksDesktop'; import * as ErrorUtils from '@libs/ErrorUtils'; diff --git a/src/pages/workspace/accounting/qbd/import/QuickbooksDesktopCustomersPage.tsx b/src/pages/workspace/accounting/qbd/import/QuickbooksDesktopCustomersPage.tsx index 528749b967f4..3f0300dc2bf4 100644 --- a/src/pages/workspace/accounting/qbd/import/QuickbooksDesktopCustomersPage.tsx +++ b/src/pages/workspace/accounting/qbd/import/QuickbooksDesktopCustomersPage.tsx @@ -3,7 +3,6 @@ import ConnectionLayout from '@components/ConnectionLayout'; import MenuItemWithTopDescription from '@components/MenuItemWithTopDescription'; import OfflineWithFeedback from '@components/OfflineWithFeedback'; import useLocalize from '@hooks/useLocalize'; -import usePermissions from '@hooks/usePermissions'; import useThemeStyles from '@hooks/useThemeStyles'; import * as QuickbooksDesktop from '@libs/actions/connections/QuickbooksDesktop'; import * as ErrorUtils from '@libs/ErrorUtils';