Fixed filter parameters.

This commit is contained in:
Mike Cao 2023-10-16 20:44:22 -07:00
parent b1d3970ea7
commit 81a810bd73
9 changed files with 36 additions and 44 deletions

View file

@ -7,7 +7,7 @@ import FieldAggregateForm from './FieldAggregateForm';
import FieldFilterForm from './FieldFilterForm';
import styles from './FieldAddForm.module.css';
export function FieldAddForm({ fields = [], group, element, onAdd, onClose }) {
export function FieldAddForm({ fields = [], group, onAdd, onClose }) {
const [selected, setSelected] = useState();
const handleSelect = value => {
@ -28,7 +28,7 @@ export function FieldAddForm({ fields = [], group, element, onAdd, onClose }) {
};
return createPortal(
<PopupForm className={styles.popup} element={element} onClose={onClose}>
<PopupForm className={styles.popup}>
{!selected && <FieldSelectForm fields={fields} onSelect={handleSelect} />}
{selected && group === REPORT_PARAMETERS.fields && (
<FieldAggregateForm {...selected} onSelect={handleSave} />