Skip to content

Commit

Permalink
Merge pull request #51581 from Expensify/lucien/qbd-remove-beta
Browse files Browse the repository at this point in the history
[QBD] Remove beta
  • Loading branch information
nkuoch authored Oct 29, 2024
2 parents 0b38886 + 4a129b1 commit 743a243
Show file tree
Hide file tree
Showing 22 changed files with 19 additions and 84 deletions.
1 change: 0 additions & 1 deletion src/CONST.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
5 changes: 0 additions & 5 deletions src/libs/Permissions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,6 @@ function canUseCombinedTrackSubmit(betas: OnyxEntry<Beta[]>): boolean {
return !!betas?.includes(CONST.BETAS.COMBINED_TRACK_SUBMIT);
}

function canUseNewDotQBD(betas: OnyxEntry<Beta[]>): boolean {
return !!betas?.includes(CONST.BETAS.NEW_DOT_QBD) || canUseAllBetas(betas);
}

/**
* Link previews are temporarily disabled.
*/
Expand All @@ -77,5 +73,4 @@ export default {
canUseWorkspaceRules,
canUseCombinedTrackSubmit,
canUseCategoryAndTagApprovers,
canUseNewDotQBD,
};
4 changes: 1 addition & 3 deletions src/pages/workspace/accounting/PolicyAccountingPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,6 @@ function PolicyAccountingPage({policy}: PolicyAccountingPageProps) {
const [isDisconnectModalOpen, setIsDisconnectModalOpen] = useState(false);
const [datetimeToRelative, setDateTimeToRelative] = useState('');
const threeDotsMenuContainerRef = useRef<View>(null);
const {canUseNewDotQBD} = usePermissions();
const {startIntegrationFlow, popoverAnchorRefs} = useAccountingContext();

const route = useRoute();
Expand All @@ -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);
Expand Down
Original file line number Diff line number Diff line change
@@ -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';
Expand All @@ -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 = [
{
Expand Down Expand Up @@ -50,9 +48,8 @@ function QuickbooksDesktopAdvancedPage({policy}: WithPolicyConnectionsProps) {
<ConnectionLayout
displayName={QuickbooksDesktopAdvancedPage.displayName}
headerTitle="workspace.accounting.advanced"
accessVariants={[CONST.POLICY.ACCESS_VARIANTS.ADMIN, CONST.POLICY.ACCESS_VARIANTS.PAID]}
accessVariants={[CONST.POLICY.ACCESS_VARIANTS.ADMIN, CONST.POLICY.ACCESS_VARIANTS.CONTROL]}
policyID={policyID}
shouldBeBlocked={!canUseNewDotQBD} // TODO: [QBD] remove it once the QBD beta is done
featureName={CONST.POLICY.MORE_FEATURES.ARE_CONNECTIONS_ENABLED}
contentContainerStyle={[styles.pb2, styles.ph5]}
connectionName={CONST.POLICY.CONNECTIONS.NAME.QBD}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 ConnectionUtils from '@libs/ConnectionUtils';
Expand All @@ -25,7 +24,6 @@ function QuickbooksDesktopCompanyCardExpenseAccountPage({policy}: WithPolicyConn
const qbdConfig = policy?.connections?.quickbooksDesktop?.config;
const {vendors} = policy?.connections?.quickbooksDesktop?.data ?? {};
const nonReimbursableBillDefaultVendorObject = vendors?.find((vendor) => vendor.id === qbdConfig?.export?.nonReimbursableBillDefaultVendor);
const {canUseNewDotQBD} = usePermissions();
const nonReimbursable = qbdConfig?.export?.nonReimbursable;
const nonReimbursableAccount = qbdConfig?.export?.nonReimbursableAccount;

Expand Down Expand Up @@ -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}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand All @@ -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;
Expand Down Expand Up @@ -88,12 +86,11 @@ function QuickbooksDesktopCompanyCardExpenseAccountSelectCardPage({policy}: With
return (
<SelectionScreen
policyID={policyID}
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}
displayName={QuickbooksDesktopCompanyCardExpenseAccountSelectCardPage.displayName}
title="workspace.accounting.exportAs"
sections={sections}
shouldBeBlocked={!canUseNewDotQBD} // TODO: [QBD] remove it once the QBD beta is done
listItem={RadioListItem}
onSelectRow={(selection: SelectorType) => selectExportCompanyCard(selection as MenuItem)}
shouldSingleExecuteRowSelect
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand All @@ -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;

Expand Down Expand Up @@ -71,12 +69,11 @@ function QuickbooksDesktopCompanyCardExpenseAccountSelectPage({policy}: WithPoli
return (
<SelectionScreen
policyID={policyID}
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}
displayName={QuickbooksDesktopCompanyCardExpenseAccountSelectPage.displayName}
headerTitleAlreadyTranslated={ConnectionUtils.getQBDNonReimbursableExportAccountType(nonReimbursable)}
headerContent={nonReimbursable ? <Text style={[styles.ph5, styles.pb5]}>{translate(`workspace.qbd.accounts.${nonReimbursable}AccountDescription`)}</Text> : null}
shouldBeBlocked={!canUseNewDotQBD} // TODO: [QBD] remove it once the QBD beta is done
sections={data.length ? [{data}] : []}
listItem={RadioListItem}
onSelectRow={selectExportAccount}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -39,8 +38,6 @@ function QuickbooksDesktopExportDateSelectPage({policy}: WithPolicyConnectionsPr
[exportDate, translate],
);

const {canUseNewDotQBD} = usePermissions();

const selectExportDate = useCallback(
(row: CardListItem) => {
if (row.value !== exportDate) {
Expand All @@ -54,7 +51,7 @@ function QuickbooksDesktopExportDateSelectPage({policy}: WithPolicyConnectionsPr
return (
<SelectionScreen
policyID={policyID}
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}
displayName={QuickbooksDesktopExportDateSelectPage.displayName}
sections={[{data}]}
Expand All @@ -64,7 +61,6 @@ function QuickbooksDesktopExportDateSelectPage({policy}: WithPolicyConnectionsPr
onSelectRow={selectExportDate}
initiallyFocusedOptionKey={data.find((mode) => 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)}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand All @@ -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,
Expand Down Expand Up @@ -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))}
>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand All @@ -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(() => {
Expand Down Expand Up @@ -69,13 +67,12 @@ function QuickbooksDesktopNonReimbursableDefaultVendorSelectPage({policy}: WithP
return (
<SelectionScreen
policyID={policyID}
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}
displayName={QuickbooksDesktopNonReimbursableDefaultVendorSelectPage.displayName}
title="workspace.accounting.defaultVendor"
sections={sections}
listItem={RadioListItem}
shouldBeBlocked={!canUseNewDotQBD} // TODO: [QBD] remove it once the QBD beta is done
onSelectRow={selectVendor}
shouldSingleExecuteRowSelect
initiallyFocusedOptionKey={sections.at(0)?.data.find((mode) => mode.isSelected)?.keyForList}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand All @@ -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;
Expand Down Expand Up @@ -94,7 +91,7 @@ function QuickbooksDesktopOutOfPocketExpenseAccountSelectPage({policy}: WithPoli
return (
<SelectionScreen
policyID={policyID}
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}
displayName={QuickbooksDesktopOutOfPocketExpenseAccountSelectPage.displayName}
sections={data.length ? [{data}] : []}
Expand All @@ -104,7 +101,6 @@ function QuickbooksDesktopOutOfPocketExpenseAccountSelectPage({policy}: WithPoli
onSelectRow={selectExportAccount}
initiallyFocusedOptionKey={data.find((mode) => 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)}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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))}
>
Expand Down
Loading

0 comments on commit 743a243

Please sign in to comment.