Skip to content
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 screen position for server / login / forgot password & mfa #8340

Merged
merged 4 commits into from
Nov 19, 2024
Merged

Conversation

enahum
Copy link
Contributor

@enahum enahum commented Nov 13, 2024

Summary

Fixes the scrolling of the contents of the following screens on iPhone, iPad & Android as part of broken window fixes

  • Server
  • Login
  • Forgot password
  • MFA

Ticket Link

https://mattermost.atlassian.net/browse/MM-56150

Fixes: #8291

Release Note

NONE

@enahum enahum added 2: Dev Review Requires review by a core commiter 2: UX Review Requires review by a UX Designer labels Nov 13, 2024
Copy link
Contributor

@larkox larkox left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, just one potential improvement.

app/screens/mfa/index.tsx Outdated Show resolved Hide resolved
@enahum enahum requested a review from larkox November 13, 2024 10:54
Copy link
Contributor

@larkox larkox left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Beautiful!

@matthewbirtch matthewbirtch added the Build Apps for PR Build the mobile app for iOS and Android to test label Nov 15, 2024

useEffect(() => {
let offsetY = height / dimisher;
if (offsetY < 80) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: Can we make the magic number of 80 into a constant with proper variable naming?

like

const KEYBOARD_OFFSET_HEIGHT = 80;

@@ -270,7 +256,7 @@ const ForgotPassword = ({componentId, serverUrl, theme}: Props) => {
const unsubscribe = Navigation.events().registerComponentListener(listener, componentId);

return () => unsubscribe.remove();
}, [dimensions]);
}, [componentId, dimensions, translateX]);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
}, [componentId, dimensions, translateX]);
// eslint-disable-next-line react-hooks/exhaustive-deps treat translateX.value like useRef
}, [componentId, dimensions.width]);

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor

@matthewbirtch matthewbirtch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @enahum. Looks like this resolves the issue!

I was unable to test the MFA screen, because as soon as I enabled it and enforced it in the system console, I'm getting a 'No teams are available to join' screen after logging in. I'm assuming this is not related to this specific PR though.

@enahum
Copy link
Contributor Author

enahum commented Nov 18, 2024

@matthewbirtch is not related to this PR but here is the thing, I can tell you for a fact that enforcing the MFA before the user has logged in, on mobile is not implemented, so the server will return the error and the mobile app will not handle it by requesting the MFA from the user. so you can try it if you enable MFA before logging in.

Yes, we should create a ticket when MFA is enforced after the user has logged in.

@enahum
Copy link
Contributor Author

enahum commented Nov 18, 2024

@matthewbirtch
Copy link
Contributor

@matthewbirtch is not related to this PR but here is the thing, I can tell you for a fact that enforcing the MFA before the user has logged in, on mobile is not implemented, so the server will return the error and the mobile app will not handle it by requesting the MFA from the user. so you can try it if you enable MFA before logging in.

Yes, we should create a ticket when MFA is enforced after the user has logged in.

Yep, confirmed I was able to test the MFA token screen now after going through he MFA setup on webapp first.

I'll create a ticket for adding this MFA setup screen to the mobile flow.

@enahum enahum added 4: Reviews Complete All reviewers have approved the pull request and removed 2: Dev Review Requires review by a core commiter 2: UX Review Requires review by a UX Designer labels Nov 19, 2024
@enahum enahum merged commit 37fd160 into main Nov 19, 2024
12 checks passed
@enahum enahum deleted the MM-56150 branch November 19, 2024 00:36
@amyblais amyblais added this to the v2.24.0 milestone Nov 25, 2024
larkox pushed a commit that referenced this pull request Nov 26, 2024
* fix screen position for server / login / forgot password & mfa

* refactor to use a hook

* fix scroll to offset not to height

* feedback review
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
4: Reviews Complete All reviewers have approved the pull request Build Apps for PR Build the mobile app for iOS and Android to test release-note-none
Projects
None yet
Development

Successfully merging this pull request may close these issues.

virtual keyboard blocking input field for mfa login on android phone
6 participants