feat(web): hint about {{domain_name}} placeholder in template editor
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -126,6 +126,12 @@ test("удаление записи вызывает onChange без удалё
|
|||||||
])
|
])
|
||||||
})
|
})
|
||||||
|
|
||||||
|
test("подсказка про плейсхолдер {{domain_name}} отображается в редакторе", () => {
|
||||||
|
render(<Harness initial={[]} onChange={vi.fn()} />)
|
||||||
|
|
||||||
|
expect(screen.getByText(/\{\{domain_name\}\}/)).toBeInTheDocument()
|
||||||
|
})
|
||||||
|
|
||||||
test("mono-шрифт применён к полям name и values", () => {
|
test("mono-шрифт применён к полям name и values", () => {
|
||||||
render(
|
render(
|
||||||
<Harness
|
<Harness
|
||||||
|
|||||||
@@ -1,7 +1,8 @@
|
|||||||
import { Plus, Trash2 } from "lucide-react"
|
import { Info, Plus, Trash2 } from "lucide-react"
|
||||||
import { Button } from "@/components/ui/button"
|
import { Button } from "@/components/ui/button"
|
||||||
import { Input } from "@/components/ui/input"
|
import { Input } from "@/components/ui/input"
|
||||||
import { Textarea } from "@/components/ui/textarea"
|
import { Textarea } from "@/components/ui/textarea"
|
||||||
|
import { FieldDescription } from "@/components/ui/field"
|
||||||
import {
|
import {
|
||||||
Select,
|
Select,
|
||||||
SelectContent,
|
SelectContent,
|
||||||
@@ -42,6 +43,15 @@ export function RecordEditor({
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="flex flex-col gap-2">
|
<div className="flex flex-col gap-2">
|
||||||
|
<FieldDescription className="flex items-start gap-2 rounded-lg border border-border/60 bg-background/40 px-3 py-2.5">
|
||||||
|
<Info className="mt-0.5 size-3.5 shrink-0 text-muted-foreground" strokeWidth={1.75} />
|
||||||
|
<span>
|
||||||
|
Используйте <code className="font-dns text-foreground">{"{{domain_name}}"}</code> в имени
|
||||||
|
или значении записи — при проверке домена подставится имя его зоны (без завершающей
|
||||||
|
точки).
|
||||||
|
</span>
|
||||||
|
</FieldDescription>
|
||||||
|
|
||||||
{value.map((record, index) => (
|
{value.map((record, index) => (
|
||||||
<div
|
<div
|
||||||
key={index}
|
key={index}
|
||||||
|
|||||||
Reference in New Issue
Block a user