-
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
Add exception for default rooms beta for users who are members of a free policy #9460
Conversation
policies: PropTypes.shape({ | ||
/** The policy name */ | ||
name: PropTypes.string, | ||
}).isRequired, |
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.
policies: PropTypes.shape({ | |
/** The policy name */ | |
name: PropTypes.string, | |
}).isRequired, | |
policies: PropTypes.arrayOf(PropTypes.shape({ | |
/** The policy name */ | |
name: PropTypes.string, | |
})).isRequired, |
I think you have to wrap it in PropTypes.arrayOf
because it is an array of object with that shape, right?
This is used later when calling PolicyUtils.isMemberOfFreePolicy(props.policies)
, which access policy.type
. Should we add the type
property in the described PropTypes.shape
?
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.
Interesting, I haven't seen this being used for the policy
OnyxProp. A couple of examples:
yuwen@MemonbookProExpensify ~/Expensidev/App (yuwen-freePolicyDefaultRooms) App % git grep policies:
src/components/ArchivedReportFooter.js: policies: PropTypes.objectOf(PropTypes.shape({
src/components/ArchivedReportFooter.js: policies: {
src/components/ReportWelcomeText.js: policies: PropTypes.shape({
src/components/ReportWelcomeText.js: policies: {
src/components/RoomNameInput.js: policies: PropTypes.shape({
src/components/RoomNameInput.js: policies: {
src/libs/Navigation/AppNavigator/MainDrawerNavigator.js: policies: PropTypes.shape({
src/libs/Navigation/AppNavigator/MainDrawerNavigator.js: policies: {
src/pages/ReportDetailsPage.js: policies: PropTypes.shape({
src/pages/ReportDetailsPage.js: policies: {
src/pages/ReportSettingsPage.js: policies: PropTypes.shape({
src/pages/ReportSettingsPage.js: policies: {
src/pages/RequestCallPage.js: policies: PropTypes.shape({
src/pages/RequestCallPage.js: policies: {
src/pages/home/HeaderView.js: policies: PropTypes.shape({
src/pages/home/HeaderView.js: policies: {
src/pages/home/ReportScreen.js: policies: PropTypes.shape({
src/pages/home/ReportScreen.js: policies: {
src/pages/home/report/ReportActionItemCreated.js: policies: PropTypes.shape({
src/pages/home/report/ReportActionItemCreated.js: policies: {},
src/pages/home/report/ReportActionItemCreated.js: policies: {
src/pages/settings/InitialSettingsPage.js: policies: PropTypes.objectOf(PropTypes.shape({
src/pages/settings/InitialSettingsPage.js: policies: {},
src/pages/settings/InitialSettingsPage.js: policies: {
src/pages/workspace/WorkspaceNewRoomPage.js: policies: {
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.
And I didn't see any warns from React about the prop type either 🤷♂️
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.
Yeah I noticed that we had it like that in other places, and it made me think that maybe PropTypes.shape
could be equivalent to PropTypes.arrayOf(PropTypes.shape(...)
, but I didn't see anything like that in the documentation
Maybe we have some bug and the check for PropTypes is not working perfectly well?
Anyway, you may consider this as a NAB, but would be good to have a look later and see if our type checks are working as expected
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 believe objectOf
might be more appropriate:
If we look at the Policy action:
App/src/libs/actions/Policy.js
Lines 18 to 27 in 0ceb6a4
Onyx.connect({ | |
key: ONYXKEYS.COLLECTION.POLICY, | |
callback: (val, key) => { | |
if (!val || !key) { | |
return; | |
} | |
allPolicies[key] = {...allPolicies[key], ...val}; | |
}, | |
}); |
... there is a val/key pairing
src/pages/home/ReportScreen.js
Outdated
policies: PropTypes.shape({ | ||
/** The policy name */ | ||
name: PropTypes.string, | ||
}).isRequired, |
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.
policies: PropTypes.shape({ | |
/** The policy name */ | |
name: PropTypes.string, | |
}).isRequired, | |
policies: PropTypes.arrayOf(PropTypes.shape({ | |
/** The policy name */ | |
name: PropTypes.string, | |
})).isRequired, |
Same here
62c4105
to
92ede9b
Compare
Updated! |
Updated! Let's prioritize this as it was mentioned in the all-hands today 👍 |
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!
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
I saw this warning about some of the new "required" props being After trying to reproduce it more consistently, I feel it happens more often when your are logging into a freshly new account (use clitools to create it, and log in), but it still doesn't happen 100% of time... Other similar warnings: None of these warnings cause the app to crash Update: I think I found a way to reproduce it more consistently:
|
Oh hmmm... so it comes from the OldDot -> NewDot workspace connection specifically? |
Nop, it can happen by just logging in, but I saw it was easier to replicate if you do it with the transition. There is probably some race condition |
🚀 Deployed to staging by @yuwenmemon in version: 1.1.78-0 🚀
|
Just to confirm, this still isn't live right? |
Nop, it is just in staging for now |
For additional context @danielrvidal, seems like Google have rejected our latest Android build and that's causing a hold up here. @francoisl has sent an appeal today, and we're waiting to hear back. |
Yeah agreed, we're getting real close. Let's just work through this remaining blocker. |
Where are we at on this one? Is it still failing? |
Thread is here to follow along. Latest is that they've rejected us again. |
Yes, that thread is great. Follow along in #deployer! |
🚀 Deployed to production by @sketchydroide in version: 1.1.78-8 🚀
|
@TomatoToaster please review
Details
Add an exception to the default rooms beta - allows users who are members of a free policy to bypass the beta and see policy rooms, but still not see domain rooms.
Fixed Issues
$ https://github.com/Expensify/Expensify/issues/214193
Tests
change this line to
return false
Log into an account on dev, create some Free Plan policy types. To do this go to the green plus on the bottom left and create a Workspace.
After it's created verify that after creating your workspace you see the default rooms for the workspace show up in the LHN: https://user-images.githubusercontent.com/4741899/173680577-10d77f0f-c3ff-4401-8ff7-01e86d42a281.mp4
Verify that you cannot find the domain room for your domain that you're logged into
Log in via another account that does not belong to a free plan policy (workspace), but belongs to other policies.
Verify that you cannot see any default rooms (policy or domain):
Change that original line back, log in via both accounts, Verify you should be able to see all rooms now (including the domain room)
PR Review Checklist
Contributor (PR Author) Checklist
### Fixed Issues
section aboveTests
sectionQA steps
sectiontoggleReport
and notonIconClick
)src/languages/*
filesSTYLE.md
) were followedAvatar
, I verified the components usingAvatar
are working as expected)/** comment above it */
displayName
propertythis
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)PR Reviewer Checklist
### Fixed Issues
section aboveTests
sectionQA steps
sectiontoggleReport
and notonIconClick
).src/languages/*
filesSTYLE.md
) were followed/** comment above it */
displayName
propertythis
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)QA Steps