-
Notifications
You must be signed in to change notification settings - Fork 3k
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 rename room permission #22316
fix rename room permission #22316
Conversation
@abdulrahuman5196 Please 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] |
@abdulrahuman5196 PR is ready for review! |
/> | ||
</View> | ||
</Form> | ||
<FullPageNotFoundView shouldShow={!Policy.isPolicyOwner(policy) && policy.role !== CONST.POLICY.ROLE.ADMIN}> |
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.
@hungvu193 This is duplicating the room rename permission logic. We should create a util function to have the logic of room rename permission check and use it in both these places.
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.
@abdulrahuman5196 Thank you, I've just fixed it
/> | ||
</View> | ||
</Form> | ||
<FullPageNotFoundView shouldShow={Policy.isPolicyMember(policy)}> |
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.
I was expecting the shouldDisableRename(linkedWorkspace)
function itself to have gone into a util and we should have been using that util here to avoid duplicate logic.
So in future anyone who wants to change the permission, they can just update in the util and it will reflect in both the places.
@hungvu193
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.
@abdulrahuman5196 That makes sense. Do you think we should keep isPolicyMember
function? I think that's helpful too.
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.
I don't think so. It seems to be actually !isPolicyAdmin()
, correct me if wrong. So It seems to be a duplicate.
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.
I think in the future, we will also allow owner and admin to edit the room name. So members aren't owner or admin. That's different.
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.
anw, I 've just pushed the updates again :)
@hungvu193 Room rename option should be disabled even in offline mode on the room details page. Kindly update the offline tests accordingly |
Reviewer Checklist
Screenshots/VideosWebScreen.Recording.2023-07-09.at.11.30.52.PM.mp4Mobile Web - Chromeaz_recorder_20230709_234436.mp4Mobile Web - SafariUntitled.2.mp4DesktopScreen.Recording.2023-07-09.at.11.50.42.PM.mp4iOSScreen.Recording.2023-07-09.at.11.54.23.PM.mp4Androidaz_recorder_20230710_001224.mp4 |
@@ -27,12 +29,20 @@ const propTypes = { | |||
|
|||
/** All reports shared with the user */ | |||
reports: PropTypes.objectOf(reportPropTypes), | |||
|
|||
/** */ |
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.
/** */ | |
/** Policy of the report for which the name is being edited */ |
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.
@hungvu193 Kindly add proper comment for the policy
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.
Oops my bad. Updated!
@@ -27,12 +29,20 @@ const propTypes = { | |||
|
|||
/** All reports shared with the user */ | |||
reports: PropTypes.objectOf(reportPropTypes), | |||
|
|||
/** */ |
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.
@hungvu193 Kindly add proper comment for the policy
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.
Changes looks good and works well. Reviewers checklist is also complete.
All yours @chiragsalian
🎀 👀 🎀
C+ Reviewed
@chiragsalian @abdulrahuman5196 Can we push this one before it reached 9 days penalty 😢 |
NAB: @hungvu193 Kindly update the author's checklist Offline test to reflect "Same as tests", since this change is expected to work in offline 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.
Tested changes again and looks good and works well. Reviewers checklist is also complete again.
All yours @chiragsalian. Good to merge.
🎀 👀 🎀
C+ Reviewed
@hungvu193 It seems there is new merge conflicts on this PR |
@abdulrahuman5196 I've just updated! |
@hungvu193 After recent merge I am unable to rename a room, only showing page not found view? Can we check and fix this? Screen.Recording.2023-07-18.at.3.43.09.AM.mp4 |
Oh my bad, that's merge issue. Fixed again @abdulrahuman5196. Screen.Recording.2023-07-18.at.06.41.23.mov |
Reviewer Checklist
Screenshots/VideosWebScreen.Recording.2023-07-18.at.3.57.15.PM.mp4Mobile Web - Chromeaz_recorder_20230718_160624.mp4Mobile Web - SafariUntitled.mp4DesktopScreen.Recording.2023-07-18.at.5.12.46.PM.mp4iOSScreen.Recording.2023-07-18.at.5.26.08.PM.mp4Androidaz_recorder_20230718_173435.mp4 |
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.
Changes looks good and works well. Reviewers checklist is also complete.
All yours. @chiragsalian Good to merge since it was already approved. It would be good to merge this soon if no other issue to avoid merge conflicts again.
🎀 👀 🎀
C+ Reviewed
NAB: @hungvu193 Kindly update this as well. |
Thanks for pointing that out 😄 . Updated |
✋ 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/Julesssss in version: 1.3.43-0 🚀
|
🚀 Deployed to staging by https://github.com/Julesssss in version: 1.3.43-0 🚀
|
🚀 Deployed to staging by https://github.com/Julesssss in version: 1.3.44-0 🚀
|
🚀 Deployed to production by https://github.com/jasperhuangg in version: 1.3.43-7 🚀
|
🚀 Deployed to production by https://github.com/marcaaron in version: 1.3.44-2 🚀
|
Details
Fix rename room permission
Fixed Issues
$ #21498
PROPOSAL: #21498 (comment)
Tests
Offline tests
Same as Tests.
QA Steps
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
Web
Screen.Recording.2023-07-06.at.12.02.14.mov
Mobile Web - Chrome
RPReplay_Final1688620024.MP4
Mobile Web - Safari
RPReplay_Final1688620024.MP4
Desktop
Screen.Recording.2023-07-06.at.12.29.32.mov
IOS
Screen.Recording.2023-07-06.at.12.25.51.mov
Android
Screen.Recording.2023-07-06.at.12.41.21.mov