Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
[frontend] ListFiltersWihoutLocalStorage to tsx
  • Loading branch information
Archidoit committed Feb 24, 2026
commit 034d44b1e71bdcef2b638289d2915c3c76bd51e7
Original file line number Diff line number Diff line change
Expand Up @@ -4,22 +4,18 @@ import { FilterListOutlined } from '@mui/icons-material';
import Popover from '@mui/material/Popover';
import Tooltip from '@mui/material/Tooltip';
import { RayEndArrow, RayStartArrow } from 'mdi-material-ui';
import React from 'react';
import makeStyles from '@mui/styles/makeStyles';
import React, { ReactElement } from 'react';
import { useFormatter } from '../../../../components/i18n';

// Deprecated - https://mui.com/system/styles/basics/
// Do not use it for new code.
const useStyles = makeStyles(() => ({
filters: {
float: 'left',
margin: '-3px 0 0 -5px',
},
container: {
width: 600,
padding: 20,
},
}));
interface ListFiltersWithoutLocalStorageProps {
handleOpenFilters: (event: React.SyntheticEvent) => void;
handleCloseFilters: () => void;
open: boolean;
anchorEl: Element | null;
filterElement: ReactElement;
variant?: string;
type?: string;
}

const ListFiltersWithoutLocalStorage = ({
handleOpenFilters,
Expand All @@ -29,12 +25,11 @@ const ListFiltersWithoutLocalStorage = ({
filterElement,
variant,
type,
}) => {
}: ListFiltersWithoutLocalStorageProps) => {
const { t_i18n } = useFormatter();
const classes = useStyles();
let icon = <FilterListOutlined fontSize="medium" />;
let tooltip = t_i18n('Filters');
// let color = 'primary';
// let color: 'primary' | 'warning' | 'success' = 'primary';
if (type === 'from') {
icon = <RayStartArrow fontSize="medium" />;
tooltip = t_i18n('Dynamic source filters');
Expand All @@ -45,7 +40,12 @@ const ListFiltersWithoutLocalStorage = ({
// color = 'success';
}
return (
<div className={classes.filters}>
<div
style={{
float: 'left',
margin: '-3px 0 0 -5px',
}}
>
{variant === 'text' ? (
<Tooltip title={tooltip}>
<Button
Expand All @@ -68,7 +68,12 @@ const ListFiltersWithoutLocalStorage = ({
</Tooltip>
)}
<Popover
classes={{ paper: classes.container }}
sx={{
'& .MuiPaper-root': {
width: 600,
padding: 20,
},
}}
open={open}
anchorEl={anchorEl}
onClose={handleCloseFilters}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ const SearchScopeElement = ({
setSearchScope,
availableRelationFilterTypes,
}: SearchScopeElementProps) => {
console.log('test');
const { t_i18n } = useFormatter();
const [anchorElSearchScope, setAnchorElSearchScope] = useState<PopoverProps['anchorEl']>();
const { stixCoreObjectTypes: entityTypes } = useAttributes();
Expand Down