ui: group filter: merge duplicate filters

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
This commit is contained in:
Thomas Lamprecht 2021-12-01 14:30:38 +01:00
parent 6a5a60ebfd
commit c72f8784a5
1 changed files with 8 additions and 3 deletions

View File

@ -243,9 +243,14 @@ Ext.define('PBS.window.SyncJobEdit', {
xtype: 'inputpanel',
onGetValues: function(values) {
PBS.Utils.delete_if_default(values, 'group-filter');
if (Ext.isArray(values['group-filter']) && values['group-filter'].length === 0) {
if (Ext.isArray(values['group-filter'])) {
if (values['group-filter'].length === 0) {
delete values['group-filter'];
values.delete = 'group-filter';
} else {
// merge duplicates
values['group-filter'] = [...new Set(values['group-filter'])];
}
}
return values;
},