diff --git a/package.json b/package.json index 7968106d..a92e9297 100644 --- a/package.json +++ b/package.json @@ -20,14 +20,14 @@ "dependencies": { "babel-polyfill": "^6.26.0", "cron-validator": "^1.1.1", - "dompurify": "^2.4.1", + "dompurify": "^3.0.11", "elastic-builder": "^2.7.1", "enzyme-adapter-react-16": "^1.15.5", "exceljs": "^4.4.0", "html2canvas": "1.4.1", "jest-fetch-mock": "^3.0.3", "jquery": "^3.5.0", - "jsdom": "18.0.0", + "jsdom": "^21.1.2", "json-2-csv": "^3.20.0", "jspdf": "^2.5.1", "react-addons-test-utils": "^15.6.2", diff --git a/public/components/context_menu/context_menu.js b/public/components/context_menu/context_menu.js index ff178260..af587ed6 100644 --- a/public/components/context_menu/context_menu.js +++ b/public/components/context_menu/context_menu.js @@ -211,7 +211,7 @@ $(function () { $('#reportGenerationProgressModal').remove(); }); - // close modal with the close EuiButton + // close modal with the close EuiSmallButton $(document).on('click', '#closeReportGenerationModalButton', function () { $('#reportGenerationProgressModal').remove(); }); diff --git a/public/components/main/__tests__/__snapshots__/main.test.tsx.snap b/public/components/main/__tests__/__snapshots__/main.test.tsx.snap index 3916766d..fb5284a8 100644 --- a/public/components/main/__tests__/__snapshots__/main.test.tsx.snap +++ b/public/components/main/__tests__/__snapshots__/main.test.tsx.snap @@ -29,7 +29,7 @@ exports[` panel render component 1`] = ` class="euiFlexItem euiFlexItem--flexGrowZero" > panel render component 1`] = ` class="euiFlexItem euiFlexItem--flexGrowZero" > panel render component 1`] = ` class="euiFlexItem euiFlexItem--flexGrowZero" > @@ -912,7 +912,7 @@ exports[` panel render component 1`] = ` /> panel render component after create success 1`] = ` class="euiFlexItem euiFlexItem--flexGrowZero" > panel render component after create success 1`] = ` class="euiFlexItem euiFlexItem--flexGrowZero" > panel render component after create success 1`] = ` class="euiFlexItem euiFlexItem--flexGrowZero" > @@ -1860,7 +1860,7 @@ exports[` panel render component after create success 1`] = ` /> panel render component after delete success 1`] = ` class="euiFlexItem euiFlexItem--flexGrowZero" > panel render component after delete success 1`] = ` class="euiFlexItem euiFlexItem--flexGrowZero" > panel render component after delete success 1`] = ` class="euiFlexItem euiFlexItem--flexGrowZero" > @@ -2865,7 +2865,7 @@ exports[` panel render component after delete success 1`] = ` /> panel render component after edit success 1`] = ` class="euiFlexItem euiFlexItem--flexGrowZero" > panel render component after edit success 1`] = ` class="euiFlexItem euiFlexItem--flexGrowZero" > panel render component after edit success 1`] = ` class="euiFlexItem euiFlexItem--flexGrowZero" > @@ -3871,7 +3871,7 @@ exports[` panel render component after edit success 1`] = ` /> panel render empty table 1`] = ` /> - + @@ -325,7 +325,7 @@ export function Main(props) { - + - { window.location.assign('reports-dashboards#/create'); @@ -348,7 +348,7 @@ export function Main(props) { 'opensearch.reports.main.reportDefinitions.button.create', { defaultMessage: 'Create' } )} - + diff --git a/public/components/main/report_definition_details/__tests__/__snapshots__/report_definition_details.test.tsx.snap b/public/components/main/report_definition_details/__tests__/__snapshots__/report_definition_details.test.tsx.snap index 7bf41540..4584b2ba 100644 --- a/public/components/main/report_definition_details/__tests__/__snapshots__/report_definition_details.test.tsx.snap +++ b/public/components/main/report_definition_details/__tests__/__snapshots__/report_definition_details.test.tsx.snap @@ -44,7 +44,7 @@ exports[` panel render 5 hours recurring definition d class="euiFlexItem euiFlexItem--flexGrowZero" > @@ -63,7 +63,7 @@ exports[` panel render 5 hours recurring definition d class="euiFlexItem euiFlexItem--flexGrowZero" > @@ -82,7 +82,7 @@ exports[` panel render 5 hours recurring definition d class="euiFlexItem euiFlexItem--flexGrowZero" > @@ -457,7 +457,7 @@ exports[` panel render disabled daily definition, cli class="euiFlexItem euiFlexItem--flexGrowZero" > @@ -476,7 +476,7 @@ exports[` panel render disabled daily definition, cli class="euiFlexItem euiFlexItem--flexGrowZero" > @@ -495,7 +495,7 @@ exports[` panel render disabled daily definition, cli class="euiFlexItem euiFlexItem--flexGrowZero" > @@ -870,7 +870,7 @@ exports[` panel render on demand definition details 1 class="euiFlexItem euiFlexItem--flexGrowZero" > @@ -889,7 +889,7 @@ exports[` panel render on demand definition details 1 class="euiFlexItem euiFlexItem--flexGrowZero" > @@ -908,7 +908,7 @@ exports[` panel render on demand definition details 1 class="euiFlexItem euiFlexItem--flexGrowZero" > diff --git a/public/components/main/report_definition_details/report_definition_details.tsx b/public/components/main/report_definition_details/report_definition_details.tsx index 2d44dfd2..531b42a8 100644 --- a/public/components/main/report_definition_details/report_definition_details.tsx +++ b/public/components/main/report_definition_details/report_definition_details.tsx @@ -16,7 +16,7 @@ import { EuiHorizontalRule, EuiSpacer, EuiPageHeaderSection, - EuiButton, + EuiSmallButton, EuiIcon, EuiLink, EuiGlobalToastList, @@ -562,12 +562,12 @@ export function ReportDefinitionDetails(props: { match?: any; setBreadcrumbs?: a reportDefinitionDetails.status === 'Active' ? 'Disable' : 'Enable'; return ( - changeScheduledReportDefinitionStatus(status)} id={'changeStatusFromDetailsButton'} > {status} - + ); }; @@ -609,12 +609,12 @@ export function ReportDefinitionDetails(props: { match?: any; setBreadcrumbs?: a const showActionButton = reportDefinitionDetails.triggerType === ON_DEMAND ? ( - generateReportFromDetails()} id={'generateReportFromDetailsButton'} > Generate report - + ) : ( ); @@ -653,7 +653,7 @@ export function ReportDefinitionDetails(props: { match?: any; setBreadcrumbs?: a )} reportDetailsComponentContent={reportDefinitionDetails.status} /> - @@ -697,7 +697,7 @@ export function ReportDefinitionDetails(props: { match?: any; setBreadcrumbs?: a gutterSize="l" > - handleShowDeleteModal(show)} id={'deleteReportDefinitionButton'} @@ -706,11 +706,11 @@ export function ReportDefinitionDetails(props: { match?: any; setBreadcrumbs?: a 'opensearch.reports.reportDefinitionsDetails.deleteReportDefinitionButton', { defaultMessage: 'Delete' } )} - + {showActionButton} - { window.location.assign( @@ -723,7 +723,7 @@ export function ReportDefinitionDetails(props: { match?: any; setBreadcrumbs?: a 'opensearch.reports.reportDefinitionsDetails.editReportDefinitionButton', { defaultMessage: 'Edit' } )} - + diff --git a/public/components/main/report_definitions_table.tsx b/public/components/main/report_definitions_table.tsx index b0d255b3..3f0c3b98 100644 --- a/public/components/main/report_definitions_table.tsx +++ b/public/components/main/report_definitions_table.tsx @@ -7,7 +7,7 @@ import React, { useState } from 'react'; import { EuiLink, EuiInMemoryTable, - EuiButton, + EuiSmallButton, EuiEmptyPrompt, EuiText, EuiIcon, @@ -57,7 +57,7 @@ const emptyMessageReportDefinitions = ( } actions={ - { window.location.assign('reports-dashboards#/create'); }} @@ -66,7 +66,7 @@ const emptyMessageReportDefinitions = ( 'opensearch.reports.reportDefinitionsTable.emptyMessageReports.createReportDefinition', { defaultMessage: 'Create report definition' } )} - + } /> diff --git a/public/components/main/reports_table.tsx b/public/components/main/reports_table.tsx index 90b85563..4e3f46c0 100644 --- a/public/components/main/reports_table.tsx +++ b/public/components/main/reports_table.tsx @@ -6,7 +6,6 @@ import React, { Fragment, useState } from 'react'; import { i18n } from '@osd/i18n'; import { - EuiButton, // @ts-ignore EuiLink, EuiText, diff --git a/public/components/report_definitions/create/create_report_definition.tsx b/public/components/report_definitions/create/create_report_definition.tsx index 5c14cfda..3d0f2f59 100644 --- a/public/components/report_definitions/create/create_report_definition.tsx +++ b/public/components/report_definitions/create/create_report_definition.tsx @@ -6,11 +6,11 @@ import React, { useEffect, useState } from 'react'; import { i18n } from '@osd/i18n'; import { - EuiButtonEmpty, + EuiSmallButtonEmpty, EuiFlexGroup, EuiFlexItem, EuiGlobalToastList, - EuiButton, + EuiSmallButton, EuiTitle, EuiPageBody, EuiSpacer, @@ -324,7 +324,7 @@ export function CreateReport(props: { [x: string]: any; setBreadcrumbs?: any; ht - { window.location.assign(`reports-dashboards#/`); }} @@ -333,10 +333,10 @@ export function CreateReport(props: { [x: string]: any; setBreadcrumbs?: any; ht 'opensearch.reports.createReportDefinition.cancel', { defaultMessage: 'Cancel' } )} - + - createNewReportDefinition( @@ -350,7 +350,7 @@ export function CreateReport(props: { [x: string]: any; setBreadcrumbs?: any; ht 'opensearch.reports.createReportDefinition.create', { defaultMessage: 'Create' } )} - + - - - + - - - + - - + - - + + Send test message - - + + ) : null; @@ -345,7 +345,7 @@ export function ReportDelivery(props: ReportDeliveryProps) { - - { window.location.assign('reports-dashboards#/'); }} @@ -327,10 +327,10 @@ export function EditReportDefinition(props: { [x: string]: any; setBreadcrumbs?: 'opensearch.reports.editReportDefinition.cancel', { defaultMessage: 'Cancel' } )} - + - editReportDefinition(editReportDefinitionRequest)} id={'editReportDefinitionButton'} @@ -338,7 +338,7 @@ export function EditReportDefinition(props: { [x: string]: any; setBreadcrumbs?: {i18n.translate('opensearch.reports.editReportDefinition.save', { defaultMessage: 'Save Changes', })} - + panel dashboard create from in-context 1`] = ` class="euiFlexItem" > panel dashboard create from in-context 1`] = ` class="euiFormRow__fieldWrapper" > panel dashboard create from in-context 1`] = ` class="euiFlexItem" > panel dashboard create from in-context 1`] = ` class="euiFormRow__fieldWrapper" > @@ -108,7 +108,7 @@ exports[` panel dashboard create from in-context 1`] = ` class="euiSpacer euiSpacer--l" /> panel dashboard create from in-context 1`] = ` id="random_html_id" > panel dashboard create from in-context 1`] = ` panel dashboard create from in-context 1`] = ` panel dashboard create from in-context 1`] = ` panel dashboard create from in-context 1`] = ` /> panel dashboard create from in-context 1`] = ` @@ -278,7 +278,7 @@ exports[` panel dashboard create from in-context 1`] = ` > panel dashboard create from in-context 1`] = ` panel dashboard create from in-context 1`] = ` class="euiFlexItem" > panel dashboard create from in-context 1`] = ` class="euiDatePickerRange euiDatePickerRange--inGroup" > @@ -422,7 +422,7 @@ exports[` panel dashboard create from in-context 1`] = ` class="euiPopover__anchor" > @@ -460,7 +460,7 @@ exports[` panel dashboard create from in-context 1`] = ` panel dashboard create from in-context 1`] = ` id="random_html_id" > panel dashboard create from in-context 1`] = ` panel dashboard create from in-context 1`] = ` Report header and footer panel dashboard create from in-context 1`] = ` panel dashboard create from in-context 1`] = ` class="euiSpacer euiSpacer--l" /> panel dashboard create from in-context 1`] = ` panel dashboard create from in-context 1`] = ` /> panel dashboard create from in-context 1`] = ` id="reportDefinitionTriggerTypes" > panel dashboard create from in-context 1`] = ` panel display errors on create 1`] = ` class="euiFlexItem" > panel display errors on create 1`] = ` class="euiFormRow__fieldWrapper" > panel display errors on create 1`] = ` class="euiFlexItem" > panel display errors on create 1`] = ` class="euiFormRow__fieldWrapper" > @@ -1291,7 +1291,7 @@ exports[` panel display errors on create 1`] = ` class="euiSpacer euiSpacer--l" /> panel display errors on create 1`] = ` id="random_html_id" > panel display errors on create 1`] = ` panel display errors on create 1`] = ` panel display errors on create 1`] = ` panel display errors on create 1`] = ` /> panel display errors on create 1`] = ` @@ -1461,7 +1461,7 @@ exports[` panel display errors on create 1`] = ` > panel display errors on create 1`] = ` panel display errors on create 1`] = ` class="euiFlexItem" > panel display errors on create 1`] = ` class="euiDatePickerRange euiDatePickerRange--inGroup" > @@ -1605,7 +1605,7 @@ exports[` panel display errors on create 1`] = ` class="euiPopover__anchor" > @@ -1650,7 +1650,7 @@ exports[` panel display errors on create 1`] = ` panel display errors on create 1`] = ` id="random_html_id" > panel display errors on create 1`] = ` panel display errors on create 1`] = ` Report header and footer panel display errors on create 1`] = ` panel display errors on create 1`] = ` class="euiSpacer euiSpacer--l" /> panel display errors on create 1`] = ` panel display errors on create 1`] = ` /> panel display errors on create 1`] = ` id="reportDefinitionTriggerTypes" > panel display errors on create 1`] = ` panel render component 1`] = ` class="euiFlexItem" > panel render component 1`] = ` class="euiFormRow__fieldWrapper" > panel render component 1`] = ` class="euiFlexItem" > panel render component 1`] = ` class="euiFormRow__fieldWrapper" > @@ -2481,7 +2481,7 @@ exports[` panel render component 1`] = ` class="euiSpacer euiSpacer--l" /> panel render component 1`] = ` id="random_html_id" > panel render component 1`] = ` panel render component 1`] = ` panel render component 1`] = ` panel render component 1`] = ` /> panel render component 1`] = ` @@ -2651,7 +2651,7 @@ exports[` panel render component 1`] = ` > panel render component 1`] = ` panel render component 1`] = ` class="euiFlexItem" > panel render component 1`] = ` class="euiDatePickerRange euiDatePickerRange--inGroup" > Last 30 minutes @@ -2802,7 +2802,7 @@ exports[` panel render component 1`] = ` panel render component 1`] = ` id="random_html_id" > panel render component 1`] = ` panel render component 1`] = ` Report header and footer panel render component 1`] = ` panel render component 1`] = ` /> panel render component 1`] = ` id="reportDefinitionTriggerTypes" > panel render component 1`] = ` panel render edit, dashboard source 1`] = ` class="euiFlexItem" > panel render edit, dashboard source 1`] = ` class="euiFormRow__fieldWrapper" > panel render edit, dashboard source 1`] = ` class="euiFlexItem" > panel render edit, dashboard source 1`] = ` class="euiFormRow__fieldWrapper" > @@ -3099,7 +3099,7 @@ exports[` panel render edit, dashboard source 1`] = ` class="euiSpacer euiSpacer--l" /> panel render edit, dashboard source 1`] = ` id="random_html_id" > panel render edit, dashboard source 1`] = ` panel render edit, dashboard source 1`] = ` panel render edit, dashboard source 1`] = ` panel render edit, dashboard source 1`] = ` /> panel render edit, dashboard source 1`] = ` @@ -3273,7 +3273,7 @@ exports[` panel render edit, dashboard source 1`] = ` > panel render edit, dashboard source 1`] = ` panel render edit, dashboard source 1`] = ` class="euiFlexItem" > panel render edit, dashboard source 1`] = ` class="euiDatePickerRange euiDatePickerRange--inGroup" > Last 30 minutes @@ -3427,7 +3427,7 @@ exports[` panel render edit, dashboard source 1`] = ` panel render edit, dashboard source 1`] = ` id="random_html_id" > panel render edit, dashboard source 1`] = ` panel render edit, dashboard source 1`] = ` Report header and footer panel render edit, dashboard source 1`] = ` panel render edit, dashboard source 1`] = ` /> panel render edit, dashboard source 1`] = ` id="reportDefinitionTriggerTypes" > panel render edit, dashboard source 1`] = ` panel render edit, dashboard source 2`] = ` class="euiFlexItem" > panel render edit, dashboard source 2`] = ` class="euiFormRow__fieldWrapper" > panel render edit, dashboard source 2`] = ` class="euiFlexItem" > panel render edit, dashboard source 2`] = ` class="euiFormRow__fieldWrapper" > @@ -3724,7 +3724,7 @@ exports[` panel render edit, dashboard source 2`] = ` class="euiSpacer euiSpacer--l" /> panel render edit, dashboard source 2`] = ` id="random_html_id" > panel render edit, dashboard source 2`] = ` panel render edit, dashboard source 2`] = ` panel render edit, dashboard source 2`] = ` panel render edit, dashboard source 2`] = ` /> panel render edit, dashboard source 2`] = ` @@ -3898,7 +3898,7 @@ exports[` panel render edit, dashboard source 2`] = ` > panel render edit, dashboard source 2`] = ` panel render edit, dashboard source 2`] = ` class="euiFlexItem" > panel render edit, dashboard source 2`] = ` class="euiDatePickerRange euiDatePickerRange--inGroup" > Last 30 minutes @@ -4052,7 +4052,7 @@ exports[` panel render edit, dashboard source 2`] = ` panel render edit, dashboard source 2`] = ` id="random_html_id" > panel render edit, dashboard source 2`] = ` panel render edit, dashboard source 2`] = ` Report header and footer panel render edit, dashboard source 2`] = ` panel render edit, dashboard source 2`] = ` /> panel render edit, dashboard source 2`] = ` id="reportDefinitionTriggerTypes" > panel render edit, dashboard source 2`] = ` panel render edit, saved search source 1`] = ` class="euiFlexItem" > panel render edit, saved search source 1`] = ` class="euiFormRow__fieldWrapper" > panel render edit, saved search source 1`] = ` class="euiFlexItem" > panel render edit, saved search source 1`] = ` class="euiFormRow__fieldWrapper" > @@ -4349,7 +4349,7 @@ exports[` panel render edit, saved search source 1`] = ` class="euiSpacer euiSpacer--l" /> panel render edit, saved search source 1`] = ` id="random_html_id" > panel render edit, saved search source 1`] = ` panel render edit, saved search source 1`] = ` panel render edit, saved search source 1`] = ` panel render edit, saved search source 1`] = ` /> panel render edit, saved search source 1`] = ` @@ -4523,7 +4523,7 @@ exports[` panel render edit, saved search source 1`] = ` > panel render edit, saved search source 1`] = ` panel render edit, saved search source 1`] = ` class="euiFlexItem" > panel render edit, saved search source 1`] = ` class="euiDatePickerRange euiDatePickerRange--inGroup" > Last 30 minutes @@ -4677,7 +4677,7 @@ exports[` panel render edit, saved search source 1`] = ` panel render edit, saved search source 1`] = ` id="random_html_id" > panel render edit, saved search source 1`] = ` panel render edit, saved search source 1`] = ` Report header and footer panel render edit, saved search source 1`] = ` panel render edit, saved search source 1`] = ` /> panel render edit, saved search source 1`] = ` id="reportDefinitionTriggerTypes" > panel render edit, saved search source 1`] = ` panel render edit, visualization source 1`] = ` class="euiFlexItem" > panel render edit, visualization source 1`] = ` class="euiFormRow__fieldWrapper" > panel render edit, visualization source 1`] = ` class="euiFlexItem" > panel render edit, visualization source 1`] = ` class="euiFormRow__fieldWrapper" > @@ -4974,7 +4974,7 @@ exports[` panel render edit, visualization source 1`] = ` class="euiSpacer euiSpacer--l" /> panel render edit, visualization source 1`] = ` id="random_html_id" > panel render edit, visualization source 1`] = ` panel render edit, visualization source 1`] = ` panel render edit, visualization source 1`] = ` panel render edit, visualization source 1`] = ` /> panel render edit, visualization source 1`] = ` @@ -5148,7 +5148,7 @@ exports[` panel render edit, visualization source 1`] = ` > panel render edit, visualization source 1`] = ` panel render edit, visualization source 1`] = ` class="euiFlexItem" > panel render edit, visualization source 1`] = ` class="euiDatePickerRange euiDatePickerRange--inGroup" > Last 30 minutes @@ -5302,7 +5302,7 @@ exports[` panel render edit, visualization source 1`] = ` panel render edit, visualization source 1`] = ` id="random_html_id" > panel render edit, visualization source 1`] = ` panel render edit, visualization source 1`] = ` Report header and footer panel render edit, visualization source 1`] = ` panel render edit, visualization source 1`] = ` /> panel render edit, visualization source 1`] = ` id="reportDefinitionTriggerTypes" > panel render edit, visualization source 1`] = ` panel render edit, visualization source 2`] = ` class="euiFlexItem" > panel render edit, visualization source 2`] = ` class="euiFormRow__fieldWrapper" > panel render edit, visualization source 2`] = ` class="euiFlexItem" > panel render edit, visualization source 2`] = ` class="euiFormRow__fieldWrapper" > @@ -5599,7 +5599,7 @@ exports[` panel render edit, visualization source 2`] = ` class="euiSpacer euiSpacer--l" /> panel render edit, visualization source 2`] = ` id="random_html_id" > panel render edit, visualization source 2`] = ` panel render edit, visualization source 2`] = ` panel render edit, visualization source 2`] = ` panel render edit, visualization source 2`] = ` /> panel render edit, visualization source 2`] = ` @@ -5773,7 +5773,7 @@ exports[` panel render edit, visualization source 2`] = ` > panel render edit, visualization source 2`] = ` panel render edit, visualization source 2`] = ` class="euiFlexItem" > panel render edit, visualization source 2`] = ` class="euiDatePickerRange euiDatePickerRange--inGroup" > Last 30 minutes @@ -5927,7 +5927,7 @@ exports[` panel render edit, visualization source 2`] = ` panel render edit, visualization source 2`] = ` id="random_html_id" > panel render edit, visualization source 2`] = ` panel render edit, visualization source 2`] = ` Report header and footer panel render edit, visualization source 2`] = ` panel render edit, visualization source 2`] = ` /> panel render edit, visualization source 2`] = ` id="reportDefinitionTriggerTypes" > panel render edit, visualization source 2`] = ` panel saved search create from in-context 1`] = ` class="euiFlexItem" > panel saved search create from in-context 1`] = ` class="euiFormRow__fieldWrapper" > panel saved search create from in-context 1`] = ` class="euiFlexItem" > panel saved search create from in-context 1`] = ` class="euiFormRow__fieldWrapper" > @@ -6224,7 +6224,7 @@ exports[` panel saved search create from in-context 1`] = ` class="euiSpacer euiSpacer--l" /> panel saved search create from in-context 1`] = ` id="random_html_id" > panel saved search create from in-context 1`] = ` panel saved search create from in-context 1`] = ` panel saved search create from in-context 1`] = ` panel saved search create from in-context 1`] = ` /> panel saved search create from in-context 1`] = ` @@ -6394,7 +6394,7 @@ exports[` panel saved search create from in-context 1`] = ` > panel saved search create from in-context 1`] = ` panel saved search create from in-context 1`] = ` class="euiFlexItem" > panel saved search create from in-context 1`] = ` class="euiDatePickerRange euiDatePickerRange--inGroup" > @@ -6538,7 +6538,7 @@ exports[` panel saved search create from in-context 1`] = ` class="euiPopover__anchor" > @@ -6576,7 +6576,7 @@ exports[` panel saved search create from in-context 1`] = ` panel saved search create from in-context 1`] = ` id="random_html_id" > panel saved search create from in-context 1`] = ` panel saved search create from in-context 1`] = ` Report header and footer panel saved search create from in-context 1`] = ` panel saved search create from in-context 1`] = ` class="euiSpacer euiSpacer--l" /> panel saved search create from in-context 1`] = ` panel saved search create from in-context 1`] = ` />