diff --git a/src/content/journal-entries/2024-11-21.md b/src/content/journal-entries/2024-11-21.md new file mode 100644 index 0000000..63a4f0d --- /dev/null +++ b/src/content/journal-entries/2024-11-21.md @@ -0,0 +1,8 @@ +--- +title: React-Admin Wrestling, a Little More Elasticsearch +date: 2024-11-21 +--- + +React-admin is a wonderful framework, and is quite flexible; but if you need something that it doesn't offer, it's very difficult to dig through the docs to find out how to do it. + +Today, I needed to add a conditional filter on a List page. The `List` component takes a `filters` prop, which is an Array of `*Input` components. It does not accept a component to act as a wrapper or container around the `*Input`s. The task was to have a "From Official Clipper?" filter (a boolean switch) for the Clips list; and if it's unchecked, the List should then show a "Has Potential?" filter (another boolean switch), defaulting to `false`. If "From Official Clipper?" is checked, then the "Has Potential?" filter should be disabled, because it's assumed clips made official clippers have potential.