ui: parser: add helper for lists of property strings

namely the filtering while preserving the original string,
it's just one line, but having a shorthand for it still makes it a bit
nicer

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
This commit is contained in:
Dominik Csapak 2023-06-16 15:05:29 +02:00 committed by Thomas Lamprecht
parent 797bcf9aa2
commit d5a9606710

View File

@ -604,5 +604,9 @@ Ext.define('PVE.Parser', {
});
return [res, extradata];
},
filterPropertyStringList: function(list, filterFn, defaultKey) {
return list.filter((entry) => filterFn(PVE.Parser.parsePropertyString(entry, defaultKey)));
},
},
});