From 3c23c4c2503d3caac0ee1a480c89548cc404e683 Mon Sep 17 00:00:00 2001 From: Thomas Lamprecht Date: Tue, 21 May 2024 11:30:07 +0200 Subject: [PATCH] ui: garbage-collection: use different state-id for global and per-datastore view For one these different views have different columns shown, and more importantly: with the state being shared one could change sorting in the global view and then have that applied in the per-datastore view too, even if one cannot sort that view explicitly otherwise as there's just one row anyway. This small glitch might lead to a bit of confusion in the worst case and looks unpolished in any way. Note that I explicitly decided against encoding the datastore in the state-id for the per-datastore views for now, as most users will want to adapt layout (like column width) for all per-datastores views. Having to re-do that for every datastore separately can be quite a nuisance while the same user wanting different layout for each datastore in their per-datastore view seems rather to be an edge case. And we can always change this, so starting out with the slightly more restricted design that has less browser local data to be saved seems better w.r.t. maintainability. Signed-off-by: Thomas Lamprecht --- www/config/GCView.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/www/config/GCView.js b/www/config/GCView.js index 7733c265..a6e79fb3 100644 --- a/www/config/GCView.js +++ b/www/config/GCView.js @@ -16,7 +16,6 @@ Ext.define('PBS.config.GCJobView', { alias: 'widget.pbsGCJobView', stateful: true, - stateId: 'grid-gc-jobs-v1', allowDeselect: false, title: gettext('Garbage Collect Jobs'), @@ -218,6 +217,8 @@ Ext.define('PBS.config.GCJobView', { let me = this; let isSingleDatastore = !!me.datastore; + me.stateId = isSingleDatastore ? 'grid-gc-jobs-single' : 'grid-gc-jobs-v1'; + for (let column of me.columns) { column.sortable = !isSingleDatastore; if (column.dataIndex === 'store') {