mirror of
https://github.com/elastic/kibana.git
synced 2025-04-23 17:28:26 -04:00
[Rollup Jobs] Added autofocus to cron editor (#86324)
This commit is contained in:
parent
94b49451ef
commit
f7ace5e16d
2 changed files with 7 additions and 0 deletions
|
@ -67,6 +67,7 @@ interface Props {
|
|||
fieldToPreferredValueMap: FieldToValueMap;
|
||||
frequency: Frequency;
|
||||
}) => void;
|
||||
autoFocus?: boolean;
|
||||
}
|
||||
|
||||
type State = FieldToValueMap;
|
||||
|
@ -234,6 +235,7 @@ export class CronEditor extends Component<Props, State> {
|
|||
fullWidth
|
||||
>
|
||||
<EuiSelect
|
||||
autoFocus={this.props.autoFocus}
|
||||
options={excludeBlockListedFrequencies(UNITS, frequencyBlockList)}
|
||||
value={frequency}
|
||||
onChange={(e: React.ChangeEvent<HTMLSelectElement>) =>
|
||||
|
|
|
@ -45,8 +45,10 @@ export class StepLogistics extends Component {
|
|||
hasMatchingIndices: PropTypes.bool.isRequired,
|
||||
indexPatternAsyncErrors: PropTypes.array,
|
||||
};
|
||||
state = { cronFocus: false };
|
||||
|
||||
showAdvancedCron = () => {
|
||||
this.setState({ cronFocus: true });
|
||||
const { onFieldsChange } = this.props;
|
||||
|
||||
onFieldsChange({
|
||||
|
@ -55,6 +57,7 @@ export class StepLogistics extends Component {
|
|||
};
|
||||
|
||||
hideAdvancedCron = () => {
|
||||
this.setState({ cronFocus: true });
|
||||
const { onFieldsChange, fields } = this.props;
|
||||
const { simpleRollupCron } = fields;
|
||||
|
||||
|
@ -156,6 +159,7 @@ export class StepLogistics extends Component {
|
|||
fullWidth
|
||||
>
|
||||
<EuiFieldText
|
||||
autoFocus={this.state.cronFocus}
|
||||
value={rollupCron}
|
||||
onChange={(e) => onFieldsChange({ rollupCron: e.target.value })}
|
||||
isInvalid={Boolean(areStepErrorsVisible && errorRollupCron)}
|
||||
|
@ -181,6 +185,7 @@ export class StepLogistics extends Component {
|
|||
return (
|
||||
<Fragment>
|
||||
<CronEditor
|
||||
autoFocus={this.state.cronFocus}
|
||||
fieldToPreferredValueMap={fieldToPreferredValueMap}
|
||||
cronExpression={rollupCron}
|
||||
frequency={cronFrequency}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue