Skip to content
Open
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
6 changes: 5 additions & 1 deletion src/components/WorkspaceConfirmationForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import useCurrentUserPersonalDetails from '@hooks/useCurrentUserPersonalDetails'
import {useMemoizedLazyExpensifyIcons} from '@hooks/useLazyAsset';
import useLocalize from '@hooks/useLocalize';
import useOnyx from '@hooks/useOnyx';
import usePreferredPolicy from '@hooks/usePreferredPolicy';
import useThemeStyles from '@hooks/useThemeStyles';
import useWorkspaceConfirmationAvatar from '@hooks/useWorkspaceConfirmationAvatar';
import {clearDraftValues} from '@libs/actions/FormActions';
Expand Down Expand Up @@ -61,6 +62,7 @@ function WorkspaceConfirmationForm({onSubmit, policyOwnerEmail = '', onBackButto
const styles = useThemeStyles();
const {translate} = useLocalize();
const {inputCallbackRef} = useAutoFocusInput();
const {isRestrictedPolicyCreation} = usePreferredPolicy();

const validate = useCallback(
(values: FormOnyxValues<typeof ONYXKEYS.FORMS.WORKSPACE_CONFIRMATION_FORM>) => {
Expand Down Expand Up @@ -128,7 +130,9 @@ function WorkspaceConfirmationForm({onSubmit, policyOwnerEmail = '', onBackButto
keyboardShouldPersistTaps="always"
>
<View style={[styles.ph5, styles.pv3]}>
<Text style={[styles.mb3, styles.webViewStyles.baseFontStyle, styles.textSupporting]}>{translate('workspace.emptyWorkspace.subtitle')}</Text>
<Text style={[styles.mb3, styles.webViewStyles.baseFontStyle, styles.textSupporting]}>
{isRestrictedPolicyCreation ? translate('workspace.emptyWorkspace.restrictedPolicySubtitle') : translate('workspace.emptyWorkspace.subtitle')}
</Text>
</View>
<AvatarWithImagePicker
isUsingDefaultAvatar={!stashedLocalAvatarImage}
Expand Down
2 changes: 1 addition & 1 deletion src/components/WorkspacesEmptyStateComponent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ function WorkspacesEmptyStateComponent() {
headerMediaType={CONST.EMPTY_STATE_MEDIA.ANIMATION}
headerMedia={LottieAnimations.WorkspacePlanet}
title={translate('workspace.emptyWorkspace.title')}
subtitle={translate('workspace.emptyWorkspace.subtitle')}
subtitle={isRestrictedPolicyCreation ? translate('workspace.emptyWorkspace.restrictedPolicySubtitle') : translate('workspace.emptyWorkspace.subtitle')}
titleStyles={styles.pt2}
headerStyles={[styles.overflowHidden, StyleUtils.getBackgroundColorStyle(colors.pink800), StyleUtils.getHeight(variables.sectionIllustrationHeight)]}
lottieWebViewStyles={styles.emptyWorkspaceListIllustrationStyle}
Expand Down
6 changes: 6 additions & 0 deletions src/languages/de.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2715,6 +2715,10 @@ ${
title: 'Mitglieder einladen',
subtitle: 'Verwalten und teilen Sie Ihre Ausgaben mit einem Buchhalter oder gründen Sie eine Reisegruppe mit Freunden.',
},
domainWorkspaceRestriction: {
subtitle: 'Die Erstellung von Workspaces ist auf Admins beschränkt. Tritt einem der unten aufgeführten Workspaces bei oder wende dich für weitere Informationen an deinen Admin.',
skipForNow: 'Vorerst überspringen',
},
},
featureTraining: {
doNotShowAgain: 'Nicht mehr anzeigen',
Expand Down Expand Up @@ -5171,6 +5175,8 @@ ${
emptyWorkspace: {
title: 'Sie haben keine Arbeitsbereiche',
subtitle: 'Verfolgen Sie Belege, erstatten Sie Ausgaben, verwalten Sie Reisen, senden Sie Rechnungen und mehr.',
restrictedPolicySubtitle:
'Ihr Unternehmen beschränkt die Erstellung von Arbeitsbereichen durch Nicht-Administratoren. Sie können Zugriff auf einen bestehenden Arbeitsbereich anfordern oder sich an einen internen Administrator wenden, um weitere Informationen zu erhalten.',
createAWorkspaceCTA: 'Loslegen',
features: {
trackAndCollect: 'Belege verfolgen und sammeln',
Expand Down
6 changes: 6 additions & 0 deletions src/languages/en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2808,6 +2808,10 @@ const translations = {
title: 'Invite members',
subtitle: 'Add your team or invite your accountant. The more, the merrier!',
},
domainWorkspaceRestriction: {
subtitle: 'Workspace creation is restricted to admins. Join one of the workspaces below or contact your admin for more information.',
skipForNow: 'Skip for now',
},
},
featureTraining: {
doNotShowAgain: "Don't show me this again",
Expand Down Expand Up @@ -5238,6 +5242,8 @@ const translations = {
emptyWorkspace: {
title: 'You have no workspaces',
subtitle: 'Track receipts, reimburse expenses, manage travel, send invoices, and more.',
restrictedPolicySubtitle:
'Your company restricts workspace creation by non-admin users. You can request access to an existing workspace or reach out to an internal admin for more information.',
createAWorkspaceCTA: 'Get Started',
features: {
trackAndCollect: 'Track and collect receipts',
Expand Down
7 changes: 7 additions & 0 deletions src/languages/es.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2448,6 +2448,11 @@ ${amount} para ${merchant} - ${date}`,
title: 'Invita a miembros',
subtitle: 'Añade a tu equipo o invita a tu contador. ¡Cuantos más, mejor!',
},
domainWorkspaceRestriction: {
subtitle:
'La creación de espacios de trabajo está restringida a los administradores. Únete a uno de los espacios a continuación o contacta a tu administrador para más información.',
skipForNow: 'Omitir por ahora',
},
},
featureTraining: {
doNotShowAgain: 'No muestres esto otra vez',
Expand Down Expand Up @@ -4901,6 +4906,8 @@ ${amount} para ${merchant} - ${date}`,
emptyWorkspace: {
title: 'No tienes espacios de trabajo',
subtitle: 'Organiza recibos, reembolsa gastos, gestiona viajes, envía facturas y mucho más.',
restrictedPolicySubtitle:
'Su empresa restringe la creación de espacios de trabajo por usuarios que no son administradores. Puede solicitar acceso a un espacio de trabajo existente o contactar a un administrador interno para más información.',
createAWorkspaceCTA: 'Comenzar',
features: {
trackAndCollect: 'Organiza recibos',
Expand Down
7 changes: 7 additions & 0 deletions src/languages/fr.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2715,6 +2715,11 @@ ${
title: 'Inviter des membres',
subtitle: 'Gérez et partagez vos dépenses avec un comptable ou créez un groupe de voyage avec des amis.',
},
domainWorkspaceRestriction: {
subtitle:
'La création d’espaces de travail est réservée aux administrateurs. Rejoignez l’un des espaces de travail ci-dessous ou contactez votre administrateur pour plus d’informations.',
skipForNow: "Ignorer pour l'instant",
},
},
featureTraining: {
doNotShowAgain: 'Ne plus me montrer ceci',
Expand Down Expand Up @@ -5183,6 +5188,8 @@ ${
emptyWorkspace: {
title: "Vous n'avez aucun espace de travail",
subtitle: 'Suivez les reçus, remboursez les dépenses, gérez les déplacements, envoyez des factures, et plus encore.',
restrictedPolicySubtitle:
'Votre entreprise limite la création d’espaces de travail par des utilisateurs non administrateurs. Vous pouvez demander l’accès à un espace de travail existant ou contacter un administrateur interne pour plus d’informations.',
createAWorkspaceCTA: 'Commencer',
features: {
trackAndCollect: 'Suivre et collecter les reçus',
Expand Down
7 changes: 7 additions & 0 deletions src/languages/it.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2700,6 +2700,11 @@ ${
title: 'Invita membri',
subtitle: 'Gestisci e condividi le tue spese con un commercialista o avvia un gruppo di viaggio con gli amici.',
},
domainWorkspaceRestriction: {
subtitle:
'La creazione di spazi di lavoro è consentita solo agli amministratori. Unisciti a uno degli spazi di lavoro qui sotto oppure contatta il tuo amministratore per maggiori informazioni.',
skipForNow: 'Salta per ora',
},
},
featureTraining: {
doNotShowAgain: 'Non mostrarmelo più',
Expand Down Expand Up @@ -5158,6 +5163,8 @@ ${
emptyWorkspace: {
title: 'Non hai spazi di lavoro',
subtitle: 'Traccia ricevute, rimborsa spese, gestisci viaggi, invia fatture e altro ancora.',
restrictedPolicySubtitle:
'La tua azienda limita la creazione di spazi di lavoro da parte di utenti non amministratori. Puoi richiedere l’accesso a uno spazio di lavoro esistente o contattare un amministratore interno per maggiori informazioni.',
createAWorkspaceCTA: 'Inizia',
features: {
trackAndCollect: 'Traccia e raccogli ricevute',
Expand Down
6 changes: 6 additions & 0 deletions src/languages/ja.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2691,6 +2691,10 @@ ${
title: 'メンバーを招待する',
subtitle: '経費を会計士と管理・共有したり、友達と旅行グループを始めたりしましょう。',
},
domainWorkspaceRestriction: {
subtitle: 'ワークスペースの作成は管理者のみに制限されています。以下のいずれかのワークスペースに参加するか、詳細は管理者にお問い合わせください。',
skipForNow: '今はスキップ',
},
},
featureTraining: {
doNotShowAgain: 'これを再び表示しないでください',
Expand Down Expand Up @@ -5116,6 +5120,8 @@ ${
emptyWorkspace: {
title: 'ワークスペースがありません',
subtitle: '領収書の管理、経費精算、出張管理、請求書の送信などができます。',
restrictedPolicySubtitle:
'あなたの会社では、管理者以外のユーザーによるワークスペースの作成が制限されています。既存のワークスペースへのアクセスをリクエストするか、社内の管理者にお問い合わせください。',
createAWorkspaceCTA: '開始する',
features: {
trackAndCollect: '領収書を追跡して収集する',
Expand Down
7 changes: 7 additions & 0 deletions src/languages/nl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2701,6 +2701,11 @@ ${
title: 'Leden uitnodigen',
subtitle: 'Beheer en deel je uitgaven met een accountant of start een reisgroep met vrienden.',
},
domainWorkspaceRestriction: {
subtitle:
'Het aanmaken van werkruimtes is voorbehouden aan beheerders. Sluit je aan bij een van de onderstaande werkruimtes of neem contact op met je beheerder voor meer informatie.',
skipForNow: 'Voor nu overslaan',
},
},
featureTraining: {
doNotShowAgain: 'Toon me dit niet meer',
Expand Down Expand Up @@ -5151,6 +5156,8 @@ ${
emptyWorkspace: {
title: 'Je hebt geen werkruimtes',
subtitle: 'Beheer bonnetjes, vergoed uitgaven, regel reizen, verstuur facturen en meer.',
restrictedPolicySubtitle:
'Uw bedrijf beperkt het aanmaken van werkruimten door niet-beheerders. U kunt toegang aanvragen tot een bestaande werkruimte of contact opnemen met een interne beheerder voor meer informatie.',
createAWorkspaceCTA: 'Aan de slag',
features: {
trackAndCollect: 'Volg en verzamel bonnetjes',
Expand Down
7 changes: 7 additions & 0 deletions src/languages/pl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2696,6 +2696,11 @@ ${
title: 'Zaproś członków',
subtitle: 'Zarządzaj i udostępniaj swoje wydatki księgowemu lub rozpocznij grupę podróżniczą z przyjaciółmi.',
},
domainWorkspaceRestriction: {
subtitle:
'Tworzenie obszarów roboczych jest ograniczone do administratorów. Dołącz do jednego z obszarów roboczych poniżej lub skontaktuj się ze swoim administratorem, aby uzyskać więcej informacji.',
skipForNow: 'Pomiń na razie',
},
},
featureTraining: {
doNotShowAgain: 'Nie pokazuj mi tego ponownie',
Expand Down Expand Up @@ -5141,6 +5146,8 @@ ${
emptyWorkspace: {
title: 'Nie masz żadnych przestrzeni roboczych',
subtitle: 'Śledź paragony, zwracaj wydatki, zarządzaj podróżami, wysyłaj faktury i nie tylko.',
restrictedPolicySubtitle:
'Twoja firma ogranicza tworzenie przestrzeni roboczych przez użytkowników niebędących administratorami. Możesz poprosić o dostęp do istniejącej przestrzeni roboczej lub skontaktować się z wewnętrznym administratorem, aby uzyskać więcej informacji.',
createAWorkspaceCTA: 'Rozpocznij',
features: {
trackAndCollect: 'Śledź i zbieraj paragony',
Expand Down
7 changes: 7 additions & 0 deletions src/languages/pt-BR.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2696,6 +2696,11 @@ ${
title: 'Convidar membros',
subtitle: 'Gerencie e compartilhe suas despesas com um contador ou inicie um grupo de viagem com amigos.',
},
domainWorkspaceRestriction: {
subtitle:
'A criação de espaços de trabalho está restrita aos administradores. Entre em um dos espaços de trabalho abaixo ou contate seu administrador para obter mais informações.',
skipForNow: 'Pular por enquanto',
},
},
featureTraining: {
doNotShowAgain: 'Não me mostre isso novamente',
Expand Down Expand Up @@ -5144,6 +5149,8 @@ ${
emptyWorkspace: {
title: 'Você não tem espaços de trabalho',
subtitle: 'Acompanhe recibos, reembolse despesas, gerencie viagens, envie faturas e muito mais.',
restrictedPolicySubtitle:
'Sua empresa restringe a criação de workspaces por usuários não administradores. Você pode solicitar acesso a um workspace existente ou entrar em contato com um administrador interno para mais informações.',
createAWorkspaceCTA: 'Começar',
features: {
trackAndCollect: 'Acompanhe e colete recibos',
Expand Down
5 changes: 5 additions & 0 deletions src/languages/zh-hans.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2662,6 +2662,10 @@ ${
title: '邀请成员',
subtitle: '与会计师管理和分享您的费用,或与朋友组建旅行团体。',
},
domainWorkspaceRestriction: {
subtitle: '工作区的创建仅限管理员。加入以下任一工作区,或联系您的管理员以获取更多信息。',
skipForNow: '暂时跳过',
},
},
featureTraining: {
doNotShowAgain: '不再显示此内容',
Expand Down Expand Up @@ -5049,6 +5053,7 @@ ${
emptyWorkspace: {
title: '您没有任何工作区',
subtitle: '跟踪收据、报销费用、管理差旅、发送发票等。',
restrictedPolicySubtitle: '您的公司限制非管理员用户创建工作区。您可以请求访问现有工作区或联系内部管理员以获取更多信息。',
createAWorkspaceCTA: '开始使用',
features: {
trackAndCollect: '跟踪并收集收据',
Expand Down
31 changes: 26 additions & 5 deletions src/pages/OnboardingWorkspaces/BaseOnboardingWorkspaces.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import {View} from 'react-native';
import Button from '@components/Button';
import HeaderWithBackButton from '@components/HeaderWithBackButton';
import * as Expensicons from '@components/Icon/Expensicons';

Check warning on line 6 in src/pages/OnboardingWorkspaces/BaseOnboardingWorkspaces.tsx

View workflow job for this annotation

GitHub Actions / Changed files ESLint check

'@components/Icon/Expensicons' import is restricted from being used by a pattern. Direct imports from Icon/Expensicons are deprecated. Please use lazy loading hooks instead. Use `useMemoizedLazyExpensifyIcons` from @hooks/useLazyAsset. See docs/LAZY_ICONS_AND_ILLUSTRATIONS.md for details

Check warning on line 6 in src/pages/OnboardingWorkspaces/BaseOnboardingWorkspaces.tsx

View workflow job for this annotation

GitHub Actions / Changed files ESLint check

'@components/Icon/Expensicons' import is restricted from being used. Direct imports from @components/Icon/Expensicons are deprecated. Please use lazy loading hooks instead. Use `useMemoizedLazyExpensifyIcons` from @hooks/useLazyAsset. See docs/LAZY_ICONS_AND_ILLUSTRATIONS.md for details
import ScreenWrapper from '@components/ScreenWrapper';
import SelectionList from '@components/SelectionList';
import UserListItem from '@components/SelectionList/ListItem/UserListItem';
Expand All @@ -13,6 +13,7 @@
import useOnboardingMessages from '@hooks/useOnboardingMessages';
import useOnyx from '@hooks/useOnyx';
import usePermissions from '@hooks/usePermissions';
import usePreferredPolicy from '@hooks/usePreferredPolicy';
import useResponsiveLayout from '@hooks/useResponsiveLayout';
import useThemeStyles from '@hooks/useThemeStyles';
import {navigateAfterOnboardingWithMicrotaskQueue} from '@libs/navigateAfterOnboarding';
Expand Down Expand Up @@ -57,6 +58,8 @@
const isVsb = onboardingValues?.signupQualifier === CONST.ONBOARDING_SIGNUP_QUALIFIERS.VSB;
const isSmb = onboardingValues?.signupQualifier === CONST.ONBOARDING_SIGNUP_QUALIFIERS.SMB;

const {isRestrictedPolicyCreation} = usePreferredPolicy();

const handleJoinWorkspace = useCallback(
(policy: JoinablePolicy) => {
if (policy.automaticJoiningEnabled) {
Expand Down Expand Up @@ -148,8 +151,8 @@
shouldShowOfflineIndicator={isSmallScreenWidth}
>
<HeaderWithBackButton
shouldShowBackButton
progressBarPercentage={60}
shouldShowBackButton={!isRestrictedPolicyCreation}
progressBarPercentage={isRestrictedPolicyCreation ? 100 : 60}
onBackButtonPress={handleBackButtonPress}
/>
<SelectionList
Expand All @@ -163,16 +166,34 @@
customListHeader={
<View style={[wrapperPadding, onboardingIsMediumOrLargerScreenWidth && styles.mt5, styles.mb5]}>
<Text style={styles.textHeadlineH1}>{translate('onboarding.joinAWorkspace')}</Text>
<Text style={[styles.textSupporting, styles.mt3]}>{translate('onboarding.listOfWorkspaces')}</Text>
<Text style={[styles.textSupporting, styles.mt3]}>
{translate(isRestrictedPolicyCreation ? 'onboarding.domainWorkspaceRestriction.subtitle' : 'onboarding.listOfWorkspaces')}
</Text>
</View>
}
footerContent={
<Button
success={false}
large
text={translate('common.skip')}
text={translate(isRestrictedPolicyCreation ? 'onboarding.domainWorkspaceRestriction.skipForNow' : 'common.skip')}
testID="onboardingWorkSpaceSkipButton"
onPress={skipJoiningWorkspaces}
onPress={() => {
if (isRestrictedPolicyCreation) {
completeOnboarding({
engagementChoice: CONST.ONBOARDING_CHOICES.LOOKING_AROUND,
onboardingMessage: onboardingMessages[CONST.ONBOARDING_CHOICES.LOOKING_AROUND],
firstName: onboardingPersonalDetails?.firstName ?? '',
lastName: onboardingPersonalDetails?.lastName ?? '',
});

Navigation.setNavigationActionToMicrotaskQueue(() => {
Navigation.navigate(ROUTES.TEST_DRIVE_MODAL_ROOT.route);
});

return;
}
skipJoiningWorkspaces();
}}
style={[styles.mt5]}
/>
}
Expand Down
Loading