Skip to content

Commit d059b6e

Browse files
committed
Fix Gusto sync results review issues
1 parent 51bcb75 commit d059b6e

4 files changed

Lines changed: 22 additions & 20 deletions

File tree

src/components/GustoSyncResultsModal.tsx

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,20 @@
11
import React, {useState} from 'react';
22
import {View} from 'react-native';
3-
import Button from '@components/Button';
4-
import FixedFooter from '@components/FixedFooter';
5-
import HeaderWithBackButton from '@components/HeaderWithBackButton';
6-
import Icon from '@components/Icon';
7-
import Modal from '@components/Modal';
8-
import type {ModalProps} from '@components/Modal/Global/ModalContext';
9-
import PressableWithoutFeedback from '@components/Pressable/PressableWithoutFeedback';
10-
import ScrollView from '@components/ScrollView';
11-
import Text from '@components/Text';
123
import {useMemoizedLazyExpensifyIcons, useMemoizedLazyIllustrations} from '@hooks/useLazyAsset';
134
import useLocalize from '@hooks/useLocalize';
145
import useTheme from '@hooks/useTheme';
156
import useThemeStyles from '@hooks/useThemeStyles';
167
import type {GustoSyncResult} from '@libs/API/GustoSyncResult';
178
import CONST from '@src/CONST';
9+
import Button from './Button';
10+
import FixedFooter from './FixedFooter';
11+
import HeaderWithBackButton from './HeaderWithBackButton';
12+
import Icon from './Icon';
13+
import Modal from './Modal';
14+
import type {ModalProps} from './Modal/Global/ModalContext';
15+
import PressableWithoutFeedback from './Pressable/PressableWithoutFeedback';
16+
import ScrollView from './ScrollView';
17+
import Text from './Text';
1818

1919
type GustoSyncResultsModalProps = ModalProps & {
2020
/** Sync result returned by the completed Gusto sync job */
@@ -57,19 +57,20 @@ function GustoSyncResultsModal({result, closeModal}: GustoSyncResultsModalProps)
5757
title={translate('workspace.hr.gusto.syncResults.title')}
5858
onBackButtonPress={closeResultsModal}
5959
/>
60-
<ScrollView contentContainerStyle={[styles.flexGrow1, styles.ph5]}>
61-
<View style={[styles.alignItemsCenter, styles.mt8, styles.mb8, styles.pRelative]}>
60+
<ScrollView contentContainerStyle={[styles.flexGrow1, styles.ph5, styles.pb8]}>
61+
<View style={[styles.alignItemsCenter, styles.mt4, styles.mb4, styles.pRelative]}>
6262
<Icon
6363
src={illustrations.SyncUsers}
64-
width={88}
65-
height={88}
64+
width={68}
65+
height={68}
6666
/>
6767
</View>
6868
<Text style={[styles.textHeadlineH1, styles.mb8]}>{translate('workspace.hr.gusto.syncResults.successTitle')}</Text>
6969
{renderResultSummary(translate('workspace.hr.gusto.syncResults.added'), addedCount)}
7070
{renderResultSummary(translate('workspace.hr.gusto.syncResults.removed'), removedCount)}
7171
<PressableWithoutFeedback
7272
accessibilityLabel={translate('workspace.hr.gusto.syncResults.skipped')}
73+
sentryLabel="GustoSyncResultsModal-SkippedEmployees"
7374
role={CONST.ROLE.BUTTON}
7475
onPress={() => setIsSkippedSectionExpanded((isExpanded) => !isExpanded)}
7576
style={[styles.flexRow, styles.justifyContentBetween, styles.alignItemsCenter]}

src/hooks/useGustoSyncResultsModal.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,11 @@ function useGustoSyncResultsModal(policyID: string, connectionSyncProgress: Onyx
1111
const previousSyncProgress = usePrevious(connectionSyncProgress);
1212

1313
useEffect(() => {
14+
const syncResult = connectionSyncProgress?.result;
1415
const isGustoSyncDoneWithResult =
1516
connectionSyncProgress?.connectionName === CONST.POLICY.CONNECTIONS.NAME.GUSTO &&
1617
connectionSyncProgress?.stageInProgress === CONST.POLICY.CONNECTIONS.SYNC_STAGE_NAME.JOB_DONE &&
17-
!!connectionSyncProgress?.result;
18+
!!syncResult;
1819
const wasSameGustoResultAlreadyHandled =
1920
previousSyncProgress?.connectionName === CONST.POLICY.CONNECTIONS.NAME.GUSTO &&
2021
previousSyncProgress?.stageInProgress === CONST.POLICY.CONNECTIONS.SYNC_STAGE_NAME.JOB_DONE &&
@@ -23,13 +24,13 @@ function useGustoSyncResultsModal(policyID: string, connectionSyncProgress: Onyx
2324
const didGustoSyncComplete =
2425
isFocused && isGustoSyncDoneWithResult && !wasSameGustoResultAlreadyHandled;
2526

26-
if (!didGustoSyncComplete) {
27+
if (!didGustoSyncComplete || !syncResult) {
2728
return;
2829
}
2930

3031
showModal({
3132
component: GustoSyncResultsModal,
32-
props: {result: connectionSyncProgress.result},
33+
props: {result: syncResult},
3334
id: `gusto-sync-results-${policyID}`,
3435
});
3536
}, [

src/languages/en.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6434,8 +6434,8 @@ const translations = {
64346434
syncResults: {
64356435
title: 'Gusto sync results',
64366436
successTitle: 'Successfully synced your Gusto connection!',
6437-
added: 'Added to Expensify',
6438-
removed: 'Removed from Expensify',
6437+
added: 'Added',
6438+
removed: 'Removed',
64396439
skipped: 'Skipped',
64406440
employeeCount: ({count}: {count: number}) => `${count} ${count === 1 ? 'employee' : 'employees'}`,
64416441
},

src/languages/es.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6271,8 +6271,8 @@ ${amount} para ${merchant} - ${date}`,
62716271
syncResults: {
62726272
title: 'Resultados de sincronización de Gusto',
62736273
successTitle: '¡Tu conexión de Gusto se sincronizó correctamente!',
6274-
added: 'Añadidos a Expensify',
6275-
removed: 'Eliminados de Expensify',
6274+
added: 'Añadidos',
6275+
removed: 'Eliminados',
62766276
skipped: 'Omitidos',
62776277
employeeCount: ({count}) => `${count} ${count === 1 ? 'empleado' : 'empleados'}`,
62786278
},

0 commit comments

Comments
 (0)