Skip to content

Commit 7df0560

Browse files
authored
Updated mds & fixed blank pages on login (#2494)
- Updates mds to v0.0.7 - Fixed an issue with blank pages during login - Fixes an issue during logout where path was redirected to 'logout/login' Signed-off-by: Benjamin Perez <benjamin@bexsoft.net>
1 parent 2368199 commit 7df0560

File tree

6 files changed

+18
-11
lines changed

6 files changed

+18
-11
lines changed

portal-ui/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
"kbar": "^0.1.0-beta.34",
3131
"local-storage-fallback": "^4.1.1",
3232
"lodash": "^4.17.21",
33-
"mds": "https://github.com/minio/mds.git#v0.0.5",
33+
"mds": "https://github.com/minio/mds.git#v0.0.7",
3434
"minio": "^7.0.28",
3535
"moment": "^2.29.4",
3636
"react": "^18.1.0",

portal-ui/src/MainRouter.tsx

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,14 @@ const MainRouter = () => {
3939
</Suspense>
4040
}
4141
/>
42-
<Route path="/logout" element={<Logout />} />
42+
<Route
43+
path="/logout"
44+
element={
45+
<Suspense fallback={<LoadingComponent />}>
46+
<Logout />
47+
</Suspense>
48+
}
49+
/>
4350
<Route
4451
path="/login"
4552
element={

portal-ui/src/ProtectedRoutes.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ import { SRInfoStateType } from "./types";
3535
import { AppState, useAppDispatch } from "./store";
3636
import { saveSessionResponse } from "./screens/Console/consoleSlice";
3737
import { getOverrideColorVariants } from "./utils/stylesUtils";
38+
import LoadingComponent from "./common/LoadingComponent";
3839

3940
interface ProtectedRouteProps {
4041
Component: any;
@@ -119,7 +120,7 @@ const ProtectedRoute = ({ Component }: ProtectedRouteProps) => {
119120

120121
// if we're still trying to retrieve user session render nothing
121122
if (sessionLoading) {
122-
return null;
123+
return <LoadingComponent />;
123124
}
124125
// redirect user to the right page based on session status
125126
return userLoggedIn ? <Component /> : <StorePathAndRedirect />;

portal-ui/src/common/LoadingComponent.tsx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,6 @@ const LoadingComponent = () => {
3030
>
3131
<Grid item xs={3} style={{ textAlign: "center" }}>
3232
<Loader style={{ width: 35, height: 35 }} />
33-
<br />
34-
Loading...
3533
</Grid>
3634
</Grid>
3735
);

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

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,10 @@ import { useNavigate } from "react-router-dom";
1919
import { useAppDispatch } from "../../store";
2020
import { ErrorResponseHandler } from "../../common/types";
2121
import { clearSession } from "../../common/utils";
22-
import api from "../../common/api";
2322
import { userLogged } from "../../systemSlice";
2423
import { resetSession } from "../Console/consoleSlice";
24+
import api from "../../common/api";
25+
import LoadingComponent from "../../common/LoadingComponent";
2526

2627
const LogoutPage = () => {
2728
const dispatch = useAppDispatch();
@@ -33,7 +34,7 @@ const LogoutPage = () => {
3334
localStorage.setItem("userLoggedIn", "");
3435
localStorage.setItem("redirect-path", "");
3536
dispatch(resetSession());
36-
navigate(`login`);
37+
navigate(`/login`);
3738
};
3839
const state = localStorage.getItem("auth-state");
3940
api
@@ -47,7 +48,7 @@ const LogoutPage = () => {
4748
});
4849
};
4950
logout();
50-
return <></>;
51+
return <LoadingComponent />;
5152
};
5253

5354
export default LogoutPage;

portal-ui/yarn.lock

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7969,9 +7969,9 @@ mdn-data@2.0.4:
79697969
resolved "https://registry.yarnpkg.com/mdn-data/-/mdn-data-2.0.4.tgz#699b3c38ac6f1d728091a64650b65d388502fd5b"
79707970
integrity sha512-iV3XNKw06j5Q7mi6h+9vbx23Tv7JkjEVgKHW4pimwyDGWm0OIQntJJ+u1C6mg6mK1EaTv42XQ7w76yuzH7M2cA==
79717971

7972-
"mds@https://github.com/minio/mds.git#v0.0.5":
7973-
version "0.0.5"
7974-
resolved "https://github.com/minio/mds.git#b9183841f178b7cc3ef320554f762c1d5bf6d7bd"
7972+
"mds@https://github.com/minio/mds.git#v0.0.7":
7973+
version "0.0.7"
7974+
resolved "https://github.com/minio/mds.git#dd51b9d694550e7737e6cf2462195b8ad70fbfe6"
79757975
dependencies:
79767976
"@types/styled-components" "^5.1.25"
79777977
styled-components "^5.3.6"

0 commit comments

Comments
 (0)