diff --git a/webview-ui/src/components/chat/CodeIndexPopover.tsx b/webview-ui/src/components/chat/CodeIndexPopover.tsx index 8ad621043e..6c26afc448 100644 --- a/webview-ui/src/components/chat/CodeIndexPopover.tsx +++ b/webview-ui/src/components/chat/CodeIndexPopover.tsx @@ -69,7 +69,6 @@ interface LocalCodeIndexSettings { codebaseIndexOpenAiCompatibleApiKey?: string codebaseIndexGeminiApiKey?: string codebaseIndexMistralApiKey?: string - codebaseIndexVertexApiKey?: string codebaseIndexVertexJsonCredentials?: string codebaseIndexVertexKeyFile?: string codebaseIndexVertexProjectId?: string @@ -144,7 +143,6 @@ const createValidationSchema = (provider: EmbedderProvider, t: any) => { return baseSchema .extend({ // At least one auth method is required - codebaseIndexVertexApiKey: z.string().optional(), codebaseIndexVertexJsonCredentials: z.string().optional(), codebaseIndexVertexKeyFile: z.string().optional(), codebaseIndexVertexProjectId: z @@ -157,16 +155,10 @@ const createValidationSchema = (provider: EmbedderProvider, t: any) => { .string() .min(1, t("settings:codeIndex.validation.modelSelectionRequired")), }) - .refine( - (data) => - data.codebaseIndexVertexApiKey || - data.codebaseIndexVertexJsonCredentials || - data.codebaseIndexVertexKeyFile, - { - message: t("settings:codeIndex.validation.vertexAuthRequired"), - path: ["codebaseIndexVertexApiKey"], - }, - ) + .refine((data) => data.codebaseIndexVertexJsonCredentials || data.codebaseIndexVertexKeyFile, { + message: t("settings:codeIndex.validation.vertexAuthRequired"), + path: ["codebaseIndexVertexJsonCredentials"], + }) default: return baseSchema @@ -212,7 +204,6 @@ export const CodeIndexPopover: React.FC = ({ codebaseIndexOpenAiCompatibleApiKey: "", codebaseIndexGeminiApiKey: "", codebaseIndexMistralApiKey: "", - codebaseIndexVertexApiKey: "", codebaseIndexVertexJsonCredentials: "", codebaseIndexVertexKeyFile: "", codebaseIndexVertexProjectId: "", @@ -251,7 +242,6 @@ export const CodeIndexPopover: React.FC = ({ codebaseIndexOpenAiCompatibleApiKey: "", codebaseIndexGeminiApiKey: "", codebaseIndexMistralApiKey: "", - codebaseIndexVertexApiKey: "", codebaseIndexVertexJsonCredentials: "", codebaseIndexVertexKeyFile: "", codebaseIndexVertexProjectId: codebaseIndexConfig.codebaseIndexVertexProjectId || "", @@ -350,9 +340,6 @@ export const CodeIndexPopover: React.FC = ({ if (!prev.codebaseIndexMistralApiKey || prev.codebaseIndexMistralApiKey === SECRET_PLACEHOLDER) { updated.codebaseIndexMistralApiKey = secretStatus.hasMistralApiKey ? SECRET_PLACEHOLDER : "" } - if (!prev.codebaseIndexVertexApiKey || prev.codebaseIndexVertexApiKey === SECRET_PLACEHOLDER) { - updated.codebaseIndexVertexApiKey = secretStatus.hasVertexApiKey ? SECRET_PLACEHOLDER : "" - } if ( !prev.codebaseIndexVertexJsonCredentials || prev.codebaseIndexVertexJsonCredentials === SECRET_PLACEHOLDER @@ -437,7 +424,6 @@ export const CodeIndexPopover: React.FC = ({ key === "codebaseIndexOpenAiCompatibleApiKey" || key === "codebaseIndexGeminiApiKey" || key === "codebaseIndexMistralApiKey" || - key === "codebaseIndexVertexApiKey" || key === "codebaseIndexVertexJsonCredentials" || key === "codebaseIndexVertexKeyFile" ) { @@ -1081,43 +1067,36 @@ export const CodeIndexPopover: React.FC = ({ {currentSettings.codebaseIndexEmbedderProvider === "vertex" && ( <> -
- -

- {t("settings:codeIndex.vertexAuthMethodDescription")} -

+
+
{t("settings:providers.googleCloudSetup.title")}
+
+ + {t("settings:providers.googleCloudSetup.step1")} + +
+
+ + {t("settings:providers.googleCloudSetup.step2")} + +
+
+ + {t("settings:providers.googleCloudSetup.step3")} + +
- updateSetting("codebaseIndexVertexApiKey", e.target.value) - } - placeholder={t("settings:codeIndex.vertexApiKeyPlaceholder")} - className={cn("w-full", { - "border-red-500": formErrors.codebaseIndexVertexApiKey, - })} - /> - {formErrors.codebaseIndexVertexApiKey && ( -

- {formErrors.codebaseIndexVertexApiKey} -

- )} -
- -
- - updateSetting( @@ -1125,9 +1104,7 @@ export const CodeIndexPopover: React.FC = ({ e.target.value, ) } - placeholder={t( - "settings:codeIndex.vertexJsonCredentialsPlaceholder", - )} + placeholder={t("settings:placeholders.credentialsJson")} className={cn("w-full", { "border-red-500": formErrors.codebaseIndexVertexJsonCredentials, })} @@ -1141,14 +1118,14 @@ export const CodeIndexPopover: React.FC = ({
updateSetting("codebaseIndexVertexKeyFile", e.target.value) } - placeholder={t("settings:codeIndex.vertexKeyFilePlaceholder")} + placeholder={t("settings:placeholders.keyFilePath")} className={cn("w-full", { "border-red-500": formErrors.codebaseIndexVertexKeyFile, })} @@ -1162,14 +1139,14 @@ export const CodeIndexPopover: React.FC = ({
updateSetting("codebaseIndexVertexProjectId", e.target.value) } - placeholder={t("settings:codeIndex.vertexProjectIdPlaceholder")} + placeholder={t("settings:placeholders.projectId")} className={cn("w-full", { "border-red-500": formErrors.codebaseIndexVertexProjectId, })} @@ -1183,7 +1160,7 @@ export const CodeIndexPopover: React.FC = ({