Skip to content

Commit 6ef35c2

Browse files
authored
Remove unused check-version api (#3045)
1 parent 8a91832 commit 6ef35c2

16 files changed

+21
-825
lines changed

integration/version_test.go

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

models/check_version_response.go

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

pkg/utils/version.go

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

portal-ui/src/api/consoleApi.ts

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1228,11 +1228,6 @@ export interface SubnetOrganization {
12281228
shortName?: string;
12291229
}
12301230

1231-
export interface CheckVersionResponse {
1232-
current_version?: string;
1233-
latest_version?: string;
1234-
}
1235-
12361231
export interface PermissionResource {
12371232
resource?: string;
12381233
conditionOperator?: string;
@@ -1852,23 +1847,6 @@ export class Api<
18521847
...params,
18531848
}),
18541849
};
1855-
checkVersion = {
1856-
/**
1857-
* No description
1858-
*
1859-
* @tags System
1860-
* @name CheckMinIoVersion
1861-
* @summary Checks the current MinIO version against the latest
1862-
* @request GET:/check-version
1863-
*/
1864-
checkMinIoVersion: (params: RequestParams = {}) =>
1865-
this.request<CheckVersionResponse, ApiError>({
1866-
path: `/check-version`,
1867-
method: "GET",
1868-
format: "json",
1869-
...params,
1870-
}),
1871-
};
18721850
account = {
18731851
/**
18741852
* No description

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

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ import { loginStrategyType } from "./login.types";
2121
import MainError from "../Console/Common/MainError/MainError";
2222
import { AppState, useAppDispatch } from "../../store";
2323
import { useSelector } from "react-redux";
24-
import { getFetchConfigurationAsync, getVersionAsync } from "./loginThunks";
24+
import { getFetchConfigurationAsync } from "./loginThunks";
2525
import { resetForm } from "./loginSlice";
2626
import StrategyForm from "./StrategyForm";
2727
import { getLogoVar } from "../../config";
@@ -57,9 +57,6 @@ const Login = () => {
5757
const loadingFetchConfiguration = useSelector(
5858
(state: AppState) => state.login.loadingFetchConfiguration,
5959
);
60-
const loadingVersion = useSelector(
61-
(state: AppState) => state.login.loadingVersion,
62-
);
6360
const navigateTo = useSelector((state: AppState) => state.login.navigateTo);
6461

6562
const isK8S = useSelector((state: AppState) => state.login.isK8S);
@@ -81,12 +78,6 @@ const Login = () => {
8178
}
8279
}, [loadingFetchConfiguration, dispatch]);
8380

84-
useEffect(() => {
85-
if (loadingVersion) {
86-
dispatch(getVersionAsync());
87-
}
88-
}, [dispatch, loadingVersion]);
89-
9081
let loginComponent;
9182

9283
switch (loginStrategy.loginStrategy) {

portal-ui/src/screens/LoginPage/loginSlice.ts

Lines changed: 1 addition & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,7 @@
1616

1717
import { createSlice, PayloadAction } from "@reduxjs/toolkit";
1818
import { LoginDetails } from "api/consoleApi";
19-
import {
20-
doLoginAsync,
21-
getFetchConfigurationAsync,
22-
getVersionAsync,
23-
} from "./loginThunks";
19+
import { doLoginAsync, getFetchConfigurationAsync } from "./loginThunks";
2420

2521
export interface LoginState {
2622
accessKey: string;
@@ -31,8 +27,6 @@ export interface LoginState {
3127
loginStrategy: LoginDetails;
3228
loginSending: boolean;
3329
loadingFetchConfiguration: boolean;
34-
latestMinIOVersion: string;
35-
loadingVersion: boolean;
3630
isK8S: boolean;
3731
navigateTo: string;
3832
ssoEmbeddedIDPDisplay: boolean;
@@ -49,8 +43,6 @@ const initialState: LoginState = {
4943
},
5044
loginSending: false,
5145
loadingFetchConfiguration: true,
52-
latestMinIOVersion: "",
53-
loadingVersion: true,
5446
isK8S: false,
5547
backgroundAnimation: false,
5648
navigateTo: "",
@@ -83,18 +75,6 @@ export const loginSlice = createSlice({
8375
},
8476
extraReducers: (builder) => {
8577
builder
86-
.addCase(getVersionAsync.pending, (state, action) => {
87-
state.loadingVersion = true;
88-
})
89-
.addCase(getVersionAsync.rejected, (state, action) => {
90-
state.loadingVersion = false;
91-
})
92-
.addCase(getVersionAsync.fulfilled, (state, action) => {
93-
state.loadingVersion = false;
94-
if (action.payload) {
95-
state.latestMinIOVersion = action.payload;
96-
}
97-
})
9878
.addCase(getFetchConfigurationAsync.pending, (state, action) => {
9979
state.loadingFetchConfiguration = true;
10080
})

portal-ui/src/screens/LoginPage/loginThunks.ts

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -76,21 +76,3 @@ export const getFetchConfigurationAsync = createAsyncThunk(
7676
});
7777
},
7878
);
79-
80-
export const getVersionAsync = createAsyncThunk(
81-
"login/getVersionAsync",
82-
async (_, { getState, rejectWithValue, dispatch }) => {
83-
return api.checkVersion
84-
.checkMinIoVersion()
85-
.then((res) => {
86-
if (res.data !== undefined) {
87-
return res.data.latest_version;
88-
}
89-
})
90-
.catch(async (res) => {
91-
const err = (await res.json()) as ApiError;
92-
dispatch(setErrorSnackMessage(errorToHandler(err)));
93-
return rejectWithValue(false);
94-
});
95-
},
96-
);

restapi/configure_console.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -127,8 +127,6 @@ func configureAPI(api *operations.ConsoleAPI) http.Handler {
127127
registerServiceHandlers(api)
128128
// Register session handlers
129129
registerSessionHandlers(api)
130-
// Register version handlers
131-
registerVersionHandlers(api)
132130
// Register admin info handlers
133131
registerAdminInfoHandlers(api)
134132
// Register admin arns handlers

0 commit comments

Comments
 (0)