feat(documents): pick documents from Paperless-ngx or Papra in the vault and wherever documents are linked

A settings card under Integrations connects either system and tests it
before saving. An import button beside Upload in Documents, on a
condition's documents card, and beside Add in the visit and vaccination
document pickers opens a sheet that searches by name with tag and date
filters, shows what HealthLog already holds, and imports the ticked
documents one at a time with a result per row. The buttons appear only
for a person in their own record with a connection; strings in all
seven languages.
This commit is contained in:
Marc-André Bombeck committed 2026-09-26 13:26:18 +02:00
1 parent 92f2cc729f
commit d109d67889
21 files changed
+2200 -20

No files matched your search

+23
View File
@@ -81,4 +81,27 @@ export const documentKeys = {
* toggle; a flip invalidates the document AI capability probe.
*/
documentsAutoAiRead: () => ["documents", "auto-ai-read"] as const,
/**
* The document picker (#1038): its own top-level prefix, deliberately NOT
* under `["documents"]`. Every vault write invalidates that prefix, and a
* search or tag read here is a request to the person's Paperless-ngx or
* Papra instance; a filing action in the vault must not re-send them.
*/
documentSources: () => ["documentSources"] as const,
/** Availability + the person's connections (`GET /api/documents/sources`). */
documentSourcesStatus: () => ["documentSources", "status"] as const,
/** One source's tags for the filter. */
documentSourceTags: (system: string) =>
["documentSources", "tags", system] as const,
/** One page of one source's search. */
documentSourceSearch: (system: string, search: DocumentSourceSearchKey) =>
["documentSources", "search", system, search] as const,
};
/** The facets that make one picker search distinct from another. */
export interface DocumentSourceSearchKey {
q: string;
tag?: string;
from?: string;
to?: string;
}