Skip to content
Snippets Groups Projects
Commit a57078b7 authored by John Sparger's avatar John Sparger
Browse files

Remove SearchBar and client-side filtering code from HostDetailsView as quick...

Remove SearchBar and client-side filtering code from HostDetailsView as quick fix for UI crash from stale code.
parent 70d8943f
No related branches found
No related tags found
2 merge requests!139Merge before release,!112Remove SearchBar and client-side filtering code from HostDetailsView as quick fix for UI crash from stale code.
...@@ -20,7 +20,6 @@ import { KeyValueTable } from '../../components/common/KeyValueTable/KeyValueTab ...@@ -20,7 +20,6 @@ import { KeyValueTable } from '../../components/common/KeyValueTable/KeyValueTab
import { LokiPanel } from '../../components/common/Loki/LokiPanel'; import { LokiPanel } from '../../components/common/Loki/LokiPanel';
import { useHistory } from "react-router-dom"; import { useHistory } from "react-router-dom";
import { formatDate, initRequestParams } from '../../components/common/Helper'; import { formatDate, initRequestParams } from '../../components/common/Helper';
import { SearchBar } from '../../components/common/SearchBar/SearchBar';
const useStyles = makeStyles((theme) => ({ const useStyles = makeStyles((theme) => ({
secondItem: { secondItem: {
...@@ -31,7 +30,6 @@ const useStyles = makeStyles((theme) => ({ ...@@ -31,7 +30,6 @@ const useStyles = makeStyles((theme) => ({
export function HostDetailsView({ id }) { export function HostDetailsView({ id }) {
const [host] = useHost(id); const [host] = useHost(id);
const [iocs, getIocs, /*reset*/, loading] = useHostIOCList(); const [iocs, getIocs, /*reset*/, loading] = useHostIOCList();
const [query, setQuery] = useState();
const [deployedIocs, setDeployedIocs] = useState([]); const [deployedIocs, setDeployedIocs] = useState([]);
const history = useHistory(); const history = useHistory();
const classes = useStyles(); const classes = useStyles();
...@@ -57,12 +55,7 @@ export function HostDetailsView({ id }) { ...@@ -57,12 +55,7 @@ export function HostDetailsView({ id }) {
getIocs(requestParams); getIocs(requestParams);
}, [getIocs, lazyParams, columnSort, id]) }, [getIocs, lazyParams, columnSort, id])
useEffect(() => setDeployedIocs((iocs?.deployedList ?? []).filter(ioc => ioc.namingName.toLowerCase().includes(query) || useEffect(() => setDeployedIocs(iocs?.deployedList ?? []), [iocs]);
(ioc.host && ioc.host.toLowerCase().includes(query)) ||
ioc.git.toLowerCase().includes(query) ||
ioc.version.toLowerCase().includes(query) ||
ioc.owner.toLowerCase().includes(query) ||
(ioc.status && ioc.status.toLowerCase().includes(query)))), [query, iocs]);
const renderHost = { ...host?.csEntryHost }; const renderHost = { ...host?.csEntryHost };
delete renderHost.id; delete renderHost.id;
...@@ -84,16 +77,14 @@ export function HostDetailsView({ id }) { ...@@ -84,16 +77,14 @@ export function HostDetailsView({ id }) {
</IconButton> </IconButton>
{host && <HostBadge host={host} />} {host && <HostBadge host={host} />}
<SimpleAccordion summary="Deployed IOCs" defaultExpanded> <SimpleAccordion summary="Deployed IOCs" defaultExpanded>
<SearchBar search={setQuery} loading={loading}> <Hidden smUp>
<Hidden smUp> <IOCList iocs={deployedIocs} loading={loading}/>
<IOCList iocs={deployedIocs} /> </Hidden>
</Hidden> <Hidden xsDown>
<Hidden xsDown> <IOCTable iocs={deployedIocs} loading={loading} rowType="host"
<IOCTable iocs={deployedIocs} rowType="host" totalCount={iocs.totalCount} lazyParams={lazyParams} setLazyParams={setLazyParams} columnSort={columnSort} setColumnSort={setColumnSort}
totalCount={iocs.totalCount} lazyParams={lazyParams} setLazyParams={setLazyParams} columnSort={columnSort} setColumnSort={setColumnSort} rowsPerPage={rowsPerPage}/>
rowsPerPage={rowsPerPage}/> </Hidden>
</Hidden>
</SearchBar>
</SimpleAccordion> </SimpleAccordion>
<SimpleAccordion summary="Syslog info" defaultExpanded> <SimpleAccordion summary="Syslog info" defaultExpanded>
{host && {host &&
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment