-
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
Fix/19987: Prioritize using name of policy from policy #20498
Conversation
@puneetlath @allroundexperts 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] |
Reviewer Checklist
Screenshots/VideosWebScreen.Recording.2023-06-12.at.12.26.52.AM.movMobile Web - ChromeScreen.Recording.2023-06-12.at.12.32.41.AM.movMobile Web - SafariScreen.Recording.2023-06-12.at.12.32.05.AM.movDesktopScreen.Recording.2023-06-12.at.12.30.54.AM.moviOSScreen.Recording.2023-06-12.at.12.34.59.AM.movAndroidScreen.Recording.2023-06-12.at.12.33.37.AM.mov |
src/libs/ReportUtils.js
Outdated
// Public rooms send back the policy name with the reportSummary, | ||
// since they can also be accessed by people who aren't in the workspace |
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.
@dukenv0307 Can you move this comment as well?
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.
@allroundexperts Just updated. I think we only should comment in the first place.
@dukenv0307 Any update on the outstanding comments? |
@allroundexperts I just updated above |
|
@allroundexperts it's so weird, I don't see your comment. Could you help to check again? |
src/libs/ReportUtils.js
Outdated
if (!policy) { | ||
if (report.policyName) { | ||
return report.policyName; | ||
} | ||
return report.oldPolicyName || Localize.translateLocal('workspace.common.unavailable'); | ||
} |
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.
This can be removed as well and replaced by:
return _.get(report, 'policyName') || _.get(policy, 'name') || _.get(report, 'oldPolicyName') || Localize.translateLocal('workspace.common.unavailable')
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.
@allroundexperts I just tested and see that this change will not work because we only should return report.policyName;
if policy is falsy. So I think we should remain this code
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.
But we're sort of repeating the condition I mentioned above. Can you look for a way with which we don't repeat the code?
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.
@allroundexperts Just updated. Could you help to check last commit? Thanks
@dukenv0307 My bad. I forgot to submit the review. Please confirm if you can see it now. |
src/libs/ReportUtils.js
Outdated
if (!policy) { | ||
return report.oldPolicyName || Localize.translateLocal('workspace.common.unavailable'); | ||
// Public rooms send back the policy name with the reportSummary, | ||
// since they can also be accessed by people who aren't in the workspace | ||
if (report.policyName) { | ||
return report.policyName; | ||
} | ||
} else if (policy.name) { | ||
return policy.name; | ||
} | ||
|
||
return policy.name || report.oldPolicyName || Localize.translateLocal('workspace.common.unavailable'); | ||
return report.oldPolicyName || Localize.translateLocal('workspace.common.unavailable'); |
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.
@dukenv0307 Can't we replace above with:
return lodashGet(policy, 'name') || report.policyName || report.oldPolicyName || Localize.translateLocal('workspace.common.unavailable')
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.
@allroundexperts I Just updated. It works well
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.
Awesome. Thanks!
if ((!allPolicies || _.size(allPolicies) === 0) && !report.policyName) { | ||
return Localize.translateLocal('workspace.common.unavailable'); | ||
} |
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.
Is this needed @dukenv0307?
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.
Oh, I see now that its needed. Else, we might show an old report 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.
Looks good!
@puneetlath All yours |
@puneetlath Bump, Could you help to check this PR |
✋ 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/puneetlath in version: 1.3.30-0 🚀
|
🚀 Deployed to production by https://github.com/luacmartins in version: 1.3.30-5 🚀
|
Details
Workspace name does not change when the room is set to "Public" because we use report.policyName first if it exists and when policy name is updated the BE doesn't update report.policyName. So we fix it by using name of policy from policy first
Fixed Issues
$ #19987
PROPOSAL: #19987 (comment)
Tests
Offline tests
same above
QA Steps
PR Author Checklist
### Fixed Issues
section aboveTests
sectionOffline steps
sectionQA steps
sectiontoggleReport
and notonIconClick
)myBool && <MyComponent />
.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
Screen.Recording.2023-06-09.at.10.55.13.mp4
Mobile Web - Chrome
351827083_6514837461911474_1151533270012611305_n.mp4
Mobile Web - Safari
Screen.Recording.2023-06-09.at.10.58.30.mp4
Desktop
Screen.Recording.2023-06-09.at.11.05.54.mov
iOS
Screen.Recording.2023-06-09.at.11.23.34.mp4
Android
Screen.Recording.2023-06-09.at.11.37.32.1.mp4