enumOptions and enum reader
This commit is contained in:
@@ -11,6 +11,7 @@ import {
|
||||
import DoneIcon from "@mui/icons-material/Done";
|
||||
import FilterListIcon from "@mui/icons-material/FilterList";
|
||||
import { ResourceField, ResourceMode } from "../types/config";
|
||||
import { getFieldOptions } from "../utils/options";
|
||||
|
||||
function FilterAutocomplete({
|
||||
options,
|
||||
@@ -110,7 +111,9 @@ function extractOptions(
|
||||
): string[] {
|
||||
const values = new Set<string>();
|
||||
|
||||
if (field.options) return field.options;
|
||||
if (field.type === 'enum' && field.options) {
|
||||
return getFieldOptions(field).map(o => o.key);
|
||||
}
|
||||
if (!data) return [];
|
||||
|
||||
const pull = (item: any): string | null => {
|
||||
|
||||
Reference in New Issue
Block a user