From 56e5b231a421a6550756ffbc69afe16dcce7c29a Mon Sep 17 00:00:00 2001 From: Daniel Gale-Rosen Date: Mon, 4 Nov 2024 12:19:50 -0500 Subject: [PATCH 1/2] remove copilot beta --- src/CONST.ts | 1 - src/components/AccountSwitcher.tsx | 3 +- src/libs/Permissions.ts | 5 -- .../Security/SecuritySettingsPage.tsx | 87 +++++++++---------- 4 files changed, 43 insertions(+), 53 deletions(-) diff --git a/src/CONST.ts b/src/CONST.ts index 437ee4e7fd424..7915851e0cd29 100755 --- a/src/CONST.ts +++ b/src/CONST.ts @@ -620,7 +620,6 @@ const CONST = { COMPANY_CARD_FEEDS: 'companyCardFeeds', DIRECT_FEEDS: 'directFeeds', NETSUITE_USA_TAX: 'netsuiteUsaTax', - NEW_DOT_COPILOT: 'newDotCopilot', COMBINED_TRACK_SUBMIT: 'combinedTrackSubmit', CATEGORY_AND_TAG_APPROVERS: 'categoryAndTagApprovers', PER_DIEM: 'newDotPerDiem', diff --git a/src/components/AccountSwitcher.tsx b/src/components/AccountSwitcher.tsx index ad58294c0cc8c..41c6b3bdb5fea 100644 --- a/src/components/AccountSwitcher.tsx +++ b/src/components/AccountSwitcher.tsx @@ -34,7 +34,6 @@ function AccountSwitcher() { const theme = useTheme(); const {translate} = useLocalize(); const {isOffline} = useNetwork(); - const {canUseNewDotCopilot} = usePermissions(); const {shouldUseNarrowLayout} = useResponsiveLayout(); const [account] = useOnyx(ONYXKEYS.ACCOUNT); const [session] = useOnyx(ONYXKEYS.SESSION); @@ -47,7 +46,7 @@ function AccountSwitcher() { const delegators = account?.delegatedAccess?.delegators ?? []; const isActingAsDelegate = !!account?.delegatedAccess?.delegate ?? false; - const canSwitchAccounts = canUseNewDotCopilot && (delegators.length > 0 || isActingAsDelegate); + const canSwitchAccounts = delegators.length > 0 || isActingAsDelegate; const createBaseMenuItem = ( personalDetails: PersonalDetails | undefined, diff --git a/src/libs/Permissions.ts b/src/libs/Permissions.ts index a02a456c48fe4..009724e73e93c 100644 --- a/src/libs/Permissions.ts +++ b/src/libs/Permissions.ts @@ -36,10 +36,6 @@ function canUseNetSuiteUSATax(betas: OnyxEntry): boolean { return !!betas?.includes(CONST.BETAS.NETSUITE_USA_TAX) || canUseAllBetas(betas); } -function canUseNewDotCopilot(betas: OnyxEntry): boolean { - return !!betas?.includes(CONST.BETAS.NEW_DOT_COPILOT) || canUseAllBetas(betas); -} - function canUseCategoryAndTagApprovers(betas: OnyxEntry): boolean { return !!betas?.includes(CONST.BETAS.CATEGORY_AND_TAG_APPROVERS) || canUseAllBetas(betas); } @@ -69,7 +65,6 @@ export default { canUseCompanyCardFeeds, canUseDirectFeeds, canUseNetSuiteUSATax, - canUseNewDotCopilot, canUseCombinedTrackSubmit, canUseCategoryAndTagApprovers, canUsePerDiem, diff --git a/src/pages/settings/Security/SecuritySettingsPage.tsx b/src/pages/settings/Security/SecuritySettingsPage.tsx index ec82000d06c82..5493c58fc4b86 100644 --- a/src/pages/settings/Security/SecuritySettingsPage.tsx +++ b/src/pages/settings/Security/SecuritySettingsPage.tsx @@ -46,7 +46,6 @@ function SecuritySettingsPage() { const {translate} = useLocalize(); const waitForNavigate = useWaitForNavigation(); const {shouldUseNarrowLayout} = useResponsiveLayout(); - const {canUseNewDotCopilot} = usePermissions(); const {windowWidth} = useWindowDimensions(); const personalDetails = usePersonalDetails(); @@ -236,50 +235,48 @@ function SecuritySettingsPage() { shouldUseSingleExecution /> - {!!canUseNewDotCopilot && ( - -
( - - {translate('delegate.copilotDelegatedAccessDescription')} - - {translate('common.learnMore')} - - - )} - isCentralPane - subtitleMuted - titleStyles={styles.accountSettingsSectionTitle} - childrenStyles={styles.pt5} - > - {hasDelegates && ( - <> - {translate('delegate.membersCanAccessYourAccount')} - - - )} - {!isActingAsDelegate && ( - Navigation.navigate(ROUTES.SETTINGS_ADD_DELEGATE)} - shouldShowRightIcon - wrapperStyle={[styles.sectionMenuItemTopDescription, styles.mb6]} - /> - )} - {hasDelegators && ( - <> - {translate('delegate.youCanAccessTheseAccounts')} - - - )} -
-
- )} + +
( + + {translate('delegate.copilotDelegatedAccessDescription')} + + {translate('common.learnMore')} + + + )} + isCentralPane + subtitleMuted + titleStyles={styles.accountSettingsSectionTitle} + childrenStyles={styles.pt5} + > + {hasDelegates && ( + <> + {translate('delegate.membersCanAccessYourAccount')} + + + )} + {!isActingAsDelegate && ( + Navigation.navigate(ROUTES.SETTINGS_ADD_DELEGATE)} + shouldShowRightIcon + wrapperStyle={[styles.sectionMenuItemTopDescription, styles.mb6]} + /> + )} + {hasDelegators && ( + <> + {translate('delegate.youCanAccessTheseAccounts')} + + + )} +
+
} From 2bf898085b19dc344ce416af7f040d9acb6f54c3 Mon Sep 17 00:00:00 2001 From: Daniel Gale-Rosen Date: Mon, 4 Nov 2024 12:48:39 -0500 Subject: [PATCH 2/2] remove unused usePermissions --- src/components/AccountSwitcher.tsx | 1 - src/pages/settings/Security/SecuritySettingsPage.tsx | 1 - 2 files changed, 2 deletions(-) diff --git a/src/components/AccountSwitcher.tsx b/src/components/AccountSwitcher.tsx index 41c6b3bdb5fea..d35877129a84a 100644 --- a/src/components/AccountSwitcher.tsx +++ b/src/components/AccountSwitcher.tsx @@ -5,7 +5,6 @@ import {useOnyx} from 'react-native-onyx'; import useCurrentUserPersonalDetails from '@hooks/useCurrentUserPersonalDetails'; import useLocalize from '@hooks/useLocalize'; import useNetwork from '@hooks/useNetwork'; -import usePermissions from '@hooks/usePermissions'; import useResponsiveLayout from '@hooks/useResponsiveLayout'; import useTheme from '@hooks/useTheme'; import useThemeStyles from '@hooks/useThemeStyles'; diff --git a/src/pages/settings/Security/SecuritySettingsPage.tsx b/src/pages/settings/Security/SecuritySettingsPage.tsx index 5493c58fc4b86..16b9ada4c9b59 100644 --- a/src/pages/settings/Security/SecuritySettingsPage.tsx +++ b/src/pages/settings/Security/SecuritySettingsPage.tsx @@ -21,7 +21,6 @@ import Section from '@components/Section'; import Text from '@components/Text'; import TextLink from '@components/TextLink'; import useLocalize from '@hooks/useLocalize'; -import usePermissions from '@hooks/usePermissions'; import useResponsiveLayout from '@hooks/useResponsiveLayout'; import useThemeStyles from '@hooks/useThemeStyles'; import useWaitForNavigation from '@hooks/useWaitForNavigation';