public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: Aaron Lauterer <a.lauterer@proxmox.com>
To: pve-devel@lists.proxmox.com
Subject: [pve-devel] [PATCH manager] ui: dc: backup: fix job detail search
Date: Tue, 22 Jun 2021 10:07:26 +0200	[thread overview]
Message-ID: <20210622080726.2361527-1-a.lauterer@proxmox.com> (raw)

'for...in array' returns the id in the array but not the value,
'for...of array' returns the values.

Another issue that I ran into was if the property did not exist.

Checking if the property evaluates to false will catch situations where
the property does not exist or is null. All other situations where there
is a value for the name, id or type, should evaluate to true if present
as they are strings or the VMID.

Signed-off-by: Aaron Lauterer <a.lauterer@proxmox.com>
---
 www/manager6/dc/Backup.js | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/www/manager6/dc/Backup.js b/www/manager6/dc/Backup.js
index 99401154..6be545ee 100644
--- a/www/manager6/dc/Backup.js
+++ b/www/manager6/dc/Backup.js
@@ -515,8 +515,8 @@ Ext.define('PVE.dc.BackupDiskTree', {
 				    data = record.parentNode.data;
 				}
 
-				for (const property in ['name', 'id', 'type']) {
-				    if (data[property] === null) {
+				for (const property of ['name', 'id', 'type']) {
+				    if (!data[property]) {
 					continue;
 				    }
 				    let v = data[property].toString();
-- 
2.30.2





             reply	other threads:[~2021-06-22  8:07 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-22  8:07 Aaron Lauterer [this message]
2021-06-22  9:52 ` [pve-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=20210622080726.2361527-1-a.lauterer@proxmox.com \
    --to=a.lauterer@proxmox.com \
    --cc=pve-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