public inbox for pbs-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: Dominik Csapak <d.csapak@proxmox.com>
To: pbs-devel@lists.proxmox.com
Subject: [pbs-devel] [PATCH proxmox-backup 1/2] ui: tape: restore: improve variable names
Date: Fri, 29 Sep 2023 15:39:23 +0200	[thread overview]
Message-ID: <20230929133924.2731714-1-d.csapak@proxmox.com> (raw)

some of the variable names did not really tell the full story, so extend
them a bit. This makes the intention much clearer.

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
---
 www/tape/window/TapeRestore.js | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/www/tape/window/TapeRestore.js b/www/tape/window/TapeRestore.js
index c1d3493c..3008f359 100644
--- a/www/tape/window/TapeRestore.js
+++ b/www/tape/window/TapeRestore.js
@@ -721,7 +721,7 @@ Ext.define('PBS.TapeManagement.SnapshotGrid', {
 	let me = this;
 	let snapshots = [];
 
-	let storeCounts = {};
+	let selectedStoreCounts = {};
 
 	me.getSelection().forEach((rec) => {
 	    let id = rec.get('id');
@@ -730,10 +730,10 @@ Ext.define('PBS.TapeManagement.SnapshotGrid', {
 	    // only add if not filtered
 	    if (me.store.findExact('id', id) !== -1) {
 		snapshots.push(`${store}:${snap}`);
-		if (storeCounts[store] === undefined) {
-		    storeCounts[store] = 0;
+		if (selectedStoreCounts[store] === undefined) {
+		    selectedStoreCounts[store] = 0;
 		}
-		storeCounts[store]++;
+		selectedStoreCounts[store]++;
 	    }
 	});
 
@@ -745,17 +745,17 @@ Ext.define('PBS.TapeManagement.SnapshotGrid', {
 	}
 
 	let wholeStores = [];
-	let wholeStoresSelected = true;
-	for (const [store, count] of Object.entries(storeCounts)) {
-	    if (me.storeCounts[store] === count) {
+	let onlyWholeStoresSelected = true;
+	for (const [store, selectedCount] of Object.entries(selectedStoreCounts)) {
+	    if (me.storeCounts[store] === selectedCount) {
 		wholeStores.push(store);
 	    } else {
-		wholeStoresSelected = false;
+		onlyWholeStoresSelected = false;
 		break;
 	    }
 	}
 
-	if (wholeStoresSelected) {
+	if (onlyWholeStoresSelected) {
 	    return wholeStores;
 	}
 
-- 
2.30.2





             reply	other threads:[~2023-09-29 13:39 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-09-29 13:39 Dominik Csapak [this message]
2023-09-29 13:39 ` [pbs-devel] [PATCH proxmox-backup 2/2] fix #4977: ui: tape: restore: rework snapshot selection logic Dominik Csapak
2023-09-29 15:30   ` Mira Limbeck
2023-10-02  6:47     ` Dominik Csapak
2023-10-02  9:14       ` Mira Limbeck
2023-11-09  7:43 ` [pbs-devel] [PATCH proxmox-backup 1/2] ui: tape: restore: improve variable names Dominik Csapak
2023-11-10 12:03 ` [pbs-devel] applied: " Thomas Lamprecht
2023-11-10 12:04   ` Dominik Csapak

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=20230929133924.2731714-1-d.csapak@proxmox.com \
    --to=d.csapak@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