Skip to content

Commit b02a1f6

Browse files
authored
Merge pull request Expensify#62863 from rayane-d/fix-503880
Update policy name formula part to match user facing term "workspace"
2 parents 09c7da9 + d5db1be commit b02a1f6

4 files changed

Lines changed: 16 additions & 14 deletions

File tree

docs/articles/expensify-classic/spending-insights/Export-Expenses-And-Reports.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,8 @@ Enter any of the following formulas into the Formula field for each column. Be s
127127
| Expenses Count | Is the number of total expenses on the report of this specific expense.|
128128
| {report:expensescount} | Would output 10 assuming that there were 10 expenses on the given report for this expense.|
129129
| Workspace Name | Is the name of the workspace applied to the report.|
130-
| {report:policyname} | Would output Sales assuming that the given report was under a workspace named Sales.|
130+
| {report:workspaceName} | Would output Sales assuming that the given report was under a workspace named Sales.|
131+
| {report:policyName} | Same as the workspace name. Policy is an older term for workspace.|
131132
| Status | Is the current state of the report when it was exported.|
132133
| {report:status} | Would output Approved assuming that the report has been approved and not yet reimbursed.|
133134
| Custom Fields | |

src/languages/en.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4993,7 +4993,7 @@ const translations = {
49934993
customNameInputLabel: 'Name',
49944994
customNameEmailPhoneExample: 'Member’s email or phone: {report:submit:from}',
49954995
customNameStartDateExample: 'Report start date: {report:startdate}',
4996-
customNameWorkspaceNameExample: 'Workspace name: {report:policyname}',
4996+
customNameWorkspaceNameExample: 'Workspace name: {report:workspacename}',
49974997
customNameReportIDExample: 'Report ID: {report:id}',
49984998
customNameTotalExample: 'Total: {report:total}.',
49994999
preventMembersFromChangingCustomNamesTitle: 'Prevent members from changing custom report names',

src/languages/es.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5063,7 +5063,7 @@ const translations = {
50635063
customNameInputLabel: 'Nombre',
50645064
customNameEmailPhoneExample: 'Correo electrónico o teléfono del miembro: {report:submit:from}',
50655065
customNameStartDateExample: 'Fecha de inicio del informe: {report:startdate}',
5066-
customNameWorkspaceNameExample: 'Nombre del espacio de trabajo: {report:policyname}',
5066+
customNameWorkspaceNameExample: 'Nombre del espacio de trabajo: {report:workspacename}',
50675067
customNameReportIDExample: 'ID del informe: {report:id}',
50685068
customNameTotalExample: 'Total: {report:total}.',
50695069
preventMembersFromChangingCustomNamesTitle: 'Evitar que los miembros cambien los nombres personalizados de los informes',

src/libs/ReportUtils.ts

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -5575,17 +5575,18 @@ function populateOptimisticReportFormula(formula: string, report: OptimisticExpe
55755575
const createdDate = report.lastVisibleActionCreated ? new Date(report.lastVisibleActionCreated) : undefined;
55765576
const result = formula
55775577
// We don't translate because the server response is always in English
5578-
.replaceAll('{report:type}', 'Expense Report')
5579-
.replaceAll('{report:startdate}', createdDate ? format(createdDate, CONST.DATE.FNS_FORMAT_STRING) : '')
5580-
.replaceAll('{report:total}', report.total !== undefined ? convertToDisplayString(Math.abs(report.total), report.currency).toString() : '')
5581-
.replaceAll('{report:currency}', report.currency ?? '')
5582-
.replaceAll('{report:policyname}', policy?.name ?? '')
5583-
.replaceAll('{report:created}', createdDate ? format(createdDate, CONST.DATE.FNS_DATE_TIME_FORMAT_STRING) : '')
5584-
.replaceAll('{report:created:yyyy-MM-dd}', createdDate ? format(createdDate, CONST.DATE.FNS_FORMAT_STRING) : '')
5585-
.replaceAll('{report:status}', report.statusNum !== undefined ? getHumanReadableStatus(report.statusNum) : '')
5586-
.replaceAll('{user:email}', currentUserEmail ?? '')
5587-
.replaceAll('{user:email|frontPart}', (currentUserEmail ? currentUserEmail.split('@').at(0) : '') ?? '')
5588-
.replaceAll(/\{report:(.+)}/g, '');
5578+
.replaceAll(/\{report:type\}/gi, 'Expense Report')
5579+
.replaceAll(/\{report:startdate\}/gi, createdDate ? format(createdDate, CONST.DATE.FNS_FORMAT_STRING) : '')
5580+
.replaceAll(/\{report:total\}/gi, report.total !== undefined ? convertToDisplayString(Math.abs(report.total), report.currency).toString() : '')
5581+
.replaceAll(/\{report:currency\}/gi, report.currency ?? '')
5582+
.replaceAll(/\{report:policyname\}/gi, policy?.name ?? '')
5583+
.replaceAll(/\{report:workspacename\}/gi, policy?.name ?? '')
5584+
.replaceAll(/\{report:created\}/gi, createdDate ? format(createdDate, CONST.DATE.FNS_DATE_TIME_FORMAT_STRING) : '')
5585+
.replaceAll(/\{report:created:yyyy-MM-dd\}/gi, createdDate ? format(createdDate, CONST.DATE.FNS_FORMAT_STRING) : '')
5586+
.replaceAll(/\{report:status\}/gi, report.statusNum !== undefined ? getHumanReadableStatus(report.statusNum) : '')
5587+
.replaceAll(/\{user:email\}/gi, currentUserEmail ?? '')
5588+
.replaceAll(/\{user:email\|frontPart\}/gi, (currentUserEmail ? currentUserEmail.split('@').at(0) : '') ?? '')
5589+
.replaceAll(/\{report:(.+)\}/gi, '');
55895590

55905591
return result.trim().length ? result : formula;
55915592
}

0 commit comments

Comments
 (0)