fix(webui): improve automation edit message field
This commit is contained in:
@@ -3854,16 +3854,13 @@ function AutomationEditDialog({
|
||||
return (
|
||||
<Dialog open={Boolean(job)} onOpenChange={onOpenChange}>
|
||||
{job ? (
|
||||
<DialogContent className="w-[min(calc(100vw-2rem),34rem)] rounded-[26px]">
|
||||
<DialogContent
|
||||
aria-describedby={undefined}
|
||||
className="w-[min(calc(100vw-2rem),34rem)] rounded-[26px]"
|
||||
>
|
||||
<form className="space-y-5" onSubmit={submit}>
|
||||
<DialogHeader>
|
||||
<DialogTitle>{tx("settings.automations.editTitle", "Edit automation")}</DialogTitle>
|
||||
<DialogDescription>
|
||||
{tx(
|
||||
"settings.automations.editDescription",
|
||||
"Update the prompt and schedule. The linked chat stays unchanged.",
|
||||
)}
|
||||
</DialogDescription>
|
||||
</DialogHeader>
|
||||
|
||||
<div className="space-y-4">
|
||||
@@ -3885,7 +3882,7 @@ function AutomationEditDialog({
|
||||
<Textarea
|
||||
value={draft.message}
|
||||
onChange={(event) => setDraft((prev) => ({ ...prev, message: event.target.value }))}
|
||||
className="min-h-24 resize-y rounded-[12px] text-[13px] leading-5"
|
||||
className="min-h-[160px] resize-none rounded-[12px] text-[13px] leading-5"
|
||||
/>
|
||||
</label>
|
||||
|
||||
|
||||
@@ -501,6 +501,13 @@ describe("App layout", () => {
|
||||
expect(await screen.findByText("Past one-shot")).toBeInTheDocument();
|
||||
fireEvent.click(screen.getByRole("button", { name: "Edit" }));
|
||||
expect(screen.queryByText("Run time must be in the future.")).not.toBeInTheDocument();
|
||||
expect(
|
||||
screen.queryByText("Update the prompt and schedule. The linked chat stays unchanged."),
|
||||
).not.toBeInTheDocument();
|
||||
expect(screen.getByDisplayValue("Old one-shot message")).toHaveClass(
|
||||
"min-h-[160px]",
|
||||
"resize-none",
|
||||
);
|
||||
|
||||
fireEvent.change(screen.getByDisplayValue("Old one-shot message"), {
|
||||
target: { value: "Updated one-shot message" },
|
||||
|
||||
Reference in New Issue
Block a user