Skip to content
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
4 changes: 4 additions & 0 deletions src/libs/ModifiedExpenseMessage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,10 @@ function getPolicyRulesModifiedMessage(translate: LocalizedTranslate, fields: Po
if (key === 'tag') {
return translate('iou.policyRulesModifiedFields.common', key, getCommaSeparatedTagNameWithSanitizedColons(updatedValue), isFirst);
}
// The backend saves the description field as `comment` key, but we need to display it as `description` key.
if (key === 'comment') {
return translate('iou.policyRulesModifiedFields.common', 'description', Parser.htmlToMarkdown(updatedValue), isFirst);
}

return translate('iou.policyRulesModifiedFields.common', key, updatedValue, isFirst);
});
Expand Down
5 changes: 4 additions & 1 deletion src/types/onyx/OriginalMessage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -845,7 +845,10 @@ type PolicyRulesModifiedFields = {
/** The value that the tag was changed to */
tag?: string;

/** The value that the description was changed to */
/** The value that the description was changed to (backend uses "comment" key) */
comment?: string;

/** The value that the description was changed to (display key, mapped from "comment") */
Comment on lines +848 to +851

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@luacmartins bit confused, what is stored in description vs comment?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Agreed, why do we have this?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Now you understand why this is needed while working on #82429?

description?: string;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

If description doesn't exist in Onyx data, maybe remove it?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

It's a type thing. We can remove it, but we'll have to update the translation types.


/** The value that the billable status was changed to */
Expand Down
Loading