public inbox for pbs-devel@lists.proxmox.com
 help / color / mirror / Atom feed
* [PATCH proxmox-backup 0/1] fix #6691: allow search by comment in datastore.
@ 2026-04-30 10:31 Erik Fastermann
  2026-04-30 10:31 ` [PATCH proxmox-backup 1/1] " Erik Fastermann
  0 siblings, 1 reply; 3+ messages in thread
From: Erik Fastermann @ 2026-04-30 10:31 UTC (permalink / raw)
  To: pbs-devel; +Cc: Erik Fastermann

Enable search by the comment field in the datastore content.

Also includes multiple small bug fixes:

- Display items again when searching by a non existing value and
  clearing the search bar.
- Correctly disable the remove box and tooltip for namespaces.
- Correctly disable the browse box and tooltip for the root namespace.

Erik Fastermann (1):
  fix #6691: allow search by comment in datastore.

 www/datastore/Content.js | 28 +++++++++++++++++++++-------
 1 file changed, 21 insertions(+), 7 deletions(-)

-- 
2.47.3




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

* [PATCH proxmox-backup 1/1] fix #6691: allow search by comment in datastore.
  2026-04-30 10:31 [PATCH proxmox-backup 0/1] fix #6691: allow search by comment in datastore Erik Fastermann
@ 2026-04-30 10:31 ` Erik Fastermann
  2026-04-30 12:44   ` Dominik Csapak
  0 siblings, 1 reply; 3+ messages in thread
From: Erik Fastermann @ 2026-04-30 10:31 UTC (permalink / raw)
  To: pbs-devel; +Cc: Erik Fastermann

Enable search by the comment field in the datastore content.

Also includes multiple small bug fixes:

- Display items again when searching by a non existing value and
  clearing the search bar.
- Correctly disable the remove box and tooltip for namespaces.
- Correctly disable the browse box and tooltip for the root namespace.

Fixes: https://bugzilla.proxmox.com/show_bug.cgi?id=6691
Signed-off-by: Erik Fastermann <e.fastermann@proxmox.com>
---
 www/datastore/Content.js | 28 +++++++++++++++++++++-------
 1 file changed, 21 insertions(+), 7 deletions(-)

diff --git a/www/datastore/Content.js b/www/datastore/Content.js
index 1ec07505d..29b27eced 100644
--- a/www/datastore/Content.js
+++ b/www/datastore/Content.js
@@ -941,6 +941,10 @@ Ext.define('PBS.DataStoreContent', {
                 return true;
             }
 
+            if (item.data.comment && item.data.comment.indexOf(value) !== -1) {
+                return true;
+            }
+
             return false;
         },
 
@@ -963,7 +967,6 @@ Ext.define('PBS.DataStoreContent', {
             // we do it a little bit later for the error mask to work
             setTimeout(function () {
                 store.clearFilter();
-                store.getRoot().collapseChildren(true);
 
                 store.beginUpdate();
                 store.getRoot().cascadeBy({
@@ -1150,14 +1153,18 @@ Ext.define('PBS.DataStoreContent', {
                         return Ext.String.format(gettext("Move namespace '{0}'"), v);
                     },
                     getClass: (v, m, { data }) => {
-                        if (data.ty === 'group') { return 'fa fa-arrows'; }
+                        if (data.ty === 'group') {
+                            return 'fa fa-arrows';
+                        }
                         if (data.ty === 'ns' && !data.isRootNS && data.ns === undefined) {
                             return 'fa fa-arrows';
                         }
                         return 'pmx-hidden';
                     },
                     isActionDisabled: (v, r, c, i, { data }) => {
-                        if (data.ty === 'group') { return false; }
+                        if (data.ty === 'group') {
+                            return false;
+                        }
                         if (data.ty === 'ns' && !data.isRootNS && data.ns === undefined) {
                             return false;
                         }
@@ -1210,7 +1217,12 @@ Ext.define('PBS.DataStoreContent', {
                         data.ty === 'dir'
                             ? 'fa critical fa-trash-o'
                             : 'pmx-hidden',
-                    isActionDisabled: (v, r, c, i, { data }) => false,
+                    isActionDisabled: (v, r, c, i, { data }) =>
+                        !(
+                            (data.ty === 'ns' && !data.isRootNS && data.ns === undefined) ||
+                            data.ty === 'group' ||
+                            data.ty === 'dir'
+                        ),
                 },
                 {
                     handler: 'downloadFile',
@@ -1235,12 +1247,14 @@ Ext.define('PBS.DataStoreContent', {
                         return 'pmx-hidden';
                     },
                     isActionDisabled: (v, r, c, i, { data }) =>
-                        !(
+                        (!(
                             data.ty === 'file' &&
                             (data.filename.endsWith('.pxar.didx') ||
                                 data.filename.endsWith('.mpxar.didx')) &&
                             data['crypt-mode'] < 3
-                        ) && data.ty !== 'ns',
+                        ) &&
+                            data.ty !== 'ns') ||
+                        data.root,
                 },
             ],
         },
@@ -1486,7 +1500,7 @@ Ext.define('PBS.DataStoreContent', {
         {
             xtype: 'textfield',
             reference: 'searchbox',
-            emptyText: gettext('group, date or owner'),
+            emptyText: gettext('group, date, owner or comment'),
             triggers: {
                 clear: {
                     cls: 'pmx-clear-trigger',
-- 
2.47.3




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

* Re: [PATCH proxmox-backup 1/1] fix #6691: allow search by comment in datastore.
  2026-04-30 10:31 ` [PATCH proxmox-backup 1/1] " Erik Fastermann
@ 2026-04-30 12:44   ` Dominik Csapak
  0 siblings, 0 replies; 3+ messages in thread
From: Dominik Csapak @ 2026-04-30 12:44 UTC (permalink / raw)
  To: Erik Fastermann, pbs-devel



On 4/30/26 12:30 PM, Erik Fastermann wrote:
> Enable search by the comment field in the datastore content.
> 
> Also includes multiple small bug fixes:
> 
> - Display items again when searching by a non existing value and
>    clearing the search bar.
> - Correctly disable the remove box and tooltip for namespaces.
> - Correctly disable the browse box and tooltip for the root namespace.
> 


please send separate patches for these things to keep the git
history clean and making bisecting and changelog writing easier


a patch/commit for each issue (or very similar issues) would be good


otherwise comments inline

> Fixes: https://bugzilla.proxmox.com/show_bug.cgi?id=6691
> Signed-off-by: Erik Fastermann <e.fastermann@proxmox.com>
> ---
>   www/datastore/Content.js | 28 +++++++++++++++++++++-------
>   1 file changed, 21 insertions(+), 7 deletions(-)
> 
> diff --git a/www/datastore/Content.js b/www/datastore/Content.js
> index 1ec07505d..29b27eced 100644
> --- a/www/datastore/Content.js
> +++ b/www/datastore/Content.js
> @@ -941,6 +941,10 @@ Ext.define('PBS.DataStoreContent', {
>                   return true;
>               }
>   
> +            if (item.data.comment && item.data.comment.indexOf(value) !== -1) {
> +                return true;
> +            }
> +

a bit preexisting, but we might want to do the search case insensitive?
we could use 'localeCompare' with case sensitivity disabled here

>               return false;
>           },
>   
> @@ -963,7 +967,6 @@ Ext.define('PBS.DataStoreContent', {
>               // we do it a little bit later for the error mask to work
>               setTimeout(function () {
>                   store.clearFilter();
> -                store.getRoot().collapseChildren(true);

to which fix does this change belong? couldn't tell from the commit message

>   
>                   store.beginUpdate();
>                   store.getRoot().cascadeBy({
> @@ -1150,14 +1153,18 @@ Ext.define('PBS.DataStoreContent', {
>                           return Ext.String.format(gettext("Move namespace '{0}'"), v);
>                       },
>                       getClass: (v, m, { data }) => {
> -                        if (data.ty === 'group') { return 'fa fa-arrows'; }
> +                        if (data.ty === 'group') {
> +                            return 'fa fa-arrows';
> +                        }
>                           if (data.ty === 'ns' && !data.isRootNS && data.ns === undefined) {
>                               return 'fa fa-arrows';
>                           }
>                           return 'pmx-hidden';
>                       },
>                       isActionDisabled: (v, r, c, i, { data }) => {
> -                        if (data.ty === 'group') { return false; }
> +                        if (data.ty === 'group') {
> +                            return false;
> +                        }

these two hunks are only reformatting, please split that also out into a 
separate patch

>                           if (data.ty === 'ns' && !data.isRootNS && data.ns === undefined) {
>                               return false;
>                           }
> @@ -1210,7 +1217,12 @@ Ext.define('PBS.DataStoreContent', {
>                           data.ty === 'dir'
>                               ? 'fa critical fa-trash-o'
>                               : 'pmx-hidden',
> -                    isActionDisabled: (v, r, c, i, { data }) => false,
> +                    isActionDisabled: (v, r, c, i, { data }) =>
> +                        !(
> +                            (data.ty === 'ns' && !data.isRootNS && data.ns === undefined) ||
> +                            data.ty === 'group' ||
> +                            data.ty === 'dir'
> +                        ),
>                   },
>                   {
>                       handler: 'downloadFile',
> @@ -1235,12 +1247,14 @@ Ext.define('PBS.DataStoreContent', {
>                           return 'pmx-hidden';
>                       },
>                       isActionDisabled: (v, r, c, i, { data }) =>
> -                        !(
> +                        (!(
>                               data.ty === 'file' &&
>                               (data.filename.endsWith('.pxar.didx') ||
>                                   data.filename.endsWith('.mpxar.didx')) &&
>                               data['crypt-mode'] < 3
> -                        ) && data.ty !== 'ns',
> +                        ) &&
> +                            data.ty !== 'ns') ||
> +                        data.root,

meh this boolean logic is rather unreadable (before and after),
can you split that out into multiple statements so one
can see better what is happening?

>                   },
>               ],
>           },
> @@ -1486,7 +1500,7 @@ Ext.define('PBS.DataStoreContent', {
>           {
>               xtype: 'textfield',
>               reference: 'searchbox',
> -            emptyText: gettext('group, date or owner'),
> +            emptyText: gettext('group, date, owner or comment'),
>               triggers: {
>                   clear: {
>                       cls: 'pmx-clear-trigger',





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

end of thread, other threads:[~2026-04-30 12:44 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-04-30 10:31 [PATCH proxmox-backup 0/1] fix #6691: allow search by comment in datastore Erik Fastermann
2026-04-30 10:31 ` [PATCH proxmox-backup 1/1] " Erik Fastermann
2026-04-30 12:44   ` Dominik Csapak

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