From e06651f14c991310e055a7af0f5d88a806b460ad Mon Sep 17 00:00:00 2001 From: Franklin Date: Tue, 25 Apr 2023 14:05:54 -0400 Subject: [PATCH] Finished agent edit screen except for update functionality --- src/pages/admin/fields/agent.rs | 25 ++++++++++++++++++------- 1 file changed, 18 insertions(+), 7 deletions(-) diff --git a/src/pages/admin/fields/agent.rs b/src/pages/admin/fields/agent.rs index e98c0ed..533e3f8 100644 --- a/src/pages/admin/fields/agent.rs +++ b/src/pages/admin/fields/agent.rs @@ -71,12 +71,24 @@ pub fn agent_fields(props: &AgentFieldsProps) -> Html { - {if (*credential_type).clone() == Some(CredentialType::PhoneNumber) { - html! { -
-
{"Tipo de Credencial"}
- selected={credential_type} options={vec![CredentialType::Email, CredentialType::PhoneNumber]} onchange={onselect_cb}/> -
+ {if (*credential_type).clone().is_none() { + match props.edittype.clone() { + EditType::New => html! { +
+
{"Tipo de Credencial"}
+ selected={credential_type} options={vec![CredentialType::Email, CredentialType::PhoneNumber]} onchange={onselect_cb}/> +
+ }, + EditType::Existing(_) => if *user_typed { + html! { +
+
{"Tipo de Credencial"}
+ selected={credential_type} options={vec![CredentialType::Email, CredentialType::PhoneNumber]} onchange={onselect_cb}/> +
+ } + } else { + html! {} + } } } else { html! { @@ -85,7 +97,6 @@ pub fn agent_fields(props: &AgentFieldsProps) -> Html { selected={credential_type} options={vec![CredentialType::Email, CredentialType::PhoneNumber]} onchange={onselect_cb}/> } - }}