Fixed some warnings (#834)
Co-authored-by: Benjamin Perez <benjamin@bexsoft.net>
This commit is contained in:
@@ -1,4 +1,4 @@
|
|||||||
import { ITenant } from "../ListTenants/types";
|
import React, { useState } from "react";
|
||||||
import { createStyles, Theme, withStyles } from "@material-ui/core/styles";
|
import { createStyles, Theme, withStyles } from "@material-ui/core/styles";
|
||||||
import {
|
import {
|
||||||
containerForHeader,
|
containerForHeader,
|
||||||
@@ -13,7 +13,6 @@ import {
|
|||||||
DialogTitle,
|
DialogTitle,
|
||||||
LinearProgress,
|
LinearProgress,
|
||||||
} from "@material-ui/core";
|
} from "@material-ui/core";
|
||||||
import React, { useState } from "react";
|
|
||||||
|
|
||||||
interface IConfirmationDialog {
|
interface IConfirmationDialog {
|
||||||
classes: any;
|
classes: any;
|
||||||
|
|||||||
@@ -29,9 +29,6 @@ import TableWrapper from "../../Common/TableWrapper/TableWrapper";
|
|||||||
import { AppState } from "../../../../store";
|
import { AppState } from "../../../../store";
|
||||||
import {
|
import {
|
||||||
setTenantDetailsLoad,
|
setTenantDetailsLoad,
|
||||||
setTenantInfo,
|
|
||||||
setTenantName,
|
|
||||||
setTenantTab,
|
|
||||||
} from "../actions";
|
} from "../actions";
|
||||||
|
|
||||||
interface IPodsSummary {
|
interface IPodsSummary {
|
||||||
|
|||||||
@@ -31,13 +31,7 @@ import {
|
|||||||
Button,
|
Button,
|
||||||
CircularProgress,
|
CircularProgress,
|
||||||
Divider,
|
Divider,
|
||||||
LinearProgress,
|
|
||||||
Typography,
|
Typography,
|
||||||
Dialog,
|
|
||||||
DialogActions,
|
|
||||||
DialogContent,
|
|
||||||
DialogContentText,
|
|
||||||
DialogTitle,
|
|
||||||
} from "@material-ui/core";
|
} from "@material-ui/core";
|
||||||
import { KeyPair } from "../ListTenants/utils";
|
import { KeyPair } from "../ListTenants/utils";
|
||||||
import FileSelector from "../../Common/FormComponents/FileSelector/FileSelector";
|
import FileSelector from "../../Common/FormComponents/FileSelector/FileSelector";
|
||||||
@@ -296,11 +290,11 @@ const TenantSecurity = ({
|
|||||||
|
|
||||||
// Update MinIO TLS certificate secrets
|
// Update MinIO TLS certificate secrets
|
||||||
const updatedMinIOTLSCertificateSecrets = minioTLSCertificateSecrets.filter(
|
const updatedMinIOTLSCertificateSecrets = minioTLSCertificateSecrets.filter(
|
||||||
(certificateSecret) => certificateSecret.name != certificateInfo.name
|
(certificateSecret) => certificateSecret.name !== certificateInfo.name
|
||||||
);
|
);
|
||||||
const updatedMinIOTLSCaCertificateSecrets =
|
const updatedMinIOTLSCaCertificateSecrets =
|
||||||
minioTLSCaCertificateSecrets.filter(
|
minioTLSCaCertificateSecrets.filter(
|
||||||
(certificateSecret) => certificateSecret.name != certificateInfo.name
|
(certificateSecret) => certificateSecret.name !== certificateInfo.name
|
||||||
);
|
);
|
||||||
setMinioTLSCertificateSecrets(updatedMinIOTLSCertificateSecrets);
|
setMinioTLSCertificateSecrets(updatedMinIOTLSCertificateSecrets);
|
||||||
setMinioTLSCaCertificateSecrets(updatedMinIOTLSCaCertificateSecrets);
|
setMinioTLSCaCertificateSecrets(updatedMinIOTLSCaCertificateSecrets);
|
||||||
@@ -308,11 +302,11 @@ const TenantSecurity = ({
|
|||||||
// Update Console TLS certificate secrets
|
// Update Console TLS certificate secrets
|
||||||
const updatedConsoleTLSCertificateSecrets =
|
const updatedConsoleTLSCertificateSecrets =
|
||||||
consoleTLSCertificateSecrets.filter(
|
consoleTLSCertificateSecrets.filter(
|
||||||
(certificateSecret) => certificateSecret.name != certificateInfo.name
|
(certificateSecret) => certificateSecret.name !== certificateInfo.name
|
||||||
);
|
);
|
||||||
const updatedConsoleTLSCaCertificateSecrets =
|
const updatedConsoleTLSCaCertificateSecrets =
|
||||||
consoleTLSCaCertificateSecrets.filter(
|
consoleTLSCaCertificateSecrets.filter(
|
||||||
(certificateSecret) => certificateSecret.name != certificateInfo.name
|
(certificateSecret) => certificateSecret.name !== certificateInfo.name
|
||||||
);
|
);
|
||||||
setConsoleTLSCertificateSecrets(updatedConsoleTLSCertificateSecrets);
|
setConsoleTLSCertificateSecrets(updatedConsoleTLSCertificateSecrets);
|
||||||
setConsoleTLSCaCertificateSecrets(updatedConsoleTLSCaCertificateSecrets);
|
setConsoleTLSCaCertificateSecrets(updatedConsoleTLSCaCertificateSecrets);
|
||||||
@@ -921,7 +915,7 @@ const TenantSecurity = ({
|
|||||||
type="submit"
|
type="submit"
|
||||||
variant="contained"
|
variant="contained"
|
||||||
color="primary"
|
color="primary"
|
||||||
disabled={dialogOpen}
|
disabled={dialogOpen || isSending}
|
||||||
onClick={() => setDialogOpen(true)}
|
onClick={() => setDialogOpen(true)}
|
||||||
>
|
>
|
||||||
Save
|
Save
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ import {
|
|||||||
import api from "../../../common/api";
|
import api from "../../../common/api";
|
||||||
import { setErrorSnackMessage } from "../../../actions";
|
import { setErrorSnackMessage } from "../../../actions";
|
||||||
import history from "../../../history";
|
import history from "../../../history";
|
||||||
import { User, UsersList } from "./types";
|
import { UsersList } from "./types";
|
||||||
|
|
||||||
interface IDeleteUserProps {
|
interface IDeleteUserProps {
|
||||||
closeDeleteModalAndRefresh: (refresh: boolean) => void;
|
closeDeleteModalAndRefresh: (refresh: boolean) => void;
|
||||||
|
|||||||
@@ -29,7 +29,7 @@ import {
|
|||||||
containerForHeader,
|
containerForHeader,
|
||||||
searchField,
|
searchField,
|
||||||
} from "../Common/FormComponents/common/styleLibrary";
|
} from "../Common/FormComponents/common/styleLibrary";
|
||||||
import { IPolicyItem, User, UsersList } from "./types";
|
import { IPolicyItem, User } from "./types";
|
||||||
import Tabs from "@material-ui/core/Tabs";
|
import Tabs from "@material-ui/core/Tabs";
|
||||||
import Tab from "@material-ui/core/Tab";
|
import Tab from "@material-ui/core/Tab";
|
||||||
import { TabPanel } from "../../shared/tabs";
|
import { TabPanel } from "../../shared/tabs";
|
||||||
@@ -45,7 +45,6 @@ import UserServiceAccountsPanel from "./UserServiceAccountsPanel";
|
|||||||
import MoreVertIcon from "@material-ui/icons/MoreVert";
|
import MoreVertIcon from "@material-ui/icons/MoreVert";
|
||||||
import ChangeUserPasswordModal from "../Account/ChangeUserPasswordModal";
|
import ChangeUserPasswordModal from "../Account/ChangeUserPasswordModal";
|
||||||
import DeleteUserString from "./DeleteUserString";
|
import DeleteUserString from "./DeleteUserString";
|
||||||
import { usersSort } from "../../../utils/sortFunctions";
|
|
||||||
|
|
||||||
const styles = (theme: Theme) =>
|
const styles = (theme: Theme) =>
|
||||||
createStyles({
|
createStyles({
|
||||||
@@ -139,7 +138,6 @@ const UserDetails = ({ classes, match }: IUserDetailsProps) => {
|
|||||||
const [addGroupOpen, setAddGroupOpen] = useState<boolean>(false);
|
const [addGroupOpen, setAddGroupOpen] = useState<boolean>(false);
|
||||||
const [policyOpen, setPolicyOpen] = useState<boolean>(false);
|
const [policyOpen, setPolicyOpen] = useState<boolean>(false);
|
||||||
const [addLoading, setAddLoading] = useState<boolean>(false);
|
const [addLoading, setAddLoading] = useState<boolean>(false);
|
||||||
const [records, setRecords] = useState<User[]>([]);
|
|
||||||
|
|
||||||
const [enabled, setEnabled] = useState<boolean>(false);
|
const [enabled, setEnabled] = useState<boolean>(false);
|
||||||
const [selectedGroups, setSelectedGroups] = useState<string[]>([]);
|
const [selectedGroups, setSelectedGroups] = useState<string[]>([]);
|
||||||
@@ -217,22 +215,6 @@ const UserDetails = ({ classes, match }: IUserDetailsProps) => {
|
|||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
const fetchRecords = useCallback(() => {
|
|
||||||
setLoading(true);
|
|
||||||
api
|
|
||||||
.invoke("GET", `/api/v1/users`)
|
|
||||||
.then((res: UsersList) => {
|
|
||||||
const users = res.users === null ? [] : res.users;
|
|
||||||
|
|
||||||
setLoading(false);
|
|
||||||
setRecords(users.sort(usersSort));
|
|
||||||
})
|
|
||||||
.catch((err) => {
|
|
||||||
setLoading(false);
|
|
||||||
setErrorSnackMessage(err);
|
|
||||||
});
|
|
||||||
}, [setLoading, setRecords, setErrorSnackMessage]);
|
|
||||||
|
|
||||||
const [anchorEl, setAnchorEl] = React.useState(null);
|
const [anchorEl, setAnchorEl] = React.useState(null);
|
||||||
|
|
||||||
const handleUserMenu = (event: any) => {
|
const handleUserMenu = (event: any) => {
|
||||||
@@ -248,7 +230,7 @@ const UserDetails = ({ classes, match }: IUserDetailsProps) => {
|
|||||||
const closeDeleteModalAndRefresh = (refresh: boolean) => {
|
const closeDeleteModalAndRefresh = (refresh: boolean) => {
|
||||||
setDeleteOpen(false);
|
setDeleteOpen(false);
|
||||||
if (refresh) {
|
if (refresh) {
|
||||||
fetchRecords();
|
getUserInformation();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user