From: Stoiko Ivanov <s.ivanov@proxmox.com>
To: Dominik Csapak <d.csapak@proxmox.com>
Cc: pmg-devel@lists.proxmox.com
Subject: Re: [PATCH pmg-yew-quarantine-gui] spam list: open mail when given via query parameter
Date: Fri, 19 Jun 2026 11:34:08 +0200 [thread overview]
Message-ID: <20260619113408.3325701f@rosa.proxmox.com> (raw)
In-Reply-To: <20260617105617.2351595-1-d.csapak@proxmox.com>
Thanks for the patch!
checked it out and gave it a spin - looks fine and works as advertised:
Reviewed-by: Stoiko Ivanov <s.ivanov@proxmox.com>
Tested-by: Stoiko Ivanov <s.ivanov@proxmox.com>
FWIW: while there I noticed an error in the browser dev-tools console:
`Could not load acl tree - api error (status = 501: Method 'GET
/access/acl' not implemented`
looked around and saw:
https://git.proxmox.com/?p=ui/proxmox-yew-comp.git;a=commitdiff;h=a9524ba99c93d3eddfbf4a28552b9abfaabfb534
-> verified that the patch fixes the spurious error.
On Wed, 17 Jun 2026 12:56:11 +0200
Dominik Csapak <d.csapak@proxmox.com> wrote:
> In the quarantine summary e-mail, there are links for the actions of
> mails but also a link that should just open the specific mail in the
> quarantine interface without an action.
>
> In the mobile UI, only the action was actually implemented, but not the
> opening when no action was selected.
>
> Implement that by handling id and action separately while extracting and
> calling the 'on_preview' callback in case no action was present.
>
> Reported in the forums:
> https://forum.proxmox.com/threads/174685/#post-857716
>
> Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
> ---
> src/spam_list.rs | 25 +++++++++++++++----------
> 1 file changed, 15 insertions(+), 10 deletions(-)
>
> diff --git a/src/spam_list.rs b/src/spam_list.rs
> index 95a0611..cd4365a 100644
> --- a/src/spam_list.rs
> +++ b/src/spam_list.rs
> @@ -144,10 +144,14 @@ impl Component for PmgSpamList {
> _reload_observer: reload_observer,
> };
>
> - match extract_mail_action_from_query_params() {
> - Ok(None) => {}
> - Ok(Some((id, action))) => {
> - ctx.link().send_message(Msg::Action(id, action));
> + match extract_mail_info_from_query_param() {
> + Ok((None, _)) => {}
> + Ok((Some(id), action)) => {
> + if let Some(action) = action {
> + ctx.link().send_message(Msg::Action(id, action));
> + } else if let Some(on_preview) = &ctx.props().on_preview {
> + on_preview.emit(id.clone())
> + }
> }
> Err(err) => {
> ctx.link().show_snackbar(
> @@ -358,15 +362,16 @@ fn epoch_to_date(epoch: i64) -> String {
> )
> }
>
> -fn extract_mail_action_from_query_params() -> Result<Option<(String, MailAction)>, Error> {
> +fn extract_mail_info_from_query_param() -> Result<(Option<String>, Option<MailAction>), Error> {
> let id = extract_query_parameter("cselect")?;
> let action = extract_query_parameter("action")?;
>
> - if let (Some(id), Some(action)) = (id, action) {
> - let action = MailAction::from_str(&action)?;
> - return Ok(Some((id, action)));
> - }
> - Ok(None)
> + let action = match action {
> + Some(action) => Some(MailAction::from_str(&action)?),
> + None => None,
> + };
> +
> + Ok((id, action))
> }
>
> /// Removes `name` parameter from the get values via the browser `history` object and returns it
prev parent reply other threads:[~2026-06-19 9:34 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-06-17 10:56 [PATCH pmg-yew-quarantine-gui] spam list: open mail when given via query parameter Dominik Csapak
2026-06-19 9:34 ` Stoiko Ivanov [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=20260619113408.3325701f@rosa.proxmox.com \
--to=s.ivanov@proxmox.com \
--cc=d.csapak@proxmox.com \
--cc=pmg-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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.