-
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
Restrict workspace settings to admins #22820
Conversation
@mollfpr Here are answers to potential concerns you might have:
|
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.
@esh-g I don't think we need to refactor the policy prop-types. If you need it in the ReportWelcomeMessagePage
and WriteCapibilityPage
, you can export it from withPolicy
.
App/src/components/AvatarWithIndicator.js
Lines 34 to 35 in 12d8a3f
/** All the user's policies (from Onyx via withFullPolicy) */ | |
policies: PropTypes.objectOf(policyPropTypes.policy), |
@@ -38,9 +51,11 @@ function WriteCapabilityPage(props) { | |||
boldStyle: value === (props.report.writeCapability || CONST.REPORT.WRITE_CAPABILITIES.ALL), | |||
})); | |||
|
|||
const canAccess = !ReportUtils.isAdminRoom(props.report) && PolicyUtils.isPolicyAdmin(props.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.
Boolean variables and props
- Boolean props or variables must be prefixed with
should
oris
to make it clear that they areBoolean
. Useshould
when we are enabling or disabling some features andis
in most other cases.
I think we should rename it with the is
prefix.
Reviewer Checklist
Screenshots/VideosWeb22820.Web.movMobile Web - Chrome22820.mWeb.Chrome.webmMobile Web - Safari22820.mWeb.Safari.mp4Desktop22820.Desktop.moviOS22820.iOS.mp4Android22820.Android.webm |
@esh-g I got prop-types error on opening |
@mollfpr Applied all the suggested changes... Hope it looks good now 😇 |
For natives, you can open the page with the deep-link URL in the chat. https://staging.new.expensify.com/r/4459906896589398/welcomeMessage https://staging.new.expensify.com/r/8000629965504300/settings/who-can-post |
Okay @mollfpr, Adding the videos now.. |
We have 2 cases for the welcome message page and 3 for the who can post page. ✅ The page will open Welcome message page:
Who can post a page
We should add all the cases to the test step. |
@mollfpr I have edited the test steps. Please confirm they are as expected and I'll attach all the videos tomorrow morning as soon as possible. (Got a lot of testing to do 6 devices x 5 tests 😅). But I still hope we can get this merged tomorrow |
@esh-g No worries! I think we can change how to test this; instead of modifying the URL, we can just prepare a chat that has all the links for each test case. But let's take that for tomorrow. |
@mollfpr I have updated the tests and the test videos. I hope they are up to the mark but please feel free to point out any suggestions you have! 😇 |
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 and tests 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.
Code and QA tests/Screenshots LGTM! Thank you
✋ 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/grgia in version: 1.3.42-0 🚀
|
🚀 Deployed to production by https://github.com/jasperhuangg in version: 1.3.42-26 🚀
|
Details
Fixed Issues
$ #22013
PROPOSAL: #22013 (comment)
Tests
Test Setup
Therefore, B is admin in workspace B and not an admin in workspace A.
Now we need to prepare a chat with deep links to the correct page for testing. This setup can be done once on web, and then can be tested on other platforms with the same account.
✅ The page will open
❌ The not found page will be open
Refer to the 'Test Setup (Web)' in the screenshots section to make sure steps are followed correctly.
We first need to copy the
reportID
of #announce of workspace A and workspace B then also #admin of workspace B. This can be done by opening the room and then copying the number in the URLlocalhost:8080/r/[reportID]
.[#announce B]
means thereportID
of the #announce room of workspace B. The same format applies for all otherreportID
s copied.Go to any chat on account B.
Add a comment 'Welcome message as admin' and add a link like this:
https://staging.new.expensify.com/r/[#announce B]/welcomeMessage
✅Add another comment 'Welcome message not as admin' and add a link like this:
https://staging.new.expensify.com/r/[#announce A]/welcomeMessage
. ❌Add another comment 'Who can post (in #admin)' and add this a link like this:
https://staging.new.expensify.com/r/[#admin B]/settings-who-can-post
. ❌Add another comment 'Who can post (as admin)' and add a link like this:
https://staging.new.expensify.com/r/[#announce B]/settings/who-can-post
. ✅Add another comment 'Who can post (not as admin)' and add a link like this:
https://staging.new.expensify.com/r/[#announce A]/settings/who-can-post
. ❌Click on each link and verify that it opens correctly according to ✅ and ❌.
Offline tests
QA Steps
Test Setup
Therefore, B is admin in workspace B and not an admin in workspace A.
Now we need to prepare a chat with deep links to the correct page for testing. This setup can be done once on web, and then can be tested on other platforms with the same account.
✅ The page will open
❌ The not found page will be open
Refer to the 'Test Setup (Web)' in the screenshots section to make sure steps are followed correctly.
We first need to copy the
reportID
of #announce of workspace A and workspace B then also #admin of workspace B. This can be done by opening the room and then copying the number in the URLstaging.new.expensify.com/r/[reportID]
.[#announce B]
means thereportID
of the #announce room of workspace B. The same format applies for all otherreportID
s copied.Go to any chat on account B.
Add a comment 'Welcome message as admin' and add a link like this:
https://staging.new.expensify.com/r/[#announce B]/welcomeMessage
✅Add another comment 'Welcome message not as admin' and add a link like this:
https://staging.new.expensify.com/r/[#announce A]/welcomeMessage
. ❌Add another comment 'Who can post (in #admin)' and add this a link like this:
https://staging.new.expensify.com/r/[#admin B]/settings-who-can-post
. ❌Add another comment 'Who can post (as admin)' and add a link like this:
https://staging.new.expensify.com/r/[#announce B]/settings/who-can-post
. ✅Add another comment 'Who can post (not as admin)' and add a link like this:
https://staging.new.expensify.com/r/[#announce A]/settings/who-can-post
. ❌Click on each link and verify that it opens correctly according to ✅ and ❌.
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
Test Setup (Web)
Web
Screen.Recording.2023-07-15.at.10.41.20.AM.mov
Mobile Web - Chrome
Screen.Recording.2023-07-15.at.10.58.59.AM-1.mov
Mobile Web - Safari
Screen.Recording.2023-07-15.at.10.46.20.AM-1.mov
Desktop
Screen.Recording.2023-07-15.at.10.49.27.AM.mov
iOS
Screen.Recording.2023-07-15.at.10.51.09.AM-1.mov
Android
Screen.Recording.2023-07-15.at.10.58.24.AM-1.mov