Skip to content
Open
Show file tree
Hide file tree
Changes from 10 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
1 change: 1 addition & 0 deletions src/ROUTES.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3168,6 +3168,7 @@ const ROUTES = {
getRoute: (backTo?: string) => getUrlWithBackToParam(`workspace/confirmation`, backTo),
},
WORKSPACE_CONFIRMATION_OWNER_SELECTOR: 'workspace/confirmation/owner-selector',
WORKSPACE_CONFIRMATION_SUCCESS: 'workspace/confirmation/success',
MIGRATED_USER_WELCOME_MODAL: {
route: 'onboarding/migrated-user-welcome',

Expand Down
2 changes: 1 addition & 1 deletion src/SCREENS.ts
Original file line number Diff line number Diff line change
Expand Up @@ -495,7 +495,7 @@ const SCREENS = {
ROOT: 'ReportChangeWorkspace_Root',
},

WORKSPACE_CONFIRMATION: {ROOT: 'Workspace_Confirmation_Root', OWNER_SELECTOR: 'Workspace_Confirmation_Owner_Selector'},
WORKSPACE_CONFIRMATION: {ROOT: 'Workspace_Confirmation_Root', OWNER_SELECTOR: 'Workspace_Confirmation_Owner_Selector', SUCCESS: 'Workspace_Confirmation_Success'},
WORKSPACE_DUPLICATE: {ROOT: 'Workspace_Duplicate_Root', SELECT_FEATURES: 'Workspace_Duplicate_Select_Features'},

WORKSPACES_LIST: 'Workspaces_List',
Expand Down
4 changes: 4 additions & 0 deletions src/languages/de.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4138,6 +4138,10 @@ ${
budgetTypeForNotificationMessage: {tag: 'Tag', category: 'Kategorie'},
deepDiveExpensifyCard: `<muted-text-label>Transaktionen der Expensify Karte werden automatisch in ein „Expensify Karte Verbindlichkeitskonto“ exportiert, das mit <a href="${CONST.DEEP_DIVE_EXPENSIFY_CARD}">unserer Integration</a> erstellt wird.</muted-text-label>`,
},
createdForClient: {
title: 'Du hast einen Workspace für deinen Kunden erstellt!',
description: 'Großartige Neuigkeiten 🎉. Kontaktiere uns, wenn sie Hilfe bei der Einrichtung benötigen.',
},
receiptPartners: {
uber: {
subtitle: (organizationName: string) =>
Expand Down
4 changes: 4 additions & 0 deletions src/languages/en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4204,6 +4204,10 @@ const translations = {
policyExpenseChatName: (displayName: string) => `${displayName}'s expenses`,
deepDiveExpensifyCard: `<muted-text-label>Expensify Card transactions will automatically export to an "Expensify Card Liability Account" created with <a href="${CONST.DEEP_DIVE_EXPENSIFY_CARD}">our integration</a>.</muted-text-label>`,
},
createdForClient: {
title: "You've created a workspace for your client!",
description: 'Great news 🎉. Reach out to us if they need any help with the setup.',
},
receiptPartners: {
uber: {
subtitle: (organizationName: string) => (organizationName ? `Connected to ${organizationName}` : 'Automate travel and meal delivery expenses across your organization.'),
Expand Down
4 changes: 4 additions & 0 deletions src/languages/es.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4068,6 +4068,10 @@ ${amount} para ${merchant} - ${date}`,
policyExpenseChatName: (displayName) => `${displayName}'s gastos`,
deepDiveExpensifyCard: `<muted-text-label>Las transacciones de la Tarjeta Expensify se exportan automáticamente a una "Cuenta de Responsabilidad de la Tarjeta Expensify" creada con <a href="${CONST.DEEP_DIVE_EXPENSIFY_CARD}">nuestra integración</a>.</muted-text-label>`,
},
createdForClient: {
title: '¡Has creado un espacio de trabajo para tu cliente!',
description: 'Excelentes noticias 🎉. Contáctanos si necesitan ayuda con la configuración.',
Comment on lines +4137 to +4139
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

},
receiptPartners: {
uber: {
subtitle: (organizationName) => (organizationName ? `Conectado a ${organizationName}` : 'Automatice los gastos de viajes y entrega de comidas en toda su organización.'),
Expand Down
4 changes: 4 additions & 0 deletions src/languages/fr.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4148,6 +4148,10 @@ ${
policyExpenseChatName: (displayName: string) => `Dépenses de ${displayName}`,
deepDiveExpensifyCard: `<muted-text-label>Les transactions de la Carte Expensify seront automatiquement exportées vers un « compte de passif Carte Expensify » créé avec <a href="${CONST.DEEP_DIVE_EXPENSIFY_CARD}">notre intégration</a>.</muted-text-label>`,
},
createdForClient: {
title: 'Vous avez créé un espace de travail pour votre client !',
description: "Excellente nouvelle 🎉. Contactez-nous si votre client a besoin d'aide pour la configuration.",
},
receiptPartners: {
uber: {
subtitle: (organizationName: string) =>
Expand Down
4 changes: 4 additions & 0 deletions src/languages/it.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4124,6 +4124,10 @@ ${
budgetTypeForNotificationMessage: {tag: 'etichetta', category: 'categoria'},
deepDiveExpensifyCard: `<muted-text-label>Le transazioni della Carta Expensify verranno esportate automaticamente in un "Conto Passivo Carta Expensify" creato con <a href="${CONST.DEEP_DIVE_EXPENSIFY_CARD}">la nostra integrazione</a>.</muted-text-label>`,
},
createdForClient: {
title: 'Hai creato uno spazio di lavoro per il tuo cliente!',
description: 'Ottime notizie 🎉. Contattaci se hanno bisogno di aiuto con la configurazione.',
},
receiptPartners: {
uber: {
subtitle: (organizationName: string) =>
Expand Down
4 changes: 4 additions & 0 deletions src/languages/ja.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4094,6 +4094,10 @@ ${
budgetFrequencyUnit: {monthly: '月', yearly: '年'},
budgetTypeForNotificationMessage: {tag: 'タグ', category: 'カテゴリ'},
},
createdForClient: {
title: 'クライアントのワークスペースを作成しました!',
description: '素晴らしいニュースです 🎉。セットアップにサポートが必要な場合はお問い合わせください。',
},
receiptPartners: {
uber: {
subtitle: (organizationName: string) => (organizationName ? `${organizationName} に接続しました` : '組織全体の出張費や飲食デリバリー経費を自動化しましょう。'),
Expand Down
4 changes: 4 additions & 0 deletions src/languages/nl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4121,6 +4121,10 @@ ${
budgetTypeForNotificationMessage: {tag: 'tag', category: 'categorie'},
deepDiveExpensifyCard: `<muted-text-label>Transacties met de Expensify Kaart worden automatisch geëxporteerd naar een "Expensify Kaart Passivarekening" dat wordt aangemaakt via <a href="${CONST.DEEP_DIVE_EXPENSIFY_CARD}">onze integratie</a>.</muted-text-label>`,
},
createdForClient: {
title: 'Je hebt een werkruimte voor je klant aangemaakt!',
description: 'Geweldig nieuws 🎉. Neem contact met ons op als ze hulp nodig hebben bij de configuratie.',
},
receiptPartners: {
uber: {
subtitle: (organizationName: string) => (organizationName ? `Verbonden met ${organizationName}` : 'Automatiseer reis- en maaltijdbezorgingskosten in uw hele organisatie.'),
Expand Down
4 changes: 4 additions & 0 deletions src/languages/pl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4115,6 +4115,10 @@ ${
policyExpenseChatName: (displayName: string) => `Wydatki ${displayName}`,
deepDiveExpensifyCard: `<muted-text-label>Transakcje z Karty Expensify będą automatycznie eksportowane do „Konta zobowiązań Karty Expensify” utworzonego dzięki <a href="${CONST.DEEP_DIVE_EXPENSIFY_CARD}">naszej integracji</a>.</muted-text-label>`,
},
createdForClient: {
title: 'Utworzyłeś przestrzeń roboczą dla swojego klienta!',
description: 'Świetna wiadomość 🎉. Skontaktuj się z nami, jeśli potrzebują pomocy przy konfiguracji.',
},
receiptPartners: {
uber: {
subtitle: (organizationName: string) =>
Expand Down
4 changes: 4 additions & 0 deletions src/languages/pt-BR.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4114,6 +4114,10 @@ ${
budgetTypeForNotificationMessage: {tag: 'etiqueta', category: 'categoria'},
deepDiveExpensifyCard: `<muted-text-label>As transações do Cartão Expensify serão exportadas automaticamente para uma “Conta de Responsabilidade do Cartão Expensify” criada com <a href="${CONST.DEEP_DIVE_EXPENSIFY_CARD}">nossa integração</a>.</muted-text-label>`,
},
createdForClient: {
title: 'Você criou um espaço de trabalho para seu cliente!',
description: 'Ótimas notícias 🎉. Entre em contato conosco se precisarem de ajuda com a configuração.',
},
receiptPartners: {
uber: {
subtitle: (organizationName: string) =>
Expand Down
4 changes: 4 additions & 0 deletions src/languages/zh-hans.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4030,6 +4030,10 @@ ${
policyExpenseChatName: (displayName: string) => `${displayName} 的报销费用`,
deepDiveExpensifyCard: `<muted-text-label>Expensify 卡交易将自动导出到使用<a href="${CONST.DEEP_DIVE_EXPENSIFY_CARD}">我们的集成</a>创建的“Expensify 卡负债账户”。</muted-text-label>`,
},
createdForClient: {
title: '您已为客户创建了工作区!',
description: '好消息 🎉。如果他们在设置方面需要帮助,请联系我们。',
},
receiptPartners: {
uber: {
subtitle: (organizationName: string) => (organizationName ? `已连接到 ${organizationName}` : '在整个组织内自动化管理差旅和外卖餐饮报销。'),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -279,6 +279,7 @@ const ReportSettingsModalStackNavigator = createModalStackNavigator<ReportSettin
const WorkspaceConfirmationModalStackNavigator = createModalStackNavigator<WorkspaceConfirmationNavigatorParamList>({
[SCREENS.WORKSPACE_CONFIRMATION.ROOT]: () => require<ReactComponentModule>('../../../../pages/workspace/WorkspaceConfirmationPage').default,
[SCREENS.WORKSPACE_CONFIRMATION.OWNER_SELECTOR]: () => require<ReactComponentModule>('../../../../pages/workspace/WorkspaceConfirmationOwnerSelectorPage').default,
[SCREENS.WORKSPACE_CONFIRMATION.SUCCESS]: () => require<ReactComponentModule>('../../../../pages/workspace/WorkspaceConfirmationSuccessPage').default,
[SCREENS.CURRENCY.SELECTION]: () => require<ReactComponentModule>('../../../../pages/CurrencySelectionPage').default,
});

Expand Down
1 change: 1 addition & 0 deletions src/libs/Navigation/linkingConfig/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1589,6 +1589,7 @@ const config: LinkingOptions<RootNavigatorParamList>['config'] = {
screens: {
[SCREENS.WORKSPACE_CONFIRMATION.ROOT]: ROUTES.WORKSPACE_CONFIRMATION.route,
[SCREENS.WORKSPACE_CONFIRMATION.OWNER_SELECTOR]: ROUTES.WORKSPACE_CONFIRMATION_OWNER_SELECTOR,
[SCREENS.WORKSPACE_CONFIRMATION.SUCCESS]: ROUTES.WORKSPACE_CONFIRMATION_SUCCESS,
[SCREENS.CURRENCY.SELECTION]: ROUTES.CURRENCY_SELECTION.route,
},
},
Expand Down
1 change: 1 addition & 0 deletions src/libs/Navigation/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2169,6 +2169,7 @@ type WorkspaceConfirmationNavigatorParamList = {
backTo?: Routes;
};
[SCREENS.WORKSPACE_CONFIRMATION.OWNER_SELECTOR]: undefined;
[SCREENS.WORKSPACE_CONFIRMATION.SUCCESS]: undefined;
[SCREENS.CURRENCY.SELECTION]: {
// eslint-disable-next-line no-restricted-syntax -- `backTo` usages in this file are legacy. Do not add new `backTo` params to screens. See contributingGuides/NAVIGATION.md
backTo?: Routes;
Expand Down
8 changes: 4 additions & 4 deletions src/libs/actions/Policy/Policy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@
};

const deprecatedAllPolicies: OnyxCollection<Policy> = {};
Onyx.connect({

Check warning on line 255 in src/libs/actions/Policy/Policy.ts

View workflow job for this annotation

GitHub Actions / Changed files ESLint check

Onyx.connect() is deprecated. Use useOnyx() hook instead and pass the data as parameters to a pure function
key: ONYXKEYS.COLLECTION.POLICY,
callback: (val, key) => {
if (!key) {
Expand All @@ -268,7 +268,7 @@
});

let deprecatedAllReportActions: OnyxCollection<ReportActions>;
Onyx.connect({

Check warning on line 271 in src/libs/actions/Policy/Policy.ts

View workflow job for this annotation

GitHub Actions / Changed files ESLint check

Onyx.connect() is deprecated. Use useOnyx() hook instead and pass the data as parameters to a pure function
key: ONYXKEYS.COLLECTION.REPORT_ACTIONS,
waitForCollectionCallback: true,
callback: (actions) => {
Expand All @@ -278,7 +278,7 @@

let deprecatedSessionEmail = '';
let deprecatedSessionAccountID = 0;
Onyx.connect({

Check warning on line 281 in src/libs/actions/Policy/Policy.ts

View workflow job for this annotation

GitHub Actions / Changed files ESLint check

Onyx.connect() is deprecated. Use useOnyx() hook instead and pass the data as parameters to a pure function
key: ONYXKEYS.SESSION,
callback: (val) => {
deprecatedSessionEmail = val?.email ?? '';
Expand All @@ -287,7 +287,7 @@
});

let deprecatedAllPersonalDetails: OnyxEntry<PersonalDetailsList>;
Onyx.connect({

Check warning on line 290 in src/libs/actions/Policy/Policy.ts

View workflow job for this annotation

GitHub Actions / Changed files ESLint check

Onyx.connect() is deprecated. Use useOnyx() hook instead and pass the data as parameters to a pure function
key: ONYXKEYS.PERSONAL_DETAILS_LIST,
callback: (val) => (deprecatedAllPersonalDetails = val),
});
Expand Down Expand Up @@ -2288,7 +2288,7 @@
id: policyID,
type: type || CONST.POLICY.TYPE.TEAM,
name: workspaceName,
role: CONST.POLICY.ROLE.ADMIN,
role: makeMeAdmin || !policyOwnerEmail || policyOwnerEmail === deprecatedSessionEmail ? CONST.POLICY.ROLE.ADMIN : undefined,
owner: deprecatedSessionEmail,
ownerAccountID: deprecatedSessionAccountID,
isPolicyExpenseChatEnabled: true,
Expand Down Expand Up @@ -2450,7 +2450,7 @@
id: policyID,
type: workspaceType,
name: workspaceName,
role: CONST.POLICY.ROLE.ADMIN,
role: makeMeAdmin || !policyOwnerEmail || policyOwnerEmail === currentUserEmailParam ? CONST.POLICY.ROLE.ADMIN : undefined,
owner: policyOwnerEmail || currentUserEmailParam,
ownerAccountID: policyOwnerEmail ? (PersonalDetailsUtils.getPersonalDetailByEmail(policyOwnerEmail)?.accountID ?? currentUserAccountIDParam) : currentUserAccountIDParam,
isPolicyExpenseChatEnabled: true,
Expand Down Expand Up @@ -2499,12 +2499,12 @@
},
}
: {}),
...(policyOwnerEmail && policyOwnerEmail !== currentUserEmailParam
...(policyOwnerEmail && policyOwnerEmail !== currentUserEmailParam && makeMeAdmin
? {
[currentUserEmailParam]: {
submitsTo: policyOwnerEmail,
email: currentUserEmailParam,
role: makeMeAdmin ? CONST.POLICY.ROLE.ADMIN : CONST.POLICY.ROLE.USER,
role: CONST.POLICY.ROLE.ADMIN,
errors: {},
},
}
Expand Down
5 changes: 4 additions & 1 deletion src/pages/workspace/WorkspaceConfirmationPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,10 @@ function WorkspaceConfirmationPage() {

const onSubmit = (params: WorkspaceConfirmationSubmitFunctionParams) => {
const policyID = params.policyID || generatePolicyID();
const routeToNavigate = isSmallScreenWidth ? ROUTES.WORKSPACE_INITIAL.getRoute(policyID) : ROUTES.WORKSPACE_OVERVIEW.getRoute(policyID);
const isDifferentOwner = !!params.owner && params.owner !== (currentUserPersonalDetails.email ?? '');
const shouldShowSuccessPage = isDifferentOwner && !params.makeMeAdmin;
const workspaceRoute = isSmallScreenWidth ? ROUTES.WORKSPACE_INITIAL.getRoute(policyID) : ROUTES.WORKSPACE_OVERVIEW.getRoute(policyID);
const routeToNavigate = shouldShowSuccessPage ? ROUTES.WORKSPACE_CONFIRMATION_SUCCESS : workspaceRoute;
createWorkspaceWithPolicyDraftAndNavigateToIt({
introSelected,
policyOwnerEmail: params.owner,
Expand Down
39 changes: 39 additions & 0 deletions src/pages/workspace/WorkspaceConfirmationSuccessPage.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
import React, {useCallback} from 'react';
import ConfirmationPage from '@components/ConfirmationPage';
import HeaderWithBackButton from '@components/HeaderWithBackButton';
import ScreenWrapper from '@components/ScreenWrapper';
import useLocalize from '@hooks/useLocalize';
import useThemeStyles from '@hooks/useThemeStyles';
import Navigation from '@libs/Navigation/Navigation';

function WorkspaceConfirmationSuccessPage() {
const styles = useThemeStyles();
const {translate} = useLocalize();
const closePage = useCallback(() => {
Navigation.closeRHPFlow();
}, []);

return (
<ScreenWrapper
shouldEnableMaxHeight
testID={WorkspaceConfirmationSuccessPage.displayName}
>
<HeaderWithBackButton
title={translate('workspace.new.confirmWorkspace')}
onBackButtonPress={closePage}
/>
<ConfirmationPage
heading={translate('workspace.createdForClient.title')}
description={translate('workspace.createdForClient.description')}
descriptionStyle={[styles.ph5, styles.textSupporting]}
shouldShowButton
buttonText={translate('common.buttonConfirm')}
onButtonPress={closePage}
/>
</ScreenWrapper>
);
}

WorkspaceConfirmationSuccessPage.displayName = 'WorkspaceConfirmationSuccessPage';

export default WorkspaceConfirmationSuccessPage;
Loading