public inbox for pdm-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: Dominik Csapak <d.csapak@proxmox.com>
To: Proxmox Datacenter Manager development discussion
	<pdm-devel@lists.proxmox.com>,
	Shannon Sterz <s.sterz@proxmox.com>
Subject: Re: [pdm-devel] [PATCH datacenter-manager] ui: remotes: use ConfirmButton component instead of ConfirmDialog
Date: Thu, 19 Dec 2024 13:32:50 +0100	[thread overview]
Message-ID: <fbf462a8-7a97-48fe-ae4d-1d5d3367fb32@proxmox.com> (raw)
In-Reply-To: <20241219110059.166895-1-s.sterz@proxmox.com>

content and functionality wise all 3 patches look good to me
(and work fine in my testing)

On 12/19/24 12:00, Shannon Sterz wrote:
> Signed-off-by: Shannon Sterz <s.sterz@proxmox.com>
> ---
>   ui/src/remotes/mod.rs | 26 +++++++++-----------------
>   1 file changed, 9 insertions(+), 17 deletions(-)
> 
> diff --git a/ui/src/remotes/mod.rs b/ui/src/remotes/mod.rs
> index c9a4e43..9b9de06 100644
> --- a/ui/src/remotes/mod.rs
> +++ b/ui/src/remotes/mod.rs
> @@ -27,8 +27,6 @@ use anyhow::Error;
>   use edit_remote::EditRemote;
>   //use pwt::widget::form::{Field, FormContext, InputType};
>   
> -use pwt::widget::ConfirmDialog;
> -
>   use pdm_api_types::remotes::Remote;
>   //use proxmox_schema::{property_string::PropertyString, ApiType};
>   use proxmox_yew_comp::percent_encoding::percent_encode_component;
> @@ -54,7 +52,9 @@ use pwt::widget::{
>   //use pwt::widget::InputPanel;
>   
>   //use proxmox_yew_comp::EditWindow;
> -use proxmox_yew_comp::{LoadableComponent, LoadableComponentContext, LoadableComponentMaster};
> +use proxmox_yew_comp::{
> +    ConfirmButton, LoadableComponent, LoadableComponentContext, LoadableComponentMaster,
> +};
>   
>   use pdm_api_types::remotes::{NodeUrl, RemoteType};
>   
> @@ -120,7 +120,6 @@ impl RemoteConfigPanel {
>   pub enum ViewState {
>       Add(RemoteType),
>       Edit,
> -    ConfirmRemove,
>   }
>   
>   pub enum Msg {
> @@ -220,10 +219,12 @@ impl LoadableComponent for PbsRemoteConfigPanel {
>                       .disabled(disabled)
>                       .onclick(link.change_view_callback(|_| Some(ViewState::Edit))),
>               )
> -            .with_child(Button::new(tr!("Remove")).disabled(disabled).onclick({
> -                let link = link.clone();
> -                move |_| link.change_view(Some(ViewState::ConfirmRemove))
> -            }))
> +            .with_child(
> +                ConfirmButton::new(tr!("Remove"))
> +                    .confirm_message(tr!("Are you sure you want to remove this remote?"))
> +                    .disabled(disabled)
> +                    .on_activate(link.callback(|_| Msg::RemoveItem)),
> +            )
>               .with_flex_spacer()
>               .with_child({
>                   let loading = ctx.loading();
> @@ -257,15 +258,6 @@ impl LoadableComponent for PbsRemoteConfigPanel {
>                   .selection
>                   .selected_key()
>                   .map(|key| self.create_edit_dialog(ctx, key)),
> -            ViewState::ConfirmRemove => self.selection.selected_key().map(|key| {
> -                ConfirmDialog::new()
> -                    .title(tr!("Confirm: Remove Remote"))
> -                    .confirm_text(tr!("Remove"))
> -                    .confirm_message(tr!("Are you sure you want to remove the remote '{0}' ?", key))
> -                    .on_confirm(ctx.link().callback(|_| Msg::RemoveItem))
> -                    .on_done(ctx.link().change_view_callback(|_| None))
> -                    .into()
> -            }),

this hunk has a merge conflict with:

https://lists.proxmox.com/pipermail/pdm-devel/2024-December/000012.html

due to an accidental rustfmt hunk there

>           }
>       }
>   }



_______________________________________________
pdm-devel mailing list
pdm-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pdm-devel


  parent reply	other threads:[~2024-12-19 12:32 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-12-19 11:00 Shannon Sterz
2024-12-19 11:00 ` [pdm-devel] [PATCH proxmox-yew-comp 2/2] confirm_button: use confirm dialog and always spawn a dialog Shannon Sterz
2025-01-08 10:25   ` [pdm-devel] applied: " Dietmar Maurer
2024-12-19 11:00 ` [pdm-devel] [PATCH yew-widget-toolkit] widget: confirm_dialog: refactor to use message box Shannon Sterz
2025-01-08  9:25   ` [pdm-devel] applied: " Dietmar Maurer
2024-12-19 12:32 ` Dominik Csapak [this message]
2025-01-08 10:24 ` [pdm-devel] applied: [PATCH datacenter-manager] ui: remotes: use ConfirmButton component instead of ConfirmDialog Dietmar Maurer

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=fbf462a8-7a97-48fe-ae4d-1d5d3367fb32@proxmox.com \
    --to=d.csapak@proxmox.com \
    --cc=pdm-devel@lists.proxmox.com \
    --cc=s.sterz@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
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal