mirror of
https://github.com/rowyio/rowy.git
synced 2025-12-29 00:16:39 +01:00
add value formatter to reference field filter
This commit is contained in:
6
src/components/fields/Reference/filters.ts
Normal file
6
src/components/fields/Reference/filters.ts
Normal file
@@ -0,0 +1,6 @@
|
||||
import { DocumentReference } from "@google-cloud/firestore";
|
||||
|
||||
export const valueFormatter = (value: DocumentReference, operator: string) => {
|
||||
if (value && value.path) return value.path;
|
||||
return "";
|
||||
};
|
||||
@@ -6,6 +6,7 @@ import { Reference } from "@src/assets/icons";
|
||||
import DisplayCell from "./DisplayCell";
|
||||
import EditorCell from "./EditorCell";
|
||||
import { filterOperators } from "@src/components/fields/ShortText/Filter";
|
||||
import { valueFormatter } from "./filters";
|
||||
|
||||
const SideDrawerField = lazy(
|
||||
() =>
|
||||
@@ -27,6 +28,6 @@ export const config: IFieldConfig = {
|
||||
disablePadding: true,
|
||||
}),
|
||||
SideDrawerField,
|
||||
filter: { operators: filterOperators },
|
||||
filter: { operators: filterOperators, valueFormatter: valueFormatter },
|
||||
};
|
||||
export default config;
|
||||
|
||||
Reference in New Issue
Block a user