-
Notifications
You must be signed in to change notification settings - Fork 3.8k
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
ui: style login page #26066
ui: style login page #26066
Conversation
0e1c6a0
to
893f64d
Compare
cc @josueeee for design review |
with a couple non-blocking nits. Tested locally. Would be good to disable the button while the login api call is happening, and change the text to "signing in..." or something. Spacing in the text box seems a bit excessive: Review status: all files reviewed at latest revision, all discussions resolved, all commit checks successful. pkg/ui/src/views/login/loginPage.tsx, line 67 at r3 (raw file):
Can you add a comment noting why have to look at the response body (generated somewhere in the depths of I'm ok with doing this for now, but we should leave clues for our future selves to fix this. Comments from Reviewable |
Also, what does the sidebar look like in insecure mode? Review status: all files reviewed at latest revision, 1 unresolved discussion, all commit checks successful. Comments from Reviewable |
Review status: all files reviewed at latest revision, 1 unresolved discussion, some commit checks failed. pkg/ui/src/views/login/loginPage.tsx, line 67 at r3 (raw file): Previously, vilterp (Pete Vilter) wrote…
It's just here: cockroach/pkg/ui/src/util/api.ts Line 160 in 2137b24
But now that I've made a bunch of these hacks all over maybe it's time I actually fix it. Comments from Reviewable |
893f64d
to
522ed74
Compare
522ed74
to
d43824c
Compare
Ready to go @vilterp PTAL |
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.
Don't see insecure indicator in insecure mode. Otherwise looks good.
@@ -70,7 +71,13 @@ function LoginIndicator({ loginState, handleLogout }: LoginIndicatorProps) { | |||
} | |||
|
|||
if (!loginState.loginEnabled()) { | |||
return (<div className="login-indicator">Insecure mode</div>); | |||
return ( |
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 don't see this indicator when I start a cluster in insecure mode. Just blank space above the cockroach icon.
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.
Are you sure you had the environment variable set? I am seeing it...
@@ -1928,6 +1928,7 @@ func serveUIAssets(fileServer http.Handler, cfg Config) http.Handler { | |||
tmplArgs := ui.IndexHTMLArgs{ | |||
ExperimentalUseLogin: cfg.EnableWebSessionAuthentication, | |||
LoginEnabled: cfg.RequireWebSession(), | |||
Tag: build.GetInfo().Tag, |
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.
looks like this is what broke the ServeIndexHTML
test in CI. It's pretty brittle — asserts the exact HTML that comes out. Not sure how to make that always pass, since the build tag will keep changing… Maybe can just sprintf it into the expected HTML.
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.
Tests updated.
pkg/ui/src/routes/login.tsx
Outdated
import LoginPage from "src/views/login/loginPage"; | ||
|
||
export const LOGIN_PAGE = "/login"; | ||
export const LOGOUT_PAGE = "/logout"; | ||
|
||
export default function(store: Store<AdminUIState>): JSX.Element { |
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.
nit: I don't like exporting anonymous functions; prefer to give them names (I think you can still export them in the same statement; maybe need an export statement below). Always giving functions names makes them easier to grep for and find via stack traces (as if we ever have reasonable stack traces… 😢 but that's a separate issue)
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.
Good point. Done.
> | ||
{ user[0] } | ||
</div> | ||
<Link to="/logout" onClick={handleLogout}>Sign Out</Link> |
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.
was gonna suggest that you make the whole thing clickable, but maybe the log out button should be pretty small so you don't click it accidentally.
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.
Yep. Maybe one day we'll have a user menu of some kind?!
Release note: None
Add some initial styling to the login page. Contributes to cockroachdb#24939. Release note: None
Add some styling and clean up the error text on login page. Contributes to cockroachdb#24939. Release note: None
Release note: None
Adds some initial styling to the login indicator on the navigation sidebar. Release note: None
An explicit logout route can be useful, so this adds one. Release note: None
Some TypeScript errors slipped through due to cockroachdb#26255. This fixes them. Release note: None
This will get shown on the login page. Release note: None
This updates the login page styling to the latest designs. Release note: None
This is temporary styling for the insecure mode indicator. A final design will be implemented later, but this will hold us over for now. Release note: None
Release note: None
d43824c
to
de8d6f1
Compare
Ah, started in insecure mode with the flag and I see the indicator now. LGTM! |
bors r+ |
26066: ui: style login page r=couchand a=couchand Adds some initial styling to the login page and the login indicator in the navigation sidebar. Sidebar: <img width="710" alt="screen shot 2018-05-29 at 1 59 44 pm" src="https://user-images.githubusercontent.com/793969/40676560-110e3a7e-6349-11e8-812a-9c8e682f5670.png"> Login page: <img width="1274" alt="screen shot 2018-06-04 at 4 28 40 pm" src="https://user-images.githubusercontent.com/793969/40940739-c0c6eb10-6816-11e8-9b24-8a0b492239b3.png"> Login page with error: <img width="1277" alt="screen shot 2018-06-04 at 4 45 40 pm" src="https://user-images.githubusercontent.com/793969/40940744-c4cb2d66-6816-11e8-90d4-d8b3c52927b6.png"> Insecure mode (temporary design): <img width="161" alt="screen shot 2018-06-04 at 5 10 56 pm" src="https://user-images.githubusercontent.com/793969/40942388-016f9478-681c-11e8-929c-36d0b7aa7463.png"> Closes #24939. Co-authored-by: Andrew Couch <[email protected]>
account access and password restoration. | ||
</p> | ||
<p className="aside"> | ||
<a href={docsURL("admin-ui-overview.html")} className="docs-link"> |
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.
maybe change to https://www.cockroachlabs.com/docs/dev/admin-ui-access-and-navigate.html#secure-the-admin-ui in a followup?
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.
@Amruta-Ranade will this link change?
Build succeeded |
Adds some initial styling to the login page and the login indicator in the navigation sidebar.
Sidebar:
Login page:
Login page with error:
Insecure mode (temporary design):
Closes #24939.