🙌 OpenHands: AI-Driven Development
Remove the "No secrets found" which is unnecessary (#10126)
mamoodi9c83a5623ff7
diff --git a/frontend/__tests__/routes/secrets-settings.test.tsx b/frontend/__tests__/routes/secrets-settings.test.tsxindex e290fe31b4..6207f61700 100644--- a/frontend/__tests__/routes/secrets-settings.test.tsx+++ b/frontend/__tests__/routes/secrets-settings.test.tsx@@ -112,12 +112,21 @@ describe("Content", () => {screen.getByTestId("git-settings-screen");});- it("should render a message if there are no existing secrets", async () => {+ it("should render an empty table when there are no existing secrets", async () => {const getSecretsSpy = vi.spyOn(SecretsService, "getSecrets");getSecretsSpy.mockResolvedValue([]);renderSecretsSettings();- await screen.findByTestId("no-secrets-message");+ // Should show the add secret button+ await screen.findByTestId("add-secret-button");++ // Should show an empty table with headers but no secret items+ expect(screen.queryAllByTestId("secret-item")).toHaveLength(0);++ // Should still show the table headers+ expect(screen.getByText("SETTINGS$NAME")).toBeInTheDocument();+ expect(screen.getByText("SECRETS$DESCRIPTION")).toBeInTheDocument();+ expect(screen.getByText("SETTINGS$ACTIONS")).toBeInTheDocument();});it("should render existing secrets", async () => {@@ -127,7 +136,6 @@ describe("Content", () => {const secrets = await screen.findAllByTestId("secret-item");expect(secrets).toHaveLength(2);- expect(screen.queryByTestId("no-secrets-message")).not.toBeInTheDocument();});});@@ -399,19 +407,22 @@ describe("Secret actions", () => {expect(screen.queryByText("My_Secret_2")).toBeInTheDocument();});- it("should hide the no items message when in form view", async () => {+ it("should hide the table and add button when in form view", async () => {const getSecretsSpy = vi.spyOn(SecretsService, "getSecrets");getSecretsSpy.mockResolvedValue([]);renderSecretsSettings();- // render form & hide items- expect(screen.queryByTestId("no-secrets-message")).not.toBeInTheDocument();+ // Initially should show the add button and tableconst button = await screen.findByTestId("add-secret-button");+ expect(screen.getByText("SETTINGS$NAME")).toBeInTheDocument(); // table header+await userEvent.click(button);+ // When in form view, should hide the add button and tableconst secretForm = screen.getByTestId("add-secret-form");expect(secretForm).toBeInTheDocument();- expect(screen.queryByTestId("no-secrets-message")).not.toBeInTheDocument();+ expect(screen.queryByTestId("add-secret-button")).not.toBeInTheDocument();+ expect(screen.queryByText("SETTINGS$NAME")).not.toBeInTheDocument(); // table header should be hidden});it("should not allow spaces in secret names", async () => {diff --git a/frontend/src/i18n/declaration.ts b/frontend/src/i18n/declaration.tsindex 5023968d80..ac0d434c61 100644--- a/frontend/src/i18n/declaration.ts+++ b/frontend/src/i18n/declaration.ts@@ -44,7 +44,6 @@ export enum I18nKey {SECRETS$SECRET_VALUE_REQUIRED = "SECRETS$SECRET_VALUE_REQUIRED",SECRETS$ADD_SECRET = "SECRETS$ADD_SECRET",SECRETS$EDIT_SECRET = "SECRETS$EDIT_SECRET",- SECRETS$NO_SECRETS_FOUND = "SECRETS$NO_SECRETS_FOUND",SECRETS$ADD_NEW_SECRET = "SECRETS$ADD_NEW_SECRET",SECRETS$CONFIRM_DELETE_KEY = "SECRETS$CONFIRM_DELETE_KEY",SETTINGS$MCP_TITLE = "SETTINGS$MCP_TITLE",diff --git a/frontend/src/i18n/translation.json b/frontend/src/i18n/translation.jsonindex 7574f62f41..649db1a435 100644--- a/frontend/src/i18n/translation.json+++ b/frontend/src/i18n/translation.json@@ -703,22 +703,6 @@"de": "Geheimnis bearbeiten","uk": "Редагувати секрет"},- "SECRETS$NO_SECRETS_FOUND": {- "en": "No secrets found",- "ja": "シークレットが見つかりません",- "zh-CN": "未找到密钥",- "zh-TW": "未找到密鑰",- "ko-KR": "비밀을 찾을 수 없습니다",- "no": "Ingen hemmeligheter funnet",- "it": "Nessun segreto trovato",- "pt": "Nenhum segredo encontrado",- "es": "No se encontraron secretos",- "ar": "لم يتم العثور على أسرار",- "fr": "Aucun secret trouvé",- "tr": "Gizli bulunamadı",- "de": "Keine Geheimnisse gefunden",- "uk": "Секретів не знайдено"- },"SECRETS$ADD_NEW_SECRET": {"en": "Add a new secret","ja": "新しいシークレットを追加",diff --git a/frontend/src/routes/secrets-settings.tsx b/frontend/src/routes/secrets-settings.tsxindex 6b8858e692..c48f029ec3 100644--- a/frontend/src/routes/secrets-settings.tsx+++ b/frontend/src/routes/secrets-settings.tsx@@ -96,10 +96,6 @@ function SecretsSettingsScreen() {</Link>)}- {secrets?.length === 0 && view === "list" && (- <p data-testid="no-secrets-message">{t("SECRETS$NO_SECRETS_FOUND")}</p>- )}-{!shouldRenderConnectToGitButton && view === "list" && (<BrandButtontestId="add-secret-button"