Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[No QA] Display policy changes logs in NewDot #16500

Merged
merged 19 commits into from
Mar 28, 2023
Merged
Show file tree
Hide file tree
Changes from 7 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
1 change: 1 addition & 0 deletions src/CONST.js
Original file line number Diff line number Diff line change
Expand Up @@ -337,6 +337,7 @@ const CONST = {
IOU: 'IOU',
RENAMED: 'RENAMED',
CHRONOSOOOLIST: 'CHRONOSOOOLIST',
POLICYCHANGELOG_REGEX: /^POLICYCHANGELOG_/,
},
},
ARCHIVE_REASON: {
Expand Down
5 changes: 5 additions & 0 deletions src/libs/ReportActionsUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,11 @@ function getSortedReportActionsForDisplay(reportActions) {
const filteredReportActions = filterOutDeprecatedReportActions(reportActions);
const sortedReportActions = getSortedReportActions(filteredReportActions, true);
return _.filter(sortedReportActions, (reportAction) => {
// Allow all Policy Change reportActions to be displayed
if (CONST.REPORT.ACTIONS.TYPE.POLICYCHANGELOG_REGEX.test(reportAction.actionName)) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated! But according to that benchmark, we should actually be using indexOf :P

return true;
}

// Filter out any unsupported reportAction types
if (!_.has(CONST.REPORT.ACTIONS.TYPE, reportAction.actionName)) {
return false;
Expand Down
5 changes: 4 additions & 1 deletion src/pages/home/report/ReportActionItem.js
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,10 @@ class ReportActionItem extends Component {
? (
<ReportActionItemMessage
action={this.props.action}
style={(!this.props.displayAsGroup && isAttachment) ? [styles.mt2] : undefined}
style={[
(!this.props.displayAsGroup && isAttachment) ? styles.mt2 : undefined,
CONST.REPORT.ACTIONS.TYPE.POLICYCHANGELOG_REGEX.test(this.props.action.actionName) ? styles.colorMuted : undefined,
luacmartins marked this conversation as resolved.
Show resolved Hide resolved
]}
/>
) : (
<ReportActionItemMessageEdit
Expand Down