From fb95b44242b2d75f62b8968a3ad29387bea2aa65 Mon Sep 17 00:00:00 2001 From: Asier Isayas Date: Fri, 17 Oct 2025 11:39:25 -0700 Subject: [PATCH] Add multiple languages for Full Text Search Policy --- .../FullTextPoliciesComponent.tsx | 25 ++++++++++++++++--- .../AddCollectionPanel/AddCollectionPanel.tsx | 1 + 2 files changed, 22 insertions(+), 4 deletions(-) diff --git a/src/Explorer/Controls/FullTextSeach/FullTextPoliciesComponent.tsx b/src/Explorer/Controls/FullTextSeach/FullTextPoliciesComponent.tsx index 8972791ce..79ad20bcd 100644 --- a/src/Explorer/Controls/FullTextSeach/FullTextPoliciesComponent.tsx +++ b/src/Explorer/Controls/FullTextSeach/FullTextPoliciesComponent.tsx @@ -22,6 +22,7 @@ export interface FullTextPoliciesComponentProps { ) => void; discardChanges?: boolean; onChangesDiscarded?: () => void; + englishOnly?: boolean; } export interface FullTextPolicyData { @@ -66,6 +67,7 @@ export const FullTextPoliciesComponent: React.FunctionComponent { const getFullTextPathError = (path: string, index?: number): string => { let error = ""; @@ -87,6 +89,7 @@ export const FullTextPoliciesComponent: React.FunctionComponent ({ ...fullTextPath, pathError: getFullTextPathError(fullTextPath.path), @@ -166,7 +169,7 @@ export const FullTextPoliciesComponent: React.FunctionComponent, option: IDropdownOption) => setDefaultLanguage(option.key as never) @@ -211,7 +214,7 @@ export const FullTextPoliciesComponent: React.FunctionComponent, option: IDropdownOption) => onFullTextPathPolicyChange(index, option) @@ -229,11 +232,25 @@ export const FullTextPoliciesComponent: React.FunctionComponent { - return [ +export const getFullTextLanguageOptions = (englishOnly?: boolean): IDropdownOption[] => { + const fullTextLanguageOptions: IDropdownOption[] = [ { key: "en-US", text: "English (US)", }, + { + key: "fr-FR", + text: "French", + }, + { + key: "de-DE", + text: "German", + }, + { + key: "es-ES", + text: "Spanish", + }, ]; + + return englishOnly ? [fullTextLanguageOptions[0]] : fullTextLanguageOptions; }; diff --git a/src/Explorer/Panes/AddCollectionPanel/AddCollectionPanel.tsx b/src/Explorer/Panes/AddCollectionPanel/AddCollectionPanel.tsx index 6162361d6..b8d03cb19 100644 --- a/src/Explorer/Panes/AddCollectionPanel/AddCollectionPanel.tsx +++ b/src/Explorer/Panes/AddCollectionPanel/AddCollectionPanel.tsx @@ -893,6 +893,7 @@ export class AddCollectionPanel extends React.Component { this.setState({ fullTextPolicy, fullTextIndexes, fullTextPolicyValidated }); }} + englishOnly={true} />