public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
* [pve-devel] [PATCH manager] ui: dc: backup: fix job detail search
@ 2021-06-22  8:07 Aaron Lauterer
  2021-06-22  9:52 ` [pve-devel] applied: " Thomas Lamprecht
  0 siblings, 1 reply; 2+ messages in thread
From: Aaron Lauterer @ 2021-06-22  8:07 UTC (permalink / raw)
  To: pve-devel

'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





^ permalink raw reply	[flat|nested] 2+ messages in thread

* [pve-devel] applied: [PATCH manager] ui: dc: backup: fix job detail search
  2021-06-22  8:07 [pve-devel] [PATCH manager] ui: dc: backup: fix job detail search Aaron Lauterer
@ 2021-06-22  9:52 ` Thomas Lamprecht
  0 siblings, 0 replies; 2+ messages in thread
From: Thomas Lamprecht @ 2021-06-22  9:52 UTC (permalink / raw)
  To: Proxmox VE development discussion, Aaron Lauterer

On 22.06.21 10:07, Aaron Lauterer wrote:
> '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.

Having something like "another issue fixed with additional changes" is
always a good indicator that it could be a separate patch.

> 
> 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(-)
> 
>

applied, to both master and stable-6, thanks!




^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-06-22  9:52 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-22  8:07 [pve-devel] [PATCH manager] ui: dc: backup: fix job detail search Aaron Lauterer
2021-06-22  9:52 ` [pve-devel] applied: " Thomas Lamprecht

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