Chore: Let kbn util infer types (#26907)

* Chore: Let kbn util infer types

Type fixes where needed

* Address review comments + test fix

* Modify kbn method and property names to pascalCase
This commit is contained in:
Zoltán Bedi
2020-08-13 09:35:32 +02:00
committed by GitHub
parent 6b1b52b704
commit 75e14aa120
23 changed files with 310 additions and 337 deletions

View File

@@ -37,7 +37,7 @@ const timeRangeValidationEvents: ValidationEvents = {
return true;
}
try {
kbn.interval_to_seconds(value);
kbn.intervalToSeconds(value);
return true;
} catch {
return false;
@@ -125,7 +125,7 @@ export class ApiKeysPage extends PureComponent<Props, any> {
// make sure that secondsToLive is number or null
const secondsToLive = this.state.newApiKey['secondsToLive'];
this.state.newApiKey['secondsToLive'] = secondsToLive ? kbn.interval_to_seconds(secondsToLive) : null;
this.state.newApiKey['secondsToLive'] = secondsToLive ? kbn.intervalToSeconds(secondsToLive) : null;
this.props.addApiKey(this.state.newApiKey, openModal, this.props.includeExpired);
this.setState((prevState: State) => {
return {