From dcf6cdab9bcded0e2e771f9d1e52fbe91a1c0513 Mon Sep 17 00:00:00 2001 From: Pierre Hubert Date: Thu, 4 Jan 2024 15:42:05 +0100 Subject: [PATCH] Add a tip to help with NWFilter priorities --- virtweb_frontend/src/widgets/forms/NWFilterPriorityInput.tsx | 1 + virtweb_frontend/src/widgets/forms/TextInput.tsx | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/virtweb_frontend/src/widgets/forms/NWFilterPriorityInput.tsx b/virtweb_frontend/src/widgets/forms/NWFilterPriorityInput.tsx index 79ccf6b..22336ec 100644 --- a/virtweb_frontend/src/widgets/forms/NWFilterPriorityInput.tsx +++ b/virtweb_frontend/src/widgets/forms/NWFilterPriorityInput.tsx @@ -16,6 +16,7 @@ export function NWFilterPriorityInput(p: { p.onChange?.(v && v !== "" ? Number(v) : undefined); }} size={ServerApi.Config.constraints.nwfilter_priority} + helperText="A lower priority value is accessed before one with a higher value" /> ); } diff --git a/virtweb_frontend/src/widgets/forms/TextInput.tsx b/virtweb_frontend/src/widgets/forms/TextInput.tsx index cb6e3b0..90354e9 100644 --- a/virtweb_frontend/src/widgets/forms/TextInput.tsx +++ b/virtweb_frontend/src/widgets/forms/TextInput.tsx @@ -16,6 +16,7 @@ export function TextInput(p: { maxRows?: number; type?: React.HTMLInputTypeAttribute; style?: React.CSSProperties; + helperText?: string; }): React.ReactElement { if (!p.editable && (p.value ?? "") === "") return <>; @@ -54,7 +55,7 @@ export function TextInput(p: { minRows={p.minRows} maxRows={p.maxRows} error={valueError !== undefined} - helperText={valueError} + helperText={valueError ?? p.helperText} /> ); }