mirror of
https://github.com/MODSetter/SurfSense.git
synced 2026-05-12 17:22:38 +02:00
Some checks are pending
Build and Push Docker Images / tag_release (push) Waiting to run
Build and Push Docker Images / build (./surfsense_backend, ./surfsense_backend/Dockerfile, backend, surfsense-backend, ubuntu-24.04-arm, linux/arm64, arm64) (push) Blocked by required conditions
Build and Push Docker Images / build (./surfsense_backend, ./surfsense_backend/Dockerfile, backend, surfsense-backend, ubuntu-latest, linux/amd64, amd64) (push) Blocked by required conditions
Build and Push Docker Images / build (./surfsense_web, ./surfsense_web/Dockerfile, web, surfsense-web, ubuntu-24.04-arm, linux/arm64, arm64) (push) Blocked by required conditions
Build and Push Docker Images / build (./surfsense_web, ./surfsense_web/Dockerfile, web, surfsense-web, ubuntu-latest, linux/amd64, amd64) (push) Blocked by required conditions
Build and Push Docker Images / create_manifest (backend, surfsense-backend) (push) Blocked by required conditions
Build and Push Docker Images / create_manifest (web, surfsense-web) (push) Blocked by required conditions
18 lines
568 B
TypeScript
18 lines
568 B
TypeScript
type MentionKeyInput = {
|
|
id: number;
|
|
document_type?: string | null;
|
|
kind?: "doc" | "folder";
|
|
};
|
|
|
|
/**
|
|
* Build a stable dedup key for a mention chip.
|
|
*
|
|
* The ``kind:document_type:id`` shape prevents a document and a folder
|
|
* with the same integer id from colliding in the chip array (folders
|
|
* use the ``FOLDER`` sentinel ``document_type``; the ``kind`` prefix
|
|
* is the belt-and-braces guard).
|
|
*/
|
|
export function getMentionDocKey(doc: MentionKeyInput): string {
|
|
const kind = doc.kind ?? "doc";
|
|
return `${kind}:${doc.document_type ?? "UNKNOWN"}:${doc.id}`;
|
|
}
|