-
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?
[Reporting] Remove kibana version from report flyout in serverless #196670
Conversation
Pinging @elastic/appex-sharedux (Team:SharedUX) |
💚 Build Succeeded
Metrics [docs]Public APIs missing comments
Async chunks
Page load bundle
|
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.
Left suggestions to use the existing flag config.statefulSettings.enabled
instead of adding a new flag
const { apiClient } = useInternalApiClient(); | ||
const isServerless = apiClient.getIsServerless(); |
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 the config
object is in scope here
@@ -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 comment
The reason will be displayed to describe this comment to others. Learn more.
- Let's change this to passing the
ClientConfigType
object
<ReportInfoFlyoutContent info={info} isServerless={isServerless} /> | |
<ReportInfoFlyoutContent info={info} config={config} /> |
@@ -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 comment
The reason will be displayed to describe this comment to others. Learn more.
- Let's have this expect the
ClientConfigType
object
isServerless: boolean; | |
config: ClientConfigType; |
} | ||
|
||
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 comment
The reason will be displayed to describe this comment to others. Learn more.
export const ReportInfoFlyoutContent: FunctionComponent<Props> = ({ info, isServerless }) => { | |
export const ReportInfoFlyoutContent: FunctionComponent<Props> = ({ info, config }) => { |
@@ -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 comment
The reason will be displayed to describe this comment to others. Learn more.
- Let's use the
config
object to determine this flag
const showKibanaVersion = Boolean(info.version) && !isServerless; | |
const showKibanaVersion = Boolean(info.version) && config.statefulSettings.enabled; |
Summary
This PR removes
Kibana Version
from report flyout in serverless.Fixes: #196000
Visuals
Checklist