fix(smb-ui): use metadata.smb_source instead of from_ingestion_api for SMB detection
The previous attempt added document.from_ingestion_api to the SMB UI patch to distinguish API-ingested SMB files from normal File uploads after we switched the connector source from ingestion_api to file. This caused a TypeScript build error because from_ingestion_api is not exposed on the frontend document types (OnyxDocument / SearchDocWithContent). Fix: rely on document.metadata?.smb_source instead. - The connector injects metadata.smb_source on every SMB document (files and index), so it is a reliable discriminator. - Normal File uploads via the UI never carry this metadata key, so the preview-suppression and clipboard-copy behavior remains scoped to SMB docs only. Updated in both locations of branding/smb/smb-ui.patch: - SearchCard.tsx (licensed search view click handler) - lib/search/utils.ts (chat citation openDocument helper)
This commit is contained in:
parent
d4cb8dcb99
commit
9d5ee01217
1 changed files with 2 additions and 2 deletions
|
|
@ -37,7 +37,7 @@ index 42fb3bd8..5ee25228 100644
|
|||
+ // browsable link and no stored file to preview — the preview pane would just
|
||||
+ // fail. Copy the logical path to the clipboard so the user can open the file
|
||||
+ // directly on the share. Mirrors openDocument() used by the chat view.
|
||||
+ if (document.from_ingestion_api || document.metadata?.smb_source) {
|
||||
+ if (document.metadata?.smb_source) {
|
||||
+ // The full network path is in metadata.logical_path (the search result does
|
||||
+ // not always carry `link`); semantic_identifier is only the file name.
|
||||
+ const logicalPath = document.metadata?.logical_path;
|
||||
|
|
@ -76,7 +76,7 @@ index ce7eab36..6e4baff3 100644
|
|||
+ // browsable link and no stored file to preview — a normal preview click would
|
||||
+ // just fail. Instead, surface the logical path by copying it to the clipboard
|
||||
+ // so the user can open the file directly on the share.
|
||||
+ if (document.from_ingestion_api || document.metadata?.smb_source) {
|
||||
+ if (document.metadata?.smb_source) {
|
||||
+ // The full network path is in metadata.logical_path (the citation object
|
||||
+ // does not always carry `link`); semantic_identifier is only the file name.
|
||||
+ const path =
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue