diff --git a/src/plugins/share/public/components/_share_context_menu.scss b/src/plugins/share/public/components/_share_context_menu.scss index 0d9596193280e..79caa88159a42 100644 --- a/src/plugins/share/public/components/_share_context_menu.scss +++ b/src/plugins/share/public/components/_share_context_menu.scss @@ -1,3 +1,4 @@ // .kbnShareContextMenu__finalPanel { // padding: $euiSize; -// } \ No newline at end of file +// } + diff --git a/src/plugins/share/public/components/modals/embed_modal_page.tsx b/src/plugins/share/public/components/modals/embed_modal_page.tsx index 845f3c732a71f..370f488b3035e 100644 --- a/src/plugins/share/public/components/modals/embed_modal_page.tsx +++ b/src/plugins/share/public/components/modals/embed_modal_page.tsx @@ -7,6 +7,9 @@ */ import { + EuiButton, + EuiButtonEmpty, + EuiCheckboxGroup, EuiModal, EuiModalHeader, EuiModalHeaderTitle, @@ -21,9 +24,15 @@ import { EuiButton, EuiFormRow, EuiLoadingSpinner, + EuiModal, + EuiModalBody, + EuiModalFooter, + EuiModalHeader, + EuiModalHeaderTitle, + EuiRadioGroup, + EuiSpacer, EuiSwitch, EuiSwitchEvent, - EuiIconTip, } from '@elastic/eui'; import { Capabilities } from '@kbn/core-capabilities-common'; import { i18n } from '@kbn/i18n'; @@ -508,7 +517,7 @@ export class EmbedModal extends Component { data-test-subj="embedUrlParamExtension" /> - + this.setState({ selectedRadio: id })} diff --git a/src/plugins/share/public/components/modals/link_modal_page.tsx b/src/plugins/share/public/components/modals/link_modal_page.tsx index a4ebf9444211e..7cff6d2d76fb9 100644 --- a/src/plugins/share/public/components/modals/link_modal_page.tsx +++ b/src/plugins/share/public/components/modals/link_modal_page.tsx @@ -9,6 +9,7 @@ import React, { Component } from 'react'; import { EuiButton, + EuiButtonEmpty, EuiFlexGroup, EuiSpacer, EuiFlexItem, @@ -22,6 +23,13 @@ import { EuiModalHeaderTitle, EuiFormRow, EuiLoadingSpinner, + EuiModal, + EuiModalBody, + EuiModalFooter, + EuiModalHeader, + EuiModalHeaderTitle, + EuiRadioGroup, + EuiSpacer, EuiSwitch, EuiIconTip, EuiSwitchEvent, @@ -452,3 +460,4 @@ export class LinkModal extends Component { ); } } + diff --git a/x-pack/plugins/reporting/public/share_context_menu/csv_export_modal.tsx b/x-pack/plugins/reporting/public/share_context_menu/csv_export_modal.tsx index 154222bbdc7e6..7a7363a0b8780 100644 --- a/x-pack/plugins/reporting/public/share_context_menu/csv_export_modal.tsx +++ b/x-pack/plugins/reporting/public/share_context_menu/csv_export_modal.tsx @@ -5,7 +5,7 @@ * 2.0. */ -import { EuiButton, EuiForm, EuiFormRow, EuiSpacer, EuiText, EuiTitle } from '@elastic/eui'; +import { EuiButton, EuiCallOut, EuiForm, EuiModalBody, EuiModalFooter, EuiModalHeader, EuiModalHeaderTitle, EuiSpacer, } from '@elastic/eui'; import { ToastsSetup } from '@kbn/core-notifications-browser'; import { ThemeServiceSetup } from '@kbn/core-theme-browser'; import { IUiSettingsClient } from '@kbn/core/public'; @@ -102,28 +102,31 @@ export const CsvModalContentUI: FC = (props: Props) => { }; return ( - - - - Share as a CSV - - - - {renderDescription(objectType)} - - - generateReportingJob()} - data-test-subj="generateReportButton" - size="s" - isLoading={Boolean(createReportingJob)} - > - - - - + <> + + Generate a CSV + + + + + + + + generateReportingJob()} + data-test-subj="generateReportButton" + isLoading={Boolean(createReportingJob)} + > + + + + ); }; diff --git a/x-pack/plugins/reporting/public/share_context_menu/image_export_modal.tsx b/x-pack/plugins/reporting/public/share_context_menu/image_export_modal.tsx index dbfaa63ce80d0..22f9079e343eb 100644 --- a/x-pack/plugins/reporting/public/share_context_menu/image_export_modal.tsx +++ b/x-pack/plugins/reporting/public/share_context_menu/image_export_modal.tsx @@ -240,7 +240,7 @@ export const ReportingModalContentUI: FC = (props: Props) => { @@ -292,42 +292,41 @@ export const ReportingModalContentUI: FC = (props: Props) => { isUnsaved: boolean; exceedsMaxLength: boolean; }) => { - if (isUnsaved) { - if (exceedsMaxLength) { - return ; - } - return ; - } else if (exceedsMaxLength) { - return ; - } + // if (isUnsaved) { + // if (exceedsMaxLength) { + // return ; + // } + // return ; + // } else if (exceedsMaxLength) { + // return ; + // } return ( - - {(copy) => ( - - - - )} - + + + + {(copy) => ( + + + + )} + + + {isUnsaved ? (exceedsMaxLength ? () : ()) : (exceedsMaxLength ? () : null)} + ); }; const saveWarningMessageWithButton = objectId === undefined || objectId === '' ? ( - - } + generateReportingJob()} + data-test-subj="generateReportButton" + isLoading={Boolean(createReportingJob)} > = (props: Props) => { > @@ -349,14 +348,63 @@ export const ReportingModalContentUI: FC = (props: Props) => { fill onClick={() => generateReportingJob()} data-test-subj="generateReportButton" - size="s" isLoading={Boolean(createReportingJob)} > - + ); return ( <> + + Export + + + + } + iconType="save" + /> + + + + + + setSelectedRadio(id)} + name="image reporting radio group" + idSelected={selectedRadio} + legend={{ + children: File type + }} + /> + + + {renderOptions()} + + + + {renderCopyURLButton({ isUnsaved: !isSaved, exceedsMaxLength })} + + + + {saveWarningMessageWithButton} + Export diff --git a/x-pack/plugins/reporting/public/share_context_menu/reporting_panel_content/components/error_unsaved_work_panel.tsx b/x-pack/plugins/reporting/public/share_context_menu/reporting_panel_content/components/error_unsaved_work_panel.tsx index 75a6a8ba35626..f210d33976f15 100644 --- a/x-pack/plugins/reporting/public/share_context_menu/reporting_panel_content/components/error_unsaved_work_panel.tsx +++ b/x-pack/plugins/reporting/public/share_context_menu/reporting_panel_content/components/error_unsaved_work_panel.tsx @@ -7,33 +7,22 @@ import { i18n } from '@kbn/i18n'; import type { FunctionComponent } from 'react'; import React from 'react'; -import { FormattedMessage } from '@kbn/i18n-react'; -import { EuiCallOut, EuiText, EuiSpacer } from '@elastic/eui'; +import { EuiIconTip } from '@elastic/eui'; const i18nTexts = { title: i18n.translate('xpack.reporting.panelContent.unsavedStateErrorTitle', { - defaultMessage: 'Unsaved work', + defaultMessage: 'Save your work before copying this URL.', }), }; export const ErrorUnsavedWorkPanel: FunctionComponent = () => { return ( - - -

- -

-
- -
+ /> ); }; diff --git a/x-pack/plugins/reporting/public/share_context_menu/reporting_panel_content/reporting_panel_content.tsx b/x-pack/plugins/reporting/public/share_context_menu/reporting_panel_content/reporting_panel_content.tsx index 920f74a4f2bba..e683db9a5734e 100644 --- a/x-pack/plugins/reporting/public/share_context_menu/reporting_panel_content/reporting_panel_content.tsx +++ b/x-pack/plugins/reporting/public/share_context_menu/reporting_panel_content/reporting_panel_content.tsx @@ -16,6 +16,8 @@ import { EuiAccordion, EuiButton, EuiCopy, + EuiFlexGroup, + EuiFlexItem, EuiForm, EuiFormRow, EuiHorizontalRule, @@ -125,31 +127,36 @@ class ReportingPanelContentUi extends Component { isUnsaved: boolean; exceedsMaxLength: boolean; }) { - if (isUnsaved) { - if (exceedsMaxLength) { - return ; - } - return ; - } else if (exceedsMaxLength) { - return ; - } + // if (isUnsaved) { + // if (exceedsMaxLength) { + // return ; + // } + // return ; + // } else if (exceedsMaxLength) { + // return ; + // } return ( - - {(copy) => ( - - - - )} - + + + + {(copy) => ( + + + + )} + + + {isUnsaved ? (exceedsMaxLength ? () : ()) : (exceedsMaxLength ? () : null)} + ); } @@ -163,7 +170,7 @@ class ReportingPanelContentUi extends Component { helpText={ } >