Skip to content
Merged
17 changes: 17 additions & 0 deletions api/webapp/extPatches/ext4-patches.js
Original file line number Diff line number Diff line change
Expand Up @@ -446,6 +446,23 @@ Ext4.override(Ext4.data.Store, {
}
});

/**
* Delayed query/type-ahead tasks and remote load callbacks can fire after onDestroy has nulled the store.
* Cancel the tasks on destroy; a remote load's callback isn't a task, so guard it.
*/
Ext4.override(Ext4.form.field.ComboBox, {
onDestroy: function() {
this.doQueryTask.cancel();
if (this.typeAheadTask)
this.typeAheadTask.cancel();
this.callParent(arguments);
},
afterQuery: function() {
if (!this.isDestroyed)
this.callParent(arguments);
}
});

/**
* RowExpander plugin is not properly configured to handle sandboxed ExtJS.
*/
Expand Down
10 changes: 4 additions & 6 deletions core/src/client/components/DynamicConfigurationModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ export default class DynamicConfigurationModal extends PureComponent<Props, Part
saveEditedModal = (): void => {
const { modalType, authConfig, configType, closeModal, updateAuthRowsAfterSave } = this.props;

this.setState({ errorMessage: '' });
if (this.areRequiredFieldsEmpty()) {
return;
}
Expand Down Expand Up @@ -98,6 +99,7 @@ export default class DynamicConfigurationModal extends PureComponent<Props, Part
areRequiredFieldsEmpty = (): boolean => {
// Issue 50964: Save incomplete disabled authentication configurations
if (!this.state.fieldValues.enabled) {
this.setState({ emptyRequiredFields: [] });
return false;
}

Expand All @@ -110,12 +112,8 @@ export default class DynamicConfigurationModal extends PureComponent<Props, Part
}, []);

const emptyRequiredFields = requiredFields.filter(name => this.state.fieldValues[name] == '');
if (emptyRequiredFields.length > 0) {
this.setState({ emptyRequiredFields });
return true;
} else {
return false;
}
this.setState({ emptyRequiredFields });
return emptyRequiredFields.length > 0;
};

onToggle = (): void => {
Expand Down
Loading