Page MenuHomePhabricator

[native] Introduce `LoggedOutStaffInfo` and display in `LoggedOutModal`
ClosedPublic

Authored by atul on Nov 8 2022, 9:53 AM.
Tags
None
Referenced Files
Unknown Object (File)
Mon, Nov 25, 1:37 AM
Unknown Object (File)
Sun, Nov 24, 6:31 AM
Unknown Object (File)
Tue, Nov 19, 8:59 PM
Unknown Object (File)
Tue, Nov 19, 8:59 PM
Unknown Object (File)
Tue, Nov 19, 8:59 PM
Unknown Object (File)
Tue, Nov 19, 8:59 PM
Unknown Object (File)
Tue, Nov 19, 8:58 PM
Unknown Object (File)
Mon, Nov 4, 3:58 PM
Subscribers

Details

Reviewers
tomek
marcin
varun
ginsu
rohan
ashoat
Group Reviewers
Restricted Owners Package(Owns No Changed Paths)
Commits
rCOMMf78e5b5d9e81: [native] Introduce `LoggedOutStaffInfo` and display in `LoggedOutModal`
Summary

In order to potentially help with troubleshooting, it's helpful to know

A. What sort of build is running (eg staff release/__DEV__)
B. Whether a staff user has logged in (hasStaffUserLoggedIn)

We display the following fields in LoggedOutStaffInfo:

  • __DEV__
  • isStaffRelease
  • hasStaffUserLoggedIn
Test Plan

Looks as expected:

15bd43.png (1×968 px, 1 MB)

Diff Detail

Repository
rCOMM Comm
Branch
arcpatch-D5559 (branched from master)
Lint
No Lint Coverage
Unit
No Test Coverage

Event Timeline

atul edited the test plan for this revision. (Show Details)
atul published this revision for review.Nov 8 2022, 9:56 AM
atul added a reviewer: Restricted Owners Package.Nov 9 2022, 7:19 AM
native/account/logged-out-modal.react.js
473 ↗(On Diff #18217)

Should these conditions just be moved to LoggedOutStaffInfo? That way LoggedOutModal (which is already a huge component) doesn't need to track staffCanSee or staffUserHasBeenLoggedIn. LoggedOutStaffInfo can just return null in those cases. What do you think?

native/account/logged-out-modal.react.js
473 ↗(On Diff #18217)

I thought it made more sense for the container component to have the logic that determines whether a contained component gets displayed, but can make that change to simplify LoggedOutModal

ashoat requested changes to this revision.Nov 9 2022, 8:21 AM

Let's do it... LoggedOutModal is already crazy complicated as-is

This revision now requires changes to proceed.Nov 9 2022, 8:21 AM

address feedback (push down staff hooks to LoggedOutStaffInfo)

native/account/logged-out-modal.react.js
5 ↗(On Diff #18287)

Shouldn't have imported useContext like this to begin with.

cut separate { useContext } import

This revision is now accepted and ready to land.Nov 9 2022, 7:23 PM
This revision was landed with ongoing or failed builds.Nov 9 2022, 7:28 PM
This revision was automatically updated to reflect the committed changes.