From fd6ebda04c5f18d20321a0d9360ba7a162be6390 Mon Sep 17 00:00:00 2001 From: Hayata Suenaga Date: Thu, 18 Apr 2024 12:21:21 -0700 Subject: [PATCH 01/15] feat: add new UI copy --- src/languages/en.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/src/languages/en.ts b/src/languages/en.ts index ed2587e5e2c6..3237c6066462 100755 --- a/src/languages/en.ts +++ b/src/languages/en.ts @@ -1897,6 +1897,7 @@ export default { categoryRequiredError: 'Category name is required.', existingCategoryError: 'A category with this name already exists.', invalidCategoryName: 'Invalid category name.', + importedFromAccountingSoftware: 'The categories below are imported from your', }, moreFeatures: { spendSection: { From d8e7f4fb6a59eefb9d2d87a3c04dba8ebe309a3c Mon Sep 17 00:00:00 2001 From: Hayata Suenaga Date: Thu, 18 Apr 2024 12:21:45 -0700 Subject: [PATCH 02/15] feat: display text --- .../workspace/categories/WorkspaceCategoriesPage.tsx | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/pages/workspace/categories/WorkspaceCategoriesPage.tsx b/src/pages/workspace/categories/WorkspaceCategoriesPage.tsx index 80394623dba8..85254ca0e9f8 100644 --- a/src/pages/workspace/categories/WorkspaceCategoriesPage.tsx +++ b/src/pages/workspace/categories/WorkspaceCategoriesPage.tsx @@ -17,7 +17,9 @@ import RightElementEnabledStatus from '@components/SelectionList/RightElementEna import TableListItem from '@components/SelectionList/TableListItem'; import type {ListItem} from '@components/SelectionList/types'; import Text from '@components/Text'; +import TextLink from '@components/TextLink'; import WorkspaceEmptyStateSection from '@components/WorkspaceEmptyStateSection'; +import useEnvironment from '@hooks/useEnvironment'; import useLocalize from '@hooks/useLocalize'; import useNetwork from '@hooks/useNetwork'; import useTheme from '@hooks/useTheme'; @@ -64,6 +66,7 @@ function WorkspaceCategoriesPage({policy, policyCategories, route}: WorkspaceCat const dropdownButtonRef = useRef(null); const [deleteCategoriesConfirmModalVisible, setDeleteCategoriesConfirmModalVisible] = useState(false); const isFocused = useIsFocused(); + const {environmentURL} = useEnvironment(); const fetchCategories = useCallback(() => { Policy.openPolicyCategoriesPage(route.params.policyID); @@ -281,6 +284,15 @@ function WorkspaceCategoriesPage({policy, policyCategories, route}: WorkspaceCat {isSmallScreenWidth && {getHeaderButtons()}} {translate('workspace.categories.subtitle')} + + {`${translate('workspace.categories.importedFromAccountingSoftware')} `} + + {`${translate('workspace.accounting.qbo')} settings`} + + {isLoading && ( Date: Thu, 18 Apr 2024 13:34:41 -0700 Subject: [PATCH 03/15] fix: the issue with HOC --- .../categories/WorkspaceCategoriesPage.tsx | 54 +++++++++---------- 1 file changed, 24 insertions(+), 30 deletions(-) diff --git a/src/pages/workspace/categories/WorkspaceCategoriesPage.tsx b/src/pages/workspace/categories/WorkspaceCategoriesPage.tsx index 85254ca0e9f8..27bf59fae0ca 100644 --- a/src/pages/workspace/categories/WorkspaceCategoriesPage.tsx +++ b/src/pages/workspace/categories/WorkspaceCategoriesPage.tsx @@ -1,8 +1,8 @@ -import {useFocusEffect, useIsFocused} from '@react-navigation/native'; -import type {StackScreenProps} from '@react-navigation/stack'; +import type {RouteProp} from '@react-navigation/native'; +import {useFocusEffect, useIsFocused, useRoute} from '@react-navigation/native'; import React, {useCallback, useEffect, useMemo, useRef, useState} from 'react'; import {ActivityIndicator, View} from 'react-native'; -import {withOnyx} from 'react-native-onyx'; +import {useOnyx} from 'react-native-onyx'; import type {OnyxEntry} from 'react-native-onyx'; import Button from '@components/Button'; import ButtonWithDropdownMenu from '@components/ButtonWithDropdownMenu'; @@ -34,6 +34,7 @@ import type {WorkspacesCentralPaneNavigatorParamList} from '@navigation/types'; import AdminPolicyAccessOrNotFoundWrapper from '@pages/workspace/AdminPolicyAccessOrNotFoundWrapper'; import FeatureEnabledAccessOrNotFoundWrapper from '@pages/workspace/FeatureEnabledAccessOrNotFoundWrapper'; import PaidPolicyAccessOrNotFoundWrapper from '@pages/workspace/PaidPolicyAccessOrNotFoundWrapper'; +import withPolicyConnections from '@pages/workspace/withPolicyConnections'; import * as Policy from '@userActions/Policy'; import CONST from '@src/CONST'; import ONYXKEYS from '@src/ONYXKEYS'; @@ -47,17 +48,14 @@ type PolicyOption = ListItem & { keyForList: string; }; -type WorkspaceCategoriesOnyxProps = { +type WorkspaceCategoriesPageProps = { /** The policy the user is accessing. */ policy: OnyxEntry; - - /** Collection of categories attached to a policy */ - policyCategories: OnyxEntry; }; -type WorkspaceCategoriesPageProps = WorkspaceCategoriesOnyxProps & StackScreenProps; +// type WorkspaceCategoriesPageProps = WorkspaceCategoriesOnyxProps &; -function WorkspaceCategoriesPage({policy, policyCategories, route}: WorkspaceCategoriesPageProps) { +function WorkspaceCategoriesPage({policy}: WorkspaceCategoriesPageProps) { const {isSmallScreenWidth} = useWindowDimensions(); const styles = useThemeStyles(); const theme = useTheme(); @@ -67,10 +65,13 @@ function WorkspaceCategoriesPage({policy, policyCategories, route}: WorkspaceCat const [deleteCategoriesConfirmModalVisible, setDeleteCategoriesConfirmModalVisible] = useState(false); const isFocused = useIsFocused(); const {environmentURL} = useEnvironment(); + const route = useRoute>(); + const policyId = route.params.policyID; + const [policyCategories] = useOnyx(`${ONYXKEYS.COLLECTION.POLICY_CATEGORIES}${policyId}` as const); const fetchCategories = useCallback(() => { - Policy.openPolicyCategoriesPage(route.params.policyID); - }, [route.params.policyID]); + Policy.openPolicyCategoriesPage(policyId); + }, [policyId]); const {isOffline} = useNetwork({onReconnect: fetchCategories}); @@ -130,26 +131,26 @@ function WorkspaceCategoriesPage({policy, policyCategories, route}: WorkspaceCat ); const navigateToCategorySettings = (category: PolicyOption) => { - Navigation.navigate(ROUTES.WORKSPACE_CATEGORY_SETTINGS.getRoute(route.params.policyID, category.keyForList)); + Navigation.navigate(ROUTES.WORKSPACE_CATEGORY_SETTINGS.getRoute(policyId, category.keyForList)); }; const navigateToCategoriesSettings = () => { - Navigation.navigate(ROUTES.WORKSPACE_CATEGORIES_SETTINGS.getRoute(route.params.policyID)); + Navigation.navigate(ROUTES.WORKSPACE_CATEGORIES_SETTINGS.getRoute(policyId)); }; const navigateToCreateCategoryPage = () => { - Navigation.navigate(ROUTES.WORKSPACE_CATEGORY_CREATE.getRoute(route.params.policyID)); + Navigation.navigate(ROUTES.WORKSPACE_CATEGORY_CREATE.getRoute(policyId)); }; const dismissError = (item: PolicyOption) => { - Policy.clearCategoryErrors(route.params.policyID, item.keyForList); + Policy.clearCategoryErrors(policyId, item.keyForList); }; const selectedCategoriesArray = Object.keys(selectedCategories).filter((key) => selectedCategories[key]); const handleDeleteCategories = () => { setSelectedCategories({}); - deleteWorkspaceCategories(route.params.policyID, selectedCategoriesArray); + deleteWorkspaceCategories(policyId, selectedCategoriesArray); setDeleteCategoriesConfirmModalVisible(false); }; @@ -182,7 +183,7 @@ function WorkspaceCategoriesPage({policy, policyCategories, route}: WorkspaceCat value: CONST.POLICY.CATEGORIES_BULK_ACTION_TYPES.DISABLE, onSelected: () => { setSelectedCategories({}); - setWorkspaceCategoryEnabled(route.params.policyID, categoriesToDisable); + setWorkspaceCategoryEnabled(policyId, categoriesToDisable); }, }); } @@ -204,7 +205,7 @@ function WorkspaceCategoriesPage({policy, policyCategories, route}: WorkspaceCat value: CONST.POLICY.CATEGORIES_BULK_ACTION_TYPES.ENABLE, onSelected: () => { setSelectedCategories({}); - setWorkspaceCategoryEnabled(route.params.policyID, categoriesToEnable); + setWorkspaceCategoryEnabled(policyId, categoriesToEnable); }, }); } @@ -251,10 +252,10 @@ function WorkspaceCategoriesPage({policy, policyCategories, route}: WorkspaceCat const shouldShowEmptyState = !categoryList.some((category) => category.pendingAction !== CONST.RED_BRICK_ROAD_PENDING_ACTION.DELETE) && !isLoading; return ( - - + + {`${translate('workspace.categories.importedFromAccountingSoftware')} `} {`${translate('workspace.accounting.qbo')} settings`} @@ -332,11 +333,4 @@ function WorkspaceCategoriesPage({policy, policyCategories, route}: WorkspaceCat WorkspaceCategoriesPage.displayName = 'WorkspaceCategoriesPage'; -export default withOnyx({ - policy: { - key: ({route}) => `${ONYXKEYS.COLLECTION.POLICY}${route.params.policyID}`, - }, - policyCategories: { - key: ({route}) => `${ONYXKEYS.COLLECTION.POLICY_CATEGORIES}${route.params.policyID}`, - }, -})(WorkspaceCategoriesPage); +export default withPolicyConnections(WorkspaceCategoriesPage); From 55523a3b558fc69635d6b785989e70363e512dd4 Mon Sep 17 00:00:00 2001 From: Hayata Suenaga Date: Thu, 18 Apr 2024 13:36:27 -0700 Subject: [PATCH 04/15] only display the "imported" message when there is a connection --- .../categories/WorkspaceCategoriesPage.tsx | 23 +++++++++++-------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/src/pages/workspace/categories/WorkspaceCategoriesPage.tsx b/src/pages/workspace/categories/WorkspaceCategoriesPage.tsx index 27bf59fae0ca..83bb383873e6 100644 --- a/src/pages/workspace/categories/WorkspaceCategoriesPage.tsx +++ b/src/pages/workspace/categories/WorkspaceCategoriesPage.tsx @@ -284,16 +284,19 @@ function WorkspaceCategoriesPage({policy}: WorkspaceCategoriesPageProps) { /> {isSmallScreenWidth && {getHeaderButtons()}} - {translate('workspace.categories.subtitle')} - - {`${translate('workspace.categories.importedFromAccountingSoftware')} `} - - {`${translate('workspace.accounting.qbo')} settings`} - - + {policy?.connections ? ( + + {`${translate('workspace.categories.importedFromAccountingSoftware')} `} + + {`${translate('workspace.accounting.qbo')} settings`} + + + ) : ( + {translate('workspace.categories.subtitle')} + )} {isLoading && ( Date: Sun, 21 Apr 2024 13:38:01 -0400 Subject: [PATCH 05/15] chore: add Spanish translation --- src/languages/es.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/src/languages/es.ts b/src/languages/es.ts index beb654cf0bc4..19a783189a3f 100644 --- a/src/languages/es.ts +++ b/src/languages/es.ts @@ -1921,6 +1921,7 @@ export default { categoryRequiredError: 'Lo nombre de la categoría es obligatorio.', existingCategoryError: 'Ya existe una categoría con este nombre.', invalidCategoryName: 'Lo nombre de la categoría es invalido.', + importedFromAccountingSoftware: 'Categorías importadas desde QuickBooks Online', }, moreFeatures: { spendSection: { From 7735295f934bd508d08d9e2863423e26e39ebb58 Mon Sep 17 00:00:00 2001 From: Hayata Suenaga Date: Sun, 21 Apr 2024 13:44:13 -0400 Subject: [PATCH 06/15] chore: delete the unnecessary comments --- src/pages/workspace/categories/WorkspaceCategoriesPage.tsx | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/pages/workspace/categories/WorkspaceCategoriesPage.tsx b/src/pages/workspace/categories/WorkspaceCategoriesPage.tsx index 83bb383873e6..d778ed94721b 100644 --- a/src/pages/workspace/categories/WorkspaceCategoriesPage.tsx +++ b/src/pages/workspace/categories/WorkspaceCategoriesPage.tsx @@ -53,8 +53,6 @@ type WorkspaceCategoriesPageProps = { policy: OnyxEntry; }; -// type WorkspaceCategoriesPageProps = WorkspaceCategoriesOnyxProps &; - function WorkspaceCategoriesPage({policy}: WorkspaceCategoriesPageProps) { const {isSmallScreenWidth} = useWindowDimensions(); const styles = useThemeStyles(); From 1062bcf81fa6561abdb66d73b2e5e24adb10de40 Mon Sep 17 00:00:00 2001 From: Hayata Suenaga Date: Mon, 22 Apr 2024 08:30:37 -0400 Subject: [PATCH 07/15] remove unnecessary const assertion --- src/pages/workspace/categories/WorkspaceCategoriesPage.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/pages/workspace/categories/WorkspaceCategoriesPage.tsx b/src/pages/workspace/categories/WorkspaceCategoriesPage.tsx index d778ed94721b..f98adbae8b90 100644 --- a/src/pages/workspace/categories/WorkspaceCategoriesPage.tsx +++ b/src/pages/workspace/categories/WorkspaceCategoriesPage.tsx @@ -65,7 +65,7 @@ function WorkspaceCategoriesPage({policy}: WorkspaceCategoriesPageProps) { const {environmentURL} = useEnvironment(); const route = useRoute>(); const policyId = route.params.policyID; - const [policyCategories] = useOnyx(`${ONYXKEYS.COLLECTION.POLICY_CATEGORIES}${policyId}` as const); + const [policyCategories] = useOnyx(`${ONYXKEYS.COLLECTION.POLICY_CATEGORIES}${policyId}`); const fetchCategories = useCallback(() => { Policy.openPolicyCategoriesPage(policyId); @@ -282,7 +282,7 @@ function WorkspaceCategoriesPage({policy}: WorkspaceCategoriesPageProps) { /> {isSmallScreenWidth && {getHeaderButtons()}} - {policy?.connections ? ( + {Object.keys(policy?.connections ?? {}).length ? ( {`${translate('workspace.categories.importedFromAccountingSoftware')} `} Date: Mon, 22 Apr 2024 08:32:29 -0400 Subject: [PATCH 08/15] export props type for withPolicyConnections HOC --- src/pages/workspace/withPolicyConnections.tsx | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/pages/workspace/withPolicyConnections.tsx b/src/pages/workspace/withPolicyConnections.tsx index b5d3ffc87a59..261a6f93a237 100644 --- a/src/pages/workspace/withPolicyConnections.tsx +++ b/src/pages/workspace/withPolicyConnections.tsx @@ -58,3 +58,5 @@ function withPolicyConnections(WrappedComponent: ComponentType Date: Mon, 22 Apr 2024 08:35:46 -0400 Subject: [PATCH 09/15] chore: use route from the prop to get the policy ID & fix the type issues --- .../categories/WorkspaceCategoriesPage.tsx | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/src/pages/workspace/categories/WorkspaceCategoriesPage.tsx b/src/pages/workspace/categories/WorkspaceCategoriesPage.tsx index f98adbae8b90..ffc53a0c9c24 100644 --- a/src/pages/workspace/categories/WorkspaceCategoriesPage.tsx +++ b/src/pages/workspace/categories/WorkspaceCategoriesPage.tsx @@ -1,5 +1,4 @@ -import type {RouteProp} from '@react-navigation/native'; -import {useFocusEffect, useIsFocused, useRoute} from '@react-navigation/native'; +import {useFocusEffect, useIsFocused} from '@react-navigation/native'; import React, {useCallback, useEffect, useMemo, useRef, useState} from 'react'; import {ActivityIndicator, View} from 'react-native'; import {useOnyx} from 'react-native-onyx'; @@ -30,16 +29,15 @@ import * as DeviceCapabilities from '@libs/DeviceCapabilities'; import localeCompare from '@libs/LocaleCompare'; import Navigation from '@libs/Navigation/Navigation'; import * as PolicyUtils from '@libs/PolicyUtils'; -import type {WorkspacesCentralPaneNavigatorParamList} from '@navigation/types'; import AdminPolicyAccessOrNotFoundWrapper from '@pages/workspace/AdminPolicyAccessOrNotFoundWrapper'; import FeatureEnabledAccessOrNotFoundWrapper from '@pages/workspace/FeatureEnabledAccessOrNotFoundWrapper'; import PaidPolicyAccessOrNotFoundWrapper from '@pages/workspace/PaidPolicyAccessOrNotFoundWrapper'; +import type {WithPolicyConnectionsProps} from '@pages/workspace/withPolicyConnections'; import withPolicyConnections from '@pages/workspace/withPolicyConnections'; import * as Policy from '@userActions/Policy'; import CONST from '@src/CONST'; import ONYXKEYS from '@src/ONYXKEYS'; import ROUTES from '@src/ROUTES'; -import type SCREENS from '@src/SCREENS'; import type * as OnyxTypes from '@src/types/onyx'; import type DeepValueOf from '@src/types/utils/DeepValueOf'; @@ -48,12 +46,14 @@ type PolicyOption = ListItem & { keyForList: string; }; -type WorkspaceCategoriesPageProps = { +type WorkspaceCategoriesPageOnyxProps = { /** The policy the user is accessing. */ policy: OnyxEntry; }; -function WorkspaceCategoriesPage({policy}: WorkspaceCategoriesPageProps) { +type WorkspaceCategoriesPageProps = WithPolicyConnectionsProps & WorkspaceCategoriesPageOnyxProps; + +function WorkspaceCategoriesPage({policy, route}: WorkspaceCategoriesPageProps) { const {isSmallScreenWidth} = useWindowDimensions(); const styles = useThemeStyles(); const theme = useTheme(); @@ -63,8 +63,7 @@ function WorkspaceCategoriesPage({policy}: WorkspaceCategoriesPageProps) { const [deleteCategoriesConfirmModalVisible, setDeleteCategoriesConfirmModalVisible] = useState(false); const isFocused = useIsFocused(); const {environmentURL} = useEnvironment(); - const route = useRoute>(); - const policyId = route.params.policyID; + const policyId = route.params.policyID ?? ''; const [policyCategories] = useOnyx(`${ONYXKEYS.COLLECTION.POLICY_CATEGORIES}${policyId}`); const fetchCategories = useCallback(() => { From 0a91b8dce0dc8f4fa53d50577c23a186eab79ea5 Mon Sep 17 00:00:00 2001 From: Hayata Suenaga Date: Mon, 22 Apr 2024 08:58:57 -0400 Subject: [PATCH 10/15] fix: translate the whole sentence for the categories page explanatory text --- src/languages/en.ts | 4 +++- src/languages/es.ts | 3 ++- src/languages/types.ts | 3 +++ src/pages/workspace/categories/WorkspaceCategoriesPage.tsx | 2 +- 4 files changed, 9 insertions(+), 3 deletions(-) diff --git a/src/languages/en.ts b/src/languages/en.ts index 3237c6066462..b3030f283e62 100755 --- a/src/languages/en.ts +++ b/src/languages/en.ts @@ -28,6 +28,7 @@ import type { FormattedMaxLengthParams, GoBackMessageParams, GoToRoomParams, + ImportedFromAccountingSoftwareParams, InstantSummaryParams, LocalTimeParams, LoggedInAsParams, @@ -1897,7 +1898,8 @@ export default { categoryRequiredError: 'Category name is required.', existingCategoryError: 'A category with this name already exists.', invalidCategoryName: 'Invalid category name.', - importedFromAccountingSoftware: 'The categories below are imported from your', + importedFromAccountingSoftware: ({accountingSoftwareName}: ImportedFromAccountingSoftwareParams) => + `The categories below are imported from your ${accountingSoftwareName} settings`, }, moreFeatures: { spendSection: { diff --git a/src/languages/es.ts b/src/languages/es.ts index 19a783189a3f..6825d4d085dc 100644 --- a/src/languages/es.ts +++ b/src/languages/es.ts @@ -27,6 +27,7 @@ import type { FormattedMaxLengthParams, GoBackMessageParams, GoToRoomParams, + ImportedFromAccountingSoftwareParams, InstantSummaryParams, LocalTimeParams, LoggedInAsParams, @@ -1921,7 +1922,7 @@ export default { categoryRequiredError: 'Lo nombre de la categoría es obligatorio.', existingCategoryError: 'Ya existe una categoría con este nombre.', invalidCategoryName: 'Lo nombre de la categoría es invalido.', - importedFromAccountingSoftware: 'Categorías importadas desde QuickBooks Online', + importedFromAccountingSoftware: ({accountingSoftwareName}: ImportedFromAccountingSoftwareParams) => `Categorías importadas desde ${accountingSoftwareName}`, }, moreFeatures: { spendSection: { diff --git a/src/languages/types.ts b/src/languages/types.ts index 30b7f842db4c..1312fb704048 100644 --- a/src/languages/types.ts +++ b/src/languages/types.ts @@ -185,6 +185,8 @@ type UserIsAlreadyMemberParams = {login: string; name: string}; type GoToRoomParams = {roomName: string}; +type ImportedFromAccountingSoftwareParams = {accountingSoftwareName: string}; + type WelcomeNoteParams = {workspaceName: string}; type RoomNameReservedErrorParams = {reservedName: string}; @@ -403,4 +405,5 @@ export type { LogSizeParams, HeldRequestParams, PaySomeoneParams, + ImportedFromAccountingSoftwareParams, }; diff --git a/src/pages/workspace/categories/WorkspaceCategoriesPage.tsx b/src/pages/workspace/categories/WorkspaceCategoriesPage.tsx index ffc53a0c9c24..025f0c3b69a9 100644 --- a/src/pages/workspace/categories/WorkspaceCategoriesPage.tsx +++ b/src/pages/workspace/categories/WorkspaceCategoriesPage.tsx @@ -288,7 +288,7 @@ function WorkspaceCategoriesPage({policy, route}: WorkspaceCategoriesPageProps) style={[styles.textNormal, styles.link]} href={`${environmentURL}/${ROUTES.POLICY_ACCOUNTING.getRoute(policyId)}`} > - {`${translate('workspace.accounting.qbo')} settings`} + {`${translate('workspace.categories.importedFromAccountingSoftware', {accountingSoftwareName: 'QuickBooks Online'})}`} ) : ( From 22ad4e3cef0fd4efa0e76f0c995a6e64e67c1aee Mon Sep 17 00:00:00 2001 From: Hayata Suenaga Date: Mon, 22 Apr 2024 09:04:59 -0400 Subject: [PATCH 11/15] fix: translate "settings" --- src/languages/en.ts | 4 +--- src/languages/es.ts | 3 +-- src/languages/types.ts | 3 --- src/pages/workspace/categories/WorkspaceCategoriesPage.tsx | 2 +- 4 files changed, 3 insertions(+), 9 deletions(-) diff --git a/src/languages/en.ts b/src/languages/en.ts index b3030f283e62..5823bbec3554 100755 --- a/src/languages/en.ts +++ b/src/languages/en.ts @@ -28,7 +28,6 @@ import type { FormattedMaxLengthParams, GoBackMessageParams, GoToRoomParams, - ImportedFromAccountingSoftwareParams, InstantSummaryParams, LocalTimeParams, LoggedInAsParams, @@ -1898,8 +1897,7 @@ export default { categoryRequiredError: 'Category name is required.', existingCategoryError: 'A category with this name already exists.', invalidCategoryName: 'Invalid category name.', - importedFromAccountingSoftware: ({accountingSoftwareName}: ImportedFromAccountingSoftwareParams) => - `The categories below are imported from your ${accountingSoftwareName} settings`, + importedFromAccountingSoftware: `The categories below are imported from your`, }, moreFeatures: { spendSection: { diff --git a/src/languages/es.ts b/src/languages/es.ts index 6825d4d085dc..9b7230d4369a 100644 --- a/src/languages/es.ts +++ b/src/languages/es.ts @@ -27,7 +27,6 @@ import type { FormattedMaxLengthParams, GoBackMessageParams, GoToRoomParams, - ImportedFromAccountingSoftwareParams, InstantSummaryParams, LocalTimeParams, LoggedInAsParams, @@ -1922,7 +1921,7 @@ export default { categoryRequiredError: 'Lo nombre de la categoría es obligatorio.', existingCategoryError: 'Ya existe una categoría con este nombre.', invalidCategoryName: 'Lo nombre de la categoría es invalido.', - importedFromAccountingSoftware: ({accountingSoftwareName}: ImportedFromAccountingSoftwareParams) => `Categorías importadas desde ${accountingSoftwareName}`, + importedFromAccountingSoftware: `Categorías importadas desde`, }, moreFeatures: { spendSection: { diff --git a/src/languages/types.ts b/src/languages/types.ts index 1312fb704048..30b7f842db4c 100644 --- a/src/languages/types.ts +++ b/src/languages/types.ts @@ -185,8 +185,6 @@ type UserIsAlreadyMemberParams = {login: string; name: string}; type GoToRoomParams = {roomName: string}; -type ImportedFromAccountingSoftwareParams = {accountingSoftwareName: string}; - type WelcomeNoteParams = {workspaceName: string}; type RoomNameReservedErrorParams = {reservedName: string}; @@ -405,5 +403,4 @@ export type { LogSizeParams, HeldRequestParams, PaySomeoneParams, - ImportedFromAccountingSoftwareParams, }; diff --git a/src/pages/workspace/categories/WorkspaceCategoriesPage.tsx b/src/pages/workspace/categories/WorkspaceCategoriesPage.tsx index 025f0c3b69a9..026c90eeddc9 100644 --- a/src/pages/workspace/categories/WorkspaceCategoriesPage.tsx +++ b/src/pages/workspace/categories/WorkspaceCategoriesPage.tsx @@ -288,7 +288,7 @@ function WorkspaceCategoriesPage({policy, route}: WorkspaceCategoriesPageProps) style={[styles.textNormal, styles.link]} href={`${environmentURL}/${ROUTES.POLICY_ACCOUNTING.getRoute(policyId)}`} > - {`${translate('workspace.categories.importedFromAccountingSoftware', {accountingSoftwareName: 'QuickBooks Online'})}`} + {`${translate('workspace.accounting.qbo')}, ${translate('common.settings')}`} ) : ( From 22468f5551b5ccb53a47279910faeae97ad6401f Mon Sep 17 00:00:00 2001 From: Hayata Suenaga Date: Mon, 22 Apr 2024 14:10:37 -0400 Subject: [PATCH 12/15] chore: use loser cased "settings" --- src/languages/en.ts | 1 + src/languages/es.ts | 1 + src/pages/workspace/categories/WorkspaceCategoriesPage.tsx | 2 +- 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/languages/en.ts b/src/languages/en.ts index 5823bbec3554..b9297a87cc48 100755 --- a/src/languages/en.ts +++ b/src/languages/en.ts @@ -2070,6 +2070,7 @@ export default { lowRateError: 'Rate must be greater than 0', }, accounting: { + settings: 'settings', title: 'Connections', subtitle: 'Connect to your accounting system to code transactions with your chart of accounts, auto-match payments and keep your finances in sync.', qbo: 'Quickbooks Online', diff --git a/src/languages/es.ts b/src/languages/es.ts index 9b7230d4369a..729f9bbad77f 100644 --- a/src/languages/es.ts +++ b/src/languages/es.ts @@ -2062,6 +2062,7 @@ export default { membersListTitle: 'Directorio de todos los miembros del espacio de trabajo.', }, accounting: { + settings: 'configuración', title: 'Conexiones', subtitle: 'Conecta a tu sistema de contabilidad para codificar transacciones con tu plan de cuentas, auto-cotejar pagos y mantener tus finanzas sincronizadas.', qbo: 'Quickbooks Online', diff --git a/src/pages/workspace/categories/WorkspaceCategoriesPage.tsx b/src/pages/workspace/categories/WorkspaceCategoriesPage.tsx index 026c90eeddc9..e6f52f15ad16 100644 --- a/src/pages/workspace/categories/WorkspaceCategoriesPage.tsx +++ b/src/pages/workspace/categories/WorkspaceCategoriesPage.tsx @@ -288,7 +288,7 @@ function WorkspaceCategoriesPage({policy, route}: WorkspaceCategoriesPageProps) style={[styles.textNormal, styles.link]} href={`${environmentURL}/${ROUTES.POLICY_ACCOUNTING.getRoute(policyId)}`} > - {`${translate('workspace.accounting.qbo')}, ${translate('common.settings')}`} + {`${translate('workspace.accounting.qbo')}, ${translate('workspace.accounting.settings')}`} ) : ( From 5235160a2799870585985a2d5ad9a78a23fadba7 Mon Sep 17 00:00:00 2001 From: Hayata Suenaga Date: Mon, 22 Apr 2024 14:12:31 -0400 Subject: [PATCH 13/15] style: use single quotes --- src/languages/en.ts | 2 +- src/languages/es.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/languages/en.ts b/src/languages/en.ts index b9297a87cc48..49f1f943488f 100755 --- a/src/languages/en.ts +++ b/src/languages/en.ts @@ -1897,7 +1897,7 @@ export default { categoryRequiredError: 'Category name is required.', existingCategoryError: 'A category with this name already exists.', invalidCategoryName: 'Invalid category name.', - importedFromAccountingSoftware: `The categories below are imported from your`, + importedFromAccountingSoftware: 'The categories below are imported from your', }, moreFeatures: { spendSection: { diff --git a/src/languages/es.ts b/src/languages/es.ts index 729f9bbad77f..c17cd1d1d65c 100644 --- a/src/languages/es.ts +++ b/src/languages/es.ts @@ -1921,7 +1921,7 @@ export default { categoryRequiredError: 'Lo nombre de la categoría es obligatorio.', existingCategoryError: 'Ya existe una categoría con este nombre.', invalidCategoryName: 'Lo nombre de la categoría es invalido.', - importedFromAccountingSoftware: `Categorías importadas desde`, + importedFromAccountingSoftware: 'Categorías importadas desde', }, moreFeatures: { spendSection: { From 36eb958276d792b3aa425caa8932b321661344c8 Mon Sep 17 00:00:00 2001 From: Hayata Suenaga Date: Mon, 22 Apr 2024 19:54:17 -0700 Subject: [PATCH 14/15] fix: unnecessary "," Co-authored-by: Abdelhafidh Belalia <16493223+s77rt@users.noreply.github.com> --- src/pages/workspace/categories/WorkspaceCategoriesPage.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pages/workspace/categories/WorkspaceCategoriesPage.tsx b/src/pages/workspace/categories/WorkspaceCategoriesPage.tsx index e6f52f15ad16..6809c70f1f34 100644 --- a/src/pages/workspace/categories/WorkspaceCategoriesPage.tsx +++ b/src/pages/workspace/categories/WorkspaceCategoriesPage.tsx @@ -288,7 +288,7 @@ function WorkspaceCategoriesPage({policy, route}: WorkspaceCategoriesPageProps) style={[styles.textNormal, styles.link]} href={`${environmentURL}/${ROUTES.POLICY_ACCOUNTING.getRoute(policyId)}`} > - {`${translate('workspace.accounting.qbo')}, ${translate('workspace.accounting.settings')}`} + {`${translate('workspace.accounting.qbo')} ${translate('workspace.accounting.settings')}`} ) : ( From 28a57cf04d7da21df4d97aeb6b62810113c112cd Mon Sep 17 00:00:00 2001 From: Hayata Suenaga Date: Tue, 23 Apr 2024 10:32:20 -0700 Subject: [PATCH 15/15] fix: use boolean condition Co-authored-by: Abdelhafidh Belalia <16493223+s77rt@users.noreply.github.com> --- src/pages/workspace/categories/WorkspaceCategoriesPage.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pages/workspace/categories/WorkspaceCategoriesPage.tsx b/src/pages/workspace/categories/WorkspaceCategoriesPage.tsx index 6809c70f1f34..96f2415cae86 100644 --- a/src/pages/workspace/categories/WorkspaceCategoriesPage.tsx +++ b/src/pages/workspace/categories/WorkspaceCategoriesPage.tsx @@ -281,7 +281,7 @@ function WorkspaceCategoriesPage({policy, route}: WorkspaceCategoriesPageProps) /> {isSmallScreenWidth && {getHeaderButtons()}} - {Object.keys(policy?.connections ?? {}).length ? ( + {Object.keys(policy?.connections ?? {}).length > 0 ? ( {`${translate('workspace.categories.importedFromAccountingSoftware')} `}