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 all 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
42 changes: 42 additions & 0 deletions src/CONST.js
Original file line number Diff line number Diff line change
Expand Up @@ -337,6 +337,48 @@ const CONST = {
IOU: 'IOU',
RENAMED: 'RENAMED',
CHRONOSOOOLIST: 'CHRONOSOOOLIST',
POLICYCHANGELOG: {
UPDATE_NAME: 'POLICYCHANGELOG_UPDATE_NAME',
UPDATE_CURRENCY: 'POLICYCHANGELOG_UPDATE_CURRENCY',
UPDATE_OWNERSHIP: 'POLICYCHANGELOG_UPDATE_OWNERSHIP',
UPDATE_AUTOHARVESTING: 'POLICYCHANGELOG_UPDATE_AUTOHARVESTING',
UPDATE_AUTOREPORTING_FREQUENCY: 'POLICYCHANGELOG_UPDATE_AUTOREPORTING_FREQUENCY',
UPDATE_DEFAULT_TITLE_ENFORCED: 'POLICYCHANGELOG_UPDATE_DEFAULT_TITLE_ENFORCED',
UPDATE_REPORT_FIELD: 'POLICYCHANGELOG_UPDATE_REPORT_FIELD',
ADD_REPORT_FIELD: 'POLICYCHANGELOG_ADD_REPORT_FIELD',
DELETE_REPORT_FIELD: 'POLICYCHANGELOG_DELETE_REPORT_FIELD',
UPDATE_DEFAULT_TITLE: 'POLICYCHANGELOG_UPDATE_DEFAULT_TITLE',
ADD_CATEGORY: 'POLICYCHANGELOG_ADD_CATEGORY',
DELETE_CATEGORY: 'POLICYCHANGELOG_DELETE_CATEGORY',
SET_CATEGORY_NAME: 'POLICYCHANGELOG_SET_CATEGORY_NAME',
UPDATE_CATEGORY: 'POLICYCHANGELOG_UPDATE_CATEGORY',
ADD_TAG: 'POLICYCHANGELOG_ADD_TAG',
UPDATE_TAG: 'POLICYCHANGELOG_UPDATE_TAG',
DELETE_TAG: 'POLICYCHANGELOG_DELETE_TAG',
UPDATE_TAG_NAME: 'POLICYCHANGELOG_UPDATE_TAG_NAME',
UPDATE_TAG_LIST_NAME: 'POLICYCHANGELOG_UPDATE_TAG_LIST_NAME',
IMPORT_TAGS: 'POLICYCHANGELOG_IMPORT_TAGS',
DELETE_ALL_TAGS: 'POLICYCHANGELOG_DELETE_ALL_TAGS',
ADD_APPROVER_RULE: 'POLICYCHANGELOG_ADD_APPROVER_RULE',
UPDATE_APPROVER_RULE: 'POLICYCHANGELOG_UPDATE_APPROVER_RULE',
DELETE_APPROVER_RULE: 'POLICYCHANGELOG_DELETE_APPROVER_RULE',
ADD_EMPLOYEE: 'POLICYCHANGELOG_ADD_EMPLOYEE',
DELETE_EMPLOYEE: 'POLICYCHANGELOG_DELETE_EMPLOYEE',
UPDATE_EMPLOYEE: 'POLICYCHANGELOG_UPDATE_EMPLOYEE',
SET_AUTO_JOIN: 'POLICYCHANGELOG_SET_AUTO_JOIN',
ADD_INTEGRATION: 'POLICYCHANGELOG_ADD_INTEGRATION',
DELETE_INTEGRATION: 'POLICYCHANGELOG_DELETE_INTEGRATION',
UPDATE_ACH_ACCOUNT: 'POLICYCHANGELOG_UPDATE_ACH_ACCOUNT',
UPDATE_REIMBURSEMENT_CHOICE: 'POLICYCHANGELOG_UPDATE_REIMBURSEMENT_CHOICE',
SET_AUTOREIMBURSEMENT: 'POLICYCHANGELOG_SET_AUTOREIMBURSEMENT',
ADD_CUSTOM_UNIT: 'POLICYCHANGELOG_ADD_CUSTOM_UNIT',
DELETE_CUSTOM_UNIT: 'POLICYCHANGELOG_DELETE_CUSTOM_UNIT',
UPDATE_CUSTOM_UNIT: 'POLICYCHANGELOG_UPDATE_CUSTOM_UNIT',
UPDATE_CUSTOM_UNIT_RATE: 'POLICYCHANGELOG_UPDATE_CUSTOM_UNIT_RATE',
ADD_CUSTOM_UNIT_RATE: 'POLICYCHANGELOG_ADD_CUSTOM_UNIT_RATE',
DELETE_CUSTOM_UNIT_RATE: 'POLICYCHANGELOG_DELETE_CUSTOM_UNIT_RATE',
UPDATE_FIELD: 'POLICYCHANGELOG_UPDATE_FIELD',
},
},
},
ARCHIVE_REASON: {
Expand Down
2 changes: 1 addition & 1 deletion src/libs/ReportActionsUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ function getSortedReportActionsForDisplay(reportActions) {
const sortedReportActions = getSortedReportActions(filteredReportActions, true);
return _.filter(sortedReportActions, (reportAction) => {
// Filter out any unsupported reportAction types
if (!_.has(CONST.REPORT.ACTIONS.TYPE, reportAction.actionName)) {
if (!_.has(CONST.REPORT.ACTIONS.TYPE, reportAction.actionName) && !_.contains(_.values(CONST.REPORT.ACTIONS.TYPE.POLICYCHANGELOG), 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,
_.contains(_.values(CONST.REPORT.ACTIONS.TYPE.POLICYCHANGELOG), this.props.action.actionName) ? styles.colorMuted : undefined,
]}
/>
) : (
<ReportActionItemMessageEdit
Expand Down
6 changes: 6 additions & 0 deletions tests/unit/ReportActionsUtilsTest.js
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,12 @@ describe('ReportActionsUtils', () => {
},
{
created: '2022-11-09 22:27:01.825',
reportActionID: '8049485084562457',
actionName: CONST.REPORT.ACTIONS.TYPE.POLICYCHANGELOG.UPDATE_FIELD,
message: [{html: 'updated the Approval Mode from "Submit and Approve" to "Submit and Close"'}],
},
{
created: '2022-11-08 22:27:01.825',
reportActionID: '1661970171066218',
actionName: 'REIMBURSED',
message: [{html: 'Hello world'}],
Expand Down