Skip to content
Merged
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
7 changes: 0 additions & 7 deletions src/ONYXKEYS.ts
Original file line number Diff line number Diff line change
Expand Up @@ -466,9 +466,6 @@ const ONYXKEYS = {

NVP_PRIVATE_CANCELLATION_DETAILS: 'nvp_private_cancellationDetails',

/** Stores the information about duplicated workspace */
DUPLICATE_WORKSPACE: 'duplicateWorkspace',

/** Stores the information about currently edited advanced approval workflow */
APPROVAL_WORKFLOW: 'approvalWorkflow',

Expand Down Expand Up @@ -686,8 +683,6 @@ const ONYXKEYS = {
WORKSPACE_CATEGORY_FORM: 'workspaceCategoryForm',
WORKSPACE_CONFIRMATION_FORM: 'workspaceConfirmationForm',
WORKSPACE_CONFIRMATION_FORM_DRAFT: 'workspaceConfirmationFormDraft',
WORKSPACE_DUPLICATE_FORM: 'workspaceDuplicateForm',
WORKSPACE_DUPLICATE_FORM_DRAFT: 'workspaceDuplicateFormDraft',
WORKSPACE_CATEGORY_FORM_DRAFT: 'workspaceCategoryFormDraft',
WORKSPACE_CATEGORY_DESCRIPTION_HINT_FORM: 'workspaceCategoryDescriptionHintForm',
WORKSPACE_CATEGORY_DESCRIPTION_HINT_FORM_DRAFT: 'workspaceCategoryDescriptionHintFormDraft',
Expand Down Expand Up @@ -894,7 +889,6 @@ type OnyxFormValuesMapping = {
[ONYXKEYS.FORMS.WORKSPACE_SETTINGS_FORM]: FormTypes.WorkspaceSettingsForm;
[ONYXKEYS.FORMS.WORKSPACE_CATEGORY_FORM]: FormTypes.WorkspaceCategoryForm;
[ONYXKEYS.FORMS.WORKSPACE_CONFIRMATION_FORM]: FormTypes.WorkspaceConfirmationForm;
[ONYXKEYS.FORMS.WORKSPACE_DUPLICATE_FORM]: FormTypes.WorkspaceDuplicateForm;
[ONYXKEYS.FORMS.ONBOARDING_WORKSPACE_DETAILS_FORM]: FormTypes.WorkspaceConfirmationForm;
[ONYXKEYS.FORMS.WORKSPACE_TAG_FORM]: FormTypes.WorkspaceTagForm;
[ONYXKEYS.FORMS.WORKSPACE_TAX_CUSTOM_NAME]: FormTypes.WorkspaceTaxCustomName;
Expand Down Expand Up @@ -1196,7 +1190,6 @@ type OnyxValuesMapping = {
[ONYXKEYS.ADD_NEW_COMPANY_CARD]: OnyxTypes.AddNewCompanyCardFeed;
[ONYXKEYS.ASSIGN_CARD]: OnyxTypes.AssignCard;
[ONYXKEYS.MOBILE_SELECTION_MODE]: boolean;
[ONYXKEYS.DUPLICATE_WORKSPACE]: OnyxTypes.DuplicateWorkspace;
[ONYXKEYS.NVP_FIRST_DAY_FREE_TRIAL]: string;
[ONYXKEYS.NVP_LAST_DAY_FREE_TRIAL]: string;
[ONYXKEYS.NVP_BILLING_FUND_ID]: number;
Expand Down
8 changes: 0 additions & 8 deletions src/ROUTES.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1876,14 +1876,6 @@ const ROUTES = {
return getUrlWithBackToParam(`workspaces/${policyID}/per-diem`, backTo);
},
},
WORKSPACE_DUPLICATE: {
route: 'workspace/:policyID/duplicate',
getRoute: (policyID: string, backTo?: string) => getUrlWithBackToParam(`workspace/${policyID}/duplicate`, backTo),
},
WORKSPACE_DUPLICATE_SELECT_FEATURES: {
route: 'workspace/:policyID/duplicate/select-features',
getRoute: (policyID: string, backTo?: string) => getUrlWithBackToParam(`workspace/${policyID}/duplicate/select-features`, backTo),
},
WORKSPACE_RECEIPT_PARTNERS: {
route: 'workspaces/:policyID/receipt-partners',
getRoute: (policyID: string | undefined, backTo?: string) => {
Expand Down
2 changes: 0 additions & 2 deletions src/SCREENS.ts
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,6 @@ const SCREENS = {
REPORT_DETAILS: 'Report_Details',
REPORT_CHANGE_WORKSPACE: 'ReportChangeWorkspace',
WORKSPACE_CONFIRMATION: 'Workspace_Confirmation',
WORKSPACE_DUPLICATE: 'Workspace_Duplicate',
REPORT_SETTINGS: 'Report_Settings',
REPORT_DESCRIPTION: 'Report_Description',
PARTICIPANTS: 'Participants',
Expand Down Expand Up @@ -389,7 +388,6 @@ const SCREENS = {
},

WORKSPACE_CONFIRMATION: {ROOT: 'Workspace_Confirmation_Root'},
WORKSPACE_DUPLICATE: {ROOT: 'Workspace_Duplicate_Root', SELECT_FEATURES: 'Workspace_Duplicate_Select_Features'},

WORKSPACES_LIST: 'Workspaces_List',

Expand Down
32 changes: 24 additions & 8 deletions src/components/WorkspaceConfirmationForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,17 @@ import useAutoFocusInput from '@hooks/useAutoFocusInput';
import useLocalize from '@hooks/useLocalize';
import useOnyx from '@hooks/useOnyx';
import useThemeStyles from '@hooks/useThemeStyles';
import useWorkspaceConfirmationAvatar from '@hooks/useWorkspaceConfirmationAvatar';
import {generateDefaultWorkspaceName, generatePolicyID} from '@libs/actions/Policy/Policy';
import type {CustomRNImageManipulatorResult} from '@libs/cropOrRotateImage/types';
import {addErrorMessage} from '@libs/ErrorUtils';
import getFirstAlphaNumericCharacter from '@libs/getFirstAlphaNumericCharacter';
import Navigation from '@libs/Navigation/Navigation';
import {getDefaultWorkspaceAvatar} from '@libs/ReportUtils';
import {isRequiredFulfilled} from '@libs/ValidationUtils';
import CONST from '@src/CONST';
import ONYXKEYS from '@src/ONYXKEYS';
import INPUT_IDS from '@src/types/form/WorkspaceConfirmationForm';
import isLoadingOnyxValue from '@src/types/utils/isLoadingOnyxValue';
import Avatar from './Avatar';
import AvatarWithImagePicker from './AvatarWithImagePicker';
import CurrencyPicker from './CurrencyPicker';
import FormProvider from './Form/FormProvider';
Expand All @@ -27,6 +26,13 @@ import ScrollView from './ScrollView';
import Text from './Text';
import TextInput from './TextInput';

function getFirstAlphaNumericCharacter(str = '') {
return str
.normalize('NFD')
.replace(/[^0-9a-z]/gi, '')
.toUpperCase()[0];
}

type WorkspaceConfirmationSubmitFunctionParams = {
name: string;
currency: string;
Expand Down Expand Up @@ -94,12 +100,22 @@ function WorkspaceConfirmationForm({onSubmit, policyOwnerEmail = '', onBackButto

const stashedLocalAvatarImage = workspaceAvatar?.avatarUri ?? undefined;

const DefaultAvatar = useWorkspaceConfirmationAvatar({
policyID,
// eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing -- nullish coalescing cannot be used if left side can be empty string
source: stashedLocalAvatarImage || getDefaultWorkspaceAvatar(workspaceNameFirstCharacter),
name: workspaceNameFirstCharacter,
});
const DefaultAvatar = useCallback(
() => (
<Avatar
containerStyles={styles.avatarXLarge}
imageStyles={[styles.avatarXLarge, styles.alignSelfCenter]}
// eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing -- nullish coalescing cannot be used if left side can be empty string
source={workspaceAvatar?.avatarUri || getDefaultWorkspaceAvatar(workspaceNameFirstCharacter)}
fallbackIcon={Expensicons.FallbackWorkspaceAvatar}
size={CONST.AVATAR_SIZE.X_LARGE}
name={workspaceNameFirstCharacter}
avatarID={policyID}
type={CONST.ICON_TYPE_WORKSPACE}
/>
),
[workspaceAvatar?.avatarUri, workspaceNameFirstCharacter, styles.alignSelfCenter, styles.avatarXLarge, policyID],
);

return (
<>
Expand Down
28 changes: 0 additions & 28 deletions src/hooks/useWorkspaceConfirmationAvatar.tsx

This file was deleted.

18 changes: 0 additions & 18 deletions src/languages/de.ts
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,6 @@ const translations = {
count: 'Zählen',
cancel: 'Abbrechen',
dismiss: 'Verwerfen',
proceed: 'Fortfahren',
yes: 'Ja',
no: 'No',
ok: 'OK',
Expand Down Expand Up @@ -3461,14 +3460,12 @@ const translations = {
customField1: 'Benutzerdefiniertes Feld 1',
customField2: 'Benutzerdefiniertes Feld 2',
customFieldHint: 'Fügen Sie benutzerdefinierten Code hinzu, der für alle Ausgaben dieses Mitglieds gilt.',
reports: 'Berichte',
reportFields: 'Berichtsfelder',
reportTitle: 'Berichtstitel',
reportField: 'Berichtsfeld',
taxes: 'Steuern',
bills: 'Rechnungen',
invoices: 'Rechnungen',
perDiem: 'Per diem',
travel: 'Reisen',
members: 'Mitglieder',
accounting: 'Buchhaltung',
Expand All @@ -3481,7 +3478,6 @@ const translations = {
testTransactions: 'Transaktionen testen',
issueAndManageCards: 'Karten ausstellen und verwalten',
reconcileCards: 'Karten abstimmen',
selectAll: 'Alle auswählen',
selected: () => ({
one: '1 ausgewählt',
other: (count: number) => `${count} ausgewählt`,
Expand All @@ -3495,8 +3491,6 @@ const translations = {
memberNotFound: 'Mitglied nicht gefunden. Um ein neues Mitglied zum Arbeitsbereich einzuladen, verwenden Sie bitte die Einladungsschaltfläche oben.',
notAuthorized: `Sie haben keinen Zugriff auf diese Seite. Wenn Sie versuchen, diesem Arbeitsbereich beizutreten, bitten Sie einfach den Besitzer des Arbeitsbereichs, Sie als Mitglied hinzuzufügen. Etwas anderes? Kontaktieren Sie ${CONST.EMAIL.CONCIERGE}.`,
goToWorkspace: 'Zum Arbeitsbereich gehen',
duplicateWorkspace: 'Arbeitsbereich duplizieren',
duplicateWorkspacePrefix: 'Duplizieren',
goToWorkspaces: 'Zu Arbeitsbereichen gehen',
clearFilter: 'Filter löschen',
workspaceName: 'Arbeitsbereichsname',
Expand Down Expand Up @@ -4905,18 +4899,6 @@ const translations = {
taxCode: 'Steuercode',
updateTaxCodeFailureMessage: 'Beim Aktualisieren des Steuercodes ist ein Fehler aufgetreten, bitte versuchen Sie es erneut.',
},
duplicateWorkspace: {
title: 'Benennen Sie Ihren neuen Arbeitsbereich',
selectFeatures: 'Auswählen der zu kopierenden Features',
whichFeatures: 'Welche Funktionen möchten Sie in Ihren neuen Arbeitsbereich kopieren?',
confirmDuplicate: '\n\nMöchten Sie fortfahren?',
categories: 'Kategorien und Ihre Auto-Kategorisierungsregeln',
reimbursementAccount: 'Erstattungskonto',
delayedSubmission: 'verspätete Einreichung',
welcomeNote: 'Bitte beginnen Sie mit der Nutzung meines neuen Arbeitsbereichs',
confirmTitle: ({newWorkspaceName, totalMembers}: {newWorkspaceName?: string; totalMembers?: number}) =>
`Sie sind dabei, ${newWorkspaceName ?? ''} zu erstellen und mit ${totalMembers ?? 0} Mitgliedern aus dem ursprünglichen Arbeitsbereich zu teilen.`,
},
emptyWorkspace: {
title: 'Sie haben keine Arbeitsbereiche',
subtitle: 'Verfolgen Sie Belege, erstatten Sie Ausgaben, verwalten Sie Reisen, senden Sie Rechnungen und mehr.',
Expand Down
18 changes: 0 additions & 18 deletions src/languages/en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,6 @@ const translations = {
count: 'Count',
cancel: 'Cancel',
dismiss: 'Dismiss',
proceed: 'Proceed',
yes: 'Yes',
no: 'No',
ok: 'OK',
Expand Down Expand Up @@ -3458,14 +3457,12 @@ const translations = {
customField1: 'Custom field 1',
customField2: 'Custom field 2',
customFieldHint: 'Add custom coding that applies to all spend from this member.',
reports: 'Reports',
reportFields: 'Report fields',
reportTitle: 'Report title',
reportField: 'Report field',
taxes: 'Taxes',
bills: 'Bills',
invoices: 'Invoices',
perDiem: 'Per diem',
travel: 'Travel',
members: 'Members',
accounting: 'Accounting',
Expand All @@ -3478,7 +3475,6 @@ const translations = {
testTransactions: 'Test transactions',
issueAndManageCards: 'Issue and manage cards',
reconcileCards: 'Reconcile cards',
selectAll: 'Select all',
selected: () => ({
one: '1 selected',
other: (count: number) => `${count} selected`,
Expand All @@ -3492,8 +3488,6 @@ const translations = {
memberNotFound: 'Member not found. To invite a new member to the workspace, please use the invite button above.',
notAuthorized: `You don't have access to this page. If you're trying to join this workspace, just ask the workspace owner to add you as a member. Something else? Reach out to ${CONST.EMAIL.CONCIERGE}.`,
goToWorkspace: 'Go to workspace',
duplicateWorkspace: 'Duplicate Workspace',
duplicateWorkspacePrefix: 'Duplicate',
goToWorkspaces: 'Go to workspaces',
clearFilter: 'Clear filter',
workspaceName: 'Workspace name',
Expand Down Expand Up @@ -4888,18 +4882,6 @@ const translations = {
taxCode: 'Tax code',
updateTaxCodeFailureMessage: 'An error occurred while updating the tax code, please try again',
},
duplicateWorkspace: {
title: 'Name your new workspace',
selectFeatures: 'Select features to copy',
whichFeatures: 'Which features do you want to copy over to your new workspace?',
confirmDuplicate: '\n\nDo you want to continue?',
categories: 'categories and your auto-categorization rules',
reimbursementAccount: 'reimbursement account',
welcomeNote: 'Please start using my new workspace',
delayedSubmission: 'delayed submission',
confirmTitle: ({newWorkspaceName, totalMembers}: {newWorkspaceName?: string; totalMembers?: number}) =>
`You’re about to create and share ${newWorkspaceName ?? ''} with ${totalMembers ?? 0} members from the original workspace.`,
},
emptyWorkspace: {
title: 'You have no workspaces',
subtitle: 'Track receipts, reimburse expenses, manage travel, send invoices, and more.',
Expand Down
18 changes: 0 additions & 18 deletions src/languages/es.ts
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,6 @@ const translations = {
count: 'Contar',
cancel: 'Cancelar',
dismiss: 'Descartar',
proceed: 'Proceed',
yes: 'Sí',
no: 'No',
ok: 'OK',
Expand Down Expand Up @@ -3446,13 +3445,11 @@ const translations = {
customField1: 'Campo personalizado 1',
customField2: 'Campo personalizado 2',
customFieldHint: 'Añade una codificación personalizada que se aplique a todos los gastos de este miembro.',
reports: 'Informes',
reportFields: 'Campos de informe',
reportTitle: 'El título del informe.',
taxes: 'Impuestos',
bills: 'Pagar facturas',
invoices: 'Facturas',
perDiem: 'Per diem',
travel: 'Viajes',
members: 'Miembros',
accounting: 'Contabilidad',
Expand All @@ -3465,7 +3462,6 @@ const translations = {
testTransactions: 'Transacciones de prueba',
issueAndManageCards: 'Emitir y gestionar tarjetas',
reconcileCards: 'Reconciliar tarjetas',
selectAll: 'Seleccionar todo',
selected: () => ({
one: '1 seleccionado',
other: (count: number) => `${count} seleccionados`,
Expand All @@ -3479,8 +3475,6 @@ const translations = {
memberNotFound: 'Miembro no encontrado. Para invitar a un nuevo miembro al espacio de trabajo, por favor, utiliza el botón invitar que está arriba.',
notAuthorized: `No tienes acceso a esta página. Si estás intentando unirte a este espacio de trabajo, pide al dueño del espacio de trabajo que te añada como miembro. ¿Necesitas algo más? Comunícate con ${CONST.EMAIL.CONCIERGE}`,
goToWorkspace: 'Ir al espacio de trabajo',
duplicateWorkspace: 'Duplicar espacio de trabajo',
duplicateWorkspacePrefix: 'Duplicar',
goToWorkspaces: 'Ir a espacios de trabajo',
clearFilter: 'Borrar filtro',
workspaceName: 'Nombre del espacio de trabajo',
Expand Down Expand Up @@ -4898,18 +4892,6 @@ const translations = {
taxCode: 'Código de impuesto',
updateTaxCodeFailureMessage: 'Se produjo un error al actualizar el código tributario, inténtelo nuevamente',
},
duplicateWorkspace: {
title: 'Nombra tu nuevo espacio de trabajo',
selectFeatures: 'Selecciona las funciones a copiar',
whichFeatures: '¿Qué funciones deseas copiar a tu nuevo espacio de trabajo?',
confirmDuplicate: '\n\n¿Quieres continuar?',
categories: 'categorías y tus reglas de auto-categorización',
reimbursementAccount: 'cuenta de reembolso',
delayedSubmission: 'presentación retrasada',
welcomeNote: 'Por favor, comience a utilizar mi nuevo espacio de trabajo.',
confirmTitle: ({newWorkspaceName, totalMembers}: {newWorkspaceName?: string; totalMembers?: number}) =>
`Estás a punto de crear y compartir ${newWorkspaceName ?? ''} con ${totalMembers ?? 0} miembros del espacio de trabajo original.`,
},
emptyWorkspace: {
title: 'No tienes espacios de trabajo',
subtitle: 'Organiza recibos, reembolsa gastos, gestiona viajes, envía facturas y mucho más.',
Expand Down
Loading
Loading