-
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
Don't allow removing the policy owner from workspace members #5582
Conversation
@@ -169,17 +183,32 @@ class WorkspacePeoplePage extends React.Component { | |||
renderItem({ | |||
item, | |||
}) { | |||
const initialDimensions = Dimensions.get('window'); | |||
const isSmallScreenWidth = initialDimensions.width <= variables.mobileResponsiveWidthBreakpoint; | |||
const isMobileDevice = getPlatform() === CONST.PLATFORM.ANDROID || getPlatform() === CONST.PLATFORM.IOS || isSmallScreenWidth; |
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.
Reminder for us to test this on iPad, as I'm not sure whether isSmallScreenWidth
will include large iPads.
@tgolen I moved it to a component like you mentioned, but I encountered the following roadblocks and maybe it's just that I am not super strong in React Native:
Any advice on how I could solve these problems? |
OK, let's see if I can help here. For the first problem, I would start with changing the onpress handler to be more like this: - onPress={canBeRemoved ? () => this.toggleUser(item.login) : () => {}}
+ onPress={() => this.toggleUser(item.login)} Then update toggleuser to be more like this:
Then finally update the checkbox component: - toggleTooltip={!canBeRemoved}
+ toggleTooltip={this.state.showTooltipForLogin === login} Would that work? For your second issue, I don't think I am understanding the problem. There shouldn't be anything specific to mobile web for showing a growl and you can just use |
@tgolen Let me explain again, so mobile browsers on phones use index.js and not index.native.js, so it will try to show a tooltip as well, but it won't work. The only way to do this (I think) would be to check for the dimensions. But then I feel I would be repeating most of the code from index.js to index.native.js |
Oh, got it. Yeah, that mobile web issue isn't great. It would be pretty cool to have an |
Ok! Updated!! Everything is working except for a small bug on Web that I am not sure how to fix, I tried multiple things but nothing works. We only show the tooltip depending on |
Hm, no... I don't have any idea about that. Could you post that in the open source channel on slack and see if someone else might know? |
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.
Those changes to the component look great!
src/components/CheckboxWithTooltip/CheckboxWithTooltipForMobileWebAndNative.js
Outdated
Show resolved
Hide resolved
src/components/CheckboxWithTooltip/CheckboxWithTooltipForMobileWebAndNative.js
Show resolved
Hide resolved
src/components/CheckboxWithTooltip/CheckboxWithTooltipForMobileWebAndNative.js
Outdated
Show resolved
Hide resolved
src/components/CheckboxWithTooltip/CheckboxWithTooltipForMobileWebAndNative.js
Outdated
Show resolved
Hide resolved
src/components/CheckboxWithTooltip/CheckboxWithTooltipForMobileWebAndNative.js
Show resolved
Hide resolved
src/components/CheckboxWithTooltip/CheckboxWithTooltipPropTypes.js
Outdated
Show resolved
Hide resolved
I fixed the bug!! I had a revelation this morning to use hoverable to fix the tooltip so it would work not only on press! Mobiles devices don't have hoverables, so win-win. Ready for another review, I replied to your two remaining comments. |
Updated! |
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.
It's working well on all platforms, but I noticed that we're showing the Growl on hover when the website window is 'small'. I think this is not expected, right? In this case, shouldn't we just display the growl on touch? This doesn't seem to occur on Desktop.
WebHover.mov
That's a consequence of not being able to tell between a mobile browser from a computer browser, I couldn't find any other solution and I tried a lot of things, but if I remove the hoverable, then the tooltip stops working on normal web browsers and desktop. |
@Julesssss had an idea to fix the weird bug and it worked!! So updated again with the small changes |
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.
👍
Can we merge this? It was a n6 polish issue so I am assuming yes? |
I double-checked on Slack, n6 polish issues are ok to merge so self-merging since everyone approved. |
✋ 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 production by @roryabraham in version: 1.1.8-9 🚀
|
Details
Disable the checkbox and shows a tooltip if the admin tries to remove the owner or themselves from the workspace.
Fixed Issues
$ https://github.com/Expensify/Expensify/issues/179467
Tests / QA
Select All
button and make sure it still works, it should select all users except for the above.Tested On
Screenshots
Web
Mobile Web
Desktop
iOS
Android