Skip to content

Commit

Permalink
[8.x] [Reporting] Remove kibana version from report flyout in serverl…
Browse files Browse the repository at this point in the history
…ess (#196670) (#197107)

# Backport

This will backport the following commits from `main` to `8.x`:
- [[Reporting] Remove kibana version from report flyout in serverless
(#196670)](#196670)

<!--- Backport version: 9.4.3 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sqren/backport)

<!--BACKPORT [{"author":{"name":"Krzysztof
Kowalczyk","email":"[email protected]"},"sourceCommit":{"committedDate":"2024-10-21T17:10:30Z","message":"[Reporting]
Remove kibana version from report flyout in serverless (#196670)\n\n##
Summary\r\n\r\nThis PR removes `Kibana Version` from report flyout in
serverless. \r\nFixes: #196000\r\n\r\n## Visuals\r\n| Previous | New
|\r\n|-----------------|-----------------|\r\n\r\n|![image](https://github.com/user-attachments/assets/d5a60c7f-f8f2-462c-9294-f9fa9c396c57)\r\n|\r\n![chrome_FNKxcur8Ju](https://github.com/user-attachments/assets/ee0fe45d-e139-4223-8d8f-407745759382)\r\n|","sha":"2dc55e6c5ad25ee00d356ec33a9387a421800985","branchLabelMapping":{"^v9.0.0$":"main","^v8.17.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["bug","release_note:skip","v9.0.0","Team:SharedUX","backport:prev-minor","Feature:Reporting:Framework"],"title":"[Reporting]
Remove kibana version from report flyout in
serverless","number":196670,"url":"https://github.com/elastic/kibana/pull/196670","mergeCommit":{"message":"[Reporting]
Remove kibana version from report flyout in serverless (#196670)\n\n##
Summary\r\n\r\nThis PR removes `Kibana Version` from report flyout in
serverless. \r\nFixes: #196000\r\n\r\n## Visuals\r\n| Previous | New
|\r\n|-----------------|-----------------|\r\n\r\n|![image](https://github.com/user-attachments/assets/d5a60c7f-f8f2-462c-9294-f9fa9c396c57)\r\n|\r\n![chrome_FNKxcur8Ju](https://github.com/user-attachments/assets/ee0fe45d-e139-4223-8d8f-407745759382)\r\n|","sha":"2dc55e6c5ad25ee00d356ec33a9387a421800985"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v9.0.0","branchLabelMappingKey":"^v9.0.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/196670","number":196670,"mergeCommit":{"message":"[Reporting]
Remove kibana version from report flyout in serverless (#196670)\n\n##
Summary\r\n\r\nThis PR removes `Kibana Version` from report flyout in
serverless. \r\nFixes: #196000\r\n\r\n## Visuals\r\n| Previous | New
|\r\n|-----------------|-----------------|\r\n\r\n|![image](https://github.com/user-attachments/assets/d5a60c7f-f8f2-462c-9294-f9fa9c396c57)\r\n|\r\n![chrome_FNKxcur8Ju](https://github.com/user-attachments/assets/ee0fe45d-e139-4223-8d8f-407745759382)\r\n|","sha":"2dc55e6c5ad25ee00d356ec33a9387a421800985"}}]}]
BACKPORT-->

Co-authored-by: Krzysztof Kowalczyk <[email protected]>
  • Loading branch information
kibanamachine and kowalczyk-krzysztof authored Oct 21, 2024
1 parent 238fbdd commit b2eba2b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ export const ReportInfoFlyout: FunctionComponent<Props> = ({ config, onClose, jo
{isLoading ? (
<EuiLoadingSpinner />
) : loadingError ? undefined : !!info ? (
<ReportInfoFlyoutContent info={info} />
<ReportInfoFlyoutContent info={info} config={config} />
) : undefined}
</EuiFlyoutBody>
{!isLoading && (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import {
import { i18n } from '@kbn/i18n';
import { VisualReportingSoftDisabledError } from '@kbn/reporting-common/errors';

import { Job, useKibana } from '@kbn/reporting-public';
import { ClientConfigType, Job, useKibana } from '@kbn/reporting-public';
import { USES_HEADLESS_JOB_TYPES } from '../../../common/constants';
import { sharedI18nTexts } from '../../shared_i18n_texts';

Expand All @@ -33,14 +33,15 @@ const UNKNOWN = i18n.translate('xpack.reporting.listing.infoPanel.unknownLabel',

interface Props {
info: Job;
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, config }) => {
const {
services: { uiSettings, docLinks },
} = useKibana();
Expand All @@ -50,6 +51,8 @@ export const ReportInfoFlyoutContent: FunctionComponent<Props> = ({ info }) => {
? moment.tz.guess()
: uiSettings.get('dateFormat:tz');

const showKibanaVersion = Boolean(info.version) && config.statefulSettings.enabled;

const formatDate = createDateFormatter(uiSettings.get('dateFormat'), timezone);
const formatMilliseconds = (millis: number) =>
i18n.translate('xpack.reporting.listing.infoPanel.msToSeconds', {
Expand All @@ -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',
}),
Expand Down

0 comments on commit b2eba2b

Please sign in to comment.