From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [IPv6:2a01:7e0:0:424::9]) by lore.proxmox.com (Postfix) with ESMTPS id 1E6491FF38C for ; Thu, 16 May 2024 11:06:18 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 2825832E2C; Thu, 16 May 2024 11:06:29 +0200 (CEST) Date: Thu, 16 May 2024 11:05:50 +0200 From: Gabriel Goller To: Thomas Lamprecht Message-ID: <20240516090550.m4achavq23mxw7uz@luna.proxmox.com> References: <20240507081304.29656-1-g.goller@proxmox.com> <07167532-dee6-490c-b8ac-16bb15a2046f@proxmox.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <07167532-dee6-490c-b8ac-16bb15a2046f@proxmox.com> X-SPAM-LEVEL: Spam detection results: 0 AWL -0.073 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DMARC_MISSING 0.1 Missing DMARC policy KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record Subject: Re: [pbs-devel] [PATCH proxmox-backup] fix #5422: ui: make columns in gcview sortable X-BeenThere: pbs-devel@lists.proxmox.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Proxmox Backup Server development discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: Proxmox Backup Server development discussion Cc: Proxmox Backup Server development discussion Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Errors-To: pbs-devel-bounces@lists.proxmox.com Sender: "pbs-devel" On 15.05.2024 14:34, Thomas Lamprecht wrote: >Would change subject to: > >fix #5422: ui: garbage collection: make columns sortable > >Using the class name "gcview" is rather implementation detail and not >really telling to devs when skimming git log entries or users, if this >gets copied over into the debian/changelog. I agree. >Am 07/05/2024 um 10:13 schrieb Gabriel Goller: >> These columns were not sortable for some reason. Tested it as well and > >The original reason was that PBS did not have a PBS-wide GC/prune view >until the recently released 3.2, and so each GC view only had a single >row, as GC jobs are always affecting the whole datastore anyway. >Thus sorting did not make sense to have for single line entries, showing >the sort-arrows would only add a tiny bit of confusion for users, as that >would imply that more entries could be present. pre-3.2 pbs only used a 1x1 table (so not really a table :) ) for gc jobs, so no sorting possible there. I wondered why the patch from Stefan Lendl only included the sortable config on some and not all columns :) >Now for the PBS-wide view sorting makes sense, but for the per-datastore >GC view it still doesn't. > >You could drop the `sortable` config from the columns entries and >set that dynamically in initComponent, we loop over all columns there >already and have the information if the view is instantiated for a single >datastore or for all. > >E.g., I'd do something like (untested): > >diff --git a/www/config/GCView.js b/www/config/GCView.js >index 1c9288e4..c3b87fe5 100644 >--- a/www/config/GCView.js >+++ b/www/config/GCView.js >@@ -224,12 +224,12 @@ Ext.define('PBS.config.GCJobView', { > > initComponent: function() { > let me = this; >- let hideLocalDatastore = !!me.datastore; >+ let isSingleDatastore = !!me.datastore; > > for (let column of me.columns) { >+ column.sortable = !isSingleDatastore; > if (column.dataIndex === 'store') { >- column.hidden = hideLocalDatastore; >- break; >+ column.hidden = isSingleDatastore; > } > } > > Wow, this works like a charm! >> the sorting seems to work fine. >> > >Could do with a fixes trailer like: > >Fixes: db3fd213 ("fix #3217: ui: global prune and gc job view") > Will do! And thanks for the review! _______________________________________________ pbs-devel mailing list pbs-devel@lists.proxmox.com https://lists.proxmox.com/cgi-bin/mailman/listinfo/pbs-devel