Skip to content

Commit dc90db6

Browse files
authored
Changed SSO Login screen to hide login form by default (#2807)
Signed-off-by: Benjamin Perez <[email protected]>
1 parent beed489 commit dc90db6

File tree

14 files changed

+259
-433
lines changed

14 files changed

+259
-433
lines changed

models/login_details.go

Lines changed: 0 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

portal-ui/src/ProtectedRoutes.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ const ProtectedRoute = ({ Component }: ProtectedRouteProps) => {
6464
dispatch(saveSessionResponse(res));
6565
dispatch(userLogged(true));
6666
setSessionLoading(false);
67-
dispatch(globalSetDistributedSetup(res.distributedMode || false));
67+
dispatch(globalSetDistributedSetup(res?.distributedMode || false));
6868

6969
if (res.customStyles && res.customStyles !== "") {
7070
const overrideColorVariants = getOverrideColorVariants(

portal-ui/src/api/consoleApi.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -466,7 +466,6 @@ export interface LoginDetails {
466466
| "service-account"
467467
| "redirect-service-account";
468468
redirectRules?: RedirectRule[];
469-
isDirectPV?: boolean;
470469
isK8S?: boolean;
471470
animatedLogin?: boolean;
472471
}

portal-ui/src/screens/LoginPage/LoginPage.tsx

Lines changed: 33 additions & 217 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,9 @@
1616

1717
import React, { Fragment, useEffect } from "react";
1818
import { useNavigate } from "react-router-dom";
19-
import { Button, Loader, LoginWrapper, RefreshIcon } from "mds";
20-
import { Theme } from "@mui/material/styles";
21-
import createStyles from "@mui/styles/createStyles";
22-
import makeStyles from "@mui/styles/makeStyles";
19+
import { Box, Button, Loader, LoginWrapper, RefreshIcon } from "mds";
2320
import { loginStrategyType, redirectRule } from "./types";
2421
import MainError from "../Console/Common/MainError/MainError";
25-
import { spacingUtils } from "../Console/Common/FormComponents/common/styleLibrary";
2622
import { AppState, useAppDispatch } from "../../store";
2723
import { useSelector } from "react-redux";
2824
import { getFetchConfigurationAsync, getVersionAsync } from "./loginThunks";
@@ -31,205 +27,6 @@ import StrategyForm from "./StrategyForm";
3127
import { redirectRules } from "../../utils/sortFunctions";
3228
import { getLogoVar } from "../../config";
3329

34-
const useStyles = makeStyles((theme: Theme) =>
35-
createStyles({
36-
root: {
37-
position: "absolute",
38-
top: 0,
39-
left: 0,
40-
width: "100%",
41-
height: "100%",
42-
overflow: "auto",
43-
},
44-
form: {
45-
width: "100%", // Fix IE 11 issue.
46-
},
47-
submit: {
48-
margin: "30px 0px 8px",
49-
height: 40,
50-
width: "100%",
51-
boxShadow: "none",
52-
padding: "16px 30px",
53-
},
54-
loginSsoText: {
55-
fontWeight: "700",
56-
marginBottom: "15px",
57-
},
58-
ssoSelect: {
59-
width: "100%",
60-
fontSize: "13px",
61-
fontWeight: "700",
62-
color: "grey",
63-
},
64-
ssoMenuItem: {
65-
fontSize: "15px",
66-
fontWeight: "700",
67-
color: theme.palette.primary.light,
68-
"&.MuiMenuItem-divider:last-of-type": {
69-
borderBottom: "none",
70-
},
71-
"&.Mui-focusVisible": {
72-
backgroundColor: theme.palette.grey["100"],
73-
},
74-
},
75-
ssoLoginIcon: {
76-
height: "13px",
77-
marginRight: "25px",
78-
},
79-
ssoSubmit: {
80-
marginTop: "15px",
81-
"&:first-of-type": {
82-
marginTop: 0,
83-
},
84-
},
85-
separator: {
86-
marginLeft: 4,
87-
marginRight: 4,
88-
},
89-
linkHolder: {
90-
marginTop: 20,
91-
font: "normal normal normal 14px/16px Inter",
92-
},
93-
miniLinks: {
94-
margin: "auto",
95-
textAlign: "center",
96-
color: "#B2DEF5",
97-
"& a": {
98-
color: "#B2DEF5",
99-
textDecoration: "none",
100-
},
101-
"& .min-icon": {
102-
width: 10,
103-
color: "#B2DEF5",
104-
},
105-
},
106-
miniLogo: {
107-
marginTop: 8,
108-
"& .min-icon": {
109-
height: 12,
110-
paddingTop: 2,
111-
marginRight: 2,
112-
},
113-
},
114-
loginPage: {
115-
height: "100%",
116-
margin: "auto",
117-
},
118-
buttonRetry: {
119-
display: "flex",
120-
justifyContent: "center",
121-
},
122-
loginContainer: {
123-
flexDirection: "column",
124-
maxWidth: 400,
125-
margin: "auto",
126-
"& .right-items": {
127-
backgroundColor: "white",
128-
padding: 40,
129-
},
130-
"& .consoleTextBanner": {
131-
fontWeight: 300,
132-
fontSize: "calc(3vw + 3vh + 1.5vmin)",
133-
lineHeight: 1.15,
134-
color: theme.palette.primary.main,
135-
flex: 1,
136-
height: "100%",
137-
display: "flex",
138-
justifyContent: "flex-start",
139-
margin: "auto",
140-
141-
"& .logoLine": {
142-
display: "flex",
143-
alignItems: "center",
144-
fontSize: 18,
145-
},
146-
"& .left-items": {
147-
marginTop: 100,
148-
background:
149-
"transparent linear-gradient(180deg, #FBFAFA 0%, #E4E4E4 100%) 0% 0% no-repeat padding-box",
150-
padding: 40,
151-
},
152-
"& .left-logo": {
153-
"& .min-icon": {
154-
color: theme.palette.primary.main,
155-
width: 108,
156-
},
157-
marginBottom: 10,
158-
},
159-
"& .text-line1": {
160-
font: " 100 44px 'Inter'",
161-
},
162-
"& .text-line2": {
163-
fontSize: 80,
164-
fontWeight: 100,
165-
textTransform: "uppercase",
166-
},
167-
"& .text-line3": {
168-
fontSize: 14,
169-
fontWeight: "bold",
170-
},
171-
"& .logo-console": {
172-
display: "flex",
173-
alignItems: "center",
174-
175-
"@media (max-width: 900px)": {
176-
marginTop: 20,
177-
flexFlow: "column",
178-
179-
"& svg": {
180-
width: "50%",
181-
},
182-
},
183-
},
184-
},
185-
},
186-
"@media (max-width: 900px)": {
187-
loginContainer: {
188-
display: "flex",
189-
flexFlow: "column",
190-
191-
"& .consoleTextBanner": {
192-
margin: 0,
193-
flex: 2,
194-
195-
"& .left-items": {
196-
alignItems: "center",
197-
textAlign: "center",
198-
},
199-
200-
"& .logoLine": {
201-
justifyContent: "center",
202-
},
203-
},
204-
},
205-
},
206-
loginStrategyMessage: {
207-
textAlign: "center",
208-
},
209-
loadingLoginStrategy: {
210-
textAlign: "center",
211-
width: 40,
212-
height: 40,
213-
},
214-
submitContainer: {
215-
textAlign: "right",
216-
marginTop: 30,
217-
},
218-
linearPredef: {
219-
height: 10,
220-
},
221-
retryButton: {
222-
alignSelf: "flex-end",
223-
},
224-
iconLogo: {
225-
"& .min-icon": {
226-
width: "100%",
227-
},
228-
},
229-
...spacingUtils,
230-
})
231-
);
232-
23330
export interface LoginStrategyPayload {
23431
accessKey: string;
23532
secretKey: string;
@@ -251,7 +48,6 @@ export const getTargetPath = () => {
25148
const Login = () => {
25249
const dispatch = useAppDispatch();
25350
const navigate = useNavigate();
254-
const classes = useStyles();
25551

25652
const loginStrategy = useSelector(
25753
(state: AppState) => state.login.loginStrategy
@@ -308,19 +104,32 @@ const Login = () => {
308104
}
309105
default:
310106
loginComponent = (
311-
<div style={{ textAlign: "center" }}>
107+
<Box
108+
sx={{
109+
textAlign: "center",
110+
"& .loadingLoginStrategy": {
111+
textAlign: "center",
112+
width: 40,
113+
height: 40,
114+
},
115+
"& .buttonRetry": {
116+
display: "flex",
117+
justifyContent: "center",
118+
},
119+
}}
120+
>
312121
{loadingFetchConfiguration ? (
313-
<Loader className={classes.loadingLoginStrategy} />
122+
<Loader className={"loadingLoginStrategy"} />
314123
) : (
315124
<Fragment>
316-
<div>
317-
<p style={{ color: "#000", textAlign: "center" }}>
125+
<Box>
126+
<p style={{ textAlign: "center" }}>
318127
An error has occurred
319128
<br />
320129
The backend cannot be reached.
321130
</p>
322-
</div>
323-
<div className={classes.buttonRetry}>
131+
</Box>
132+
<div className={"buttonRetry"}>
324133
<Button
325134
onClick={() => {
326135
dispatch(getFetchConfigurationAsync());
@@ -334,7 +143,7 @@ const Login = () => {
334143
</div>
335144
</Fragment>
336145
)}
337-
</div>
146+
</Box>
338147
);
339148
}
340149

@@ -351,35 +160,42 @@ const Login = () => {
351160
logoProps={{ applicationName: "console", subVariant: getLogoVar() }}
352161
form={loginComponent}
353162
formFooter={
354-
<Fragment>
163+
<Box
164+
sx={{
165+
"& .separator": {
166+
marginLeft: 4,
167+
marginRight: 4,
168+
},
169+
}}
170+
>
355171
<a href={docsURL} target="_blank" rel="noopener">
356172
Documentation
357173
</a>
358-
<span className={classes.separator}>|</span>
174+
<span className={"separator"}>|</span>
359175
<a
360176
href="https://github.com/minio/minio"
361177
target="_blank"
362178
rel="noopener"
363179
>
364180
GitHub
365181
</a>
366-
<span className={classes.separator}>|</span>
182+
<span className={"separator"}>|</span>
367183
<a
368184
href="https://subnet.min.io/?ref=con"
369185
target="_blank"
370186
rel="noopener"
371187
>
372188
Support
373189
</a>
374-
<span className={classes.separator}>|</span>
190+
<span className={"separator"}>|</span>
375191
<a
376192
href="https://min.io/download/?ref=con"
377193
target="_blank"
378194
rel="noopener"
379195
>
380196
Download
381197
</a>
382-
</Fragment>
198+
</Box>
383199
}
384200
promoHeader={
385201
<span style={{ fontSize: 28 }}>High-Performance Object Store</span>

0 commit comments

Comments
 (0)