Skip to content

Commit

Permalink
[Reporting] Remove "download CSV" export type functionality, Part 2
Browse files Browse the repository at this point in the history
Follows #199033
  • Loading branch information
tsullivan committed Nov 20, 2024
1 parent 8ce1c46 commit b5ff439
Show file tree
Hide file tree
Showing 8 changed files with 2 additions and 61 deletions.
6 changes: 0 additions & 6 deletions docs/settings/reporting-settings.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -302,11 +302,5 @@ Enables a check that warns you when there's a potential formula included in the
`xpack.reporting.csv.escapeFormulaValues`::
Escape formula values in cells with a `'`. See OWASP: https://www.owasp.org/index.php/CSV_Injection. Defaults to `true`.

`xpack.reporting.csv.enablePanelActionDownload`::
deprecated:[8.14.0,This setting will be removed in an upcoming version of {kib}.] When `true`, this
setting enables a deprecated feature which allows users to download a CSV export from a saved search
panel on a dashboard. When `false`, users can generate regular CSV reports from a saved search panel on a
dashboard and later download them in *Stack Management > Reporting*. Defaults to `false`.

`xpack.reporting.csv.useByteOrderMarkEncoding`::
Adds a byte order mark (`\ufeff`) at the beginning of the CSV file. Defaults to `false`.
1 change: 0 additions & 1 deletion packages/kbn-generate-csv/src/generate_csv.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ const getMockConfig = (opts: Partial<CsvConfigType> = {}): CsvConfigType => ({
maxSizeBytes: 180000,
useByteOrderMarkEncoding: false,
scroll: { size: 500, duration: '30s', strategy: 'pit' },
enablePanelActionDownload: false,
maxConcurrentShardRequests: 5,
...opts,
});
Expand Down
2 changes: 0 additions & 2 deletions packages/kbn-generate-csv/src/generate_csv_esql.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,6 @@ describe('CsvESQLGenerator', () => {
maxSizeBytes: 180000,
useByteOrderMarkEncoding: false,
scroll: { size: 500, duration: '30s', strategy: 'pit' },
enablePanelActionDownload: false,
maxConcurrentShardRequests: 5,
};

Expand Down Expand Up @@ -569,7 +568,6 @@ describe('CsvESQLGenerator', () => {
maxSizeBytes: 180000,
useByteOrderMarkEncoding: false,
scroll: { size: 500, duration: '30s', strategy: 'pit' },
enablePanelActionDownload: false,
maxConcurrentShardRequests: 5,
};
mockSearchResponse({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ describe('getExportSettings', () => {
scroll: { size: 500, duration: '30s', strategy: 'pit' },
useByteOrderMarkEncoding: false,
maxConcurrentShardRequests: 5,
enablePanelActionDownload: false,
};

taskInstanceFields = { startedAt: null, retryAt: null };
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion packages/kbn-reporting/server/config_schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ const CaptureSchema = schema.object({
const CsvSchema = schema.object({
checkForFormulas: schema.boolean({ defaultValue: true }),
escapeFormulaValues: schema.boolean({ defaultValue: false }),
enablePanelActionDownload: schema.boolean({ defaultValue: false }), // unused as of 9.0
enablePanelActionDownload: schema.maybe(schema.boolean({ defaultValue: false })), // unused as of 9.0
maxSizeBytes: schema.oneOf([schema.number(), schema.byteSize()], {
defaultValue: ByteSizeValue.parse('250mb'),
}),
Expand Down
11 changes: 0 additions & 11 deletions x-pack/plugins/reporting/server/config/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,19 +54,8 @@ describe('deprecations', () => {
`);
});

it('logs a warning if csv.enablePanelActionDownload: true is set', () => {
const { messages } = applyReportingDeprecations({ csv: { enablePanelActionDownload: true } });
expect(messages).toMatchInlineSnapshot(`
Array [
"The default mechanism for Reporting privileges will work differently in future versions, which will affect the behavior of this cluster. Set \\"xpack.reporting.roles.enabled\\" to \\"false\\" to adopt the future behavior before upgrading.",
"The \\"xpack.reporting.csv.enablePanelActionDownload\\" setting is deprecated.",
]
`);
});

it('does not log a warning recommended settings are used', () => {
const { messages } = applyReportingDeprecations({
csv: { enablePanelActionDownload: false },
roles: { enabled: false },
});
expect(messages).toMatchInlineSnapshot(`Array []`);
Expand Down
38 changes: 1 addition & 37 deletions x-pack/plugins/reporting/server/config/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,7 @@ import { ConfigSchema, ReportingConfigType } from '@kbn/reporting-server';

export const config: PluginConfigDescriptor<ReportingConfigType> = {
exposeToBrowser: {
csv: {
enablePanelActionDownload: true,
scroll: true,
},
csv: { scroll: true },
poll: true,
roles: true,
export_types: true,
Expand Down Expand Up @@ -69,44 +66,11 @@ export const config: PluginConfigDescriptor<ReportingConfigType> = {
},
});
}

if (reporting?.csv?.enablePanelActionDownload === true) {
addDeprecation({
configPath: `${fromPath}.csv.enablePanelActionDownload`,
title: i18n.translate('xpack.reporting.deprecations.csvPanelActionDownload.title', {
defaultMessage:
'The setting to enable CSV Download from saved search panels in dashboards is deprecated.',
}),
level: 'warning',
message: i18n.translate('xpack.reporting.deprecations.csvPanelActionDownload.message', {
defaultMessage: `The "{enablePanelActionDownload}" setting is deprecated.`,
values: {
enablePanelActionDownload: `${fromPath}.csv.enablePanelActionDownload`,
},
}),
correctiveActions: {
manualSteps: [
i18n.translate('xpack.reporting.deprecations.csvPanelActionDownload.manualStep1', {
defaultMessage:
'Remove "{enablePanelActionDownload}" from `kibana.yml` or change the setting to `false`.',
values: {
enablePanelActionDownload: `${fromPath}.csv.enablePanelActionDownload`,
},
}),
i18n.translate('xpack.reporting.deprecations.csvPanelActionDownload.manualStep2', {
defaultMessage:
'Use the replacement panel action to generate CSV reports from saved search panels in the Dashboard application.',
}),
],
},
});
}
},
],
exposeToUsage: {
capture: { maxAttempts: true },
csv: {
enablePanelActionDownload: true,
maxSizeBytes: true,
scroll: { size: true, duration: true },
},
Expand Down

0 comments on commit b5ff439

Please sign in to comment.