-
Notifications
You must be signed in to change notification settings - Fork 8.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Reporting] Integration polling config with client code #63754
Merged
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
6ed210a
source new platform for reporting ui config
tsullivan 58ca755
Merge branch 'master' into reporting/ui-config
tsullivan 8430897
fix test types
tsullivan 3e1f473
fix type check
tsullivan f403ccc
Merge branch 'master' into reporting/ui-config
elasticmachine File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License; | ||
* you may not use this file except in compliance with the Elastic License. | ||
*/ | ||
|
||
export { ConfigType } from '../server/config'; | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,15 +4,6 @@ | |
* you may not use this file except in compliance with the Elastic License. | ||
*/ | ||
|
||
import { | ||
CoreSetup, | ||
CoreStart, | ||
HttpSetup, | ||
Plugin, | ||
PluginInitializerContext, | ||
NotificationsStart, | ||
} from '../../../src/core/public'; | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. cleaned up unnecessary "proxied" imports |
||
export type JobId = string; | ||
export type JobStatus = | ||
| 'completed' | ||
|
@@ -21,9 +12,6 @@ export type JobStatus = | |
| 'processing' | ||
| 'failed'; | ||
|
||
export type HttpService = HttpSetup; | ||
export type NotificationsService = NotificationsStart; | ||
|
||
export interface SourceJob { | ||
_id: JobId; | ||
_source: { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,14 +16,15 @@ import { i18n } from '@kbn/i18n'; | |
import { FormattedMessage, InjectedIntl, injectI18n } from '@kbn/i18n/react'; | ||
import { get } from 'lodash'; | ||
import moment from 'moment'; | ||
import { Component, Fragment, default as React } from 'react'; | ||
import { Component, default as React, Fragment } from 'react'; | ||
import { Subscription } from 'rxjs'; | ||
import { ApplicationStart, ToastsSetup } from 'src/core/public'; | ||
import { ILicense, LicensingPluginSetup } from '../../../licensing/public'; | ||
import { Poller } from '../../common/poller'; | ||
import { JobStatuses, JOB_COMPLETION_NOTIFICATIONS_POLLER_CONFIG } from '../../constants'; | ||
import { JobStatuses } from '../../constants'; | ||
import { checkLicense } from '../lib/license_check'; | ||
import { JobQueueEntry, ReportingAPIClient } from '../lib/reporting_api_client'; | ||
import { ClientConfigType } from '../plugin'; | ||
import { | ||
ReportDeleteButton, | ||
ReportDownloadButton, | ||
|
@@ -53,6 +54,7 @@ export interface Props { | |
intl: InjectedIntl; | ||
apiClient: ReportingAPIClient; | ||
license$: LicensingPluginSetup['license$']; | ||
pollConfig: ClientConfigType['poll']; | ||
redirect: ApplicationStart['navigateToApp']; | ||
toasts: ToastsSetup; | ||
} | ||
|
@@ -167,12 +169,10 @@ class ReportListingUi extends Component<Props, State> { | |
functionToPoll: () => { | ||
return this.fetchJobs(); | ||
}, | ||
pollFrequencyInMillis: | ||
JOB_COMPLETION_NOTIFICATIONS_POLLER_CONFIG.jobCompletionNotifier.interval, | ||
pollFrequencyInMillis: this.props.pollConfig.jobsRefresh.interval, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this was previously using the wrong config key |
||
trailing: false, | ||
continuePollingOnError: true, | ||
pollFrequencyErrorMultiplier: | ||
JOB_COMPLETION_NOTIFICATIONS_POLLER_CONFIG.jobCompletionNotifier.intervalErrorMultiplier, | ||
pollFrequencyErrorMultiplier: this.props.pollConfig.jobsRefresh.intervalErrorMultiplier, | ||
}); | ||
this.poller.start(); | ||
this.licenseSubscription = this.props.license$.subscribe(this.licenseHandler); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A new file for sharing types in server / client. I expect there will be more additions to this in the future when we remove the code from legacy and clean up where types are defined