-
Notifications
You must be signed in to change notification settings - Fork 8.2k
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] Remove kibana version from report flyout in serverless #196670
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -38,7 +38,9 @@ interface Props { | |||||
|
||||||
export const ReportInfoFlyout: FunctionComponent<Props> = ({ config, onClose, job }) => { | ||||||
const isMounted = useMountedState(); | ||||||
|
||||||
const { apiClient } = useInternalApiClient(); | ||||||
const isServerless = apiClient.getIsServerless(); | ||||||
|
||||||
const [isLoading, setIsLoading] = useState<boolean>(true); | ||||||
const [loadingError, setLoadingError] = useState<undefined | Error>(); | ||||||
|
@@ -139,7 +141,7 @@ export const ReportInfoFlyout: FunctionComponent<Props> = ({ config, onClose, jo | |||||
{isLoading ? ( | ||||||
<EuiLoadingSpinner /> | ||||||
) : loadingError ? undefined : !!info ? ( | ||||||
<ReportInfoFlyoutContent info={info} /> | ||||||
<ReportInfoFlyoutContent info={info} isServerless={isServerless} /> | ||||||
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.
Suggested change
|
||||||
) : undefined} | ||||||
</EuiFlyoutBody> | ||||||
{!isLoading && ( | ||||||
|
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -33,14 +33,15 @@ const UNKNOWN = i18n.translate('xpack.reporting.listing.infoPanel.unknownLabel', | |||||
|
||||||
interface Props { | ||||||
info: Job; | ||||||
isServerless: boolean; | ||||||
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.
Suggested change
|
||||||
} | ||||||
|
||||||
const createDateFormatter = (format: string, tz: string) => (date: string) => { | ||||||
const m = moment.tz(date, tz); | ||||||
return m.isValid() ? m.format(format) : NA; | ||||||
}; | ||||||
|
||||||
export const ReportInfoFlyoutContent: FunctionComponent<Props> = ({ info }) => { | ||||||
export const ReportInfoFlyoutContent: FunctionComponent<Props> = ({ info, isServerless }) => { | ||||||
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.
Suggested change
|
||||||
const { | ||||||
services: { uiSettings, docLinks }, | ||||||
} = useKibana(); | ||||||
|
@@ -50,6 +51,8 @@ export const ReportInfoFlyoutContent: FunctionComponent<Props> = ({ info }) => { | |||||
? moment.tz.guess() | ||||||
: uiSettings.get('dateFormat:tz'); | ||||||
|
||||||
const showKibanaVersion = Boolean(info.version) && !isServerless; | ||||||
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.
Suggested change
|
||||||
|
||||||
const formatDate = createDateFormatter(uiSettings.get('dateFormat'), timezone); | ||||||
const formatMilliseconds = (millis: number) => | ||||||
i18n.translate('xpack.reporting.listing.infoPanel.msToSeconds', { | ||||||
|
@@ -74,7 +77,7 @@ export const ReportInfoFlyoutContent: FunctionComponent<Props> = ({ info }) => { | |||||
}), | ||||||
description: info.prettyStatus, | ||||||
}, | ||||||
Boolean(info.version) && { | ||||||
showKibanaVersion && { | ||||||
title: i18n.translate('xpack.reporting.listing.infoPanel.kibanaVersion', { | ||||||
defaultMessage: 'Kibana version', | ||||||
}), | ||||||
|
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.
The overall changes in this PR can be simplified, since there already is an indication of whether the deployment is serverless in the
config.statefulSettings.enabled
value, and theconfig
object is in scope here