feat: add cross-integration entity references (#1862)
* feat: add cross-integration entity references * fix(web): anchor entity reference menu to composer * fix: keep Kandev tasks under @ mentions * fix: address entity reference review findings * test(e2e): use option role for prompt menu * test(e2e): update passthrough mention roles * fix: preserve queued references and paginate Azure PRs
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
import type { EntityReference, EntityReferenceSearchGroup } from "@/lib/types/entity-reference";
|
||||
|
||||
export function visibleEntityReferenceGroups(
|
||||
groups: readonly EntityReferenceSearchGroup[],
|
||||
): EntityReferenceSearchGroup[] {
|
||||
return groups.filter(
|
||||
(group) =>
|
||||
group.source !== "kandev_tasks" &&
|
||||
group.status !== "not_configured" &&
|
||||
group.status !== "unsupported_scope" &&
|
||||
(group.status !== "ok" || group.results.length > 0),
|
||||
);
|
||||
}
|
||||
|
||||
export function selectableEntityReferences(
|
||||
groups: readonly EntityReferenceSearchGroup[],
|
||||
): EntityReference[] {
|
||||
return visibleEntityReferenceGroups(groups).flatMap((group) =>
|
||||
group.status === "ok" ? group.results : [],
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user