Changed embedding configuration field texts

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
Archie Agarwal
2026-09-08 12:59:29 +05:30
parent d0d69e2ce6
commit d4fd0150e9
4 changed files with 61 additions and 19 deletions
@@ -108,12 +108,12 @@ describe("VectorEmbeddingPoliciesComponent - embedding source", () => {
}); });
const expandSection = () => { const expandSection = () => {
const header = screen.getByRole("button", { name: /Embedding source/ }); const header = screen.getByRole("button", { name: /Embedding Configuration/ });
fireEvent.click(header); fireEvent.click(header);
}; };
test("renders the embedding source accordion collapsed by default with no errors", () => { test("renders the embedding source accordion collapsed by default with no errors", () => {
expect(screen.getByText("Embedding source (Preview)")).toBeInTheDocument(); expect(screen.getByText("Embedding Configuration (Preview)")).toBeInTheDocument();
expect(view.container.querySelector("#vector-policy-embeddingSource-sourcePaths-1")).toBeNull(); expect(view.container.querySelector("#vector-policy-embeddingSource-sourcePaths-1")).toBeNull();
const lastCall = onChange.mock.calls[onChange.mock.calls.length - 1]; const lastCall = onChange.mock.calls[onChange.mock.calls.length - 1];
expect(lastCall[2]).toBe(true); expect(lastCall[2]).toBe(true);
@@ -127,6 +127,18 @@ describe("VectorEmbeddingPoliciesComponent - embedding source", () => {
expect(view.container.querySelector("#vector-policy-embeddingSource-modelName-1")).not.toBeNull(); expect(view.container.querySelector("#vector-policy-embeddingSource-modelName-1")).not.toBeNull();
expect(view.container.querySelector("#vector-policy-embeddingSource-endpoint-1")).not.toBeNull(); expect(view.container.querySelector("#vector-policy-embeddingSource-endpoint-1")).not.toBeNull();
expect(view.container.querySelector("#vector-policy-embeddingSource-authType-1")).not.toBeNull(); expect(view.container.querySelector("#vector-policy-embeddingSource-authType-1")).not.toBeNull();
expect(screen.getByPlaceholderText("/title, /description")).toBeInTheDocument();
expect(screen.getAllByPlaceholderText("text-embedding-3-small")).toHaveLength(2);
expect(screen.getByPlaceholderText("https://<foundry-resource-name>.openai.azure.com/")).toBeInTheDocument();
expect(screen.getByText("Embedding model name")).toBeInTheDocument();
expect(screen.getByText("Microsoft Foundry Endpoint")).toBeInTheDocument();
expect(
screen.getByLabelText(
"The item property paths whose values are used as input for embedding generation. Enter multiple values separated by commas, for example /title, /description.",
),
).toBeInTheDocument();
expect(screen.getByLabelText("Microsoft Foundry model deployment name")).toBeInTheDocument();
expect(screen.getByLabelText("Microsoft Foundry model name")).toBeInTheDocument();
expect(screen.queryByText("At least one source path is required")).toBeNull(); expect(screen.queryByText("At least one source path is required")).toBeNull();
expect(screen.queryByText("Deployment name is required")).toBeNull(); expect(screen.queryByText("Deployment name is required")).toBeNull();
}); });
@@ -270,7 +282,7 @@ describe("VectorEmbeddingPoliciesComponent - embedding source gating", () => {
onVectorEmbeddingChange={jest.fn()} onVectorEmbeddingChange={jest.fn()}
/>, />,
); );
expect(screen.queryByText("Embedding source (Preview)")).toBeNull(); expect(screen.queryByText("Embedding Configuration (Preview)")).toBeNull();
expect(view.container.querySelector("#vector-policy-embeddingSource-sourcePaths-1")).toBeNull(); expect(view.container.querySelector("#vector-policy-embeddingSource-sourcePaths-1")).toBeNull();
expect(view.container.querySelector("#vector-policy-embeddingSource-deploymentName-1")).toBeNull(); expect(view.container.querySelector("#vector-policy-embeddingSource-deploymentName-1")).toBeNull();
expect(view.container.querySelector("#vector-policy-embeddingSource-modelName-1")).toBeNull(); expect(view.container.querySelector("#vector-policy-embeddingSource-modelName-1")).toBeNull();
@@ -1,4 +1,4 @@
import { Dropdown, IDropdownOption, Label, Stack, TextField } from "@fluentui/react"; import { Dropdown, Icon, IDropdownOption, Label, Stack, TextField, TooltipHost } from "@fluentui/react";
import { CollapsibleSectionComponent } from "Explorer/Controls/CollapsiblePanel/CollapsibleSectionComponent"; import { CollapsibleSectionComponent } from "Explorer/Controls/CollapsiblePanel/CollapsibleSectionComponent";
import { VectorEmbeddingSource } from "Contracts/DataModels"; import { VectorEmbeddingSource } from "Contracts/DataModels";
import { import {
@@ -21,6 +21,23 @@ export interface IVectorEmbeddingSourceComponentProps {
const defaultAuthType: VectorEmbeddingSource["authType"] = "Entra"; const defaultAuthType: VectorEmbeddingSource["authType"] = "Entra";
interface EmbeddingSourceLabelProps {
disabled: boolean;
label: string;
tooltip?: string;
}
const EmbeddingSourceLabel = ({ disabled, label, tooltip }: EmbeddingSourceLabelProps): JSX.Element => (
<Label disabled={disabled} styles={labelStyles}>
{label}
{tooltip && (
<TooltipHost content={tooltip} styles={{ root: { display: "inline-block", marginLeft: 4 } }}>
<Icon iconName="Info" ariaLabel={tooltip} tabIndex={0} />
</TooltipHost>
)}
</Label>
);
const validateSourcePaths = (raw: string): string => { const validateSourcePaths = (raw: string): string => {
const parsed = parseSourcePaths(raw); const parsed = parseSourcePaths(raw);
if (parsed.length === 0) { if (parsed.length === 0) {
@@ -128,9 +145,11 @@ export const VectorEmbeddingSourceComponent: FunctionComponent<IVectorEmbeddingS
> >
<Stack style={{ marginLeft: "10px", marginTop: 4 }} tokens={{ childrenGap: 4 }}> <Stack style={{ marginLeft: "10px", marginTop: 4 }} tokens={{ childrenGap: 4 }}>
<Stack> <Stack>
<Label disabled={disabled} styles={labelStyles}> <EmbeddingSourceLabel
{t(Keys.controls.vectorEmbeddingPolicies.sourcePaths)} disabled={disabled}
</Label> label={t(Keys.controls.vectorEmbeddingPolicies.sourcePaths)}
tooltip={t(Keys.controls.vectorEmbeddingPolicies.sourcePathsTooltip)}
/>
<TextField <TextField
disabled={disabled} disabled={disabled}
id={`vector-policy-embeddingSource-sourcePaths-${suffix}`} id={`vector-policy-embeddingSource-sourcePaths-${suffix}`}
@@ -143,13 +162,16 @@ export const VectorEmbeddingSourceComponent: FunctionComponent<IVectorEmbeddingS
/> />
</Stack> </Stack>
<Stack> <Stack>
<Label disabled={disabled} styles={labelStyles}> <EmbeddingSourceLabel
{t(Keys.controls.vectorEmbeddingPolicies.deploymentName)} disabled={disabled}
</Label> label={t(Keys.controls.vectorEmbeddingPolicies.deploymentName)}
tooltip={t(Keys.controls.vectorEmbeddingPolicies.deploymentNameTooltip)}
/>
<TextField <TextField
disabled={disabled} disabled={disabled}
id={`vector-policy-embeddingSource-deploymentName-${suffix}`} id={`vector-policy-embeddingSource-deploymentName-${suffix}`}
data-test={`VectorEmbeddingSource/DeploymentName/${suffix}`} data-test={`VectorEmbeddingSource/DeploymentName/${suffix}`}
placeholder={t(Keys.controls.vectorEmbeddingPolicies.deploymentNamePlaceholder)}
styles={textFieldStyles} styles={textFieldStyles}
value={deploymentName} value={deploymentName}
onChange={(_event, newValue) => setDeploymentName(newValue || "")} onChange={(_event, newValue) => setDeploymentName(newValue || "")}
@@ -157,13 +179,16 @@ export const VectorEmbeddingSourceComponent: FunctionComponent<IVectorEmbeddingS
/> />
</Stack> </Stack>
<Stack> <Stack>
<Label disabled={disabled} styles={labelStyles}> <EmbeddingSourceLabel
{t(Keys.controls.vectorEmbeddingPolicies.modelName)} disabled={disabled}
</Label> label={t(Keys.controls.vectorEmbeddingPolicies.modelName)}
tooltip={t(Keys.controls.vectorEmbeddingPolicies.modelNameTooltip)}
/>
<TextField <TextField
disabled={disabled} disabled={disabled}
id={`vector-policy-embeddingSource-modelName-${suffix}`} id={`vector-policy-embeddingSource-modelName-${suffix}`}
data-test={`VectorEmbeddingSource/ModelName/${suffix}`} data-test={`VectorEmbeddingSource/ModelName/${suffix}`}
placeholder={t(Keys.controls.vectorEmbeddingPolicies.modelNamePlaceholder)}
styles={textFieldStyles} styles={textFieldStyles}
value={modelName} value={modelName}
onChange={(_event, newValue) => setModelName(newValue || "")} onChange={(_event, newValue) => setModelName(newValue || "")}
@@ -52,7 +52,7 @@ export const VectorSearchComponent = (props: VectorSearchComponentProps): JSX.El
setVectorIndexingPolicy(vectorIndexingPolicy); setVectorIndexingPolicy(vectorIndexingPolicy);
setVectorPolicyValidated(vectorPolicyValidated); setVectorPolicyValidated(vectorPolicyValidated);
}} }}
isGlobalSecondaryIndexTarget={isGlobalSecondaryIndexTarget} isGlobalSecondaryIndex={isGlobalSecondaryIndexTarget}
/> />
</Stack> </Stack>
</Stack> </Stack>
+10 -5
View File
@@ -996,14 +996,19 @@
"indexingSearchListSize": "Indexing search list size", "indexingSearchListSize": "Indexing search list size",
"vectorIndexShardKey": "Vector index shard key", "vectorIndexShardKey": "Vector index shard key",
"addVectorEmbedding": "Add vector embedding", "addVectorEmbedding": "Add vector embedding",
"embeddingSourceSection": "Embedding source", "embeddingSourceSection": "Embedding Configuration",
"embeddingSourceTooltip": "Configure Cosmos DB to auto-generate the vector from one or more source paths using a Microsoft Foundry deployment. Leave all fields empty to skip auto-generation.", "embeddingSourceTooltip": "Configure Cosmos DB to auto-generate the vector from one or more source paths using a Microsoft Foundry deployment. Leave all fields empty to skip auto-generation.",
"sourcePaths": "Source paths", "sourcePaths": "Source paths",
"sourcePathsPlaceholder": "/description, /title", "sourcePathsTooltip": "The item property paths whose values are used as input for embedding generation. Enter multiple values separated by commas, for example /title, /description.",
"sourcePathsPlaceholder": "/title, /description",
"deploymentName": "Deployment name", "deploymentName": "Deployment name",
"modelName": "Model name", "deploymentNameTooltip": "Microsoft Foundry model deployment name",
"endpoint": "Endpoint", "deploymentNamePlaceholder": "text-embedding-3-small",
"endpointPlaceholder": "https://<your-foundry-endpoint>", "modelName": "Embedding model name",
"modelNameTooltip": "Microsoft Foundry model name",
"modelNamePlaceholder": "text-embedding-3-small",
"endpoint": "Microsoft Foundry Endpoint",
"endpointPlaceholder": "https://<foundry-resource-name>.openai.azure.com/",
"authType": "Authentication type", "authType": "Authentication type",
"pathEmptyError": "Path should not be empty", "pathEmptyError": "Path should not be empty",
"pathDuplicateError": "Path is already defined", "pathDuplicateError": "Path is already defined",