From 5840dc215e96dce014cc5a093386e8294e6c64ef Mon Sep 17 00:00:00 2001 From: Manuel Cillero Date: Thu, 29 Feb 2024 23:34:31 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=9A=9A=20Rename=20add=5Felement()=20to=20?= =?UTF-8?q?more=20descriptive=20name?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/pagetop-user/src/lib.rs | 6 +++--- src/base/component/form/form_main.rs | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/pagetop-user/src/lib.rs b/packages/pagetop-user/src/lib.rs index 954a721c..7517a20d 100644 --- a/packages/pagetop-user/src/lib.rs +++ b/packages/pagetop-user/src/lib.rs @@ -43,7 +43,7 @@ async fn login(request: HttpRequest) -> ResultPage { fn form_login() -> Form { Form::new() .with_id("user-login") - .with_element( + .add_element( form::Input::textfield() .with_name("name") .with_label(L10n::t("username", &LOCALES_USER)) @@ -53,11 +53,11 @@ fn form_login() -> Form { ) .with_autofocus(true), ) - .with_element( + .add_element( form::Input::password() .with_name("pass") .with_label(L10n::t("password", &LOCALES_USER)) .with_help_text(L10n::t("password_help", &LOCALES_USER)), ) - .with_element(form::ActionButton::submit().with_value(L10n::t("login", &LOCALES_USER))) + .add_element(form::ActionButton::submit().with_value(L10n::t("login", &LOCALES_USER))) } diff --git a/src/base/component/form/form_main.rs b/src/base/component/form/form_main.rs index 347c761c..6e5c4647 100644 --- a/src/base/component/form/form_main.rs +++ b/src/base/component/form/form_main.rs @@ -98,7 +98,7 @@ impl Form { } #[rustfmt::skip] - pub fn with_element(mut self, element: impl ComponentTrait) -> Self { + pub fn add_element(mut self, element: impl ComponentTrait) -> Self { self.stuff.alter_value(ArcAnyOp::Add(ArcAnyComponent::new(element))); self }