-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
Conversation
@aimane-chnaif @chiragsalian One of you needs to copy/paste the Reviewer Checklist from here into a new comment on this PR and complete it. If you have the K2 extension, you can simply click: [this button] |
src/libs/ReportActionsUtils.js
Outdated
@@ -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)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should use startsWith instead of a regex. (https://www.measurethat.net/Benchmarks/Show/4797/1/js-regex-vs-startswith-vs-indexof#latest_results_block)
There was a problem hiding this comment.
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
Does this require C+ review? |
@aimane-chnaif I'm not sure that you'll be able to test this PR. You can always review the code though |
Reviewer Checklist
Screenshots/VideosWebMobile Web - ChromeMobile Web - SafariDesktopiOSAndroid |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
policychangelog messages can be grouped or not?
App/src/libs/ReportActionsUtils.js
Lines 120 to 124 in 61726eb
// Do not group if previous or current action was a renamed action | |
if (previousAction.actionName === CONST.REPORT.ACTIONS.TYPE.RENAMED | |
|| currentAction.actionName === CONST.REPORT.ACTIONS.TYPE.RENAMED) { | |
return false; | |
} |
@aimane-chnaif - Yes they can. So no need to worry about that part. |
@yuwenmemon I don't see the styling issue. Do you have more specific reproducible steps? |
And maybe add automated tests in |
@aimane-chnaif these are system messages and users should not be able to delete or react to them. The only context actions available are |
I am heard systematic messages also accept reactions. |
We might have to change the way these messages are stored in the backend if we want to support reactions cc @yuwenmemon |
Are policy change logs in chats not reportActions? I personally like the ability to react to changes like people joining/leaving channels in slack, I think it is a fun way to interact. |
@luacmartins latest updates should show context menu like this, correct? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good just one comment!
src/CONST.js
Outdated
@@ -337,6 +337,48 @@ const CONST = { | |||
IOU: 'IOU', | |||
RENAMED: 'RENAMED', | |||
CHRONOSOOOLIST: 'CHRONOSOOOLIST', | |||
POLICYCHANGELOG: { | |||
POLICYCHANGELOG_UPDATE_NAME: 'POLICYCHANGELOG_UPDATE_NAME', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The POLICYCHANGELOG_
prefix here is kind of redundant - can we remove them everywhere in this object?
@chiragsalian all urs |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code LGTM 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM too, though not able to test 🙂
🎯 @aimane-chnaif, thanks for reviewing and testing this PR! 🎉 An E/App issue has been created to issue payment here: #16622. |
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
🚀 Deployed to staging by https://github.com/chiragsalian in version: 1.2.91-0 🚀
|
🚀 Deployed to production by https://github.com/luacmartins in version: 1.2.91-1 🚀
|
Details
Allow workspace changes to be displayed in NewDot
cc @yuwenmemon
Fixed Issues
$ https://github.com/Expensify/Expensify/issues/267615
Tests
Setup:
Policy > People > Approval mode
and change the approval modeupdated the Approval Mode from "Submit and Close" to "Submit and Approve"
policy change messageOffline tests
N/A
QA Steps
N/A
PR Author Checklist
### Fixed Issues
section aboveTests
sectionOffline steps
sectionQA steps
sectiontoggleReport
and notonIconClick
)src/languages/*
files and using the translation methodWaiting for Copy
label for a copy review on the original GH to get the correct copy.STYLE.md
) were followedAvatar
, I verified the components usingAvatar
are working as expected)/** comment above it */
this
properly so there are no scoping issues (i.e. foronClick={this.submit}
the methodthis.submit
should be bound tothis
in the constructor)this
are necessary to be bound (i.e. avoidthis.submit = this.submit.bind(this);
ifthis.submit
is never passed to a component event handler likeonClick
)StyleUtils.getBackgroundAndBorderStyle(themeColors.componentBG
)Avatar
is modified, I verified thatAvatar
is working as expected in all cases)ScrollView
component to make it scrollable when more elements are added to the page.main
branch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTest
steps.Screenshots/Videos
Web
web.mov
Mobile Web - Chrome
Mobile Web - Safari
Desktop
iOS
Android