diff --git a/portal-ui/src/screens/Console/Buckets/BucketDetails/BucketEventsPanel.tsx b/portal-ui/src/screens/Console/Buckets/BucketDetails/BucketEventsPanel.tsx index b10154691f..6d6a8c6eb6 100644 --- a/portal-ui/src/screens/Console/Buckets/BucketDetails/BucketEventsPanel.tsx +++ b/portal-ui/src/screens/Console/Buckets/BucketDetails/BucketEventsPanel.tsx @@ -104,6 +104,13 @@ const BucketEventsPanel = ({ const tableActions = [{ type: "delete", onClick: confirmDeleteEvent }]; + const filteredRecords = records.filter((item: BucketEvent) => { + if(item.arn.toLowerCase().includes(filter.toLowerCase())) { + return true; + } + return false; + }); + return ( {deleteOpen && ( @@ -170,7 +177,7 @@ const BucketEventsPanel = ({ { label: "Suffix", elementKey: "suffix" }, ]} isLoading={loadingEvents} - records={records} + records={filteredRecords} entityName="Events" idField="id" /> diff --git a/portal-ui/src/screens/Console/Buckets/BucketDetails/BucketLifecyclePanel.tsx b/portal-ui/src/screens/Console/Buckets/BucketDetails/BucketLifecyclePanel.tsx index 149a22b363..d5f54741d6 100644 --- a/portal-ui/src/screens/Console/Buckets/BucketDetails/BucketLifecyclePanel.tsx +++ b/portal-ui/src/screens/Console/Buckets/BucketDetails/BucketLifecyclePanel.tsx @@ -61,6 +61,7 @@ const BucketLifecyclePanel = ({ const [lifecycleRecords, setLifecycleRecords] = useState([]); const [addLifecycleOpen, setAddLifecycleOpen] = useState(false); const [editLifecycleOpen, setEditLifecycleOpen] = useState(false); + const [filter, setFilter] = useState(""); const bucketName = match.params["bucketName"]; @@ -153,6 +154,16 @@ const BucketLifecyclePanel = ({ }, ]; + const filteredRecords = lifecycleRecords.filter( + (item: LifeCycleItem) => { + if (item.id.toLocaleLowerCase().includes(filter.toLowerCase())) + { + return true; + } + return false; + } + ); + return ( {editLifecycleOpen && ( @@ -180,7 +191,7 @@ const BucketLifecyclePanel = ({ id="search-resource" label="" onChange={(event) => { - // setFilter(event.target.value); + setFilter(event.target.value); }} InputProps={{ disableUnderline: true, @@ -211,7 +222,7 @@ const BucketLifecyclePanel = ({ itemActions={[]} columns={lifecycleColumns} isLoading={loadingLifecycle} - records={lifecycleRecords} + records={filteredRecords} entityName="Lifecycle" customEmptyMessage="There are no Lifecycle rules yet" idField="id" diff --git a/portal-ui/src/screens/Console/Buckets/BucketDetails/BucketReplicationPanel.tsx b/portal-ui/src/screens/Console/Buckets/BucketDetails/BucketReplicationPanel.tsx index b611942758..b038a223eb 100644 --- a/portal-ui/src/screens/Console/Buckets/BucketDetails/BucketReplicationPanel.tsx +++ b/portal-ui/src/screens/Console/Buckets/BucketDetails/BucketReplicationPanel.tsx @@ -72,6 +72,7 @@ const BucketReplicationPanel = ({ useState(false); const [openSetReplication, setOpenSetReplication] = useState(false); const [selectedRRule, setSelectedRRule] = useState(""); + const [filter, setFilter] = useState(""); const bucketName = match.params["bucketName"]; @@ -185,6 +186,19 @@ const BucketReplicationPanel = ({ }, ]; + const filteredRecords = replicationRules.filter( + (item: BucketReplicationRule) => { + if ( + (item.prefix && + item.prefix.toLowerCase().includes(filter.toLowerCase())) || + (item.tags && item.tags.toLowerCase().includes(filter.toLowerCase())) + ) { + return true; + } + return false; + } + ); + return ( {openSetReplication && ( @@ -211,7 +225,7 @@ const BucketReplicationPanel = ({ id="search-resource" label="" onChange={(event) => { - // setFilter(event.target.value); + setFilter(event.target.value); }} InputProps={{ disableUnderline: true, @@ -274,7 +288,7 @@ const BucketReplicationPanel = ({ { label: "Status", elementKey: "status" }, ]} isLoading={loadingReplication} - records={replicationRules} + records={filteredRecords} entityName="Replication Rules" idField="id" /> diff --git a/portal-ui/src/screens/Console/Tenants/TenantDetails/PodDetails.tsx b/portal-ui/src/screens/Console/Tenants/TenantDetails/PodDetails.tsx index 8ea877df62..72a468a3da 100644 --- a/portal-ui/src/screens/Console/Tenants/TenantDetails/PodDetails.tsx +++ b/portal-ui/src/screens/Console/Tenants/TenantDetails/PodDetails.tsx @@ -16,7 +16,6 @@ import React, { Fragment, useEffect, useState } from "react"; import { connect } from "react-redux"; -import get from "lodash/get"; import { createStyles, Theme, withStyles } from "@material-ui/core/styles"; import { actionsTray, @@ -28,29 +27,15 @@ import { } from "../../Common/FormComponents/common/styleLibrary"; import Grid from "@material-ui/core/Grid"; import { - Button, - IconButton, - Menu, - MenuItem, TextField, } from "@material-ui/core"; -import Tabs from "@material-ui/core/Tabs"; -import Tab from "@material-ui/core/Tab"; -import TableWrapper from "../../Common/TableWrapper/TableWrapper"; import Paper from "@material-ui/core/Paper"; import api from "../../../../common/api"; import PageHeader from "../../Common/PageHeader/PageHeader"; -import { ILog, ITenant } from "../ListTenants/types"; -import { LicenseInfo } from "../../License/types"; import { Link } from "react-router-dom"; import { setErrorSnackMessage } from "../../../../actions"; -import MoreVertIcon from "@material-ui/icons/MoreVert"; -import TenantYAML from "./TenantYAML"; -import SubnetLicenseTenant from "./SubnetLicenseTenant"; import InputAdornment from "@material-ui/core/InputAdornment"; import SearchIcon from "@material-ui/icons/Search"; -import history from "../../../../history"; -import { LogMessage } from "../../Logs/types"; interface ITenantDetailsProps { classes: any; @@ -165,8 +150,6 @@ const TenantDetails = ({ match, setErrorSnackMessage, }: ITenantDetailsProps) => { - const [selectedTab, setSelectedTab] = useState(0); - const [log, setLog] = useState(""); const [highlight, setHighlight] = useState(""); const [logLines, setLogLines] = useState([]); const tenantNamespace = match.params["tenantNamespace"]; @@ -225,13 +208,12 @@ const TenantDetails = ({ `/api/v1/namespaces/${tenantNamespace}/tenants/${tenantName}/pods/${podName}` ) .then((res: string) => { - setLog(res); setLogLines(res.split("\n")); }) .catch((err) => { setErrorSnackMessage(err); }); - }, [tenantNamespace, tenantName, podName]); + }, [tenantNamespace, tenantName, podName, setErrorSnackMessage]); return (