From: "Lukas Wagner" <l.wagner@proxmox.com>
To: "Proxmox Datacenter Manager development discussion"
<pdm-devel@lists.proxmox.com>,
"Dominik Csapak" <d.csapak@proxmox.com>
Subject: Re: [pdm-devel] [PATCH datacenter-manager] ui: views: add view id schema validation
Date: Tue, 16 Dec 2025 14:58:28 +0100 [thread overview]
Message-ID: <DEZP06J5S51K.32B4MJFTG10US@proxmox.com> (raw)
In-Reply-To: <20251210151841.3617325-1-d.csapak@proxmox.com>
On Wed Dec 10, 2025 at 4:18 PM CET, Dominik Csapak wrote:
> so the user gets instant feedback about the validity of the id.
>
> Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
> ---
> ui/src/configuration/views.rs | 11 +++++++++--
> 1 file changed, 9 insertions(+), 2 deletions(-)
>
> diff --git a/ui/src/configuration/views.rs b/ui/src/configuration/views.rs
> index 810bda36..dcb0672c 100644
> --- a/ui/src/configuration/views.rs
> +++ b/ui/src/configuration/views.rs
> @@ -4,11 +4,12 @@ use std::rc::Rc;
>
> use anyhow::{bail, Error};
>
> +use pdm_api_types::VIEW_ID_SCHEMA;
> use yew::virtual_dom::{Key, VComp, VNode};
>
> use proxmox_yew_comp::form::delete_empty_values;
> use proxmox_yew_comp::percent_encoding::percent_encode_component;
> -use proxmox_yew_comp::{http_delete, http_get, http_post, http_put, EditWindow};
> +use proxmox_yew_comp::{http_delete, http_get, http_post, http_put, EditWindow, SchemaValidation};
> use proxmox_yew_comp::{
> LoadableComponent, LoadableComponentContext, LoadableComponentMaster,
> LoadableComponentScopeExt, LoadableComponentState,
> @@ -341,7 +342,13 @@ fn input_panel(form_ctx: &FormContext, mode: InputPanelMode) -> Html {
>
> match mode {
> InputPanelMode::Create(store) => {
> - input_panel.add_field(tr!("Name"), Field::new().name("id").required(true));
> + input_panel.add_field(
> + tr!("Name"),
> + Field::new()
> + .name("id")
> + .schema(&VIEW_ID_SCHEMA)
> + .required(true),
> + );
> input_panel.add_right_field(
> tr!("Copy Layout from"),
> ViewSelector::new(store)
LGTM!
Tested-by: Lukas Wagner <l.wagner@proxmox.com>
Reviewed-by: Lukas Wagner <l.wagner@proxmox.com>
_______________________________________________
pdm-devel mailing list
pdm-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pdm-devel
prev parent reply other threads:[~2025-12-16 13:57 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-12-10 15:18 Dominik Csapak
2025-12-16 13:58 ` Lukas Wagner [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=DEZP06J5S51K.32B4MJFTG10US@proxmox.com \
--to=l.wagner@proxmox.com \
--cc=d.csapak@proxmox.com \
--cc=pdm-devel@lists.proxmox.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox