all lists on lists.proxmox.com
 help / color / mirror / Atom feed
From: Shan Shaji <s.shaji@proxmox.com>
To: pbs-devel@lists.proxmox.com
Cc: Shan Shaji <s.shaji@proxmox.com>
Subject: [pbs-devel] [PATCH proxmox-backup v2] fix #6592: ui: add custom sort function to comment column
Date: Wed,  6 Aug 2025 12:46:30 +0200	[thread overview]
Message-ID: <20250806104630.116305-1-s.shaji@proxmox.com> (raw)

When sorting the Comment column, if the `comment` field was
present, the sorting worked correctly. However, when the `comment`
field was missing and only `last-comment` was available
(and shown in the UI), the default Ext JS sorting did not use the
`last-comment` value.

To fix this, a custom sort function was added to use the `last-comment`
value when `comment` is empty.

Signed-off-by: Shan Shaji <s.shaji@proxmox.com>
---
 
 changes since v1: 
 - Fixed comment description line length

 www/datastore/Content.js | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/www/datastore/Content.js b/www/datastore/Content.js
index 075022e9..a2aa1949 100644
--- a/www/datastore/Content.js
+++ b/www/datastore/Content.js
@@ -1004,6 +1004,15 @@ Ext.define('PBS.DataStoreContent', {
                 return `<span class="snapshot-comment-column ${additionalClasses}">${v}</span>
 		    <i data-qtip="${gettext('Edit')}" style="float: right; margin: 0px;" class="${icon}"></i>`;
             },
+            sorter: (aRec, bRec) => {
+                let a = aRec.data.comment || aRec.data['last-comment'] || '';
+                let b = bRec.data.comment || bRec.data['last-comment'] || '';
+
+                a = a.toLowerCase();
+                b = b.toLowerCase();
+
+                return a.localeCompare(b);
+            },
             listeners: {
                 afterrender: function (component) {
                     // a bit of a hack, but relatively easy, cheap and works out well.
-- 
2.39.5



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


             reply	other threads:[~2025-08-06 10:45 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-08-06 10:46 Shan Shaji [this message]
2025-08-12 13:33 ` Michael Köppl
2025-09-15 20:10 ` [pbs-devel] applied: " Thomas Lamprecht

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=20250806104630.116305-1-s.shaji@proxmox.com \
    --to=s.shaji@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 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.
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal