From 2cd3a4a9dabd143a155e109ed6fc2a692d17e7c5 Mon Sep 17 00:00:00 2001 From: Cristi Paval Date: Fri, 22 Dec 2023 01:12:00 +0200 Subject: [PATCH 1/2] Parse welcomeNote before sending to Web --- src/libs/actions/Policy.js | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/libs/actions/Policy.js b/src/libs/actions/Policy.js index f33e6637e2de..0cf31d8b5666 100644 --- a/src/libs/actions/Policy.js +++ b/src/libs/actions/Policy.js @@ -18,6 +18,7 @@ import * as ReportUtils from '@libs/ReportUtils'; import * as TransactionUtils from '@libs/TransactionUtils'; import CONST from '@src/CONST'; import ONYXKEYS from '@src/ONYXKEYS'; +import ExpensiMark from 'expensify-common/lib/ExpensiMark'; const allPolicies = {}; Onyx.connect({ @@ -601,10 +602,7 @@ function addMembersToWorkspace(invitedEmailsToAccountIDs, welcomeNote, policyID) const params = { employees: JSON.stringify(_.map(logins, (login) => ({email: login}))), - - // Do not escape HTML special chars for welcomeNote as this will be handled in the backend. - // See https://github.com/Expensify/App/issues/20081 for more details. - welcomeNote, + welcomeNote: new ExpensiMark().replace(welcomeNote), policyID, }; if (!_.isEmpty(membersChats.reportCreationData)) { From 3be2115c18707b373817d25608e7a307320ce921 Mon Sep 17 00:00:00 2001 From: Cristi Paval Date: Fri, 22 Dec 2023 01:25:59 +0200 Subject: [PATCH 2/2] Run prettier --- src/libs/actions/Policy.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libs/actions/Policy.js b/src/libs/actions/Policy.js index 0cf31d8b5666..da5580c19bfd 100644 --- a/src/libs/actions/Policy.js +++ b/src/libs/actions/Policy.js @@ -1,4 +1,5 @@ import {PUBLIC_DOMAINS} from 'expensify-common/lib/CONST'; +import ExpensiMark from 'expensify-common/lib/ExpensiMark'; import Str from 'expensify-common/lib/str'; import {escapeRegExp} from 'lodash'; import filter from 'lodash/filter'; @@ -18,7 +19,6 @@ import * as ReportUtils from '@libs/ReportUtils'; import * as TransactionUtils from '@libs/TransactionUtils'; import CONST from '@src/CONST'; import ONYXKEYS from '@src/ONYXKEYS'; -import ExpensiMark from 'expensify-common/lib/ExpensiMark'; const allPolicies = {}; Onyx.connect({