-
Notifications
You must be signed in to change notification settings - Fork 8.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Reporting] Make CSV authentication failure a warning (#126358)
* added ability for CSV to fail due to auth or unknown error and NOT throw * wording * added warning toast when report finishes, but with warnings * added tests for CSV generator * moved i18n to external file * remove extra i18n for now Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
- Loading branch information
1 parent
6e11bea
commit 3285eb1
Showing
8 changed files
with
182 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License | ||
* 2.0; you may not use this file except in compliance with the Elastic License | ||
* 2.0. | ||
*/ | ||
|
||
import { FormattedMessage } from '@kbn/i18n-react'; | ||
import React, { Fragment } from 'react'; | ||
import { ThemeServiceStart, ToastInput } from 'src/core/public'; | ||
import { toMountPoint } from '../../../../../src/plugins/kibana_react/public'; | ||
import { JobId, JobSummary } from '../../common/types'; | ||
import { DownloadButton } from './job_download_button'; | ||
import { ReportLink } from './report_link'; | ||
|
||
export const getWarningToast = ( | ||
job: JobSummary, | ||
getReportLink: () => string, | ||
getDownloadLink: (jobId: JobId) => string, | ||
theme: ThemeServiceStart | ||
): ToastInput => ({ | ||
title: toMountPoint( | ||
<FormattedMessage | ||
id="xpack.reporting.publicNotifier.warning.title" | ||
defaultMessage="{reportType} completed with issues" | ||
values={{ reportType: job.jobtype }} | ||
/>, | ||
{ theme$: theme.theme$ } | ||
), | ||
text: toMountPoint( | ||
<Fragment> | ||
<p> | ||
<FormattedMessage | ||
id="xpack.reporting.publicNotifier.warning.description" | ||
defaultMessage="The report completed with issues." | ||
/> | ||
</p> | ||
<p> | ||
<ReportLink getUrl={getReportLink} /> | ||
</p> | ||
<DownloadButton getUrl={getDownloadLink} job={job} /> | ||
</Fragment>, | ||
{ theme$: theme.theme$ } | ||
), | ||
'data-test-subj': 'completeReportWarning', | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
26 changes: 26 additions & 0 deletions
26
x-pack/plugins/reporting/server/export_types/csv_searchsource/generate_csv/i18n_texts.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License | ||
* 2.0; you may not use this file except in compliance with the Elastic License | ||
* 2.0. | ||
*/ | ||
|
||
import { i18n } from '@kbn/i18n'; | ||
|
||
export const i18nTexts = { | ||
escapedFormulaValuesMessage: i18n.translate( | ||
'xpack.reporting.exportTypes.csv.generateCsv.escapedFormulaValues', | ||
{ | ||
defaultMessage: 'CSV may contain formulas whose values have been escaped', | ||
} | ||
), | ||
authenticationError: { | ||
partialResultsMessage: i18n.translate( | ||
'xpack.reporting.exportTypes.csv.generateCsv.authenticationExpired.partialResultsMessage', | ||
{ | ||
defaultMessage: | ||
'This report contains partial CSV results because authentication expired before it could finish. Try exporting a smaller amount of data or increase your authentication timeout.', | ||
} | ||
), | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters