Skip to content

[Reporting] Remove kibana version from report flyout in serverless #196670

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

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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