Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add employee and accounting page to onboarding flow #49161

Merged
merged 61 commits into from
Oct 10, 2024
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
Show all changes
61 commits
Select commit Hold shift + click to select a range
accc8a1
feat: add employee and accounting page to onboarding flow
nkdengineer Sep 13, 2024
419f7cc
fix ts error
nkdengineer Sep 13, 2024
88dda39
Merge branch 'main' into fix/48745
nkdengineer Sep 16, 2024
6bdf7ed
add OnboadingListItem
nkdengineer Sep 16, 2024
e0bc748
fix test
nkdengineer Sep 16, 2024
de74800
add offline indicator and fix ts bug
nkdengineer Sep 16, 2024
5f75726
Merge branch 'main' into fix/48745
nkdengineer Sep 17, 2024
a37009d
fix the font-size issue
nkdengineer Sep 17, 2024
d72dec2
decrease spacing between title and description
nkdengineer Sep 17, 2024
2200305
Merge branch 'main' into fix/48745
nkdengineer Sep 18, 2024
646fc6d
Update src/pages/OnboardingEmployees/index.tsx
nkdengineer Sep 18, 2024
b7b016f
Update src/pages/OnboardingAccounting/index.tsx
nkdengineer Sep 18, 2024
6964f34
call completeOnboarding API
nkdengineer Sep 18, 2024
def4389
fix ts error
nkdengineer Sep 18, 2024
b923dab
Merge branch 'main' into fix/48745
nkdengineer Sep 18, 2024
b1e8c24
move the type to CONST
nkdengineer Sep 18, 2024
f8ff1f5
remove OnboardingListItem
nkdengineer Sep 18, 2024
a773766
remove onboardingIcon type
nkdengineer Sep 18, 2024
a50ce47
remove unused style
nkdengineer Sep 18, 2024
c9b6a0b
fix lint
nkdengineer Sep 18, 2024
0d6adac
merge main
nkdengineer Sep 19, 2024
13f4da9
add type and refactor style
nkdengineer Sep 19, 2024
944b3d3
Merge branch 'main' into fix/48745
nkdengineer Sep 20, 2024
1a67914
change firstname and lastname as optional
nkdengineer Sep 20, 2024
497a35e
migrate to useOnyx
nkdengineer Sep 20, 2024
ced0874
remove withOnyx
nkdengineer Sep 20, 2024
41de3e1
Merge branch 'main' into fix/48745
nkdengineer Sep 20, 2024
d417b6a
remove unnecessary code
nkdengineer Sep 20, 2024
c6c8cbc
Update src/SCREENS.ts
nkdengineer Sep 20, 2024
11f3a4a
Merge branch 'main' into fix/48745
nkdengineer Sep 23, 2024
465ffbc
Update src/CONST.ts
nkdengineer Sep 23, 2024
d3121d6
Update src/pages/OnboardingAccounting/BaseOnboardingAccounting.tsx
nkdengineer Sep 23, 2024
f72f134
refactor code
nkdengineer Sep 23, 2024
076d4af
Merge branch 'fix/48745' of https://github.com/nkdengineer/App into f…
nkdengineer Sep 23, 2024
ccfa4e1
fix type error
nkdengineer Sep 23, 2024
a1201d2
remove unnecessary prop
nkdengineer Sep 23, 2024
91bbbaf
Merge branch 'main' into fix/48745
nkdengineer Sep 24, 2024
63a5932
remove unused style
nkdengineer Sep 24, 2024
34f74ad
fix lint
nkdengineer Sep 24, 2024
fb70a3f
add style prop for list item
nkdengineer Sep 24, 2024
bdf3a08
Merge branch 'main' into fix/48745
nkdengineer Sep 25, 2024
d0be895
remove unnecessary prop
nkdengineer Sep 25, 2024
5e61daf
add pl8 and pr8 style
nkdengineer Sep 25, 2024
d8b71b0
Merge branch 'main' into fix/48745
nkdengineer Sep 27, 2024
0057cb1
resolve conflict
nkdengineer Oct 2, 2024
939c169
merge main
nkdengineer Oct 2, 2024
97e41e8
fix ts error
nkdengineer Oct 2, 2024
556b83f
merge main
nkdengineer Oct 8, 2024
fe9d9b5
remove description translation
nkdengineer Oct 8, 2024
9a1c414
Merge branch 'main' into fix/48745
nkdengineer Oct 8, 2024
8706f60
update translation
nkdengineer Oct 8, 2024
74631ed
Merge branch 'main' into fix/48745
nkdengineer Oct 8, 2024
4516b4d
update confirm button to continue button
nkdengineer Oct 8, 2024
aab3ad8
fix ts error
nkdengineer Oct 8, 2024
9985e88
remove unused variable
nkdengineer Oct 8, 2024
7bba26c
Merge branch 'main' into fix/48745
nkdengineer Oct 9, 2024
7fb12f0
remove onboaring work
nkdengineer Oct 9, 2024
433261c
merge main
nkdengineer Oct 9, 2024
f806fde
remove import type
nkdengineer Oct 9, 2024
3584504
merge main
nkdengineer Oct 10, 2024
bd6b524
merge main
nkdengineer Oct 10, 2024
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
2 changes: 1 addition & 1 deletion src/languages/en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1723,9 +1723,9 @@ const translations = {
getStarted: 'Get started',
whatsYourName: "What's your name?",
whereYouWork: 'Where do you work?',
errorSelection: 'Please make a selection to continue.',
purpose: {
title: 'What do you want to do today?',
errorSelection: 'Please make a selection to continue.',
errorContinue: 'Please press continue to get set up.',
errorBackButton: 'Please finish the setup questions to start using the app.',
[CONST.ONBOARDING_CHOICES.EMPLOYER]: 'Get paid back by my employer',
Expand Down
2 changes: 1 addition & 1 deletion src/languages/es.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1723,9 +1723,9 @@ const translations = {
getStarted: 'Comenzar',
whatsYourName: '¿Cómo te llamas?',
whereYouWork: '¿Dónde trabajas?',
errorSelection: 'Por favor selecciona una opción para continuar.',
purpose: {
title: '¿Qué quieres hacer hoy?',
errorSelection: 'Por favor selecciona una opción para continuar.',
errorContinue: 'Por favor, haz click en continuar para configurar tu cuenta.',
errorBackButton: 'Por favor, finaliza las preguntas de configuración para empezar a utilizar la aplicación.',
[CONST.ONBOARDING_CHOICES.EMPLOYER]: 'Cobrar de mi empresa',
Expand Down
4 changes: 2 additions & 2 deletions src/libs/actions/Report.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ import Parser from '@libs/Parser';
import * as PersonalDetailsUtils from '@libs/PersonalDetailsUtils';
import * as PhoneNumber from '@libs/PhoneNumber';
import getPolicyEmployeeAccountIDs from '@libs/PolicyEmployeeListUtils';
import {extractPolicyIDFromPath} from '@libs/PolicyUtils';
import {extractPolicyIDFromPath, getPolicy} from '@libs/PolicyUtils';
import processReportIDDeeplink from '@libs/processReportIDDeeplink';
import * as Pusher from '@libs/Pusher/pusher';
import * as ReportActionsUtils from '@libs/ReportActionsUtils';
Expand Down Expand Up @@ -3669,7 +3669,7 @@ function completeOnboarding(
onyxMethod: Onyx.METHOD.MERGE,
key: `${ONYXKEYS.COLLECTION.POLICY}${onboardingPolicyID}`,
value: {
areConnectionsEnabled: false,
areConnectionsEnabled: getPolicy(onboardingPolicyID)?.areConnectionsEnabled,
pendingFields: {
areConnectionsEnabled: null,
},
Expand Down
87 changes: 45 additions & 42 deletions src/pages/OnboardingAccounting/BaseOnboardingAccounting.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import FormHelpMessage from '@components/FormHelpMessage';
import HeaderWithBackButton from '@components/HeaderWithBackButton';
import Icon from '@components/Icon';
import * as Expensicons from '@components/Icon/Expensicons';
import OfflineIndicator from '@components/OfflineIndicator';
import ScreenWrapper from '@components/ScreenWrapper';
import SelectionList from '@components/SelectionList';
import RadioListItem from '@components/SelectionList/RadioListItem';
Expand Down Expand Up @@ -47,45 +46,50 @@ function BaseOnboardingAccounting({shouldUseNativeStyles, route}: BaseOnboarding
const [error, setError] = useState('');

const accountingOptions: OnboardingListItem[] = useMemo(() => {
const policyAccountingOptions = Object.values(CONST.POLICY.CONNECTIONS.NAME).map((connectionName): OnboardingListItem => {
let text;
let accountingIcon;
switch (connectionName) {
case CONST.POLICY.CONNECTIONS.NAME.QBO: {
text = translate('workspace.accounting.qbo');
accountingIcon = Expensicons.QBOCircle;
break;
}
case CONST.POLICY.CONNECTIONS.NAME.XERO: {
text = translate('workspace.accounting.xero');
accountingIcon = Expensicons.XeroCircle;
break;
}
case CONST.POLICY.CONNECTIONS.NAME.NETSUITE: {
text = translate('workspace.accounting.netsuite');
accountingIcon = Expensicons.NetSuiteSquare;
break;
}
default: {
text = translate('workspace.accounting.intacct');
accountingIcon = Expensicons.IntacctSquare;
break;
const policyAccountingOptions = Object.values(CONST.POLICY.CONNECTIONS.NAME)
.map((connectionName): OnboardingListItem | undefined => {
let text;
let accountingIcon;
switch (connectionName) {
case CONST.POLICY.CONNECTIONS.NAME.QBO: {
text = translate('workspace.accounting.qbo');
accountingIcon = Expensicons.QBOCircle;
break;
}
case CONST.POLICY.CONNECTIONS.NAME.XERO: {
text = translate('workspace.accounting.xero');
accountingIcon = Expensicons.XeroCircle;
break;
}
case CONST.POLICY.CONNECTIONS.NAME.NETSUITE: {
text = translate('workspace.accounting.netsuite');
accountingIcon = Expensicons.NetSuiteSquare;
break;
}
case CONST.POLICY.CONNECTIONS.NAME.SAGE_INTACCT: {
text = translate('workspace.accounting.intacct');
accountingIcon = Expensicons.IntacctSquare;
break;
}
default: {
return;
}
}
}
return {
keyForList: connectionName,
text,
leftElement: (
<Icon
src={accountingIcon}
width={variables.iconSizeExtraLarge}
height={variables.iconSizeExtraLarge}
additionalStyles={[StyleUtils.getAvatarBorderStyle(CONST.AVATAR_SIZE.DEFAULT, CONST.ICON_TYPE_AVATAR), styles.mr3]}
/>
),
isSelected: userReportedIntegration === connectionName,
};
});
return {
keyForList: connectionName,
text,
leftElement: (
<Icon
src={accountingIcon}
width={variables.iconSizeExtraLarge}
height={variables.iconSizeExtraLarge}
additionalStyles={[StyleUtils.getAvatarBorderStyle(CONST.AVATAR_SIZE.DEFAULT, CONST.ICON_TYPE_AVATAR), styles.mr3]}
/>
),
isSelected: userReportedIntegration === connectionName,
};
})
.filter((item): item is OnboardingListItem => !!item);
const noneAccountingOption: OnboardingListItem = {
keyForList: null,
text: translate('onboarding.accounting.noneOfAbove'),
Expand Down Expand Up @@ -115,10 +119,10 @@ function BaseOnboardingAccounting({shouldUseNativeStyles, route}: BaseOnboarding
<Button
success
large
text={translate('common.confirm')}
text={translate('common.continue')}
onPress={() => {
if (userReportedIntegration === undefined) {
setError(translate('onboarding.purpose.errorSelection'));
setError(translate('onboarding.errorSelection'));
return;
}

Expand Down Expand Up @@ -180,7 +184,6 @@ function BaseOnboardingAccounting({shouldUseNativeStyles, route}: BaseOnboarding
shouldShowTooltips={false}
listItemWrapperStyle={onboardingIsMediumOrLargerScreenWidth ? [styles.pl8, styles.pr8] : []}
/>
{shouldUseNarrowLayout && <OfflineIndicator />}
</ScreenWrapper>
);
}
Expand Down
12 changes: 4 additions & 8 deletions src/pages/OnboardingEmployees/BaseOnboardingEmployees.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import {useOnyx} from 'react-native-onyx';
import Button from '@components/Button';
import FormHelpMessage from '@components/FormHelpMessage';
import HeaderWithBackButton from '@components/HeaderWithBackButton';
import OfflineIndicator from '@components/OfflineIndicator';
import ScreenWrapper from '@components/ScreenWrapper';
import SelectionList from '@components/SelectionList';
import RadioListItem from '@components/SelectionList/RadioListItem';
Expand All @@ -30,7 +29,7 @@ function BaseOnboardingEmployees({shouldUseNativeStyles, route}: BaseOnboardingE
const {translate} = useLocalize();
const [onboardingCompanySize] = useOnyx(ONYXKEYS.ONBOARDING_COMPANY_SIZE);
const [onboardingPurposeSelected] = useOnyx(ONYXKEYS.ONBOARDING_PURPOSE_SELECTED);
const {onboardingIsMediumOrLargerScreenWidth, shouldUseNarrowLayout} = useResponsiveLayout();
const {onboardingIsMediumOrLargerScreenWidth} = useResponsiveLayout();
const [selectedCompanySize, setSelectedCompanySize] = useState<OnboardingCompanySizeType | null | undefined>(onboardingCompanySize);
const [error, setError] = useState('');

Expand All @@ -56,10 +55,10 @@ function BaseOnboardingEmployees({shouldUseNativeStyles, route}: BaseOnboardingE
<Button
success
large
text={translate('common.confirm')}
text={translate('common.continue')}
onPress={() => {
if (!selectedCompanySize) {
setError(translate('onboarding.purpose.errorSelection'));
setError(translate('onboarding.errorSelection'));
return;
}
Welcome.setOnboardingCompanySize(selectedCompanySize);
Expand All @@ -82,9 +81,7 @@ function BaseOnboardingEmployees({shouldUseNativeStyles, route}: BaseOnboardingE
onBackButtonPress={OnboardingFlow.goBack}
/>
<View style={[onboardingIsMediumOrLargerScreenWidth && styles.mt5, onboardingIsMediumOrLargerScreenWidth ? styles.mh8 : styles.mh5]}>
<View style={[onboardingIsMediumOrLargerScreenWidth ? styles.flexRow : styles.flexColumn, styles.mb5]}>
<Text style={[styles.textHeadlineH1]}>{translate('onboarding.employees.title')}</Text>
</View>
<Text style={[styles.textHeadlineH1, styles.mb5]}>{translate('onboarding.employees.title')}</Text>
</View>
nkdengineer marked this conversation as resolved.
Show resolved Hide resolved
<SelectionList
sections={[{data: companySizeOptions}]}
Expand All @@ -98,7 +95,6 @@ function BaseOnboardingEmployees({shouldUseNativeStyles, route}: BaseOnboardingE
footerContent={footerContent}
listItemWrapperStyle={onboardingIsMediumOrLargerScreenWidth ? [styles.pl8, styles.pr8] : []}
/>
{shouldUseNarrowLayout && <OfflineIndicator />}
</ScreenWrapper>
);
}
Expand Down
2 changes: 1 addition & 1 deletion src/pages/OnboardingPurpose/BaseOnboardingPurpose.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ function BaseOnboardingPurpose({shouldUseNativeStyles, shouldEnableMaxHeight, ro
const isFocused = useIsFocused();

const handleOuterClick = useCallback(() => {
Welcome.setOnboardingErrorMessage(translate('onboarding.purpose.errorSelection'));
Welcome.setOnboardingErrorMessage(translate('onboarding.errorSelection'));
}, [translate]);

const onboardingLocalRef = useRef<TOnboardingRef>(null);
Expand Down
Loading