Remove Warnings (#1200)

Signed-off-by: Daniel Valdivia <18384552+dvaldivia@users.noreply.github.com>
This commit is contained in:
Daniel Valdivia
2021-11-08 22:43:00 -08:00
committed by GitHub
parent 31fbdd515c
commit e461a2268a
20 changed files with 33 additions and 30 deletions

View File

@@ -79,7 +79,7 @@ const DeleteServiceAccount = ({
]);
const removeRecord = () => {
if (selectedServiceAccount == null) {
if (selectedServiceAccount === null) {
return;
}

View File

@@ -197,7 +197,12 @@ const AccessRule = ({
setLoadingAccessRules(false);
}
}
}, [loadingAccessRules, setErrorSnackMessage, bucketName]);
}, [
loadingAccessRules,
setErrorSnackMessage,
displayAccessRules,
bucketName,
]);
const closeAddAccessRuleModal = () => {
setAddAccessRuleOpen(false);

View File

@@ -14,7 +14,7 @@
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
import React, { Fragment, useEffect, useState } from "react";
import React, { Fragment, useEffect } from "react";
import { connect } from "react-redux";
import { Theme } from "@mui/material/styles";
import createStyles from "@mui/styles/createStyles";

View File

@@ -52,7 +52,7 @@ const DeleteEvent = ({
if (deleteLoading) {
return;
}
if (bucketEvent == null) {
if (bucketEvent === null) {
return;
}

View File

@@ -346,7 +346,7 @@ const ListObjects = ({
if (
loadingVersioning &&
bucketInfo?.allowedActions &&
bucketInfo?.name == bucketName
bucketInfo?.name === bucketName
) {
if (displayListObjects) {
api
@@ -423,7 +423,7 @@ const ListObjects = ({
if (
loading &&
bucketInfo?.allowedActions &&
bucketInfo?.name == bucketName
bucketInfo?.name === bucketName
) {
if (displayListObjects) {
let pathPrefix = "";

View File

@@ -76,7 +76,7 @@ const BoxIconButton = ({
<IconButton
{...rest}
className={clsx(classes.root, {
[classes.contained]: variant == "contained",
[classes.contained]: variant === "contained",
})}
>
{children}

View File

@@ -85,7 +85,7 @@ const BasicDashboard = ({ classes, usage }: IDashboardProps) => {
};
const makeServerArray = (usage: Usage | null) => {
if (usage != null) {
if (usage !== null) {
return usage.servers.sort(function (a, b) {
var nameA = a.endpoint.toLowerCase();
var nameB = b.endpoint.toLowerCase();

View File

@@ -24,15 +24,18 @@ import { Card, CardHeader } from "@mui/material";
import { CircleIcon, VersionIcon } from "../../../../icons";
import get from "lodash/get";
import { commonDashboardInfocard } from "../../Common/FormComponents/common/styleLibrary";
const styles = (theme: Theme) =>
createStyles({
...commonDashboardInfocard,
});
interface ICardProps {
classes: any;
server: ServerInfo;
index: number;
}
const ServerInfoCard = ({ classes, server, index }: ICardProps) => {
const serverStatusToClass = (health_status: string) => {
switch (health_status) {
@@ -81,7 +84,7 @@ const ServerInfoCard = ({ classes, server, index }: ICardProps) => {
className={`${classes.innerState} ${
activeDisks <= totalDrives / 2 && classes.redState
} ${
totalDrives != 2 &&
totalDrives !== 2 &&
activeDisks === totalDrives / 2 + 1 &&
classes.yellowState
} ${activeDisks === totalDrives && classes.greenState}`}

View File

@@ -178,7 +178,7 @@ const PieChartWidget = ({
<Cell
key={`cellOuter-${index}`}
fill={
typeof outerColors[index] == "undefined"
typeof outerColors[index] === "undefined"
? "#393939"
: outerColors[index]
}
@@ -219,7 +219,7 @@ const PieChartWidget = ({
<Cell
key={`cell-${index}`}
fill={
typeof innerColors[index] == "undefined"
typeof innerColors[index] === "undefined"
? "#393939"
: innerColors[index]
}

View File

@@ -14,7 +14,7 @@
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
import React, { useState, useEffect, useCallback } from "react";
import React, { useCallback, useEffect, useState } from "react";
import { connect } from "react-redux";
import { Theme } from "@mui/material/styles";
import createStyles from "@mui/styles/createStyles";
@@ -184,7 +184,7 @@ const UsersSelectors = ({
<Grid item xs={12}>
<Paper className={classes.paper}>
{loading && <LinearProgress />}
{records != null && records.length > 0 ? (
{records !== null && records.length > 0 ? (
<React.Fragment>
<Grid item xs={12} className={classes.actionsTray}>
<span className={classes.actionsTitle}>

View File

@@ -137,7 +137,7 @@ const PodsSummary = ({
label: "Restarts",
elementKey: "restarts",
renderFunction: (input) => {
return input != null ? input : 0;
return input !== null ? input : 0;
},
},
{ label: "Node", elementKey: "node" },

View File

@@ -92,7 +92,7 @@ const AddUser = ({
}, [selectedUser, setModalErrorSnackMessage]);
useEffect(() => {
if (selectedUser == null) {
if (selectedUser === null) {
setAccessKey("");
setSecretKey("");
setSelectedGroups([]);

View File

@@ -83,7 +83,7 @@ const ChangeUserGroups = ({
}, [selectedUser, setModalErrorSnackMessage]);
useEffect(() => {
if (selectedUser == null) {
if (selectedUser === null) {
setAccessKey("");
setSecretKey("");
setSelectedGroups([]);

View File

@@ -49,7 +49,7 @@ const DeleteUser = ({
if (deleteLoading) {
return;
}
if (selectedUser == null) {
if (selectedUser === null) {
return;
}
setDeleteLoading(true);

View File

@@ -50,7 +50,7 @@ const DeleteUserString = ({
if (deleteLoading) {
return;
}
if (userName == null) {
if (userName === null) {
return;
}
setDeleteLoading(true);

View File

@@ -179,7 +179,7 @@ const GroupsSelectors = ({
<React.Fragment>
<Grid item xs={12}>
{loading && <LinearProgress />}
{records != null && records.length > 0 ? (
{records !== null && records.length > 0 ? (
<React.Fragment>
<Grid item xs={12} className={classes.actionsTray}>
<span className={classes.actionsTitle}>Assign Groups</span>

View File

@@ -43,7 +43,7 @@ const LoginCallback: FC<RouteComponentProps> = ({ location }) => {
let targetPath = "/";
if (
localStorage.getItem("redirect-path") &&
localStorage.getItem("redirect-path") != ""
localStorage.getItem("redirect-path") !== ""
) {
targetPath = `${localStorage.getItem("redirect-path")}`;
localStorage.setItem("redirect-path", "");

View File

@@ -245,7 +245,7 @@ const Login = ({
let targetPath = "/";
if (
localStorage.getItem("redirect-path") &&
localStorage.getItem("redirect-path") != ""
localStorage.getItem("redirect-path") !== ""
) {
targetPath = `${localStorage.getItem("redirect-path")}`;
localStorage.setItem("redirect-path", "");

View File

@@ -68,7 +68,7 @@ function registerValidSW(swUrl: string, config?: Config) {
.then((registration) => {
registration.onupdatefound = () => {
const installingWorker = registration.installing;
if (installingWorker == null) {
if (installingWorker === null) {
return;
}
installingWorker.onstatechange = () => {
@@ -114,7 +114,7 @@ function checkValidServiceWorker(swUrl: string, config?: Config) {
const contentType = response.headers.get("content-type");
if (
response.status === 404 ||
(contentType != null && contentType.indexOf("javascript") === -1)
(contentType !== null && contentType.indexOf("javascript") === -1)
) {
// No service worker found. Probably a different app. Reload the page.
navigator.serviceWorker.ready.then((registration) => {

View File

@@ -14,12 +14,7 @@
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
import {
ADMIN_ALL_ACTIONS,
S3_ALL_ACTIONS,
S3_GET_BUCKET_OBJECT_LOCK_CONFIGURATION,
S3_PUT_OBJECT_TAGGING,
} from "../types";
import { ADMIN_ALL_ACTIONS, S3_ALL_ACTIONS } from "../types";
// displayComponent receives a list of user permissions to perform on a specific resource, then compares those permissions against
// a list of required permissions and return true or false depending of the level of required access (match all permissions,
@@ -44,6 +39,6 @@ export const displayComponent = (
);
});
return matchAll
? permissions.length == requiredPermissions.length
? permissions.length === requiredPermissions.length
: permissions.length > 0;
};