Skip to content

Commit 2fa63aa

Browse files
authored
Merge pull request Expensify#61845 from rushatgabhane/feat/vacation
[Vacation delegate] add ability to set a vacation delegate
2 parents e2f3916 + c63ffa7 commit 2fa63aa

33 files changed

Lines changed: 622 additions & 5 deletions

src/CONST/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1762,6 +1762,7 @@ const CONST = {
17621762
UNABLE_TO_RETRY: 'unableToRetry',
17631763
UPDATE_REQUIRED: 426,
17641764
INCORRECT_MAGIC_CODE: 451,
1765+
POLICY_DIFF_WARNING: 305,
17651766
},
17661767
HTTP_STATUS: {
17671768
// When Cloudflare throttles

src/ONYXKEYS.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -503,6 +503,9 @@ const ONYXKEYS = {
503503
/** Stores the information about the state of side panel */
504504
NVP_SIDE_PANEL: 'nvp_sidePanel',
505505

506+
/** Information about vacation delegate */
507+
NVP_PRIVATE_VACATION_DELEGATE: 'nvp_private_vacationDelegate',
508+
506509
/** Stores draft information while user is scheduling the call. */
507510
SCHEDULE_CALL_DRAFT: 'scheduleCallDraft',
508511

@@ -1183,6 +1186,7 @@ type OnyxValuesMapping = {
11831186
[ONYXKEYS.SHOULD_BILL_WHEN_DOWNGRADING]: boolean | undefined;
11841187
[ONYXKEYS.BILLING_RECEIPT_DETAILS]: OnyxTypes.BillingReceiptDetails;
11851188
[ONYXKEYS.NVP_SIDE_PANEL]: OnyxTypes.SidePanel;
1189+
[ONYXKEYS.NVP_PRIVATE_VACATION_DELEGATE]: OnyxTypes.VacationDelegate;
11861190
[ONYXKEYS.SCHEDULE_CALL_DRAFT]: OnyxTypes.ScheduleCallDraft;
11871191
[ONYXKEYS.IS_FORCED_TO_CHANGE_CURRENCY]: boolean | undefined;
11881192
[ONYXKEYS.IS_COMING_FROM_GLOBAL_REIMBURSEMENTS_FLOW]: boolean | undefined;

src/ROUTES.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -346,6 +346,7 @@ const ROUTES = {
346346
SETTINGS_STATUS_CLEAR_AFTER: 'settings/profile/status/clear-after',
347347
SETTINGS_STATUS_CLEAR_AFTER_DATE: 'settings/profile/status/clear-after/date',
348348
SETTINGS_STATUS_CLEAR_AFTER_TIME: 'settings/profile/status/clear-after/time',
349+
SETTINGS_VACATION_DELEGATE: 'settings/profile/status/vacation-delegate',
349350
SETTINGS_TROUBLESHOOT: 'settings/troubleshoot',
350351
SETTINGS_CONSOLE: {
351352
route: 'settings/troubleshoot/console',

src/SCREENS.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,7 @@ const SCREENS = {
101101
STATUS_CLEAR_AFTER: 'Settings_Status_Clear_After',
102102
STATUS_CLEAR_AFTER_DATE: 'Settings_Status_Clear_After_Date',
103103
STATUS_CLEAR_AFTER_TIME: 'Settings_Status_Clear_After_Time',
104+
VACATION_DELEGATE: 'Settings_Status_Vacation_Delegate',
104105
STATUS: 'Settings_Status',
105106
PRONOUNS: 'Settings_Pronouns',
106107
TIMEZONE: 'Settings_Timezone',

src/languages/de.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -194,6 +194,7 @@ import type {
194194
StepCounterParams,
195195
StripePaidParams,
196196
SubmitsToParams,
197+
SubmittedToVacationDelegateParams,
197198
SubscriptionCommitmentParams,
198199
SubscriptionSettingsRenewsOnParams,
199200
SubscriptionSettingsSaveUpToParams,
@@ -245,6 +246,7 @@ import type {
245246
UsePlusButtonParams,
246247
UserIsAlreadyMemberParams,
247248
UserSplitParams,
249+
VacationDelegateParams,
248250
ViolationsAutoReportedRejectedExpenseParams,
249251
ViolationsCashExpenseWithNoReceiptParams,
250252
ViolationsConversionSurchargeParams,
@@ -610,6 +612,7 @@ const translations = {
610612
workspacesTabTitle: 'Arbeitsbereiche',
611613
getTheApp: 'Hole dir die App',
612614
scanReceiptsOnTheGo: 'Scannen Sie Belege von Ihrem Telefon aus',
615+
headsUp: 'Achtung!',
613616
},
614617
supportalNoAccess: {
615618
title: 'Nicht so schnell',
@@ -2377,6 +2380,13 @@ const translations = {
23772380
untilTime: ({time}: UntilTimeParams) => `Bis ${time}`,
23782381
date: 'Datum',
23792382
time: 'Zeit',
2383+
vacationDelegate: 'Urlaubsvertretung',
2384+
setVacationDelegate: `Legen Sie eine Urlaubsvertretung fest, die Berichte in Ihrer Abwesenheit genehmigt.`,
2385+
vacationDelegateError: 'Beim Aktualisieren Ihrer Urlaubsvertretung ist ein Fehler aufgetreten.',
2386+
asVacationDelegate: ({nameOrEmail: managerName}: VacationDelegateParams) => `als Urlaubsvertretung von ${managerName}`,
2387+
toAsVacationDelegate: ({submittedToName, vacationDelegateName}: SubmittedToVacationDelegateParams) => `an ${submittedToName} als Urlaubsvertretung von ${vacationDelegateName}`,
2388+
vacationDelegateWarning: ({nameOrEmail}: VacationDelegateParams) =>
2389+
`Sie weisen ${nameOrEmail} als Ihre Urlaubsvertretung zu. Diese Person ist noch nicht in all Ihren Workspaces. Wenn Sie fortfahren, wird eine E-Mail an alle Ihre Workspace-Administratoren gesendet, um sie hinzuzufügen.`,
23802390
clearAfter: 'Nach dem Löschen',
23812391
whenClearStatus: 'Wann sollten wir Ihren Status löschen?',
23822392
},

src/languages/en.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -182,6 +182,7 @@ import type {
182182
StepCounterParams,
183183
StripePaidParams,
184184
SubmitsToParams,
185+
SubmittedToVacationDelegateParams,
185186
SubscriptionCommitmentParams,
186187
SubscriptionSettingsRenewsOnParams,
187188
SubscriptionSettingsSaveUpToParams,
@@ -233,6 +234,7 @@ import type {
233234
UsePlusButtonParams,
234235
UserIsAlreadyMemberParams,
235236
UserSplitParams,
237+
VacationDelegateParams,
236238
ViolationsAutoReportedRejectedExpenseParams,
237239
ViolationsCashExpenseWithNoReceiptParams,
238240
ViolationsConversionSurchargeParams,
@@ -600,6 +602,7 @@ const translations = {
600602
workspacesTabTitle: 'Workspaces',
601603
getTheApp: 'Get the app',
602604
scanReceiptsOnTheGo: 'Scan receipts from your phone',
605+
headsUp: 'Heads up!',
603606
},
604607
supportalNoAccess: {
605608
title: 'Not so fast',
@@ -2339,6 +2342,13 @@ const translations = {
23392342
time: 'Time',
23402343
clearAfter: 'Clear after',
23412344
whenClearStatus: 'When should we clear your status?',
2345+
vacationDelegate: 'Vacation delegate',
2346+
setVacationDelegate: `Set a vacation delegate to approve reports on your behalf while you're out of office.`,
2347+
vacationDelegateError: 'There was an error updating your vacation delegate.',
2348+
asVacationDelegate: ({nameOrEmail}: VacationDelegateParams) => `as ${nameOrEmail}'s vacation delegate`,
2349+
toAsVacationDelegate: ({submittedToName, vacationDelegateName}: SubmittedToVacationDelegateParams) => `to ${submittedToName} as vacation delegate for ${vacationDelegateName}`,
2350+
vacationDelegateWarning: ({nameOrEmail}: VacationDelegateParams) =>
2351+
`You're assigning ${nameOrEmail} as your vacation delegate. They're not on all your workspaces yet. If you choose to continue, an email will be sent to all your workspace admins to add them.`,
23422352
},
23432353
stepCounter: ({step, total, text}: StepCounterParams) => {
23442354
let result = `Step ${step}`;

src/languages/es.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,7 @@ import type {
181181
StepCounterParams,
182182
StripePaidParams,
183183
SubmitsToParams,
184+
SubmittedToVacationDelegateParams,
184185
SubscriptionCommitmentParams,
185186
SubscriptionSettingsRenewsOnParams,
186187
SubscriptionSettingsSaveUpToParams,
@@ -232,6 +233,7 @@ import type {
232233
UsePlusButtonParams,
233234
UserIsAlreadyMemberParams,
234235
UserSplitParams,
236+
VacationDelegateParams,
235237
ViolationsAutoReportedRejectedExpenseParams,
236238
ViolationsCashExpenseWithNoReceiptParams,
237239
ViolationsConversionSurchargeParams,
@@ -591,6 +593,7 @@ const translations = {
591593
workspacesTabTitle: 'Espacios',
592594
getTheApp: 'Descarga la app',
593595
scanReceiptsOnTheGo: 'Escanea recibos desde tu teléfono',
596+
headsUp: '¡Atención!',
594597
},
595598
supportalNoAccess: {
596599
title: 'No tan rápido',
@@ -2359,6 +2362,13 @@ const translations = {
23592362
time: 'Hora',
23602363
clearAfter: 'Borrar después',
23612364
whenClearStatus: '¿Cuándo deberíamos borrar tu estado?',
2365+
vacationDelegate: 'Delegado de vacaciones',
2366+
setVacationDelegate: 'Configura un delegado de vacaciones para aprobar informes en tu nombre mientras estás fuera de la oficina.',
2367+
vacationDelegateError: 'Hubo un error al actualizar tu delegado de vacaciones.',
2368+
asVacationDelegate: ({nameOrEmail: managerName}: VacationDelegateParams) => `como delegado de vacaciones de ${managerName}`,
2369+
toAsVacationDelegate: ({submittedToName, vacationDelegateName}: SubmittedToVacationDelegateParams) => `a ${submittedToName} como delegado de vacaciones de ${vacationDelegateName}`,
2370+
vacationDelegateWarning: ({nameOrEmail}: VacationDelegateParams) =>
2371+
`Está asignando a ${nameOrEmail} como su delegado de vacaciones. Aún no está en todos sus espacios de trabajo. Si decide continuar, se enviará un correo electrónico a todos los administradores de sus espacios de trabajo para agregarlo.`,
23622372
},
23632373
stepCounter: ({step, total, text}: StepCounterParams) => {
23642374
let result = `Paso ${step}`;

src/languages/fr.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -194,6 +194,7 @@ import type {
194194
StepCounterParams,
195195
StripePaidParams,
196196
SubmitsToParams,
197+
SubmittedToVacationDelegateParams,
197198
SubscriptionCommitmentParams,
198199
SubscriptionSettingsRenewsOnParams,
199200
SubscriptionSettingsSaveUpToParams,
@@ -245,6 +246,7 @@ import type {
245246
UsePlusButtonParams,
246247
UserIsAlreadyMemberParams,
247248
UserSplitParams,
249+
VacationDelegateParams,
248250
ViolationsAutoReportedRejectedExpenseParams,
249251
ViolationsCashExpenseWithNoReceiptParams,
250252
ViolationsConversionSurchargeParams,
@@ -610,6 +612,7 @@ const translations = {
610612
workspacesTabTitle: 'Espaces de travail',
611613
getTheApp: "Obtenez l'application",
612614
scanReceiptsOnTheGo: 'Numérisez les reçus depuis votre téléphone',
615+
headsUp: 'Attention !',
613616
},
614617
supportalNoAccess: {
615618
title: 'Pas si vite',
@@ -2377,6 +2380,14 @@ const translations = {
23772380
time: 'Temps',
23782381
clearAfter: 'Effacer après',
23792382
whenClearStatus: 'Quand devrions-nous effacer votre statut ?',
2383+
vacationDelegate: 'Délégué de vacances',
2384+
setVacationDelegate: `Définissez un délégué de vacances pour approuver les rapports en votre absence.`,
2385+
vacationDelegateError: 'Une erreur est survenue lors de la mise à jour de votre délégué de vacances.',
2386+
asVacationDelegate: ({nameOrEmail: managerName}: VacationDelegateParams) => `en tant que délégué de vacances de ${managerName}`,
2387+
toAsVacationDelegate: ({submittedToName, vacationDelegateName}: SubmittedToVacationDelegateParams) =>
2388+
${submittedToName} en tant que délégué de vacances de ${vacationDelegateName}`,
2389+
vacationDelegateWarning: ({nameOrEmail}: VacationDelegateParams) =>
2390+
`Vous assignez ${nameOrEmail} en tant que délégué de vacances. Il/elle n'est pas encore présent(e) dans tous vos espaces de travail. Si vous choisissez de continuer, un e-mail sera envoyé à tous les administrateurs de vos espaces pour l’ajouter.`,
23802391
},
23812392
stepCounter: ({step, total, text}: StepCounterParams) => {
23822393
let result = `Étape ${step}`;

src/languages/it.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -194,6 +194,7 @@ import type {
194194
StepCounterParams,
195195
StripePaidParams,
196196
SubmitsToParams,
197+
SubmittedToVacationDelegateParams,
197198
SubscriptionCommitmentParams,
198199
SubscriptionSettingsRenewsOnParams,
199200
SubscriptionSettingsSaveUpToParams,
@@ -245,6 +246,7 @@ import type {
245246
UsePlusButtonParams,
246247
UserIsAlreadyMemberParams,
247248
UserSplitParams,
249+
VacationDelegateParams,
248250
ViolationsAutoReportedRejectedExpenseParams,
249251
ViolationsCashExpenseWithNoReceiptParams,
250252
ViolationsConversionSurchargeParams,
@@ -610,6 +612,7 @@ const translations = {
610612
workspacesTabTitle: 'Spazi di lavoro',
611613
getTheApp: "Scarica l'app",
612614
scanReceiptsOnTheGo: 'Scansiona le ricevute dal tuo telefono',
615+
headsUp: 'Attenzione!',
613616
},
614617
supportalNoAccess: {
615618
title: 'Non così in fretta',
@@ -2364,6 +2367,13 @@ const translations = {
23642367
time: 'Tempo',
23652368
clearAfter: 'Cancella dopo',
23662369
whenClearStatus: 'Quando dovremmo cancellare il tuo stato?',
2370+
vacationDelegate: 'Delegato per le vacanze',
2371+
setVacationDelegate: `Imposta un delegato per le vacanze per approvare i report al tuo posto mentre sei fuori ufficio.`,
2372+
vacationDelegateError: 'Si è verificato un errore durante l’aggiornamento del delegato per le vacanze.',
2373+
asVacationDelegate: ({nameOrEmail: managerName}: VacationDelegateParams) => `come delegato per le vacanze di ${managerName}`,
2374+
toAsVacationDelegate: ({submittedToName, vacationDelegateName}: SubmittedToVacationDelegateParams) => `a ${submittedToName} come delegato per le vacanze di ${vacationDelegateName}`,
2375+
vacationDelegateWarning: ({nameOrEmail}: VacationDelegateParams) =>
2376+
`Stai assegnando ${nameOrEmail} come tuo delegato per le vacanze. Non è ancora presente in tutti i tuoi workspace. Se scegli di continuare, verrà inviata un'e-mail a tutti gli amministratori dei tuoi workspace per aggiungerlo.`,
23672377
},
23682378
stepCounter: ({step, total, text}: StepCounterParams) => {
23692379
let result = `Passo ${step}`;

src/languages/ja.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -194,6 +194,7 @@ import type {
194194
StepCounterParams,
195195
StripePaidParams,
196196
SubmitsToParams,
197+
SubmittedToVacationDelegateParams,
197198
SubscriptionCommitmentParams,
198199
SubscriptionSettingsRenewsOnParams,
199200
SubscriptionSettingsSaveUpToParams,
@@ -245,6 +246,7 @@ import type {
245246
UsePlusButtonParams,
246247
UserIsAlreadyMemberParams,
247248
UserSplitParams,
249+
VacationDelegateParams,
248250
ViolationsAutoReportedRejectedExpenseParams,
249251
ViolationsCashExpenseWithNoReceiptParams,
250252
ViolationsConversionSurchargeParams,
@@ -610,6 +612,7 @@ const translations = {
610612
workspacesTabTitle: 'ワークスペース',
611613
getTheApp: 'アプリを入手',
612614
scanReceiptsOnTheGo: '携帯電話から領収書をスキャンする',
615+
headsUp: 'ご注意ください!',
613616
},
614617
supportalNoAccess: {
615618
title: 'ちょっと待ってください',
@@ -2350,6 +2353,13 @@ const translations = {
23502353
afterWeek: '1週間',
23512354
custom: 'カスタム',
23522355
},
2356+
vacationDelegate: '休暇代理人',
2357+
setVacationDelegate: `不在中にレポートを承認してもらうため、休暇代理人を設定してください。`,
2358+
vacationDelegateError: '休暇代理人の更新中にエラーが発生しました。',
2359+
asVacationDelegate: ({nameOrEmail: managerName}: VacationDelegateParams) => `${managerName}の休暇代理人として`,
2360+
toAsVacationDelegate: ({submittedToName, vacationDelegateName}: SubmittedToVacationDelegateParams) => `${submittedToName}へ、${vacationDelegateName}の休暇代理人として`,
2361+
vacationDelegateWarning: ({nameOrEmail}: VacationDelegateParams) =>
2362+
`${nameOrEmail} を休暇代理人として設定しています。まだすべてのワークスペースに参加していません。続行すると、すべてのワークスペース管理者に追加を依頼するメールが送信されます。`,
23532363
untilTomorrow: '明日まで',
23542364
untilTime: ({time}: UntilTimeParams) => `${time}まで`,
23552365
date: '日付',

0 commit comments

Comments
 (0)