forked from r.muellner/velum-raycast
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:
@@ -62,6 +62,7 @@ export default function Command() {
|
||||
const [sessions, setSessions] = useState<VelumSession[]>([]);
|
||||
const [activeSessionId, setActiveSessionId] = useState<string>();
|
||||
const [entityTypes, setEntityTypes] = useState<EntityType[]>([]);
|
||||
const [defaultEntityTypes, setDefaultEntityTypes] = useState<EntityType[]>([]);
|
||||
const [selectedEntityTypes, setSelectedEntityTypes] = useState<string[]>([]);
|
||||
const [greeting, setGreeting] = useState("Lieber");
|
||||
const [signOff, setSignOff] = useState("Alles Liebe,");
|
||||
@@ -99,8 +100,9 @@ export default function Command() {
|
||||
|
||||
try {
|
||||
const loadedEntityTypes = await getEntityTypes();
|
||||
setEntityTypes(loadedEntityTypes);
|
||||
setSelectedEntityTypes(loadedEntityTypes);
|
||||
setEntityTypes(loadedEntityTypes.all);
|
||||
setDefaultEntityTypes(loadedEntityTypes.defaults);
|
||||
setSelectedEntityTypes(loadedEntityTypes.defaults);
|
||||
} catch {
|
||||
setEntityTypes([]);
|
||||
} finally {
|
||||
@@ -299,7 +301,8 @@ export default function Command() {
|
||||
/>
|
||||
<Form.Separator />
|
||||
<ContextPicker sessions={sessions} activeSessionId={activeSessionId}
|
||||
availableEntityTypes={entityTypes} onEntityTypesChange={setSelectedEntityTypes} />
|
||||
availableEntityTypes={entityTypes} defaultEntityTypes={defaultEntityTypes}
|
||||
onEntityTypesChange={setSelectedEntityTypes} />
|
||||
{entityTypes.length > 0 ? (
|
||||
<Form.TagPicker
|
||||
id="entityTypes"
|
||||
|
||||
Reference in New Issue
Block a user