Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions config/oxlint/oxlint.seatbelt.tsv

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

NAB: no need to tighten the seatbelt manually. It happens automatically on merge

Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
29 changes: 22 additions & 7 deletions src/pages/settings/Security/TwoFactorAuth/EnabledPage.tsx
Original file line number Diff line number Diff line change
@@ -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';
Expand All @@ -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';

Expand All @@ -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 = () => {
Expand Down Expand Up @@ -67,19 +72,29 @@ function EnabledPage() {
onPress={() => Navigation.navigate(ROUTES.SETTINGS_2FA_REPLACE_VERIFY_OLD)}
icon={icons.Sync}
/>
<MenuItem
<MenuItem.Root
sentryLabel={CONST.SENTRY_LABEL.TWO_FACTOR_AUTH.DISABLE}
title={translate('twoFactorAuth.disableTwoFactorAuth')}
onPress={() => {
onPress={callIfAuthenticated(() => {
if (hasAdminPolicyWithXeroConnection) {
showTwoFactorAuthRequireModal();
return;
}
Navigation.navigate(ROUTES.SETTINGS_2FA_DISABLE);
}}
icon={icons.Close}
iconFill={theme.danger}
/>
}, session)}
>
<MenuItem.Row>
<MenuItem.Leading>
<Icon
src={icons.Close}
fill={theme.danger}
additionalStyles={styles.popoverMenuIcon}
/>
</MenuItem.Leading>
<MenuItem.Content>
<MenuItem.Title>{translate('twoFactorAuth.disableTwoFactorAuth')}</MenuItem.Title>
</MenuItem.Content>
</MenuItem.Row>
</MenuItem.Root>
</ScrollView>
</TwoFactorAuthWrapper>
);
Expand Down
Original file line number Diff line number Diff line change
@@ -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';
Expand Down Expand Up @@ -63,12 +63,10 @@ function CampfireExistingConnectionsPage({route}: CampfireExistingConnectionsPag
/>
<ScrollView style={[styles.flex1]}>
<Text style={[styles.mh5, styles.mb4]}>{translate('workspace.common.existingConnectionsDescription', CONST.POLICY.CONNECTIONS.NAME.CAMPFIRE)}</Text>
<MenuItem
<MenuItemNavigation
sentryLabel={CONST.SENTRY_LABEL.WORKSPACE.ACCOUNTING.CREATE_NEW_CONNECTION}
title={translate('workspace.common.createNewConnection')}
icon={icons.LinkCopy}
iconStyles={styles.br2}
shouldShowRightIcon
onPress={() => Navigation.navigate(ROUTES.POLICY_ACCOUNTING_CAMPFIRE_SETUP.getRoute(policyID))}
/>
<Text style={[styles.sectionTitle, styles.pl5, styles.pr5, styles.pb2, styles.mt3]}>{translate('workspace.common.existingConnections')}</Text>
Expand Down
Original file line number Diff line number Diff line change
@@ -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';
Expand Down Expand Up @@ -63,12 +63,10 @@ function DualEntryExistingConnectionsPage({route}: DualEntryExistingConnectionsP
/>
<ScrollView style={[styles.flex1]}>
<Text style={[styles.mh5, styles.mb4]}>{translate('workspace.common.existingConnectionsDescription', CONST.POLICY.CONNECTIONS.NAME.DUALENTRY)}</Text>
<MenuItem
<MenuItemNavigation
sentryLabel={CONST.SENTRY_LABEL.WORKSPACE.ACCOUNTING.CREATE_NEW_CONNECTION}
title={translate('workspace.common.createNewConnection')}
icon={icons.LinkCopy}
iconStyles={styles.br2}
shouldShowRightIcon
onPress={() => Navigation.navigate(ROUTES.POLICY_ACCOUNTING_DUALENTRY_SETUP.getRoute(policyID))}
/>
<Text style={[styles.sectionTitle, styles.pl5, styles.pr5, styles.pb2, styles.mt3]}>{translate('workspace.common.existingConnections')}</Text>
Expand Down
28 changes: 19 additions & 9 deletions src/pages/workspace/tags/DynamicTagSettingsPage.tsx
Original file line number Diff line number Diff line change
@@ -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';
Expand All @@ -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';
Expand All @@ -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';
Expand All @@ -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);
Expand Down Expand Up @@ -211,15 +215,21 @@ function DynamicTagSettingsPage({route, navigation}: DynamicTagSettingsPageProps
/>
</OfflineWithFeedback>
<OfflineWithFeedback pendingAction={currentPolicyTag.pendingFields?.['GL Code']}>
<MenuItemWithTopDescription
<MenuItemField
sentryLabel={CONST.SENTRY_LABEL.WORKSPACE.TAGS.SETTINGS_GL_CODE}
description={translate(`workspace.tags.glCode`)}
title={currentPolicyTag?.['GL Code']}
onPress={navigateToEditGlCode}
iconRight={hasAccountingConnections ? expensifyIcons.Lock : undefined}
interactive={canWriteTags && !hasAccountingConnections}
shouldShowRightIcon={canWriteTags}
/>
name={translate(`workspace.tags.glCode`)}
value={currentPolicyTag?.['GL Code']}
onPress={canWriteTags && !hasAccountingConnections ? navigateToEditGlCode : undefined}
>
{canWriteTags && hasAccountingConnections && (
<Icon
src={expensifyIcons.Lock}
fill={theme.icon}
width={variables.iconSizeNormal}
height={variables.iconSizeNormal}
/>
)}
</MenuItemField>
</OfflineWithFeedback>

{arePolicyRulesEnabled(policy, policyData.categories) && !isMultiLevelTags && (
Expand Down
Loading