Skip to content

Commit

Permalink
[Manual backport] Update report with many records warning (#431)
Browse files Browse the repository at this point in the history
* [Feature] Add the ability to configure record limit/count from the UI (#395)

* feat(components/report-settings): add field for variable record limits

Signed-off-by: Károly Szakály <[email protected]>

* fix(components/report-settings): set type for event target

Signed-off-by: Károly Szakály <[email protected]>

* feat(components/report-settings): load existing record limit in edit mode

Signed-off-by: Károly Szakály <[email protected]>

* feat(components/report-definition-details): show record limit on report definition details page

Signed-off-by: Károly Szakály <[email protected]>

* feat(components/report-definition-details): omit record limit for non saved search sources

Signed-off-by: Károly Szakály <[email protected]>

* feat(components/report-details): show record limit on report details page

Signed-off-by: Károly Szakály <[email protected]>

* tests(cypress): add `force: true` to name input

Signed-off-by: Károly Szakály <[email protected]>

* tests(jest/snapshots): update snapshots

Signed-off-by: Károly Szakály <[email protected]>

* feat(components/report-settings): add proper i18n label for record limit input

Signed-off-by: Károly Szakály <[email protected]>

* Update release notes

Signed-off-by: Simeon Widdis <[email protected]>

* Add potential OOM warning for large record limits

Signed-off-by: Simeon Widdis <[email protected]>

* Make memory warning more conservative based on original limit

Signed-off-by: Simeon Widdis <[email protected]>

---------

Signed-off-by: Károly Szakály <[email protected]>
Signed-off-by: Simeon Widdis <[email protected]>
Co-authored-by: Simeon Widdis <[email protected]>

* Fix merge conflict markers

Signed-off-by: Simeon Widdis <[email protected]>

* Update large record report warning (#429)

Signed-off-by: Simeon Widdis <[email protected]>

* Merge 2.x

Signed-off-by: Simeon Widdis <[email protected]>

---------

Signed-off-by: Károly Szakály <[email protected]>
Signed-off-by: Simeon Widdis <[email protected]>
Co-authored-by: Károly Szakály <[email protected]>
  • Loading branch information
Swiddis and szkly authored Sep 10, 2024
1 parent 6dc0fbb commit 6d2970e
Showing 1 changed file with 16 additions and 22 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,23 +6,13 @@
import React, { useEffect, useState } from 'react';
import { i18n } from '@osd/i18n';
import {
EuiFieldText,
EuiFieldNumber,
EuiFlexGroup,
EuiFlexItem,
EuiFormRow,
EuiPageHeader,
EuiTitle,
EuiPageContent,
EuiPageContentBody,
EuiHorizontalRule,
EuiSpacer,
EuiRadioGroup,
EuiTextArea,
EuiCheckboxGroup,
EuiComboBox,
EuiText,
EuiIcon,
EuiFormRow,
EuiCallOut,
} from '@elastic/eui';
import {
REPORT_SOURCE_RADIOS,
Expand Down Expand Up @@ -800,22 +790,26 @@ export function ReportSettings(props: ReportSettingProps) {
/>
</EuiFormRow>
<EuiSpacer />
{savedSearchRecordLimit > 10000 ? (
<>
<EuiCallOut
color="primary"
title={i18n.translate(
'opensearch.reports.reportSettingProps.form.savedSearchLargeRecordLimitWarning',
{ defaultMessage: 'Generating reports with a large number of records can cause memory issues' }
)}
iconType="iInCircle"
size="s"
/>
<EuiSpacer size="xs" />
</>
) : null}
<EuiFormRow
id="reportSourceSavedSearchRecordLimit"
label={i18n.translate(
'opensearch.reports.reportSettingProps.form.savedSearchRecordLimit',
{ defaultMessage: 'Record limit' }
)}
helpText={
savedSearchRecordLimit > 10000 ? (
<EuiText color="warning" size="xs">
<EuiIcon color="warning" type="alert" size="s" /> Generating
very large reports can cause memory issues.
</EuiText>
) : (
''
)
}
>
<EuiFieldNumber
value={savedSearchRecordLimit}
Expand Down

0 comments on commit 6d2970e

Please sign in to comment.