Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 4 additions & 5 deletions site/src/pages/UserSettingsPage/SecretsPage/SecretDialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ import {
} from "#/components/Dialog/Dialog";
import { FileUpload } from "#/components/FileUpload/FileUpload";
import { FormField } from "#/components/FormField/FormField";
import { Input } from "#/components/Input/Input";
import { Label } from "#/components/Label/Label";
import { Separator } from "#/components/Separator/Separator";
import { Spinner } from "#/components/Spinner/Spinner";
Expand Down Expand Up @@ -441,13 +440,13 @@ const SecretValueField: FC<SecretValueFieldProps> = ({
{required ? <RequiredFieldLabel>Value</RequiredFieldLabel> : "Value"}
</Label>
<div className="flex flex-col gap-2 sm:flex-row sm:items-start">
<Input
<Textarea

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we add a story test that submits a multiline value and asserts it reaches onCreateSecret unchanged?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Image

resize-none might be a quick and easy enhancement here 🙂

id={field.id}
name={field.name}
type="text"
value={value}
placeholder={placeholder}
autoComplete="off"
rows={4}
aria-required={required}
aria-invalid={displayField.error}
aria-describedby={
Expand All @@ -459,9 +458,9 @@ const SecretValueField: FC<SecretValueFieldProps> = ({
}
disabled={clearValueRequested}
className={cn(
"placeholder:text-content-disabled sm:flex-1",
"placeholder:text-content-disabled sm:flex-1 font-mono",
displayField.error && "border-border-destructive",
maskTypedValue && "[-webkit-text-security:circle]",
maskTypedValue && "[-webkit-text-security:disc]",
)}
onFocus={(event) => {
if (isShowingSavedValue) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -418,9 +418,11 @@ export const EditSecretClearValue: Story = {
await user.click(dialog.getByRole("button", { name: "Clear" }));
await expect(valueField).toHaveValue("");
await expect(valueField).toBeDisabled();
await expect(
dialog.getByText("Saved value will be cleared when you update."),
).toBeVisible();
await waitFor(() =>
expect(
dialog.getByText("Saved value will be cleared when you update."),
).toBeVisible(),
);
await expect(updateButton).toBeEnabled();

await user.click(dialog.getByRole("button", { name: "Undo" }));
Expand Down
Loading