forked from p15670423/monkey
UI: Reset last action on in ConfigurePage.js
Last action, like "Configuration was reset successfully" shouldn't linger in the page for long. It should reset upon modifying the configuration or changing the tab
This commit is contained in:
parent
6725b01342
commit
5a52ceaa4c
|
@ -59,6 +59,10 @@ class ConfigurePageComponent extends AuthComponent {
|
|||
}
|
||||
}
|
||||
|
||||
resetLastAction = () => {
|
||||
this.setState({lastAction: 'none'});
|
||||
}
|
||||
|
||||
getSectionsOrder() {
|
||||
let islandMode = this.props.islandMode !== 'unset' ? this.props.islandMode : 'advanced'
|
||||
return CONFIGURATION_TABS_PER_MODE[islandMode];
|
||||
|
@ -262,13 +266,7 @@ class ConfigurePageComponent extends AuthComponent {
|
|||
}
|
||||
|
||||
setSelectedSection = (key) => {
|
||||
|
||||
// TODO: Fix https://github.com/guardicore/monkey/issues/1621
|
||||
//if ( key === 'basic' & this.userChangedConfig()) {
|
||||
// this.setState({showUnsubmittedConfigWarning: true});
|
||||
// return;
|
||||
//}
|
||||
|
||||
this.resetLastAction();
|
||||
this.updateConfigSection();
|
||||
this.currentSection = key;
|
||||
let selectedSectionData = this.state.configuration[key];
|
||||
|
@ -351,6 +349,7 @@ class ConfigurePageComponent extends AuthComponent {
|
|||
formProperties['fields'] = {DescriptionField: HtmlFieldDescription};
|
||||
formProperties['formData'] = this.state.currentFormData;
|
||||
formProperties['onChange'] = this.onChange;
|
||||
formProperties['onFocus'] = this.resetLastAction;
|
||||
formProperties['customFormats'] = formValidationFormats;
|
||||
formProperties['transformErrors'] = transformErrors;
|
||||
formProperties['className'] = 'config-form';
|
||||
|
|
|
@ -182,7 +182,7 @@ class AdvancedMultiSelect extends React.Component {
|
|||
} = this.props;
|
||||
|
||||
return (
|
||||
<div className={'advanced-multi-select'}>
|
||||
<div className={'advanced-multi-select'} onFocus={this.props.onFocus}>
|
||||
<AdvancedMultiSelectHeader title={schema.title}
|
||||
onCheckboxClick={this.onMasterCheckboxClick}
|
||||
checkboxState={this.getMasterCheckboxState(
|
||||
|
|
Loading…
Reference in New Issue