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
import { LokiPanel } from '../../components/common/Loki/LokiPanel';
import { useHistory } from "react-router-dom";
import { formatDate, initRequestParams } from '../../components/common/Helper';
import { SearchBar } from '../../components/common/SearchBar/SearchBar';
const useStyles = makeStyles((theme) => ({
secondItem: {
......@@ -31,7 +30,6 @@ const useStyles = makeStyles((theme) => ({
export function HostDetailsView({ id }) {
const [host] = useHost(id);
const [iocs, getIocs, /*reset*/, loading] = useHostIOCList();
const [query, setQuery] = useState();
const [deployedIocs, setDeployedIocs] = useState([]);
const history = useHistory();
const classes = useStyles();
......@@ -57,12 +55,7 @@ export function HostDetailsView({ id }) {
getIocs(requestParams);
}, [getIocs, lazyParams, columnSort, id])
useEffect(() => setDeployedIocs((iocs?.deployedList ?? []).filter(ioc => ioc.namingName.toLowerCase().includes(query) ||
(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]);
useEffect(() => setDeployedIocs(iocs?.deployedList ?? []), [iocs]);
const renderHost = { ...host?.csEntryHost };
delete renderHost.id;
......@@ -84,16 +77,14 @@ export function HostDetailsView({ id }) {
</IconButton>
{host && <HostBadge host={host} />}
<SimpleAccordion summary="Deployed IOCs" defaultExpanded>
<SearchBar search={setQuery} loading={loading}>
<Hidden smUp>
<IOCList iocs={deployedIocs} />
</Hidden>
<Hidden xsDown>
<IOCTable iocs={deployedIocs} rowType="host"
totalCount={iocs.totalCount} lazyParams={lazyParams} setLazyParams={setLazyParams} columnSort={columnSort} setColumnSort={setColumnSort}
rowsPerPage={rowsPerPage}/>
</Hidden>
</SearchBar>
<Hidden smUp>
<IOCList iocs={deployedIocs} loading={loading}/>
</Hidden>
<Hidden xsDown>
<IOCTable iocs={deployedIocs} loading={loading} rowType="host"
totalCount={iocs.totalCount} lazyParams={lazyParams} setLazyParams={setLazyParams} columnSort={columnSort} setColumnSort={setColumnSort}
rowsPerPage={rowsPerPage}/>
</Hidden>
</SimpleAccordion>
<SimpleAccordion summary="Syslog info" defaultExpanded>
{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