feat: preselect all entity types except IP, Datum and Referenz
Forms and the project-file command now preselect the backend's default_entity_types from /api/entity-types instead of every type. Older backends without that field fall back to all types except IP, DATUM and REFERENZ. Saved project selections are still loaded unchanged; the project-file command keeps excluding ORT by default as before. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
22
tests/entity-types.test.ts
Normal file
22
tests/entity-types.test.ts
Normal file
@@ -0,0 +1,22 @@
|
||||
import { expect, it } from "bun:test";
|
||||
import { entityTypeCatalog } from "../src/lib/entity-types";
|
||||
|
||||
const all = ["PERSON", "EMAIL", "REFERENZ", "ORT", "DATUM", "URL", "IP"];
|
||||
|
||||
it("uses the backend default selection when Velum reports one", () => {
|
||||
expect(
|
||||
entityTypeCatalog({
|
||||
entity_types: all,
|
||||
default_entity_types: ["PERSON", "IP", "UNBEKANNT"],
|
||||
}),
|
||||
).toEqual({ all, defaults: ["PERSON", "IP"] });
|
||||
});
|
||||
|
||||
it("leaves IP, Datum and Referenz off for backends without a default list", () => {
|
||||
expect(entityTypeCatalog({ entity_types: all }).defaults).toEqual([
|
||||
"PERSON",
|
||||
"EMAIL",
|
||||
"ORT",
|
||||
"URL",
|
||||
]);
|
||||
});
|
||||
Reference in New Issue
Block a user