From 60d1cf95d8f6cbdb4c73c4e3ece77815c70c1ae1 Mon Sep 17 00:00:00 2001 From: Timothy Sullivan Date: Wed, 20 Nov 2024 10:03:25 -0700 Subject: [PATCH] [Reporting] Remove "download CSV" export type functionality, Part 2 Follows #199033 --- docs/settings/reporting-settings.asciidoc | 6 --- .../kbn-generate-csv/src/generate_csv.test.ts | 1 - .../src/generate_csv_esql.test.ts | 2 - .../src/lib/get_export_settings.test.ts | 1 - .../__snapshots__/config_schema.test.ts.snap | 2 - .../kbn-reporting/server/config_schema.ts | 2 +- .../reporting/server/config/index.test.ts | 11 ------ .../plugins/reporting/server/config/index.ts | 38 +------------------ .../translations/translations/fr-FR.json | 4 -- .../translations/translations/ja-JP.json | 4 -- .../translations/translations/zh-CN.json | 2 - 11 files changed, 2 insertions(+), 71 deletions(-) diff --git a/docs/settings/reporting-settings.asciidoc b/docs/settings/reporting-settings.asciidoc index 49aa22de9fd35..b43f3b268e438 100644 --- a/docs/settings/reporting-settings.asciidoc +++ b/docs/settings/reporting-settings.asciidoc @@ -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`. diff --git a/packages/kbn-generate-csv/src/generate_csv.test.ts b/packages/kbn-generate-csv/src/generate_csv.test.ts index f39cf51352a58..e2999b63088d3 100644 --- a/packages/kbn-generate-csv/src/generate_csv.test.ts +++ b/packages/kbn-generate-csv/src/generate_csv.test.ts @@ -47,7 +47,6 @@ const getMockConfig = (opts: Partial = {}): CsvConfigType => ({ maxSizeBytes: 180000, useByteOrderMarkEncoding: false, scroll: { size: 500, duration: '30s', strategy: 'pit' }, - enablePanelActionDownload: false, maxConcurrentShardRequests: 5, ...opts, }); diff --git a/packages/kbn-generate-csv/src/generate_csv_esql.test.ts b/packages/kbn-generate-csv/src/generate_csv_esql.test.ts index 9ae0b2b711c19..d2ee8e8345438 100644 --- a/packages/kbn-generate-csv/src/generate_csv_esql.test.ts +++ b/packages/kbn-generate-csv/src/generate_csv_esql.test.ts @@ -98,7 +98,6 @@ describe('CsvESQLGenerator', () => { maxSizeBytes: 180000, useByteOrderMarkEncoding: false, scroll: { size: 500, duration: '30s', strategy: 'pit' }, - enablePanelActionDownload: false, maxConcurrentShardRequests: 5, }; @@ -569,7 +568,6 @@ describe('CsvESQLGenerator', () => { maxSizeBytes: 180000, useByteOrderMarkEncoding: false, scroll: { size: 500, duration: '30s', strategy: 'pit' }, - enablePanelActionDownload: false, maxConcurrentShardRequests: 5, }; mockSearchResponse({ diff --git a/packages/kbn-generate-csv/src/lib/get_export_settings.test.ts b/packages/kbn-generate-csv/src/lib/get_export_settings.test.ts index 05a321aa1a255..f1c73680a8b9d 100644 --- a/packages/kbn-generate-csv/src/lib/get_export_settings.test.ts +++ b/packages/kbn-generate-csv/src/lib/get_export_settings.test.ts @@ -39,7 +39,6 @@ describe('getExportSettings', () => { scroll: { size: 500, duration: '30s', strategy: 'pit' }, useByteOrderMarkEncoding: false, maxConcurrentShardRequests: 5, - enablePanelActionDownload: false, }; taskInstanceFields = { startedAt: null, retryAt: null }; diff --git a/packages/kbn-reporting/server/__snapshots__/config_schema.test.ts.snap b/packages/kbn-reporting/server/__snapshots__/config_schema.test.ts.snap index fecc985c76f34..d52630ab6820c 100644 --- a/packages/kbn-reporting/server/__snapshots__/config_schema.test.ts.snap +++ b/packages/kbn-reporting/server/__snapshots__/config_schema.test.ts.snap @@ -7,7 +7,6 @@ Object { }, "csv": Object { "checkForFormulas": true, - "enablePanelActionDownload": false, "escapeFormulaValues": false, "maxConcurrentShardRequests": 5, "maxSizeBytes": ByteSizeValue { @@ -70,7 +69,6 @@ Object { }, "csv": Object { "checkForFormulas": true, - "enablePanelActionDownload": false, "escapeFormulaValues": false, "maxConcurrentShardRequests": 5, "maxSizeBytes": ByteSizeValue { diff --git a/packages/kbn-reporting/server/config_schema.ts b/packages/kbn-reporting/server/config_schema.ts index a4117341d27ca..e14bc30ab56f7 100644 --- a/packages/kbn-reporting/server/config_schema.ts +++ b/packages/kbn-reporting/server/config_schema.ts @@ -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'), }), diff --git a/x-pack/plugins/reporting/server/config/index.test.ts b/x-pack/plugins/reporting/server/config/index.test.ts index a517affac54e6..d6b0f31ddc5f3 100644 --- a/x-pack/plugins/reporting/server/config/index.test.ts +++ b/x-pack/plugins/reporting/server/config/index.test.ts @@ -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 []`); diff --git a/x-pack/plugins/reporting/server/config/index.ts b/x-pack/plugins/reporting/server/config/index.ts index 709d072a9035a..c99e2667eb6df 100644 --- a/x-pack/plugins/reporting/server/config/index.ts +++ b/x-pack/plugins/reporting/server/config/index.ts @@ -13,10 +13,7 @@ import { ConfigSchema, ReportingConfigType } from '@kbn/reporting-server'; export const config: PluginConfigDescriptor = { exposeToBrowser: { - csv: { - enablePanelActionDownload: true, - scroll: true, - }, + csv: { scroll: true }, poll: true, roles: true, export_types: true, @@ -69,44 +66,11 @@ export const config: PluginConfigDescriptor = { }, }); } - - 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 }, }, diff --git a/x-pack/plugins/translations/translations/fr-FR.json b/x-pack/plugins/translations/translations/fr-FR.json index 4d6e42bc03fbd..0dd3370d2db75 100644 --- a/x-pack/plugins/translations/translations/fr-FR.json +++ b/x-pack/plugins/translations/translations/fr-FR.json @@ -35469,10 +35469,6 @@ "xpack.remoteClusters.updateRemoteCluster.noRemoteClusterErrorMessage": "Aucun cluster distant ne porte ce nom.", "xpack.remoteClusters.updateRemoteCluster.unknownRemoteClusterErrorMessage": "Impossible de modifier le cluster, aucune réponse renvoyée d'ES.", "xpack.reporting.breadcrumb": "Reporting", - "xpack.reporting.deprecations.csvPanelActionDownload.manualStep1": "Supprimez \"{enablePanelActionDownload}\" de `kibana.yml` ou modifiez le paramètre sur `false`.", - "xpack.reporting.deprecations.csvPanelActionDownload.manualStep2": "Utilisez le panneau de remplacement pour générer des rapports CSV à partir des panneaux de recherche enregistrés dans l'application Tableau de bord.", - "xpack.reporting.deprecations.csvPanelActionDownload.message": "Le paramètre \"{enablePanelActionDownload}\" est déclassé.", - "xpack.reporting.deprecations.csvPanelActionDownload.title": "Le paramètre permettant d'activer le téléchargement CSV à partir des panneaux de recherche enregistrés dans les tableaux de bord est déclassé.", "xpack.reporting.deprecations.migrateIndexIlmPolicy.manualStepOneMessage": "Mettez à jour tous les index de reporting de façon à ce qu'ils utilisent la politique \"{reportingIlmPolicy}\" à l'aide de l'API de paramètres des index.", "xpack.reporting.deprecations.migrateIndexIlmPolicyActionMessage": "Les nouveaux index de reporting seront gérés par la politique ILM provisionnée \"{reportingIlmPolicy}\". Vous devez modifier cette politique pour gérer le cycle de vie des rapports. Cette modification cible le modèle d'indexation du système caché \"{indexPattern}\".", "xpack.reporting.deprecations.migrateIndexIlmPolicyActionTitle": "Des index de reporting gérés par une politique ILM personnalisée ont été détectés.", diff --git a/x-pack/plugins/translations/translations/ja-JP.json b/x-pack/plugins/translations/translations/ja-JP.json index 7479c77fffa7a..2876452fff753 100644 --- a/x-pack/plugins/translations/translations/ja-JP.json +++ b/x-pack/plugins/translations/translations/ja-JP.json @@ -35438,10 +35438,6 @@ "xpack.remoteClusters.updateRemoteCluster.noRemoteClusterErrorMessage": "その名前のリモートクラスターはありません。", "xpack.remoteClusters.updateRemoteCluster.unknownRemoteClusterErrorMessage": "ES からレスポンスが返らず、クラスターを編集できません。", "xpack.reporting.breadcrumb": "レポート", - "xpack.reporting.deprecations.csvPanelActionDownload.manualStep1": "kibana.ymlから“{enablePanelActionDownload}”を削除するか、設定をfalseに変更します。", - "xpack.reporting.deprecations.csvPanelActionDownload.manualStep2": "置換パネルアクションを使用して、ダッシュボードアプリケーションに保存された検索パネルからCSV形式のレポートを生成します。", - "xpack.reporting.deprecations.csvPanelActionDownload.message": "\"{enablePanelActionDownload}\"設定は廃止予定です。", - "xpack.reporting.deprecations.csvPanelActionDownload.title": "ダッシュボードの保存された検索パネルからCSVダウンロードを有効にする設定は廃止予定です。", "xpack.reporting.deprecations.migrateIndexIlmPolicy.manualStepOneMessage": "インデックス設定APIを使用して、すべてのレポートインデックスを更新し、\"{reportingIlmPolicy}\"ポリシーを使用します。", "xpack.reporting.deprecations.migrateIndexIlmPolicyActionMessage": "新しいレポートインデックスは\"{reportingIlmPolicy}\"がプロビジョニングしたILMポリシーによって管理されます。レポートライフサイクルを管理するには、このポリシーを編集する必要があります。この変更は、非表示のシステムインデックスパターン\"{indexPattern}\"を対象としています。", "xpack.reporting.deprecations.migrateIndexIlmPolicyActionTitle": "カスタムILMポリシーで管理されたレポートインデックスが見つかりました。", diff --git a/x-pack/plugins/translations/translations/zh-CN.json b/x-pack/plugins/translations/translations/zh-CN.json index a4d8a624c9108..83b3ad894c07d 100644 --- a/x-pack/plugins/translations/translations/zh-CN.json +++ b/x-pack/plugins/translations/translations/zh-CN.json @@ -34903,8 +34903,6 @@ "xpack.remoteClusters.updateRemoteCluster.noRemoteClusterErrorMessage": "没有该名称的远程集群。", "xpack.remoteClusters.updateRemoteCluster.unknownRemoteClusterErrorMessage": "无法编辑集群,ES 未返回任何响应。", "xpack.reporting.breadcrumb": "Reporting", - "xpack.reporting.deprecations.csvPanelActionDownload.manualStep2": "在 Dashboard 应用程序中使用替代面板操作从已保存搜索面板生成 CSV 报告。", - "xpack.reporting.deprecations.csvPanelActionDownload.title": "在仪表板中从已保存搜索面板启用 CSV 下载的设置已弃用。", "xpack.reporting.deprecations.migrateIndexIlmPolicyActionTitle": "找到由定制 ILM 策略管理的报告索引。", "xpack.reporting.deprecations.reportingRole.forbiddenErrorCorrectiveAction": "请确保您分配有'manage_security'集群权限。", "xpack.reporting.deprecations.reportingRole.forbiddenErrorMessage": "您没有足够的权限来修复此弃用。",