Skip to content

Commit 4f5b1b0

Browse files
authored
Show modal to restart minio after subnet register (#2752)
1 parent 0e362c2 commit 4f5b1b0

File tree

4 files changed

+15
-127
lines changed

4 files changed

+15
-127
lines changed

portal-ui/src/screens/Console/Support/ApiKeyRegister.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,10 @@ import RegisterHelpBox from "./RegisterHelpBox";
2424
import { SubnetLoginRequest, SubnetLoginResponse } from "../License/types";
2525
import api from "../../../common/api";
2626
import { useAppDispatch } from "../../../store";
27-
import { setErrorSnackMessage } from "../../../systemSlice";
27+
import {
28+
setErrorSnackMessage,
29+
setServerNeedsRestart,
30+
} from "../../../systemSlice";
2831
import { ErrorResponseHandler } from "../../../common/types";
2932
import { spacingUtils } from "../Common/FormComponents/common/styleLibrary";
3033
import { Theme } from "@mui/material/styles";
@@ -66,6 +69,7 @@ const ApiKeyRegister = ({ classes, registerEndpoint }: IApiKeyRegister) => {
6669
.then((resp: SubnetLoginResponse) => {
6770
setLoading(false);
6871
if (resp && resp.registered) {
72+
dispatch(setServerNeedsRestart(true));
6973
navigate(IAM_PAGES.LICENSE);
7074
}
7175
})

portal-ui/src/screens/Console/Support/OfflineRegistration.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,10 @@ import { useSelector } from "react-redux";
2626
import CommentBoxWrapper from "../Common/FormComponents/CommentBoxWrapper/CommentBoxWrapper";
2727
import useApi from "../Common/Hooks/useApi";
2828
import { fetchLicenseInfo } from "./registerThunks";
29-
import { setErrorSnackMessage } from "../../../systemSlice";
29+
import {
30+
setErrorSnackMessage,
31+
setServerNeedsRestart,
32+
} from "../../../systemSlice";
3033

3134
const OfflineRegistration = () => {
3235
const dispatch = useAppDispatch();
@@ -47,6 +50,7 @@ const OfflineRegistration = () => {
4750
const [isSaving, invokeApplyLicenseApi] = useApi(
4851
() => {
4952
dispatch(fetchLicenseInfo());
53+
dispatch(setServerNeedsRestart(true));
5054
},
5155
(err) => {
5256
dispatch(setErrorSnackMessage(err));

portal-ui/src/screens/Console/Support/RegisterOperator.tsx

Lines changed: 0 additions & 124 deletions
This file was deleted.

portal-ui/src/screens/Console/Support/registerThunks.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,10 @@ import {
3535
SubnetRegisterRequest,
3636
} from "../License/types";
3737
import { ErrorResponseHandler } from "../../../common/types";
38-
import { setErrorSnackMessage } from "../../../systemSlice";
38+
import {
39+
setErrorSnackMessage,
40+
setServerNeedsRestart,
41+
} from "../../../systemSlice";
3942
import { createAsyncThunk } from "@reduxjs/toolkit";
4043
import { AppState } from "../../../store";
4144
import { hasPermission } from "../../../common/SecureComponent";
@@ -104,6 +107,7 @@ export const callRegister = createAsyncThunk(
104107
.invoke("POST", "/api/v1/subnet/register", request)
105108
.then(() => {
106109
dispatch(setLoading(false));
110+
dispatch(setServerNeedsRestart(true));
107111
dispatch(resetRegisterForm());
108112
dispatch(fetchLicenseInfo());
109113
})

0 commit comments

Comments
 (0)