From d356e19115bae09ee519ada878bd6f33a7539e7c Mon Sep 17 00:00:00 2001 From: Zhongnan Su Date: Mon, 26 Oct 2020 15:18:00 -0700 Subject: [PATCH 1/2] keep csv only --- .../components/context_menu/context_menu.js | 2 +- .../context_menu/context_menu_ui.js | 41 ++++++----- .../public/components/main/main_utils.tsx | 1 + .../report_definition_details.tsx | 4 +- .../main/report_details/report_details.tsx | 4 +- .../report_definitions/delivery/delivery.tsx | 2 +- .../report_settings/report_settings.tsx | 73 ++++++++++--------- .../report_settings_constants.tsx | 16 ++-- 8 files changed, 76 insertions(+), 67 deletions(-) diff --git a/kibana-reports/public/components/context_menu/context_menu.js b/kibana-reports/public/components/context_menu/context_menu.js index 9a4b634e..9e5285cc 100644 --- a/kibana-reports/public/components/context_menu/context_menu.js +++ b/kibana-reports/public/components/context_menu/context_menu.js @@ -240,7 +240,7 @@ function locationHashChanged() { return; } const menuItem = document.createElement('div'); - menuItem.innerHTML = getMenuItem('Reporting'); + menuItem.innerHTML = getMenuItem('Reporting', !isDiscover()); navMenu[0].appendChild(menuItem.children[0]); } catch (e) { console.log(e); diff --git a/kibana-reports/public/components/context_menu/context_menu_ui.js b/kibana-reports/public/components/context_menu/context_menu_ui.js index a7d90fb5..a113bb97 100644 --- a/kibana-reports/public/components/context_menu/context_menu_ui.js +++ b/kibana-reports/public/components/context_menu/context_menu_ui.js @@ -13,25 +13,26 @@ * permissions and limitations under the License. */ -export const getMenuItem = (name) => { +export const getMenuItem = (name, isHidden) => { + const hidden = isHidden ? `style="display: none"` : ''; return ` -
+
- ` -} + `; +}; export const popoverMenu = () => { - return ` + return `
-
+
- ` - } + `; +}; export const popoverMenuDiscover = (savedSearchAvailable) => { - const buttonClass = savedSearchAvailable ? 'euiContextMenuItem' : 'euiContextMenuItem euiContextMenuItem-isDisabled'; + const buttonClass = savedSearchAvailable + ? 'euiContextMenuItem' + : 'euiContextMenuItem euiContextMenuItem-isDisabled'; const button = savedSearchAvailable ? 'button' : 'button disabled'; const popoverHeight = savedSearchAvailable ? '354px' : '322px'; - const message = savedSearchAvailable ? - `Files can take a minute or two to generate depending on the size of your source data.` : - `Save this search to enable CSV reports.`; + const message = savedSearchAvailable + ? `Files can take a minute or two to generate depending on the size of your source data.` + : `Save this search to enable CSV reports.`; return `
@@ -176,7 +179,7 @@ export const popoverMenuDiscover = (savedSearchAvailable) => {
- ` + `; }; export const reportGenerationSuccess = () => { @@ -205,8 +208,8 @@ export const reportGenerationSuccess = () => { href="opendistro_kibana_reports#/" rel="noreferrer">Reports.

- ` -} + `; +}; export const reportGenerationFailure = () => { return ` @@ -232,8 +235,8 @@ export const reportGenerationFailure = () => {

There was an error generating this report

- ` -} + `; +}; export const reportGenerationInProgressModal = () => { return ` @@ -274,5 +277,5 @@ export const reportGenerationInProgressModal = () => {
- ` -} + `; +}; diff --git a/kibana-reports/public/components/main/main_utils.tsx b/kibana-reports/public/components/main/main_utils.tsx index 55b90e87..43dde5d1 100644 --- a/kibana-reports/public/components/main/main_utils.tsx +++ b/kibana-reports/public/components/main/main_utils.tsx @@ -65,6 +65,7 @@ export const addReportsTableContent = (data) => { url: `${location.host}${report.query_url}`, format: reportParams.core_params.report_format, }; + console.log(reportsTableEntry.url); reportsTableItems.push(reportsTableEntry); } return reportsTableItems; diff --git a/kibana-reports/public/components/main/report_definition_details/report_definition_details.tsx b/kibana-reports/public/components/main/report_definition_details/report_definition_details.tsx index 8cefe5a4..f46c4de3 100644 --- a/kibana-reports/public/components/main/report_definition_details/report_definition_details.tsx +++ b/kibana-reports/public/components/main/report_definition_details/report_definition_details.tsx @@ -572,7 +572,7 @@ export function ReportDefinitionDetails(props) { {triggerSection} - + {/*

Notification settings

@@ -596,7 +596,7 @@ export function ReportDefinitionDetails(props) { )} /> - + */} - + {/*

Notification settings

@@ -371,7 +371,7 @@ export function ReportDetails(props) { )} /> - + */} +