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

@@ -32,6 +32,8 @@ import {
type EntityLinkOption,
} from "@/components/links/entity-link-picker";
import { useVaultDocumentOptions } from "@/components/links/vault-document-options";
import { ImportFromSourceButton } from "@/components/documents/sources/import-from-source-button";
import { mergeIds } from "@/components/documents/sources/merge-ids";
/** Fetch cap for the picker — the grouped sheet needs enough rows to group. */
export const PICKER_FETCH_LIMIT = 200;
@@ -152,6 +154,17 @@ export function EncounterLinkPickers({
options={documents.options}
searchPlaceholder={t("links.picker.searchPlaceholder")}
emptyLabel={t("encounters.form.linkNothingToOffer")}
extraAction={
// The form owns its selection and replaces the visit's links on
// save, so imported documents join the selection rather than
// being linked on the server.
<ImportFromSourceButton
className="min-h-9"
onImported={(ids) =>
onChange({ documentIds: mergeIds(documentIds, ids) })
}
/>
}
/>
) : null}