diff --git a/config/oxlint/oxlint.seatbelt.tsv b/config/oxlint/oxlint.seatbelt.tsv index a648ccd422d4..7fc46ed31e45 100644 --- a/config/oxlint/oxlint.seatbelt.tsv +++ b/config/oxlint/oxlint.seatbelt.tsv @@ -1495,7 +1495,6 @@ "../../src/pages/settings/Security/MergeAccounts/MergeResultPage.tsx" "no-restricted-imports" 1 "../../src/pages/settings/Security/SecuritySettingsPage.tsx" "no-restricted-imports" 1 "../../src/pages/settings/Security/TwoFactorAuth/DynamicSuccessPage.tsx" "rulesdir/no-onyx-loading-status" 1 -"../../src/pages/settings/Security/TwoFactorAuth/EnabledPage.tsx" "@typescript-eslint/no-deprecated/MenuItem" 1 "../../src/pages/settings/Security/TwoFactorAuth/EnabledPage.tsx" "@typescript-eslint/no-unnecessary-type-assertion" 1 "../../src/pages/settings/Security/TwoFactorAuth/SuccessPage.tsx" "rulesdir/no-onyx-loading-status" 1 "../../src/pages/settings/Security/TwoFactorAuth/TwoFactorAuthWrapper.tsx" "no-restricted-imports" 1 @@ -1694,14 +1693,12 @@ "../../src/pages/workspace/accounting/AccountingContext/default.ts" "@typescript-eslint/no-unsafe-type-assertion" 1 "../../src/pages/workspace/accounting/AccountingSetupWebViewPage.tsx" "no-restricted-imports" 1 "../../src/pages/workspace/accounting/businessCentral/BusinessCentralPrerequisitesPage.tsx" "no-restricted-imports" 1 -"../../src/pages/workspace/accounting/campfire/CampfireExistingConnectionsPage.tsx" "@typescript-eslint/no-deprecated/MenuItem" 1 "../../src/pages/workspace/accounting/campfire/CampfireExistingConnectionsPage.tsx" "no-restricted-imports" 1 "../../src/pages/workspace/accounting/campfire/export/CampfireExportPage.tsx" "@typescript-eslint/no-unsafe-type-assertion" 1 "../../src/pages/workspace/accounting/certinia/CertiniaExistingConnectionsPage.tsx" "no-restricted-imports" 1 "../../src/pages/workspace/accounting/certinia/import/CertiniaDimensionMappingPage.tsx" "@typescript-eslint/no-unsafe-type-assertion" 1 "../../src/pages/workspace/accounting/ClaimOfferPage.tsx" "@typescript-eslint/no-unsafe-type-assertion" 1 "../../src/pages/workspace/accounting/ClaimOfferPage.tsx" "no-restricted-imports" 1 -"../../src/pages/workspace/accounting/dualentry/DualEntryExistingConnectionsPage.tsx" "@typescript-eslint/no-deprecated/MenuItem" 1 "../../src/pages/workspace/accounting/dualentry/DualEntryExistingConnectionsPage.tsx" "no-restricted-imports" 1 "../../src/pages/workspace/accounting/dualentry/export/DualEntryExportPage.tsx" "@typescript-eslint/no-unsafe-type-assertion" 1 "../../src/pages/workspace/accounting/ExactOnlineWaitlistButton.tsx" "rulesdir/no-onyx-loading-status" 4 @@ -1999,7 +1996,6 @@ "../../src/pages/workspace/tags/DynamicTagApproverPage.tsx" "no-restricted-imports" 1 "../../src/pages/workspace/tags/DynamicTagGLCodePage.tsx" "no-restricted-imports" 1 "../../src/pages/workspace/tags/DynamicTagGLCodePage.tsx" "rulesdir/no-onyx-loading-status" 1 -"../../src/pages/workspace/tags/DynamicTagSettingsPage.tsx" "@typescript-eslint/no-deprecated/MenuItemWithTopDescription" 1 "../../src/pages/workspace/tags/DynamicTagSettingsPage.tsx" "no-restricted-imports" 1 "../../src/pages/workspace/tags/DynamicWorkspaceEditTagsPage.tsx" "no-restricted-imports" 1 "../../src/pages/workspace/tags/DynamicWorkspaceViewTagsPage.tsx" "no-restricted-imports" 1 diff --git a/src/pages/settings/Security/TwoFactorAuth/EnabledPage.tsx b/src/pages/settings/Security/TwoFactorAuth/EnabledPage.tsx index 8a9b752b8702..b3331df0e064 100644 --- a/src/pages/settings/Security/TwoFactorAuth/EnabledPage.tsx +++ b/src/pages/settings/Security/TwoFactorAuth/EnabledPage.tsx @@ -1,3 +1,4 @@ +import Icon from '@components/Icon'; import {loadIllustration} from '@components/Icon/IllustrationLoader'; import type {IllustrationName} from '@components/Icon/IllustrationLoader'; import MenuItem from '@components/MenuItem'; @@ -16,11 +17,14 @@ import useThemeStyles from '@hooks/useThemeStyles'; import Navigation from '@libs/Navigation/Navigation'; +import {callIfAuthenticated} from '@userActions/Session'; + import CONST from '@src/CONST'; import ONYXKEYS from '@src/ONYXKEYS'; import ROUTES from '@src/ROUTES'; import {createHasAdminPolicyWithXeroConnectionSelector} from '@selectors/Policy'; +import {authTokenTypeSelector} from '@selectors/Session'; import React from 'react'; import {View} from 'react-native'; @@ -34,6 +38,7 @@ function EnabledPage() { const {asset: ShieldYellow} = useMemoizedLazyAsset(() => loadIllustration('ShieldYellow' as IllustrationName)); const {login} = useCurrentUserPersonalDetails(); const [hasAdminPolicyWithXeroConnection] = useOnyx(ONYXKEYS.COLLECTION.POLICY, {selector: createHasAdminPolicyWithXeroConnectionSelector(login)}); + const [session] = useOnyx(ONYXKEYS.SESSION, {selector: authTokenTypeSelector}); const {translate} = useLocalize(); const {showConfirmModal} = useConfirmModal(); const showTwoFactorAuthRequireModal = () => { @@ -67,19 +72,29 @@ function EnabledPage() { onPress={() => Navigation.navigate(ROUTES.SETTINGS_2FA_REPLACE_VERIFY_OLD)} icon={icons.Sync} /> - { + onPress={callIfAuthenticated(() => { if (hasAdminPolicyWithXeroConnection) { showTwoFactorAuthRequireModal(); return; } Navigation.navigate(ROUTES.SETTINGS_2FA_DISABLE); - }} - icon={icons.Close} - iconFill={theme.danger} - /> + }, session)} + > + + + + + + {translate('twoFactorAuth.disableTwoFactorAuth')} + + + ); diff --git a/src/pages/workspace/accounting/campfire/CampfireExistingConnectionsPage.tsx b/src/pages/workspace/accounting/campfire/CampfireExistingConnectionsPage.tsx index 73217cdb68fb..585425a64649 100644 --- a/src/pages/workspace/accounting/campfire/CampfireExistingConnectionsPage.tsx +++ b/src/pages/workspace/accounting/campfire/CampfireExistingConnectionsPage.tsx @@ -1,5 +1,5 @@ import HeaderWithBackButton from '@components/HeaderWithBackButton'; -import MenuItem from '@components/MenuItem'; +import MenuItemNavigation from '@components/MenuItem/presets/MenuItemNavigation'; import MenuItemList from '@components/MenuItemList'; import ScreenWrapper from '@components/ScreenWrapper'; import ScrollView from '@components/ScrollView'; @@ -63,12 +63,10 @@ function CampfireExistingConnectionsPage({route}: CampfireExistingConnectionsPag /> {translate('workspace.common.existingConnectionsDescription', CONST.POLICY.CONNECTIONS.NAME.CAMPFIRE)} - Navigation.navigate(ROUTES.POLICY_ACCOUNTING_CAMPFIRE_SETUP.getRoute(policyID))} /> {translate('workspace.common.existingConnections')} diff --git a/src/pages/workspace/accounting/dualentry/DualEntryExistingConnectionsPage.tsx b/src/pages/workspace/accounting/dualentry/DualEntryExistingConnectionsPage.tsx index eeca111352c3..c18b07be36ee 100644 --- a/src/pages/workspace/accounting/dualentry/DualEntryExistingConnectionsPage.tsx +++ b/src/pages/workspace/accounting/dualentry/DualEntryExistingConnectionsPage.tsx @@ -1,5 +1,5 @@ import HeaderWithBackButton from '@components/HeaderWithBackButton'; -import MenuItem from '@components/MenuItem'; +import MenuItemNavigation from '@components/MenuItem/presets/MenuItemNavigation'; import MenuItemList from '@components/MenuItemList'; import ScreenWrapper from '@components/ScreenWrapper'; import ScrollView from '@components/ScrollView'; @@ -63,12 +63,10 @@ function DualEntryExistingConnectionsPage({route}: DualEntryExistingConnectionsP /> {translate('workspace.common.existingConnectionsDescription', CONST.POLICY.CONNECTIONS.NAME.DUALENTRY)} - Navigation.navigate(ROUTES.POLICY_ACCOUNTING_DUALENTRY_SETUP.getRoute(policyID))} /> {translate('workspace.common.existingConnections')} diff --git a/src/pages/workspace/tags/DynamicTagSettingsPage.tsx b/src/pages/workspace/tags/DynamicTagSettingsPage.tsx index 4d7e6dc97c30..064ce331bcbd 100644 --- a/src/pages/workspace/tags/DynamicTagSettingsPage.tsx +++ b/src/pages/workspace/tags/DynamicTagSettingsPage.tsx @@ -1,8 +1,8 @@ import HeaderWithBackButton from '@components/HeaderWithBackButton'; +import Icon from '@components/Icon'; import MenuItem from '@components/MenuItem'; import MenuItemAction from '@components/MenuItem/presets/MenuItemAction'; import MenuItemField from '@components/MenuItem/presets/MenuItemField'; -import MenuItemWithTopDescription from '@components/MenuItemWithTopDescription'; import {ModalActions} from '@components/Modal/Global/ModalContext'; import OfflineWithFeedback from '@components/OfflineWithFeedback'; import ScreenWrapper from '@components/ScreenWrapper'; @@ -20,6 +20,7 @@ import usePersonalDetailByLogin from '@hooks/usePersonalDetailByLogin'; import usePolicyData from '@hooks/usePolicyData'; import usePolicyFeatureWriteAccess from '@hooks/usePolicyFeatureWriteAccess'; import useScreenBoundDynamicRoute from '@hooks/useScreenBoundDynamicRoute'; +import useTheme from '@hooks/useTheme'; import useThemeStyles from '@hooks/useThemeStyles'; import {getLatestErrorMessageField} from '@libs/ErrorUtils'; @@ -46,6 +47,8 @@ import type {SettingsNavigatorParamList} from '@navigation/types'; import NotFoundPage from '@pages/ErrorPage/NotFoundPage'; import AccessOrNotFoundWrapper from '@pages/workspace/AccessOrNotFoundWrapper'; +import variables from '@styles/variables'; + import {clearPolicyTagErrors, deletePolicyTags, setWorkspaceTagEnabled} from '@userActions/Policy/Tag'; import CONST from '@src/CONST'; @@ -63,6 +66,7 @@ function DynamicTagSettingsPage({route, navigation}: DynamicTagSettingsPageProps const {policyID, tagName, parentTagsFilter} = route.params; const orderWeight = Number(route.params.orderWeight); const styles = useThemeStyles(); + const theme = useTheme(); const {translate, formatPhoneNumber} = useLocalize(); const {isBetaEnabledOrUnknown} = usePermissions(); const isVendorMatchingBetaEnabled = isBetaEnabledOrUnknown(CONST.BETAS.VENDOR_MATCHING); @@ -211,15 +215,21 @@ function DynamicTagSettingsPage({route, navigation}: DynamicTagSettingsPageProps /> - + name={translate(`workspace.tags.glCode`)} + value={currentPolicyTag?.['GL Code']} + onPress={canWriteTags && !hasAccountingConnections ? navigateToEditGlCode : undefined} + > + {canWriteTags && hasAccountingConnections && ( + + )} + {arePolicyRulesEnabled(policy, policyData.categories) && !isMultiLevelTags && (