the prune input panel is used in various contexts (add/editing a
prunejob, adding a datastore, executing a prune). These different api
calls don't all take the same parameters, so we have to correctly set
the `isCreate` to not send a `delete` paramter for those request if
there was an empty field.
Also set 'max-depth:0' only when recursive was not set *and* we can
set 'recursive', because for creating a datastore that is not supported
by the api, and for the prune job editing we override the whole
onGetValues anyway so that's not an issue there.
Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
ns,
dryrun: true,
canRecurse: true,
+ isCreate: true,
},
],
});
if (me.ns && me.ns !== '') {
values.ns = me.ns;
}
- if (!values.recursive) {
+ if (!values.recursive && me.canRecurse) {
values['max-depth'] = 0;
}
delete values.recursive;
xtype: 'pbsNamespaceMaxDepthReduced',
name: 'max-depth',
fieldLabel: gettext('Max. Depth'),
- deleteEmpty: true,
+ cbind: {
+ deleteEmpty: '{!isCreate}',
+ },
},
],
columnB: [
{
xtype: 'pbsPruneInputPanel',
+ cbind: {
+ isCreate: '{isCreate}',
+ },
getValues: () => ({}), // let that handle our inputpanel here
},
{