-
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] Fix copy issue in report notifications (#123607)
* refactor constants to better group report types separately * format * update comment * split report type and job type constants into separate files * added prettyReportTypeName getter to Job * use pretty name if it exists, otherwise fallback to whatever is in jobtype * slight restructure to existing copy to make it sound more natural * added basic test for pretty names * another update to existing copy, this time for the warning notification * slight update to make test clearer * fixed i18n strings for error notification and refactored success for consistency * removed previous copy * updated snapshots * remove old i18n * incorporoated copy feedback * updated snapshots
- Loading branch information
1 parent
7f5e6c3
commit 8a8a12a
Showing
14 changed files
with
119 additions
and
53 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
/* | ||
* 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. | ||
*/ | ||
|
||
export const CSV_JOB_TYPE = 'csv_searchsource'; | ||
|
||
export const PDF_JOB_TYPE = 'printable_pdf'; | ||
export const PDF_JOB_TYPE_V2 = 'printable_pdf_v2'; | ||
|
||
export const PNG_JOB_TYPE = 'PNG'; | ||
export const PNG_JOB_TYPE_V2 = 'PNGV2'; |
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,14 @@ | ||
/* | ||
* 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. | ||
*/ | ||
|
||
export const CSV_REPORT_TYPE = 'CSV'; | ||
|
||
export const PDF_REPORT_TYPE = 'printablePdf'; | ||
export const PDF_REPORT_TYPE_V2 = 'printablePdfV2'; | ||
|
||
export const PNG_REPORT_TYPE = 'PNG'; | ||
export const PNG_REPORT_TYPE_V2 = 'pngV2'; |
29 changes: 16 additions & 13 deletions
29
x-pack/plugins/reporting/public/lib/__snapshots__/stream_handler.test.ts.snap
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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,24 @@ | ||
/* | ||
* 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 { mockJobs } from '../../common/test'; | ||
import * as jobTypes from '../../common/constants/job_types'; | ||
import { Job } from './job'; | ||
|
||
describe('Job', () => { | ||
it('should provide a pretty name for all known job types', () => { | ||
for (const jobType of Object.values(jobTypes)) { | ||
const job = new Job({ ...mockJobs[0], jobtype: jobType }); | ||
expect(job.prettyJobTypeName).toEqual(expect.any(String)); | ||
} | ||
}); | ||
|
||
it('should provide "undefined" for unknown job types', () => { | ||
const job = new Job({ ...mockJobs[0], jobtype: 'foo' }); | ||
expect(job.prettyJobTypeName).toBeUndefined(); | ||
}); | ||
}); |
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
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
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