Use the correct way to update the state variable using depChange method.

This commit is contained in:
Akshay Joshi 2021-09-30 10:57:39 +05:30
parent 3da85f415d
commit 031167fbea

View File

@ -119,11 +119,12 @@ export default class PgaJobStepSchema extends BaseUISchema {
options: this.fieldOptions.databases,
controlProps: {allowClear: true, placeholder: ''},
disabled: function(state) {
let retVal = !state.jstkind || !state.jstconntype;
if (retVal) {
state.jstdbname = null;
return !state.jstkind || !state.jstconntype;
},
depChange: (state)=>{
if (!state.jstkind || !state.jstconntype) {
return {jstdbname: null};
}
return retVal;
},
deps: ['jstkind', 'jstconntype'],
helpMessage: gettext('Please select the database on which the job step will run.'),