Skip to content

Commit

Permalink
Merge pull request #27091 from kursat/main
Browse files Browse the repository at this point in the history
Fix: Web -Workspace - Inconsistency in Workspace Notification for HTML Cha…
  • Loading branch information
marcaaron authored Sep 12, 2023
2 parents 09a264a + bf0fbf9 commit ab6913a
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions src/components/ArchivedReportFooter.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import lodashGet from 'lodash/get';
import React from 'react';
import PropTypes from 'prop-types';
import {withOnyx} from 'react-native-onyx';
import _ from 'lodash';
import CONST from '../CONST';
import Banner from './Banner';
import withLocalize, {withLocalizePropTypes} from './withLocalize';
Expand Down Expand Up @@ -60,15 +61,25 @@ function ArchivedReportFooter(props) {
oldDisplayName = PersonalDetailsUtils.getDisplayNameOrDefault(props.personalDetails, [oldAccountID, 'displayName']);
}

const shouldRenderHTML = archiveReason !== CONST.REPORT.ARCHIVE_REASON.DEFAULT;

let policyName = ReportUtils.getPolicyName(props.report);

if (shouldRenderHTML) {
oldDisplayName = _.escape(oldDisplayName);
displayName = _.escape(displayName);
policyName = _.escape(policyName);
}

return (
<Banner
containerStyles={[styles.archivedReportFooter]}
text={props.translate(`reportArchiveReasons.${archiveReason}`, {
displayName: `<strong>${displayName}</strong>`,
oldDisplayName: `<strong>${oldDisplayName}</strong>`,
policyName: `<strong>${ReportUtils.getPolicyName(props.report)}</strong>`,
policyName: `<strong>${policyName}</strong>`,
})}
shouldRenderHTML={archiveReason !== CONST.REPORT.ARCHIVE_REASON.DEFAULT}
shouldRenderHTML={shouldRenderHTML}
shouldShowIcon
/>
);
Expand Down

0 comments on commit ab6913a

Please sign in to comment.