Skip to content

Commit

Permalink
add link to UI
Browse files Browse the repository at this point in the history
  • Loading branch information
jloleysens committed Apr 14, 2022
1 parent 1b7c5fb commit cd13819
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,13 @@ export const i18nTexts = {
insufficientMemoryError: (helpUrl: string) => (
<FormattedMessage
id="xpack.reporting.listing.infoPanel.callout.cloud.insufficientMemoryError"
defaultMessage="This report cannot be generated because Kibana does not have sufficient memory. See {helpUrl} for further information."
defaultMessage="This report cannot be generated. {link}."
values={{
helpUrl: (
link: (
<EuiLink href={helpUrl}>
{i18n.translate(
'xpack.reporting.listing.infoPanel.callout.cloud.insufficientMemoryError.urlLink',
{ defaultMessage: 'this documentation' }
{ defaultMessage: 'See minimum RAM requirements' }
)}
</EuiLink>
),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ const createDateFormatter = (format: string, tz: string) => (date: string) => {

export const ReportInfoFlyoutContent: FunctionComponent<Props> = ({ info }) => {
const {
services: { uiSettings },
services: { uiSettings, docLinks },
} = useKibana();

const timezone =
Expand Down Expand Up @@ -195,20 +195,23 @@ export const ReportInfoFlyoutContent: FunctionComponent<Props> = ({ info }) => {
* should only occur on cloud.
*/
info.error_code === VisualReportingSoftDisabledError.code
? i18nTexts.cloud.insufficientMemoryError('#')
? i18nTexts.cloud.insufficientMemoryError(docLinks.links.reporting.cloudMinimumRequirements)
: info.getError();

return (
<>
{Boolean(errored) && (
<EuiCallOut
title={i18n.translate('xpack.reporting.listing.infoPanel.callout.failedReportTitle', {
defaultMessage: 'Report failed',
})}
color="danger"
>
{errored}
</EuiCallOut>
<>
<EuiCallOut
title={i18n.translate('xpack.reporting.listing.infoPanel.callout.failedReportTitle', {
defaultMessage: 'Report failed',
})}
color="danger"
>
{errored}
</EuiCallOut>
<EuiSpacer />
</>
)}
{Boolean(warnings) && (
<>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ export async function mountManagementSection(
http: coreSetup.http,
application: coreStart.application,
uiSettings: coreStart.uiSettings,
docLinks: coreStart.docLinks,
}}
>
<InternalApiClientProvider apiClient={apiClient}>
Expand Down
9 changes: 5 additions & 4 deletions x-pack/plugins/reporting/public/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,11 @@
* 2.0.
*/

import type { HttpSetup, ApplicationStart, CoreSetup } from 'src/core/public';
import type { CoreSetup, CoreStart } from 'src/core/public';

export interface KibanaContext {
http: HttpSetup;
application: ApplicationStart;
uiSettings: CoreSetup['uiSettings'];
http: CoreSetup['http'];
application: CoreStart['application'];
uiSettings: CoreStart['uiSettings'];
docLinks: CoreStart['docLinks'];
}

0 comments on commit cd13819

Please sign in to comment.