mirror of
https://github.com/OpenHands/OpenHands.git
synced 2025-12-26 05:48:36 +08:00
Change API key placeholder to <hidden> when key is set (#7427)
Co-authored-by: openhands <openhands@all-hands.dev>
This commit is contained in:
parent
0a0ed3f606
commit
8dda45bf99
@ -112,7 +112,7 @@ describe("Settings Screen", () => {
|
||||
});
|
||||
});
|
||||
|
||||
it("should set asterik placeholder if the GitHub token is set", async () => {
|
||||
it("should set '<hidden>' placeholder if the GitHub token is set", async () => {
|
||||
getSettingsSpy.mockResolvedValue({
|
||||
...MOCK_DEFAULT_USER_SETTINGS,
|
||||
github_token_is_set: true,
|
||||
@ -122,7 +122,7 @@ describe("Settings Screen", () => {
|
||||
|
||||
await waitFor(() => {
|
||||
const input = screen.getByTestId("github-token-input");
|
||||
expect(input).toHaveProperty("placeholder", "**********");
|
||||
expect(input).toHaveProperty("placeholder", "<hidden>");
|
||||
});
|
||||
});
|
||||
|
||||
@ -410,7 +410,7 @@ describe("Settings Screen", () => {
|
||||
});
|
||||
});
|
||||
|
||||
it("should set asterik placeholder if the LLM API key is set", async () => {
|
||||
it("should set '<hidden>' placeholder if the LLM API key is set", async () => {
|
||||
getSettingsSpy.mockResolvedValueOnce({
|
||||
...MOCK_DEFAULT_USER_SETTINGS,
|
||||
llm_api_key: "**********",
|
||||
@ -420,7 +420,7 @@ describe("Settings Screen", () => {
|
||||
|
||||
await waitFor(() => {
|
||||
const input = screen.getByTestId("llm-api-key-input");
|
||||
expect(input).toHaveProperty("placeholder", "**********");
|
||||
expect(input).toHaveProperty("placeholder", "<hidden>");
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
@ -96,6 +96,7 @@ export function SettingsForm({ settings, models, onClose }: SettingsFormProps) {
|
||||
label="API Key"
|
||||
type="password"
|
||||
className="w-[680px]"
|
||||
placeholder={isLLMKeySet ? "<hidden>" : ""}
|
||||
startContent={isLLMKeySet && <KeyStatusIcon isSet={isLLMKeySet} />}
|
||||
/>
|
||||
|
||||
|
||||
@ -288,7 +288,7 @@ function AccountSettings() {
|
||||
startContent={
|
||||
isLLMKeySet && <KeyStatusIcon isSet={isLLMKeySet} />
|
||||
}
|
||||
placeholder={isLLMKeySet ? "**********" : ""}
|
||||
placeholder={isLLMKeySet ? "<hidden>" : ""}
|
||||
/>
|
||||
)}
|
||||
|
||||
@ -407,9 +407,9 @@ function AccountSettings() {
|
||||
<KeyStatusIcon isSet={!!isGitHubTokenSet} />
|
||||
)
|
||||
}
|
||||
placeholder={isGitHubTokenSet ? "**********" : ""}
|
||||
placeholder={isGitHubTokenSet ? "<hidden>" : ""}
|
||||
/>
|
||||
<p data-testId="github-token-help-anchor" className="text-xs">
|
||||
<p data-testid="github-token-help-anchor" className="text-xs">
|
||||
{" "}
|
||||
Generate a token on{" "}
|
||||
<b>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user