public inbox for pbs-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: Dominik Csapak <d.csapak@proxmox.com>
To: Proxmox Backup Server development discussion
	<pbs-devel@lists.proxmox.com>,
	Philipp Hufnagl <p.hufnagl@proxmox.com>
Subject: Re: [pbs-devel] [PATCH proxmox-backup v5] ui: fix #4260: add dynamic notes in backup group comment
Date: Thu, 12 Oct 2023 14:42:12 +0200	[thread overview]
Message-ID: <040bbd79-985e-4b95-b666-0121b9cbf0ba@proxmox.com> (raw)
In-Reply-To: <20231003123425.991560-1-p.hufnagl@proxmox.com>

one nit inline, rest LGTM

On 10/3/23 14:34, Philipp Hufnagl wrote:
> When there is no comment for a backup group, the comment of the last
> snapshot in this group will be shown slightly grayed out as long as
> the group is collapsed.
> 
> Signed-off-by: Philipp Hufnagl <p.hufnagl@proxmox.com>
> ---
> 
> Changes since v1:
> * fixed typo at "additonal classes"
> * renamed css class to "faded" so it can be used more generic
> * guarded snapshot comment for not being a string guarded snapshot
> 
> Changes since v2:
> * fixed variable name in violation of coding guidelines
> 
> Changes since v3:
> * fixed intentation
> * removed span prefix from faded class
> 
> Changes since v4:
> * fixed css class
> 
>   www/css/ext6-pbs.css     |  4 ++++
>   www/datastore/Content.js | 17 ++++++++++++++---
>   2 files changed, 18 insertions(+), 3 deletions(-)
> 
> diff --git a/www/css/ext6-pbs.css b/www/css/ext6-pbs.css
> index 5fd65d25..95a655cf 100644
> --- a/www/css/ext6-pbs.css
> +++ b/www/css/ext6-pbs.css
> @@ -227,6 +227,10 @@ span.snapshot-comment-column {
>       width: calc(100% - 18px);
>   }
>   
> +.pmx-faded {
> +    opacity: 0.7;
> +}
> +
>   .x-action-col-icon.good:before {
>       color: #21BF4B;
>   }
> diff --git a/www/datastore/Content.js b/www/datastore/Content.js
> index 9fc07d49..740d10bf 100644
> --- a/www/datastore/Content.js
> +++ b/www/datastore/Content.js
> @@ -146,6 +146,7 @@ Ext.define('PBS.DataStoreContent', {
>   		    leaf: false,
>   		    iconCls: "fa " + cls,
>   		    expanded: false,
> +		    comment: item.data.comment,

nit: i think this is leftover? at least i can't see where you would use it in this patch,
and it still worked after i patched this out?

>   		    backup_type: item.data["backup-type"],
>   		    backup_id: item.data["backup-id"],
>   		    children: [],
> @@ -287,6 +288,7 @@ Ext.define('PBS.DataStoreContent', {
>   		    if (item["backup-time"] > last_backup && item.size !== null) {
>   			last_backup = item["backup-time"];
>   			group["backup-time"] = last_backup;
> +			group["last-comment"] = item.comment;
>   			group.files = item.files;
>   			group.size = item.size;
>   			group.owner = item.owner;
> @@ -903,13 +905,22 @@ Ext.define('PBS.DataStoreContent', {
>   		if (!data || data.leaf || data.root) {
>   		    return '';
>   		}
> -		if (v === undefined || v === null) {
> -		    v = '';
> +
> +		let additionalClasses = "";
> +		// when there is no group comment and the section is collapsed,
> +		// display the most recent snapshot comment
> +		if (v === undefined || v === null|| v === '') {
> +		    if (data.expanded === false) {
> +			v = data['last-comment'] ?? '';
> +			additionalClasses = "pmx-faded";
> +		    } else {
> +			v = '';
> +		    }
>   		}
>   		v = Ext.String.htmlEncode(v);
>   		let icon = 'x-action-col-icon fa fa-fw fa-pencil pointer';
>   
> -		return `<span class="snapshot-comment-column">${v}</span>
> +		return `<span class="snapshot-comment-column ${additionalClasses}">${v}</span>
>   		    <i data-qtip="${gettext('Edit')}" style="float: right; margin: 0px;" class="${icon}"></i>`;
>   	    },
>   	    listeners: {





      reply	other threads:[~2023-10-12 12:42 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-03 12:34 Philipp Hufnagl
2023-10-12 12:42 ` Dominik Csapak [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=040bbd79-985e-4b95-b666-0121b9cbf0ba@proxmox.com \
    --to=d.csapak@proxmox.com \
    --cc=p.hufnagl@proxmox.com \
    --cc=pbs-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
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal