diff --git a/portal-ui/src/screens/Console/Account/DeleteServiceAccount.tsx b/portal-ui/src/screens/Console/Account/DeleteServiceAccount.tsx index c5df82083..086dcd5f4 100644 --- a/portal-ui/src/screens/Console/Account/DeleteServiceAccount.tsx +++ b/portal-ui/src/screens/Console/Account/DeleteServiceAccount.tsx @@ -79,7 +79,7 @@ const DeleteServiceAccount = ({ ]); const removeRecord = () => { - if (selectedServiceAccount == null) { + if (selectedServiceAccount === null) { return; } diff --git a/portal-ui/src/screens/Console/Buckets/BucketDetails/AccessRulePanel.tsx b/portal-ui/src/screens/Console/Buckets/BucketDetails/AccessRulePanel.tsx index 150d5329d..a66de36c1 100644 --- a/portal-ui/src/screens/Console/Buckets/BucketDetails/AccessRulePanel.tsx +++ b/portal-ui/src/screens/Console/Buckets/BucketDetails/AccessRulePanel.tsx @@ -197,7 +197,12 @@ const AccessRule = ({ setLoadingAccessRules(false); } } - }, [loadingAccessRules, setErrorSnackMessage, bucketName]); + }, [ + loadingAccessRules, + setErrorSnackMessage, + displayAccessRules, + bucketName, + ]); const closeAddAccessRuleModal = () => { setAddAccessRuleOpen(false); diff --git a/portal-ui/src/screens/Console/Buckets/BucketDetails/BrowserHandler.tsx b/portal-ui/src/screens/Console/Buckets/BucketDetails/BrowserHandler.tsx index dcb3a420e..d111f7947 100644 --- a/portal-ui/src/screens/Console/Buckets/BucketDetails/BrowserHandler.tsx +++ b/portal-ui/src/screens/Console/Buckets/BucketDetails/BrowserHandler.tsx @@ -14,7 +14,7 @@ // You should have received a copy of the GNU Affero General Public License // along with this program. If not, see . -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"; diff --git a/portal-ui/src/screens/Console/Buckets/BucketDetails/DeleteEvent.tsx b/portal-ui/src/screens/Console/Buckets/BucketDetails/DeleteEvent.tsx index 73e644496..3225fe85b 100644 --- a/portal-ui/src/screens/Console/Buckets/BucketDetails/DeleteEvent.tsx +++ b/portal-ui/src/screens/Console/Buckets/BucketDetails/DeleteEvent.tsx @@ -52,7 +52,7 @@ const DeleteEvent = ({ if (deleteLoading) { return; } - if (bucketEvent == null) { + if (bucketEvent === null) { return; } diff --git a/portal-ui/src/screens/Console/Buckets/ListBuckets/Objects/ListObjects/ListObjects.tsx b/portal-ui/src/screens/Console/Buckets/ListBuckets/Objects/ListObjects/ListObjects.tsx index c7995c9ae..e279d7777 100644 --- a/portal-ui/src/screens/Console/Buckets/ListBuckets/Objects/ListObjects/ListObjects.tsx +++ b/portal-ui/src/screens/Console/Buckets/ListBuckets/Objects/ListObjects/ListObjects.tsx @@ -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 = ""; diff --git a/portal-ui/src/screens/Console/Common/BoxIconButton.tsx b/portal-ui/src/screens/Console/Common/BoxIconButton.tsx index f965c2943..63e7f6317 100644 --- a/portal-ui/src/screens/Console/Common/BoxIconButton.tsx +++ b/portal-ui/src/screens/Console/Common/BoxIconButton.tsx @@ -76,7 +76,7 @@ const BoxIconButton = ({ {children} diff --git a/portal-ui/src/screens/Console/Dashboard/BasicDashboard/BasicDashboard.tsx b/portal-ui/src/screens/Console/Dashboard/BasicDashboard/BasicDashboard.tsx index 706e366c9..8437cc10f 100644 --- a/portal-ui/src/screens/Console/Dashboard/BasicDashboard/BasicDashboard.tsx +++ b/portal-ui/src/screens/Console/Dashboard/BasicDashboard/BasicDashboard.tsx @@ -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(); diff --git a/portal-ui/src/screens/Console/Dashboard/BasicDashboard/ServerInfoCard.tsx b/portal-ui/src/screens/Console/Dashboard/BasicDashboard/ServerInfoCard.tsx index 5235f6172..1a1380e89 100644 --- a/portal-ui/src/screens/Console/Dashboard/BasicDashboard/ServerInfoCard.tsx +++ b/portal-ui/src/screens/Console/Dashboard/BasicDashboard/ServerInfoCard.tsx @@ -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}`} diff --git a/portal-ui/src/screens/Console/Dashboard/Prometheus/Widgets/PieChartWidget.tsx b/portal-ui/src/screens/Console/Dashboard/Prometheus/Widgets/PieChartWidget.tsx index 84006eb47..b0a22edd1 100644 --- a/portal-ui/src/screens/Console/Dashboard/Prometheus/Widgets/PieChartWidget.tsx +++ b/portal-ui/src/screens/Console/Dashboard/Prometheus/Widgets/PieChartWidget.tsx @@ -178,7 +178,7 @@ const PieChartWidget = ({ . -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 = ({ {loading && } - {records != null && records.length > 0 ? ( + {records !== null && records.length > 0 ? ( diff --git a/portal-ui/src/screens/Console/Tenants/TenantDetails/PodsSummary.tsx b/portal-ui/src/screens/Console/Tenants/TenantDetails/PodsSummary.tsx index 825f9134c..7c436668d 100644 --- a/portal-ui/src/screens/Console/Tenants/TenantDetails/PodsSummary.tsx +++ b/portal-ui/src/screens/Console/Tenants/TenantDetails/PodsSummary.tsx @@ -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" }, diff --git a/portal-ui/src/screens/Console/Users/AddUser.tsx b/portal-ui/src/screens/Console/Users/AddUser.tsx index 596501c54..de4828f49 100644 --- a/portal-ui/src/screens/Console/Users/AddUser.tsx +++ b/portal-ui/src/screens/Console/Users/AddUser.tsx @@ -92,7 +92,7 @@ const AddUser = ({ }, [selectedUser, setModalErrorSnackMessage]); useEffect(() => { - if (selectedUser == null) { + if (selectedUser === null) { setAccessKey(""); setSecretKey(""); setSelectedGroups([]); diff --git a/portal-ui/src/screens/Console/Users/ChangeUserGroups.tsx b/portal-ui/src/screens/Console/Users/ChangeUserGroups.tsx index f68935f98..4f614e90c 100644 --- a/portal-ui/src/screens/Console/Users/ChangeUserGroups.tsx +++ b/portal-ui/src/screens/Console/Users/ChangeUserGroups.tsx @@ -83,7 +83,7 @@ const ChangeUserGroups = ({ }, [selectedUser, setModalErrorSnackMessage]); useEffect(() => { - if (selectedUser == null) { + if (selectedUser === null) { setAccessKey(""); setSecretKey(""); setSelectedGroups([]); diff --git a/portal-ui/src/screens/Console/Users/DeleteUser.tsx b/portal-ui/src/screens/Console/Users/DeleteUser.tsx index 32f76fb72..a32cca3a1 100644 --- a/portal-ui/src/screens/Console/Users/DeleteUser.tsx +++ b/portal-ui/src/screens/Console/Users/DeleteUser.tsx @@ -49,7 +49,7 @@ const DeleteUser = ({ if (deleteLoading) { return; } - if (selectedUser == null) { + if (selectedUser === null) { return; } setDeleteLoading(true); diff --git a/portal-ui/src/screens/Console/Users/DeleteUserString.tsx b/portal-ui/src/screens/Console/Users/DeleteUserString.tsx index 3de3282a3..41fbde6b2 100644 --- a/portal-ui/src/screens/Console/Users/DeleteUserString.tsx +++ b/portal-ui/src/screens/Console/Users/DeleteUserString.tsx @@ -50,7 +50,7 @@ const DeleteUserString = ({ if (deleteLoading) { return; } - if (userName == null) { + if (userName === null) { return; } setDeleteLoading(true); diff --git a/portal-ui/src/screens/Console/Users/GroupsSelectors.tsx b/portal-ui/src/screens/Console/Users/GroupsSelectors.tsx index e2b2ccad2..476b9cd25 100644 --- a/portal-ui/src/screens/Console/Users/GroupsSelectors.tsx +++ b/portal-ui/src/screens/Console/Users/GroupsSelectors.tsx @@ -179,7 +179,7 @@ const GroupsSelectors = ({ {loading && } - {records != null && records.length > 0 ? ( + {records !== null && records.length > 0 ? ( Assign Groups diff --git a/portal-ui/src/screens/LoginPage/LoginCallback.tsx b/portal-ui/src/screens/LoginPage/LoginCallback.tsx index 277264f6c..ed2449f60 100644 --- a/portal-ui/src/screens/LoginPage/LoginCallback.tsx +++ b/portal-ui/src/screens/LoginPage/LoginCallback.tsx @@ -43,7 +43,7 @@ const LoginCallback: FC = ({ 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", ""); diff --git a/portal-ui/src/screens/LoginPage/LoginPage.tsx b/portal-ui/src/screens/LoginPage/LoginPage.tsx index 97d2f80d4..b72064043 100644 --- a/portal-ui/src/screens/LoginPage/LoginPage.tsx +++ b/portal-ui/src/screens/LoginPage/LoginPage.tsx @@ -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", ""); diff --git a/portal-ui/src/serviceWorker.ts b/portal-ui/src/serviceWorker.ts index 712066910..84bc06840 100644 --- a/portal-ui/src/serviceWorker.ts +++ b/portal-ui/src/serviceWorker.ts @@ -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) => { diff --git a/portal-ui/src/utils/permissions.ts b/portal-ui/src/utils/permissions.ts index 1949d3b11..6406c5e10 100644 --- a/portal-ui/src/utils/permissions.ts +++ b/portal-ui/src/utils/permissions.ts @@ -14,12 +14,7 @@ // You should have received a copy of the GNU Affero General Public License // along with this program. If not, see . -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; };