feat(grid): distinguish blank and null filters

Closes #5006
This commit is contained in:
t8y2 committed 2026-08-24 22:33:21 +00:00
1 parent f621e40655
commit e2fa810f2e
16 files changed
+146 -10

No files matched your search

@@ -36,6 +36,19 @@ describe("normalizeColumnFormatter", () => {
expect(normalizeColumnFormatter({ ...base, filter: { column: "dict_type", mode: "between", value: "A" } })).toBeUndefined();
expect(normalizeColumnFormatter({ ...base, filter: { column: "dict_type", mode: "raw-sql", value: "1=1" } })).toBeUndefined();
});
it.each(["is-blank", "is-not-blank"] as const)("preserves the value-less %s manual reference filter", (mode) => {
expect(
normalizeColumnFormatter({
kind: "foreign-key-display",
referenceMode: "manual",
refTable: "dictionary",
refColumn: "dict_key",
displayColumn: "dict_value",
filter: { column: "dict_type", mode },
}),
).toMatchObject({ filter: { column: "dict_type", mode, value: undefined, endValue: undefined } });
});
});
describe("normalizeSupportedDateTimePattern", () => {
@@ -4,7 +4,7 @@ import type { DataGridContextFilterMode } from "@/lib/dataGrid/dataGridSql";
describe("VictoriaMetrics data grid filters", () => {
it("does not expose SQL filter modes for MetricsQL results", () => {
const modes: DataGridContextFilterMode[] = ["equals", "not-equals", "is-null", "is-not-null", "like", "not-like", "less-than", "greater-than", "in", "not-in", "between", "not-between"];
const modes: DataGridContextFilterMode[] = ["equals", "not-equals", "is-null", "is-not-null", "is-blank", "is-not-blank", "like", "not-like", "less-than", "greater-than", "in", "not-in", "between", "not-between"];
expect(modes.every((mode) => !filterModeIsSupportedForDatabase(mode, "victoriametrics"))).toBe(true);
expect(filterModeIsSupportedForDatabase("equals", "postgres")).toBe(true);