From 5bbf0a1c3c47ec7949626230dbe560ee337f0fda Mon Sep 17 00:00:00 2001 From: Annie Lee <71157062+leeyun-amzn@users.noreply.github.com> Date: Fri, 10 Sep 2021 12:23:05 -0700 Subject: [PATCH 01/22] OpenSearch 1.1.0 release (#103) * Create opensearch-alerting-dashboards-plugin.release-notes-1.1.0.0.md (#101) * Create opensearch-alerting-dashboards-plugin.release-notes-1.1.0.0.md * Create opensearch-alerting-dashboards-plugin.release-notes-1.1.0.0.md Signed-off-by: Annie Lee * Update opensearch-alerting-dashboards-plugin.release-notes-1.1.0.0.md Signed-off-by: Annie Lee * Update comments Signed-off-by: Annie Lee * Update version in package.json (#102) * Update package.json * Update opensearch-alerting-dashboards-plugin.release-notes-1.1.0.0.md Signed-off-by: Annie Lee * Update opensearch-alerting-dashboards-plugin.release-notes-1.1.0.0.md Signed-off-by: Annie Lee * Text updates (#105) * Add icon tooltip * Update text and rename MonitorDefinitionCard directory * Update Schedule.js * Update Schedule.js Signed-off-by: Annie Lee * Update opensearch-alerting-dashboards-plugin.release-notes-1.1.0.0.md * Remove license Signed-off-by: Annie Lee Signed-off-by: AWSHurneyt --- package.json | 2 +- public/components/IconToolTip/IconToolTip.js | 28 ++++++++++ public/components/IconToolTip/index.js | 14 +++++ .../MonitorDefinitionCard.js | 0 .../index.js | 0 .../expressions/ForExpression.js | 5 +- .../expressions/GroupByExpression.js | 10 +++- .../expressions/MetricExpression.js | 11 ++-- .../expressions/WhereExpression.js | 10 +++- .../components/MonitorType/MonitorType.js | 6 +-- .../components/Schedule/Schedule.js | 6 +-- .../CreateMonitor/utils/constants.js | 6 +++ .../MonitorDetails/MonitorDetails.js | 3 +- .../CreateTrigger/utils/triggerToFormik.js | 2 +- .../MonitorHistory/MonitorHistory.js | 2 +- ...dashboards-plugin.release-notes-1.1.0.0.md | 51 +++++++++++++++++++ 16 files changed, 137 insertions(+), 19 deletions(-) create mode 100644 public/components/IconToolTip/IconToolTip.js create mode 100644 public/components/IconToolTip/index.js rename public/pages/CreateMonitor/components/{MonitorDefinitionCards => MonitorDefinitionCard}/MonitorDefinitionCard.js (100%) rename public/pages/CreateMonitor/components/{MonitorDefinitionCards => MonitorDefinitionCard}/index.js (100%) create mode 100644 release-notes/opensearch-alerting-dashboards-plugin.release-notes-1.1.0.0.md diff --git a/package.json b/package.json index 410e8e107..d8e333370 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "opensearch-alerting-dashboards", - "version": "1.0.0.0", + "version": "1.1.0.0", "description": "OpenSearch Dashboards Alerting Plugin", "main": "index.js", "license": "Apache-2.0", diff --git a/public/components/IconToolTip/IconToolTip.js b/public/components/IconToolTip/IconToolTip.js new file mode 100644 index 000000000..bc9ac2366 --- /dev/null +++ b/public/components/IconToolTip/IconToolTip.js @@ -0,0 +1,28 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + * + * Modifications Copyright OpenSearch Contributors. See + * GitHub history for details. + */ + +import React from 'react'; +import PropTypes from 'prop-types'; +import { EuiIcon, EuiToolTip } from '@elastic/eui'; + +const IconToolTip = ({ iconType, content, position = 'top' }) => ( + + + +); + +IconToolTip.propTypes = { + iconType: PropTypes.string.isRequired, + content: PropTypes.string, + position: PropTypes.string, +}; + +export default IconToolTip; diff --git a/public/components/IconToolTip/index.js b/public/components/IconToolTip/index.js new file mode 100644 index 000000000..7421fd0a2 --- /dev/null +++ b/public/components/IconToolTip/index.js @@ -0,0 +1,14 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + * + * Modifications Copyright OpenSearch Contributors. See + * GitHub history for details. + */ + +import IconToolTip from './IconToolTip'; + +export default IconToolTip; diff --git a/public/pages/CreateMonitor/components/MonitorDefinitionCards/MonitorDefinitionCard.js b/public/pages/CreateMonitor/components/MonitorDefinitionCard/MonitorDefinitionCard.js similarity index 100% rename from public/pages/CreateMonitor/components/MonitorDefinitionCards/MonitorDefinitionCard.js rename to public/pages/CreateMonitor/components/MonitorDefinitionCard/MonitorDefinitionCard.js diff --git a/public/pages/CreateMonitor/components/MonitorDefinitionCards/index.js b/public/pages/CreateMonitor/components/MonitorDefinitionCard/index.js similarity index 100% rename from public/pages/CreateMonitor/components/MonitorDefinitionCards/index.js rename to public/pages/CreateMonitor/components/MonitorDefinitionCard/index.js diff --git a/public/pages/CreateMonitor/components/MonitorExpressions/expressions/ForExpression.js b/public/pages/CreateMonitor/components/MonitorExpressions/expressions/ForExpression.js index d1e6233be..ad3c2204e 100644 --- a/public/pages/CreateMonitor/components/MonitorExpressions/expressions/ForExpression.js +++ b/public/pages/CreateMonitor/components/MonitorExpressions/expressions/ForExpression.js @@ -29,13 +29,16 @@ import { EuiText, EuiFlexGroup, EuiFlexItem, EuiSpacer } from '@elastic/eui'; import { UNITS_OF_TIME } from './utils/constants'; import { FormikFieldNumber, FormikSelect } from '../../../../../components/FormControls'; import { hasError, isInvalid, validatePositiveInteger } from '../../../../../utils/validate'; +import IconToolTip from '../../../../../components/IconToolTip'; +import { TIME_RANGE_TOOLTIP_TEXT } from '../../../containers/CreateMonitor/utils/constants'; class ForExpression extends Component { render() { return (
- Time range for the last + Time range for the last + diff --git a/public/pages/CreateMonitor/components/MonitorExpressions/expressions/GroupByExpression.js b/public/pages/CreateMonitor/components/MonitorExpressions/expressions/GroupByExpression.js index 3d6722678..34fdaa97b 100644 --- a/public/pages/CreateMonitor/components/MonitorExpressions/expressions/GroupByExpression.js +++ b/public/pages/CreateMonitor/components/MonitorExpressions/expressions/GroupByExpression.js @@ -33,6 +33,11 @@ import GroupByItem from './GroupByItem'; import { GROUP_BY_ERROR } from './utils/constants'; import { MONITOR_TYPE } from '../../../../../utils/constants'; import { inputLimitText } from '../../../../../utils/helpers'; +import { + GROUP_BY_TOOLTIP_TEXT, + TIME_RANGE_TOOLTIP_TEXT, +} from '../../../containers/CreateMonitor/utils/constants'; +import IconToolTip from '../../../../../components/IconToolTip'; export const MAX_NUM_QUERY_LEVEL_GROUP_BYS = 1; export const MAX_NUM_BUCKET_LEVEL_GROUP_BYS = 2; @@ -103,8 +108,9 @@ class GroupByExpression extends Component { return (
- Group by - {!isBucketLevelMonitor ? - optional : null} + Group by + {!isBucketLevelMonitor ? - optional : null} + diff --git a/public/pages/CreateMonitor/components/MonitorExpressions/expressions/MetricExpression.js b/public/pages/CreateMonitor/components/MonitorExpressions/expressions/MetricExpression.js index 223ef2ffa..495808e26 100644 --- a/public/pages/CreateMonitor/components/MonitorExpressions/expressions/MetricExpression.js +++ b/public/pages/CreateMonitor/components/MonitorExpressions/expressions/MetricExpression.js @@ -26,14 +26,18 @@ import React, { Component } from 'react'; import { connect } from 'formik'; -import { EuiText, EuiButtonEmpty, EuiSpacer, EuiBadge } from '@elastic/eui'; +import { EuiText, EuiButtonEmpty, EuiSpacer, EuiBadge, EuiToolTip, EuiIcon } from '@elastic/eui'; import { getIndexFields } from './utils/dataTypes'; import { getMetricExpressionAllowedTypes, validateAggregationsDuplicates } from './utils/helpers'; import _ from 'lodash'; -import { FORMIK_INITIAL_AGG_VALUES } from '../../../containers/CreateMonitor/utils/constants'; +import { + FORMIK_INITIAL_AGG_VALUES, + METRIC_TOOLTIP_TEXT, +} from '../../../containers/CreateMonitor/utils/constants'; import { MetricItem } from './index'; import { MONITOR_TYPE } from '../../../../../utils/constants'; import { inputLimitText } from '../../../../../utils/helpers'; +import IconToolTip from '../../../../../components/IconToolTip'; export const MAX_NUM_QUERY_LEVEL_METRICS = 1; export const MAX_NUM_BUCKET_LEVEL_METRICS = 5; @@ -111,7 +115,8 @@ class MetricExpression extends Component {
Metrics - - optional + - optional + diff --git a/public/pages/CreateMonitor/components/MonitorExpressions/expressions/WhereExpression.js b/public/pages/CreateMonitor/components/MonitorExpressions/expressions/WhereExpression.js index ca8499fb0..68d112a8b 100644 --- a/public/pages/CreateMonitor/components/MonitorExpressions/expressions/WhereExpression.js +++ b/public/pages/CreateMonitor/components/MonitorExpressions/expressions/WhereExpression.js @@ -63,7 +63,11 @@ import { FormikFieldText, } from '../../../../../components/FormControls'; import { getFilteredIndexFields, getIndexFields } from './utils/dataTypes'; -import { FORMIK_INITIAL_VALUES } from '../../../containers/CreateMonitor/utils/constants'; +import { + FILTERS_TOOLTIP_TEXT, + FORMIK_INITIAL_VALUES, + TIME_RANGE_TOOLTIP_TEXT, +} from '../../../containers/CreateMonitor/utils/constants'; import { DATA_TYPES } from '../../../../../utils/constants'; import { TRIGGER_COMPARISON_OPERATORS, @@ -71,6 +75,7 @@ import { } from '../../../../CreateTrigger/containers/DefineBucketLevelTrigger/DefineBucketLevelTrigger'; import { FORMIK_INITIAL_TRIGGER_VALUES } from '../../../../CreateTrigger/containers/CreateTrigger/utils/constants'; import { inputLimitText } from '../../../../../utils/helpers'; +import IconToolTip from '../../../../../components/IconToolTip'; const propTypes = { formik: PropTypes.object.isRequired, @@ -243,7 +248,8 @@ class WhereExpression extends Component {
{whereFilterHeader} - - optional + - optional + diff --git a/public/pages/CreateMonitor/components/MonitorType/MonitorType.js b/public/pages/CreateMonitor/components/MonitorType/MonitorType.js index 4d0752f8a..cdefd5147 100644 --- a/public/pages/CreateMonitor/components/MonitorType/MonitorType.js +++ b/public/pages/CreateMonitor/components/MonitorType/MonitorType.js @@ -44,14 +44,14 @@ const onChangeDefinition = (e, form) => { const queryLevelDescription = ( - Per query monitors run a specified query and allow you to define triggers based on the result of - that query. + Per query monitors run a specified query and define triggers that check the results of that + query. ); const bucketLevelDescription = ( - Per bucket monitors allow you to group results into buckets and define triggers that run per + Per bucket monitors allow you to group results into buckets and define triggers that check each bucket. ); diff --git a/public/pages/CreateMonitor/components/Schedule/Schedule.js b/public/pages/CreateMonitor/components/Schedule/Schedule.js index d186ca9dd..0eff9e68f 100644 --- a/public/pages/CreateMonitor/components/Schedule/Schedule.js +++ b/public/pages/CreateMonitor/components/Schedule/Schedule.js @@ -38,9 +38,9 @@ const Schedule = ({ isAd }) => ( {isAd ? (

- Define how often the monitor collects data and determines how often you may receive - alerts. We recommend scheduling the monitor at least twice the detector interval to avoid - missing anomaly results. + Define how often the monitor collects data and how often you may receive alerts. We + recommend setting this frequency to two times the detector interval to avoid missing + anomalous results from delayed processing time.

) : null} diff --git a/public/pages/CreateMonitor/containers/CreateMonitor/utils/constants.js b/public/pages/CreateMonitor/containers/CreateMonitor/utils/constants.js index bbca91e9d..d71ca3790 100644 --- a/public/pages/CreateMonitor/containers/CreateMonitor/utils/constants.js +++ b/public/pages/CreateMonitor/containers/CreateMonitor/utils/constants.js @@ -75,3 +75,9 @@ export const FORMIK_INITIAL_AGG_VALUES = { }; export const DEFAULT_COMPOSITE_AGG_SIZE = 50; + +export const METRIC_TOOLTIP_TEXT = 'Extracted statistics such as simple calculations of data.'; +export const TIME_RANGE_TOOLTIP_TEXT = 'The time frame of data the plugin should monitor.'; +export const FILTERS_TOOLTIP_TEXT = + 'Use a filter to retrieve a subset of the original data source.'; +export const GROUP_BY_TOOLTIP_TEXT = 'Specify a field whose every unique value can trigger alerts.'; diff --git a/public/pages/CreateMonitor/containers/MonitorDetails/MonitorDetails.js b/public/pages/CreateMonitor/containers/MonitorDetails/MonitorDetails.js index 7687ab738..3a60d073e 100644 --- a/public/pages/CreateMonitor/containers/MonitorDetails/MonitorDetails.js +++ b/public/pages/CreateMonitor/containers/MonitorDetails/MonitorDetails.js @@ -30,7 +30,7 @@ import ContentPanel from '../../../../components/ContentPanel'; import FormikFieldText from '../../../../components/FormControls/FormikFieldText'; import { hasError, isInvalid, required, validateMonitorName } from '../../../../utils/validate'; import Schedule from '../../components/Schedule'; -import MonitorDefinitionCard from '../../components/MonitorDefinitionCards'; +import MonitorDefinitionCard from '../../components/MonitorDefinitionCard'; import MonitorType from '../../components/MonitorType'; import AnomalyDetectors from '../AnomalyDetectors/AnomalyDetectors'; @@ -62,7 +62,6 @@ function renderEmptyMessage(message) { ); } -// TODO: Make sure that resetResponse is defined in Query and passed to MonitorDetails const MonitorDetails = ({ values, errors, diff --git a/public/pages/CreateTrigger/containers/CreateTrigger/utils/triggerToFormik.js b/public/pages/CreateTrigger/containers/CreateTrigger/utils/triggerToFormik.js index 21569c533..c3aacb16b 100644 --- a/public/pages/CreateTrigger/containers/CreateTrigger/utils/triggerToFormik.js +++ b/public/pages/CreateTrigger/containers/CreateTrigger/utils/triggerToFormik.js @@ -187,7 +187,7 @@ export function bucketLevelTriggerToFormik(trigger, monitor) { anomalyDetector: { /*If trigger type doesn't exist fallback to query trigger with following reasons 1. User has changed monitory type from normal monitor to AD monitor. - 2. User has created / updated from API and visiting Kibana to do other operations. + 2. User has created / updated from API and visiting OpenSearch Dashboards to do other operations. */ triggerType: triggerType ? triggerType : TRIGGER_TYPE.ALERT_TRIGGER, anomalyGradeThresholdValue, diff --git a/public/pages/MonitorDetails/containers/MonitorHistory/MonitorHistory.js b/public/pages/MonitorDetails/containers/MonitorHistory/MonitorHistory.js index 1efcbc922..0c7c8d085 100644 --- a/public/pages/MonitorDetails/containers/MonitorHistory/MonitorHistory.js +++ b/public/pages/MonitorDetails/containers/MonitorHistory/MonitorHistory.js @@ -185,7 +185,7 @@ class MonitorHistory extends PureComponent { /* brushAreaStart Duration is to defined the start point for smaller window over zoomer on which time line will be displayed. Duration will default to what interval has been - computed to ES bucket in case it is too small, + computed to OpenSearch bucket in case it is too small, just scale it so that customer can have better experience */ const { diff --git a/release-notes/opensearch-alerting-dashboards-plugin.release-notes-1.1.0.0.md b/release-notes/opensearch-alerting-dashboards-plugin.release-notes-1.1.0.0.md new file mode 100644 index 000000000..1069c108e --- /dev/null +++ b/release-notes/opensearch-alerting-dashboards-plugin.release-notes-1.1.0.0.md @@ -0,0 +1,51 @@ +## Version 1.1.0.0 2021-09-07 + +Compatible with OpenSearch Dashboards 1.1.0 + +### Features + +* Bucket level alerting create monitor page refactor ([#62](https://github.com/opensearch-project/alerting-dashboards-plugin/pull/62)) +* Add DefineBucketLevelTrigger component ([#63](https://github.com/opensearch-project/alerting-dashboards-plugin/pull/63)) +* Refactor CreateTrigger components to support single-page experience ([#64](https://github.com/opensearch-project/alerting-dashboards-plugin/pull/64)) +* Update CreateMonitor to incorporate new single-page experience ([#65](https://github.com/opensearch-project/alerting-dashboards-plugin/pull/65)) +* Update Monitor overview page ([#66](https://github.com/opensearch-project/alerting-dashboards-plugin/pull/66)) +* Alert dashboard table column update ([#67](https://github.com/opensearch-project/alerting-dashboards-plugin/pull/67)) +* Refactored query and bucket-level trigger definitions to align with new mocks ([#68](https://github.com/opensearch-project/alerting-dashboards-plugin/pull/68)) +* Alert dashboard update on monitor ([#72](https://github.com/opensearch-project/alerting-dashboards-plugin/pull/72)) +* Create monitor page, bucket level monitor showing bar graph ([#73](https://github.com/opensearch-project/alerting-dashboards-plugin/pull/73)) +* Use destination api to validate destination name ([#69](https://github.com/opensearch-project/alerting-dashboards-plugin/pull/69)) +* Update Monitor Details panel ([#75](https://github.com/opensearch-project/alerting-dashboards-plugin/pull/75)) +* Flyout panel on alert dashboard page ([#78](https://github.com/opensearch-project/alerting-dashboards-plugin/pull/78)) +* Add button to refresh graph , add accordion to expand/collapse graph view ([#79](https://github.com/opensearch-project/alerting-dashboards-plugin/pull/79)) +* Add success toast message for create and update monitor ([#80](https://github.com/opensearch-project/alerting-dashboards-plugin/pull/80)) +* Refactored trigger condition popover to dropdown menu. Refactored actions panel to hide throttling for 'per execution' ([#81](https://github.com/opensearch-project/alerting-dashboards-plugin/pull/81)) +* Added Export JSON button and modal to create/edit Monitor page ([#82](https://github.com/opensearch-project/alerting-dashboards-plugin/pull/82)) +* Added Monitor state EuiHealth element, replaced state item in overview with Monitor level type ([#83](https://github.com/opensearch-project/alerting-dashboards-plugin/pull/83)) +* Update alert history graph for bucket-level monitors ([#84](https://github.com/opensearch-project/alerting-dashboards-plugin/pull/84)) +* Refactored query trigger definition components to align with mocks. ([#85](https://github.com/opensearch-project/alerting-dashboards-plugin/pull/85)) +* Removed the close button from the top-right of the alert dashboard flyout. Refactored monitor details page for anomaly detection monitors. ([#86](https://github.com/opensearch-project/alerting-dashboards-plugin/pull/86)) +* Several changes in query panel ([#87](https://github.com/opensearch-project/alerting-dashboards-plugin/pull/87)) +* Implemented test message toast. Fixed alerts dashboard severity display bug. ([#88](https://github.com/opensearch-project/alerting-dashboards-plugin/pull/88)) +* Refactored Dashboard::getMonitors to function without using the from and size parameters from getAlerts ([#89](https://github.com/opensearch-project/alerting-dashboards-plugin/pull/89)) +* Query level monitor updates ([#90](https://github.com/opensearch-project/alerting-dashboards-plugin/pull/90)) +* Changes of metrics expression and graph ([#95](https://github.com/opensearch-project/alerting-dashboards-plugin/pull/95)) +* Update formik conversion for Bucket-Level Trigger to handle throttle change ([#97](https://github.com/opensearch-project/alerting-dashboards-plugin/pull/97)) +* Implemented View alert details, and logic for landing page alerts dashboard. ([#98](https://github.com/opensearch-project/alerting-dashboards-plugin/pull/98)) +* Added limit text, adjusted spacing/sizing/text, etc. ([#100](https://github.com/opensearch-project/alerting-dashboards-plugin/pull/100)) +* Remove pagination and set default size of alerts pert trigger to 10000 ([#99](https://github.com/opensearch-project/alerting-dashboards-plugin/pull/99)) + +### Enhancements + +* Show Error Toast Message whenever action execution fails from backend due to incorrect configurations ([#22](https://github.com/opensearch-project/alerting-dashboards-plugin/pull/22)) +* Bucket level alerting dev UX review feedback ([#93](https://github.com/opensearch-project/alerting-dashboards-plugin/pull/93)) +* Text updates ([#105](https://github.com/opensearch-project/alerting-dashboards-plugin/pull/105)) + +### Maintenance + +* Commit the updated yarn lock to maintain consistency. ([#26](https://github.com/opensearch-project/alerting-dashboards-plugin/pull/26)) +* Add Integtest.sh for OpenSearch integtest setups ([#28](https://github.com/opensearch-project/alerting-dashboards-plugin/pull/28)) +* Allow for custom endpoints for cypress tests ([#29](https://github.com/opensearch-project/alerting-dashboards-plugin/pull/29)) +* Add Cypress tests for Bucket-Level Alerting ([#91](https://github.com/opensearch-project/alerting-dashboards-plugin/pull/91)) +* Update cypress-workflow.yml to use environment variable for OS and OS dashboard versions ([#96](https://github.com/opensearch-project/alerting-dashboards-plugin/pull/96)) +* Create opensearch-alerting-dashboards-plugin.release-notes-1.1.0.0.md ([#101](https://github.com/opensearch-project/alerting-dashboards-plugin/pull/101)) +* Update version in package.json ([#102](https://github.com/opensearch-project/alerting-dashboards-plugin/pull/102)) \ No newline at end of file From d4dc43626628ba3bdbc8acfae6b10ca044168002 Mon Sep 17 00:00:00 2001 From: Annie Lee <71157062+leeyun-amzn@users.noreply.github.com> Date: Wed, 15 Sep 2021 14:54:28 -0700 Subject: [PATCH 02/22] Updates to workflow, unit tests, and some appearance (#114) * Added badges to the package README, and the Uploads coverage job to the unit tests workflow. (#104) * Added badges to the package README, and the Uploads coverage job to the unit tests workflow. * Removing code coverage upload token. * Update jest unit tests (#112) * Update .opensearch_dashboards-plugin-helpers.json * Update snapshots * Update whereExpression.test and some snapshots * Update whereExpression.test and some snapshots Signed-off-by: Annie Lee * Update snapshots * Update formikToTrigger.test.js * Update formikToTrigger.test.js * Update formikToTrigger.test.js * Add icon tooltip * Add test * Update tests * remove license * Update TriggerExpressions.test.js * Update Triggers.test.js * Update validation test * Update getOverviewStats.test.js * Update validate.test.js * Update helpers.test.js and remove unused import * Update Triggers.test.js * Update helpers.js * Update CreateMonitor test and clean up code * Update CreateMonitor test and clean up code Signed-off-by: Annie Lee * Update release note and adding more tests * Add test and modify cypress common-utils branch * Update MonitorDefinitionCard.test.js.snap * Update cypress-workflow.yml Signed-off-by: Annie Lee Co-authored-by: AWSHurneyt Signed-off-by: AWSHurneyt --- .github/workflows/cypress-workflow.yml | 4 +- .github/workflows/unit-tests-workflow.yml | 4 +- README.md | 7 + .../__snapshots__/Breadcrumbs.test.js.snap | 2 +- .../__snapshots__/ContentPanel.test.js.snap | 8 + .../Flyout/__snapshots__/Flyout.test.js.snap | 1 + .../__snapshots__/flyouts.test.js.snap | 1 + .../FormikCheckableCard.test.js | 38 ++ .../FormikCheckableCard.test.js.snap | 70 +++ .../FormikCodeEditor/FormikCodeEditor.test.js | 12 +- .../FormikCodeEditor.test.js.snap | 70 +++ .../IconToolTip/IconToolTip.test.js | 22 + .../__snapshots__/IconToolTip.test.js.snap | 11 + .../FeatureChart/FeatureChart.test.js | 50 ++ .../__snapshots__/FeatureChart.test.js.snap | 3 + .../ExtractionQuery/ExtractionQuery.test.js | 10 +- .../ExtractionQuery.test.js.snap | 111 ++++ .../MonitorDefinition.test.js.snap | 82 +-- .../MonitorDefinitionCard.js | 2 +- .../MonitorDefinitionCard.test.js | 39 ++ .../MonitorDefinitionCard.test.js.snap | 303 ++++++++++ .../MonitorExpressions.test.js | 2 +- .../MonitorExpressions.test.js.snap | 343 +++++++++--- .../expressions/WhereExpression.test.js | 7 +- .../__snapshots__/ForExpression.test.js.snap | 109 +++- .../WhereExpression.test.js.snap | 63 ++- .../MonitorTimeField/MonitorTimeField.test.js | 2 +- .../MonitorTimeField.test.js.snap | 114 ++-- .../MonitorType/MonitorType.test.js | 27 + .../__snapshots__/MonitorType.test.js.snap | 158 ++++++ .../QueryPerformance.test.js.snap | 151 +++-- .../__snapshots__/Frequencies.test.js.snap | 22 +- .../components/VisualGraph/VisualGraph.js | 1 - .../__snapshots__/VisualGraph.test.js.snap | 10 +- .../VisualGraph/utils/helpers.test.js | 53 +- .../AnomalyDetector.test.js.snap | 48 ++ .../CreateMonitor/CreateMonitor.test.js | 11 +- .../__snapshots__/CreateMonitor.test.js.snap | 8 + .../formikToMonitor.test.js.snap | 40 +- .../__snapshots__/DefineMonitor.test.js.snap | 239 ++++---- .../__snapshots__/MonitorIndex.test.js.snap | 44 +- .../__snapshots__/Message.test.js.snap | 204 ++++--- .../TriggerExpressions.test.js | 40 -- .../TriggerExpressions.test.js.snap | 106 +--- .../__snapshots__/TriggerQuery.test.js.snap | 159 +++--- .../utils/formikToTrigger.test.js | 32 +- .../DefineTrigger/utils/validation.js | 1 + .../DefineTrigger/utils/validation.test.js | 11 +- .../DashboardControls.test.js.snap | 10 +- .../__snapshots__/Dashboard.test.js.snap | 527 +++++++++++++----- .../DestinationsList.test.js.snap | 228 +++++++- .../Home/__snapshots__/Home.test.js.snap | 2 +- .../Main/__snapshots__/Main.test.js.snap | 2 +- .../__snapshots__/EmptyHistory.test.js.snap | 4 +- .../MonitorOverview.test.js.snap | 14 +- .../utils/getOverviewStats.test.js | 4 +- .../containers/Triggers/Triggers.js | 1 + .../containers/Triggers/Triggers.test.js | 25 +- .../__snapshots__/Triggers.test.js.snap | 45 +- public/utils/validate.test.js | 29 +- ...dashboards-plugin.release-notes-1.1.0.0.md | 3 +- test/utils/helpers.js | 31 +- 62 files changed, 2789 insertions(+), 991 deletions(-) create mode 100644 public/components/FormControls/FormikCheckableCard/FormikCheckableCard.test.js create mode 100644 public/components/FormControls/FormikCheckableCard/__snapshots__/FormikCheckableCard.test.js.snap create mode 100644 public/components/FormControls/FormikCodeEditor/__snapshots__/FormikCodeEditor.test.js.snap create mode 100644 public/components/IconToolTip/IconToolTip.test.js create mode 100644 public/components/IconToolTip/__snapshots__/IconToolTip.test.js.snap create mode 100644 public/pages/CreateMonitor/components/AnomalyDetectors/FeatureChart/FeatureChart.test.js create mode 100644 public/pages/CreateMonitor/components/AnomalyDetectors/FeatureChart/__snapshots__/FeatureChart.test.js.snap create mode 100644 public/pages/CreateMonitor/components/ExtractionQuery/__snapshots__/ExtractionQuery.test.js.snap create mode 100644 public/pages/CreateMonitor/components/MonitorDefinitionCard/MonitorDefinitionCard.test.js create mode 100644 public/pages/CreateMonitor/components/MonitorDefinitionCard/__snapshots__/MonitorDefinitionCard.test.js.snap create mode 100644 public/pages/CreateMonitor/components/MonitorType/MonitorType.test.js create mode 100644 public/pages/CreateMonitor/components/MonitorType/__snapshots__/MonitorType.test.js.snap diff --git a/.github/workflows/cypress-workflow.yml b/.github/workflows/cypress-workflow.yml index 69c741ab7..727245837 100644 --- a/.github/workflows/cypress-workflow.yml +++ b/.github/workflows/cypress-workflow.yml @@ -30,7 +30,7 @@ jobs: with: repository: opensearch-project/OpenSearch path: OpenSearch - ref: '1.x' + ref: '1.1' - name: Build OpenSearch working-directory: ./OpenSearch run: ./gradlew publishToMavenLocal @@ -40,7 +40,7 @@ jobs: with: repository: opensearch-project/common-utils path: common-utils - ref: 'main' + ref: '1.1' - name: Build common-utils working-directory: ./common-utils run: ./gradlew publishToMavenLocal -Dopensearch.version=${{ env.OPENSEARCH_VERSION }} diff --git a/.github/workflows/unit-tests-workflow.yml b/.github/workflows/unit-tests-workflow.yml index 1a156a396..d89b763e1 100644 --- a/.github/workflows/unit-tests-workflow.yml +++ b/.github/workflows/unit-tests-workflow.yml @@ -45,4 +45,6 @@ jobs: - name: Run tests run: | cd OpenSearch-Dashboards/plugins/alerting-dashboards-plugin - yarn run test:jest + yarn run test:jest --coverage + - name: Uploads coverage + uses: codecov/codecov-action@v1 diff --git a/README.md b/README.md index f1bcb71b5..132ec2046 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,10 @@ +[![Unit tests](https://github.com/opensearch-project/alerting-dashboards-plugin/workflows/Unit%20tests%20workflow/badge.svg)](https://github.com/opensearch-project/alerting-dashboards-plugin/actions?query=workflow%3A%22Unit+tests+workflow%22) +[![Integration tests](https://github.com/opensearch-project/alerting-dashboards-plugin/workflows/E2E%20Cypress%20tests/badge.svg)](https://github.com/opensearch-project/alerting-dashboards-plugin/actions?query=workflow%3A%22E2E+Cypress+tests%22) +[![codecov](https://codecov.io/gh/opensearch-project/alerting-dashboards-plugin/branch/main/graph/badge.svg)](https://codecov.io/gh/opensearch-project/alerting-dashboards-plugin) +[![Documentation](https://img.shields.io/badge/doc-reference-blue)](https://opensearch.org/docs/monitoring-plugins/alerting/index/) +[![Forum](https://img.shields.io/badge/chat-on%20forums-blue)](https://discuss.opendistrocommunity.dev/c/Use-this-category-for-all-questions-around-machine-learning-plugins) +![PRs welcome!](https://img.shields.io/badge/PRs-welcome!-success) + - [OpenSearch Alerting Dashboards](#opensearch-alerting-dashboards) diff --git a/public/components/Breadcrumbs/__snapshots__/Breadcrumbs.test.js.snap b/public/components/Breadcrumbs/__snapshots__/Breadcrumbs.test.js.snap index cfb18b3a6..b3464dafd 100644 --- a/public/components/Breadcrumbs/__snapshots__/Breadcrumbs.test.js.snap +++ b/public/components/Breadcrumbs/__snapshots__/Breadcrumbs.test.js.snap @@ -38,7 +38,7 @@ Object { exports[`getBreadcrumb returns correct constant breadcrumbs 3`] = ` Object { "href": "/dashboard", - "text": "Dashboard", + "text": "Alerts", } `; diff --git a/public/components/ContentPanel/__snapshots__/ContentPanel.test.js.snap b/public/components/ContentPanel/__snapshots__/ContentPanel.test.js.snap index b7314cf62..96b1926d8 100644 --- a/public/components/ContentPanel/__snapshots__/ContentPanel.test.js.snap +++ b/public/components/ContentPanel/__snapshots__/ContentPanel.test.js.snap @@ -30,6 +30,14 @@ exports[`ContentPanel renders 1`] = `
+
+
+

diff --git a/public/components/Flyout/__snapshots__/Flyout.test.js.snap b/public/components/Flyout/__snapshots__/Flyout.test.js.snap index 9c9f5c7f1..5b62ba8f3 100644 --- a/public/components/Flyout/__snapshots__/Flyout.test.js.snap +++ b/public/components/Flyout/__snapshots__/Flyout.test.js.snap @@ -48,6 +48,7 @@ exports[`Flyout renders 1`] = `
  • diff --git a/public/components/Flyout/flyouts/__snapshots__/flyouts.test.js.snap b/public/components/Flyout/flyouts/__snapshots__/flyouts.test.js.snap index d720a4c16..0fc5f3de4 100644 --- a/public/components/Flyout/flyouts/__snapshots__/flyouts.test.js.snap +++ b/public/components/Flyout/flyouts/__snapshots__/flyouts.test.js.snap @@ -18,6 +18,7 @@ Object {
    • diff --git a/public/components/FormControls/FormikCheckableCard/FormikCheckableCard.test.js b/public/components/FormControls/FormikCheckableCard/FormikCheckableCard.test.js new file mode 100644 index 000000000..90c9f8efd --- /dev/null +++ b/public/components/FormControls/FormikCheckableCard/FormikCheckableCard.test.js @@ -0,0 +1,38 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + * + * Modifications Copyright OpenSearch Contributors. See + * GitHub history for details. + */ + +import React from 'react'; +import { render } from 'enzyme'; +import { Formik } from 'formik'; + +import FormikCheckableCard from './FormikCheckableCard'; + +describe('FormikCheckableCard', () => { + test('render formRow', () => { + const component = ( + + + + ); + + expect(render(component)).toMatchSnapshot(); + }); + + test('render', () => { + const component = ( + + + + ); + + expect(render(component)).toMatchSnapshot(); + }); +}); diff --git a/public/components/FormControls/FormikCheckableCard/__snapshots__/FormikCheckableCard.test.js.snap b/public/components/FormControls/FormikCheckableCard/__snapshots__/FormikCheckableCard.test.js.snap new file mode 100644 index 000000000..0bda3fa43 --- /dev/null +++ b/public/components/FormControls/FormikCheckableCard/__snapshots__/FormikCheckableCard.test.js.snap @@ -0,0 +1,70 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`FormikCheckableCard render 1`] = ` +
      +
      +
      +
      + +
      +
      +
      +
      +
      +`; + +exports[`FormikCheckableCard render formRow 1`] = ` +
      +
      +
      +
      +
      +
      + +
      +
      +
      +
      +
      +
      +
      +`; diff --git a/public/components/FormControls/FormikCodeEditor/FormikCodeEditor.test.js b/public/components/FormControls/FormikCodeEditor/FormikCodeEditor.test.js index 71459fb57..95013b9e6 100644 --- a/public/components/FormControls/FormikCodeEditor/FormikCodeEditor.test.js +++ b/public/components/FormControls/FormikCodeEditor/FormikCodeEditor.test.js @@ -29,10 +29,20 @@ import { render } from 'enzyme'; import { Formik } from 'formik'; import FormikCodeEditor from './FormikCodeEditor'; +import FormikCheckableCard from '../FormikCheckableCard'; // FIXME: This has an issue where EuiCodeEditor is generating a random HTML id and failing snapshot test -describe.skip('FormikCodeEditor', () => { +describe('FormikCodeEditor', () => { + test('render formRow', () => { + const component = ( + + + + ); + + expect(render(component)).toMatchSnapshot(); + }); test('renders', () => { const component = ( diff --git a/public/components/FormControls/FormikCodeEditor/__snapshots__/FormikCodeEditor.test.js.snap b/public/components/FormControls/FormikCodeEditor/__snapshots__/FormikCodeEditor.test.js.snap new file mode 100644 index 000000000..c044cb2f4 --- /dev/null +++ b/public/components/FormControls/FormikCodeEditor/__snapshots__/FormikCodeEditor.test.js.snap @@ -0,0 +1,70 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`FormikCodeEditor render formRow 1`] = ` +
      +
      +
      +
      +

      + Press Enter to start editing. +

      +

      + When you're done, press Escape to stop editing. +

      +
      +
      +
      +
      +
      +`; + +exports[`FormikCodeEditor renders 1`] = ` +
      +
      +

      + Press Enter to start editing. +

      +

      + When you're done, press Escape to stop editing. +

      +
      +
      +
      +`; diff --git a/public/components/IconToolTip/IconToolTip.test.js b/public/components/IconToolTip/IconToolTip.test.js new file mode 100644 index 000000000..942ecaaa7 --- /dev/null +++ b/public/components/IconToolTip/IconToolTip.test.js @@ -0,0 +1,22 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + * + * Modifications Copyright OpenSearch Contributors. See + * GitHub history for details. + */ + +import React from 'react'; +import { render } from 'enzyme'; + +import IconToolTip from './IconToolTip'; + +describe('IconToolTip', () => { + test('renders', () => { + const component = ; + expect(render(component)).toMatchSnapshot(); + }); +}); diff --git a/public/components/IconToolTip/__snapshots__/IconToolTip.test.js.snap b/public/components/IconToolTip/__snapshots__/IconToolTip.test.js.snap new file mode 100644 index 000000000..26f77365e --- /dev/null +++ b/public/components/IconToolTip/__snapshots__/IconToolTip.test.js.snap @@ -0,0 +1,11 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`IconToolTip renders 1`] = ` + +
      + EuiIconMock +
      +
      +`; diff --git a/public/pages/CreateMonitor/components/AnomalyDetectors/FeatureChart/FeatureChart.test.js b/public/pages/CreateMonitor/components/AnomalyDetectors/FeatureChart/FeatureChart.test.js new file mode 100644 index 000000000..d834b5cd9 --- /dev/null +++ b/public/pages/CreateMonitor/components/AnomalyDetectors/FeatureChart/FeatureChart.test.js @@ -0,0 +1,50 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + * + * Modifications Copyright OpenSearch Contributors. See + * GitHub history for details. + */ + +import React from 'react'; +import { mount, render } from 'enzyme'; +import { FeatureChart } from './FeatureChart'; +import AlertingFakes from '../../../../../../test/utils/helpers'; + +const alertingFakes = new AlertingFakes('random seed'); + +function getMountWrapper(customProps = {}) { + return mount( + + ); +} + +describe('FeatureChart', () => { + test('renders ', () => { + const component = ( + + ); + expect(render(component)).toMatchSnapshot(); + }); + + test('go to page ', () => { + const mountWrapper = getMountWrapper(); + mountWrapper.instance().goToPage(1); + expect(mountWrapper.instance().state.activePage).toBe(1); + }); +}); diff --git a/public/pages/CreateMonitor/components/AnomalyDetectors/FeatureChart/__snapshots__/FeatureChart.test.js.snap b/public/pages/CreateMonitor/components/AnomalyDetectors/FeatureChart/__snapshots__/FeatureChart.test.js.snap new file mode 100644 index 000000000..306ae56b2 --- /dev/null +++ b/public/pages/CreateMonitor/components/AnomalyDetectors/FeatureChart/__snapshots__/FeatureChart.test.js.snap @@ -0,0 +1,3 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`FeatureChart renders 1`] = `null`; diff --git a/public/pages/CreateMonitor/components/ExtractionQuery/ExtractionQuery.test.js b/public/pages/CreateMonitor/components/ExtractionQuery/ExtractionQuery.test.js index 20cb76414..87a3a006e 100644 --- a/public/pages/CreateMonitor/components/ExtractionQuery/ExtractionQuery.test.js +++ b/public/pages/CreateMonitor/components/ExtractionQuery/ExtractionQuery.test.js @@ -28,10 +28,16 @@ import React from 'react'; import { render } from 'enzyme'; import ExtractionQuery from './ExtractionQuery'; +import { Formik } from 'formik'; +import { FORMIK_INITIAL_VALUES } from '../../containers/CreateMonitor/utils/constants'; -describe.skip('ExtractionQuery', () => { +describe('ExtractionQuery', () => { test('renders', () => { - const component = ; + const component = ( + + {() => } + + ); expect(render(component)).toMatchSnapshot(); }); diff --git a/public/pages/CreateMonitor/components/ExtractionQuery/__snapshots__/ExtractionQuery.test.js.snap b/public/pages/CreateMonitor/components/ExtractionQuery/__snapshots__/ExtractionQuery.test.js.snap new file mode 100644 index 000000000..f9fd88ebb --- /dev/null +++ b/public/pages/CreateMonitor/components/ExtractionQuery/__snapshots__/ExtractionQuery.test.js.snap @@ -0,0 +1,111 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`ExtractionQuery renders 1`] = ` +
      +
      +
      +
      + +
      +
      +
      +
      +

      + Press Enter to start editing. +

      +

      + When you're done, press Escape to stop editing. +

      +
      +
      +
      +
      +
      +
      +
      +
      +
      + +
      +
      +
      +
      +

      + Press Enter to start editing. +

      +

      + When you're done, press Escape to stop editing. +

      +
      +
      +
      +
      +
      +
      +
      +`; diff --git a/public/pages/CreateMonitor/components/MonitorDefinition/__snapshots__/MonitorDefinition.test.js.snap b/public/pages/CreateMonitor/components/MonitorDefinition/__snapshots__/MonitorDefinition.test.js.snap index 45264816d..c30d92122 100644 --- a/public/pages/CreateMonitor/components/MonitorDefinition/__snapshots__/MonitorDefinition.test.js.snap +++ b/public/pages/CreateMonitor/components/MonitorDefinition/__snapshots__/MonitorDefinition.test.js.snap @@ -1,56 +1,58 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP exports[`MonitorDefinition renders 1`] = ` -
      +
      - -
      -
      + +
      -
      - + + + +
      -
      - EuiIconMock -
      - + +
      + EuiIconMock +
      +
      +
      diff --git a/public/pages/CreateMonitor/components/MonitorDefinitionCard/MonitorDefinitionCard.js b/public/pages/CreateMonitor/components/MonitorDefinitionCard/MonitorDefinitionCard.js index cab7ee08b..02a5278d5 100644 --- a/public/pages/CreateMonitor/components/MonitorDefinitionCard/MonitorDefinitionCard.js +++ b/public/pages/CreateMonitor/components/MonitorDefinitionCard/MonitorDefinitionCard.js @@ -40,7 +40,7 @@ const onChangeDefinition = (e, form) => { form.setFieldValue('searchType', type, false); }; -const MonitorDefinitionCard = ({ values, resetResponse, plugins }) => { +const MonitorDefinitionCard = ({ values, plugins }) => { const hasADPlugin = plugins.indexOf(OS_AD_PLUGIN) !== -1; const isBucketLevelMonitor = values.monitor_type === MONITOR_TYPE.BUCKET_LEVEL; diff --git a/public/pages/CreateMonitor/components/MonitorDefinitionCard/MonitorDefinitionCard.test.js b/public/pages/CreateMonitor/components/MonitorDefinitionCard/MonitorDefinitionCard.test.js new file mode 100644 index 000000000..a0f006265 --- /dev/null +++ b/public/pages/CreateMonitor/components/MonitorDefinitionCard/MonitorDefinitionCard.test.js @@ -0,0 +1,39 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + * + * Modifications Copyright OpenSearch Contributors. See + * GitHub history for details. + */ + +import React from 'react'; +import { render } from 'enzyme'; + +import MonitorDefinitionCard from './MonitorDefinitionCard'; +import { Formik } from 'formik'; +import { FORMIK_INITIAL_VALUES } from '../../containers/CreateMonitor/utils/constants'; +import { OS_AD_PLUGIN } from '../../../../utils/constants'; + +describe('MonitorDefinitionCard', () => { + test('renders without AD plugin', () => { + const component = ( + + {() => } + + ); + + expect(render(component)).toMatchSnapshot(); + }); + test('renders without AD plugin', () => { + const component = ( + + {() => } + + ); + + expect(render(component)).toMatchSnapshot(); + }); +}); diff --git a/public/pages/CreateMonitor/components/MonitorDefinitionCard/__snapshots__/MonitorDefinitionCard.test.js.snap b/public/pages/CreateMonitor/components/MonitorDefinitionCard/__snapshots__/MonitorDefinitionCard.test.js.snap new file mode 100644 index 000000000..906c9d308 --- /dev/null +++ b/public/pages/CreateMonitor/components/MonitorDefinitionCard/__snapshots__/MonitorDefinitionCard.test.js.snap @@ -0,0 +1,303 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`MonitorDefinitionCard renders without AD plugin 1`] = ` +
      +
      +

      + Monitor defining method +

      +
      +
      +
      + Specify the way you want to define your query and triggers. + + Learn more +
      + EuiIconMock +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      + +
      +
      +
      + +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      + +
      +
      +
      + +
      +
      +
      +
      +
      +
      +
      +`; + +exports[`MonitorDefinitionCard renders without AD plugin 2`] = ` +
      +
      +

      + Monitor defining method +

      +
      +
      +
      + Specify the way you want to define your query and triggers. + + Learn more +
      + EuiIconMock +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      + +
      +
      +
      + +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      + +
      +
      +
      + +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      + +
      +
      +
      + +
      +
      +
      +
      +
      +`; diff --git a/public/pages/CreateMonitor/components/MonitorExpressions/MonitorExpressions.test.js b/public/pages/CreateMonitor/components/MonitorExpressions/MonitorExpressions.test.js index 0304babd3..195f6f937 100644 --- a/public/pages/CreateMonitor/components/MonitorExpressions/MonitorExpressions.test.js +++ b/public/pages/CreateMonitor/components/MonitorExpressions/MonitorExpressions.test.js @@ -35,7 +35,7 @@ describe('MonitorExpressions', () => { test('renders', () => { const component = ( - {() => {}} dataTypes={[]} ofEnabled={false} />} + {() => {}} dataTypes={[]} errors={{}} />} ); diff --git a/public/pages/CreateMonitor/components/MonitorExpressions/__snapshots__/MonitorExpressions.test.js.snap b/public/pages/CreateMonitor/components/MonitorExpressions/__snapshots__/MonitorExpressions.test.js.snap index 443f5a876..f7f943fab 100644 --- a/public/pages/CreateMonitor/components/MonitorExpressions/__snapshots__/MonitorExpressions.test.js.snap +++ b/public/pages/CreateMonitor/components/MonitorExpressions/__snapshots__/MonitorExpressions.test.js.snap @@ -1,120 +1,317 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP exports[`MonitorExpressions renders 1`] = ` -
      +
      -
      + Metrics + + + - optional + + +
      + EuiIconMock +
      +
      +
      +
      + + - + + + +
      +
      +
      +
      + +
      +
      + You can add up to 1 metric.
      + class="euiSpacer euiSpacer--m" + /> +
      +
      + + Time range for the last + + +
      + EuiIconMock +
      +
      +
      +
      -
      +
      +
      +
      +
      +
      +
      - all documents - - + +
      + +
      + EuiIconMock +
      +
      +
      +
      +
      + class="euiSpacer euiSpacer--l" + /> +
      + + Data filter + + + - optional + + +
      + EuiIconMock +
      +
      +
      +
      +
      -
      + + + Add filter + + + +
      +
      + You can add up to 1 data filter.
      +
      + + Group by + + + - optional + + +
      + EuiIconMock +
      +
      +
      +
      +
      + No group bys defined. +
      +
      +
      + + + Add group by + + + +
      +
      +
      +
      +
      + You can add up to 1 group by.
      +
      `; diff --git a/public/pages/CreateMonitor/components/MonitorExpressions/expressions/WhereExpression.test.js b/public/pages/CreateMonitor/components/MonitorExpressions/expressions/WhereExpression.test.js index 45720aba2..1c2acd5d0 100644 --- a/public/pages/CreateMonitor/components/MonitorExpressions/expressions/WhereExpression.test.js +++ b/public/pages/CreateMonitor/components/MonitorExpressions/expressions/WhereExpression.test.js @@ -27,7 +27,7 @@ import React from 'react'; import { Formik } from 'formik'; import { render, mount } from 'enzyme'; -import { EuiExpression } from '@elastic/eui'; +import { EuiPopover } from '@elastic/eui'; import { FORMIK_INITIAL_VALUES } from '../../../containers/CreateMonitor/utils/constants'; import WhereExpression from './WhereExpression'; @@ -65,7 +65,7 @@ describe('WhereExpression', () => { }); test('calls openExpression when clicking expression', () => { const wrapper = mount(getMountWrapper()); - const button = wrapper.find(EuiExpression); + const button = wrapper.find('[data-test-subj="where.addFilterButton"]').first(); button.simulate('click'); wrapper.update(); expect(openExpression).toHaveBeenCalled(); @@ -73,8 +73,7 @@ describe('WhereExpression', () => { test('calls closeExpression when closing popover', () => { const wrapper = mount(getMountWrapper(true)); - const button = wrapper.find(EuiExpression); - button.simulate('keyDown', { keyCode: 27 }); + wrapper.find(EuiPopover).simulate('keyDown', { keyCode: 27 }); expect(closeExpression).toHaveBeenCalled(); }); test('should render text input for the text data types', async () => { diff --git a/public/pages/CreateMonitor/components/MonitorExpressions/expressions/__snapshots__/ForExpression.test.js.snap b/public/pages/CreateMonitor/components/MonitorExpressions/expressions/__snapshots__/ForExpression.test.js.snap index 3a8f93a33..d4ade7d01 100644 --- a/public/pages/CreateMonitor/components/MonitorExpressions/expressions/__snapshots__/ForExpression.test.js.snap +++ b/public/pages/CreateMonitor/components/MonitorExpressions/expressions/__snapshots__/ForExpression.test.js.snap @@ -1,28 +1,103 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP exports[`ForExpression renders 1`] = ` -
      +
      -
      + +
      +
      +
      +
      +
      - for the last - - - +
      +
      + +
      +
      +
      +
      +
      +
      +
      - 1 hour(s) - - +
      + +
      + +
      + EuiIconMock +
      +
      +
      +
      +
      +
      `; diff --git a/public/pages/CreateMonitor/components/MonitorExpressions/expressions/__snapshots__/WhereExpression.test.js.snap b/public/pages/CreateMonitor/components/MonitorExpressions/expressions/__snapshots__/WhereExpression.test.js.snap index 5bee81de7..f437f13da 100644 --- a/public/pages/CreateMonitor/components/MonitorExpressions/expressions/__snapshots__/WhereExpression.test.js.snap +++ b/public/pages/CreateMonitor/components/MonitorExpressions/expressions/__snapshots__/WhereExpression.test.js.snap @@ -1,28 +1,59 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP exports[`WhereExpression renders 1`] = ` -
      +
      -
      +
      +
      +
      + No filters defined. +
      +
      + + + +
      +
      + You can add up to 1 data filter. +
      `; diff --git a/public/pages/CreateMonitor/components/MonitorTimeField/MonitorTimeField.test.js b/public/pages/CreateMonitor/components/MonitorTimeField/MonitorTimeField.test.js index 12a491208..e47595a26 100644 --- a/public/pages/CreateMonitor/components/MonitorTimeField/MonitorTimeField.test.js +++ b/public/pages/CreateMonitor/components/MonitorTimeField/MonitorTimeField.test.js @@ -31,7 +31,7 @@ import { Formik } from 'formik'; import MonitorTimeField from './MonitorTimeField'; describe('MonitorTimeField', () => { - test.skip('renders', () => { + test('renders', () => { const component = ( {}}> diff --git a/public/pages/CreateMonitor/components/MonitorTimeField/__snapshots__/MonitorTimeField.test.js.snap b/public/pages/CreateMonitor/components/MonitorTimeField/__snapshots__/MonitorTimeField.test.js.snap index 4b2aa0069..97e5f5159 100644 --- a/public/pages/CreateMonitor/components/MonitorTimeField/__snapshots__/MonitorTimeField.test.js.snap +++ b/public/pages/CreateMonitor/components/MonitorTimeField/__snapshots__/MonitorTimeField.test.js.snap @@ -3,68 +3,86 @@ exports[`MonitorTimeField renders 1`] = `
      - + +
      -
      -
      - Choose the time field you want to use for your x-axis +
      + Choose the time field you want to use for your x-axis +
      `; diff --git a/public/pages/CreateMonitor/components/MonitorType/MonitorType.test.js b/public/pages/CreateMonitor/components/MonitorType/MonitorType.test.js new file mode 100644 index 000000000..c62ef4a07 --- /dev/null +++ b/public/pages/CreateMonitor/components/MonitorType/MonitorType.test.js @@ -0,0 +1,27 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + * + * Modifications Copyright OpenSearch Contributors. See + * GitHub history for details. + */ + +import React from 'react'; +import { render } from 'enzyme'; + +import MonitorType from './MonitorType'; +import { Formik } from 'formik'; +import { FORMIK_INITIAL_VALUES } from '../../containers/CreateMonitor/utils/constants'; + +describe('MonitorType', () => { + test('renders', () => { + const component = ( + {() => } + ); + + expect(render(component)).toMatchSnapshot(); + }); +}); diff --git a/public/pages/CreateMonitor/components/MonitorType/__snapshots__/MonitorType.test.js.snap b/public/pages/CreateMonitor/components/MonitorType/__snapshots__/MonitorType.test.js.snap new file mode 100644 index 000000000..97be8378c --- /dev/null +++ b/public/pages/CreateMonitor/components/MonitorType/__snapshots__/MonitorType.test.js.snap @@ -0,0 +1,158 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`MonitorType renders 1`] = ` +
      +
      +
      +
      + +
      +
      +
      +
      +
      +
      + +
      +
      +
      + +
      +
      +
      +
      +
      +
      + Per query monitors run a specified query and define triggers that check the results of that query. +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      + +
      +
      +
      + +
      +
      +
      +
      +
      +
      + Per bucket monitors allow you to group results into buckets and define triggers that check each bucket. +
      +
      +
      +
      +
      +
      +
      +
      +
      +`; diff --git a/public/pages/CreateMonitor/components/QueryPerformance/__snapshots__/QueryPerformance.test.js.snap b/public/pages/CreateMonitor/components/QueryPerformance/__snapshots__/QueryPerformance.test.js.snap index 2466a1bfa..6e89b5f99 100644 --- a/public/pages/CreateMonitor/components/QueryPerformance/__snapshots__/QueryPerformance.test.js.snap +++ b/public/pages/CreateMonitor/components/QueryPerformance/__snapshots__/QueryPerformance.test.js.snap @@ -1,84 +1,119 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP exports[`QueryPerformance renders 1`] = ` -Array [ -

      - Query performance -

      , -
      , +
      - - Check the performance of your query and make sure to follow best practices. - +

      - Learn more - - -

      , + Query performance + +
      +
      +
      +
      +
      +
      +
      , + class="euiText euiText--extraSmall" + style="padding:0px 10px" + > +
      + + Check the performance of your query and make sure to follow best practices. + + Learn more +
      + EuiIconMock +
      +
      +
      +
      +
      +
      +
      - - Query duration - - - 5 ms - + + Query duration + + + 5 ms + +
      -
      -
      - - Request duration - - - - - + + Request duration + + + - + +
      -
      -
      - - Hits - - - 15 - + + Hits + + + 15 + +
      -
      , -] +
      +
      `; diff --git a/public/pages/CreateMonitor/components/Schedule/Frequencies/__snapshots__/Frequencies.test.js.snap b/public/pages/CreateMonitor/components/Schedule/Frequencies/__snapshots__/Frequencies.test.js.snap index 03f432348..4e44c245b 100644 --- a/public/pages/CreateMonitor/components/Schedule/Frequencies/__snapshots__/Frequencies.test.js.snap +++ b/public/pages/CreateMonitor/components/Schedule/Frequencies/__snapshots__/Frequencies.test.js.snap @@ -3,7 +3,7 @@ exports[`Frequencies renders CustomCron 1`] = `
      - Every + Run every
      cron expressions +
      + EuiIconMock +
      for complex schedules
      @@ -137,7 +140,6 @@ exports[`Frequencies renders Frequency 1`] = `
      - Every + Run every
      - Every + Run every
      -
      -
      - There is no data for the current selections. -
      +
      + There is no data for the current selections.
      `; diff --git a/public/pages/CreateMonitor/components/VisualGraph/utils/helpers.test.js b/public/pages/CreateMonitor/components/VisualGraph/utils/helpers.test.js index e4588a058..d899abd23 100644 --- a/public/pages/CreateMonitor/components/VisualGraph/utils/helpers.test.js +++ b/public/pages/CreateMonitor/components/VisualGraph/utils/helpers.test.js @@ -40,12 +40,13 @@ import { } from './helpers'; import { DEFAULT_MARK_SIZE } from './constants'; import { FORMIK_INITIAL_VALUES } from '../../../containers/CreateMonitor/utils/constants'; +import { MONITOR_TYPE } from '../../../../../utils/constants'; describe('getYTitle', () => { test('returns count when empty array, undefined, or null', () => { - expect(getYTitle([])).toBe('count'); - expect(getYTitle(undefined)).toBe('count'); - expect(getYTitle(null)).toBe('count'); + expect(getYTitle([])).toBe('doc_count'); + expect(getYTitle(undefined)).toBe('doc_count'); + expect(getYTitle(null)).toBe('doc_count'); }); }); @@ -154,24 +155,6 @@ describe('getMarkData', () => { }); }); -describe('getAggregationTitle', () => { - test('gets count aggregation type title', () => { - const formikValues = _.cloneDeep(FORMIK_INITIAL_VALUES); - expect(getAggregationTitle(formikValues)).toBe( - 'WHEN count() OVER all documents FOR THE LAST 1 hour(s)' - ); - }); - - test('gets avg aggregation type title', () => { - const formikValues = _.cloneDeep(FORMIK_INITIAL_VALUES); - formikValues.aggregationType = 'avg'; - formikValues.fieldName = [{ label: 'bytes' }]; - expect(getAggregationTitle(formikValues)).toBe( - 'WHEN average() OF bytes OVER all documents FOR THE LAST 1 hour(s)' - ); - }); -}); - describe('getDataFromResponse', () => { test('gets empty array when no response', () => { expect(getDataFromResponse(null)).toEqual([]); @@ -188,67 +171,67 @@ describe('getDataFromResponse', () => { from_as_string: '2018-10-31T18:00:00.000-07:00', key: 1541034000000, doc_count: 32, - when: { value: 5705.40625 }, + metric: { value: 5705.40625 }, }, { key_as_string: '2018-10-31T19:00:00.000-07:00', from_as_string: '2018-10-31T19:00:00.000-07:00', key: 1541037600000, doc_count: 67, - when: { value: 6185.373134328358 }, + metric: { value: 6185.373134328358 }, }, { key_as_string: '2018-10-31T20:00:00.000-07:00', from_as_string: '2018-10-31T20:00:00.000-07:00', key: 1541041200000, doc_count: 79, - when: { value: -2439.9367088607596 }, + metric: { value: -2439.9367088607596 }, }, { key_as_string: '2018-10-31T21:00:00.000-07:00', from_as_string: '2018-10-31T21:00:00.000-07:00', key: 1541044800000, doc_count: 31, - when: { value: null }, + metric: { value: null }, }, { key_as_string: '2018-10-31T22:00:00.000-07:00', from_as_string: '2018-10-31T22:00:00.000-07:00', key: 1541048400000, doc_count: 18, - when: { value: 4651.5 }, + metric: { value: 4651.5 }, }, { key_as_string: '2018-10-31T23:00:00.000-07:00', from_as_string: '2018-10-31T23:00:00.000-07:00', key: 1541052000000, doc_count: 3, - when: { value: 4410.666666666667 }, + metric: { value: 4410.666666666667 }, }, ], }, }, }; - expect(getDataFromResponse(response)).toEqual([ + expect(getDataFromResponse(response, 'metric', MONITOR_TYPE.QUERY_LEVEL)).toEqual([ { x: new Date(response.aggregations.over.buckets[0].from_as_string), - y: response.aggregations.over.buckets[0].when.value, + y: response.aggregations.over.buckets[0].metric.value, }, { x: new Date(response.aggregations.over.buckets[1].from_as_string), - y: response.aggregations.over.buckets[1].when.value, + y: response.aggregations.over.buckets[1].metric.value, }, { x: new Date(response.aggregations.over.buckets[2].from_as_string), - y: response.aggregations.over.buckets[2].when.value, + y: response.aggregations.over.buckets[2].metric.value, }, { x: new Date(response.aggregations.over.buckets[4].from_as_string), - y: response.aggregations.over.buckets[4].when.value, + y: response.aggregations.over.buckets[4].metric.value, }, { x: new Date(response.aggregations.over.buckets[5].from_as_string), - y: response.aggregations.over.buckets[5].when.value, + y: response.aggregations.over.buckets[5].metric.value, }, ]); }); @@ -261,11 +244,11 @@ describe('getXYValues', () => { from_as_string: '2018-10-31T18:00:00.000-07:00', key: 1541034000000, doc_count: 32, - when: { value: 5705.40625 }, + metric: { value: 5705.40625 }, }; expect(getXYValues(whenBucket)).toEqual({ x: new Date(whenBucket.from_as_string), - y: whenBucket.when.value, + y: whenBucket.metric.value, }); }); diff --git a/public/pages/CreateMonitor/containers/AnomalyDetectors/__tests__/__snapshots__/AnomalyDetector.test.js.snap b/public/pages/CreateMonitor/containers/AnomalyDetectors/__tests__/__snapshots__/AnomalyDetector.test.js.snap index a89b72633..741d3566c 100644 --- a/public/pages/CreateMonitor/containers/AnomalyDetectors/__tests__/__snapshots__/AnomalyDetector.test.js.snap +++ b/public/pages/CreateMonitor/containers/AnomalyDetectors/__tests__/__snapshots__/AnomalyDetector.test.js.snap @@ -5,6 +5,7 @@ exports[`AnomalyDetectors renders 1`] = ` initialValues={ Object { "aggregationType": "count", + "aggregations": Array [], "bucketUnitOfTime": "h", "bucketValue": 1, "cronExpression": "0 */1 * * *", @@ -13,9 +14,16 @@ exports[`AnomalyDetectors renders 1`] = ` "disabled": false, "fieldName": Array [], "frequency": "interval", + "groupBy": Array [], + "groupByField": Array [ + Object { + "label": "", + }, + ], "groupedOverFieldName": "bytes", "groupedOverTop": 5, "index": Array [], + "monitor_type": "query_level_monitor", "monthly": Object { "day": 1, "type": "day", @@ -59,6 +67,7 @@ exports[`AnomalyDetectors renders 1`] = ` values={ Object { "aggregationType": "count", + "aggregations": Array [], "bucketUnitOfTime": "h", "bucketValue": 1, "cronExpression": "0 */1 * * *", @@ -67,9 +76,16 @@ exports[`AnomalyDetectors renders 1`] = ` "disabled": false, "fieldName": Array [], "frequency": "interval", + "groupBy": Array [], + "groupByField": Array [ + Object { + "label": "", + }, + ], "groupedOverFieldName": "bytes", "groupedOverTop": 5, "index": Array [], + "monitor_type": "query_level_monitor", "monthly": Object { "day": 1, "type": "day", @@ -174,6 +190,7 @@ exports[`AnomalyDetectors renders 1`] = ` "initialTouched": Object {}, "initialValues": Object { "aggregationType": "count", + "aggregations": Array [], "bucketUnitOfTime": "h", "bucketValue": 1, "cronExpression": "0 */1 * * *", @@ -182,9 +199,16 @@ exports[`AnomalyDetectors renders 1`] = ` "disabled": false, "fieldName": Array [], "frequency": "interval", + "groupBy": Array [], + "groupByField": Array [ + Object { + "label": "", + }, + ], "groupedOverFieldName": "bytes", "groupedOverTop": 5, "index": Array [], + "monitor_type": "query_level_monitor", "monthly": Object { "day": 1, "type": "day", @@ -247,6 +271,7 @@ exports[`AnomalyDetectors renders 1`] = ` "validateOnMount": false, "values": Object { "aggregationType": "count", + "aggregations": Array [], "bucketUnitOfTime": "h", "bucketValue": 1, "cronExpression": "0 */1 * * *", @@ -255,9 +280,16 @@ exports[`AnomalyDetectors renders 1`] = ` "disabled": false, "fieldName": Array [], "frequency": "interval", + "groupBy": Array [], + "groupByField": Array [ + Object { + "label": "", + }, + ], "groupedOverFieldName": "bytes", "groupedOverTop": 5, "index": Array [], + "monitor_type": "query_level_monitor", "monthly": Object { "day": 1, "type": "day", @@ -368,6 +400,7 @@ exports[`AnomalyDetectors renders 1`] = ` "initialTouched": Object {}, "initialValues": Object { "aggregationType": "count", + "aggregations": Array [], "bucketUnitOfTime": "h", "bucketValue": 1, "cronExpression": "0 */1 * * *", @@ -376,9 +409,16 @@ exports[`AnomalyDetectors renders 1`] = ` "disabled": false, "fieldName": Array [], "frequency": "interval", + "groupBy": Array [], + "groupByField": Array [ + Object { + "label": "", + }, + ], "groupedOverFieldName": "bytes", "groupedOverTop": 5, "index": Array [], + "monitor_type": "query_level_monitor", "monthly": Object { "day": 1, "type": "day", @@ -441,6 +481,7 @@ exports[`AnomalyDetectors renders 1`] = ` "validateOnMount": false, "values": Object { "aggregationType": "count", + "aggregations": Array [], "bucketUnitOfTime": "h", "bucketValue": 1, "cronExpression": "0 */1 * * *", @@ -449,9 +490,16 @@ exports[`AnomalyDetectors renders 1`] = ` "disabled": false, "fieldName": Array [], "frequency": "interval", + "groupBy": Array [], + "groupByField": Array [ + Object { + "label": "", + }, + ], "groupedOverFieldName": "bytes", "groupedOverTop": 5, "index": Array [], + "monitor_type": "query_level_monitor", "monthly": Object { "day": 1, "type": "day", diff --git a/public/pages/CreateMonitor/containers/CreateMonitor/CreateMonitor.test.js b/public/pages/CreateMonitor/containers/CreateMonitor/CreateMonitor.test.js index 826f971ff..6729d35d2 100644 --- a/public/pages/CreateMonitor/containers/CreateMonitor/CreateMonitor.test.js +++ b/public/pages/CreateMonitor/containers/CreateMonitor/CreateMonitor.test.js @@ -32,6 +32,7 @@ import { historyMock, httpClientMock } from '../../../../../test/mocks'; import { FORMIK_INITIAL_VALUES } from './utils/constants'; import AlertingFakes from '../../../../../test/utils/helpers'; import { SEARCH_TYPE } from '../../../../utils/constants'; +import { TRIGGER_TYPE } from '../../../CreateTrigger/containers/CreateTrigger/utils/constants'; const alertingFakes = new AlertingFakes('CreateMonitor random seed'); @@ -179,9 +180,10 @@ describe('CreateMonitor', () => { }); describe('onUpdate', () => { - test('calls updateMonitor with monitor with no triggers key', () => { + // Query-level monitor + test('calls updateMonitor with monitor', () => { const monitor = alertingFakes.randomMonitor(); - const trigger = alertingFakes.randomTrigger(); + const trigger = alertingFakes.randomTrigger(TRIGGER_TYPE.QUERY_LEVEL); monitor.triggers = [trigger]; const wrapper = shallow( { ); wrapper.instance().onUpdate(monitor, formikBag); expect(updateMonitor).toHaveBeenCalledTimes(1); - // The updatedMonitor that is passed in should NOT have the trigger key - const updatedMonitor = { ...monitor }; - delete updatedMonitor.triggers; - expect(updateMonitor).toHaveBeenCalledWith(updatedMonitor); + expect(updateMonitor).toHaveBeenCalledWith(monitor); }); test('logs error when updateMonitor rejects', async () => { diff --git a/public/pages/CreateMonitor/containers/CreateMonitor/__snapshots__/CreateMonitor.test.js.snap b/public/pages/CreateMonitor/containers/CreateMonitor/__snapshots__/CreateMonitor.test.js.snap index 59ec5a38e..b65783ed8 100644 --- a/public/pages/CreateMonitor/containers/CreateMonitor/__snapshots__/CreateMonitor.test.js.snap +++ b/public/pages/CreateMonitor/containers/CreateMonitor/__snapshots__/CreateMonitor.test.js.snap @@ -12,6 +12,7 @@ exports[`CreateMonitor renders 1`] = ` initialValues={ Object { "aggregationType": "count", + "aggregations": Array [], "bucketUnitOfTime": "h", "bucketValue": 1, "cronExpression": "0 */1 * * *", @@ -20,9 +21,16 @@ exports[`CreateMonitor renders 1`] = ` "disabled": false, "fieldName": Array [], "frequency": "interval", + "groupBy": Array [], + "groupByField": Array [ + Object { + "label": "", + }, + ], "groupedOverFieldName": "bytes", "groupedOverTop": 5, "index": Array [], + "monitor_type": "query_level_monitor", "monthly": Object { "day": 1, "type": "day", diff --git a/public/pages/CreateMonitor/containers/CreateMonitor/utils/__snapshots__/formikToMonitor.test.js.snap b/public/pages/CreateMonitor/containers/CreateMonitor/utils/__snapshots__/formikToMonitor.test.js.snap index 086712815..a898d4d74 100644 --- a/public/pages/CreateMonitor/containers/CreateMonitor/utils/__snapshots__/formikToMonitor.test.js.snap +++ b/public/pages/CreateMonitor/containers/CreateMonitor/utils/__snapshots__/formikToMonitor.test.js.snap @@ -123,6 +123,7 @@ Object { }, }, ], + "monitor_type": "query_level_monitor", "name": "random_name", "schedule": Object { "period": Object { @@ -133,6 +134,7 @@ Object { "triggers": Array [], "type": "monitor", "ui_metadata": Object { + "monitor_type": "query_level_monitor", "schedule": Object { "cronExpression": "0 */1 * * *", "daily": 0, @@ -157,13 +159,10 @@ Object { }, }, "search": Object { - "aggregationType": "count", + "aggregations": Array [], "bucketUnitOfTime": "h", "bucketValue": 1, - "fieldName": "bytes", - "groupedOverFieldName": "bytes", - "groupedOverTop": 5, - "overDocuments": "all documents", + "groupBy": Array [], "searchType": "graph", "timeField": "", "where": Object { @@ -290,13 +289,10 @@ Object { exports[`formikToUiSearch can build ui search 1`] = ` Object { - "aggregationType": "count", + "aggregations": Array [], "bucketUnitOfTime": "h", "bucketValue": 1, - "fieldName": "bytes", - "groupedOverFieldName": "bytes", - "groupedOverTop": 5, - "overDocuments": "all documents", + "groupBy": Array [], "searchType": "graph", "timeField": "@timestamp", "where": Object { @@ -311,13 +307,10 @@ Object { exports[`formikToUiSearch can build ui search with range where field 1`] = ` Object { - "aggregationType": "count", + "aggregations": Array [], "bucketUnitOfTime": "h", "bucketValue": 1, - "fieldName": "bytes", - "groupedOverFieldName": "bytes", - "groupedOverTop": 5, - "overDocuments": "all documents", + "groupBy": Array [], "searchType": "graph", "timeField": "@timestamp", "where": Object { @@ -336,13 +329,10 @@ Object { exports[`formikToUiSearch can build ui search with term where field 1`] = ` Object { - "aggregationType": "count", + "aggregations": Array [], "bucketUnitOfTime": "h", "bucketValue": 1, - "fieldName": "bytes", - "groupedOverFieldName": "bytes", - "groupedOverTop": 5, - "overDocuments": "all documents", + "groupBy": Array [], "searchType": "graph", "timeField": "@timestamp", "where": Object { @@ -360,12 +350,4 @@ Object { exports[`formikToWhenAggregation can build when (count) aggregation 1`] = `Object {}`; -exports[`formikToWhenAggregation can build when aggregation 1`] = ` -Object { - "when": Object { - "avg": Object { - "field": "bytes", - }, - }, -} -`; +exports[`formikToWhenAggregation can build when aggregation 1`] = `Object {}`; diff --git a/public/pages/CreateMonitor/containers/DefineMonitor/__snapshots__/DefineMonitor.test.js.snap b/public/pages/CreateMonitor/containers/DefineMonitor/__snapshots__/DefineMonitor.test.js.snap index 4945154f9..667ce9e32 100644 --- a/public/pages/CreateMonitor/containers/DefineMonitor/__snapshots__/DefineMonitor.test.js.snap +++ b/public/pages/CreateMonitor/containers/DefineMonitor/__snapshots__/DefineMonitor.test.js.snap @@ -1,104 +1,16 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP exports[`DefineMonitor renders 1`] = ` - - - - -
      -
      -
      -
      - You must specify an index. -
      -
      -
      -
      - - -
      -`; - -exports[`DefineMonitor should show warning in case of Ad monitor and plugin is not installed 1`] = ` - - - - -
      - +
      + +
      - + +
      +
      +
      +
      + You must specify an index. +
      +
      +
      +
      +
      +
      +`; + +exports[`DefineMonitor should show warning in case of Ad monitor and plugin is not installed 1`] = ` +
      + + Run + , + ] + } + bodyStyles={ + Object { + "padding": "initial", + } + } + panelStyles={ + Object { + "paddingLeft": "10px", + "paddingRight": "10px", + } + } + title="Query" + titleSize="s" + > + + +
      +
      +
      +
      + You must specify an index. +
      +
      +
      +
      + + +
      +
      `; diff --git a/public/pages/CreateMonitor/containers/MonitorIndex/__snapshots__/MonitorIndex.test.js.snap b/public/pages/CreateMonitor/containers/MonitorIndex/__snapshots__/MonitorIndex.test.js.snap index daf14fde0..84940ee25 100644 --- a/public/pages/CreateMonitor/containers/MonitorIndex/__snapshots__/MonitorIndex.test.js.snap +++ b/public/pages/CreateMonitor/containers/MonitorIndex/__snapshots__/MonitorIndex.test.js.snap @@ -5,6 +5,7 @@ exports[`MonitorIndex renders 1`] = ` initialValues={ Object { "aggregationType": "count", + "aggregations": Array [], "bucketUnitOfTime": "h", "bucketValue": 1, "cronExpression": "0 */1 * * *", @@ -13,9 +14,16 @@ exports[`MonitorIndex renders 1`] = ` "disabled": false, "fieldName": Array [], "frequency": "interval", + "groupBy": Array [], + "groupByField": Array [ + Object { + "label": "", + }, + ], "groupedOverFieldName": "bytes", "groupedOverTop": 5, "index": Array [], + "monitor_type": "query_level_monitor", "monthly": Object { "day": 1, "type": "day", @@ -97,7 +105,6 @@ exports[`MonitorIndex renders 1`] = ` "label": "Index", "style": Object { "paddingLeft": "10px", - "textAlign": "center", }, } } @@ -132,6 +139,7 @@ exports[`MonitorIndex renders 1`] = ` "initialTouched": Object {}, "initialValues": Object { "aggregationType": "count", + "aggregations": Array [], "bucketUnitOfTime": "h", "bucketValue": 1, "cronExpression": "0 */1 * * *", @@ -140,9 +148,16 @@ exports[`MonitorIndex renders 1`] = ` "disabled": false, "fieldName": Array [], "frequency": "interval", + "groupBy": Array [], + "groupByField": Array [ + Object { + "label": "", + }, + ], "groupedOverFieldName": "bytes", "groupedOverTop": 5, "index": Array [], + "monitor_type": "query_level_monitor", "monthly": Object { "day": 1, "type": "day", @@ -205,6 +220,7 @@ exports[`MonitorIndex renders 1`] = ` "validateOnMount": false, "values": Object { "aggregationType": "count", + "aggregations": Array [], "bucketUnitOfTime": "h", "bucketValue": 1, "cronExpression": "0 */1 * * *", @@ -213,9 +229,16 @@ exports[`MonitorIndex renders 1`] = ` "disabled": false, "fieldName": Array [], "frequency": "interval", + "groupBy": Array [], + "groupByField": Array [ + Object { + "label": "", + }, + ], "groupedOverFieldName": "bytes", "groupedOverTop": 5, "index": Array [], + "monitor_type": "query_level_monitor", "monthly": Object { "day": 1, "type": "day", @@ -263,7 +286,6 @@ exports[`MonitorIndex renders 1`] = ` "label": "Index", "style": Object { "paddingLeft": "10px", - "textAlign": "center", }, } } @@ -282,7 +304,6 @@ exports[`MonitorIndex renders 1`] = ` style={ Object { "paddingLeft": "10px", - "textAlign": "center", } } > @@ -292,7 +313,6 @@ exports[`MonitorIndex renders 1`] = ` style={ Object { "paddingLeft": "10px", - "textAlign": "center", } } > @@ -345,6 +365,7 @@ exports[`MonitorIndex renders 1`] = ` "initialTouched": Object {}, "initialValues": Object { "aggregationType": "count", + "aggregations": Array [], "bucketUnitOfTime": "h", "bucketValue": 1, "cronExpression": "0 */1 * * *", @@ -353,9 +374,16 @@ exports[`MonitorIndex renders 1`] = ` "disabled": false, "fieldName": Array [], "frequency": "interval", + "groupBy": Array [], + "groupByField": Array [ + Object { + "label": "", + }, + ], "groupedOverFieldName": "bytes", "groupedOverTop": 5, "index": Array [], + "monitor_type": "query_level_monitor", "monthly": Object { "day": 1, "type": "day", @@ -418,6 +446,7 @@ exports[`MonitorIndex renders 1`] = ` "validateOnMount": false, "values": Object { "aggregationType": "count", + "aggregations": Array [], "bucketUnitOfTime": "h", "bucketValue": 1, "cronExpression": "0 */1 * * *", @@ -426,9 +455,16 @@ exports[`MonitorIndex renders 1`] = ` "disabled": false, "fieldName": Array [], "frequency": "interval", + "groupBy": Array [], + "groupByField": Array [ + Object { + "label": "", + }, + ], "groupedOverFieldName": "bytes", "groupedOverTop": 5, "index": Array [], + "monitor_type": "query_level_monitor", "monthly": Object { "day": 1, "type": "day", diff --git a/public/pages/CreateTrigger/components/Action/actions/__snapshots__/Message.test.js.snap b/public/pages/CreateTrigger/components/Action/actions/__snapshots__/Message.test.js.snap index 571472c2a..bfc62b2ed 100644 --- a/public/pages/CreateTrigger/components/Action/actions/__snapshots__/Message.test.js.snap +++ b/public/pages/CreateTrigger/components/Action/actions/__snapshots__/Message.test.js.snap @@ -4,7 +4,8 @@ exports[`Message renders 1`] = `
      Message subject @@ -21,14 +22,15 @@ exports[`Message renders 1`] = ` class="euiFormRow__fieldWrapper" >
      @@ -37,7 +39,7 @@ exports[`Message renders 1`] = `
      - - Message - -
      +
      - - - Info - - - + Learn more +
      + EuiIconMock +
      + +
      +
      @@ -74,50 +87,64 @@ exports[`Message renders 1`] = ` > -
      +

      + Action configuration +

      -
      - - Action throttling - - -
      + Throttling
      @@ -254,39 +238,39 @@ exports[`Message renders 1`] = ` >
      minutes
      - Throttle value must be greater than 0 and less than 1440 + Throttle value must be greater than 0 and less than 1440.
      diff --git a/public/pages/CreateTrigger/components/TriggerExpressions/TriggerExpressions.test.js b/public/pages/CreateTrigger/components/TriggerExpressions/TriggerExpressions.test.js index 2f8076c98..e9037ec65 100644 --- a/public/pages/CreateTrigger/components/TriggerExpressions/TriggerExpressions.test.js +++ b/public/pages/CreateTrigger/components/TriggerExpressions/TriggerExpressions.test.js @@ -41,44 +41,4 @@ describe('TriggerExpressions', () => { const wrapper = shallow(); expect(wrapper).toMatchSnapshot(); }); - - test('calls openExpression when clicking expression', () => { - const wrapper = mount( } />); - const openExpression = jest.spyOn( - wrapper.find(TriggerExpressions).instance(), - 'openExpression' - ); - const button = wrapper.find(EuiExpression); - expect(wrapper.find(TriggerExpressions).state().openedStates[Expressions.THRESHOLD]).toBe( - false - ); - button.simulate('click'); - wrapper.update(); - expect(openExpression).toHaveBeenCalled(); - expect(wrapper.find(TriggerExpressions).state().openedStates[Expressions.THRESHOLD]).toBe(true); - }); - - test('calls closeExpression when closing popover', async () => { - const wrapper = mount( } />); - const openExpression = jest.spyOn( - wrapper.find(TriggerExpressions).instance(), - 'openExpression' - ); - const closeExpression = jest.spyOn( - wrapper.find(TriggerExpressions).instance(), - 'closeExpression' - ); - const button = wrapper.find(EuiExpression); - button.simulate('click'); - wrapper.update(); - expect(openExpression).toHaveBeenCalled(); - expect(wrapper.find(TriggerExpressions).state().openedStates[Expressions.THRESHOLD]).toBe(true); - await new Promise((res) => setTimeout(() => res())); - button.simulate('keyDown', { keyCode: 27 }); - wrapper.update(); - expect(closeExpression).toHaveBeenCalled(); - expect(wrapper.find(TriggerExpressions).state().openedStates[Expressions.THRESHOLD]).toBe( - false - ); - }); }); diff --git a/public/pages/CreateTrigger/components/TriggerExpressions/__snapshots__/TriggerExpressions.test.js.snap b/public/pages/CreateTrigger/components/TriggerExpressions/__snapshots__/TriggerExpressions.test.js.snap index 35abc84bf..445297f3b 100644 --- a/public/pages/CreateTrigger/components/TriggerExpressions/__snapshots__/TriggerExpressions.test.js.snap +++ b/public/pages/CreateTrigger/components/TriggerExpressions/__snapshots__/TriggerExpressions.test.js.snap @@ -1,83 +1,37 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP exports[`TriggerExpressions renders 1`] = ` - - - - - - } - closePopover={[Function]} - display="inlineBlock" - hasArrow={true} - id="trigger-popover" - isOpen={false} - ownFocus={true} - panelPaddingSize="none" - withTitle={true} + -
      - - - - - - - - - - - - -
      -
      -
      -
      + + + + + + + + + + + `; diff --git a/public/pages/CreateTrigger/components/TriggerQuery/__snapshots__/TriggerQuery.test.js.snap b/public/pages/CreateTrigger/components/TriggerQuery/__snapshots__/TriggerQuery.test.js.snap index c8bc024be..9a2b588b5 100644 --- a/public/pages/CreateTrigger/components/TriggerQuery/__snapshots__/TriggerQuery.test.js.snap +++ b/public/pages/CreateTrigger/components/TriggerQuery/__snapshots__/TriggerQuery.test.js.snap @@ -1,84 +1,95 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP exports[`TriggerQuery renders 1`] = ` -
      - - - - - - - - - - - - - - - - - - - + + + +
      + + + + + Trigger condition response + + + } + labelType="label" + > + + + + + + - - - Run - - - -
      + Run for condition response + + + `; diff --git a/public/pages/CreateTrigger/containers/CreateTrigger/utils/formikToTrigger.test.js b/public/pages/CreateTrigger/containers/CreateTrigger/utils/formikToTrigger.test.js index 712051d8f..005f2fa25 100644 --- a/public/pages/CreateTrigger/containers/CreateTrigger/utils/formikToTrigger.test.js +++ b/public/pages/CreateTrigger/containers/CreateTrigger/utils/formikToTrigger.test.js @@ -27,8 +27,9 @@ import _ from 'lodash'; import { formikToTrigger, formikToTriggerUiMetadata, formikToCondition } from './formikToTrigger'; -import { FORMIK_INITIAL_TRIGGER_VALUES } from './constants'; -import { SEARCH_TYPE } from '../../../../../utils/constants'; +import { FORMIK_INITIAL_TRIGGER_VALUES, TRIGGER_TYPE } from './constants'; +import { MONITOR_TYPE, SEARCH_TYPE } from '../../../../../utils/constants'; +import { FORMIK_INITIAL_VALUES } from '../../../../CreateMonitor/containers/CreateMonitor/utils/constants'; describe('formikToTrigger', () => { test('can create trigger', () => { @@ -46,13 +47,18 @@ describe('formikToTrigger', () => { describe('formikToTriggerUiMetadata', () => { test('can create trigger metadata for AD monitors', () => { - const formikValues = _.cloneDeep(FORMIK_INITIAL_TRIGGER_VALUES); + let formikValues = _.cloneDeep(FORMIK_INITIAL_VALUES); + _.set(formikValues, 'triggerDefinitions', [FORMIK_INITIAL_TRIGGER_VALUES]); + _.set(formikValues, 'triggerDefinitions.trigger_type', TRIGGER_TYPE.AD); expect( - formikToTriggerUiMetadata(formikValues, { search: { searchType: SEARCH_TYPE.AD } }) + formikToTriggerUiMetadata(formikValues, { + search: { searchType: SEARCH_TYPE.AD }, + monitor_type: MONITOR_TYPE.QUERY_LEVEL, + }) ).toEqual({ [formikValues.name]: { - value: formikValues.thresholdValue, - enum: formikValues.thresholdEnum, + value: formikValues.triggerDefinitions[0].thresholdValue, + enum: formikValues.triggerDefinitions[0].thresholdEnum, adTriggerMetadata: { triggerType: 'anomaly_detector_trigger', anomalyGrade: { @@ -69,13 +75,17 @@ describe('formikToTriggerUiMetadata', () => { }); test('can create metadata', () => { - const formikValues = _.cloneDeep(FORMIK_INITIAL_TRIGGER_VALUES); + let formikValues = _.cloneDeep(FORMIK_INITIAL_VALUES); + _.set(formikValues, 'triggerDefinitions', [FORMIK_INITIAL_TRIGGER_VALUES]); expect( - formikToTriggerUiMetadata(formikValues, { search: { searchType: SEARCH_TYPE.QUERY } }) + formikToTriggerUiMetadata(formikValues, { + search: { searchType: SEARCH_TYPE.QUERY }, + monitor_type: MONITOR_TYPE.QUERY_LEVEL, + }) ).toEqual({ [formikValues.name]: { - value: formikValues.thresholdValue, - enum: formikValues.thresholdEnum, + value: formikValues.triggerDefinitions[0].thresholdValue, + enum: formikValues.triggerDefinitions[0].thresholdEnum, }, }); }); @@ -119,7 +129,7 @@ describe('formikToCondition', () => { ).toEqual({ script: { lang: 'painless', - source: `return ctx.results[0].aggregations.when.value == null ? false : ctx.results[0].aggregations.when.value > 10000`, + source: 'ctx.results[0].hits.total.value > 10000', }, }); }); diff --git a/public/pages/CreateTrigger/containers/DefineTrigger/utils/validation.js b/public/pages/CreateTrigger/containers/DefineTrigger/utils/validation.js index a668ea4b3..ee7ecb215 100644 --- a/public/pages/CreateTrigger/containers/DefineTrigger/utils/validation.js +++ b/public/pages/CreateTrigger/containers/DefineTrigger/utils/validation.js @@ -23,6 +23,7 @@ * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ +import _ from 'lodash'; import { FORMIK_INITIAL_TRIGGER_VALUES, TRIGGER_TYPE } from '../../CreateTrigger/utils/constants'; diff --git a/public/pages/CreateTrigger/containers/DefineTrigger/utils/validation.test.js b/public/pages/CreateTrigger/containers/DefineTrigger/utils/validation.test.js index 503b0f6a6..4a6b3a068 100644 --- a/public/pages/CreateTrigger/containers/DefineTrigger/utils/validation.test.js +++ b/public/pages/CreateTrigger/containers/DefineTrigger/utils/validation.test.js @@ -25,6 +25,7 @@ */ import { validateTriggerName } from './validation'; +import { TRIGGER_TYPE } from '../../CreateTrigger/utils/constants'; describe('validateTriggerName', () => { test('returns undefined if no error', () => { @@ -36,12 +37,16 @@ describe('validateTriggerName', () => { expect(validateTriggerName([], {})('')).toBe('Required'); }); test('returns false if name already exists in monitor while creates new trigger', () => { - const triggers = [{ id: '123', name: 'Test' }]; - expect(validateTriggerName(triggers, {})('Test')).toBe('Trigger name already used'); + const triggers = [{ [TRIGGER_TYPE.QUERY_LEVEL]: { id: '123', name: 'Test' } }]; + expect(validateTriggerName(triggers, { [TRIGGER_TYPE.QUERY_LEVEL]: {} })('Test')).toBe( + 'Trigger name already used' + ); }); test('returns undefined if editing trigger and name is the same', () => { const triggers = [{ id: '123', name: 'Test' }]; - expect(validateTriggerName(triggers, { id: '123' })('Test')).toBeUndefined(); + expect( + validateTriggerName(triggers, { [TRIGGER_TYPE.QUERY_LEVEL]: { id: '123' } })('Test') + ).toBeUndefined(); }); }); diff --git a/public/pages/Dashboard/components/DashboardControls/__snapshots__/DashboardControls.test.js.snap b/public/pages/Dashboard/components/DashboardControls/__snapshots__/DashboardControls.test.js.snap index bae503fda..03257100b 100644 --- a/public/pages/Dashboard/components/DashboardControls/__snapshots__/DashboardControls.test.js.snap +++ b/public/pages/Dashboard/components/DashboardControls/__snapshots__/DashboardControls.test.js.snap @@ -55,27 +55,27 @@ exports[`DashboardControls renders 1`] = `
      + View alert details + , + Acknowledge @@ -64,7 +71,7 @@ exports[`Dashboard renders 1`] = ` "padding": "initial", } } - title="Alerts" + title="Alerts by triggers" titleSize="l" > - Alerts + Alerts by triggers
      @@ -136,18 +143,66 @@ exports[`Dashboard renders 1`] = ` className="euiFlexItem" > + + + + +
      + + +
      +
      + +
      + +
      + +
      + - 1 + 1 (Highest) @@ -774,28 +857,29 @@ exports[`Dashboard renders 1`] = ` columns={ Array [ Object { - "dataType": "date", - "field": "start_time", - "name": "Alert start time", + "field": "total", + "name": "Alerts", "render": [Function], "sortable": true, "truncateText": false, }, Object { - "dataType": "date", - "field": "end_time", - "name": "Alert end time", - "render": [Function], + "field": "ACTIVE", + "name": "Active", "sortable": true, "truncateText": false, }, Object { - "field": "monitor_name", - "name": "Monitor name", - "render": [Function], + "field": "ACKNOWLEDGED", + "name": "Acknowledged", "sortable": true, - "textOnly": true, - "truncateText": true, + "truncateText": false, + }, + Object { + "field": "ERROR", + "name": "Errors", + "sortable": true, + "truncateText": false, }, Object { "field": "trigger_name", @@ -805,25 +889,34 @@ exports[`Dashboard renders 1`] = ` "truncateText": true, }, Object { - "field": "severity", - "name": "Severity", - "sortable": false, + "dataType": "date", + "field": "start_time", + "name": "Trigger start time", + "render": [Function], + "sortable": true, "truncateText": false, }, Object { - "field": "state", - "name": "State", + "dataType": "date", + "field": "last_notification_time", + "name": "Trigger last updated", "render": [Function], + "sortable": true, + "truncateText": true, + }, + Object { + "field": "severity", + "name": "Severity", "sortable": false, "truncateText": false, }, Object { - "dataType": "date", - "field": "acknowledged_time", - "name": "Time acknowledged", + "field": "monitor_name", + "name": "Monitor name", "render": [Function], "sortable": true, - "truncateText": false, + "textOnly": true, + "truncateText": true, }, ] } @@ -832,19 +925,6 @@ exports[`Dashboard renders 1`] = ` items={Array []} noItemsMessage={} onChange={[Function]} - pagination={ - Object { - "pageIndex": 0, - "pageSize": 20, - "pageSizeOptions": Array [ - 5, - 10, - 20, - 50, - ], - "totalItemCount": 0, - } - } responsive={true} selection={ Object { @@ -935,38 +1015,59 @@ exports[`Dashboard renders 1`] = ` items={ Array [ Object { - "isSortAscending": false, - "isSorted": true, - "key": "_data_s_start_time_0", - "name": "Alert start time", + "isSortAscending": undefined, + "isSorted": false, + "key": "_data_s_total_0", + "name": "Alerts", "onSort": [Function], }, Object { "isSortAscending": undefined, "isSorted": false, - "key": "_data_s_end_time_1", - "name": "Alert end time", + "key": "_data_s_ACTIVE_1", + "name": "Active", "onSort": [Function], }, Object { "isSortAscending": undefined, "isSorted": false, - "key": "_data_s_monitor_name_2", - "name": "Monitor name", + "key": "_data_s_ACKNOWLEDGED_2", + "name": "Acknowledged", "onSort": [Function], }, Object { "isSortAscending": undefined, "isSorted": false, - "key": "_data_s_trigger_name_3", + "key": "_data_s_ERROR_3", + "name": "Errors", + "onSort": [Function], + }, + Object { + "isSortAscending": undefined, + "isSorted": false, + "key": "_data_s_trigger_name_4", "name": "Trigger name", "onSort": [Function], }, + Object { + "isSortAscending": false, + "isSorted": true, + "key": "_data_s_start_time_5", + "name": "Trigger start time", + "onSort": [Function], + }, Object { "isSortAscending": undefined, "isSorted": false, - "key": "_data_s_acknowledged_time_6", - "name": "Time acknowledged", + "key": "_data_s_last_notification_time_6", + "name": "Trigger last updated", + "onSort": [Function], + }, + Object { + "isSortAscending": undefined, + "isSorted": false, + "key": "_data_s_monitor_name_8", + "name": "Monitor name", "onSort": [Function], }, ] @@ -1151,17 +1252,16 @@ exports[`Dashboard renders 1`] = ` + + + + + + + + + + - State + Severity
      @@ -1488,16 +1751,16 @@ exports[`Dashboard renders 1`] = ` - Time acknowledged + Monitor name @@ -1561,12 +1824,12 @@ exports[`Dashboard renders 1`] = ` >
      + +
      + +
      + +
      + @@ -1158,9 +1201,74 @@ exports[`DestinationsList renders 1`] = ` + + + + +
      + +
      + +
      + +
      + @@ -2398,9 +2549,74 @@ exports[`DestinationsList renders when email is disallowed 1`] = ` + + + + + - Dashboard + Alerts
      @@ -36,7 +36,7 @@ exports[` renders 1`] = ` - Create trigger + Edit monitor diff --git a/public/pages/MonitorDetails/components/MonitorOverview/__snapshots__/MonitorOverview.test.js.snap b/public/pages/MonitorDetails/components/MonitorOverview/__snapshots__/MonitorOverview.test.js.snap index 92ed72756..71a3418ab 100644 --- a/public/pages/MonitorDetails/components/MonitorOverview/__snapshots__/MonitorOverview.test.js.snap +++ b/public/pages/MonitorDetails/components/MonitorOverview/__snapshots__/MonitorOverview.test.js.snap @@ -30,6 +30,14 @@ exports[`MonitorOverview renders 1`] = `
      +
      +
      +

      @@ -46,10 +54,10 @@ exports[`MonitorOverview renders 1`] = ` class="euiText euiText--extraSmall" > - State + Monitor type
      - Enabled + Per query monitor
      @@ -145,7 +153,7 @@ exports[`MonitorOverview renders 1`] = ` Last updated by
      - N/A + -
      diff --git a/public/pages/MonitorDetails/components/MonitorOverview/utils/getOverviewStats.test.js b/public/pages/MonitorDetails/components/MonitorOverview/utils/getOverviewStats.test.js index 4cb5ceba3..20d4ca5fd 100644 --- a/public/pages/MonitorDetails/components/MonitorOverview/utils/getOverviewStats.test.js +++ b/public/pages/MonitorDetails/components/MonitorOverview/utils/getOverviewStats.test.js @@ -40,8 +40,8 @@ describe('getOverviewStats', () => { const activeCount = 17; expect(getOverviewStats(monitor, monitorId, monitorVersion, activeCount)).toEqual([ { - header: 'State', - value: 'Enabled', + header: 'Monitor type', + value: 'Per query monitor', }, { header: 'Monitor definition type', diff --git a/public/pages/MonitorDetails/containers/Triggers/Triggers.js b/public/pages/MonitorDetails/containers/Triggers/Triggers.js index 61c782cb7..f92399abc 100644 --- a/public/pages/MonitorDetails/containers/Triggers/Triggers.js +++ b/public/pages/MonitorDetails/containers/Triggers/Triggers.js @@ -28,6 +28,7 @@ import React, { Component } from 'react'; import PropTypes from 'prop-types'; import uuidv4 from 'uuid/v4'; import { EuiInMemoryTable } from '@elastic/eui'; +import _ from 'lodash'; import ContentPanel from '../../../../components/ContentPanel'; import { MONITOR_TYPE } from '../../../../utils/constants'; diff --git a/public/pages/MonitorDetails/containers/Triggers/Triggers.test.js b/public/pages/MonitorDetails/containers/Triggers/Triggers.test.js index 512a30bf2..8d2672ddc 100644 --- a/public/pages/MonitorDetails/containers/Triggers/Triggers.test.js +++ b/public/pages/MonitorDetails/containers/Triggers/Triggers.test.js @@ -28,6 +28,8 @@ import React from 'react'; import { shallow } from 'enzyme'; import Triggers from './Triggers'; +import { MONITOR_TYPE } from '../../../../utils/constants'; +import { TRIGGER_TYPE } from '../../../CreateTrigger/containers/CreateTrigger/utils/constants'; const props = { monitor: { @@ -79,16 +81,31 @@ describe('Triggers', () => { test('onDelete calls updateMonitor with triggers to keep', () => { const onDelete = jest.spyOn(Triggers.prototype, 'onDelete'); const monitor = { + monitor_type: MONITOR_TYPE.QUERY_LEVEL, triggers: [ - { name: 'one', severity: 1, actions: [{ name: 'one action' }] }, - { name: 'two', severity: 2, actions: [{ name: 'two action' }] }, + { + [TRIGGER_TYPE.QUERY_LEVEL]: { + name: 'one', + severity: 1, + actions: [{ name: 'one action' }], + }, + }, + { + [TRIGGER_TYPE.QUERY_LEVEL]: { + name: 'two', + severity: 2, + actions: [{ name: 'two action' }], + }, + }, ], }; const wrapper = getShallowWrapper({ monitor }); - wrapper.setState({ selectedItems: [monitor.triggers[0]] }); + wrapper.setState({ selectedItems: [monitor.triggers[0][TRIGGER_TYPE.QUERY_LEVEL]] }); wrapper.instance().onDelete(); expect(onDelete).toHaveBeenCalled(); expect(props.updateMonitor).toHaveBeenCalled(); - expect(props.updateMonitor).toHaveBeenCalledWith({ triggers: [monitor.triggers[1]] }); + expect(props.updateMonitor).toHaveBeenCalledWith({ + triggers: [monitor.triggers[1][TRIGGER_TYPE.QUERY_LEVEL]], + }); }); }); diff --git a/public/pages/MonitorDetails/containers/Triggers/__snapshots__/Triggers.test.js.snap b/public/pages/MonitorDetails/containers/Triggers/__snapshots__/Triggers.test.js.snap index 2f0cdd59f..7d508b089 100644 --- a/public/pages/MonitorDetails/containers/Triggers/__snapshots__/Triggers.test.js.snap +++ b/public/pages/MonitorDetails/containers/Triggers/__snapshots__/Triggers.test.js.snap @@ -2,35 +2,12 @@ exports[`Triggers renders 1`] = ` - Edit - , - - Delete - , - - Create - , - ] - } bodyStyles={ Object { "padding": "initial", } } - title="Triggers" + title="Triggers (1)" titleSize="s" > { describe('validateActionName', () => { const trigger = { name: 'trigger_name', - actions: [{ name: 'foo' }, { name: 'bar' }], + [TRIGGER_TYPE.QUERY_LEVEL]: { actions: [{ name: 'foo' }, { name: 'bar' }] }, }; + const monitor = FORMIK_INITIAL_VALUES; test('returns undefined if no error', () => { - expect(validateActionName(trigger)('valid action name')).toBeUndefined(); + expect(validateActionName(monitor, trigger)('valid action name')).toBeUndefined(); }); test('returns Required string if falsy value', () => { - expect(validateActionName(trigger)()).toBe('Required'); - expect(validateActionName(trigger)('')).toBe('Required'); + expect(validateActionName(monitor, trigger)()).toBe('Required.'); + expect(validateActionName(monitor, trigger)('')).toBe('Required.'); }); - trigger.actions.push({ name: 'foo' }); + trigger[TRIGGER_TYPE.QUERY_LEVEL].actions.push({ name: 'foo' }); test('returns already used if action name is already used', () => { - expect(validateActionName(trigger)('foo')).toBe('Action name is already used'); + expect(validateActionName(monitor, trigger)('foo')).toBe('Action name is already used.'); }); }); @@ -112,8 +115,8 @@ describe('validateMonitorName', () => { }); test('returns Required string if falsy value', () => { - validateMonitorName(httpClient, {})().catch((err) => expect(err).toEqual('Required')); - validateMonitorName(httpClient, {})('').catch((err) => expect(err).toEqual('Required')); + validateMonitorName(httpClient, {})().catch((err) => expect(err).toEqual('Required.')); + validateMonitorName(httpClient, {})('').catch((err) => expect(err).toEqual('Required.')); }); }); @@ -124,7 +127,7 @@ describe('validatePositiveInteger', () => { }); test('returns error string if invalid value', () => { - const invalidText = 'Must be a positive integer'; + const invalidText = 'Must be a positive integer.'; expect(validatePositiveInteger(-5)).toBe(invalidText); expect(validatePositiveInteger(0)).toBe(invalidText); expect(validatePositiveInteger(1.5)).toBe(invalidText); @@ -142,7 +145,7 @@ describe('validateUnit', () => { }); test('returns error string if invalid value', () => { - const invalidText = 'Must be one of minutes, hours, days'; + const invalidText = 'Must be one of minutes, hours, days.'; expect(validateUnit(5)).toBe(invalidText); expect(validateUnit('RANDOM')).toBe(invalidText); expect(validateUnit(null)).toBe(invalidText); @@ -159,7 +162,7 @@ describe('validateMonthlyDay', () => { }); test('returns error string if invalid value', () => { - const invalidText = 'Must be a positive integer between 1-31'; + const invalidText = 'Must be a positive integer between 1-31.'; expect(validateMonthlyDay(-5)).toBe(invalidText); expect(validateMonthlyDay(0)).toBe(invalidText); expect(validateMonthlyDay(1.5)).toBe(invalidText); @@ -202,7 +205,7 @@ describe('validateIndex', () => { }); test('returns error string if non array is passed in', () => { - const invalidText = 'Must specify an index'; + const invalidText = 'Must specify an index.'; expect(validateIndex(1)).toBe(invalidText); expect(validateIndex(null)).toBe(invalidText); expect(validateIndex('test')).toBe(invalidText); @@ -210,7 +213,7 @@ describe('validateIndex', () => { }); test('returns error string if empty array', () => { - const invalidText = 'Must specify an index'; + const invalidText = 'Must specify an index.'; expect(validateIndex([])).toBe(invalidText); }); diff --git a/release-notes/opensearch-alerting-dashboards-plugin.release-notes-1.1.0.0.md b/release-notes/opensearch-alerting-dashboards-plugin.release-notes-1.1.0.0.md index 1069c108e..b1584f384 100644 --- a/release-notes/opensearch-alerting-dashboards-plugin.release-notes-1.1.0.0.md +++ b/release-notes/opensearch-alerting-dashboards-plugin.release-notes-1.1.0.0.md @@ -48,4 +48,5 @@ Compatible with OpenSearch Dashboards 1.1.0 * Add Cypress tests for Bucket-Level Alerting ([#91](https://github.com/opensearch-project/alerting-dashboards-plugin/pull/91)) * Update cypress-workflow.yml to use environment variable for OS and OS dashboard versions ([#96](https://github.com/opensearch-project/alerting-dashboards-plugin/pull/96)) * Create opensearch-alerting-dashboards-plugin.release-notes-1.1.0.0.md ([#101](https://github.com/opensearch-project/alerting-dashboards-plugin/pull/101)) -* Update version in package.json ([#102](https://github.com/opensearch-project/alerting-dashboards-plugin/pull/102)) \ No newline at end of file +* Update version in package.json ([#102](https://github.com/opensearch-project/alerting-dashboards-plugin/pull/102)) +* Update jest unit tests ([#112](https://github.com/opensearch-project/alerting-dashboards-plugin/pull/112)) \ No newline at end of file diff --git a/test/utils/helpers.js b/test/utils/helpers.js index dd6f6cdf3..d413bf4b9 100644 --- a/test/utils/helpers.js +++ b/test/utils/helpers.js @@ -9,6 +9,8 @@ * GitHub history for details. */ +import { TRIGGER_TYPE } from '../../public/pages/CreateTrigger/containers/CreateTrigger/utils/constants'; + const Chance = require('chance'); class AlertingFakes { @@ -31,6 +33,7 @@ class AlertingFakes { this.randomInputs = this.randomInputs.bind(this); this.randomMonitorEnabled = this.randomMonitorEnabled.bind(this); this.randomMonitor = this.randomMonitor.bind(this); + this.randomTime = this.randomTime.bind(this); } randomEmailDestination() { @@ -106,20 +109,22 @@ class AlertingFakes { }; } - randomTrigger() { + randomTrigger(type = TRIGGER_TYPE.QUERY_LEVEL) { return { - id: this.chance.guid().slice(0, 20), - name: this.chance.word(), - severity: this.chance.string({ length: 1, pool: '12345' }), - condition: { - script: { - lang: 'painless', - source: `return ${this.chance.bool()}`, + [type]: { + id: this.chance.guid().slice(0, 20), + name: this.chance.word(), + severity: this.chance.string({ length: 1, pool: '12345' }), + condition: { + script: { + lang: 'painless', + source: `return ${this.chance.bool()}`, + }, }, + actions: new Array(this.chance.natural({ max: 10 })) + .fill(null) + .map(() => this.randomAction()), }, - actions: new Array(this.chance.natural({ max: 10 })) - .fill(null) - .map(() => this.randomAction()), }; } @@ -184,6 +189,10 @@ class AlertingFakes { .map(() => this.randomTrigger()), }; } + + randomTime() { + return this.chance.timestamp(); + } } module.exports = AlertingFakes; From 3f4e3384f8123910daec27d8c297100d64297eb3 Mon Sep 17 00:00:00 2001 From: Annie Lee <71157062+leeyun-amzn@users.noreply.github.com> Date: Tue, 12 Oct 2021 16:44:32 -0700 Subject: [PATCH 03/22] Cherry-pick commits from main branch to 1.x branch (#131) * Bumps version to 1.2 (#128) * Bumps version to 1.2 * Changes test workflows to follow Dashboards 1.x Signed-off-by: Clay Downs * Fixed a bug that displayed all alerts for a monitor on individual triggers' flyouts. Fixed a bug that displayed incorrect source for the condition field on the alerts flyout. Fixed a bug that displayed incorrect severity on the alerts flyout. Fixed a bug that prevented selecting query-level monitor alerts 1 by 1. Fixed bug relating to validation of popovers when defining monitor queries. (#123) (#130) * Create opensearch-alerting-dashboards-plugin.release-notes-1.1.0.0.md (#101) * Create opensearch-alerting-dashboards-plugin.release-notes-1.1.0.0.md * Create opensearch-alerting-dashboards-plugin.release-notes-1.1.0.0.md Signed-off-by: Annie Lee * Update opensearch-alerting-dashboards-plugin.release-notes-1.1.0.0.md Signed-off-by: Annie Lee * Update comments Signed-off-by: Annie Lee * Update version in package.json (#102) * Update package.json * Update opensearch-alerting-dashboards-plugin.release-notes-1.1.0.0.md Signed-off-by: Annie Lee * Update opensearch-alerting-dashboards-plugin.release-notes-1.1.0.0.md Signed-off-by: Annie Lee * Text updates (#105) * Add icon tooltip * Update text and rename MonitorDefinitionCard directory * Update Schedule.js * Update Schedule.js Signed-off-by: Annie Lee * Update opensearch-alerting-dashboards-plugin.release-notes-1.1.0.0.md * Remove license Signed-off-by: Annie Lee * Added badges to the package README, and the Uploads coverage job to the unit tests workflow. (#104) * Added badges to the package README, and the Uploads coverage job to the unit tests workflow. * Removing code coverage upload token. * Update jest unit tests (#112) * Update .opensearch_dashboards-plugin-helpers.json * Update snapshots * Update whereExpression.test and some snapshots * Update whereExpression.test and some snapshots Signed-off-by: Annie Lee * Update snapshots * Update formikToTrigger.test.js * Update formikToTrigger.test.js * Update formikToTrigger.test.js * Add icon tooltip * Add test * Update tests * remove license * Update TriggerExpressions.test.js * Update Triggers.test.js * Update validation test * Update getOverviewStats.test.js * Update validate.test.js * Update helpers.test.js and remove unused import * Update Triggers.test.js * Update helpers.js * Update CreateMonitor test and clean up code * Update CreateMonitor test and clean up code Signed-off-by: Annie Lee * Update release note and adding more tests * Add test and modify cypress common-utils branch * Update MonitorDefinitionCard.test.js.snap * Update cypress-workflow.yml * Update jest unit tests (#112) * Update .opensearch_dashboards-plugin-helpers.json * Update snapshots * Update whereExpression.test and some snapshots * Update whereExpression.test and some snapshots Signed-off-by: Annie Lee * Update snapshots * Update formikToTrigger.test.js * Update formikToTrigger.test.js * Update formikToTrigger.test.js * Add icon tooltip * Add test * Update tests * remove license * Update TriggerExpressions.test.js * Update Triggers.test.js * Update validation test * Update getOverviewStats.test.js * Update validate.test.js * Update helpers.test.js and remove unused import * Update Triggers.test.js * Update helpers.js * Update CreateMonitor test and clean up code * Update CreateMonitor test and clean up code Signed-off-by: Annie Lee * Update release note and adding more tests * Add test and modify cypress common-utils branch * Update MonitorDefinitionCard.test.js.snap * Update cypress-workflow.yml Signed-off-by: Annie Lee * Fixed a few bugs * Update opensearch-alerting-dashboards-plugin.release-notes-1.1.0.0.md Signed-off-by: Annie Lee * Fixed a bug that displayed all alerts for a monitor on individual trigger flyouts. Fixed a bug that diplayed incorrect source for the condition field on the alerts flyout. Fixed a bug that diplaying incorrect severity on the alerts flyout. * Updated release notes to reflect PR 122 bug fix. * Fixing number of alerts displayed on Monitors tab. * Update opensearch-alerting-dashboards-plugin.release-notes-1.1.0.0.md Signed-off-by: Annie Lee * More bug fix Signed-off-by: Annie Lee * Skip test based on modification Signed-off-by: Annie Lee * Skip test based on modification Signed-off-by: Annie Lee * Update popover windows to remove item when filed is not defined * Update field validation * Fixed a bug that prevented selecting query-level monitor alerts 1 by 1. Removed experimental code and comments. * Merge remote-tracking branch 'thomas/alertFlyoutBugFix' into bug-fix * Update Dashboard.js * Support data filter when using null operator * Update WhereExpression.js * Fixed a bug that was causing incorrect pagination display on alerts flyout. * Removed redundant validation from filter values that was generating error messages that prevented preview graphs from displaying data. * Removed redundant validation from filter values that was generating error messages that prevented preview graphs from displaying data. * Update metric error for query monitors * Update MetricExpression.js * Removed experimental dev code. * Updated release notes. Co-authored-by: Annie Lee Co-authored-by: Annie Lee Co-authored-by: AWSHurneyt Co-authored-by: Clay Downs Co-authored-by: AWSHurneyt Signed-off-by: AWSHurneyt --- .github/workflows/cypress-workflow.yml | 6 ++-- opensearch_dashboards.json | 4 +-- package.json | 2 +- .../Flyout/flyouts/alertsDashboard.js | 8 +++-- .../expressions/GroupByExpression.js | 4 ++- .../expressions/GroupByItem.js | 2 ++ .../expressions/MetricExpression.js | 8 ++++- .../expressions/MetricItem.js | 2 ++ .../expressions/WhereExpression.js | 23 +++++++------- .../expressions/utils/constants.js | 3 ++ .../components/VisualGraph/VisualGraph.js | 2 +- .../components/VisualGraph/utils/helpers.js | 23 +++++++++----- .../containers/DefineMonitor/DefineMonitor.js | 2 +- .../DefineTrigger/utils/validation.js | 4 +-- .../DefineTrigger/utils/validation.test.js | 6 ++-- .../pages/Dashboard/containers/Dashboard.js | 30 ++++++++++++++----- .../MonitorActions/MonitorActions.js | 7 ++++- .../MonitorActions/MonitorActions.test.js | 2 +- public/utils/validate.js | 2 +- ...dashboards-plugin.release-notes-1.1.0.0.md | 5 +++- 20 files changed, 96 insertions(+), 49 deletions(-) diff --git a/.github/workflows/cypress-workflow.yml b/.github/workflows/cypress-workflow.yml index 727245837..069810948 100644 --- a/.github/workflows/cypress-workflow.yml +++ b/.github/workflows/cypress-workflow.yml @@ -8,7 +8,7 @@ on: - main env: OPENSEARCH_DASHBOARDS_VERSION: '1.x' - OPENSEARCH_VERSION: '1.1.0-SNAPSHOT' + OPENSEARCH_VERSION: '1.2.0-SNAPSHOT' jobs: tests: name: Run Cypress E2E tests @@ -30,7 +30,7 @@ jobs: with: repository: opensearch-project/OpenSearch path: OpenSearch - ref: '1.1' + ref: '1.x' - name: Build OpenSearch working-directory: ./OpenSearch run: ./gradlew publishToMavenLocal @@ -40,7 +40,7 @@ jobs: with: repository: opensearch-project/common-utils path: common-utils - ref: '1.1' + ref: 'main' - name: Build common-utils working-directory: ./common-utils run: ./gradlew publishToMavenLocal -Dopensearch.version=${{ env.OPENSEARCH_VERSION }} diff --git a/opensearch_dashboards.json b/opensearch_dashboards.json index 5c27f182f..72afca77c 100644 --- a/opensearch_dashboards.json +++ b/opensearch_dashboards.json @@ -1,7 +1,7 @@ { "id": "alertingDashboards", - "version": "1.1.0.0", - "opensearchDashboardsVersion": "1.1.0", + "version": "1.2.0.0", + "opensearchDashboardsVersion": "1.2.0", "configPath": ["opensearch_alerting"], "requiredPlugins": [], "server": true, diff --git a/package.json b/package.json index d8e333370..320d5b6d4 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "opensearch-alerting-dashboards", - "version": "1.1.0.0", + "version": "1.2.0.0", "description": "OpenSearch Dashboards Alerting Plugin", "main": "index.js", "license": "Apache-2.0", diff --git a/public/components/Flyout/flyouts/alertsDashboard.js b/public/components/Flyout/flyouts/alertsDashboard.js index 3e5b28763..17bf4df95 100644 --- a/public/components/Flyout/flyouts/alertsDashboard.js +++ b/public/components/Flyout/flyouts/alertsDashboard.js @@ -80,6 +80,7 @@ const getBucketLevelGraphFilter = (trigger) => { const alertsDashboard = (payload) => { const { + alerts, history, httpClient, last_notification_time, @@ -90,9 +91,8 @@ const alertsDashboard = (payload) => { monitor_name, notifications, setFlyout, - severity, start_time, - triggerId, + triggerID, trigger_name, } = payload; const monitor = _.get(_.find(monitors, { _id: monitor_id }), '_source'); @@ -104,10 +104,11 @@ const alertsDashboard = (payload) => { monitorType === MONITOR_TYPE.QUERY_LEVEL ? TRIGGER_TYPE.QUERY_LEVEL : TRIGGER_TYPE.BUCKET_LEVEL; let trigger = _.get(monitor, 'triggers', []).find((trigger) => { - return trigger[triggerType].triggerId === triggerId; + return trigger[triggerType].id === triggerID; }); trigger = _.get(trigger, triggerType); + const severity = _.get(trigger, 'severity'); const groupBy = _.get(monitor, MONITOR_GROUP_BY); const condition = @@ -260,6 +261,7 @@ const alertsDashboard = (payload) => { monitorType={monitorType} perAlertView={true} groupBy={groupBy} + flyoutAlerts={alerts} /> diff --git a/public/pages/CreateMonitor/components/MonitorExpressions/expressions/GroupByExpression.js b/public/pages/CreateMonitor/components/MonitorExpressions/expressions/GroupByExpression.js index 34fdaa97b..bd3322a8d 100644 --- a/public/pages/CreateMonitor/components/MonitorExpressions/expressions/GroupByExpression.js +++ b/public/pages/CreateMonitor/components/MonitorExpressions/expressions/GroupByExpression.js @@ -30,7 +30,7 @@ import { EuiText, EuiButtonEmpty, EuiSpacer } from '@elastic/eui'; import { getIndexFields } from './utils/dataTypes'; import { getGroupByExpressionAllowedTypes } from './utils/helpers'; import GroupByItem from './GroupByItem'; -import { GROUP_BY_ERROR } from './utils/constants'; +import { GROUP_BY_ERROR, QUERY_TYPE_GROUP_BY_ERROR } from './utils/constants'; import { MONITOR_TYPE } from '../../../../../utils/constants'; import { inputLimitText } from '../../../../../utils/helpers'; import { @@ -86,6 +86,8 @@ class GroupByExpression extends Component { const isBucketLevelMonitor = values.monitor_type === MONITOR_TYPE.BUCKET_LEVEL; if (!values.groupBy.length && isBucketLevelMonitor) { errors.groupBy = GROUP_BY_ERROR; + } else if (!isBucketLevelMonitor && values.groupBy.length > MAX_NUM_QUERY_LEVEL_GROUP_BYS) { + errors.groupBy = QUERY_TYPE_GROUP_BY_ERROR; } else { delete errors.groupBy; } diff --git a/public/pages/CreateMonitor/components/MonitorExpressions/expressions/GroupByItem.js b/public/pages/CreateMonitor/components/MonitorExpressions/expressions/GroupByItem.js index 7e11c9edb..ac092fd70 100644 --- a/public/pages/CreateMonitor/components/MonitorExpressions/expressions/GroupByItem.js +++ b/public/pages/CreateMonitor/components/MonitorExpressions/expressions/GroupByItem.js @@ -10,6 +10,7 @@ */ import React, { useState } from 'react'; +import _ from 'lodash'; import { EuiPopover, EuiBadge, EuiPopoverTitle } from '@elastic/eui'; import { GroupByPopover } from './index'; @@ -18,6 +19,7 @@ export default function GroupByItem( ) { const [isPopoverOpen, setIsPopoverOpen] = useState(groupByItem === ''); const closePopover = () => { + if (_.isEmpty(groupByItem)) arrayHelpers.remove(index); setIsPopoverOpen(false); }; diff --git a/public/pages/CreateMonitor/components/MonitorExpressions/expressions/MetricExpression.js b/public/pages/CreateMonitor/components/MonitorExpressions/expressions/MetricExpression.js index 495808e26..2731237c1 100644 --- a/public/pages/CreateMonitor/components/MonitorExpressions/expressions/MetricExpression.js +++ b/public/pages/CreateMonitor/components/MonitorExpressions/expressions/MetricExpression.js @@ -27,9 +27,9 @@ import React, { Component } from 'react'; import { connect } from 'formik'; import { EuiText, EuiButtonEmpty, EuiSpacer, EuiBadge, EuiToolTip, EuiIcon } from '@elastic/eui'; +import _ from 'lodash'; import { getIndexFields } from './utils/dataTypes'; import { getMetricExpressionAllowedTypes, validateAggregationsDuplicates } from './utils/helpers'; -import _ from 'lodash'; import { FORMIK_INITIAL_AGG_VALUES, METRIC_TOOLTIP_TEXT, @@ -38,6 +38,7 @@ import { MetricItem } from './index'; import { MONITOR_TYPE } from '../../../../../utils/constants'; import { inputLimitText } from '../../../../../utils/helpers'; import IconToolTip from '../../../../../components/IconToolTip'; +import { QUERY_TYPE_METRIC_ERROR } from './utils/constants'; export const MAX_NUM_QUERY_LEVEL_METRICS = 1; export const MAX_NUM_BUCKET_LEVEL_METRICS = 5; @@ -107,6 +108,11 @@ class MetricExpression extends Component { if (validateAggregationsDuplicates(aggregations)) { errors.aggregations = `You have defined duplicated metrics.`; + } else if ( + MONITOR_TYPE.QUERY_LEVEL === monitorType && + aggregations.length > MAX_NUM_QUERY_LEVEL_METRICS + ) { + errors.aggregations = QUERY_TYPE_METRIC_ERROR; } else { delete errors.aggregations; } diff --git a/public/pages/CreateMonitor/components/MonitorExpressions/expressions/MetricItem.js b/public/pages/CreateMonitor/components/MonitorExpressions/expressions/MetricItem.js index d72735f6b..cf0459ada 100644 --- a/public/pages/CreateMonitor/components/MonitorExpressions/expressions/MetricItem.js +++ b/public/pages/CreateMonitor/components/MonitorExpressions/expressions/MetricItem.js @@ -10,6 +10,7 @@ */ import React, { useState } from 'react'; +import _ from 'lodash'; import { EuiPopover, EuiBadge, EuiPopoverTitle } from '@elastic/eui'; import MetricPopover from './MetricPopover'; @@ -18,6 +19,7 @@ export default function MetricItem( ) { const [isPopoverOpen, setIsPopoverOpen] = useState(aggregation.fieldName === ''); const closePopover = () => { + if (_.isEmpty(aggregation.fieldName)) arrayHelpers.remove(index); setIsPopoverOpen(false); }; diff --git a/public/pages/CreateMonitor/components/MonitorExpressions/expressions/WhereExpression.js b/public/pages/CreateMonitor/components/MonitorExpressions/expressions/WhereExpression.js index 68d112a8b..046b23dcd 100644 --- a/public/pages/CreateMonitor/components/MonitorExpressions/expressions/WhereExpression.js +++ b/public/pages/CreateMonitor/components/MonitorExpressions/expressions/WhereExpression.js @@ -50,12 +50,7 @@ import { isNullOperator, isRangeOperator, } from './utils/whereHelpers'; -import { - hasError, - isInvalid, - required, - validateRequiredNumber, -} from '../../../../../utils/validate'; +import { hasError, isInvalid } from '../../../../../utils/validate'; import { FormikComboBox, FormikSelect, @@ -66,7 +61,6 @@ import { getFilteredIndexFields, getIndexFields } from './utils/dataTypes'; import { FILTERS_TOOLTIP_TEXT, FORMIK_INITIAL_VALUES, - TIME_RANGE_TOOLTIP_TEXT, } from '../../../containers/CreateMonitor/utils/constants'; import { DATA_TYPES } from '../../../../../utils/constants'; import { @@ -105,9 +99,10 @@ class WhereExpression extends Component { } }; - handleOperatorChange = (e, field) => { + handleOperatorChange = (e, field, form) => { this.props.onMadeChanges(); field.onChange(e); + form.setFieldError('where', undefined); }; handleChangeWrapper = (e, field) => { @@ -123,9 +118,16 @@ class WhereExpression extends Component { } = this.props; // Explicitly invoking validation, this component unmount after it closes. const fieldName = _.get(values, `${fieldPath}where.fieldName`, ''); + const fieldOperator = _.get(values, `${fieldPath}where.operator`, 'is'); + const fieldValue = _.get(values, `${fieldPath}where.fieldValue`, ''); if (fieldName > 0) { await this.props.formik.validateForm(); } + if ( + _.isEmpty(fieldName) || + (!isNullOperator(fieldOperator) && _.isEmpty(fieldValue.toString())) + ) + this.resetValues(); closeExpression(Expressions.WHERE); }; @@ -182,7 +184,6 @@ class WhereExpression extends Component { ) : ( ); @@ -267,7 +266,7 @@ class WhereExpression extends Component { iconSide="right" iconType="cross" iconOnClick={() => this.resetValues()} - iconOnClickAriaLabel="Remove where filter" + iconOnClickAriaLabel="Remove filter" onClick={() => { openExpression(Expressions.WHERE); }} diff --git a/public/pages/CreateMonitor/components/MonitorExpressions/expressions/utils/constants.js b/public/pages/CreateMonitor/components/MonitorExpressions/expressions/utils/constants.js index 377633d09..c83c8daa1 100644 --- a/public/pages/CreateMonitor/components/MonitorExpressions/expressions/utils/constants.js +++ b/public/pages/CreateMonitor/components/MonitorExpressions/expressions/utils/constants.js @@ -114,3 +114,6 @@ export const AGGREGATION_TYPES = [ ]; export const GROUP_BY_ERROR = 'Must specify at least 1 group by expression.'; +export const QUERY_TYPE_GROUP_BY_ERROR = 'Can have a maximum of 1 group by selections.'; + +export const QUERY_TYPE_METRIC_ERROR = 'Can have a maximum of 1 metric selections.'; diff --git a/public/pages/CreateMonitor/components/VisualGraph/VisualGraph.js b/public/pages/CreateMonitor/components/VisualGraph/VisualGraph.js index cde9b9768..aa61530df 100644 --- a/public/pages/CreateMonitor/components/VisualGraph/VisualGraph.js +++ b/public/pages/CreateMonitor/components/VisualGraph/VisualGraph.js @@ -128,7 +128,7 @@ export default class VisualGraph extends Component { renderAggregationXYPlot = (data, groupedData) => { const { annotation, thresholdValue, values, fieldName, aggregationType } = this.props; const { hint } = this.state; - const xDomain = getBufferedXDomain(data); + const xDomain = getBufferedXDomain(data, values); const yDomain = getYDomain(data); const annotations = getAnnotationData(xDomain, yDomain, thresholdValue); const xTitle = values.timeField; diff --git a/public/pages/CreateMonitor/components/VisualGraph/utils/helpers.js b/public/pages/CreateMonitor/components/VisualGraph/utils/helpers.js index 2db08b0bc..4d9a72d64 100644 --- a/public/pages/CreateMonitor/components/VisualGraph/utils/helpers.js +++ b/public/pages/CreateMonitor/components/VisualGraph/utils/helpers.js @@ -25,6 +25,7 @@ */ import _ from 'lodash'; +import moment from 'moment'; import { selectOptionValueToText } from '../../MonitorExpressions/expressions/utils/helpers'; import { @@ -61,10 +62,14 @@ export function getXDomain(data) { return [minDate.x, maxDate.x]; } -export function getBufferedXDomain(data) { +export function getBufferedXDomain(data, values) { + const { bucketValue, bucketUnitOfTime } = values; const minDate = data[0].x; const maxDate = data[data.length - 1].x; - const timeRange = maxDate - minDate; + // If minDate equals to maxDate, then use bucketValue and bucketUnitOfTime as timeRange. + let timeRange = maxDate - minDate; + if (!timeRange) timeRange = moment.duration(bucketValue, bucketUnitOfTime); + const minDateBuffer = minDate - timeRange * X_DOMAIN_BUFFER; const maxDateBuffer = maxDate.getTime() + timeRange * X_DOMAIN_BUFFER; return [minDateBuffer, maxDateBuffer]; @@ -111,13 +116,13 @@ export function getDataFromResponse(response, fieldName, monitorType) { } } -// Function for aggregation type monitors to get Map of data. -// The current response gives a large number of data aggregated in buckets, and this function returns the top n results with highest count of data points. -// The number n is based on the constant BAY_KEY_COUNT. +// Function for aggregation type monitors to get Map of data. +// The current response gives a large number of data aggregated in buckets, and this function returns the top n results with highest count of data points. +// The number n is based on the constant BAY_KEY_COUNT. export function getMapDataFromResponse(response, fieldName, groupByFields) { if (!response) return []; const buckets = _.get(response, 'aggregations.composite_agg.buckets', []); - let allData = new Map(); + const allData = new Map(); buckets.map((bucket) => { const dataPoint = getXYValuesByFieldName(bucket, fieldName); // Key of object is the string concat by group by field values @@ -126,7 +131,7 @@ export function getMapDataFromResponse(response, fieldName, groupByFields) { ? allData.set(key, [dataPoint, ...allData.get(key)]) : allData.set(key, [dataPoint]); }); - let entryLength = []; + const entryLength = []; for (const [key, value] of allData.entries()) { allData.set(key, _.filter(value, filterInvalidYValues)); entryLength.push({ key, length: value.length }); @@ -141,7 +146,9 @@ export function getMapDataFromResponse(response, fieldName, groupByFields) { export function getXYValuesByFieldName(bucket, fieldName) { const x = new Date(bucket.key.date); - const path = bucket[fieldName] ? `${fieldName}.value` : 'doc_count'; + // Parse the fieldName containing "." to "_" + const parsedFieldName = fieldName.replace(/\./g, '_'); + const path = bucket[parsedFieldName] ? `${parsedFieldName}.value` : 'doc_count'; const y = _.get(bucket, path, null); return { x, y }; } diff --git a/public/pages/CreateMonitor/containers/DefineMonitor/DefineMonitor.js b/public/pages/CreateMonitor/containers/DefineMonitor/DefineMonitor.js index a3f56e899..7f3afed98 100644 --- a/public/pages/CreateMonitor/containers/DefineMonitor/DefineMonitor.js +++ b/public/pages/CreateMonitor/containers/DefineMonitor/DefineMonitor.js @@ -182,7 +182,7 @@ class DefineMonitor extends Component { // Default `count of documents` graph when using Bucket-level monitor let graphs = [ - , + , ]; diff --git a/public/pages/CreateTrigger/containers/DefineTrigger/utils/validation.js b/public/pages/CreateTrigger/containers/DefineTrigger/utils/validation.js index ee7ecb215..26620bd72 100644 --- a/public/pages/CreateTrigger/containers/DefineTrigger/utils/validation.js +++ b/public/pages/CreateTrigger/containers/DefineTrigger/utils/validation.js @@ -28,7 +28,7 @@ import _ from 'lodash'; import { FORMIK_INITIAL_TRIGGER_VALUES, TRIGGER_TYPE } from '../../CreateTrigger/utils/constants'; export const validateTriggerName = (triggers, triggerToEdit, fieldPath) => (value) => { - if (!value) return 'Required'; + if (!value) return 'Required.'; const nameExists = triggers.filter((trigger) => { const triggerId = _.get( trigger, @@ -44,7 +44,7 @@ export const validateTriggerName = (triggers, triggerToEdit, fieldPath) => (valu return triggerToEditId !== triggerId && triggerName.toLowerCase() === value.toLowerCase(); }); if (nameExists.length > 0) { - return 'Trigger name already used'; + return 'Trigger name already used.'; } // TODO: character restrictions // TODO: character limits diff --git a/public/pages/CreateTrigger/containers/DefineTrigger/utils/validation.test.js b/public/pages/CreateTrigger/containers/DefineTrigger/utils/validation.test.js index 4a6b3a068..f141d1936 100644 --- a/public/pages/CreateTrigger/containers/DefineTrigger/utils/validation.test.js +++ b/public/pages/CreateTrigger/containers/DefineTrigger/utils/validation.test.js @@ -33,13 +33,13 @@ describe('validateTriggerName', () => { }); test('returns Required string if falsy value', () => { - expect(validateTriggerName([], {})()).toBe('Required'); - expect(validateTriggerName([], {})('')).toBe('Required'); + expect(validateTriggerName([], {})()).toBe('Required.'); + expect(validateTriggerName([], {})('')).toBe('Required.'); }); test('returns false if name already exists in monitor while creates new trigger', () => { const triggers = [{ [TRIGGER_TYPE.QUERY_LEVEL]: { id: '123', name: 'Test' } }]; expect(validateTriggerName(triggers, { [TRIGGER_TYPE.QUERY_LEVEL]: {} })('Test')).toBe( - 'Trigger name already used' + 'Trigger name already used.' ); }); diff --git a/public/pages/Dashboard/containers/Dashboard.js b/public/pages/Dashboard/containers/Dashboard.js index 64d834766..7641d700d 100644 --- a/public/pages/Dashboard/containers/Dashboard.js +++ b/public/pages/Dashboard/containers/Dashboard.js @@ -49,7 +49,7 @@ export default class Dashboard extends Component { constructor(props) { super(props); - const { isAlertsFlyout = false, perAlertView } = props; + const { flyoutAlerts, isAlertsFlyout = false, perAlertView } = props; const { alertState, @@ -77,6 +77,7 @@ export default class Dashboard extends Component { sortField, totalAlerts: 0, totalTriggers: 0, + trimmedFlyoutAlerts: flyoutAlerts ? flyoutAlerts.slice(0, 10) : [], }; } @@ -307,16 +308,23 @@ export default class Dashboard extends Component { }; onTableChange = ({ page: tablePage = {}, sort = {} }) => { + const { isAlertsFlyout } = this.props; const { index: page, size } = tablePage; const { field: sortField, direction: sortDirection } = sort; - this.setState({ page, size, sortField, sortDirection, }); + + // If the table is in flyout, return the trimmed array of alerts. + if (isAlertsFlyout) { + const { flyoutAlerts } = this.props; + const trimmedFlyoutAlerts = flyoutAlerts.slice(page * size, page * size + size); + this.setState({ trimmedFlyoutAlerts }); + } }; onSeverityLevelChange = (e) => { @@ -355,6 +363,7 @@ export default class Dashboard extends Component { sortField, totalAlerts, totalTriggers, + trimmedFlyoutAlerts, } = this.state; const { monitorIds, @@ -370,7 +379,7 @@ export default class Dashboard extends Component { notifications, isAlertsFlyout = false, } = this.props; - const totalItems = perAlertView ? totalAlerts : totalTriggers; + let totalItems = perAlertView ? totalAlerts : totalTriggers; const isBucketMonitor = monitorType === MONITOR_TYPE.BUCKET_LEVEL; let columnType = perAlertView @@ -387,7 +396,10 @@ export default class Dashboard extends Component { setFlyout ); - if (isAlertsFlyout) columnType = removeColumns(['severity', 'trigger_name'], columnType); + if (isAlertsFlyout) { + totalItems = this.props.flyoutAlerts.length; + columnType = removeColumns(['severity', 'trigger_name'], columnType); + } const pagination = { pageIndex: page, @@ -413,8 +425,12 @@ export default class Dashboard extends Component { }; const actions = () => { + // The acknowledge button is disabled when viewing by per alerts, and no item selected or per trigger view and item selected is not 1. const actions = [ - + Acknowledge , ]; @@ -459,7 +475,7 @@ export default class Dashboard extends Component { }; const getItemId = (item) => { - if (perAlertView && isBucketMonitor) return item.id; + if (perAlertView) return isBucketMonitor ? item.id : `${item.id}-${item.version}`; return `${item.triggerID}-${item.version}`; }; @@ -486,7 +502,7 @@ export default class Dashboard extends Component { { - return [ + // TODO: Support bulk acknowledge alerts across multiple monitors after figuring out the correct parameter for getAlerts API. + // Disabling the acknowledge button for now when more than 1 monitors selected. + const { isEditDisabled } = this.props; + const actions = [ , ]; + if (isEditDisabled) actions.splice(0, 1); + return actions; }; onCloseActions = () => { diff --git a/public/pages/Monitors/components/MonitorActions/MonitorActions.test.js b/public/pages/Monitors/components/MonitorActions/MonitorActions.test.js index 8da931536..bfbc5c4a6 100644 --- a/public/pages/Monitors/components/MonitorActions/MonitorActions.test.js +++ b/public/pages/Monitors/components/MonitorActions/MonitorActions.test.js @@ -86,7 +86,7 @@ describe('MonitorActions', () => { expect(wrapper.state('isActionsOpen')).toBe(false); }); - test('calls onCloseActions and onBulkAcknowledge when clicking Acknowledge item', () => { + test.skip('calls onCloseActions and onBulkAcknowledge when clicking Acknowledge item', () => { const instance = wrapper.instance(); jest.spyOn(instance, 'onCloseActions'); wrapper.find('[data-test-subj="actionsButton"]').hostNodes().simulate('click'); diff --git a/public/utils/validate.js b/public/utils/validate.js index 9f1757268..6f66edcab 100644 --- a/public/utils/validate.js +++ b/public/utils/validate.js @@ -74,7 +74,7 @@ export const required = (value) => { }; export const validateRequiredNumber = (value) => { - if (_.isEmpty(value)) return 'Provide a value.'; + if (value === undefined || typeof value === 'string') return 'Provide a value.'; }; export const validateMonitorName = (httpClient, monitorToEdit) => async (value) => { diff --git a/release-notes/opensearch-alerting-dashboards-plugin.release-notes-1.1.0.0.md b/release-notes/opensearch-alerting-dashboards-plugin.release-notes-1.1.0.0.md index b1584f384..f09d42a6e 100644 --- a/release-notes/opensearch-alerting-dashboards-plugin.release-notes-1.1.0.0.md +++ b/release-notes/opensearch-alerting-dashboards-plugin.release-notes-1.1.0.0.md @@ -49,4 +49,7 @@ Compatible with OpenSearch Dashboards 1.1.0 * Update cypress-workflow.yml to use environment variable for OS and OS dashboard versions ([#96](https://github.com/opensearch-project/alerting-dashboards-plugin/pull/96)) * Create opensearch-alerting-dashboards-plugin.release-notes-1.1.0.0.md ([#101](https://github.com/opensearch-project/alerting-dashboards-plugin/pull/101)) * Update version in package.json ([#102](https://github.com/opensearch-project/alerting-dashboards-plugin/pull/102)) -* Update jest unit tests ([#112](https://github.com/opensearch-project/alerting-dashboards-plugin/pull/112)) \ No newline at end of file +* Update jest unit tests ([#112](https://github.com/opensearch-project/alerting-dashboards-plugin/pull/112)) + +### Bug Fixes +* Fixed a bug that displayed all alerts for a monitor on individual triggers' flyouts. Fixed a bug that displayed incorrect source for the condition field on the alerts flyout. Fixed a bug that displayed incorrect severity on the alerts flyout. Fixed a bug that prevented selecting query-level monitor alerts 1 by 1. Consolidates bug fixes from PR 121 and 122 ([#123](https://github.com/opensearch-project/alerting-dashboards-plugin/pull/123)) \ No newline at end of file From 9ff7822641568f951d85d916f35d0bd8be7877be Mon Sep 17 00:00:00 2001 From: AWSHurneyt <79280347+AWSHurneyt@users.noreply.github.com> Date: Fri, 5 Nov 2021 16:25:52 -0700 Subject: [PATCH 04/22] Cherry-picking commits from main to 1.x branch for 1.2 release (#142) * Fixes flaky test and removes local publishing of plugin dependencies (#135) * Fixes 'bucket level monitor can be created by extraction query' flaky test * Removes local publishing of plugin dependencies for github cypress tests Signed-off-by: Clay Downs * Update copyright notice (#140) Signed-off-by: Mohammad Qureshi * Added 1.2 release notes. (#141) * Added badges to the package README, and the Uploads coverage job to the unit tests workflow. * Removing code coverage upload token. * Added 1.2 release notes. Signed-off-by: Thomas Hurney Signed-off-by: AWSHurneyt * Added 1.2 release notes. Signed-off-by: Thomas Hurney Signed-off-by: AWSHurneyt * Updated 1.2 release notes. Signed-off-by: Thomas Hurney Signed-off-by: AWSHurneyt Co-authored-by: Clay Downs Co-authored-by: Mohammad Qureshi Signed-off-by: AWSHurneyt --- .github/workflows/cypress-workflow.yml | 20 ------------------- README.md | 2 +- .../integration/bucket_level_monitor_spec.js | 1 + ...dashboards-plugin.release-notes-1.2.0.0.md | 11 ++++++++++ 4 files changed, 13 insertions(+), 21 deletions(-) create mode 100644 release-notes/opensearch-alerting-dashboards-plugin.release-notes-1.2.0.0.md diff --git a/.github/workflows/cypress-workflow.yml b/.github/workflows/cypress-workflow.yml index 069810948..48a6f571c 100644 --- a/.github/workflows/cypress-workflow.yml +++ b/.github/workflows/cypress-workflow.yml @@ -24,26 +24,6 @@ jobs: with: # TODO: Parse this from alerting plugin java-version: 14 - # dependencies: OpenSearch - - name: Checkout OpenSearch - uses: actions/checkout@v2 - with: - repository: opensearch-project/OpenSearch - path: OpenSearch - ref: '1.x' - - name: Build OpenSearch - working-directory: ./OpenSearch - run: ./gradlew publishToMavenLocal - # dependencies: common-utils - - name: Checkout common-utils - uses: actions/checkout@v2 - with: - repository: opensearch-project/common-utils - path: common-utils - ref: 'main' - - name: Build common-utils - working-directory: ./common-utils - run: ./gradlew publishToMavenLocal -Dopensearch.version=${{ env.OPENSEARCH_VERSION }} - name: Checkout uses: actions/checkout@v2 with: diff --git a/README.md b/README.md index 132ec2046..558e904a9 100644 --- a/README.md +++ b/README.md @@ -48,4 +48,4 @@ This project is licensed under the [Apache v2.0 License](LICENSE). ## Copyright -Copyright 2020-2021 Amazon.com, Inc. or its affiliates. All Rights Reserved. +Copyright OpenSearch Contributors. See [NOTICE](NOTICE.txt) for details. diff --git a/cypress/integration/bucket_level_monitor_spec.js b/cypress/integration/bucket_level_monitor_spec.js index 54ebe50de..59feb9e13 100644 --- a/cypress/integration/bucket_level_monitor_spec.js +++ b/cypress/integration/bucket_level_monitor_spec.js @@ -160,6 +160,7 @@ describe('Bucket-Level Monitors', () => { cy.get('[data-test-subj="extractionQueryCodeEditor"]').within(() => { // If possible, a data-test-subj attribute should be added to access the code editor input directly cy.get('.ace_text-input') + .focus() .clear({ force: true }) .type(JSON.stringify(sampleAggregationQuery), { force: true, diff --git a/release-notes/opensearch-alerting-dashboards-plugin.release-notes-1.2.0.0.md b/release-notes/opensearch-alerting-dashboards-plugin.release-notes-1.2.0.0.md new file mode 100644 index 000000000..ce0b76fe2 --- /dev/null +++ b/release-notes/opensearch-alerting-dashboards-plugin.release-notes-1.2.0.0.md @@ -0,0 +1,11 @@ +## Version 1.2.0.0 2021-11-04 + +Compatible with OpenSearch Dashboards 1.2.0 + +### Maintenance +* Bumps version to 1.2 ([#128](https://github.com/opensearch-project/alerting-dashboards-plugin/pull/128)) +* Added 1.2 release notes. ([#141](https://github.com/opensearch-project/alerting-dashboards-plugin/pull/141)) + +### Bug Fixes +* Fixes flaky test and removes local publishing of plugin dependencies ([#135](https://github.com/opensearch-project/alerting-dashboards-plugin/pull/135)) +* Update copyright notice ([#140](https://github.com/opensearch-project/alerting-dashboards-plugin/pull/140)) \ No newline at end of file From 052b12860edb7a8af1ad9c14c42e18e776d073be Mon Sep 17 00:00:00 2001 From: AWSHurneyt <79280347+AWSHurneyt@users.noreply.github.com> Date: Tue, 9 Nov 2021 10:10:21 -0800 Subject: [PATCH 05/22] Added DCO section to CONTRIBUTING.md and GitHub workflows. Updated copyright notice. Signed-off-by: Thomas Hurney (#145) Signed-off-by: AWSHurneyt --- .github/workflows/dco.yml | 18 ++++++++++++++++ CONTRIBUTING.md | 45 ++++++++++++++++++++++++++++++++++++++- NOTICE | 4 ++-- 3 files changed, 64 insertions(+), 3 deletions(-) create mode 100644 .github/workflows/dco.yml diff --git a/.github/workflows/dco.yml b/.github/workflows/dco.yml new file mode 100644 index 000000000..cf30ea89d --- /dev/null +++ b/.github/workflows/dco.yml @@ -0,0 +1,18 @@ +name: Developer Certificate of Origin Check + +on: [pull_request] + +jobs: + check: + runs-on: ubuntu-latest + + steps: + - name: Get PR Commits + id: 'get-pr-commits' + uses: tim-actions/get-pr-commits@v1.1.0 + with: + token: ${{ secrets.GITHUB_TOKEN }} + - name: DCO Check + uses: tim-actions/dco@v1.1.0 + with: + commits: ${{ steps.get-pr-commits.outputs.commits }} diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index ac2b6e945..0f5868e36 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,4 +1,47 @@ -## Contributing to this Project +## Contributing to OpenSearch OpenSearch is a community project that is built and maintained by people just like **you**. [This document](https://github.com/opensearch-project/.github/blob/main/CONTRIBUTING.md) explains how you can contribute to this and related projects. + +## Developer Certificate of Origin + +OpenSearch is an open source product released under the Apache 2.0 license (see either [the Apache](https://www.apache.org/licenses/LICENSE-2.0) site or the [LICENSE.txt file](https://github.com/opensearch-project/.github/blob/main/LICENSE.txt)). The Apache 2.0 license allows you to freely use, modify, distribute, and sell your own products that include Apache 2.0 licensed software. + +We respect intellectual property rights of others and we want to make sure all incoming contributions are correctly attributed and licensed. A Developer Certificate of Origin (DCO) is a lightweight mechanism to do that. + +The DCO is a declaration attached to every contribution made by every developer. In the commit message of the contribution, the developer simply adds a `Signed-off-by` statement and thereby agrees to the DCO, which you can find below or at [DeveloperCertificate.org](http://developercertificate.org/). +```` +Developer's Certificate of Origin 1.1 + +By making a contribution to this project, I certify that: + +(a) The contribution was created in whole or in part by me and I +have the right to submit it under the open source license +indicated in the file; or + +(b) The contribution is based upon previous work that, to the +best of my knowledge, is covered under an appropriate open +source license and I have the right under that license to +submit that work with modifications, whether created in whole +or in part by me, under the same open source license (unless +I am permitted to submit under a different license), as +Indicated in the file; or + +(c) The contribution was provided directly to me by some other +person who certified (a), (b) or (c) and I have not modified +it. + +(d) I understand and agree that this project and the contribution +are public and that a record of the contribution (including +all personal information I submit with it, including my +sign-off) is maintained indefinitely and may be redistributed +consistent with this project or the open source license(s) +involved. +```` +We require that every contribution to OpenSearch is signed with a Developer Certificate of Origin. Additionally, please use your real name. We do not accept anonymous contributors nor those utilizing pseudonyms. + +Each commit must include a DCO which looks like this +```` +Signed-off-by: Jane Smith +```` +You may type this line on your own when writing your commit messages. However, if your user.name and user.email are set in your git configs, you can use `-s` or `–-signoff` to add the `Signed-off-by` line to the end of the commit message. \ No newline at end of file diff --git a/NOTICE b/NOTICE index be83767d4..6c7dc983f 100644 --- a/NOTICE +++ b/NOTICE @@ -1,5 +1,5 @@ -OpenSearch -Copyright 2021 OpenSearch Contributors +OpenSearch (https://opensearch.org/) +Copyright OpenSearch Contributors This product includes software developed by Elasticsearch (http://www.elastic.co). From b0315b51f9a395726f9ece4943972f9a7c26b7fb Mon Sep 17 00:00:00 2001 From: Yaliang <49084640+ylwu-amzn@users.noreply.github.com> Date: Tue, 9 Nov 2021 12:04:48 -0800 Subject: [PATCH 06/22] support creating monitor for anomaly detector with custom result index (#143) (#147) * support creating monitor for anomaly detector with custom result index Signed-off-by: Yaliang Wu * add release note Signed-off-by: Yaliang Wu Signed-off-by: AWSHurneyt --- .../containers/AnomalyDetectors/AnomalyDetectors.js | 2 ++ .../CreateMonitor/__snapshots__/CreateMonitor.test.js.snap | 1 + .../containers/CreateMonitor/utils/formikToMonitor.js | 3 ++- .../containers/CreateMonitor/utils/monitorQueryParams.js | 1 + .../containers/CreateMonitor/utils/monitorToFormik.js | 1 + ...nsearch-alerting-dashboards-plugin.release-notes-1.2.0.0.md | 3 +++ 6 files changed, 10 insertions(+), 1 deletion(-) diff --git a/public/pages/CreateMonitor/containers/AnomalyDetectors/AnomalyDetectors.js b/public/pages/CreateMonitor/containers/AnomalyDetectors/AnomalyDetectors.js index 1f2cb63e2..f761427b0 100644 --- a/public/pages/CreateMonitor/containers/AnomalyDetectors/AnomalyDetectors.js +++ b/public/pages/CreateMonitor/containers/AnomalyDetectors/AnomalyDetectors.js @@ -58,6 +58,7 @@ class AnomalyDetectors extends React.Component { value: detector.id, features: detector.featureAttributes, interval: detector.detectionInterval, + resultIndex: detector.resultIndex, })); this.setState({ detectorOptions }); } else { @@ -111,6 +112,7 @@ class AnomalyDetectors extends React.Component { interval: 2 * get(options, '0.interval.period.interval'), unit: get(options, '0.interval.period.unit', 'MINUTES').toUpperCase(), }); + form.setFieldValue('adResultIndex', get(options, '0.resultIndex')); }, singleSelection: { asPlaintext: true }, isClearable: false, diff --git a/public/pages/CreateMonitor/containers/CreateMonitor/__snapshots__/CreateMonitor.test.js.snap b/public/pages/CreateMonitor/containers/CreateMonitor/__snapshots__/CreateMonitor.test.js.snap index b65783ed8..2edf2b131 100644 --- a/public/pages/CreateMonitor/containers/CreateMonitor/__snapshots__/CreateMonitor.test.js.snap +++ b/public/pages/CreateMonitor/containers/CreateMonitor/__snapshots__/CreateMonitor.test.js.snap @@ -11,6 +11,7 @@ exports[`CreateMonitor renders 1`] = ` { queryParams.interval && queryParams.unit ? { interval: parseInt(queryParams.interval), unit: queryParams.unit } : undefined, + adResultIndex: queryParams.adResultIndex || undefined, }; }; diff --git a/public/pages/CreateMonitor/containers/CreateMonitor/utils/monitorToFormik.js b/public/pages/CreateMonitor/containers/CreateMonitor/utils/monitorToFormik.js index a8c012159..9289d3e18 100644 --- a/public/pages/CreateMonitor/containers/CreateMonitor/utils/monitorToFormik.js +++ b/public/pages/CreateMonitor/containers/CreateMonitor/utils/monitorToFormik.js @@ -66,6 +66,7 @@ export default function monitorToFormik(monitor) { detectorId: isAD ? _.get(inputs, INPUTS_DETECTOR_ID) : undefined, index: inputs[0].search.indices.map((index) => ({ label: index })), + adResultIndex: isAD ? _.get(inputs, '0.search.indices.0') : undefined, query: JSON.stringify(inputs[0].search.query, null, 4), }; } diff --git a/release-notes/opensearch-alerting-dashboards-plugin.release-notes-1.2.0.0.md b/release-notes/opensearch-alerting-dashboards-plugin.release-notes-1.2.0.0.md index ce0b76fe2..d4bcf1f44 100644 --- a/release-notes/opensearch-alerting-dashboards-plugin.release-notes-1.2.0.0.md +++ b/release-notes/opensearch-alerting-dashboards-plugin.release-notes-1.2.0.0.md @@ -2,6 +2,9 @@ Compatible with OpenSearch Dashboards 1.2.0 +### Features +* support creating monitor for anomaly detector with custom result index ([#143](https://github.com/opensearch-project/alerting-dashboards-plugin/pull/143)) + ### Maintenance * Bumps version to 1.2 ([#128](https://github.com/opensearch-project/alerting-dashboards-plugin/pull/128)) * Added 1.2 release notes. ([#141](https://github.com/opensearch-project/alerting-dashboards-plugin/pull/141)) From 9c02e0d3579a6e48f81156c8526645e2b81f4387 Mon Sep 17 00:00:00 2001 From: AWSHurneyt <79280347+AWSHurneyt@users.noreply.github.com> Date: Fri, 17 Dec 2021 17:15:55 -0800 Subject: [PATCH 07/22] Bumping version to 1.3. Signed-off-by: AWSHurneyt (#159) Signed-off-by: AWSHurneyt <79280347+AWSHurneyt@users.noreply.github.com> Signed-off-by: AWSHurneyt --- .github/workflows/cypress-workflow.yml | 2 +- opensearch_dashboards.json | 4 ++-- package.json | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/cypress-workflow.yml b/.github/workflows/cypress-workflow.yml index 48a6f571c..dc177e033 100644 --- a/.github/workflows/cypress-workflow.yml +++ b/.github/workflows/cypress-workflow.yml @@ -8,7 +8,7 @@ on: - main env: OPENSEARCH_DASHBOARDS_VERSION: '1.x' - OPENSEARCH_VERSION: '1.2.0-SNAPSHOT' + OPENSEARCH_VERSION: '1.3.0-SNAPSHOT' jobs: tests: name: Run Cypress E2E tests diff --git a/opensearch_dashboards.json b/opensearch_dashboards.json index 72afca77c..5106d4272 100644 --- a/opensearch_dashboards.json +++ b/opensearch_dashboards.json @@ -1,7 +1,7 @@ { "id": "alertingDashboards", - "version": "1.2.0.0", - "opensearchDashboardsVersion": "1.2.0", + "version": "1.3.0.0", + "opensearchDashboardsVersion": "1.3.0", "configPath": ["opensearch_alerting"], "requiredPlugins": [], "server": true, diff --git a/package.json b/package.json index 320d5b6d4..5fad73ef2 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "opensearch-alerting-dashboards", - "version": "1.2.0.0", + "version": "1.3.0.0", "description": "OpenSearch Dashboards Alerting Plugin", "main": "index.js", "license": "Apache-2.0", From a85dec5d54892404fa6941ccf967b55a90d85dca Mon Sep 17 00:00:00 2001 From: CEHENKLE Date: Fri, 31 Dec 2021 07:28:12 -0800 Subject: [PATCH 08/22] initial commit (#150) Signed-off-by: CEHENKLE Signed-off-by: AWSHurneyt --- .github/CODEOWNERS | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 .github/CODEOWNERS diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS new file mode 100644 index 000000000..6ea02bfba --- /dev/null +++ b/.github/CODEOWNERS @@ -0,0 +1,2 @@ +# This should match the owning team set up in https://github.com/orgs/opensearch-project/teams +* @opensearch-project/alerting-plugin \ No newline at end of file From f15a3d10c3b1a08eaa2b53795984ccd111842701 Mon Sep 17 00:00:00 2001 From: "whitesource-for-github-com[bot]" <50673670+whitesource-for-github-com[bot]@users.noreply.github.com> Date: Thu, 13 Jan 2022 16:02:18 -0800 Subject: [PATCH 09/22] Add .whitesource configuration file (#153) Co-authored-by: whitesource-for-github-com[bot] <50673670+whitesource-for-github-com[bot]@users.noreply.github.com> Signed-off-by: AWSHurneyt --- .whitesource | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 .whitesource diff --git a/.whitesource b/.whitesource new file mode 100644 index 000000000..db4b0fec8 --- /dev/null +++ b/.whitesource @@ -0,0 +1,15 @@ +{ + "scanSettings": { + "configMode": "AUTO", + "configExternalURL": "", + "projectToken": "", + "baseBranches": [] + }, + "checkRunSettings": { + "vulnerableCheckRunConclusionLevel": "failure", + "displayMode": "diff" + }, + "issueSettings": { + "minSeverityLevel": "LOW" + } +} \ No newline at end of file From dab2efe73100e8dce31317ed7f614110551a080c Mon Sep 17 00:00:00 2001 From: AWSHurneyt <79280347+AWSHurneyt@users.noreply.github.com> Date: Thu, 27 Jan 2022 11:20:37 -0800 Subject: [PATCH 10/22] Implemented a toast to display successful attempts to acknowledge alerts. Refactored alerts dashboard flyout to refresh its alerts table when alerts are acknowledged. (#160) * Implemented unit and integ tests for the alerts dashboard flyout. Refactored AlertsDashboardFlyoutComponent::getBucketLevelGraphConditions to return a string with line breaks instead of an array of HTML elements. Signed-off-by: AWSHurneyt Signed-off-by: AWSHurneyt <79280347+AWSHurneyt@users.noreply.github.com> * Removed an unused test variable. Signed-off-by: AWSHurneyt <79280347+AWSHurneyt@users.noreply.github.com> * Removed debug logs. Signed-off-by: AWSHurneyt <79280347+AWSHurneyt@users.noreply.github.com> * Implemented unit test. Refactored integration tests to use fewer wait periods. Signed-off-by: AWSHurneyt <79280347+AWSHurneyt@users.noreply.github.com> * Examining flakiness in cypress test. Signed-off-by: AWSHurneyt <79280347+AWSHurneyt@users.noreply.github.com> * Added short wait period to flyout cypress tests to alleviate flakiness. Signed-off-by: AWSHurneyt <79280347+AWSHurneyt@users.noreply.github.com> * Refactored flyout cypress tests to use aliases. Signed-off-by: AWSHurneyt <79280347+AWSHurneyt@users.noreply.github.com> Signed-off-by: AWSHurneyt --- ...le_alerts_flyout_bucket_level_monitor.json | 134 +++ ...ple_alerts_flyout_query_level_monitor.json | 101 +++ .../alerts_dashboard_flyout_spec.js | 264 ++++++ .../__snapshots__/flyouts.test.js.snap | 40 + .../Flyout/flyouts/alertsDashboard.js | 229 +---- .../AlertsDashboardFlyoutComponent.js | 583 ++++++++++++ .../components/Flyout/flyouts/flyouts.test.js | 7 + .../DashboardControls/DashboardControls.js | 7 +- .../DashboardControls.test.js.snap | 1 + .../pages/Dashboard/containers/Dashboard.js | 177 ++-- .../__snapshots__/Dashboard.test.js.snap | 6 + public/pages/Dashboard/utils/helpers.js | 83 +- public/pages/Dashboard/utils/helpers.test.js | 848 ++++++++++++++++++ public/pages/Dashboard/utils/tableUtils.js | 34 +- .../Monitors/containers/Monitors/Monitors.js | 23 +- 15 files changed, 2181 insertions(+), 356 deletions(-) create mode 100644 cypress/fixtures/sample_alerts_flyout_bucket_level_monitor.json create mode 100644 cypress/fixtures/sample_alerts_flyout_query_level_monitor.json create mode 100644 cypress/integration/alerts_dashboard_flyout_spec.js create mode 100644 public/components/Flyout/flyouts/components/AlertsDashboardFlyoutComponent.js create mode 100644 public/pages/Dashboard/utils/helpers.test.js diff --git a/cypress/fixtures/sample_alerts_flyout_bucket_level_monitor.json b/cypress/fixtures/sample_alerts_flyout_bucket_level_monitor.json new file mode 100644 index 000000000..3647ed055 --- /dev/null +++ b/cypress/fixtures/sample_alerts_flyout_bucket_level_monitor.json @@ -0,0 +1,134 @@ +{ + "name": "sample_alerts_flyout_bucket_level_monitor", + "type": "monitor", + "monitor_type": "bucket_level_monitor", + "enabled": true, + "schedule": { + "period": { + "unit": "MINUTES", + "interval": 1 + } + }, + "inputs": [ + { + "search": { + "indices": ["opensearch_dashboards_sample_data_ecommerce"], + "query": { + "size": 0, + "aggregations": { + "composite_agg": { + "composite": { + "sources": [ + { + "customer_gender": { + "terms": { + "field": "customer_gender" + } + } + }, + { + "user": { + "terms": { + "field": "user" + } + } + } + ] + }, + "aggs": { + "avg_products_price": { + "avg": { + "field": "products.price" + } + } + } + } + }, + "query": { + "bool": { + "filter": [ + { + "range": { + "order_date": { + "gte": "{{period_end}}||-10d", + "lte": "{{period_end}}", + "format": "epoch_millis" + } + } + } + ] + } + } + } + } + } + ], + "triggers": [ + { + "bucket_level_trigger": { + "id": "JHpsfH0BYHgJ26-yS5n7", + "name": "sample_alerts_flyout_bucket_level_trigger", + "severity": "4", + "condition": { + "buckets_path": { + "_count": "_count", + "avg_products_price": "avg_products_price" + }, + "parent_bucket_path": "composite_agg", + "script": { + "source": "params._count < 10000 || params.avg_products_price == 10", + "lang": "painless" + }, + "gap_policy": "skip" + }, + "actions": [] + } + } + ], + "ui_metadata": { + "schedule": { + "timezone": null, + "frequency": "interval", + "period": { + "unit": "MINUTES", + "interval": 1 + }, + "daily": 0, + "weekly": { + "tue": false, + "wed": false, + "thur": false, + "sat": false, + "fri": false, + "mon": false, + "sun": false + }, + "monthly": { + "type": "day", + "day": 1 + }, + "cronExpression": "0 */1 * * *" + }, + "search": { + "searchType": "graph", + "timeField": "order_date", + "aggregations": [ + { + "aggregationType": "avg", + "fieldName": "products.price" + } + ], + "groupBy": ["customer_gender", "user"], + "bucketValue": 10, + "bucketUnitOfTime": "d", + "where": { + "fieldName": [], + "fieldRangeEnd": 0, + "fieldRangeStart": 0, + "fieldValue": "", + "operator": "is" + } + }, + "monitor_type": "bucket_level_monitor" + } +} diff --git a/cypress/fixtures/sample_alerts_flyout_query_level_monitor.json b/cypress/fixtures/sample_alerts_flyout_query_level_monitor.json new file mode 100644 index 000000000..ce9753d5e --- /dev/null +++ b/cypress/fixtures/sample_alerts_flyout_query_level_monitor.json @@ -0,0 +1,101 @@ +{ + "name": "sample_alerts_flyout_query_level_monitor", + "type": "monitor", + "monitor_type": "query_level_monitor", + "enabled": true, + "schedule": { + "period": { + "unit": "MINUTES", + "interval": 1 + } + }, + "inputs": [ + { + "search": { + "indices": ["opensearch_dashboards_sample_data_ecommerce"], + "query": { + "size": 0, + "aggregations": { + "terms_agg": { + "terms": { + "field": "user" + } + } + }, + "query": { + "bool": { + "filter": [ + { + "range": { + "order_date": { + "gte": "{{period_end}}||-10d", + "lte": "{{period_end}}", + "format": "epoch_millis" + } + } + } + ] + } + } + } + } + } + ], + "triggers": [ + { + "query_level_trigger": { + "id": "YHpufH0BYHgJ26-yhJm-", + "name": "sample_alerts_flyout_query_level_trigger", + "severity": "2", + "condition": { + "script": { + "source": "ctx.results[0].hits.total.value < 10000", + "lang": "painless" + } + }, + "actions": [] + } + } + ], + "ui_metadata": { + "schedule": { + "timezone": null, + "frequency": "interval", + "period": { + "unit": "MINUTES", + "interval": 1 + }, + "daily": 0, + "weekly": { + "tue": false, + "wed": false, + "thur": false, + "sat": false, + "fri": false, + "mon": false, + "sun": false + }, + "monthly": { + "type": "day", + "day": 1 + }, + "cronExpression": "0 */1 * * *" + }, + "search": { + "searchType": "graph", + "timeField": "order_date", + "aggregations": [], + "groupBy": ["user"], + "bucketValue": 10, + "bucketUnitOfTime": "d", + "where": { + "fieldName": [], + "fieldRangeEnd": 0, + "fieldRangeStart": 0, + "fieldValue": "", + "operator": "is" + } + }, + "monitor_type": "query_level_monitor" + } +} diff --git a/cypress/integration/alerts_dashboard_flyout_spec.js b/cypress/integration/alerts_dashboard_flyout_spec.js new file mode 100644 index 000000000..4c107ef71 --- /dev/null +++ b/cypress/integration/alerts_dashboard_flyout_spec.js @@ -0,0 +1,264 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + * + * Modifications Copyright OpenSearch Contributors. See + * GitHub history for details. + */ + +/* + * Copyright 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"). + * You may not use this file except in compliance with the License. + * A copy of the License is located at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * or in the "license" file accompanying this file. This file is distributed + * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + * express or implied. See the License for the specific language governing + * permissions and limitations under the License. + */ + +import React from 'react'; +import { INDEX, PLUGIN_NAME } from '../support/constants'; +import sampleAlertsFlyoutBucketMonitor from '../fixtures/sample_alerts_flyout_bucket_level_monitor.json'; +import sampleAlertsFlyoutQueryMonitor from '../fixtures/sample_alerts_flyout_query_level_monitor.json'; + +const BUCKET_MONITOR = 'sample_alerts_flyout_bucket_level_monitor'; +const BUCKET_TRIGGER = 'sample_alerts_flyout_bucket_level_trigger'; +const QUERY_MONITOR = 'sample_alerts_flyout_query_level_monitor'; +const QUERY_TRIGGER = 'sample_alerts_flyout_query_level_trigger'; + +const TWENTY_SECONDS = 20000; + +describe('Alerts by trigger flyout', () => { + before(() => { + // Delete any existing monitors + cy.deleteAllMonitors(); + + // Load sample data + cy.loadSampleEcommerceData(); + + // Create the test monitors + cy.createMonitor(sampleAlertsFlyoutBucketMonitor); + cy.createMonitor(sampleAlertsFlyoutQueryMonitor); + + // Visit Alerting OpenSearch Dashboards + cy.visit(`${Cypress.env('opensearch_dashboards')}/app/${PLUGIN_NAME}#/monitors`); + + // Confirm test monitors were created successfully + cy.contains(BUCKET_MONITOR, { timeout: TWENTY_SECONDS }); + cy.contains(QUERY_MONITOR, { timeout: TWENTY_SECONDS }); + + // Wait 1 minutes for the test monitors to trigger alerts, then go to the 'Alerts by trigger' dashboard page to view alerts + cy.wait(60000); + }); + + beforeEach(() => { + // Reloading the page to close any flyouts that were not closed by other tests that had failures. + cy.visit(`${Cypress.env('opensearch_dashboards')}/app/${PLUGIN_NAME}#/dashboard`); + + // Waiting 5 seconds for alerts to finish loading. + // This short wait period alleviates flakiness observed during these tests. + cy.wait(5000); + + // Confirm dashboard is displaying rows for the test monitors. + cy.contains(BUCKET_MONITOR, { timeout: TWENTY_SECONDS }); + cy.contains(QUERY_MONITOR, { timeout: TWENTY_SECONDS }); + }); + + it('Bucket-level monitor flyout test', () => { + // Click the link for the flyout. + cy.get(`[data-test-subj="euiLink_${BUCKET_TRIGGER}"]`).click(); + + // Perform the test checks within the flyout component. + cy.get(`[data-test-subj="alertsDashboardFlyout_${BUCKET_TRIGGER}"]`, { + timeout: TWENTY_SECONDS, + }).within(() => { + // Confirm flyout header contains expected text. + cy.get( + `[data-test-subj="alertsDashboardFlyout_header_${BUCKET_TRIGGER}"]` + ).contains(`Alerts by ${BUCKET_TRIGGER}`, { timeout: TWENTY_SECONDS }); + + // Confirm 'Trigger name' sections renders as expected. + cy.get(`[data-test-subj="alertsDashboardFlyout_triggerName_${BUCKET_TRIGGER}"]`).as( + 'triggerName' + ); + cy.get('@triggerName').contains('Trigger name'); + cy.get('@triggerName').contains(BUCKET_TRIGGER, { timeout: TWENTY_SECONDS }); + + // Confirm 'Severity' sections renders as expected. + cy.get(`[data-test-subj="alertsDashboardFlyout_severity_${BUCKET_TRIGGER}"]`).as('severity'); + cy.get('@severity').contains('Severity'); + cy.get('@severity').contains('4 (Low)', { timeout: TWENTY_SECONDS }); + + // Confirm 'Monitor' sections renders as expected. + cy.get(`[data-test-subj="alertsDashboardFlyout_monitor_${BUCKET_TRIGGER}"]`).as('monitor'); + cy.get('@monitor').contains('Monitor'); + cy.get('@monitor').contains(BUCKET_MONITOR, { timeout: TWENTY_SECONDS }); + + // Confirm 'Conditions' sections renders as expected. + cy.get(`[data-test-subj="alertsDashboardFlyout_conditions_${BUCKET_TRIGGER}"]`).as( + 'conditions' + ); + cy.get('@conditions').contains('Conditions'); + + // Confirm the 'Conditions' sections renders with all of the expected conditions. + ['params._count < 10000', 'OR', 'params.avg_products_price == 10'].forEach((entry) => + cy.get('@conditions').contains(entry, { timeout: TWENTY_SECONDS }) + ); + + // Confirm 'Time range for the last' sections renders as expected. + cy.get(`[data-test-subj="alertsDashboardFlyout_timeRange_${BUCKET_TRIGGER}"]`).as( + 'timeRange' + ); + cy.get('@timeRange').contains('Time range for the last'); + cy.get('@timeRange').contains('10 day(s)', { timeout: TWENTY_SECONDS }); + + // Confirm 'Filters' sections renders as expected. + cy.get(`[data-test-subj="alertsDashboardFlyout_filters_${BUCKET_TRIGGER}"]`).as('filters'); + cy.get('@filters').contains('Filters'); + cy.get('@filters').contains('All fields are included', { timeout: TWENTY_SECONDS }); + + // Confirm 'Group by' sections renders as expected. + cy.get(`[data-test-subj="alertsDashboardFlyout_groupBy_${BUCKET_TRIGGER}"]`).as('groupBy'); + cy.get('@groupBy').contains('Group by'); + cy.get('@groupBy').contains('customer_gender, user', { timeout: TWENTY_SECONDS }); + + // Set the 'severity' filter to only display ACTIVE alerts. + cy.get('[data-test-subj="dashboardAlertStateFilter"]').select('Active'); + + // This monitor configuration consistently returns 46 alerts when testing locally. + // Confirm the flyout dashboard contains more than 1 ACTIVE alert. + cy.get('tbody > tr', { timeout: TWENTY_SECONDS }).should(($tr) => + expect($tr).to.have.length.greaterThan(1) + ); + + // Select the first and last alerts in the table. + cy.get('input[data-test-subj^="checkboxSelectRow-"]').first().click(); + cy.get('input[data-test-subj^="checkboxSelectRow-"]').last().click(); + + // Press the flyout 'Acknowledge button, and wait for the AcknowledgeAlerts API call to complete. + cy.get('[data-test-subj="flyoutAcknowledgeAlertsButton"]').click(); + }); + + // Confirm acknowledge alerts toast displays expected text. + cy.contains('Successfully acknowledged 2 alerts.', { timeout: TWENTY_SECONDS }); + + // Confirm alerts were acknowledged as expected. + cy.get(`[data-test-subj="alertsDashboardFlyout_${BUCKET_TRIGGER}"]`).within(() => { + // Set the 'severity' filter to only display ACKNOWLEDGED alerts. + cy.get('[data-test-subj="dashboardAlertStateFilter"]').select('Acknowledged'); + + // Confirm the table displays 2 acknowledged alerts. + cy.get('tbody > tr', { timeout: TWENTY_SECONDS }).should(($tr) => + expect($tr).to.have.length(2) + ); + }); + + // Confirm close button hides the flyout. + cy.get(`[data-test-subj="alertsDashboardFlyout_closeButton_${BUCKET_TRIGGER}"]`).click(); + cy.contains(`[data-test-subj="alertsDashboardFlyout_${BUCKET_TRIGGER}"]`).should('not.exist'); + }); + + it('Query-level monitor flyout test', () => { + // Click the link for the flyout. + cy.get(`[data-test-subj="euiLink_${QUERY_TRIGGER}"]`).click(); + + // Perform the test checks within the flyout component. + cy.get(`[data-test-subj="alertsDashboardFlyout_${QUERY_TRIGGER}"]`, { + timeout: TWENTY_SECONDS, + }).within(() => { + // Confirm flyout header contains expected text. + cy.get( + `[data-test-subj="alertsDashboardFlyout_header_${QUERY_TRIGGER}"]` + ).contains(`Alerts by ${QUERY_TRIGGER}`, { timeout: TWENTY_SECONDS }); + + // Confirm 'Trigger name' sections renders as expected. + cy.get(`[data-test-subj="alertsDashboardFlyout_triggerName_${QUERY_TRIGGER}"]`).as( + 'triggerName' + ); + cy.get('@triggerName').contains('Trigger name'); + cy.get('@triggerName').contains(QUERY_TRIGGER, { timeout: TWENTY_SECONDS }); + + // Confirm 'Severity' sections renders as expected. + cy.get(`[data-test-subj="alertsDashboardFlyout_severity_${QUERY_TRIGGER}"]`).as('severity'); + cy.get('@severity').contains('Severity'); + cy.get('@severity').contains('2 (High)', { timeout: TWENTY_SECONDS }); + + // Confirm 'Monitor' sections renders as expected. + cy.get(`[data-test-subj="alertsDashboardFlyout_monitor_${QUERY_TRIGGER}"]`).as('monitor'); + cy.get('@monitor').contains('Monitor'); + cy.get('@monitor').contains(QUERY_MONITOR, { timeout: TWENTY_SECONDS }); + + // Confirm 'Conditions' sections renders as expected. + cy.get(`[data-test-subj="alertsDashboardFlyout_conditions_${QUERY_TRIGGER}"]`).as( + 'conditions' + ); + cy.get('@conditions').contains('Condition'); + cy.get('@conditions').contains(`ctx.results[0].hits.total.value < 10000`, { + timeout: TWENTY_SECONDS, + }); + + // Confirm 'Time range for the last' sections renders as expected. + cy.get(`[data-test-subj="alertsDashboardFlyout_timeRange_${QUERY_TRIGGER}"]`).as('timeRange'); + cy.get('@timeRange').contains('Time range for the last'); + cy.get('@timeRange').contains('10 day(s)', { timeout: TWENTY_SECONDS }); + + // Confirm 'Filters' sections renders as expected. + cy.get(`[data-test-subj="alertsDashboardFlyout_filters_${QUERY_TRIGGER}"]`).as('filters'); + cy.get('@filters').contains('Filters'); + cy.get('@filters').contains('-', { timeout: TWENTY_SECONDS }); + + // Confirm 'Group by' sections renders as expected. + cy.get(`[data-test-subj="alertsDashboardFlyout_groupBy_${QUERY_TRIGGER}"]`).as('groupBy'); + cy.get('@groupBy').contains('Group by'); + cy.get('@groupBy').contains('user', { timeout: TWENTY_SECONDS }); + + // Set the 'severity' filter to only display ACTIVE alerts. + cy.get('[data-test-subj="dashboardAlertStateFilter"]').select('Active'); + + // Confirm the flyout dashboard contains 1 alert. + cy.get('tbody > tr', { timeout: TWENTY_SECONDS }).should(($tr) => + expect($tr).to.have.length(1) + ); + + // Select the alert. + cy.get('input[data-test-subj^="checkboxSelectRow-"]').first().click(); + + // Press the flyout 'Acknowledge button, and wait for the AcknowledgeAlerts API call to complete. + cy.get('[data-test-subj="flyoutAcknowledgeAlertsButton"]').click(); + }); + + // Confirm acknowledge alerts toast displays expected text. + cy.contains('Successfully acknowledged 1 alert.', { timeout: TWENTY_SECONDS }); + + // Confirm alerts were acknowledged as expected. + cy.get(`[data-test-subj="alertsDashboardFlyout_${QUERY_TRIGGER}"]`).within(() => { + // Set the 'severity' filter to only display ACKNOWLEDGED alerts. + cy.get('[data-test-subj="dashboardAlertStateFilter"]').select('Acknowledged'); + + // Confirm the table displays 1 acknowledged alert. + cy.get('tbody > tr', { timeout: TWENTY_SECONDS }).should(($tr) => + expect($tr).to.have.length(1) + ); + }); + + // Confirm close button hides the flyout. + cy.get(`[data-test-subj="alertsDashboardFlyout_closeButton_${QUERY_TRIGGER}"]`).click(); + cy.contains(`[data-test-subj="alertsDashboardFlyout_${QUERY_TRIGGER}"]`).should('not.exist'); + }); + + after(() => { + // Delete all monitors + cy.deleteAllMonitors(); + + // Delete sample data + cy.deleteIndexByName(`${INDEX.SAMPLE_DATA_ECOMMERCE}`); + }); +}); diff --git a/public/components/Flyout/flyouts/__snapshots__/flyouts.test.js.snap b/public/components/Flyout/flyouts/__snapshots__/flyouts.test.js.snap index 0fc5f3de4..4e8e406d6 100644 --- a/public/components/Flyout/flyouts/__snapshots__/flyouts.test.js.snap +++ b/public/components/Flyout/flyouts/__snapshots__/flyouts.test.js.snap @@ -1,5 +1,45 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP +exports[`Flyouts.alertsDashboard generates message JSON 1`] = ` +Object { + "body": , + "flyoutProps": Object { + "aria-labelledby": "alertsDashboardFlyout", + "data-test-subj": "alertsDashboardFlyout_undefined", + "hideCloseButton": true, + "size": "m", + }, + "footer": + Close + , + "footerProps": Object { + "style": Object { + "backgroundColor": "#F5F7FA", + }, + }, + "header": +

      + Alerts by undefined +

      +
      , + "headerProps": Object { + "hasBorder": true, + }, +} +`; + exports[`Flyouts.message generates message JSON 1`] = ` Object { "body": { - let conditions = _.get(trigger, 'condition.script.source', '-'); - conditions = _.replace(conditions, ' && ', '&AND&'); - conditions = _.replace(conditions, ' || ', '&OR&'); - conditions = conditions.split(/&/); - return conditions.map((condition, index) => { - return ( -

      - {condition} -

      - ); - }); -}; - -const getSeverityText = (severity) => { - return _.get(_.find(SEVERITY_OPTIONS, { value: severity }), 'text'); -}; - -const getBucketLevelGraphFilter = (trigger) => { - const compositeAggFilter = _.get(trigger, 'condition.composite_agg_filter'); - if (_.isEmpty(compositeAggFilter)) return DEFAULT_WHERE_EXPRESSION_TEXT; - const keyword = _.keys(compositeAggFilter)[0]; - const operator = _.keys(compositeAggFilter[keyword])[0]; - const value = _.get(compositeAggFilter, `${keyword}.${operator}`); - return `${keyword} ${_.upperCase(operator)}S ${value}`; -}; +import { EuiButtonEmpty, EuiText } from '@elastic/eui'; +import AlertsDashboardFlyoutComponent from './components/AlertsDashboardFlyoutComponent'; const alertsDashboard = (payload) => { - const { - alerts, - history, - httpClient, - last_notification_time, - loadingMonitors, - location, - monitors, - monitor_id, - monitor_name, - notifications, - setFlyout, - start_time, - triggerID, - trigger_name, - } = payload; - const monitor = _.get(_.find(monitors, { _id: monitor_id }), '_source'); - const monitorType = _.get(monitor, 'monitor_type', MONITOR_TYPE.QUERY_LEVEL); - const searchType = _.get(monitor, 'ui_metadata.search.searchType', SEARCH_TYPE.GRAPH); - const detectorId = _.get(monitor, MONITOR_INPUT_DETECTOR_ID); - - const triggerType = - monitorType === MONITOR_TYPE.QUERY_LEVEL ? TRIGGER_TYPE.QUERY_LEVEL : TRIGGER_TYPE.BUCKET_LEVEL; - - let trigger = _.get(monitor, 'triggers', []).find((trigger) => { - return trigger[triggerType].id === triggerID; - }); - trigger = _.get(trigger, triggerType); - - const severity = _.get(trigger, 'severity'); - const groupBy = _.get(monitor, MONITOR_GROUP_BY); - - const condition = - monitorType === MONITOR_TYPE.BUCKET_LEVEL && searchType === SEARCH_TYPE.GRAPH - ? getBucketLevelGraphConditions(trigger) - : _.get(trigger, 'condition.script.source', '-'); - - const filters = - monitorType === MONITOR_TYPE.BUCKET_LEVEL && searchType === SEARCH_TYPE.GRAPH - ? getBucketLevelGraphFilter(trigger) - : '-'; - - const bucketValue = _.get(monitor, 'ui_metadata.search.bucketValue'); - let bucketUnitOfTime = _.get(monitor, 'ui_metadata.search.bucketUnitOfTime'); - UNITS_OF_TIME.map((entry) => { - if (entry.value === bucketUnitOfTime) bucketUnitOfTime = entry.text; - }); - const timeRangeForLast = - bucketValue !== undefined && !_.isEmpty(bucketUnitOfTime) - ? `${bucketValue} ${bucketUnitOfTime}` - : '-'; - + const { closeFlyout, trigger_name } = payload; return { flyoutProps: { 'aria-labelledby': 'alertsDashboardFlyout', size: 'm', hideCloseButton: true, + 'data-test-subj': `alertsDashboardFlyout_${trigger_name}`, }, headerProps: { hasBorder: true }, header: ( - +

      {`Alerts by ${trigger_name}`}

      ), @@ -147,127 +47,14 @@ const alertsDashboard = (payload) => { footer: ( setFlyout(null)} + onClick={() => closeFlyout()} style={{ paddingLeft: '0px', marginLeft: '0px' }} + data-test-subj={`alertsDashboardFlyout_closeButton_${trigger_name}`} > Close ), - body: ( -
      - - - - Trigger name -

      {trigger_name}

      -
      -
      - - - Severity -

      {getSeverityText(severity) || severity || '-'}

      -
      -
      -
      - - - - - - - Trigger start time -

      {getTime(start_time)}

      -
      -
      - - - Trigger last updated -

      {getTime(last_notification_time)}

      -
      -
      -
      - - - - - - - Monitor -

      - {monitor_name} -

      -
      -
      -
      - - - - - - - {_.isArray(condition) ? 'Conditions' : 'Condition'} - {loadingMonitors ? ( - 'Loading conditions...' - ) : _.isArray(condition) ? ( - condition - ) : ( -

      {condition}

      - )} -
      -
      - - - Time range for the last -

      {timeRangeForLast}

      -
      -
      -
      - - - - - - - Filters -

      {loadingMonitors ? 'Loading filters...' : filters}

      -
      -
      - - - Group by -

      - {loadingMonitors - ? 'Loading groups...' - : !_.isEmpty(groupBy) - ? _.join(_.orderBy(groupBy), ', ') - : '-'} -

      -
      -
      -
      - - - - - - - - - -
      - ), + body: , }; }; diff --git a/public/components/Flyout/flyouts/components/AlertsDashboardFlyoutComponent.js b/public/components/Flyout/flyouts/components/AlertsDashboardFlyoutComponent.js new file mode 100644 index 000000000..d8c1619b7 --- /dev/null +++ b/public/components/Flyout/flyouts/components/AlertsDashboardFlyoutComponent.js @@ -0,0 +1,583 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + * + * Modifications Copyright OpenSearch Contributors. See + * GitHub history for details. + */ + +/* + * Copyright 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"). + * You may not use this file except in compliance with the License. + * A copy of the License is located at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * or in the "license" file accompanying this file. This file is distributed + * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + * express or implied. See the License for the specific language governing + * permissions and limitations under the License. + */ + +import React, { Component } from 'react'; +import _ from 'lodash'; +import { + EuiBasicTable, + EuiButton, + EuiFlexGroup, + EuiFlexItem, + EuiHorizontalRule, + EuiIcon, + EuiLink, + EuiSpacer, + EuiText, +} from '@elastic/eui'; +import { getTime } from '../../../../pages/MonitorDetails/components/MonitorOverview/utils/getOverviewStats'; +import { PLUGIN_NAME } from '../../../../../utils/constants'; +import { + ALERT_STATE, + MONITOR_GROUP_BY, + MONITOR_INPUT_DETECTOR_ID, + MONITOR_TYPE, + OPENSEARCH_DASHBOARDS_AD_PLUGIN, + SEARCH_TYPE, +} from '../../../../utils/constants'; +import { TRIGGER_TYPE } from '../../../../pages/CreateTrigger/containers/CreateTrigger/utils/constants'; +import { SEVERITY_OPTIONS } from '../../../../pages/CreateTrigger/containers/DefineTrigger/DefineTrigger'; +import { UNITS_OF_TIME } from '../../../../pages/CreateMonitor/components/MonitorExpressions/expressions/utils/constants'; +import { DEFAULT_WHERE_EXPRESSION_TEXT } from '../../../../pages/CreateMonitor/components/MonitorExpressions/expressions/utils/whereHelpers'; +import { backendErrorNotification } from '../../../../utils/helpers'; +import { + displayAcknowledgedAlertsToast, + filterActiveAlerts, + getQueryObjectFromState, + getURLQueryParams, + insertGroupByColumn, + removeColumns, +} from '../../../../pages/Dashboard/utils/helpers'; +import DashboardControls from '../../../../pages/Dashboard/components/DashboardControls'; +import ContentPanel from '../../../ContentPanel'; +import { queryColumns } from '../../../../pages/Dashboard/utils/tableUtils'; +import { DEFAULT_PAGE_SIZE_OPTIONS } from '../../../../pages/Monitors/containers/Monitors/utils/constants'; +import queryString from 'query-string'; +import { MAX_ALERT_COUNT } from '../../../../pages/Dashboard/utils/constants'; + +export const DEFAULT_NUM_FLYOUT_ROWS = 10; + +export default class AlertsDashboardFlyoutComponent extends Component { + constructor(props) { + super(props); + const { location, monitor_id } = this.props; + + const { + alertState, + from, + search, + severityLevel, + size, + sortDirection, + sortField, + } = getURLQueryParams(location); + + this.state = { + alerts: [], + alertState: alertState, + loading: true, + monitors: [], + monitorIds: [monitor_id], + page: Math.floor(from / size), + search: search, + selectable: true, + selectedItems: [], + severityLevel: severityLevel, + size: DEFAULT_NUM_FLYOUT_ROWS, + sortDirection: sortDirection, + sortField: sortField, + totalAlerts: 0, + }; + } + + componentDidMount() { + const { + alertState, + page, + search, + severityLevel, + size, + sortDirection, + sortField, + monitorIds, + } = this.state; + this.getAlerts( + page * size, + size, + search, + sortField, + sortDirection, + severityLevel, + alertState, + monitorIds + ); + } + + componentDidUpdate(prevProps, prevState) { + const prevQuery = getQueryObjectFromState(prevState); + const currQuery = getQueryObjectFromState(this.state); + if (!_.isEqual(prevQuery, currQuery)) { + const { + page, + size, + search, + sortField, + sortDirection, + severityLevel, + alertState, + monitorIds, + } = this.state; + this.getAlerts( + page * size, + size, + search, + sortField, + sortDirection, + severityLevel, + alertState, + monitorIds + ); + } + } + + getBucketLevelGraphConditions = (trigger) => { + let conditions = _.get(trigger, 'condition.script.source', '-'); + conditions = _.replace(conditions, ' && ', '&AND&'); + conditions = _.replace(conditions, ' || ', '&OR&'); + conditions = conditions.split(/&/); + return conditions.join('\n'); + }; + + getSeverityText = (severity) => { + return _.get(_.find(SEVERITY_OPTIONS, { value: severity }), 'text'); + }; + + getBucketLevelGraphFilter = (trigger) => { + const compositeAggFilter = _.get(trigger, 'condition.composite_agg_filter'); + if (_.isEmpty(compositeAggFilter)) return DEFAULT_WHERE_EXPRESSION_TEXT; + const keyword = _.keys(compositeAggFilter)[0]; + const operator = _.keys(compositeAggFilter[keyword])[0]; + const value = _.get(compositeAggFilter, `${keyword}.${operator}`); + return `${keyword} ${_.upperCase(operator)}S ${value}`; + }; + + getAlerts = async () => { + this.setState({ ...this.state, loading: true }); + const { + from, + search, + sortField, + sortDirection, + severityLevel, + alertState, + monitorIds, + } = this.state; + + const { httpClient, history, notifications, triggerID } = this.props; + + const params = { + from, + size: MAX_ALERT_COUNT, + search, + sortField, + sortDirection, + severityLevel, + alertState, + monitorIds, + }; + + const queryParamsString = queryString.stringify(params); + history.replace({ ...this.props.location, search: queryParamsString }); + + httpClient.get('../api/alerting/alerts', { query: params }).then((resp) => { + if (resp.ok) { + const { alerts } = resp; + const filteredAlerts = _.filter(alerts, { trigger_id: triggerID }); + this.setState({ + ...this.state, + alerts: filteredAlerts, + totalAlerts: filteredAlerts.length, + }); + } else { + console.log('error getting alerts:', resp); + backendErrorNotification(notifications, 'get', 'alerts', resp.err); + } + }); + + this.setState({ ...this.state, loading: false }); + }; + + acknowledgeAlerts = async () => { + const { selectedItems } = this.state; + const { httpClient, notifications } = this.props; + + if (!selectedItems.length) return; + + const selectedAlerts = filterActiveAlerts(selectedItems); + + const monitorAlerts = selectedAlerts.reduce((monitorAlerts, alert) => { + const { id, monitor_id: monitorId } = alert; + if (monitorAlerts[monitorId]) monitorAlerts[monitorId].push(id); + else monitorAlerts[monitorId] = [id]; + return monitorAlerts; + }, {}); + + Object.entries(monitorAlerts).map(([monitorId, alerts]) => + httpClient + .post(`../api/alerting/monitors/${monitorId}/_acknowledge/alerts`, { + body: JSON.stringify({ alerts }), + }) + .then((resp) => { + if (!resp.ok) { + backendErrorNotification(notifications, 'acknowledge', 'alert', resp.resp); + } else { + const successfulCount = _.get(resp, 'resp.success', []).length; + displayAcknowledgedAlertsToast(notifications, successfulCount); + } + }) + .catch((error) => error) + ); + + const { + page, + size, + search, + sortField, + sortDirection, + severityLevel, + alertState, + monitorIds, + } = this.state; + await this.getAlerts( + page * size, + size, + search, + sortField, + sortDirection, + severityLevel, + alertState, + monitorIds + ); + this.setState({ ...this.state, selectedItems: [] }); + this.props.refreshDashboard(); + }; + + onAlertStateChange = (e) => { + this.setState({ page: 0, alertState: e.target.value }); + }; + + onPageClick = (page) => { + this.setState({ page }); + }; + + onSearchChange = (e) => { + this.setState({ page: 0, search: e.target.value }); + }; + + onSelectionChange = (selectedItems) => { + this.setState({ selectedItems }); + }; + + onTableChange = ({ page: tablePage = {}, sort = {} }) => { + const { index: page, size } = tablePage; + + const { field: sortField, direction: sortDirection } = sort; + this.setState({ + page, + size, + sortField, + sortDirection, + }); + + const { alerts } = this.props; + this.setState({ alerts }); + }; + + render() { + const { + last_notification_time, + loadingMonitors, + monitors, + monitor_id, + monitor_name, + start_time, + triggerID, + trigger_name, + } = this.props; + const monitor = _.get(_.find(monitors, { _id: monitor_id }), '_source'); + const monitorType = _.get(monitor, 'monitor_type', MONITOR_TYPE.QUERY_LEVEL); + const searchType = _.get(monitor, 'ui_metadata.search.searchType', SEARCH_TYPE.GRAPH); + const detectorId = _.get(monitor, MONITOR_INPUT_DETECTOR_ID); + + const triggerType = + monitorType === MONITOR_TYPE.QUERY_LEVEL + ? TRIGGER_TYPE.QUERY_LEVEL + : TRIGGER_TYPE.BUCKET_LEVEL; + + let trigger = _.get(monitor, 'triggers', []).find((trigger) => { + return trigger[triggerType].id === triggerID; + }); + trigger = _.get(trigger, triggerType); + + const severity = _.get(trigger, 'severity'); + const groupBy = _.get(monitor, MONITOR_GROUP_BY); + + const condition = + monitorType === MONITOR_TYPE.BUCKET_LEVEL && searchType === SEARCH_TYPE.GRAPH + ? this.getBucketLevelGraphConditions(trigger) + : _.get(trigger, 'condition.script.source', '-'); + + const filters = + monitorType === MONITOR_TYPE.BUCKET_LEVEL && searchType === SEARCH_TYPE.GRAPH + ? this.getBucketLevelGraphFilter(trigger) + : '-'; + + const bucketValue = _.get(monitor, 'ui_metadata.search.bucketValue'); + let bucketUnitOfTime = _.get(monitor, 'ui_metadata.search.bucketUnitOfTime'); + UNITS_OF_TIME.map((entry) => { + if (entry.value === bucketUnitOfTime) bucketUnitOfTime = entry.text; + }); + const timeRangeForLast = + bucketValue !== undefined && !_.isEmpty(bucketUnitOfTime) + ? `${bucketValue} ${bucketUnitOfTime}` + : '-'; + + const actions = () => { + const { selectedItems } = this.state; + const actions = [ + + Acknowledge + , + ]; + if (!_.isEmpty(detectorId)) { + actions.unshift( + + View detector + + ); + } + return actions; + }; + + const getItemId = (item) => { + switch (monitorType) { + case MONITOR_TYPE.QUERY_LEVEL: + return `${item.id}-${item.version}`; + case MONITOR_TYPE.BUCKET_LEVEL: + return item.id; + } + }; + + const { + alerts, + alertState, + loading, + page, + search, + selectable, + severityLevel, + size, + sortDirection, + sortField, + totalAlerts, + } = this.state; + + const columnType = () => { + let columns = []; + switch (monitorType) { + case MONITOR_TYPE.QUERY_LEVEL: + columns = queryColumns; + break; + case MONITOR_TYPE.BUCKET_LEVEL: + columns = insertGroupByColumn(groupBy); + break; + } + return removeColumns(['severity', 'trigger_name'], columns); + }; + + const pagination = { + pageIndex: page, + pageSize: size, + totalItemCount: totalAlerts, + pageSizeOptions: DEFAULT_PAGE_SIZE_OPTIONS, + }; + + const selection = { + onSelectionChange: this.onSelectionChange, + selectable: (item) => item.state === ALERT_STATE.ACTIVE, + selectableMessage: (selectable) => + selectable ? undefined : 'Only active alerts can be acknowledged.', + }; + + const sorting = { + sort: { + direction: sortDirection, + field: sortField, + }, + }; + + const trimmedAlerts = alerts.slice(page * size, page * size + size); + + return ( +
      + + + + Trigger name +

      {trigger_name}

      +
      +
      + + + Severity +

      {this.getSeverityText(severity) || severity || '-'}

      +
      +
      +
      + + + + + + + Trigger start time +

      {getTime(start_time)}

      +
      +
      + + + Trigger last updated +

      {getTime(last_notification_time)}

      +
      +
      +
      + + + + + + + Monitor +

      + {monitor_name} +

      +
      +
      +
      + + + + + + + + {monitorType === MONITOR_TYPE.BUCKET_LEVEL ? 'Conditions' : 'Condition'} + +

      + {loadingMonitors || loading ? 'Loading conditions...' : condition} +

      +
      +
      + + + Time range for the last +

      {timeRangeForLast}

      +
      +
      +
      + + + + + + + Filters +

      {loadingMonitors || loading ? 'Loading filters...' : filters}

      +
      +
      + + + Group by +

      + {loadingMonitors || loading + ? 'Loading groups...' + : !_.isEmpty(groupBy) + ? _.join(_.orderBy(groupBy), ', ') + : '-'} +

      +
      +
      +
      + + + + + + + + + + + + + + + +
      + ); + } +} diff --git a/public/components/Flyout/flyouts/flyouts.test.js b/public/components/Flyout/flyouts/flyouts.test.js index 926e0c05b..1f500d855 100644 --- a/public/components/Flyout/flyouts/flyouts.test.js +++ b/public/components/Flyout/flyouts/flyouts.test.js @@ -47,3 +47,10 @@ describe('Flyouts.triggerCondition', () => { expect(json).toMatchSnapshot(); }); }); + +describe('Flyouts.alertsDashboard', () => { + test('generates message JSON', () => { + const json = Flyouts.alertsDashboard({}); + expect(json).toMatchSnapshot(); + }); +}); diff --git a/public/pages/Dashboard/components/DashboardControls/DashboardControls.js b/public/pages/Dashboard/components/DashboardControls/DashboardControls.js index 645f6e636..3b728921a 100644 --- a/public/pages/Dashboard/components/DashboardControls/DashboardControls.js +++ b/public/pages/Dashboard/components/DashboardControls/DashboardControls.js @@ -75,7 +75,12 @@ const DashboardControls = ({ )} - + diff --git a/public/pages/Dashboard/components/DashboardControls/__snapshots__/DashboardControls.test.js.snap b/public/pages/Dashboard/components/DashboardControls/__snapshots__/DashboardControls.test.js.snap index 03257100b..32801493a 100644 --- a/public/pages/Dashboard/components/DashboardControls/__snapshots__/DashboardControls.test.js.snap +++ b/public/pages/Dashboard/components/DashboardControls/__snapshots__/DashboardControls.test.js.snap @@ -103,6 +103,7 @@ exports[`DashboardControls renders 1`] = ` > { const triggerID = alert.trigger_id; @@ -39,7 +40,6 @@ export function groupAlertsByTrigger(alerts) { : addFirstAlert(alert); alertsByTriggers.set(triggerID, newAlertList); }); - return Array.from(alertsByTriggers, ([triggerID, alerts]) => ({ ...alerts, triggerID })); } @@ -69,6 +69,7 @@ export function addFirstAlert(firstAlert) { monitor_id, }; } + export function addAlert(alertList, newAlert) { const state = newAlert.state; alertList[state]++; @@ -87,7 +88,7 @@ export const renderEmptyValue = (value) => { return value === undefined ? DEFAULT_EMPTY_DATA : value; }; -export function insertGroupByColumn(groupBy) { +export function insertGroupByColumn(groupBy = []) { let result = _.cloneDeep(bucketColumns); groupBy.map((fieldName) => result.splice(0, 0, { @@ -101,14 +102,70 @@ export function insertGroupByColumn(groupBy) { return result; } -export function removeColumns(columnFieldNames = [], allColumns) { - return allColumns.filter((column) => { - return !_.includes(columnFieldNames, column.field); - }); +export function removeColumns(columnFieldNames = [], allColumns = []) { + return allColumns.filter((column) => !_.includes(columnFieldNames, column.field)); +} + +export function getInitialSize( + perAlertView = false, + defaultSize = DEFAULT_GET_ALERTS_QUERY_PARAMS.size +) { + return perAlertView && defaultSize >= 0 ? defaultSize : MAX_ALERT_COUNT; +} + +export function displayAcknowledgedAlertsToast(notifications, successfulCount = 0) { + const successfulText = `Successfully acknowledged ${successfulCount} ${ + successfulCount === 1 ? 'alert' : 'alerts' + }.`; + if (successfulCount > 0) notifications.toasts.addSuccess(successfulText); +} + +export function filterActiveAlerts(alerts = []) { + return _.filter(alerts, { state: ALERT_STATE.ACTIVE }); } -export function getInitialSize(isAlertsFlyout, perAlertView, defaultSize) { - if (!perAlertView) return MAX_ALERT_COUNT; - if (isAlertsFlyout) return DEFAULT_NUM_FLYOUT_ROWS; - return defaultSize; +export function getQueryObjectFromState({ + page, + size, + search, + sortField, + sortDirection, + severityLevel, + alertState, + monitorIds, + flyoutIsOpen, +}) { + return { + page, + size, + search, + sortField, + sortDirection, + severityLevel, + alertState, + monitorIds, + flyoutIsOpen, + }; +} + +export function getURLQueryParams(location) { + const { + from = DEFAULT_GET_ALERTS_QUERY_PARAMS.from, + size = DEFAULT_GET_ALERTS_QUERY_PARAMS.size, + search = DEFAULT_GET_ALERTS_QUERY_PARAMS.search, + sortField = DEFAULT_GET_ALERTS_QUERY_PARAMS.sortField, + sortDirection = DEFAULT_GET_ALERTS_QUERY_PARAMS.sortDirection, + severityLevel = DEFAULT_GET_ALERTS_QUERY_PARAMS.severityLevel, + alertState = DEFAULT_GET_ALERTS_QUERY_PARAMS.alertState, + } = queryString.parse(location.search); + + return { + from: isNaN(parseInt(from, 10)) ? DEFAULT_GET_ALERTS_QUERY_PARAMS.from : parseInt(from, 10), + size: isNaN(parseInt(size, 10)) ? DEFAULT_GET_ALERTS_QUERY_PARAMS.size : parseInt(size, 10), + search, + sortField, + sortDirection, + severityLevel, + alertState, + }; } diff --git a/public/pages/Dashboard/utils/helpers.test.js b/public/pages/Dashboard/utils/helpers.test.js new file mode 100644 index 000000000..8188572c8 --- /dev/null +++ b/public/pages/Dashboard/utils/helpers.test.js @@ -0,0 +1,848 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + * + * Modifications Copyright OpenSearch Contributors. See + * GitHub history for details. + */ + +/* + * Copyright 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"). + * You may not use this file except in compliance with the License. + * A copy of the License is located at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * or in the "license" file accompanying this file. This file is distributed + * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + * express or implied. See the License for the specific language governing + * permissions and limitations under the License. + */ + +import _ from 'lodash'; +import { + addAlert, + addFirstAlert, + displayAcknowledgedAlertsToast, + filterActiveAlerts, + getInitialSize, + getQueryObjectFromState, + getURLQueryParams, + groupAlertsByTrigger, + insertGroupByColumn, + removeColumns, + renderEmptyValue, +} from './helpers'; +import { ALERT_STATE, DEFAULT_EMPTY_DATA } from '../../../utils/constants'; +import { bucketColumns } from './tableUtils'; +import { DEFAULT_GET_ALERTS_QUERY_PARAMS, MAX_ALERT_COUNT } from './constants'; +import coreMock from '../../../../test/mocks/CoreMock'; + +describe('Dashboard/utils/helpers', () => { + describe('groupAlertsByTrigger', () => { + test('with empty alerts list', () => { + const alerts = []; + const expectedOutput = []; + expect(groupAlertsByTrigger(alerts)).toEqual(expectedOutput); + }); + + test('with undefined alerts list', () => { + const alerts = undefined; + const expectedOutput = []; + expect(groupAlertsByTrigger(alerts)).toEqual(expectedOutput); + }); + + test('with valid alerts list', () => { + const alerts = [ + { + id: 'bucket-monitor-trigger1-alert1', + monitor_name: 'bucket-monitor', + trigger_id: 'bucket-monitor-trigger1-id', + trigger_name: 'bucket-monitor-trigger1', + state: 'ACTIVE', + start_time: 1638360000000, + end_time: null, + agg_alert_content: { + parent_bucket_path: 'composite_agg', + bucket_keys: ['groupBy1KeywordValue', 'groupBy2KeywordValue'], + bucket: { + doc_count: 10, + field1: { + value: 100, + }, + field2: { + value: 200, + }, + key: { + groupBy1: 'groupBy1Keyword', + groupBy2: 'groupBy2Keyword', + }, + }, + }, + }, + { + id: 'bucket-monitor-trigger1-alert2', + monitor_name: 'bucket-monitor', + trigger_id: 'bucket-monitor-trigger1-id', + trigger_name: 'bucket-monitor-trigger1', + state: 'ACTIVE', + start_time: 1638360000000, + end_time: null, + agg_alert_content: { + parent_bucket_path: 'composite_agg', + bucket_keys: ['groupBy1KeywordValue', 'groupBy2KeywordValue'], + bucket: { + doc_count: 10, + field1: { + value: 100, + }, + field2: { + value: 200, + }, + key: { + groupBy1: 'groupBy1Keyword', + groupBy2: 'groupBy2Keyword', + }, + }, + }, + }, + { + id: 'bucket-monitor-trigger2-alert1', + monitor_name: 'bucket-monitor', + trigger_id: 'bucket-monitor-trigger2-id', + trigger_name: 'bucket-monitor-trigger2', + state: 'ACTIVE', + start_time: 1638361800000, + end_time: null, + agg_alert_content: { + parent_bucket_path: 'composite_agg', + bucket_keys: ['groupBy1KeywordValue', 'groupBy2KeywordValue'], + bucket: { + doc_count: 10, + field1: { + value: 100, + }, + field2: { + value: 200, + }, + key: { + groupBy1: 'groupBy1Keyword', + groupBy2: 'groupBy2Keyword', + }, + }, + }, + }, + { + id: 'query-monitor-trigger1-alert1', + monitor_name: 'query-monitor', + trigger_id: 'query-monitor-trigger1-id', + trigger_name: 'query-monitor-trigger1', + state: 'ACTIVE', + start_time: 1638360000000, + end_time: null, + }, + { + id: 'query-monitor-trigger2-alert1', + monitor_name: 'query-monitor', + trigger_id: 'query-monitor-trigger2-id', + trigger_name: 'query-monitor-trigger2', + state: 'ACTIVE', + start_time: 1638361800000, + end_time: null, + }, + ]; + const expectedOutput = [ + { + ACTIVE: 2, + ACKNOWLEDGED: 0, + ERROR: 0, + total: 2, + alerts: [ + { + id: 'bucket-monitor-trigger1-alert1', + monitor_name: 'bucket-monitor', + trigger_id: 'bucket-monitor-trigger1-id', + trigger_name: 'bucket-monitor-trigger1', + state: 'ACTIVE', + start_time: 1638360000000, + end_time: null, + agg_alert_content: { + parent_bucket_path: 'composite_agg', + bucket_keys: ['groupBy1KeywordValue', 'groupBy2KeywordValue'], + bucket: { + doc_count: 10, + field1: { + value: 100, + }, + field2: { + value: 200, + }, + key: { + groupBy1: 'groupBy1Keyword', + groupBy2: 'groupBy2Keyword', + }, + }, + }, + }, + { + id: 'bucket-monitor-trigger1-alert2', + monitor_name: 'bucket-monitor', + trigger_id: 'bucket-monitor-trigger1-id', + trigger_name: 'bucket-monitor-trigger1', + state: 'ACTIVE', + start_time: 1638360000000, + end_time: null, + agg_alert_content: { + parent_bucket_path: 'composite_agg', + bucket_keys: ['groupBy1KeywordValue', 'groupBy2KeywordValue'], + bucket: { + doc_count: 10, + field1: { + value: 100, + }, + field2: { + value: 200, + }, + key: { + groupBy1: 'groupBy1Keyword', + groupBy2: 'groupBy2Keyword', + }, + }, + }, + }, + ], + trigger_name: 'bucket-monitor-trigger1', + start_time: 1638360000000, + monitor_name: 'bucket-monitor', + triggerID: 'bucket-monitor-trigger1-id', + }, + { + ACTIVE: 1, + ACKNOWLEDGED: 0, + ERROR: 0, + total: 1, + alerts: [ + { + id: 'bucket-monitor-trigger2-alert1', + monitor_name: 'bucket-monitor', + trigger_id: 'bucket-monitor-trigger2-id', + trigger_name: 'bucket-monitor-trigger2', + state: 'ACTIVE', + start_time: 1638361800000, + end_time: null, + agg_alert_content: { + parent_bucket_path: 'composite_agg', + bucket_keys: ['groupBy1KeywordValue', 'groupBy2KeywordValue'], + bucket: { + doc_count: 10, + field1: { + value: 100, + }, + field2: { + value: 200, + }, + key: { + groupBy1: 'groupBy1Keyword', + groupBy2: 'groupBy2Keyword', + }, + }, + }, + }, + ], + trigger_name: 'bucket-monitor-trigger2', + start_time: 1638361800000, + monitor_name: 'bucket-monitor', + triggerID: 'bucket-monitor-trigger2-id', + }, + { + ACTIVE: 1, + ACKNOWLEDGED: 0, + ERROR: 0, + total: 1, + alerts: [ + { + id: 'query-monitor-trigger1-alert1', + monitor_name: 'query-monitor', + trigger_id: 'query-monitor-trigger1-id', + trigger_name: 'query-monitor-trigger1', + state: 'ACTIVE', + start_time: 1638360000000, + end_time: null, + }, + ], + trigger_name: 'query-monitor-trigger1', + start_time: 1638360000000, + monitor_name: 'query-monitor', + triggerID: 'query-monitor-trigger1-id', + }, + { + ACTIVE: 1, + ACKNOWLEDGED: 0, + ERROR: 0, + total: 1, + alerts: [ + { + id: 'query-monitor-trigger2-alert1', + monitor_name: 'query-monitor', + trigger_id: 'query-monitor-trigger2-id', + trigger_name: 'query-monitor-trigger2', + state: 'ACTIVE', + start_time: 1638361800000, + end_time: null, + }, + ], + trigger_name: 'query-monitor-trigger2', + start_time: 1638361800000, + monitor_name: 'query-monitor', + triggerID: 'query-monitor-trigger2-id', + }, + ]; + expect(groupAlertsByTrigger(alerts)).toEqual(expectedOutput); + }); + }); + + describe('addFirstAlert', () => { + test('with bucket-level alert', () => { + const alert = { + id: 'bucket-monitor-trigger1-alert1', + last_notification_time: null, + monitor_id: 'bucket-monitor-id', + monitor_name: 'bucket-monitor', + severity: 5, + trigger_id: 'bucket-monitor-trigger1-id', + trigger_name: 'bucket-monitor-trigger1', + version: 1, + state: 'ACTIVE', + start_time: 1638360000000, + end_time: null, + agg_alert_content: { + parent_bucket_path: 'composite_agg', + bucket_keys: ['groupBy1KeywordValue', 'groupBy2KeywordValue'], + bucket: { + doc_count: 10, + field1: { + value: 100, + }, + field2: { + value: 200, + }, + key: { + groupBy1: 'groupBy1Keyword', + groupBy2: 'groupBy2Keyword', + }, + }, + }, + }; + const expectedOutput = { + ACTIVE: 1, + ACKNOWLEDGED: 0, + ERROR: 0, + total: 1, + alerts: [ + { + id: 'bucket-monitor-trigger1-alert1', + last_notification_time: null, + monitor_id: 'bucket-monitor-id', + monitor_name: 'bucket-monitor', + severity: 5, + trigger_id: 'bucket-monitor-trigger1-id', + trigger_name: 'bucket-monitor-trigger1', + version: 1, + state: 'ACTIVE', + start_time: 1638360000000, + end_time: null, + agg_alert_content: { + parent_bucket_path: 'composite_agg', + bucket_keys: ['groupBy1KeywordValue', 'groupBy2KeywordValue'], + bucket: { + doc_count: 10, + field1: { + value: 100, + }, + field2: { + value: 200, + }, + key: { + groupBy1: 'groupBy1Keyword', + groupBy2: 'groupBy2Keyword', + }, + }, + }, + }, + ], + version: 1, + trigger_name: 'bucket-monitor-trigger1', + severity: 5, + start_time: 1638360000000, + last_notification_time: null, + monitor_name: 'bucket-monitor', + monitor_id: 'bucket-monitor-id', + }; + expect(addFirstAlert(alert)).toEqual(expectedOutput); + }); + test('with query-level alert', () => { + const alert = { + id: 'query-monitor-trigger1-alert1', + last_notification_time: null, + monitor_id: 'query-monitor-id', + monitor_name: 'query-monitor', + severity: 5, + trigger_id: 'query-monitor-trigger1-id', + trigger_name: 'query-monitor-trigger1', + version: 1, + state: 'ACTIVE', + start_time: 1638360000000, + end_time: null, + }; + const expectedOutput = { + ACTIVE: 1, + ACKNOWLEDGED: 0, + ERROR: 0, + total: 1, + alerts: [ + { + id: 'query-monitor-trigger1-alert1', + last_notification_time: null, + monitor_id: 'query-monitor-id', + monitor_name: 'query-monitor', + severity: 5, + trigger_id: 'query-monitor-trigger1-id', + trigger_name: 'query-monitor-trigger1', + version: 1, + state: 'ACTIVE', + start_time: 1638360000000, + end_time: null, + }, + ], + version: 1, + trigger_name: 'query-monitor-trigger1', + severity: 5, + start_time: 1638360000000, + last_notification_time: null, + monitor_name: 'query-monitor', + monitor_id: 'query-monitor-id', + }; + expect(addFirstAlert(alert)).toEqual(expectedOutput); + }); + }); + + describe('addAlert', () => { + test('with valid alerts list', () => { + const alert = { + id: 'bucket-monitor-trigger1-alert2', + monitor_name: 'bucket-monitor', + trigger_id: 'bucket-monitor-trigger1-id', + trigger_name: 'bucket-monitor-trigger1', + state: 'ACTIVE', + start_time: 1638360000000, + end_time: null, + agg_alert_content: { + parent_bucket_path: 'composite_agg', + bucket_keys: ['groupBy1KeywordValue', 'groupBy2KeywordValue'], + bucket: { + doc_count: 10, + field1: { + value: 100, + }, + field2: { + value: 200, + }, + key: { + groupBy1: 'groupBy1Keyword', + groupBy2: 'groupBy2Keyword', + }, + }, + }, + }; + const alertsList = { + ACTIVE: 1, + ACKNOWLEDGED: 0, + ERROR: 0, + total: 1, + alerts: [ + { + id: 'bucket-monitor-trigger1-alert1', + monitor_name: 'bucket-monitor', + trigger_id: 'bucket-monitor-trigger1-id', + trigger_name: 'bucket-monitor-trigger1', + state: 'ACTIVE', + start_time: 1638360000000, + end_time: null, + agg_alert_content: { + parent_bucket_path: 'composite_agg', + bucket_keys: ['groupBy1KeywordValue', 'groupBy2KeywordValue'], + bucket: { + doc_count: 10, + field1: { + value: 100, + }, + field2: { + value: 200, + }, + key: { + groupBy1: 'groupBy1Keyword', + groupBy2: 'groupBy2Keyword', + }, + }, + }, + }, + ], + trigger_name: 'bucket-monitor-trigger1', + start_time: 1638360000000, + monitor_name: 'bucket-monitor', + triggerID: 'bucket-monitor-trigger1-id', + }; + const expectedOutput = { + ACTIVE: 2, + ACKNOWLEDGED: 0, + ERROR: 0, + total: 2, + alerts: [ + { + id: 'bucket-monitor-trigger1-alert1', + monitor_name: 'bucket-monitor', + trigger_id: 'bucket-monitor-trigger1-id', + trigger_name: 'bucket-monitor-trigger1', + state: 'ACTIVE', + start_time: 1638360000000, + end_time: null, + agg_alert_content: { + parent_bucket_path: 'composite_agg', + bucket_keys: ['groupBy1KeywordValue', 'groupBy2KeywordValue'], + bucket: { + doc_count: 10, + field1: { + value: 100, + }, + field2: { + value: 200, + }, + key: { + groupBy1: 'groupBy1Keyword', + groupBy2: 'groupBy2Keyword', + }, + }, + }, + }, + { + id: 'bucket-monitor-trigger1-alert2', + monitor_name: 'bucket-monitor', + trigger_id: 'bucket-monitor-trigger1-id', + trigger_name: 'bucket-monitor-trigger1', + state: 'ACTIVE', + start_time: 1638360000000, + end_time: null, + agg_alert_content: { + parent_bucket_path: 'composite_agg', + bucket_keys: ['groupBy1KeywordValue', 'groupBy2KeywordValue'], + bucket: { + doc_count: 10, + field1: { + value: 100, + }, + field2: { + value: 200, + }, + key: { + groupBy1: 'groupBy1Keyword', + groupBy2: 'groupBy2Keyword', + }, + }, + }, + }, + ], + trigger_name: 'bucket-monitor-trigger1', + start_time: 1638360000000, + monitor_name: 'bucket-monitor', + triggerID: 'bucket-monitor-trigger1-id', + }; + expect(addAlert(alertsList, alert)).toEqual(expectedOutput); + }); + }); + + describe('renderEmptyValue', () => { + test('with empty value', () => { + const value = {}; + expect(renderEmptyValue(value)).toEqual(value); + }); + + test('with undefined value', () => { + const value = undefined; + expect(renderEmptyValue(value)).toEqual(DEFAULT_EMPTY_DATA); + }); + + test('with defined value', () => { + const value = { key: 'value' }; + expect(renderEmptyValue(value)).toEqual(value); + }); + }); + + describe('insertGroupByColumn', () => { + test('with empty groupBy list', () => { + const groupBy = []; + expect(insertGroupByColumn(groupBy)).toEqual(bucketColumns); + }); + + test('with undefined groupBy list', () => { + const groupBy = undefined; + expect(insertGroupByColumn(groupBy)).toEqual(bucketColumns); + }); + + test('with valid groupBy list', () => { + const groupBy = ['keyword1', 'keyword2', 'keyword3']; + const expectedOutput = _.cloneDeep(bucketColumns); + expectedOutput.unshift( + { + field: 'agg_alert_content.bucket.key.keyword3', + name: 'keyword3', + render: renderEmptyValue, + sortable: false, + truncateText: false, + }, + { + field: 'agg_alert_content.bucket.key.keyword2', + name: 'keyword2', + render: renderEmptyValue, + sortable: false, + truncateText: false, + }, + { + field: 'agg_alert_content.bucket.key.keyword1', + name: 'keyword1', + render: renderEmptyValue, + sortable: false, + truncateText: false, + } + ); + expect(insertGroupByColumn(groupBy)).toEqual(expectedOutput); + }); + }); + + describe('removeColumns', () => { + describe('with empty allColumns parameter', () => { + const allColumns = []; + test('with empty columnFieldNames', () => { + const columnFieldNames = []; + const expectedOutput = []; + expect(removeColumns(columnFieldNames, allColumns)).toEqual(expectedOutput); + }); + + test('with undefined columnFieldNames', () => { + const columnFieldNames = undefined; + const expectedOutput = []; + expect(removeColumns(columnFieldNames, allColumns)).toEqual(expectedOutput); + }); + + test('with valid columnFieldNames', () => { + const columnFieldNames = ['first column', 'third column']; + const expectedOutput = []; + expect(removeColumns(columnFieldNames, allColumns)).toEqual(expectedOutput); + }); + }); + describe('with undefined allColumns parameter', () => { + const allColumns = undefined; + test('with empty columnFieldNames', () => { + const columnFieldNames = []; + const expectedOutput = []; + expect(removeColumns(columnFieldNames, allColumns)).toEqual(expectedOutput); + }); + + test('with undefined columnFieldNames', () => { + const columnFieldNames = undefined; + const expectedOutput = []; + expect(removeColumns(columnFieldNames, allColumns)).toEqual(expectedOutput); + }); + + test('with valid columnFieldNames', () => { + const columnFieldNames = ['first column', 'third column']; + const expectedOutput = []; + expect(removeColumns(columnFieldNames, allColumns)).toEqual(expectedOutput); + }); + }); + describe('with valid allColumns parameter', () => { + const allColumns = [ + { field: 'first column' }, + { field: 'second column' }, + { field: 'third column' }, + { field: 'fourth column' }, + { field: 'fifth column' }, + ]; + + test('with empty columnFieldNames', () => { + const columnFieldNames = []; + expect(removeColumns(columnFieldNames, allColumns)).toEqual(allColumns); + }); + + test('with undefined columnFieldNames', () => { + const columnFieldNames = undefined; + expect(removeColumns(columnFieldNames, allColumns)).toEqual(allColumns); + }); + + test('with valid columnFieldNames', () => { + const columnFieldNames = ['first column', 'third column']; + const expectedOutput = [ + { field: 'second column' }, + { field: 'fourth column' }, + { field: 'fifth column' }, + ]; + expect(removeColumns(columnFieldNames, allColumns)).toEqual(expectedOutput); + }); + }); + }); + + describe('getInitialSize', () => { + describe('when perAlertView is false', () => { + const perAlertView = false; + test('when defaultSize is undefined', () => { + const defaultSize = undefined; + expect(getInitialSize(perAlertView, defaultSize)).toEqual(MAX_ALERT_COUNT); + }); + test('when defaultSize is 0', () => { + const defaultSize = 0; + expect(getInitialSize(perAlertView, defaultSize)).toEqual(MAX_ALERT_COUNT); + }); + test('when defaultSize is greater than 0', () => { + const defaultSize = 10; + expect(getInitialSize(perAlertView, defaultSize)).toEqual(MAX_ALERT_COUNT); + }); + test('when defaultSize is less than 0', () => { + const defaultSize = -10; + expect(getInitialSize(perAlertView, defaultSize)).toEqual(MAX_ALERT_COUNT); + }); + }); + describe('when perAlertView is true', () => { + const perAlertView = test('when defaultSize is undefined', () => { + const defaultSize = undefined; + expect(getInitialSize(perAlertView, defaultSize)).toEqual( + DEFAULT_GET_ALERTS_QUERY_PARAMS.size + ); + }); + test('when defaultSize is 0', () => { + const defaultSize = 0; + expect(getInitialSize(perAlertView, defaultSize)).toEqual(defaultSize); + }); + test('when defaultSize is greater than 0', () => { + const defaultSize = 10; + expect(getInitialSize(perAlertView, defaultSize)).toEqual(defaultSize); + }); + test('when defaultSize is less than 0', () => { + const defaultSize = -10; + expect(getInitialSize(perAlertView, defaultSize)).toEqual(MAX_ALERT_COUNT); + }); + }); + describe('when perAlertView is undefined', () => { + const perAlertView = undefined; + test('when defaultSize is undefined', () => { + const defaultSize = undefined; + expect(getInitialSize(perAlertView, defaultSize)).toEqual(MAX_ALERT_COUNT); + }); + test('when defaultSize is 0', () => { + const defaultSize = 0; + expect(getInitialSize(perAlertView, defaultSize)).toEqual(MAX_ALERT_COUNT); + }); + test('when defaultSize is greater than 0', () => { + const defaultSize = 10; + expect(getInitialSize(perAlertView, defaultSize)).toEqual(MAX_ALERT_COUNT); + }); + test('when defaultSize is less than 0', () => { + const defaultSize = -10; + expect(getInitialSize(perAlertView, defaultSize)).toEqual(MAX_ALERT_COUNT); + }); + }); + }); + + describe('displayAcknowledgedAlertsToast', () => { + let notifications; + beforeEach(() => { + notifications = _.cloneDeep(coreMock.notifications); + }); + test('when successfulCount is less than 1', () => { + displayAcknowledgedAlertsToast(notifications, 0); + expect(notifications.toasts.addSuccess).toHaveBeenCalledTimes(0); + }); + test('when successfulCount is undefined', () => { + displayAcknowledgedAlertsToast(notifications, undefined); + expect(notifications.toasts.addSuccess).toHaveBeenCalledTimes(0); + }); + test('when successfulCount is 1', () => { + displayAcknowledgedAlertsToast(notifications, 1); + expect(notifications.toasts.addSuccess).toHaveBeenCalledWith( + 'Successfully acknowledged 1 alert.' + ); + }); + test('when successfulCount is greater than 1', () => { + displayAcknowledgedAlertsToast(notifications, 10); + expect(notifications.toasts.addSuccess).toHaveBeenCalledWith( + 'Successfully acknowledged 10 alerts.' + ); + }); + }); + + describe('filterActiveAlerts', () => { + test('with empty alerts', () => { + const alerts = []; + expect(filterActiveAlerts(alerts)).toEqual([]); + }); + test('with undefined alerts', () => { + const alerts = undefined; + expect(filterActiveAlerts(alerts)).toEqual([]); + }); + test('with valid alerts', () => { + const alerts = [ + { state: ALERT_STATE.ACKNOWLEDGED }, + { state: ALERT_STATE.ACTIVE }, + { state: ALERT_STATE.ACTIVE }, + { state: ALERT_STATE.COMPLETED }, + { state: ALERT_STATE.DELETED }, + { state: ALERT_STATE.ERROR }, + ]; + const expectedOutput = [{ state: ALERT_STATE.ACTIVE }, { state: ALERT_STATE.ACTIVE }]; + expect(filterActiveAlerts(alerts)).toEqual(expectedOutput); + }); + }); + + test('getQueryObjectFromState', () => { + const expectedOutput = { + page: 1, + size: 10, + search: '', + sortField: 'start_time', + sortDirection: 'desc', + severityLevel: 'ALL', + alertState: 'ALL', + monitorIds: ['monitor1', 'monitor2', 'monitor3'], + flyoutIsOpen: true, + }; + const state = { + ...expectedOutput, + extraField1: 'extraField1', + extraField2: 'extraField2', + extraField3: 'extraField3', + }; + expect(getQueryObjectFromState(state)).toEqual(expectedOutput); + }); + + test('getURLQueryParams', () => { + const location = { + pathname: '/dashboard', + search: + '?alertState=ACKNOWLEDGED&from=0&search=searchTerm&severityLevel=5&size=10000&sortDirection=desc&sortField=start_time', + hash: '', + }; + const expectedOutput = { + from: 0, + size: 10000, + search: 'searchTerm', + sortField: 'start_time', + sortDirection: 'desc', + severityLevel: '5', + alertState: ALERT_STATE.ACKNOWLEDGED, + }; + expect(getURLQueryParams(location)).toEqual(expectedOutput); + }); +}); diff --git a/public/pages/Dashboard/utils/tableUtils.js b/public/pages/Dashboard/utils/tableUtils.js index a3ebf1129..8fc877db1 100644 --- a/public/pages/Dashboard/utils/tableUtils.js +++ b/public/pages/Dashboard/utils/tableUtils.js @@ -28,7 +28,6 @@ import React from 'react'; import _ from 'lodash'; import { EuiLink } from '@elastic/eui'; import moment from 'moment'; - import { ALERT_STATE, DEFAULT_EMPTY_DATA } from '../../../utils/constants'; import { PLUGIN_NAME } from '../../../../utils/constants'; @@ -142,19 +141,21 @@ export const alertColumns = ( location, monitors, notifications, - setFlyout + setFlyout, + openFlyout, + closeFlyout, + refreshDashboard ) => [ { field: 'total', name: 'Alerts', sortable: true, truncateText: false, - render: (total, alert) => ( - { - setFlyout({ - type: 'alertsDashboard', - payload: { + render: (total, alert) => { + return ( + { + openFlyout({ ...alert, history, httpClient, @@ -163,13 +164,16 @@ export const alertColumns = ( monitors, notifications, setFlyout, - }, - }); - }} - > - {`${total} alerts`} - - ), + closeFlyout, + refreshDashboard, + }); + }} + data-test-subj={`euiLink_${alert.trigger_name}`} + > + {`${total} alerts`} + + ); + }, }, { field: 'ACTIVE', diff --git a/public/pages/Monitors/containers/Monitors/Monitors.js b/public/pages/Monitors/containers/Monitors/Monitors.js index 910a69429..234fd4b55 100644 --- a/public/pages/Monitors/containers/Monitors/Monitors.js +++ b/public/pages/Monitors/containers/Monitors/Monitors.js @@ -10,25 +10,24 @@ */ /* - * Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. + * Copyright 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved. * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at + * Licensed under the Apache License, Version 2.0 (the "License"). + * You may not use this file except in compliance with the License. + * A copy of the License is located at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. + * or in the "license" file accompanying this file. This file is distributed + * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + * express or implied. See the License for the specific language governing + * permissions and limitations under the License. */ import React, { Component } from 'react'; import _ from 'lodash'; import queryString from 'query-string'; import { EuiBasicTable, EuiHorizontalRule } from '@elastic/eui'; - import AcknowledgeModal from '../../components/AcknowledgeModal'; import ContentPanel from '../../../../components/ContentPanel'; import MonitorActions from '../../components/MonitorActions'; @@ -39,6 +38,7 @@ import { getURLQueryParams } from './utils/helpers'; import { columns as staticColumns } from './utils/tableUtils'; import { MONITOR_ACTIONS } from '../../../../utils/constants'; import { backendErrorNotification } from '../../../../utils/helpers'; +import { displayAcknowledgedAlertsToast } from '../../../Dashboard/utils/helpers'; const MAX_MONITOR_COUNT = 1000; @@ -265,6 +265,9 @@ export default class Monitors extends Component { .then((resp) => { if (!resp.ok) { backendErrorNotification(notifications, 'acknowledge', 'alert', resp.resp); + } else { + const successfulCount = _.get(resp, 'resp.success', []).length; + displayAcknowledgedAlertsToast(notifications, successfulCount); } }) .catch((error) => error) From cb98e0a526ecd05d38bf700464d881927e364bf4 Mon Sep 17 00:00:00 2001 From: Annie Lee <71157062+leeyun-amzn@users.noreply.github.com> Date: Thu, 27 Jan 2022 17:09:08 -0800 Subject: [PATCH 11/22] Adding basic unit tests (#151) * Add flyout render Signed-off-by: Annie Lee * Add some basic tests Signed-off-by: Annie Lee * Add more tests Signed-off-by: Annie Lee * Update jest.config.js Signed-off-by: Annie Lee * Add tests Signed-off-by: Annie Lee * Update dashboard sample alerttime Signed-off-by: Annie Lee * Update dashboard test alert time snapshot Signed-off-by: Annie Lee * Update Dashboard.test.js Signed-off-by: Annie Lee * Remove test alert start time Signed-off-by: Annie Lee * Update VisualGraph test and code Signed-off-by: Annie Lee * Update package.json to run unit tests in UTC timezone Signed-off-by: Annie Lee * Update dashboard sample alert start time Signed-off-by: Annie Lee * Update Dashboard test Signed-off-by: Annie Lee * Update Dashboard.test.js.snap Signed-off-by: Annie Lee * Update snapshot file Signed-off-by: Annie Lee Signed-off-by: AWSHurneyt --- package.json | 2 +- .../components/VisualGraph/VisualGraph.js | 15 +- .../VisualGraph/VisualGraph.test.js | 91 +- .../__snapshots__/VisualGraph.test.js.snap | 1087 ++++- .../containers/DataSource/DataSource.test.js | 30 + .../__snapshots__/DataSource.test.js.snap | 27 + .../containers/DefineMonitor/DefineMonitor.js | 2 +- .../ActionEmptyPrompt.test.js | 15 + .../ActionEmptyPrompt.test.js.snap | 26 + .../AddActionButton/AddActionButton.test.js | 15 + .../AddActionButton.test.js.snap | 11 + .../AddTriggerButton/AddTriggerButton.test.js | 15 + .../AddTriggerButton.test.js.snap | 11 + .../AddTriggerConditionButton.test.js | 15 + .../AddTriggerConditionButton.test.js.snap | 11 + .../BucketLevelTriggerExpression.test.js | 15 + .../BucketLevelTriggerExpression.test.js.snap | 79 + .../BucketLevelTriggerGraph.test.js | 15 + .../components/TriggerGraph.test.js | 15 + .../BucketLevelTriggerGraph.test.js.snap | 20 + .../__snapshots__/TriggerGraph.test.js.snap | 23 + .../Dashboard/containers/Dashboard.test.js | 119 +- .../__snapshots__/Dashboard.test.js.snap | 4131 +++++++++++++++-- test/jest.config.js | 5 + 24 files changed, 5329 insertions(+), 466 deletions(-) create mode 100644 public/pages/CreateMonitor/containers/DataSource/DataSource.test.js create mode 100644 public/pages/CreateMonitor/containers/DataSource/__snapshots__/DataSource.test.js.snap create mode 100644 public/pages/CreateTrigger/components/ActionEmptyPrompt/ActionEmptyPrompt.test.js create mode 100644 public/pages/CreateTrigger/components/ActionEmptyPrompt/__snapshots__/ActionEmptyPrompt.test.js.snap create mode 100644 public/pages/CreateTrigger/components/AddActionButton/AddActionButton.test.js create mode 100644 public/pages/CreateTrigger/components/AddActionButton/__snapshots__/AddActionButton.test.js.snap create mode 100644 public/pages/CreateTrigger/components/AddTriggerButton/AddTriggerButton.test.js create mode 100644 public/pages/CreateTrigger/components/AddTriggerButton/__snapshots__/AddTriggerButton.test.js.snap create mode 100644 public/pages/CreateTrigger/components/AddTriggerConditionButton/AddTriggerConditionButton.test.js create mode 100644 public/pages/CreateTrigger/components/AddTriggerConditionButton/__snapshots__/AddTriggerConditionButton.test.js.snap create mode 100644 public/pages/CreateTrigger/components/BucketLevelTriggerExpression/BucketLevelTriggerExpression.test.js create mode 100644 public/pages/CreateTrigger/components/BucketLevelTriggerExpression/__snapshots__/BucketLevelTriggerExpression.test.js.snap create mode 100644 public/pages/CreateTrigger/components/BucketLevelTriggerGraph.test.js create mode 100644 public/pages/CreateTrigger/components/TriggerGraph.test.js create mode 100644 public/pages/CreateTrigger/components/__snapshots__/BucketLevelTriggerGraph.test.js.snap create mode 100644 public/pages/CreateTrigger/components/__snapshots__/TriggerGraph.test.js.snap diff --git a/package.json b/package.json index 5fad73ef2..4c26edb66 100644 --- a/package.json +++ b/package.json @@ -16,7 +16,7 @@ "osd": "node ../../scripts/osd", "opensearch": "node ../../scripts/opensearch", "lint": "../../node_modules/.bin/eslint '**/*.js' -c .eslintrc --ignore-path .gitignore", - "test:jest": "../../node_modules/.bin/jest --config ./test/jest.config.js", + "test:jest": "TZ=UTC ../../node_modules/.bin/jest --config ./test/jest.config.js", "build": "yarn plugin-helpers build", "plugin-helpers": "node ../../scripts/plugin_helpers", "postbuild": "echo Renaming build artifact to [$npm_package_config_id-$npm_package_version.zip] && mv build/$npm_package_config_id*.zip build/$npm_package_config_id-$npm_package_version.zip" diff --git a/public/pages/CreateMonitor/components/VisualGraph/VisualGraph.js b/public/pages/CreateMonitor/components/VisualGraph/VisualGraph.js index aa61530df..9ed8f47ae 100644 --- a/public/pages/CreateMonitor/components/VisualGraph/VisualGraph.js +++ b/public/pages/CreateMonitor/components/VisualGraph/VisualGraph.js @@ -208,18 +208,11 @@ export default class VisualGraph extends Component { ? null : getMapDataFromResponse(response, aggTypeFieldName, values.groupBy); // Show empty graph view when data is empty or aggregation monitor does not have group by defined. - const showEmpty = - !data.length || (monitorType == MONITOR_TYPE.BUCKET_LEVEL && !values.groupBy.length); + const showEmpty = !data.length || (!isQueryMonitor && !values.groupBy.length); - return ( - <> - {showEmpty - ? this.renderEmptyData() - : isQueryMonitor - ? this.renderXYPlot(data) - : this.renderAggregationXYPlot(data, groupedData)} - - ); + if (showEmpty) return <>{this.renderEmptyData()}; + else if (isQueryMonitor) return <>{this.renderXYPlot(data)}; + else return <>{this.renderAggregationXYPlot(data, groupedData)}; } } diff --git a/public/pages/CreateMonitor/components/VisualGraph/VisualGraph.test.js b/public/pages/CreateMonitor/components/VisualGraph/VisualGraph.test.js index b66a7439a..9e361fe99 100644 --- a/public/pages/CreateMonitor/components/VisualGraph/VisualGraph.test.js +++ b/public/pages/CreateMonitor/components/VisualGraph/VisualGraph.test.js @@ -29,10 +29,99 @@ import { render } from 'enzyme'; import VisualGraph from './VisualGraph'; import { FORMIK_INITIAL_VALUES } from '../../containers/CreateMonitor/utils/constants'; +import { MONITOR_TYPE } from '../../../../utils/constants'; + +const queryGraphResponse = { + _shards: { total: 1, failed: 0, successful: 1, skipped: 0 }, + hits: { hits: [], total: { value: 28, relation: 'eq' }, max_score: null }, + took: 5, + timed_out: false, + aggregations: { + over: { + buckets: [ + { key_as_string: '2021-11-19T07:00:00.000-08:00', doc_count: 0, key: 1637334000000 }, + { key_as_string: '2021-11-19T08:00:00.000-08:00', doc_count: 6, key: 1637337600000 }, + { key_as_string: '2021-11-19T09:00:00.000-08:00', doc_count: 5, key: 1637341200000 }, + { key_as_string: '2021-11-19T10:00:00.000-08:00', doc_count: 4, key: 1637344800000 }, + { key_as_string: '2021-11-19T11:00:00.000-08:00', doc_count: 8, key: 1637348400000 }, + { key_as_string: '2021-11-19T12:00:00.000-08:00', doc_count: 5, key: 1637352000000 }, + ], + }, + }, +}; +const bucketMonitorValues = { + name: '', + disabled: false, + frequency: 'interval', + timezone: [], + daily: 0, + period: { interval: 1, unit: 'MINUTES' }, + weekly: { mon: false, tue: false, wed: false, thur: false, fri: false, sat: false, sun: false }, + monthly: { type: 'day', day: 1 }, + cronExpression: '0 */1 * * *', + monitor_type: 'bucket_level_monitor', + searchType: 'graph', + index: [ + { label: 'opensearch_dashboards_sample_data_ecommerce', health: 'green', status: 'open' }, + ], + timeField: 'order_date', + query: '{\n "size": 0,\n "query": {\n "match_all": {}\n }\n}', + aggregationType: 'count', + fieldName: [], + aggregations: [], + groupBy: ['customer_gender'], + groupByField: [{ label: '' }], + overDocuments: 'all documents', + groupedOverTop: 5, + groupedOverFieldName: 'bytes', + bucketValue: 1, + bucketUnitOfTime: 'h', + where: { fieldName: [], operator: 'is', fieldValue: '', fieldRangeStart: 0, fieldRangeEnd: 0 }, + detectorId: '', + triggerDefinitions: [], +}; + +const bucketGraphResponse = { + _shards: { total: 1, failed: 0, successful: 1, skipped: 0 }, + hits: { hits: [], total: { value: 28, relation: 'eq' }, max_score: null }, + took: 19, + timed_out: false, + aggregations: { + composite_agg: { + buckets: [ + { doc_count: 6, key: { date: 1637337600000 } }, + { doc_count: 5, key: { date: 1637341200000 } }, + { doc_count: 4, key: { date: 1637344800000 } }, + { doc_count: 8, key: { date: 1637348400000 } }, + { doc_count: 5, key: { date: 1637352000000 } }, + ], + after_key: { date: 1637352000000 }, + }, + }, +}; describe('VisualGraph', () => { test('renders', () => { - const component = ; + const component = ( + + ); + expect(render(component)).toMatchSnapshot(); + }); + + test('renders with bucket level monitor', () => { + const values = FORMIK_INITIAL_VALUES; + values.monitor_type = MONITOR_TYPE.BUCKET_LEVEL; + const component = ( + + ); expect(render(component)).toMatchSnapshot(); }); }); diff --git a/public/pages/CreateMonitor/components/VisualGraph/__snapshots__/VisualGraph.test.js.snap b/public/pages/CreateMonitor/components/VisualGraph/__snapshots__/VisualGraph.test.js.snap index 0382b4252..5753da187 100644 --- a/public/pages/CreateMonitor/components/VisualGraph/__snapshots__/VisualGraph.test.js.snap +++ b/public/pages/CreateMonitor/components/VisualGraph/__snapshots__/VisualGraph.test.js.snap @@ -2,10 +2,1091 @@ exports[`VisualGraph renders 1`] = `
      -
      - There is no data for the current selections. +
      +
      +

      + COUNT of documents +

      +
      +
      +
      +
      +
      +
      +
      +
      +
      + FOR THE LAST 1 hour(s) +
      +
      +
      +
      +
      +
      + + + + + + + + 03 PM + + + + + + 04 PM + + + + + + 05 PM + + + + + + 06 PM + + + + + + 07 PM + + + + + + 08 PM + + + + + + + + + + + 0 + + + + + + 1 + + + + + + 2 + + + + + + 3 + + + + + + 4 + + + + + + 5 + + + + + + 6 + + + + + + 7 + + + + + + 8 + + + + + + 9 + + + + + + 10 + + + + + + 11 + + + + + + 12 + + + + + + + doc_count + + + + + + + + + + + + + + +
      +
      +
      +
      +`; + +exports[`VisualGraph renders with bucket level monitor 1`] = ` +
      +
      +
      +

      + COUNT of documents +

      +
      +
      +
      +
      +
      +
      +
      +
      +
      + + FOR THE LAST 1 hour(s), GROUP BY customer_gender, Showing top 3 buckets. + +
      +
      +
      +
      +
      +
      + + + + + + + + 04 PM + + + + + + 05 PM + + + + + + 06 PM + + + + + + 07 PM + + + + + + 08 PM + + + + + + + order_date + + + + + + + + + + + 0 + + + + + + 1 + + + + + + 2 + + + + + + 3 + + + + + + 4 + + + + + + 5 + + + + + + 6 + + + + + + 7 + + + + + + 8 + + + + + + 9 + + + + + + 10 + + + + + + 11 + + + + + + 12 + + + + + + + doc_count + + + + + + + + + + + + +
      +
      + + + + + - + +
      +
      +
      +
      `; diff --git a/public/pages/CreateMonitor/containers/DataSource/DataSource.test.js b/public/pages/CreateMonitor/containers/DataSource/DataSource.test.js new file mode 100644 index 000000000..135d50fcc --- /dev/null +++ b/public/pages/CreateMonitor/containers/DataSource/DataSource.test.js @@ -0,0 +1,30 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + * + * Modifications Copyright OpenSearch Contributors. See + * GitHub history for details. + */ + +import React from 'react'; +import { shallow } from 'enzyme'; + +import { httpClientMock } from '../../../../../test/mocks'; +import DataSource from './DataSource'; +import { FORMIK_INITIAL_VALUES } from '../CreateMonitor/utils/constants'; + +beforeEach(() => { + jest.clearAllMocks(); +}); + +describe('DataSource', () => { + test('renders', () => { + const wrapper = shallow( + + ); + expect(wrapper).toMatchSnapshot(); + }); +}); diff --git a/public/pages/CreateMonitor/containers/DataSource/__snapshots__/DataSource.test.js.snap b/public/pages/CreateMonitor/containers/DataSource/__snapshots__/DataSource.test.js.snap new file mode 100644 index 000000000..da337a372 --- /dev/null +++ b/public/pages/CreateMonitor/containers/DataSource/__snapshots__/DataSource.test.js.snap @@ -0,0 +1,27 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`DataSource renders 1`] = ` + + + + + +`; diff --git a/public/pages/CreateMonitor/containers/DefineMonitor/DefineMonitor.js b/public/pages/CreateMonitor/containers/DefineMonitor/DefineMonitor.js index 7f3afed98..c6a929d6f 100644 --- a/public/pages/CreateMonitor/containers/DefineMonitor/DefineMonitor.js +++ b/public/pages/CreateMonitor/containers/DefineMonitor/DefineMonitor.js @@ -402,7 +402,7 @@ class DefineMonitor extends Component { showPluginWarning() { const { values } = this.props; const { plugins } = this.state; - return values.searchType == SEARCH_TYPE.AD && plugins.indexOf(OS_AD_PLUGIN) == -1; + return values.searchType === SEARCH_TYPE.AD && plugins.indexOf(OS_AD_PLUGIN) === -1; } render() { diff --git a/public/pages/CreateTrigger/components/ActionEmptyPrompt/ActionEmptyPrompt.test.js b/public/pages/CreateTrigger/components/ActionEmptyPrompt/ActionEmptyPrompt.test.js new file mode 100644 index 000000000..00b120472 --- /dev/null +++ b/public/pages/CreateTrigger/components/ActionEmptyPrompt/ActionEmptyPrompt.test.js @@ -0,0 +1,15 @@ +/* + * Copyright OpenSearch Contributors + * SPDX-License-Identifier: Apache-2.0 + */ + +import React from 'react'; +import { shallow } from 'enzyme'; +import ActionEmptyPrompt from './ActionEmptyPrompt'; + +describe('ActionEmptyPrompt', () => { + test('renders', () => { + const wrapper = shallow(); + expect(wrapper).toMatchSnapshot(); + }); +}); diff --git a/public/pages/CreateTrigger/components/ActionEmptyPrompt/__snapshots__/ActionEmptyPrompt.test.js.snap b/public/pages/CreateTrigger/components/ActionEmptyPrompt/__snapshots__/ActionEmptyPrompt.test.js.snap new file mode 100644 index 000000000..ba7f2772d --- /dev/null +++ b/public/pages/CreateTrigger/components/ActionEmptyPrompt/__snapshots__/ActionEmptyPrompt.test.js.snap @@ -0,0 +1,26 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`ActionEmptyPrompt renders 1`] = ` + + Add destination + + } + body={ + +

      + There are no existing destinations. Add a destinations to create an action. +

      +
      + } + style={ + Object { + "maxWidth": "45em", + } + } +/> +`; diff --git a/public/pages/CreateTrigger/components/AddActionButton/AddActionButton.test.js b/public/pages/CreateTrigger/components/AddActionButton/AddActionButton.test.js new file mode 100644 index 000000000..ce97c0152 --- /dev/null +++ b/public/pages/CreateTrigger/components/AddActionButton/AddActionButton.test.js @@ -0,0 +1,15 @@ +/* + * Copyright OpenSearch Contributors + * SPDX-License-Identifier: Apache-2.0 + */ + +import React from 'react'; +import { shallow } from 'enzyme'; +import AddActionButton from './AddActionButton'; + +describe('AddActionButton', () => { + test('renders', () => { + const wrapper = shallow(); + expect(wrapper).toMatchSnapshot(); + }); +}); diff --git a/public/pages/CreateTrigger/components/AddActionButton/__snapshots__/AddActionButton.test.js.snap b/public/pages/CreateTrigger/components/AddActionButton/__snapshots__/AddActionButton.test.js.snap new file mode 100644 index 000000000..77ddf9b3c --- /dev/null +++ b/public/pages/CreateTrigger/components/AddActionButton/__snapshots__/AddActionButton.test.js.snap @@ -0,0 +1,11 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AddActionButton renders 1`] = ` + + Add action + +`; diff --git a/public/pages/CreateTrigger/components/AddTriggerButton/AddTriggerButton.test.js b/public/pages/CreateTrigger/components/AddTriggerButton/AddTriggerButton.test.js new file mode 100644 index 000000000..b1ce4773a --- /dev/null +++ b/public/pages/CreateTrigger/components/AddTriggerButton/AddTriggerButton.test.js @@ -0,0 +1,15 @@ +/* + * Copyright OpenSearch Contributors + * SPDX-License-Identifier: Apache-2.0 + */ + +import React from 'react'; +import { shallow } from 'enzyme'; +import AddTriggerButton from './AddTriggerButton'; + +describe('AddTriggerButton', () => { + test('renders', () => { + const wrapper = shallow(); + expect(wrapper).toMatchSnapshot(); + }); +}); diff --git a/public/pages/CreateTrigger/components/AddTriggerButton/__snapshots__/AddTriggerButton.test.js.snap b/public/pages/CreateTrigger/components/AddTriggerButton/__snapshots__/AddTriggerButton.test.js.snap new file mode 100644 index 000000000..ce44dfe55 --- /dev/null +++ b/public/pages/CreateTrigger/components/AddTriggerButton/__snapshots__/AddTriggerButton.test.js.snap @@ -0,0 +1,11 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AddTriggerButton renders 1`] = ` + + Add trigger + +`; diff --git a/public/pages/CreateTrigger/components/AddTriggerConditionButton/AddTriggerConditionButton.test.js b/public/pages/CreateTrigger/components/AddTriggerConditionButton/AddTriggerConditionButton.test.js new file mode 100644 index 000000000..f011b13bd --- /dev/null +++ b/public/pages/CreateTrigger/components/AddTriggerConditionButton/AddTriggerConditionButton.test.js @@ -0,0 +1,15 @@ +/* + * Copyright OpenSearch Contributors + * SPDX-License-Identifier: Apache-2.0 + */ + +import React from 'react'; +import { shallow } from 'enzyme'; +import AddTriggerConditionButton from './AddTriggerConditionButton'; + +describe('AddTriggerConditionButton', () => { + test('renders', () => { + const wrapper = shallow(); + expect(wrapper).toMatchSnapshot(); + }); +}); diff --git a/public/pages/CreateTrigger/components/AddTriggerConditionButton/__snapshots__/AddTriggerConditionButton.test.js.snap b/public/pages/CreateTrigger/components/AddTriggerConditionButton/__snapshots__/AddTriggerConditionButton.test.js.snap new file mode 100644 index 000000000..46541ed58 --- /dev/null +++ b/public/pages/CreateTrigger/components/AddTriggerConditionButton/__snapshots__/AddTriggerConditionButton.test.js.snap @@ -0,0 +1,11 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AddTriggerConditionButton renders 1`] = ` + + + Add condition + +`; diff --git a/public/pages/CreateTrigger/components/BucketLevelTriggerExpression/BucketLevelTriggerExpression.test.js b/public/pages/CreateTrigger/components/BucketLevelTriggerExpression/BucketLevelTriggerExpression.test.js new file mode 100644 index 000000000..f033f62e6 --- /dev/null +++ b/public/pages/CreateTrigger/components/BucketLevelTriggerExpression/BucketLevelTriggerExpression.test.js @@ -0,0 +1,15 @@ +/* + * Copyright OpenSearch Contributors + * SPDX-License-Identifier: Apache-2.0 + */ + +import React from 'react'; +import { shallow } from 'enzyme'; +import BucketLevelTriggerExpression from './BucketLevelTriggerExpression'; + +describe('BucketLevelTriggerExpression', () => { + test('renders', () => { + const wrapper = shallow(); + expect(wrapper).toMatchSnapshot(); + }); +}); diff --git a/public/pages/CreateTrigger/components/BucketLevelTriggerExpression/__snapshots__/BucketLevelTriggerExpression.test.js.snap b/public/pages/CreateTrigger/components/BucketLevelTriggerExpression/__snapshots__/BucketLevelTriggerExpression.test.js.snap new file mode 100644 index 000000000..070802868 --- /dev/null +++ b/public/pages/CreateTrigger/components/BucketLevelTriggerExpression/__snapshots__/BucketLevelTriggerExpression.test.js.snap @@ -0,0 +1,79 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`BucketLevelTriggerExpression renders 1`] = ` + + + + + + + + + + + + + + + + + + + + + + + + Remove condition + + + +`; diff --git a/public/pages/CreateTrigger/components/BucketLevelTriggerGraph.test.js b/public/pages/CreateTrigger/components/BucketLevelTriggerGraph.test.js new file mode 100644 index 000000000..7451f6d0b --- /dev/null +++ b/public/pages/CreateTrigger/components/BucketLevelTriggerGraph.test.js @@ -0,0 +1,15 @@ +/* + * Copyright OpenSearch Contributors + * SPDX-License-Identifier: Apache-2.0 + */ + +import React from 'react'; +import { shallow } from 'enzyme'; +import BucketLevelTriggerGraph from './BucketLevelTriggerGraph'; + +describe('BucketLevelTriggerGraph', () => { + test('renders', () => { + const wrapper = shallow(); + expect(wrapper).toMatchSnapshot(); + }); +}); diff --git a/public/pages/CreateTrigger/components/TriggerGraph.test.js b/public/pages/CreateTrigger/components/TriggerGraph.test.js new file mode 100644 index 000000000..45dc1fbe1 --- /dev/null +++ b/public/pages/CreateTrigger/components/TriggerGraph.test.js @@ -0,0 +1,15 @@ +/* + * Copyright OpenSearch Contributors + * SPDX-License-Identifier: Apache-2.0 + */ + +import React from 'react'; +import { shallow } from 'enzyme'; +import TriggerGraph from './TriggerGraph'; + +describe('TriggerGraph', () => { + test('renders', () => { + const wrapper = shallow(); + expect(wrapper).toMatchSnapshot(); + }); +}); diff --git a/public/pages/CreateTrigger/components/__snapshots__/BucketLevelTriggerGraph.test.js.snap b/public/pages/CreateTrigger/components/__snapshots__/BucketLevelTriggerGraph.test.js.snap new file mode 100644 index 000000000..06b31912c --- /dev/null +++ b/public/pages/CreateTrigger/components/__snapshots__/BucketLevelTriggerGraph.test.js.snap @@ -0,0 +1,20 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`BucketLevelTriggerGraph renders 1`] = ` +
      + +
      +`; diff --git a/public/pages/CreateTrigger/components/__snapshots__/TriggerGraph.test.js.snap b/public/pages/CreateTrigger/components/__snapshots__/TriggerGraph.test.js.snap new file mode 100644 index 000000000..70f3c8791 --- /dev/null +++ b/public/pages/CreateTrigger/components/__snapshots__/TriggerGraph.test.js.snap @@ -0,0 +1,23 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`TriggerGraph renders 1`] = ` +
      + + + +
      +`; diff --git a/public/pages/Dashboard/containers/Dashboard.test.js b/public/pages/Dashboard/containers/Dashboard.test.js index 345b3832d..4f440e976 100644 --- a/public/pages/Dashboard/containers/Dashboard.test.js +++ b/public/pages/Dashboard/containers/Dashboard.test.js @@ -36,6 +36,45 @@ const location = { state: undefined, }; +const sampleQueryAlerts = [ + { + id: 'Ciw2DH0B3-v9t8HD4m3Q', + monitor_id: '7SwkDH0B3-v9t8HDk2zN', + schema_version: 3, + monitor_version: 2, + monitor_name: 'test-query-monitor', + trigger_id: '7CwkDH0B3-v9t8HDk2w_', + trigger_name: 'test-query-trigger', + state: 'ACTIVE', + error_message: null, + alert_history: [], + severity: '1', + action_execution_results: [], + start_time: 1636587463371, + last_notification_time: 1636587523369, + end_time: null, + acknowledged_time: null, + }, + { + id: 'Cyw2DH0B3-v9t8HD4m3Q', + monitor_id: '7SwkDH0B3-v9t8HDk2zN', + schema_version: 3, + monitor_version: 2, + monitor_name: 'test-query-monitor', + trigger_id: '_iw2DH0B3-v9t8HDNWwE', + trigger_name: 'test-query-trigger2', + state: 'ACTIVE', + error_message: null, + alert_history: [], + severity: '1', + action_execution_results: [], + start_time: 1636587463371, + last_notification_time: 1636587523370, + end_time: null, + acknowledged_time: null, + }, +]; + const runAllPromises = () => new Promise(setImmediate); describe('Dashboard', () => { @@ -43,7 +82,7 @@ describe('Dashboard', () => { jest.clearAllMocks(); }); - test('renders', () => { + test('renders with per alert view', () => { const resp = { ok: true, alerts: [], @@ -53,7 +92,56 @@ describe('Dashboard', () => { httpClientMock.get = jest.fn().mockImplementation(() => Promise.resolve(resp)); const wrapper = mount( - + + ); + + expect(wrapper).toMatchSnapshot(); + }); + + test('renders with alert by triggers view', () => { + const resp = { + ok: true, + alerts: [], + totalAlerts: 0, + }; + + httpClientMock.get = jest.fn().mockImplementation(() => Promise.resolve(resp)); + + const wrapper = mount( + + ); + + expect(wrapper).toMatchSnapshot(); + }); + + test('renders in flyout', () => { + const resp = { + ok: true, + alerts: [], + totalAlerts: 0, + }; + + httpClientMock.get = jest.fn().mockImplementation(() => Promise.resolve(resp)); + + const wrapper = mount( + ); expect(wrapper).toMatchSnapshot(); @@ -104,4 +192,31 @@ describe('Dashboard', () => { expect(wrapper.instance().state.alerts[0].alert_history).toStrictEqual([]); expect(wrapper.instance().state.alerts[0].error_message).toBe(''); }); + + test.skip('able to select single alert in flyout', () => { + const resp = { + ok: true, + alerts: [], + totalAlerts: 0, + }; + + httpClientMock.get = jest.fn().mockImplementation(() => Promise.resolve(resp)); + + const wrapper = mount( + + ); + //TODO: Figure out how to find the 1 acknowledge button out of 3 nodes + expect(wrapper.find('[data-test-subj="acknowledgeButton"]').is('[disabled]')).toBe(true); + wrapper + .find('[data-test-subj="checkboxSelectRow-Ciw2DH0B3-v9t8HD4m3Q-3"]') + .hostNodes() + .simulate('change'); + expect(wrapper.find('[data-test-subj="acknowledgeButton"]').is('[disabled]')).toBe(false); + }); }); diff --git a/public/pages/Dashboard/containers/__snapshots__/Dashboard.test.js.snap b/public/pages/Dashboard/containers/__snapshots__/Dashboard.test.js.snap index 5532eefe1..0476105c2 100644 --- a/public/pages/Dashboard/containers/__snapshots__/Dashboard.test.js.snap +++ b/public/pages/Dashboard/containers/__snapshots__/Dashboard.test.js.snap @@ -1,8 +1,48 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`Dashboard renders 1`] = ` +exports[`Dashboard renders in flyout 1`] = ` - View alert details - , - Alerts by triggers + Alerts
      @@ -139,53 +175,6 @@ exports[`Dashboard renders 1`] = ` > -
      - - - - - -
      -
      -
      - -
      - - -
      -
      - - - - -
      - - - - - -
      -
      -
      -
      -
      -
      -
      -
      @@ -863,27 +715,18 @@ exports[`Dashboard renders 1`] = ` columns={ Array [ Object { - "field": "total", - "name": "Alerts", + "dataType": "date", + "field": "start_time", + "name": "Alert start time", "render": [Function], "sortable": true, "truncateText": false, }, Object { - "field": "ACTIVE", - "name": "Active", - "sortable": true, - "truncateText": false, - }, - Object { - "field": "ACKNOWLEDGED", - "name": "Acknowledged", - "sortable": true, - "truncateText": false, - }, - Object { - "field": "ERROR", - "name": "Errors", + "dataType": "date", + "field": "end_time", + "name": "Alert end time", + "render": [Function], "sortable": true, "truncateText": false, }, @@ -895,34 +738,25 @@ exports[`Dashboard renders 1`] = ` "truncateText": true, }, Object { - "dataType": "date", - "field": "start_time", - "name": "Trigger start time", - "render": [Function], - "sortable": true, + "field": "severity", + "name": "Severity", + "sortable": false, "truncateText": false, }, Object { - "dataType": "date", - "field": "last_notification_time", - "name": "Trigger last updated", + "field": "state", + "name": "State", "render": [Function], - "sortable": true, - "truncateText": true, - }, - Object { - "field": "severity", - "name": "Severity", "sortable": false, "truncateText": false, }, Object { - "field": "monitor_name", - "name": "Monitor name", + "dataType": "date", + "field": "acknowledged_time", + "name": "Time acknowledged", "render": [Function], "sortable": true, - "textOnly": true, - "truncateText": true, + "truncateText": false, }, ] } @@ -931,6 +765,19 @@ exports[`Dashboard renders 1`] = ` items={Array []} noItemsMessage={} onChange={[Function]} + pagination={ + Object { + "pageIndex": 0, + "pageSize": 20, + "pageSizeOptions": Array [ + 5, + 10, + 20, + 50, + ], + "totalItemCount": 0, + } + } responsive={true} selection={ Object { @@ -1021,59 +868,31 @@ exports[`Dashboard renders 1`] = ` items={ Array [ Object { - "isSortAscending": undefined, - "isSorted": false, - "key": "_data_s_total_0", - "name": "Alerts", + "isSortAscending": false, + "isSorted": true, + "key": "_data_s_start_time_0", + "name": "Alert start time", "onSort": [Function], }, Object { "isSortAscending": undefined, "isSorted": false, - "key": "_data_s_ACTIVE_1", - "name": "Active", + "key": "_data_s_end_time_1", + "name": "Alert end time", "onSort": [Function], }, Object { "isSortAscending": undefined, "isSorted": false, - "key": "_data_s_ACKNOWLEDGED_2", - "name": "Acknowledged", + "key": "_data_s_trigger_name_2", + "name": "Trigger name", "onSort": [Function], }, Object { "isSortAscending": undefined, "isSorted": false, - "key": "_data_s_ERROR_3", - "name": "Errors", - "onSort": [Function], - }, - Object { - "isSortAscending": undefined, - "isSorted": false, - "key": "_data_s_trigger_name_4", - "name": "Trigger name", - "onSort": [Function], - }, - Object { - "isSortAscending": false, - "isSorted": true, - "key": "_data_s_start_time_5", - "name": "Trigger start time", - "onSort": [Function], - }, - Object { - "isSortAscending": undefined, - "isSorted": false, - "key": "_data_s_last_notification_time_6", - "name": "Trigger last updated", - "onSort": [Function], - }, - Object { - "isSortAscending": undefined, - "isSorted": false, - "key": "_data_s_monitor_name_8", - "name": "Monitor name", + "key": "_data_s_acknowledged_time_5", + "name": "Time acknowledged", "onSort": [Function], }, ] @@ -1258,16 +1077,17 @@ exports[`Dashboard renders 1`] = ` + + + Severity + + +
      - + + + State + + +
      +
      + + + +`; + +exports[`Dashboard renders with alert by triggers view 1`] = ` + + + View alert details + , + + Acknowledge + , + ] + } + bodyStyles={ + Object { + "padding": "initial", + } + } + title="Alerts by triggers" + titleSize="l" + > + +
      + +
      + +
      + +

      + Alerts by triggers +

      +
      +
      +
      + +
      + +
      + +
      + + + + + +
      +
      + +
      + + + + + +
      +
      +
      +
      +
      +
      +
      +
      + +
      + +
      + +
      + + +
      +
      +
      + + +
      + +
      + + +
      +
      + + + + +
      + + + + + +
      +
      +
      +
      +
      +
      +
      +
      + +
      + + +
      +
      + + + + +
      + + + + + +
      +
      +
      +
      +
      +
      +
      +
      + +
      + + +
      +
      + + + + +
      + + + + + +
      +
      +
      +
      +
      +
      +
      +
      + +
      + + + +
      +
      +
      +
      +
      + +
      +
      + } + onChange={[Function]} + responsive={true} + selection={ + Object { + "onSelectionChange": [Function], + "selectable": [Function], + "selectableMessage": [Function], + } + } + sorting={ + Object { + "sort": Object { + "direction": "desc", + "field": "start_time", + }, + } + } + tableLayout="fixed" + > +
      +
      + +
      + +
      + +
      + + +
      + +
      + +
      + + +
      + + +
      + +
      + + + + } + closePopover={[Function]} + display="inlineBlock" + hasArrow={true} + isOpen={false} + ownFocus={true} + panelPaddingSize="none" + > + +
      +
      + + + +
      +
      +
      +
      +
      +
      +
      +
      +
      + +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      + +
      +
      + + +
      + +
      +
      + + +
      +
      + + + + + + + + + + + + + + +
      + + + Severity + + +
      +
      + +
      +
      + + + + Create monitor + + } + body={ + +

      + There are no existing alerts. Create a monitor to add triggers and actions. Once an alarm is triggered, the state will show in this table. +

      +
      + } + style={ + Object { + "maxWidth": "45em", + } + } + > +
      + + + +
      + +
      +

      + There are no existing alerts. Create a monitor to add triggers and actions. Once an alarm is triggered, the state will show in this table. +

      +
      +
      +
      +
      +
      +
      + +
      + + + + + + +
      +
      +
      +
      +
      + +
      +
      + + + +`; + +exports[`Dashboard renders with per alert view 1`] = ` + + + Acknowledge + , + ] + } + bodyStyles={ + Object { + "padding": "initial", + } + } + title="Alerts" + titleSize="l" + > + +
      + +
      + +
      + +

      + Alerts +

      +
      +
      +
      + +
      + +
      + +
      + + + + + +
      +
      +
      +
      +
      +
      +
      +
      + +
      + +
      + +
      + + +
      +
      +
      + + +
      + +
      + + +
      +
      + + + + +
      + + + + + +
      +
      +
      +
      +
      +
      +
      +
      + +
      + + +
      +
      + + + + +
      + + + + + +
      +
      +
      +
      +
      +
      +
      +
      + +
      + + +
      +
      + + + + +
      + + + + + +
      +
      +
      +
      +
      +
      +
      +
      + +
      + + + +
      +
      +
      +
      +
      + +
      +
      + } + onChange={[Function]} + pagination={ + Object { + "pageIndex": 0, + "pageSize": 20, + "pageSizeOptions": Array [ + 5, + 10, + 20, + 50, + ], + "totalItemCount": 0, + } + } + responsive={true} + selection={ + Object { + "onSelectionChange": [Function], + "selectable": [Function], + "selectableMessage": [Function], + } + } + sorting={ + Object { + "sort": Object { + "direction": "desc", + "field": "start_time", + }, + } + } + tableLayout="fixed" + > +
      +
      + +
      + +
      + +
      + + +
      + +
      + +
      + + +
      + + +
      + +
      + + + + } + closePopover={[Function]} + display="inlineBlock" + hasArrow={true} + isOpen={false} + ownFocus={true} + panelPaddingSize="none" + > + +
      +
      + + + +
      +
      +
      +
      +
      +
      +
      +
      +
      + +
      + + + + + + + + + + + + + + + + + + + + + +
      + +
      +
      + + +
      + +
      +
      + + +
      +
      + + + + + +
      + + + State + + +
      +
      - Monitor name + Time acknowledged @@ -1830,12 +5067,12 @@ exports[`Dashboard renders 1`] = ` > /public/app.js', '!/public/actions/**', '!/public/components/Charts/Highlight/Highlight.js', '!/public/reducers/**', @@ -55,6 +56,10 @@ module.exports = { '!/scripts/**', '!/build/**', '!/gather-info.js', + '!/cypress/**', '!**/vendor/**', ], + clearMocks: true, + testPathIgnorePatterns: ['/build/', '/node_modules/'], + modulePathIgnorePatterns: ['alertingDashboards'], }; From aacf4130031ab55ca03eb97c7c4f3ac445016112 Mon Sep 17 00:00:00 2001 From: Annie Lee <71157062+leeyun-amzn@users.noreply.github.com> Date: Fri, 11 Feb 2022 10:13:34 -0800 Subject: [PATCH 12/22] Fix the error handling when config index is not found (#173) Signed-off-by: Annie Lee Signed-off-by: AWSHurneyt --- server/services/DestinationsService.js | 6 ++++++ server/services/MonitorService.js | 6 ++++++ server/services/utils/helpers.js | 10 +++++++++- 3 files changed, 21 insertions(+), 1 deletion(-) diff --git a/server/services/DestinationsService.js b/server/services/DestinationsService.js index 345c2b1ee..92bbfd98d 100644 --- a/server/services/DestinationsService.js +++ b/server/services/DestinationsService.js @@ -25,6 +25,7 @@ */ import _ from 'lodash'; +import { isIndexNotFoundError } from './utils/helpers'; export default class DestinationsService { constructor(esDriver) { @@ -198,6 +199,11 @@ export default class DestinationsService { }, }); } catch (err) { + if (isIndexNotFoundError(err)) { + return res.ok({ + body: { ok: true, resp: { totalDestinations: 0, destinations: [] } }, + }); + } return res.ok({ body: { ok: false, diff --git a/server/services/MonitorService.js b/server/services/MonitorService.js index b2567cdc9..a83979d87 100644 --- a/server/services/MonitorService.js +++ b/server/services/MonitorService.js @@ -27,6 +27,7 @@ import _ from 'lodash'; import { INDEX } from '../../utils/constants'; +import { isIndexNotFoundError } from './utils/helpers'; export default class MonitorService { constructor(esDriver) { @@ -350,6 +351,11 @@ export default class MonitorService { }); } catch (err) { console.error('Alerting - MonitorService - getMonitors', err); + if (isIndexNotFoundError(err)) { + return res.ok({ + body: { ok: false, resp: { totalMonitors: 0, monitors: [] } }, + }); + } return res.ok({ body: { ok: false, diff --git a/server/services/utils/helpers.js b/server/services/utils/helpers.js index e022e3381..fbf0f8630 100644 --- a/server/services/utils/helpers.js +++ b/server/services/utils/helpers.js @@ -24,7 +24,7 @@ * permissions and limitations under the License. */ -import { map, mapKeys, mapValues, isPlainObject, snakeCase, camelCase } from 'lodash'; +import { get, map, mapKeys, mapValues, isPlainObject, snakeCase, camelCase } from 'lodash'; export function mapKeysDeep(obj, fn) { if (Array.isArray(obj)) { @@ -39,3 +39,11 @@ export function mapKeysDeep(obj, fn) { export const toSnake = (value, key) => snakeCase(key); export const toCamel = (value, key) => camelCase(key); + +export const isIndexNotFoundError = (err) => { + return ( + err.statusCode === 404 && + get(err, 'body.error.reason', '') === + 'Configured indices are not found: [.opendistro-alerting-config]' + ); +}; From c2f76f8eb4482246e75eabc9174f61041a9215b3 Mon Sep 17 00:00:00 2001 From: AWSHurneyt <79280347+AWSHurneyt@users.noreply.github.com> Date: Thu, 17 Feb 2022 10:28:59 -0800 Subject: [PATCH 13/22] Updated copyright notices and headers. (#168) * Updated CONTRIBUTING.md and NOTICE files. Signed-off-by: AWSHurneyt <79280347+AWSHurneyt@users.noreply.github.com> * Updated license headers. Signed-off-by: AWSHurneyt <79280347+AWSHurneyt@users.noreply.github.com> Signed-off-by: AWSHurneyt --- CONTRIBUTING.md | 47 +------------------ NOTICE | 10 ---- cypress/integration/alert_spec.js | 23 +-------- .../alerts_dashboard_flyout_spec.js | 23 +-------- .../integration/bucket_level_monitor_spec.js | 23 +-------- cypress/integration/destination_spec.js | 23 +-------- .../integration/query_level_monitor_spec.js | 23 +-------- cypress/plugins/index.js | 23 +-------- cypress/support/commands.js | 23 +-------- cypress/support/constants.js | 23 +-------- cypress/support/index.js | 23 +-------- public/__tests__/index.js | 23 +-------- public/app.js | 23 +-------- .../AttributeEditor/AttributeEditor.js | 23 +-------- public/components/AttributeEditor/index.js | 23 +-------- public/components/Breadcrumbs/Breadcrumbs.js | 23 +-------- .../Breadcrumbs/Breadcrumbs.test.js | 23 +-------- public/components/Breadcrumbs/index.js | 23 +-------- .../ChartContainer/ChartContainer.js | 23 +-------- .../components/Charts/Highlight/Highlight.js | 23 +-------- .../components/ContentPanel/ContentPanel.js | 23 +-------- .../ContentPanel/ContentPanel.test.js | 23 +-------- public/components/ContentPanel/index.js | 23 +-------- .../components/DelayedLoader/DelayedLoader.js | 23 +-------- .../__tests__/DelayedLoader.test.js | 23 +-------- public/components/DelayedLoader/index.js | 23 +-------- public/components/Flyout/Flyout.js | 23 +-------- public/components/Flyout/Flyout.test.js | 23 +-------- .../Flyout/flyouts/alertsDashboard.js | 23 +-------- .../AlertsDashboardFlyoutComponent.js | 23 +-------- .../components/Flyout/flyouts/flyouts.test.js | 23 +-------- public/components/Flyout/flyouts/index.js | 23 +-------- public/components/Flyout/flyouts/message.js | 23 +-------- .../Flyout/flyouts/messageFrequency.js | 23 +-------- .../Flyout/flyouts/triggerCondition.js | 23 +-------- public/components/Flyout/index.js | 23 +-------- .../FormikCheckableCard.js | 8 +--- .../FormikCheckableCard.test.js | 8 +--- .../FormControls/FormikCheckableCard/index.js | 8 +--- .../FormikCheckbox/FormikCheckbox.js | 23 +-------- .../FormikCheckbox/FormikCheckbox.test.js | 23 +-------- .../FormControls/FormikCheckbox/index.js | 23 +-------- .../FormikCodeEditor/FormikCodeEditor.js | 23 +-------- .../FormikCodeEditor/FormikCodeEditor.test.js | 23 +-------- .../FormControls/FormikCodeEditor/index.js | 23 +-------- .../FormikComboBox/FormikComboBox.js | 23 +-------- .../FormikComboBox/FormikComboBox.test.js | 23 +-------- .../FormControls/FormikComboBox/index.js | 23 +-------- .../FormikFieldNumber/FormikFieldNumber.js | 23 +-------- .../FormikFieldNumber.test.js | 23 +-------- .../FormControls/FormikFieldNumber/index.js | 23 +-------- .../FormikFieldPassword.js | 23 +-------- .../FormikFieldPassword.test.js | 23 +-------- .../FormControls/FormikFieldPassword/index.js | 23 +-------- .../FormikFieldRadio/FormikFieldRadio.js | 23 +-------- .../FormControls/FormikFieldRadio/index.js | 23 +-------- .../FormikFieldText/FormikFieldText.js | 23 +-------- .../FormikFieldText/FormikFieldText.test.js | 23 +-------- .../FormControls/FormikFieldText/index.js | 23 +-------- .../FormikFormRow/FormikFormRow.js | 23 +-------- .../FormikFormRow/FormikFormRow.test.js | 23 +-------- .../FormControls/FormikFormRow/index.js | 23 +-------- .../FormikInputWrapper/FormikInputWrapper.js | 23 +-------- .../FormikInputWrapper.test.js | 23 +-------- .../FormControls/FormikInputWrapper/index.js | 23 +-------- .../FormControls/FormikSelect/FormikSelect.js | 23 +-------- .../FormikSelect/FormikSelect.test.js | 23 +-------- .../FormControls/FormikSelect/index.js | 23 +-------- .../FormControls/FormikSwitch/FormikSwitch.js | 23 +-------- .../FormikSwitch/FormikSwitch.test.js | 23 +-------- .../FormControls/FormikSwitch/index.js | 23 +-------- .../FormikTextArea/FormikTextArea.js | 23 +-------- .../FormikTextArea/FormikTextArea.test.js | 23 +-------- .../FormControls/FormikTextArea/index.js | 23 +-------- public/components/FormControls/index.js | 23 +-------- public/components/IconToolTip/IconToolTip.js | 8 +--- .../IconToolTip/IconToolTip.test.js | 8 +--- public/components/IconToolTip/index.js | 8 +--- public/components/SubHeader/SubHeader.js | 23 +-------- public/components/SubHeader/SubHeader.test.js | 23 +-------- public/components/SubHeader/index.js | 23 +-------- public/index.js | 23 +-------- public/less/main.less | 23 +-------- .../AnomaliesChart/AnomaliesChart.js | 23 +-------- .../AnomaliesChart/AnomaliesChart.test.js | 23 +-------- .../AnomalyDetectors/AnomaliesChart/index.js | 23 +-------- .../EmptyDetectorMessage.js | 23 +-------- .../EmptyFeaturesMessage.js | 23 +-------- .../EmptyFeaturesMessage.test.js | 23 +-------- .../FeatureChart/FeatureChart.js | 23 +-------- .../FeatureChart/FeatureChart.test.js | 8 +--- .../ExtractionQuery/ExtractionQuery.js | 23 +-------- .../ExtractionQuery/ExtractionQuery.test.js | 23 +-------- .../components/ExtractionQuery/index.js | 23 +-------- .../MonitorDefinition/MonitorDefinition.js | 8 +--- .../MonitorDefinition.test.js | 23 +-------- .../components/MonitorDefinition/index.js | 23 +-------- .../MonitorDefinitionCard.js | 23 +-------- .../MonitorDefinitionCard.test.js | 8 +--- .../components/MonitorDefinitionCard/index.js | 8 +--- .../MonitorExpressions/MonitorExpressions.js | 23 +-------- .../MonitorExpressions.test.js | 23 +-------- .../expressions/ForExpression.js | 23 +-------- .../expressions/ForExpression.test.js | 23 +-------- .../expressions/GroupByExpression.js | 23 +-------- .../expressions/GroupByItem.js | 8 +--- .../expressions/GroupByPopover.js | 8 +--- .../expressions/MetricExpression.js | 23 +-------- .../expressions/MetricItem.js | 8 +--- .../expressions/MetricPopover.js | 8 +--- .../expressions/OfExpression.js | 23 +-------- .../expressions/OfExpression.test.js | 23 +-------- .../expressions/OverExpression.js | 23 +-------- .../expressions/OverExpression.test.js | 23 +-------- .../expressions/WhenExpression.js | 23 +-------- .../expressions/WhenExpression.test.js | 23 +-------- .../expressions/WhereExpression.js | 23 +-------- .../expressions/WhereExpression.test.js | 23 +-------- .../MonitorExpressions/expressions/index.js | 23 +-------- .../expressions/utils/constants.js | 23 +-------- .../expressions/utils/dataTypes.js | 23 +-------- .../expressions/utils/helpers.js | 23 +-------- .../expressions/utils/whereHelpers.js | 23 +-------- .../expressions/utils/whereHelpers.test.js | 23 +-------- .../components/MonitorExpressions/index.js | 23 +-------- .../components/MonitorState/MonitorState.js | 23 +-------- .../MonitorState/MonitorState.test.js | 23 +-------- .../components/MonitorState/index.js | 23 +-------- .../MonitorTimeField/MonitorTimeField.js | 23 +-------- .../MonitorTimeField/MonitorTimeField.test.js | 23 +-------- .../components/MonitorTimeField/index.js | 23 +-------- .../MonitorTimeField/utils/validation.js | 23 +-------- .../components/MonitorType/MonitorType.js | 23 +-------- .../MonitorType/MonitorType.test.js | 8 +--- .../components/MonitorType/index.js | 23 +-------- .../QueryPerformance/QueryPerformance.js | 23 +-------- .../QueryPerformance/QueryPerformance.test.js | 23 +-------- .../components/QueryPerformance/index.js | 23 +-------- .../Schedule/Frequencies/CustomCron.js | 23 +-------- .../components/Schedule/Frequencies/Daily.js | 23 +-------- .../Schedule/Frequencies/Daily.test.js | 23 +-------- .../Schedule/Frequencies/Frequencies.test.js | 23 +-------- .../Schedule/Frequencies/Frequency.js | 23 +-------- .../Schedule/Frequencies/FrequencyPicker.js | 23 +-------- .../Schedule/Frequencies/Interval.js | 23 +-------- .../Schedule/Frequencies/Monthly.js | 23 +-------- .../Schedule/Frequencies/TimezoneComboBox.js | 23 +-------- .../components/Schedule/Frequencies/Weekly.js | 23 +-------- .../components/Schedule/Frequencies/index.js | 23 +-------- .../Schedule/Frequencies/utils/constants.js | 23 +-------- .../components/Schedule/Schedule.js | 23 +-------- .../components/Schedule/Schedule.test.js | 23 +-------- .../components/Schedule/index.js | 23 +-------- .../components/VisualGraph/VisualGraph.js | 23 +-------- .../VisualGraph/VisualGraph.test.js | 23 +-------- .../components/VisualGraph/index.js | 23 +-------- .../components/VisualGraph/utils/constants.js | 23 +-------- .../components/VisualGraph/utils/helpers.js | 23 +-------- .../VisualGraph/utils/helpers.test.js | 23 +-------- .../AnomalyDetectors/AnomalyDetectorData.js | 23 +-------- .../AnomalyDetectors/AnomalyDetectors.js | 23 +-------- .../__tests__/AnomalyDetector.test.js | 23 +-------- .../AnomalyDetectorPreviewData.test.js | 23 +-------- .../containers/AnomalyDetectors/index.js | 23 +-------- .../containers/CreateMonitor/CreateMonitor.js | 23 +-------- .../CreateMonitor/CreateMonitor.test.js | 23 +-------- .../containers/CreateMonitor/index.js | 23 +-------- .../CreateMonitor/utils/constants.js | 23 +-------- .../CreateMonitor/utils/formikToMonitor.js | 23 +-------- .../utils/formikToMonitor.test.js | 23 +-------- .../CreateMonitor/utils/monitorQueryParams.js | 23 +-------- .../CreateMonitor/utils/monitorToFormik.js | 23 +-------- .../utils/monitorToFormik.test.js | 23 +-------- .../CreateMonitor/utils/whereFilters.js | 23 +-------- .../containers/DataSource/DataSource.js | 23 +-------- .../containers/DataSource/DataSource.test.js | 8 +--- .../containers/DataSource/index.js | 8 +--- .../containers/DefineMonitor/DefineMonitor.js | 23 +-------- .../DefineMonitor/DefineMonitor.test.js | 23 +-------- .../containers/DefineMonitor/index.js | 23 +-------- .../DefineMonitor/utils/mappings.js | 23 +-------- .../DefineMonitor/utils/mappings.test.js | 23 +-------- .../DefineMonitor/utils/searchRequests.js | 23 +-------- .../MonitorDetails/MonitorDetails.js | 23 +-------- .../containers/MonitorDetails/index.js | 8 +--- .../containers/MonitorIndex/MonitorIndex.js | 23 +-------- .../MonitorIndex/MonitorIndex.test.js | 23 +-------- .../containers/MonitorIndex/index.js | 23 +-------- .../containers/MonitorIndex/utils/helpers.js | 23 +-------- public/pages/CreateMonitor/index.js | 23 +-------- .../CreateTrigger/components/Action/Action.js | 23 +-------- .../components/Action/actions/Message.js | 23 +-------- .../components/Action/actions/Message.test.js | 23 +-------- .../components/Action/actions/index.js | 23 +-------- .../CreateTrigger/components/Action/index.js | 23 +-------- .../components/Action/utils/constants.js | 23 +-------- .../components/Action/utils/validate.js | 8 +--- .../ActionEmptyPrompt/ActionEmptyPrompt.js | 23 +-------- .../components/ActionEmptyPrompt/index.js | 23 +-------- .../AddActionButton/AddActionButton.js | 23 +-------- .../components/AddActionButton/index.js | 23 +-------- .../AddTriggerButton/AddTriggerButton.js | 14 +----- .../components/AddTriggerButton/index.js | 14 +----- .../AddTriggerConditionButton.js | 14 +----- .../AddTriggerConditionButton/index.js | 14 +----- .../BucketLevelTriggerExpression.js | 23 +-------- .../BucketLevelTriggerExpression/index.js | 14 +----- .../components/BucketLevelTriggerGraph.js | 14 +----- .../BucketLevelTriggerQuery.js | 23 +-------- .../BucketLevelTriggerQuery/index.js | 14 +----- .../TriggerEmptyPrompt/TriggerEmptyPrompt.js | 23 +-------- .../components/TriggerEmptyPrompt/index.js | 14 +----- .../TriggerExpressions/TriggerExpressions.js | 23 +-------- .../TriggerExpressions.test.js | 23 +-------- .../components/TriggerExpressions/index.js | 23 +-------- .../CreateTrigger/components/TriggerGraph.js | 23 +-------- .../components/TriggerQuery/TriggerQuery.js | 23 +-------- .../TriggerQuery/TriggerQuery.test.js | 23 +-------- .../components/TriggerQuery/index.js | 23 +-------- .../ConfigureActions/ConfigureActions.js | 23 +-------- .../ConfigureActions/ConfigureActions.test.js | 23 +-------- .../containers/ConfigureActions/index.js | 23 +-------- .../ConfigureTriggers/ConfigureTriggers.js | 23 +-------- .../containers/ConfigureTriggers/index.js | 14 +----- .../CreateTrigger/CreateTrigger.js | 14 +----- .../CreateTrigger/CreateTrigger/index.js | 23 +-------- .../CreateTrigger/utils/constants.js | 23 +-------- .../CreateTrigger/utils/formikToTrigger.js | 23 +-------- .../utils/formikToTrigger.test.js | 23 +-------- .../CreateTrigger/utils/triggerToFormik.js | 23 +-------- .../DefineBucketLevelTrigger.js | 23 +-------- .../DefineBucketLevelTrigger/index.js | 14 +----- .../DefineTrigger/AnomalyDetectorTrigger.js | 23 +-------- .../containers/DefineTrigger/DefineTrigger.js | 23 +-------- .../containers/DefineTrigger/index.js | 23 +-------- .../DefineTrigger/utils/validation.js | 23 +-------- .../DefineTrigger/utils/validation.test.js | 23 +-------- public/pages/CreateTrigger/index.js | 23 +-------- public/pages/CreateTrigger/utils/constants.js | 23 +-------- .../DashboardControls/DashboardControls.js | 23 +-------- .../DashboardControls.test.js | 23 +-------- .../components/DashboardControls/index.js | 23 +-------- .../DashboardEmptyPrompt.js | 23 +-------- .../DashboardEmptyPrompt.test.js | 23 +-------- .../components/DashboardEmptyPrompt/index.js | 23 +-------- .../pages/Dashboard/containers/Dashboard.js | 23 +-------- .../Dashboard/containers/Dashboard.test.js | 23 +-------- public/pages/Dashboard/utils/constants.js | 8 +--- public/pages/Dashboard/utils/helpers.js | 23 +-------- public/pages/Dashboard/utils/helpers.test.js | 23 +-------- public/pages/Dashboard/utils/tableUtils.js | 23 +-------- .../DeleteConfirmation/DeleteConfirmation.js | 23 +-------- .../DeleteConfirmation.test.js | 23 +-------- .../DeleteConfirmation/index.js | 23 +-------- .../DestinationsActions.js | 23 +-------- .../DestinationsActions.test.js | 23 +-------- .../DestinationsActions/index.js | 23 +-------- .../DestinationsControls.js | 23 +-------- .../DestinationsControls.test.js | 23 +-------- .../DestinationsControls/index.js | 23 +-------- .../EmptyDestinations/EmptyDestinations.js | 23 +-------- .../EmptyDestinations.test.js | 23 +-------- .../EmptyDestinations/index.js | 23 +-------- .../components/DestinationsList/index.js | 23 +-------- .../AddEmailGroupButton.js | 23 +-------- .../AddSenderButton/AddSenderButton.js | 23 +-------- .../CustomWebhook/CustomWebhook.js | 23 +-------- .../CustomWebhook/HeaderParamsEditor.js | 23 +-------- .../CustomWebhook/MethodEditor.js | 8 +--- .../CustomWebhook/QueryParamsEditor.js | 23 +-------- .../CustomWebhook/URLInfo.js | 23 +-------- .../createDestinations/CustomWebhook/index.js | 23 +-------- .../CustomWebhook/validate.js | 23 +-------- .../CustomWebhook/validate.test.js | 23 +-------- .../createDestinations/Email/Email.js | 23 +-------- .../createDestinations/Email/EmailGroup.js | 23 +-------- .../createDestinations/Email/Sender.js | 23 +-------- .../createDestinations/Email/index.js | 23 +-------- .../Email/utils/constants.js | 23 +-------- .../Email/utils/validate.js | 23 +-------- .../EmailGroupEmptyPrompt.js | 23 +-------- .../EmailGroupEmptyPrompt/index.js | 23 +-------- .../SenderEmptyPrompt/SenderEmptyPrompt.js | 23 +-------- .../SenderEmptyPrompt/index.js | 23 +-------- .../createDestinations/Webhook/Webhook.js | 23 +-------- .../components/createDestinations/index.js | 23 +-------- .../CreateDestination/CreateDestination.js | 23 +-------- .../EmailRecipients/EmailRecipients.js | 23 +-------- .../EmailRecipients/index.js | 23 +-------- .../EmailRecipients/utils/constants.js | 23 +-------- .../EmailRecipients/utils/helpers.js | 23 +-------- .../EmailRecipients/utils/validate.js | 23 +-------- .../EmailSender/EmailSender.js | 23 +-------- .../CreateDestination/EmailSender/index.js | 23 +-------- .../EmailSender/utils/helpers.js | 23 +-------- .../EmailSender/utils/validate.js | 23 +-------- .../ManageEmailGroups/ManageEmailGroups.js | 23 +-------- .../ManageEmailGroups.test.js | 23 +-------- .../ManageEmailGroups/index.js | 23 +-------- .../ManageEmailGroups/utils/helpers.js | 23 +-------- .../ManageSenders/ManageSenders.js | 23 +-------- .../ManageSenders/ManageSenders.test.js | 23 +-------- .../CreateDestination/ManageSenders/index.js | 23 +-------- .../ManageSenders/utils/helpers.js | 23 +-------- .../containers/CreateDestination/index.js | 23 +-------- .../__tests__/destinationToFormik.test.js | 23 +-------- .../__tests__/formikToDestination.test.js | 23 +-------- .../utils/__tests__/validation.test.js | 23 +-------- .../CreateDestination/utils/constants.js | 23 +-------- .../utils/destinationToFormik.js | 23 +-------- .../utils/formikToDestination.js | 23 +-------- .../CreateDestination/utils/validations.js | 23 +-------- .../DestinationsList/DestinationsList.js | 23 +-------- .../DestinationsList/DestinationsList.test.js | 23 +-------- .../containers/DestinationsList/index.js | 23 +-------- .../utils/__tests__/helpers.test.js | 23 +-------- .../DestinationsList/utils/constants.js | 23 +-------- .../DestinationsList/utils/deleteHelpers.js | 23 +-------- .../DestinationsList/utils/helpers.js | 23 +-------- public/pages/Destinations/utils/constants.js | 23 +-------- public/pages/Destinations/utils/helpers.js | 23 +-------- public/pages/Home/Home.js | 23 +-------- public/pages/Home/Home.test.js | 23 +-------- public/pages/Home/index.js | 23 +-------- public/pages/Main/Main.js | 23 +-------- public/pages/Main/Main.test.js | 23 +-------- public/pages/Main/index.js | 23 +-------- .../EmptyHistory/EmptyHistory.js | 23 +-------- .../EmptyHistory/EmptyHistory.test.js | 23 +-------- .../MonitorHistory/Legend/Legend.js | 23 +-------- .../MonitorHistory/Legend/Legende.test.js | 23 +-------- .../MonitorHistory/POIChart/POIChart.js | 23 +-------- .../MonitorHistory/POIChart/POIChart.test.js | 23 +-------- .../TriggersTimeSeries/TriggersTimeSeries.js | 23 +-------- .../TriggersTimeSeries.test.js | 23 +-------- .../TriggersTimeSeries/utils/helpers.js | 23 +-------- .../TriggersTimeSeries/utils/helpers.test.js | 23 +-------- .../components/MonitorHistory/index.js | 23 +-------- .../MonitorOverview/MonitorOverview.js | 23 +-------- .../MonitorOverview/MonitorOverview.test.js | 23 +-------- .../components/MonitorOverview/index.js | 23 +-------- .../MonitorOverview/utils/constants.js | 23 +-------- .../MonitorOverview/utils/getOverviewStats.js | 23 +-------- .../utils/getOverviewStats.test.js | 23 +-------- .../utils/getScheduleFromMonitor.js | 23 +-------- .../utils/getScheduleFromMonitor.test.js | 23 +-------- .../components/OverviewStat/OverviewStat.js | 23 +-------- .../OverviewStat/OverviewStat.test.js | 23 +-------- .../components/OverviewStat/index.js | 23 +-------- .../AnomalyHistory/AnomalyHistory.js | 23 +-------- .../containers/MonitorDetails.js | 23 +-------- .../MonitorHistory/DateRangePicker.js | 23 +-------- .../MonitorHistory/MonitorHistory.js | 23 +-------- .../MonitorHistory/__mocks__/ui/chrome.js | 8 +--- .../__tests__/DateRangePicker.test.js | 23 +-------- .../__tests__/MonitorHistory.test.js | 23 +-------- .../MonitorHistory/__tests__/testHelpers.js | 23 +-------- .../containers/MonitorHistory/index.js | 23 +-------- .../utils/__tests__/chartHelpers.test.js | 23 +-------- .../utils/__tests__/timeUtils.test.js | 23 +-------- .../MonitorHistory/utils/chartHelpers.js | 23 +-------- .../MonitorHistory/utils/constants.js | 23 +-------- .../MonitorHistory/utils/timeUtils.js | 23 +-------- .../containers/Triggers/Triggers.js | 23 +-------- .../containers/Triggers/Triggers.test.js | 23 +-------- .../containers/Triggers/index.js | 23 +-------- .../containers/utils/__tests__/helper.test.js | 23 +-------- .../containers/utils/helpers.js | 23 +-------- .../AcknowledgeModal/AcknowledgeModal.js | 23 +-------- .../AcknowledgeModal/AcknowledgeModal.test.js | 23 +-------- .../components/AcknowledgeModal/index.js | 23 +-------- .../MonitorActions/MonitorActions.js | 23 +-------- .../MonitorActions/MonitorActions.test.js | 23 +-------- .../components/MonitorActions/index.js | 23 +-------- .../MonitorControls/MonitorControls.js | 23 +-------- .../components/MonitorControls/index.js | 23 +-------- .../MonitorEmptyPrompt/MonitorEmptyPrompt.js | 23 +-------- .../MonitorEmptyPrompt.test.js | 23 +-------- .../components/MonitorEmptyPrompt/index.js | 23 +-------- .../Monitors/containers/Monitors/Monitors.js | 23 +-------- .../containers/Monitors/Monitors.test.js | 23 +-------- .../Monitors/containers/Monitors/index.js | 23 +-------- .../containers/Monitors/utils/constants.js | 23 +-------- .../containers/Monitors/utils/helpers.js | 23 +-------- .../containers/Monitors/utils/tableUtils.js | 23 +-------- public/plugin.js | 23 +-------- public/utils/CoreContext.js | 23 +-------- public/utils/SubmitErrorHandler.js | 23 +-------- public/utils/constants.js | 23 +-------- public/utils/helpers.js | 23 +-------- public/utils/helpers.test.js | 23 +-------- public/utils/validate.js | 23 +-------- public/utils/validate.test.js | 23 +-------- server/clusters/alerting/adPlugin.js | 23 +-------- server/clusters/alerting/alertingPlugin.js | 23 +-------- .../alerting/createAlertingADCluster.js | 23 +-------- .../alerting/createAlertingCluster.js | 23 +-------- server/clusters/index.js | 23 +-------- server/index.js | 23 +-------- server/plugin.js | 23 +-------- server/routes/alerts.js | 23 +-------- server/routes/anomalyDetector.js | 23 +-------- server/routes/destinations.js | 23 +-------- server/routes/index.js | 23 +-------- server/routes/monitors.js | 23 +-------- server/routes/opensearch.js | 23 +-------- server/services/AlertService.js | 23 +-------- server/services/AnomalyDetectorService.js | 23 +-------- server/services/DestinationsService.js | 23 +-------- server/services/MonitorService.js | 23 +-------- server/services/OpensearchService.js | 23 +-------- server/services/index.js | 23 +-------- .../utils/__tests__/adHelpers.test.js | 23 +-------- .../services/utils/__tests__/helpers.test.js | 23 +-------- server/services/utils/adHelpers.js | 23 +-------- server/services/utils/constants.js | 23 +-------- server/services/utils/helpers.js | 23 +-------- test/enzyme.js | 23 +-------- test/functional/config.js | 23 +-------- .../functional/pageObjects/alerting-common.js | 23 +-------- test/functional/pageObjects/index.js | 23 +-------- test/functional/tests/alerting-app.js | 23 +-------- test/functional/tests/index.js | 23 +-------- test/jest.config.js | 23 +-------- test/mocks/CoreMock.js | 23 +-------- test/mocks/historyMock.js | 23 +-------- test/mocks/httpClientMock.js | 23 +-------- test/mocks/index.js | 23 +-------- test/mocks/styleMock.js | 23 +-------- test/polyfills.js | 23 +-------- test/polyfills/mutationObserver.js | 8 +--- test/setup.jest.js | 23 +-------- test/setupTests.js | 23 +-------- test/utils/helpers.js | 8 +--- utils/constants.js | 8 +--- 435 files changed, 446 insertions(+), 9096 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 0f5868e36..2562cbbf1 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,47 +1,4 @@ -## Contributing to OpenSearch +## Contributing to this Project OpenSearch is a community project that is built and maintained by people just like **you**. -[This document](https://github.com/opensearch-project/.github/blob/main/CONTRIBUTING.md) explains how you can contribute to this and related projects. - -## Developer Certificate of Origin - -OpenSearch is an open source product released under the Apache 2.0 license (see either [the Apache](https://www.apache.org/licenses/LICENSE-2.0) site or the [LICENSE.txt file](https://github.com/opensearch-project/.github/blob/main/LICENSE.txt)). The Apache 2.0 license allows you to freely use, modify, distribute, and sell your own products that include Apache 2.0 licensed software. - -We respect intellectual property rights of others and we want to make sure all incoming contributions are correctly attributed and licensed. A Developer Certificate of Origin (DCO) is a lightweight mechanism to do that. - -The DCO is a declaration attached to every contribution made by every developer. In the commit message of the contribution, the developer simply adds a `Signed-off-by` statement and thereby agrees to the DCO, which you can find below or at [DeveloperCertificate.org](http://developercertificate.org/). -```` -Developer's Certificate of Origin 1.1 - -By making a contribution to this project, I certify that: - -(a) The contribution was created in whole or in part by me and I -have the right to submit it under the open source license -indicated in the file; or - -(b) The contribution is based upon previous work that, to the -best of my knowledge, is covered under an appropriate open -source license and I have the right under that license to -submit that work with modifications, whether created in whole -or in part by me, under the same open source license (unless -I am permitted to submit under a different license), as -Indicated in the file; or - -(c) The contribution was provided directly to me by some other -person who certified (a), (b) or (c) and I have not modified -it. - -(d) I understand and agree that this project and the contribution -are public and that a record of the contribution (including -all personal information I submit with it, including my -sign-off) is maintained indefinitely and may be redistributed -consistent with this project or the open source license(s) -involved. -```` -We require that every contribution to OpenSearch is signed with a Developer Certificate of Origin. Additionally, please use your real name. We do not accept anonymous contributors nor those utilizing pseudonyms. - -Each commit must include a DCO which looks like this -```` -Signed-off-by: Jane Smith -```` -You may type this line on your own when writing your commit messages. However, if your user.name and user.email are set in your git configs, you can use `-s` or `–-signoff` to add the `Signed-off-by` line to the end of the commit message. \ No newline at end of file +[This document](https://github.com/opensearch-project/.github/blob/main/CONTRIBUTING.md) explains how you can contribute to this and related projects. \ No newline at end of file diff --git a/NOTICE b/NOTICE index 6c7dc983f..731cb6006 100644 --- a/NOTICE +++ b/NOTICE @@ -1,12 +1,2 @@ OpenSearch (https://opensearch.org/) Copyright OpenSearch Contributors - -This product includes software developed by -Elasticsearch (http://www.elastic.co). -Copyright 2009-2018 Elasticsearch - -This product includes software developed by The Apache Software -Foundation (http://www.apache.org/). - -This product includes software developed by -Joda.org (http://www.joda.org/). diff --git a/cypress/integration/alert_spec.js b/cypress/integration/alert_spec.js index a57e24aed..609815f29 100644 --- a/cypress/integration/alert_spec.js +++ b/cypress/integration/alert_spec.js @@ -1,27 +1,6 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. */ import { PLUGIN_NAME } from '../support/constants'; diff --git a/cypress/integration/alerts_dashboard_flyout_spec.js b/cypress/integration/alerts_dashboard_flyout_spec.js index 4c107ef71..478fdc2f3 100644 --- a/cypress/integration/alerts_dashboard_flyout_spec.js +++ b/cypress/integration/alerts_dashboard_flyout_spec.js @@ -1,27 +1,6 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Copyright 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. */ import React from 'react'; diff --git a/cypress/integration/bucket_level_monitor_spec.js b/cypress/integration/bucket_level_monitor_spec.js index 59feb9e13..274bc2e62 100644 --- a/cypress/integration/bucket_level_monitor_spec.js +++ b/cypress/integration/bucket_level_monitor_spec.js @@ -1,27 +1,6 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Copyright 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. */ import { INDEX, PLUGIN_NAME } from '../support/constants'; diff --git a/cypress/integration/destination_spec.js b/cypress/integration/destination_spec.js index 11c6d609c..a30f9101d 100644 --- a/cypress/integration/destination_spec.js +++ b/cypress/integration/destination_spec.js @@ -1,27 +1,6 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. */ import { PLUGIN_NAME } from '../support/constants'; diff --git a/cypress/integration/query_level_monitor_spec.js b/cypress/integration/query_level_monitor_spec.js index a1a703f3d..bcd5d2e72 100644 --- a/cypress/integration/query_level_monitor_spec.js +++ b/cypress/integration/query_level_monitor_spec.js @@ -1,27 +1,6 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Copyright 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. */ import { PLUGIN_NAME } from '../support/constants'; diff --git a/cypress/plugins/index.js b/cypress/plugins/index.js index 2cb92dbe7..ddaa17210 100644 --- a/cypress/plugins/index.js +++ b/cypress/plugins/index.js @@ -1,27 +1,6 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. */ /// diff --git a/cypress/support/commands.js b/cypress/support/commands.js index a2defb9f0..0188b9925 100644 --- a/cypress/support/commands.js +++ b/cypress/support/commands.js @@ -1,27 +1,6 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. */ const { API, ADMIN_AUTH } = require('./constants'); diff --git a/cypress/support/constants.js b/cypress/support/constants.js index 2b9519653..9bd0c7a9f 100644 --- a/cypress/support/constants.js +++ b/cypress/support/constants.js @@ -1,27 +1,6 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. */ export const API_ROUTE_PREFIX = '/_plugins/_alerting'; diff --git a/cypress/support/index.js b/cypress/support/index.js index 7936c7edb..ac0cbfcc1 100644 --- a/cypress/support/index.js +++ b/cypress/support/index.js @@ -1,27 +1,6 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. */ // *********************************************************** diff --git a/public/__tests__/index.js b/public/__tests__/index.js index 97042c4d8..1e7a215e6 100644 --- a/public/__tests__/index.js +++ b/public/__tests__/index.js @@ -1,27 +1,6 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. */ import expect from 'expect.js'; diff --git a/public/app.js b/public/app.js index d155735b4..6d5e98abc 100644 --- a/public/app.js +++ b/public/app.js @@ -1,27 +1,6 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. */ import React from 'react'; diff --git a/public/components/AttributeEditor/AttributeEditor.js b/public/components/AttributeEditor/AttributeEditor.js index f0fe7085f..d14a71863 100644 --- a/public/components/AttributeEditor/AttributeEditor.js +++ b/public/components/AttributeEditor/AttributeEditor.js @@ -1,27 +1,6 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. */ import React from 'react'; diff --git a/public/components/AttributeEditor/index.js b/public/components/AttributeEditor/index.js index a911fc1b9..c39cf1ef1 100644 --- a/public/components/AttributeEditor/index.js +++ b/public/components/AttributeEditor/index.js @@ -1,27 +1,6 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. */ import AttributeEditor from './AttributeEditor'; diff --git a/public/components/Breadcrumbs/Breadcrumbs.js b/public/components/Breadcrumbs/Breadcrumbs.js index fb7457cd4..3ba41a8ff 100644 --- a/public/components/Breadcrumbs/Breadcrumbs.js +++ b/public/components/Breadcrumbs/Breadcrumbs.js @@ -1,27 +1,6 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. */ import React, { Component } from 'react'; diff --git a/public/components/Breadcrumbs/Breadcrumbs.test.js b/public/components/Breadcrumbs/Breadcrumbs.test.js index 0811d28ca..002d855ba 100644 --- a/public/components/Breadcrumbs/Breadcrumbs.test.js +++ b/public/components/Breadcrumbs/Breadcrumbs.test.js @@ -1,27 +1,6 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. */ import React from 'react'; diff --git a/public/components/Breadcrumbs/index.js b/public/components/Breadcrumbs/index.js index aa1fdbb96..ae1f37950 100644 --- a/public/components/Breadcrumbs/index.js +++ b/public/components/Breadcrumbs/index.js @@ -1,27 +1,6 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. */ import Breadcrumbs from './Breadcrumbs'; diff --git a/public/components/ChartContainer/ChartContainer.js b/public/components/ChartContainer/ChartContainer.js index dfca3cb2a..84cd526eb 100644 --- a/public/components/ChartContainer/ChartContainer.js +++ b/public/components/ChartContainer/ChartContainer.js @@ -1,27 +1,6 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. */ import PropTypes from 'prop-types'; diff --git a/public/components/Charts/Highlight/Highlight.js b/public/components/Charts/Highlight/Highlight.js index 9c703715e..63c3a6137 100644 --- a/public/components/Charts/Highlight/Highlight.js +++ b/public/components/Charts/Highlight/Highlight.js @@ -1,27 +1,6 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. */ /* diff --git a/public/components/ContentPanel/ContentPanel.js b/public/components/ContentPanel/ContentPanel.js index 93d0a3980..6c30f2e82 100644 --- a/public/components/ContentPanel/ContentPanel.js +++ b/public/components/ContentPanel/ContentPanel.js @@ -1,27 +1,6 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. */ import React from 'react'; diff --git a/public/components/ContentPanel/ContentPanel.test.js b/public/components/ContentPanel/ContentPanel.test.js index d6f84389e..2e6dbc9e7 100644 --- a/public/components/ContentPanel/ContentPanel.test.js +++ b/public/components/ContentPanel/ContentPanel.test.js @@ -1,27 +1,6 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. */ import React from 'react'; diff --git a/public/components/ContentPanel/index.js b/public/components/ContentPanel/index.js index cf1236eb2..f3a1aa28e 100644 --- a/public/components/ContentPanel/index.js +++ b/public/components/ContentPanel/index.js @@ -1,27 +1,6 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. */ import ContentPanel from './ContentPanel'; diff --git a/public/components/DelayedLoader/DelayedLoader.js b/public/components/DelayedLoader/DelayedLoader.js index 90fd4367c..2fd87bfa4 100644 --- a/public/components/DelayedLoader/DelayedLoader.js +++ b/public/components/DelayedLoader/DelayedLoader.js @@ -1,27 +1,6 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. */ import React from 'react'; diff --git a/public/components/DelayedLoader/__tests__/DelayedLoader.test.js b/public/components/DelayedLoader/__tests__/DelayedLoader.test.js index e46fc72f5..9787dc08a 100644 --- a/public/components/DelayedLoader/__tests__/DelayedLoader.test.js +++ b/public/components/DelayedLoader/__tests__/DelayedLoader.test.js @@ -1,27 +1,6 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. */ import React from 'react'; diff --git a/public/components/DelayedLoader/index.js b/public/components/DelayedLoader/index.js index 20a79a642..842bd0fcb 100644 --- a/public/components/DelayedLoader/index.js +++ b/public/components/DelayedLoader/index.js @@ -1,27 +1,6 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. */ import DelayedLoader from './DelayedLoader'; diff --git a/public/components/Flyout/Flyout.js b/public/components/Flyout/Flyout.js index ef62bf108..b0cd5dc1c 100644 --- a/public/components/Flyout/Flyout.js +++ b/public/components/Flyout/Flyout.js @@ -1,27 +1,6 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. */ import React from 'react'; diff --git a/public/components/Flyout/Flyout.test.js b/public/components/Flyout/Flyout.test.js index b59c7544e..c4f5cad2b 100644 --- a/public/components/Flyout/Flyout.test.js +++ b/public/components/Flyout/Flyout.test.js @@ -1,27 +1,6 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. */ import React from 'react'; diff --git a/public/components/Flyout/flyouts/alertsDashboard.js b/public/components/Flyout/flyouts/alertsDashboard.js index eeabf967f..e2955dec4 100644 --- a/public/components/Flyout/flyouts/alertsDashboard.js +++ b/public/components/Flyout/flyouts/alertsDashboard.js @@ -1,27 +1,6 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Copyright 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. */ import React from 'react'; diff --git a/public/components/Flyout/flyouts/components/AlertsDashboardFlyoutComponent.js b/public/components/Flyout/flyouts/components/AlertsDashboardFlyoutComponent.js index d8c1619b7..ebd3b0878 100644 --- a/public/components/Flyout/flyouts/components/AlertsDashboardFlyoutComponent.js +++ b/public/components/Flyout/flyouts/components/AlertsDashboardFlyoutComponent.js @@ -1,27 +1,6 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Copyright 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. */ import React, { Component } from 'react'; diff --git a/public/components/Flyout/flyouts/flyouts.test.js b/public/components/Flyout/flyouts/flyouts.test.js index 1f500d855..d7da27bb7 100644 --- a/public/components/Flyout/flyouts/flyouts.test.js +++ b/public/components/Flyout/flyouts/flyouts.test.js @@ -1,27 +1,6 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. */ import React from 'react'; diff --git a/public/components/Flyout/flyouts/index.js b/public/components/Flyout/flyouts/index.js index 612848c3d..90b7aff9f 100644 --- a/public/components/Flyout/flyouts/index.js +++ b/public/components/Flyout/flyouts/index.js @@ -1,27 +1,6 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Copyright 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. */ import message from './message'; diff --git a/public/components/Flyout/flyouts/message.js b/public/components/Flyout/flyouts/message.js index c174c2b75..949a2a248 100644 --- a/public/components/Flyout/flyouts/message.js +++ b/public/components/Flyout/flyouts/message.js @@ -1,27 +1,6 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Copyright 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. */ import React from 'react'; diff --git a/public/components/Flyout/flyouts/messageFrequency.js b/public/components/Flyout/flyouts/messageFrequency.js index 4f01df1e2..07e6abfcf 100644 --- a/public/components/Flyout/flyouts/messageFrequency.js +++ b/public/components/Flyout/flyouts/messageFrequency.js @@ -1,27 +1,6 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. */ import React from 'react'; diff --git a/public/components/Flyout/flyouts/triggerCondition.js b/public/components/Flyout/flyouts/triggerCondition.js index e26d12ecd..d2aa79fa5 100644 --- a/public/components/Flyout/flyouts/triggerCondition.js +++ b/public/components/Flyout/flyouts/triggerCondition.js @@ -1,27 +1,6 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. */ import React from 'react'; diff --git a/public/components/Flyout/index.js b/public/components/Flyout/index.js index a1e5dfb00..8f1e8111a 100644 --- a/public/components/Flyout/index.js +++ b/public/components/Flyout/index.js @@ -1,27 +1,6 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. */ import Flyout from './Flyout'; diff --git a/public/components/FormControls/FormikCheckableCard/FormikCheckableCard.js b/public/components/FormControls/FormikCheckableCard/FormikCheckableCard.js index 1fc15bfc7..e8e6382aa 100644 --- a/public/components/FormControls/FormikCheckableCard/FormikCheckableCard.js +++ b/public/components/FormControls/FormikCheckableCard/FormikCheckableCard.js @@ -1,12 +1,6 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. */ import React from 'react'; diff --git a/public/components/FormControls/FormikCheckableCard/FormikCheckableCard.test.js b/public/components/FormControls/FormikCheckableCard/FormikCheckableCard.test.js index 90c9f8efd..5efcb6170 100644 --- a/public/components/FormControls/FormikCheckableCard/FormikCheckableCard.test.js +++ b/public/components/FormControls/FormikCheckableCard/FormikCheckableCard.test.js @@ -1,12 +1,6 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. */ import React from 'react'; diff --git a/public/components/FormControls/FormikCheckableCard/index.js b/public/components/FormControls/FormikCheckableCard/index.js index e6d83e68b..7cda3fe3d 100644 --- a/public/components/FormControls/FormikCheckableCard/index.js +++ b/public/components/FormControls/FormikCheckableCard/index.js @@ -1,12 +1,6 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. */ import FormikCheckableCard from './FormikCheckableCard'; diff --git a/public/components/FormControls/FormikCheckbox/FormikCheckbox.js b/public/components/FormControls/FormikCheckbox/FormikCheckbox.js index e9121f015..b107e1206 100644 --- a/public/components/FormControls/FormikCheckbox/FormikCheckbox.js +++ b/public/components/FormControls/FormikCheckbox/FormikCheckbox.js @@ -1,27 +1,6 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. */ import React from 'react'; diff --git a/public/components/FormControls/FormikCheckbox/FormikCheckbox.test.js b/public/components/FormControls/FormikCheckbox/FormikCheckbox.test.js index e188e14d8..7403c681e 100644 --- a/public/components/FormControls/FormikCheckbox/FormikCheckbox.test.js +++ b/public/components/FormControls/FormikCheckbox/FormikCheckbox.test.js @@ -1,27 +1,6 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. */ import React from 'react'; diff --git a/public/components/FormControls/FormikCheckbox/index.js b/public/components/FormControls/FormikCheckbox/index.js index 7caf9d3d2..51e625423 100644 --- a/public/components/FormControls/FormikCheckbox/index.js +++ b/public/components/FormControls/FormikCheckbox/index.js @@ -1,27 +1,6 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. */ import FormikCheckbox from './FormikCheckbox'; diff --git a/public/components/FormControls/FormikCodeEditor/FormikCodeEditor.js b/public/components/FormControls/FormikCodeEditor/FormikCodeEditor.js index c4944bf56..c97301d74 100644 --- a/public/components/FormControls/FormikCodeEditor/FormikCodeEditor.js +++ b/public/components/FormControls/FormikCodeEditor/FormikCodeEditor.js @@ -1,27 +1,6 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. */ import React from 'react'; diff --git a/public/components/FormControls/FormikCodeEditor/FormikCodeEditor.test.js b/public/components/FormControls/FormikCodeEditor/FormikCodeEditor.test.js index 95013b9e6..d1cac01ef 100644 --- a/public/components/FormControls/FormikCodeEditor/FormikCodeEditor.test.js +++ b/public/components/FormControls/FormikCodeEditor/FormikCodeEditor.test.js @@ -1,27 +1,6 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. */ import React from 'react'; diff --git a/public/components/FormControls/FormikCodeEditor/index.js b/public/components/FormControls/FormikCodeEditor/index.js index b162cc598..1472218d6 100644 --- a/public/components/FormControls/FormikCodeEditor/index.js +++ b/public/components/FormControls/FormikCodeEditor/index.js @@ -1,27 +1,6 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. */ import FormikCodeEditor from './FormikCodeEditor'; diff --git a/public/components/FormControls/FormikComboBox/FormikComboBox.js b/public/components/FormControls/FormikComboBox/FormikComboBox.js index 2e39556db..61e569775 100644 --- a/public/components/FormControls/FormikComboBox/FormikComboBox.js +++ b/public/components/FormControls/FormikComboBox/FormikComboBox.js @@ -1,27 +1,6 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. */ import React from 'react'; diff --git a/public/components/FormControls/FormikComboBox/FormikComboBox.test.js b/public/components/FormControls/FormikComboBox/FormikComboBox.test.js index 65e76904a..530098606 100644 --- a/public/components/FormControls/FormikComboBox/FormikComboBox.test.js +++ b/public/components/FormControls/FormikComboBox/FormikComboBox.test.js @@ -1,27 +1,6 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. */ import React from 'react'; diff --git a/public/components/FormControls/FormikComboBox/index.js b/public/components/FormControls/FormikComboBox/index.js index 893dbc701..74d4a45f4 100644 --- a/public/components/FormControls/FormikComboBox/index.js +++ b/public/components/FormControls/FormikComboBox/index.js @@ -1,27 +1,6 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. */ import FormikComboBox from './FormikComboBox'; diff --git a/public/components/FormControls/FormikFieldNumber/FormikFieldNumber.js b/public/components/FormControls/FormikFieldNumber/FormikFieldNumber.js index 44d64eb3a..fa64c722a 100644 --- a/public/components/FormControls/FormikFieldNumber/FormikFieldNumber.js +++ b/public/components/FormControls/FormikFieldNumber/FormikFieldNumber.js @@ -1,27 +1,6 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. */ import React from 'react'; diff --git a/public/components/FormControls/FormikFieldNumber/FormikFieldNumber.test.js b/public/components/FormControls/FormikFieldNumber/FormikFieldNumber.test.js index c9ead3165..80aa79145 100644 --- a/public/components/FormControls/FormikFieldNumber/FormikFieldNumber.test.js +++ b/public/components/FormControls/FormikFieldNumber/FormikFieldNumber.test.js @@ -1,27 +1,6 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. */ import React from 'react'; diff --git a/public/components/FormControls/FormikFieldNumber/index.js b/public/components/FormControls/FormikFieldNumber/index.js index 1100a755f..0fd9f8c1f 100644 --- a/public/components/FormControls/FormikFieldNumber/index.js +++ b/public/components/FormControls/FormikFieldNumber/index.js @@ -1,27 +1,6 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. */ import FormikFieldNumber from './FormikFieldNumber'; diff --git a/public/components/FormControls/FormikFieldPassword/FormikFieldPassword.js b/public/components/FormControls/FormikFieldPassword/FormikFieldPassword.js index e3dde5b20..9f25f2eb1 100644 --- a/public/components/FormControls/FormikFieldPassword/FormikFieldPassword.js +++ b/public/components/FormControls/FormikFieldPassword/FormikFieldPassword.js @@ -1,27 +1,6 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. */ import React from 'react'; diff --git a/public/components/FormControls/FormikFieldPassword/FormikFieldPassword.test.js b/public/components/FormControls/FormikFieldPassword/FormikFieldPassword.test.js index e9634c636..d81af52be 100644 --- a/public/components/FormControls/FormikFieldPassword/FormikFieldPassword.test.js +++ b/public/components/FormControls/FormikFieldPassword/FormikFieldPassword.test.js @@ -1,27 +1,6 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. */ import React from 'react'; diff --git a/public/components/FormControls/FormikFieldPassword/index.js b/public/components/FormControls/FormikFieldPassword/index.js index 2cf41aafe..7e9ee3855 100644 --- a/public/components/FormControls/FormikFieldPassword/index.js +++ b/public/components/FormControls/FormikFieldPassword/index.js @@ -1,27 +1,6 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. */ import FormikFieldPassword from './FormikFieldPassword'; diff --git a/public/components/FormControls/FormikFieldRadio/FormikFieldRadio.js b/public/components/FormControls/FormikFieldRadio/FormikFieldRadio.js index 64cc5fef2..30936cd30 100644 --- a/public/components/FormControls/FormikFieldRadio/FormikFieldRadio.js +++ b/public/components/FormControls/FormikFieldRadio/FormikFieldRadio.js @@ -1,27 +1,6 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. */ import React from 'react'; diff --git a/public/components/FormControls/FormikFieldRadio/index.js b/public/components/FormControls/FormikFieldRadio/index.js index d90754c18..7f064f86c 100644 --- a/public/components/FormControls/FormikFieldRadio/index.js +++ b/public/components/FormControls/FormikFieldRadio/index.js @@ -1,27 +1,6 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. */ import FormikFieldRadio from './FormikFieldRadio'; diff --git a/public/components/FormControls/FormikFieldText/FormikFieldText.js b/public/components/FormControls/FormikFieldText/FormikFieldText.js index 7a8cb6fdd..32a2fb5f4 100644 --- a/public/components/FormControls/FormikFieldText/FormikFieldText.js +++ b/public/components/FormControls/FormikFieldText/FormikFieldText.js @@ -1,27 +1,6 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. */ import React from 'react'; diff --git a/public/components/FormControls/FormikFieldText/FormikFieldText.test.js b/public/components/FormControls/FormikFieldText/FormikFieldText.test.js index 45be79a53..69bb989be 100644 --- a/public/components/FormControls/FormikFieldText/FormikFieldText.test.js +++ b/public/components/FormControls/FormikFieldText/FormikFieldText.test.js @@ -1,27 +1,6 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. */ import React from 'react'; diff --git a/public/components/FormControls/FormikFieldText/index.js b/public/components/FormControls/FormikFieldText/index.js index 1fcb50481..1ce018e24 100644 --- a/public/components/FormControls/FormikFieldText/index.js +++ b/public/components/FormControls/FormikFieldText/index.js @@ -1,27 +1,6 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. */ import FormikFieldText from './FormikFieldText'; diff --git a/public/components/FormControls/FormikFormRow/FormikFormRow.js b/public/components/FormControls/FormikFormRow/FormikFormRow.js index 3a42e18d4..9de0b7a3a 100644 --- a/public/components/FormControls/FormikFormRow/FormikFormRow.js +++ b/public/components/FormControls/FormikFormRow/FormikFormRow.js @@ -1,27 +1,6 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. */ import React from 'react'; diff --git a/public/components/FormControls/FormikFormRow/FormikFormRow.test.js b/public/components/FormControls/FormikFormRow/FormikFormRow.test.js index f0975b331..aee0441e7 100644 --- a/public/components/FormControls/FormikFormRow/FormikFormRow.test.js +++ b/public/components/FormControls/FormikFormRow/FormikFormRow.test.js @@ -1,27 +1,6 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. */ import React from 'react'; diff --git a/public/components/FormControls/FormikFormRow/index.js b/public/components/FormControls/FormikFormRow/index.js index ca99b4d67..e1e02f9fd 100644 --- a/public/components/FormControls/FormikFormRow/index.js +++ b/public/components/FormControls/FormikFormRow/index.js @@ -1,27 +1,6 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. */ import FormikFormRow from './FormikFormRow'; diff --git a/public/components/FormControls/FormikInputWrapper/FormikInputWrapper.js b/public/components/FormControls/FormikInputWrapper/FormikInputWrapper.js index f84613e33..f17edd8cc 100644 --- a/public/components/FormControls/FormikInputWrapper/FormikInputWrapper.js +++ b/public/components/FormControls/FormikInputWrapper/FormikInputWrapper.js @@ -1,27 +1,6 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. */ import React from 'react'; diff --git a/public/components/FormControls/FormikInputWrapper/FormikInputWrapper.test.js b/public/components/FormControls/FormikInputWrapper/FormikInputWrapper.test.js index 0c5c76fe1..fb1e39f45 100644 --- a/public/components/FormControls/FormikInputWrapper/FormikInputWrapper.test.js +++ b/public/components/FormControls/FormikInputWrapper/FormikInputWrapper.test.js @@ -1,27 +1,6 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. */ import React from 'react'; diff --git a/public/components/FormControls/FormikInputWrapper/index.js b/public/components/FormControls/FormikInputWrapper/index.js index 578f40d88..31d47b37b 100644 --- a/public/components/FormControls/FormikInputWrapper/index.js +++ b/public/components/FormControls/FormikInputWrapper/index.js @@ -1,27 +1,6 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. */ import FormikInputWrapper from './FormikInputWrapper'; diff --git a/public/components/FormControls/FormikSelect/FormikSelect.js b/public/components/FormControls/FormikSelect/FormikSelect.js index c3d3ee75a..218fce5a1 100644 --- a/public/components/FormControls/FormikSelect/FormikSelect.js +++ b/public/components/FormControls/FormikSelect/FormikSelect.js @@ -1,27 +1,6 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. */ import React from 'react'; diff --git a/public/components/FormControls/FormikSelect/FormikSelect.test.js b/public/components/FormControls/FormikSelect/FormikSelect.test.js index e3502d01d..1b15b5583 100644 --- a/public/components/FormControls/FormikSelect/FormikSelect.test.js +++ b/public/components/FormControls/FormikSelect/FormikSelect.test.js @@ -1,27 +1,6 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. */ import React from 'react'; diff --git a/public/components/FormControls/FormikSelect/index.js b/public/components/FormControls/FormikSelect/index.js index f37c95ded..11eb4faa2 100644 --- a/public/components/FormControls/FormikSelect/index.js +++ b/public/components/FormControls/FormikSelect/index.js @@ -1,27 +1,6 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. */ import FormikSelect from './FormikSelect'; diff --git a/public/components/FormControls/FormikSwitch/FormikSwitch.js b/public/components/FormControls/FormikSwitch/FormikSwitch.js index 51001f7df..25538905b 100644 --- a/public/components/FormControls/FormikSwitch/FormikSwitch.js +++ b/public/components/FormControls/FormikSwitch/FormikSwitch.js @@ -1,27 +1,6 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. */ import React from 'react'; diff --git a/public/components/FormControls/FormikSwitch/FormikSwitch.test.js b/public/components/FormControls/FormikSwitch/FormikSwitch.test.js index 8e5d8b685..665abad27 100644 --- a/public/components/FormControls/FormikSwitch/FormikSwitch.test.js +++ b/public/components/FormControls/FormikSwitch/FormikSwitch.test.js @@ -1,27 +1,6 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. */ import React from 'react'; diff --git a/public/components/FormControls/FormikSwitch/index.js b/public/components/FormControls/FormikSwitch/index.js index 0138bf18e..894334919 100644 --- a/public/components/FormControls/FormikSwitch/index.js +++ b/public/components/FormControls/FormikSwitch/index.js @@ -1,27 +1,6 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. */ import FormikSwitch from './FormikSwitch'; diff --git a/public/components/FormControls/FormikTextArea/FormikTextArea.js b/public/components/FormControls/FormikTextArea/FormikTextArea.js index b2cead083..109312971 100644 --- a/public/components/FormControls/FormikTextArea/FormikTextArea.js +++ b/public/components/FormControls/FormikTextArea/FormikTextArea.js @@ -1,27 +1,6 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. */ import React from 'react'; diff --git a/public/components/FormControls/FormikTextArea/FormikTextArea.test.js b/public/components/FormControls/FormikTextArea/FormikTextArea.test.js index 1f5b81550..4dabfcb7b 100644 --- a/public/components/FormControls/FormikTextArea/FormikTextArea.test.js +++ b/public/components/FormControls/FormikTextArea/FormikTextArea.test.js @@ -1,27 +1,6 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. */ import React from 'react'; diff --git a/public/components/FormControls/FormikTextArea/index.js b/public/components/FormControls/FormikTextArea/index.js index 94b5fa4a9..92fe83099 100644 --- a/public/components/FormControls/FormikTextArea/index.js +++ b/public/components/FormControls/FormikTextArea/index.js @@ -1,27 +1,6 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. */ import FormikTextArea from './FormikTextArea'; diff --git a/public/components/FormControls/index.js b/public/components/FormControls/index.js index d2712edb0..756e0acf3 100644 --- a/public/components/FormControls/index.js +++ b/public/components/FormControls/index.js @@ -1,27 +1,6 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. */ import FormikFieldText from './FormikFieldText'; diff --git a/public/components/IconToolTip/IconToolTip.js b/public/components/IconToolTip/IconToolTip.js index bc9ac2366..575a71e53 100644 --- a/public/components/IconToolTip/IconToolTip.js +++ b/public/components/IconToolTip/IconToolTip.js @@ -1,12 +1,6 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. */ import React from 'react'; diff --git a/public/components/IconToolTip/IconToolTip.test.js b/public/components/IconToolTip/IconToolTip.test.js index 942ecaaa7..1838bd8d8 100644 --- a/public/components/IconToolTip/IconToolTip.test.js +++ b/public/components/IconToolTip/IconToolTip.test.js @@ -1,12 +1,6 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. */ import React from 'react'; diff --git a/public/components/IconToolTip/index.js b/public/components/IconToolTip/index.js index 7421fd0a2..7a0c8fc7e 100644 --- a/public/components/IconToolTip/index.js +++ b/public/components/IconToolTip/index.js @@ -1,12 +1,6 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. */ import IconToolTip from './IconToolTip'; diff --git a/public/components/SubHeader/SubHeader.js b/public/components/SubHeader/SubHeader.js index 9cd426796..9e0f80c5b 100644 --- a/public/components/SubHeader/SubHeader.js +++ b/public/components/SubHeader/SubHeader.js @@ -1,27 +1,6 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. */ import React, { Fragment } from 'react'; diff --git a/public/components/SubHeader/SubHeader.test.js b/public/components/SubHeader/SubHeader.test.js index d7e846645..a53fe787f 100644 --- a/public/components/SubHeader/SubHeader.test.js +++ b/public/components/SubHeader/SubHeader.test.js @@ -1,27 +1,6 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. */ import React from 'react'; diff --git a/public/components/SubHeader/index.js b/public/components/SubHeader/index.js index e411b0606..1b39f7ec7 100644 --- a/public/components/SubHeader/index.js +++ b/public/components/SubHeader/index.js @@ -1,27 +1,6 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. */ import SubHeader from './SubHeader'; diff --git a/public/index.js b/public/index.js index 2698cf15d..f1eea4fc4 100644 --- a/public/index.js +++ b/public/index.js @@ -1,27 +1,6 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. */ import { AlertingPlugin } from './plugin'; diff --git a/public/less/main.less b/public/less/main.less index 7abde397e..f2f9282a2 100644 --- a/public/less/main.less +++ b/public/less/main.less @@ -1,27 +1,6 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. */ .container { diff --git a/public/pages/CreateMonitor/components/AnomalyDetectors/AnomaliesChart/AnomaliesChart.js b/public/pages/CreateMonitor/components/AnomalyDetectors/AnomaliesChart/AnomaliesChart.js index 1581ea1fb..7cc72a957 100644 --- a/public/pages/CreateMonitor/components/AnomalyDetectors/AnomaliesChart/AnomaliesChart.js +++ b/public/pages/CreateMonitor/components/AnomalyDetectors/AnomaliesChart/AnomaliesChart.js @@ -1,27 +1,6 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. */ import React from 'react'; diff --git a/public/pages/CreateMonitor/components/AnomalyDetectors/AnomaliesChart/AnomaliesChart.test.js b/public/pages/CreateMonitor/components/AnomalyDetectors/AnomaliesChart/AnomaliesChart.test.js index b4c2c40c6..c8192dd26 100644 --- a/public/pages/CreateMonitor/components/AnomalyDetectors/AnomaliesChart/AnomaliesChart.test.js +++ b/public/pages/CreateMonitor/components/AnomalyDetectors/AnomaliesChart/AnomaliesChart.test.js @@ -1,27 +1,6 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. */ import React from 'react'; diff --git a/public/pages/CreateMonitor/components/AnomalyDetectors/AnomaliesChart/index.js b/public/pages/CreateMonitor/components/AnomalyDetectors/AnomaliesChart/index.js index 61c260cc1..c32b19220 100644 --- a/public/pages/CreateMonitor/components/AnomalyDetectors/AnomaliesChart/index.js +++ b/public/pages/CreateMonitor/components/AnomalyDetectors/AnomaliesChart/index.js @@ -1,27 +1,6 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. */ export { AnomaliesChart } from './AnomaliesChart'; diff --git a/public/pages/CreateMonitor/components/AnomalyDetectors/EmptyDetectorMessage/EmptyDetectorMessage.js b/public/pages/CreateMonitor/components/AnomalyDetectors/EmptyDetectorMessage/EmptyDetectorMessage.js index e576b7149..e3f96ab5a 100644 --- a/public/pages/CreateMonitor/components/AnomalyDetectors/EmptyDetectorMessage/EmptyDetectorMessage.js +++ b/public/pages/CreateMonitor/components/AnomalyDetectors/EmptyDetectorMessage/EmptyDetectorMessage.js @@ -1,27 +1,6 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Copyright 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. */ import React from 'react'; diff --git a/public/pages/CreateMonitor/components/AnomalyDetectors/EmptyFeaturesMessage/EmptyFeaturesMessage.js b/public/pages/CreateMonitor/components/AnomalyDetectors/EmptyFeaturesMessage/EmptyFeaturesMessage.js index 14d1c258d..988bf6136 100644 --- a/public/pages/CreateMonitor/components/AnomalyDetectors/EmptyFeaturesMessage/EmptyFeaturesMessage.js +++ b/public/pages/CreateMonitor/components/AnomalyDetectors/EmptyFeaturesMessage/EmptyFeaturesMessage.js @@ -1,27 +1,6 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. */ import React from 'react'; diff --git a/public/pages/CreateMonitor/components/AnomalyDetectors/EmptyFeaturesMessage/EmptyFeaturesMessage.test.js b/public/pages/CreateMonitor/components/AnomalyDetectors/EmptyFeaturesMessage/EmptyFeaturesMessage.test.js index 4adb56440..c030d7210 100644 --- a/public/pages/CreateMonitor/components/AnomalyDetectors/EmptyFeaturesMessage/EmptyFeaturesMessage.test.js +++ b/public/pages/CreateMonitor/components/AnomalyDetectors/EmptyFeaturesMessage/EmptyFeaturesMessage.test.js @@ -1,27 +1,6 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. */ import React from 'react'; diff --git a/public/pages/CreateMonitor/components/AnomalyDetectors/FeatureChart/FeatureChart.js b/public/pages/CreateMonitor/components/AnomalyDetectors/FeatureChart/FeatureChart.js index dc1ccbf7b..ab8807271 100644 --- a/public/pages/CreateMonitor/components/AnomalyDetectors/FeatureChart/FeatureChart.js +++ b/public/pages/CreateMonitor/components/AnomalyDetectors/FeatureChart/FeatureChart.js @@ -1,27 +1,6 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. */ import React from 'react'; diff --git a/public/pages/CreateMonitor/components/AnomalyDetectors/FeatureChart/FeatureChart.test.js b/public/pages/CreateMonitor/components/AnomalyDetectors/FeatureChart/FeatureChart.test.js index d834b5cd9..813def183 100644 --- a/public/pages/CreateMonitor/components/AnomalyDetectors/FeatureChart/FeatureChart.test.js +++ b/public/pages/CreateMonitor/components/AnomalyDetectors/FeatureChart/FeatureChart.test.js @@ -1,12 +1,6 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. */ import React from 'react'; diff --git a/public/pages/CreateMonitor/components/ExtractionQuery/ExtractionQuery.js b/public/pages/CreateMonitor/components/ExtractionQuery/ExtractionQuery.js index 4b862a2e9..361a797d8 100644 --- a/public/pages/CreateMonitor/components/ExtractionQuery/ExtractionQuery.js +++ b/public/pages/CreateMonitor/components/ExtractionQuery/ExtractionQuery.js @@ -1,27 +1,6 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. */ import React from 'react'; diff --git a/public/pages/CreateMonitor/components/ExtractionQuery/ExtractionQuery.test.js b/public/pages/CreateMonitor/components/ExtractionQuery/ExtractionQuery.test.js index 87a3a006e..ca926a786 100644 --- a/public/pages/CreateMonitor/components/ExtractionQuery/ExtractionQuery.test.js +++ b/public/pages/CreateMonitor/components/ExtractionQuery/ExtractionQuery.test.js @@ -1,27 +1,6 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. */ import React from 'react'; diff --git a/public/pages/CreateMonitor/components/ExtractionQuery/index.js b/public/pages/CreateMonitor/components/ExtractionQuery/index.js index 0abcd3a91..d638e6cab 100644 --- a/public/pages/CreateMonitor/components/ExtractionQuery/index.js +++ b/public/pages/CreateMonitor/components/ExtractionQuery/index.js @@ -1,27 +1,6 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. */ import ExtractionQuery from './ExtractionQuery'; diff --git a/public/pages/CreateMonitor/components/MonitorDefinition/MonitorDefinition.js b/public/pages/CreateMonitor/components/MonitorDefinition/MonitorDefinition.js index 20c7657af..ba859c9c8 100644 --- a/public/pages/CreateMonitor/components/MonitorDefinition/MonitorDefinition.js +++ b/public/pages/CreateMonitor/components/MonitorDefinition/MonitorDefinition.js @@ -1,12 +1,6 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. */ import React from 'react'; diff --git a/public/pages/CreateMonitor/components/MonitorDefinition/MonitorDefinition.test.js b/public/pages/CreateMonitor/components/MonitorDefinition/MonitorDefinition.test.js index 9505724d0..519ed65b7 100644 --- a/public/pages/CreateMonitor/components/MonitorDefinition/MonitorDefinition.test.js +++ b/public/pages/CreateMonitor/components/MonitorDefinition/MonitorDefinition.test.js @@ -1,27 +1,6 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. */ import React from 'react'; diff --git a/public/pages/CreateMonitor/components/MonitorDefinition/index.js b/public/pages/CreateMonitor/components/MonitorDefinition/index.js index eaa1d01a9..a53d251ba 100644 --- a/public/pages/CreateMonitor/components/MonitorDefinition/index.js +++ b/public/pages/CreateMonitor/components/MonitorDefinition/index.js @@ -1,27 +1,6 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. */ import MonitorDefinition from './MonitorDefinition'; diff --git a/public/pages/CreateMonitor/components/MonitorDefinitionCard/MonitorDefinitionCard.js b/public/pages/CreateMonitor/components/MonitorDefinitionCard/MonitorDefinitionCard.js index 02a5278d5..7f686ff56 100644 --- a/public/pages/CreateMonitor/components/MonitorDefinitionCard/MonitorDefinitionCard.js +++ b/public/pages/CreateMonitor/components/MonitorDefinitionCard/MonitorDefinitionCard.js @@ -1,27 +1,6 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Copyright 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. */ import React from 'react'; diff --git a/public/pages/CreateMonitor/components/MonitorDefinitionCard/MonitorDefinitionCard.test.js b/public/pages/CreateMonitor/components/MonitorDefinitionCard/MonitorDefinitionCard.test.js index a0f006265..9cd4e92cf 100644 --- a/public/pages/CreateMonitor/components/MonitorDefinitionCard/MonitorDefinitionCard.test.js +++ b/public/pages/CreateMonitor/components/MonitorDefinitionCard/MonitorDefinitionCard.test.js @@ -1,12 +1,6 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. */ import React from 'react'; diff --git a/public/pages/CreateMonitor/components/MonitorDefinitionCard/index.js b/public/pages/CreateMonitor/components/MonitorDefinitionCard/index.js index a869d056e..86f732158 100644 --- a/public/pages/CreateMonitor/components/MonitorDefinitionCard/index.js +++ b/public/pages/CreateMonitor/components/MonitorDefinitionCard/index.js @@ -1,12 +1,6 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. */ import MonitorDefinitionCard from './MonitorDefinitionCard'; diff --git a/public/pages/CreateMonitor/components/MonitorExpressions/MonitorExpressions.js b/public/pages/CreateMonitor/components/MonitorExpressions/MonitorExpressions.js index 714675060..72a242195 100644 --- a/public/pages/CreateMonitor/components/MonitorExpressions/MonitorExpressions.js +++ b/public/pages/CreateMonitor/components/MonitorExpressions/MonitorExpressions.js @@ -1,27 +1,6 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Copyright 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. */ import React, { Component } from 'react'; diff --git a/public/pages/CreateMonitor/components/MonitorExpressions/MonitorExpressions.test.js b/public/pages/CreateMonitor/components/MonitorExpressions/MonitorExpressions.test.js index 195f6f937..16ada23c5 100644 --- a/public/pages/CreateMonitor/components/MonitorExpressions/MonitorExpressions.test.js +++ b/public/pages/CreateMonitor/components/MonitorExpressions/MonitorExpressions.test.js @@ -1,27 +1,6 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. */ import React from 'react'; diff --git a/public/pages/CreateMonitor/components/MonitorExpressions/expressions/ForExpression.js b/public/pages/CreateMonitor/components/MonitorExpressions/expressions/ForExpression.js index ad3c2204e..f3e7a3b6d 100644 --- a/public/pages/CreateMonitor/components/MonitorExpressions/expressions/ForExpression.js +++ b/public/pages/CreateMonitor/components/MonitorExpressions/expressions/ForExpression.js @@ -1,27 +1,6 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Copyright 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. */ import React, { Component } from 'react'; diff --git a/public/pages/CreateMonitor/components/MonitorExpressions/expressions/ForExpression.test.js b/public/pages/CreateMonitor/components/MonitorExpressions/expressions/ForExpression.test.js index c7c150e19..5013e86fd 100644 --- a/public/pages/CreateMonitor/components/MonitorExpressions/expressions/ForExpression.test.js +++ b/public/pages/CreateMonitor/components/MonitorExpressions/expressions/ForExpression.test.js @@ -1,27 +1,6 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. */ import React from 'react'; diff --git a/public/pages/CreateMonitor/components/MonitorExpressions/expressions/GroupByExpression.js b/public/pages/CreateMonitor/components/MonitorExpressions/expressions/GroupByExpression.js index bd3322a8d..c3064b27e 100644 --- a/public/pages/CreateMonitor/components/MonitorExpressions/expressions/GroupByExpression.js +++ b/public/pages/CreateMonitor/components/MonitorExpressions/expressions/GroupByExpression.js @@ -1,27 +1,6 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Copyright 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. */ import React, { Component } from 'react'; diff --git a/public/pages/CreateMonitor/components/MonitorExpressions/expressions/GroupByItem.js b/public/pages/CreateMonitor/components/MonitorExpressions/expressions/GroupByItem.js index ac092fd70..c212e1db8 100644 --- a/public/pages/CreateMonitor/components/MonitorExpressions/expressions/GroupByItem.js +++ b/public/pages/CreateMonitor/components/MonitorExpressions/expressions/GroupByItem.js @@ -1,12 +1,6 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. */ import React, { useState } from 'react'; diff --git a/public/pages/CreateMonitor/components/MonitorExpressions/expressions/GroupByPopover.js b/public/pages/CreateMonitor/components/MonitorExpressions/expressions/GroupByPopover.js index d45fc3aba..54e55f467 100644 --- a/public/pages/CreateMonitor/components/MonitorExpressions/expressions/GroupByPopover.js +++ b/public/pages/CreateMonitor/components/MonitorExpressions/expressions/GroupByPopover.js @@ -1,12 +1,6 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. */ import React from 'react'; diff --git a/public/pages/CreateMonitor/components/MonitorExpressions/expressions/MetricExpression.js b/public/pages/CreateMonitor/components/MonitorExpressions/expressions/MetricExpression.js index 2731237c1..5ec107af2 100644 --- a/public/pages/CreateMonitor/components/MonitorExpressions/expressions/MetricExpression.js +++ b/public/pages/CreateMonitor/components/MonitorExpressions/expressions/MetricExpression.js @@ -1,27 +1,6 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Copyright 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. */ import React, { Component } from 'react'; diff --git a/public/pages/CreateMonitor/components/MonitorExpressions/expressions/MetricItem.js b/public/pages/CreateMonitor/components/MonitorExpressions/expressions/MetricItem.js index cf0459ada..7eabf5c83 100644 --- a/public/pages/CreateMonitor/components/MonitorExpressions/expressions/MetricItem.js +++ b/public/pages/CreateMonitor/components/MonitorExpressions/expressions/MetricItem.js @@ -1,12 +1,6 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. */ import React, { useState } from 'react'; diff --git a/public/pages/CreateMonitor/components/MonitorExpressions/expressions/MetricPopover.js b/public/pages/CreateMonitor/components/MonitorExpressions/expressions/MetricPopover.js index a8f14f8c4..6c81a8543 100644 --- a/public/pages/CreateMonitor/components/MonitorExpressions/expressions/MetricPopover.js +++ b/public/pages/CreateMonitor/components/MonitorExpressions/expressions/MetricPopover.js @@ -1,12 +1,6 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. */ import React from 'react'; diff --git a/public/pages/CreateMonitor/components/MonitorExpressions/expressions/OfExpression.js b/public/pages/CreateMonitor/components/MonitorExpressions/expressions/OfExpression.js index 1fe0c78ed..77ca6ab91 100644 --- a/public/pages/CreateMonitor/components/MonitorExpressions/expressions/OfExpression.js +++ b/public/pages/CreateMonitor/components/MonitorExpressions/expressions/OfExpression.js @@ -1,27 +1,6 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. */ import React, { Component } from 'react'; diff --git a/public/pages/CreateMonitor/components/MonitorExpressions/expressions/OfExpression.test.js b/public/pages/CreateMonitor/components/MonitorExpressions/expressions/OfExpression.test.js index 352f6071a..8dface3f6 100644 --- a/public/pages/CreateMonitor/components/MonitorExpressions/expressions/OfExpression.test.js +++ b/public/pages/CreateMonitor/components/MonitorExpressions/expressions/OfExpression.test.js @@ -1,27 +1,6 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. */ import React from 'react'; diff --git a/public/pages/CreateMonitor/components/MonitorExpressions/expressions/OverExpression.js b/public/pages/CreateMonitor/components/MonitorExpressions/expressions/OverExpression.js index 5fcd0a106..5d3a6c5e5 100644 --- a/public/pages/CreateMonitor/components/MonitorExpressions/expressions/OverExpression.js +++ b/public/pages/CreateMonitor/components/MonitorExpressions/expressions/OverExpression.js @@ -1,27 +1,6 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. */ import React, { Component } from 'react'; diff --git a/public/pages/CreateMonitor/components/MonitorExpressions/expressions/OverExpression.test.js b/public/pages/CreateMonitor/components/MonitorExpressions/expressions/OverExpression.test.js index abcb5c047..530b6d1dd 100644 --- a/public/pages/CreateMonitor/components/MonitorExpressions/expressions/OverExpression.test.js +++ b/public/pages/CreateMonitor/components/MonitorExpressions/expressions/OverExpression.test.js @@ -1,27 +1,6 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. */ import React from 'react'; diff --git a/public/pages/CreateMonitor/components/MonitorExpressions/expressions/WhenExpression.js b/public/pages/CreateMonitor/components/MonitorExpressions/expressions/WhenExpression.js index 8018b31aa..86695755c 100644 --- a/public/pages/CreateMonitor/components/MonitorExpressions/expressions/WhenExpression.js +++ b/public/pages/CreateMonitor/components/MonitorExpressions/expressions/WhenExpression.js @@ -1,27 +1,6 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. */ import React, { Component } from 'react'; diff --git a/public/pages/CreateMonitor/components/MonitorExpressions/expressions/WhenExpression.test.js b/public/pages/CreateMonitor/components/MonitorExpressions/expressions/WhenExpression.test.js index 4fe5e487e..c06afd070 100644 --- a/public/pages/CreateMonitor/components/MonitorExpressions/expressions/WhenExpression.test.js +++ b/public/pages/CreateMonitor/components/MonitorExpressions/expressions/WhenExpression.test.js @@ -1,27 +1,6 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. */ import React from 'react'; diff --git a/public/pages/CreateMonitor/components/MonitorExpressions/expressions/WhereExpression.js b/public/pages/CreateMonitor/components/MonitorExpressions/expressions/WhereExpression.js index 046b23dcd..d984bb19e 100644 --- a/public/pages/CreateMonitor/components/MonitorExpressions/expressions/WhereExpression.js +++ b/public/pages/CreateMonitor/components/MonitorExpressions/expressions/WhereExpression.js @@ -1,27 +1,6 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Copyright 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. */ import React, { Component } from 'react'; diff --git a/public/pages/CreateMonitor/components/MonitorExpressions/expressions/WhereExpression.test.js b/public/pages/CreateMonitor/components/MonitorExpressions/expressions/WhereExpression.test.js index 1c2acd5d0..802c2ed61 100644 --- a/public/pages/CreateMonitor/components/MonitorExpressions/expressions/WhereExpression.test.js +++ b/public/pages/CreateMonitor/components/MonitorExpressions/expressions/WhereExpression.test.js @@ -1,27 +1,6 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. */ import React from 'react'; diff --git a/public/pages/CreateMonitor/components/MonitorExpressions/expressions/index.js b/public/pages/CreateMonitor/components/MonitorExpressions/expressions/index.js index 119fb8950..125c49259 100644 --- a/public/pages/CreateMonitor/components/MonitorExpressions/expressions/index.js +++ b/public/pages/CreateMonitor/components/MonitorExpressions/expressions/index.js @@ -1,27 +1,6 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. */ import ForExpression from './ForExpression'; diff --git a/public/pages/CreateMonitor/components/MonitorExpressions/expressions/utils/constants.js b/public/pages/CreateMonitor/components/MonitorExpressions/expressions/utils/constants.js index c83c8daa1..fd85c9720 100644 --- a/public/pages/CreateMonitor/components/MonitorExpressions/expressions/utils/constants.js +++ b/public/pages/CreateMonitor/components/MonitorExpressions/expressions/utils/constants.js @@ -1,27 +1,6 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Copyright 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. */ export const POPOVER_STYLE = { zIndex: '200' }; diff --git a/public/pages/CreateMonitor/components/MonitorExpressions/expressions/utils/dataTypes.js b/public/pages/CreateMonitor/components/MonitorExpressions/expressions/utils/dataTypes.js index 4e8f4e0c3..9488dd7f1 100644 --- a/public/pages/CreateMonitor/components/MonitorExpressions/expressions/utils/dataTypes.js +++ b/public/pages/CreateMonitor/components/MonitorExpressions/expressions/utils/dataTypes.js @@ -1,27 +1,6 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. */ import { NUMBER_TYPES } from './constants'; diff --git a/public/pages/CreateMonitor/components/MonitorExpressions/expressions/utils/helpers.js b/public/pages/CreateMonitor/components/MonitorExpressions/expressions/utils/helpers.js index 2e56cafec..740c0f6a2 100644 --- a/public/pages/CreateMonitor/components/MonitorExpressions/expressions/utils/helpers.js +++ b/public/pages/CreateMonitor/components/MonitorExpressions/expressions/utils/helpers.js @@ -1,27 +1,6 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. */ export function selectOptionValueToText(optionValue, options) { diff --git a/public/pages/CreateMonitor/components/MonitorExpressions/expressions/utils/whereHelpers.js b/public/pages/CreateMonitor/components/MonitorExpressions/expressions/utils/whereHelpers.js index 915e5a33a..b6101ecbb 100644 --- a/public/pages/CreateMonitor/components/MonitorExpressions/expressions/utils/whereHelpers.js +++ b/public/pages/CreateMonitor/components/MonitorExpressions/expressions/utils/whereHelpers.js @@ -1,27 +1,6 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Copyright 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. */ import _ from 'lodash'; diff --git a/public/pages/CreateMonitor/components/MonitorExpressions/expressions/utils/whereHelpers.test.js b/public/pages/CreateMonitor/components/MonitorExpressions/expressions/utils/whereHelpers.test.js index 1e6dfa42c..b1dd1c7bd 100644 --- a/public/pages/CreateMonitor/components/MonitorExpressions/expressions/utils/whereHelpers.test.js +++ b/public/pages/CreateMonitor/components/MonitorExpressions/expressions/utils/whereHelpers.test.js @@ -1,27 +1,6 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. */ import { diff --git a/public/pages/CreateMonitor/components/MonitorExpressions/index.js b/public/pages/CreateMonitor/components/MonitorExpressions/index.js index 0307cff71..d62c9d033 100644 --- a/public/pages/CreateMonitor/components/MonitorExpressions/index.js +++ b/public/pages/CreateMonitor/components/MonitorExpressions/index.js @@ -1,27 +1,6 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. */ import MonitorExpressions from './MonitorExpressions'; diff --git a/public/pages/CreateMonitor/components/MonitorState/MonitorState.js b/public/pages/CreateMonitor/components/MonitorState/MonitorState.js index 08b3bf939..c9080fa23 100644 --- a/public/pages/CreateMonitor/components/MonitorState/MonitorState.js +++ b/public/pages/CreateMonitor/components/MonitorState/MonitorState.js @@ -1,27 +1,6 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. */ import React, { Fragment } from 'react'; diff --git a/public/pages/CreateMonitor/components/MonitorState/MonitorState.test.js b/public/pages/CreateMonitor/components/MonitorState/MonitorState.test.js index 7c78ae9b0..c6c81f511 100644 --- a/public/pages/CreateMonitor/components/MonitorState/MonitorState.test.js +++ b/public/pages/CreateMonitor/components/MonitorState/MonitorState.test.js @@ -1,27 +1,6 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. */ import React from 'react'; diff --git a/public/pages/CreateMonitor/components/MonitorState/index.js b/public/pages/CreateMonitor/components/MonitorState/index.js index b84a4e118..98e8288aa 100644 --- a/public/pages/CreateMonitor/components/MonitorState/index.js +++ b/public/pages/CreateMonitor/components/MonitorState/index.js @@ -1,27 +1,6 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. */ import MonitorState from './MonitorState'; diff --git a/public/pages/CreateMonitor/components/MonitorTimeField/MonitorTimeField.js b/public/pages/CreateMonitor/components/MonitorTimeField/MonitorTimeField.js index d0ec47a46..7903cbdbf 100644 --- a/public/pages/CreateMonitor/components/MonitorTimeField/MonitorTimeField.js +++ b/public/pages/CreateMonitor/components/MonitorTimeField/MonitorTimeField.js @@ -1,27 +1,6 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. */ import React from 'react'; diff --git a/public/pages/CreateMonitor/components/MonitorTimeField/MonitorTimeField.test.js b/public/pages/CreateMonitor/components/MonitorTimeField/MonitorTimeField.test.js index e47595a26..d98b8f335 100644 --- a/public/pages/CreateMonitor/components/MonitorTimeField/MonitorTimeField.test.js +++ b/public/pages/CreateMonitor/components/MonitorTimeField/MonitorTimeField.test.js @@ -1,27 +1,6 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. */ import React from 'react'; diff --git a/public/pages/CreateMonitor/components/MonitorTimeField/index.js b/public/pages/CreateMonitor/components/MonitorTimeField/index.js index 1e6246ca5..8a12fab52 100644 --- a/public/pages/CreateMonitor/components/MonitorTimeField/index.js +++ b/public/pages/CreateMonitor/components/MonitorTimeField/index.js @@ -1,27 +1,6 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. */ import MonitorTimeField from './MonitorTimeField'; diff --git a/public/pages/CreateMonitor/components/MonitorTimeField/utils/validation.js b/public/pages/CreateMonitor/components/MonitorTimeField/utils/validation.js index 87ff53e41..251216a7d 100644 --- a/public/pages/CreateMonitor/components/MonitorTimeField/utils/validation.js +++ b/public/pages/CreateMonitor/components/MonitorTimeField/utils/validation.js @@ -1,27 +1,6 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. */ export const validateTimeField = (dateFields) => (value) => { diff --git a/public/pages/CreateMonitor/components/MonitorType/MonitorType.js b/public/pages/CreateMonitor/components/MonitorType/MonitorType.js index cdefd5147..8c71746c4 100644 --- a/public/pages/CreateMonitor/components/MonitorType/MonitorType.js +++ b/public/pages/CreateMonitor/components/MonitorType/MonitorType.js @@ -1,27 +1,6 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Copyright 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. */ import React from 'react'; diff --git a/public/pages/CreateMonitor/components/MonitorType/MonitorType.test.js b/public/pages/CreateMonitor/components/MonitorType/MonitorType.test.js index c62ef4a07..214b3e0fa 100644 --- a/public/pages/CreateMonitor/components/MonitorType/MonitorType.test.js +++ b/public/pages/CreateMonitor/components/MonitorType/MonitorType.test.js @@ -1,12 +1,6 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. */ import React from 'react'; diff --git a/public/pages/CreateMonitor/components/MonitorType/index.js b/public/pages/CreateMonitor/components/MonitorType/index.js index a35cf734a..c8dd61fea 100644 --- a/public/pages/CreateMonitor/components/MonitorType/index.js +++ b/public/pages/CreateMonitor/components/MonitorType/index.js @@ -1,27 +1,6 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. */ import MonitorType from './MonitorType'; diff --git a/public/pages/CreateMonitor/components/QueryPerformance/QueryPerformance.js b/public/pages/CreateMonitor/components/QueryPerformance/QueryPerformance.js index 94636f951..23f53804c 100644 --- a/public/pages/CreateMonitor/components/QueryPerformance/QueryPerformance.js +++ b/public/pages/CreateMonitor/components/QueryPerformance/QueryPerformance.js @@ -1,27 +1,6 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Copyright 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. */ import React, { Fragment } from 'react'; diff --git a/public/pages/CreateMonitor/components/QueryPerformance/QueryPerformance.test.js b/public/pages/CreateMonitor/components/QueryPerformance/QueryPerformance.test.js index bb76d4149..d440de5fc 100644 --- a/public/pages/CreateMonitor/components/QueryPerformance/QueryPerformance.test.js +++ b/public/pages/CreateMonitor/components/QueryPerformance/QueryPerformance.test.js @@ -1,27 +1,6 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. */ import React from 'react'; diff --git a/public/pages/CreateMonitor/components/QueryPerformance/index.js b/public/pages/CreateMonitor/components/QueryPerformance/index.js index 73d1a77f7..a098edd54 100644 --- a/public/pages/CreateMonitor/components/QueryPerformance/index.js +++ b/public/pages/CreateMonitor/components/QueryPerformance/index.js @@ -1,27 +1,6 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. */ import QueryPerformance from './QueryPerformance'; diff --git a/public/pages/CreateMonitor/components/Schedule/Frequencies/CustomCron.js b/public/pages/CreateMonitor/components/Schedule/Frequencies/CustomCron.js index 3f340ab47..164ab7e67 100644 --- a/public/pages/CreateMonitor/components/Schedule/Frequencies/CustomCron.js +++ b/public/pages/CreateMonitor/components/Schedule/Frequencies/CustomCron.js @@ -1,27 +1,6 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Copyright 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. */ import React from 'react'; diff --git a/public/pages/CreateMonitor/components/Schedule/Frequencies/Daily.js b/public/pages/CreateMonitor/components/Schedule/Frequencies/Daily.js index 26dc0c7de..33d69a99b 100644 --- a/public/pages/CreateMonitor/components/Schedule/Frequencies/Daily.js +++ b/public/pages/CreateMonitor/components/Schedule/Frequencies/Daily.js @@ -1,27 +1,6 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Copyright 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. */ import React from 'react'; diff --git a/public/pages/CreateMonitor/components/Schedule/Frequencies/Daily.test.js b/public/pages/CreateMonitor/components/Schedule/Frequencies/Daily.test.js index f817e6a64..ae8cb062a 100644 --- a/public/pages/CreateMonitor/components/Schedule/Frequencies/Daily.test.js +++ b/public/pages/CreateMonitor/components/Schedule/Frequencies/Daily.test.js @@ -1,27 +1,6 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. */ import React from 'react'; diff --git a/public/pages/CreateMonitor/components/Schedule/Frequencies/Frequencies.test.js b/public/pages/CreateMonitor/components/Schedule/Frequencies/Frequencies.test.js index f541f21ef..faac9115b 100644 --- a/public/pages/CreateMonitor/components/Schedule/Frequencies/Frequencies.test.js +++ b/public/pages/CreateMonitor/components/Schedule/Frequencies/Frequencies.test.js @@ -1,27 +1,6 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. */ import React from 'react'; diff --git a/public/pages/CreateMonitor/components/Schedule/Frequencies/Frequency.js b/public/pages/CreateMonitor/components/Schedule/Frequencies/Frequency.js index 33edb5878..c4d967339 100644 --- a/public/pages/CreateMonitor/components/Schedule/Frequencies/Frequency.js +++ b/public/pages/CreateMonitor/components/Schedule/Frequencies/Frequency.js @@ -1,27 +1,6 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Copyright 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. */ import React from 'react'; diff --git a/public/pages/CreateMonitor/components/Schedule/Frequencies/FrequencyPicker.js b/public/pages/CreateMonitor/components/Schedule/Frequencies/FrequencyPicker.js index 83956e854..fab615a39 100644 --- a/public/pages/CreateMonitor/components/Schedule/Frequencies/FrequencyPicker.js +++ b/public/pages/CreateMonitor/components/Schedule/Frequencies/FrequencyPicker.js @@ -1,27 +1,6 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. */ import React from 'react'; diff --git a/public/pages/CreateMonitor/components/Schedule/Frequencies/Interval.js b/public/pages/CreateMonitor/components/Schedule/Frequencies/Interval.js index 62b105faf..d513aed0d 100644 --- a/public/pages/CreateMonitor/components/Schedule/Frequencies/Interval.js +++ b/public/pages/CreateMonitor/components/Schedule/Frequencies/Interval.js @@ -1,27 +1,6 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Copyright 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. */ import React from 'react'; diff --git a/public/pages/CreateMonitor/components/Schedule/Frequencies/Monthly.js b/public/pages/CreateMonitor/components/Schedule/Frequencies/Monthly.js index 166a37127..89c6c9ea4 100644 --- a/public/pages/CreateMonitor/components/Schedule/Frequencies/Monthly.js +++ b/public/pages/CreateMonitor/components/Schedule/Frequencies/Monthly.js @@ -1,27 +1,6 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Copyright 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. */ import React, { Fragment } from 'react'; diff --git a/public/pages/CreateMonitor/components/Schedule/Frequencies/TimezoneComboBox.js b/public/pages/CreateMonitor/components/Schedule/Frequencies/TimezoneComboBox.js index 4b2357809..037afdb6b 100644 --- a/public/pages/CreateMonitor/components/Schedule/Frequencies/TimezoneComboBox.js +++ b/public/pages/CreateMonitor/components/Schedule/Frequencies/TimezoneComboBox.js @@ -1,27 +1,6 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. */ import React from 'react'; diff --git a/public/pages/CreateMonitor/components/Schedule/Frequencies/Weekly.js b/public/pages/CreateMonitor/components/Schedule/Frequencies/Weekly.js index e4657f5b1..fc71aa5a6 100644 --- a/public/pages/CreateMonitor/components/Schedule/Frequencies/Weekly.js +++ b/public/pages/CreateMonitor/components/Schedule/Frequencies/Weekly.js @@ -1,27 +1,6 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Copyright 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. */ import React, { Fragment } from 'react'; diff --git a/public/pages/CreateMonitor/components/Schedule/Frequencies/index.js b/public/pages/CreateMonitor/components/Schedule/Frequencies/index.js index 663b9ecb8..f1d556867 100644 --- a/public/pages/CreateMonitor/components/Schedule/Frequencies/index.js +++ b/public/pages/CreateMonitor/components/Schedule/Frequencies/index.js @@ -1,27 +1,6 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. */ import Frequency from './Frequency'; diff --git a/public/pages/CreateMonitor/components/Schedule/Frequencies/utils/constants.js b/public/pages/CreateMonitor/components/Schedule/Frequencies/utils/constants.js index 6bcf7b8b7..dc8f5f5d8 100644 --- a/public/pages/CreateMonitor/components/Schedule/Frequencies/utils/constants.js +++ b/public/pages/CreateMonitor/components/Schedule/Frequencies/utils/constants.js @@ -1,27 +1,6 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. */ export const monthlyTypes = [{ value: 'day', text: 'Day' }]; diff --git a/public/pages/CreateMonitor/components/Schedule/Schedule.js b/public/pages/CreateMonitor/components/Schedule/Schedule.js index 0eff9e68f..f5e16378a 100644 --- a/public/pages/CreateMonitor/components/Schedule/Schedule.js +++ b/public/pages/CreateMonitor/components/Schedule/Schedule.js @@ -1,27 +1,6 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Copyright 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. */ import React, { Fragment } from 'react'; diff --git a/public/pages/CreateMonitor/components/Schedule/Schedule.test.js b/public/pages/CreateMonitor/components/Schedule/Schedule.test.js index 935239a70..2eee140d7 100644 --- a/public/pages/CreateMonitor/components/Schedule/Schedule.test.js +++ b/public/pages/CreateMonitor/components/Schedule/Schedule.test.js @@ -1,27 +1,6 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. */ import React from 'react'; diff --git a/public/pages/CreateMonitor/components/Schedule/index.js b/public/pages/CreateMonitor/components/Schedule/index.js index e54ff2b4b..1787a6773 100644 --- a/public/pages/CreateMonitor/components/Schedule/index.js +++ b/public/pages/CreateMonitor/components/Schedule/index.js @@ -1,27 +1,6 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. */ import Schedule from './Schedule'; diff --git a/public/pages/CreateMonitor/components/VisualGraph/VisualGraph.js b/public/pages/CreateMonitor/components/VisualGraph/VisualGraph.js index 9ed8f47ae..12816449a 100644 --- a/public/pages/CreateMonitor/components/VisualGraph/VisualGraph.js +++ b/public/pages/CreateMonitor/components/VisualGraph/VisualGraph.js @@ -1,27 +1,6 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. */ import React, { Component } from 'react'; diff --git a/public/pages/CreateMonitor/components/VisualGraph/VisualGraph.test.js b/public/pages/CreateMonitor/components/VisualGraph/VisualGraph.test.js index 9e361fe99..e5ca7c7f2 100644 --- a/public/pages/CreateMonitor/components/VisualGraph/VisualGraph.test.js +++ b/public/pages/CreateMonitor/components/VisualGraph/VisualGraph.test.js @@ -1,27 +1,6 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. */ import React from 'react'; diff --git a/public/pages/CreateMonitor/components/VisualGraph/index.js b/public/pages/CreateMonitor/components/VisualGraph/index.js index 9ce850bd4..ff641b87d 100644 --- a/public/pages/CreateMonitor/components/VisualGraph/index.js +++ b/public/pages/CreateMonitor/components/VisualGraph/index.js @@ -1,27 +1,6 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. */ import VisualGraph from './VisualGraph'; diff --git a/public/pages/CreateMonitor/components/VisualGraph/utils/constants.js b/public/pages/CreateMonitor/components/VisualGraph/utils/constants.js index 32e9be320..41fa26b85 100644 --- a/public/pages/CreateMonitor/components/VisualGraph/utils/constants.js +++ b/public/pages/CreateMonitor/components/VisualGraph/utils/constants.js @@ -1,27 +1,6 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. */ export const SIZE_RANGE = [3, 3]; diff --git a/public/pages/CreateMonitor/components/VisualGraph/utils/helpers.js b/public/pages/CreateMonitor/components/VisualGraph/utils/helpers.js index 4d9a72d64..c2420a5ed 100644 --- a/public/pages/CreateMonitor/components/VisualGraph/utils/helpers.js +++ b/public/pages/CreateMonitor/components/VisualGraph/utils/helpers.js @@ -1,27 +1,6 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. */ import _ from 'lodash'; diff --git a/public/pages/CreateMonitor/components/VisualGraph/utils/helpers.test.js b/public/pages/CreateMonitor/components/VisualGraph/utils/helpers.test.js index d899abd23..cc489e678 100644 --- a/public/pages/CreateMonitor/components/VisualGraph/utils/helpers.test.js +++ b/public/pages/CreateMonitor/components/VisualGraph/utils/helpers.test.js @@ -1,27 +1,6 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. */ import _ from 'lodash'; diff --git a/public/pages/CreateMonitor/containers/AnomalyDetectors/AnomalyDetectorData.js b/public/pages/CreateMonitor/containers/AnomalyDetectors/AnomalyDetectorData.js index 5ed6b5b37..20c9d0aac 100644 --- a/public/pages/CreateMonitor/containers/AnomalyDetectors/AnomalyDetectorData.js +++ b/public/pages/CreateMonitor/containers/AnomalyDetectors/AnomalyDetectorData.js @@ -1,27 +1,6 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. */ import React from 'react'; diff --git a/public/pages/CreateMonitor/containers/AnomalyDetectors/AnomalyDetectors.js b/public/pages/CreateMonitor/containers/AnomalyDetectors/AnomalyDetectors.js index f761427b0..0a8b07a58 100644 --- a/public/pages/CreateMonitor/containers/AnomalyDetectors/AnomalyDetectors.js +++ b/public/pages/CreateMonitor/containers/AnomalyDetectors/AnomalyDetectors.js @@ -1,27 +1,6 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. */ import React from 'react'; diff --git a/public/pages/CreateMonitor/containers/AnomalyDetectors/__tests__/AnomalyDetector.test.js b/public/pages/CreateMonitor/containers/AnomalyDetectors/__tests__/AnomalyDetector.test.js index 8fc0e8bb9..44eb5893b 100644 --- a/public/pages/CreateMonitor/containers/AnomalyDetectors/__tests__/AnomalyDetector.test.js +++ b/public/pages/CreateMonitor/containers/AnomalyDetectors/__tests__/AnomalyDetector.test.js @@ -1,27 +1,6 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. */ import React from 'react'; diff --git a/public/pages/CreateMonitor/containers/AnomalyDetectors/__tests__/AnomalyDetectorPreviewData.test.js b/public/pages/CreateMonitor/containers/AnomalyDetectors/__tests__/AnomalyDetectorPreviewData.test.js index e6d578c71..4f06646ee 100644 --- a/public/pages/CreateMonitor/containers/AnomalyDetectors/__tests__/AnomalyDetectorPreviewData.test.js +++ b/public/pages/CreateMonitor/containers/AnomalyDetectors/__tests__/AnomalyDetectorPreviewData.test.js @@ -1,27 +1,6 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. */ import React from 'react'; diff --git a/public/pages/CreateMonitor/containers/AnomalyDetectors/index.js b/public/pages/CreateMonitor/containers/AnomalyDetectors/index.js index ffc6af938..6f5f096c2 100644 --- a/public/pages/CreateMonitor/containers/AnomalyDetectors/index.js +++ b/public/pages/CreateMonitor/containers/AnomalyDetectors/index.js @@ -1,27 +1,6 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. */ import AnomalyDetectors from './AnomalyDetectors'; diff --git a/public/pages/CreateMonitor/containers/CreateMonitor/CreateMonitor.js b/public/pages/CreateMonitor/containers/CreateMonitor/CreateMonitor.js index f22e183bf..63e4a3050 100644 --- a/public/pages/CreateMonitor/containers/CreateMonitor/CreateMonitor.js +++ b/public/pages/CreateMonitor/containers/CreateMonitor/CreateMonitor.js @@ -1,27 +1,6 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Copyright 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. */ import React, { Component, Fragment } from 'react'; diff --git a/public/pages/CreateMonitor/containers/CreateMonitor/CreateMonitor.test.js b/public/pages/CreateMonitor/containers/CreateMonitor/CreateMonitor.test.js index 6729d35d2..b9af48dbf 100644 --- a/public/pages/CreateMonitor/containers/CreateMonitor/CreateMonitor.test.js +++ b/public/pages/CreateMonitor/containers/CreateMonitor/CreateMonitor.test.js @@ -1,27 +1,6 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. */ import React from 'react'; diff --git a/public/pages/CreateMonitor/containers/CreateMonitor/index.js b/public/pages/CreateMonitor/containers/CreateMonitor/index.js index 4cae99246..4b2e157f4 100644 --- a/public/pages/CreateMonitor/containers/CreateMonitor/index.js +++ b/public/pages/CreateMonitor/containers/CreateMonitor/index.js @@ -1,27 +1,6 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. */ import CreateMonitor from './CreateMonitor'; diff --git a/public/pages/CreateMonitor/containers/CreateMonitor/utils/constants.js b/public/pages/CreateMonitor/containers/CreateMonitor/utils/constants.js index d71ca3790..1536f76c0 100644 --- a/public/pages/CreateMonitor/containers/CreateMonitor/utils/constants.js +++ b/public/pages/CreateMonitor/containers/CreateMonitor/utils/constants.js @@ -1,27 +1,6 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Copyright 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. */ import { OPERATORS_MAP } from '../../../components/MonitorExpressions/expressions/utils/constants'; diff --git a/public/pages/CreateMonitor/containers/CreateMonitor/utils/formikToMonitor.js b/public/pages/CreateMonitor/containers/CreateMonitor/utils/formikToMonitor.js index 43e1d09a5..27a7153b9 100644 --- a/public/pages/CreateMonitor/containers/CreateMonitor/utils/formikToMonitor.js +++ b/public/pages/CreateMonitor/containers/CreateMonitor/utils/formikToMonitor.js @@ -1,27 +1,6 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Copyright 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. */ import _ from 'lodash'; diff --git a/public/pages/CreateMonitor/containers/CreateMonitor/utils/formikToMonitor.test.js b/public/pages/CreateMonitor/containers/CreateMonitor/utils/formikToMonitor.test.js index 383e41aad..e598bf555 100644 --- a/public/pages/CreateMonitor/containers/CreateMonitor/utils/formikToMonitor.test.js +++ b/public/pages/CreateMonitor/containers/CreateMonitor/utils/formikToMonitor.test.js @@ -1,27 +1,6 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. */ import _ from 'lodash'; diff --git a/public/pages/CreateMonitor/containers/CreateMonitor/utils/monitorQueryParams.js b/public/pages/CreateMonitor/containers/CreateMonitor/utils/monitorQueryParams.js index 9cd066535..c696e2eb2 100644 --- a/public/pages/CreateMonitor/containers/CreateMonitor/utils/monitorQueryParams.js +++ b/public/pages/CreateMonitor/containers/CreateMonitor/utils/monitorQueryParams.js @@ -1,27 +1,6 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. */ import { SEARCH_TYPE } from '../../../../../utils/constants'; diff --git a/public/pages/CreateMonitor/containers/CreateMonitor/utils/monitorToFormik.js b/public/pages/CreateMonitor/containers/CreateMonitor/utils/monitorToFormik.js index 9289d3e18..7fe188e56 100644 --- a/public/pages/CreateMonitor/containers/CreateMonitor/utils/monitorToFormik.js +++ b/public/pages/CreateMonitor/containers/CreateMonitor/utils/monitorToFormik.js @@ -1,27 +1,6 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Copyright 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. */ import _ from 'lodash'; diff --git a/public/pages/CreateMonitor/containers/CreateMonitor/utils/monitorToFormik.test.js b/public/pages/CreateMonitor/containers/CreateMonitor/utils/monitorToFormik.test.js index 66024a3d2..2faf440f6 100644 --- a/public/pages/CreateMonitor/containers/CreateMonitor/utils/monitorToFormik.test.js +++ b/public/pages/CreateMonitor/containers/CreateMonitor/utils/monitorToFormik.test.js @@ -1,27 +1,6 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Copyright 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. */ import _ from 'lodash'; diff --git a/public/pages/CreateMonitor/containers/CreateMonitor/utils/whereFilters.js b/public/pages/CreateMonitor/containers/CreateMonitor/utils/whereFilters.js index 03378ae7e..b12922bbe 100644 --- a/public/pages/CreateMonitor/containers/CreateMonitor/utils/whereFilters.js +++ b/public/pages/CreateMonitor/containers/CreateMonitor/utils/whereFilters.js @@ -1,27 +1,6 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. */ import { OPERATORS_MAP } from '../../../components/MonitorExpressions/expressions/utils/constants'; diff --git a/public/pages/CreateMonitor/containers/DataSource/DataSource.js b/public/pages/CreateMonitor/containers/DataSource/DataSource.js index b7b9ed2a0..7c0496027 100644 --- a/public/pages/CreateMonitor/containers/DataSource/DataSource.js +++ b/public/pages/CreateMonitor/containers/DataSource/DataSource.js @@ -1,27 +1,6 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Copyright 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. */ import React, { Component } from 'react'; diff --git a/public/pages/CreateMonitor/containers/DataSource/DataSource.test.js b/public/pages/CreateMonitor/containers/DataSource/DataSource.test.js index 135d50fcc..a249efacb 100644 --- a/public/pages/CreateMonitor/containers/DataSource/DataSource.test.js +++ b/public/pages/CreateMonitor/containers/DataSource/DataSource.test.js @@ -1,12 +1,6 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. */ import React from 'react'; diff --git a/public/pages/CreateMonitor/containers/DataSource/index.js b/public/pages/CreateMonitor/containers/DataSource/index.js index 61f260e94..56308d667 100644 --- a/public/pages/CreateMonitor/containers/DataSource/index.js +++ b/public/pages/CreateMonitor/containers/DataSource/index.js @@ -1,12 +1,6 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. */ import DataSource from './DataSource'; diff --git a/public/pages/CreateMonitor/containers/DefineMonitor/DefineMonitor.js b/public/pages/CreateMonitor/containers/DefineMonitor/DefineMonitor.js index c6a929d6f..eed26d5f7 100644 --- a/public/pages/CreateMonitor/containers/DefineMonitor/DefineMonitor.js +++ b/public/pages/CreateMonitor/containers/DefineMonitor/DefineMonitor.js @@ -1,27 +1,6 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Copyright 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. */ import React, { Component, Fragment } from 'react'; diff --git a/public/pages/CreateMonitor/containers/DefineMonitor/DefineMonitor.test.js b/public/pages/CreateMonitor/containers/DefineMonitor/DefineMonitor.test.js index ef587e9ac..7fe3eeb57 100644 --- a/public/pages/CreateMonitor/containers/DefineMonitor/DefineMonitor.test.js +++ b/public/pages/CreateMonitor/containers/DefineMonitor/DefineMonitor.test.js @@ -1,27 +1,6 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. */ import React from 'react'; diff --git a/public/pages/CreateMonitor/containers/DefineMonitor/index.js b/public/pages/CreateMonitor/containers/DefineMonitor/index.js index 86aab6005..8e76e5971 100644 --- a/public/pages/CreateMonitor/containers/DefineMonitor/index.js +++ b/public/pages/CreateMonitor/containers/DefineMonitor/index.js @@ -1,27 +1,6 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. */ import DefineMonitor from './DefineMonitor'; diff --git a/public/pages/CreateMonitor/containers/DefineMonitor/utils/mappings.js b/public/pages/CreateMonitor/containers/DefineMonitor/utils/mappings.js index ab72eda06..2daf644ef 100644 --- a/public/pages/CreateMonitor/containers/DefineMonitor/utils/mappings.js +++ b/public/pages/CreateMonitor/containers/DefineMonitor/utils/mappings.js @@ -1,27 +1,6 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. */ export function shouldSkip(mapping) { diff --git a/public/pages/CreateMonitor/containers/DefineMonitor/utils/mappings.test.js b/public/pages/CreateMonitor/containers/DefineMonitor/utils/mappings.test.js index b593591d8..d7b19d022 100644 --- a/public/pages/CreateMonitor/containers/DefineMonitor/utils/mappings.test.js +++ b/public/pages/CreateMonitor/containers/DefineMonitor/utils/mappings.test.js @@ -1,27 +1,6 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. */ import { getPathsPerDataType } from './mappings'; diff --git a/public/pages/CreateMonitor/containers/DefineMonitor/utils/searchRequests.js b/public/pages/CreateMonitor/containers/DefineMonitor/utils/searchRequests.js index f1879343f..097e3fa9a 100644 --- a/public/pages/CreateMonitor/containers/DefineMonitor/utils/searchRequests.js +++ b/public/pages/CreateMonitor/containers/DefineMonitor/utils/searchRequests.js @@ -1,27 +1,6 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. */ import { diff --git a/public/pages/CreateMonitor/containers/MonitorDetails/MonitorDetails.js b/public/pages/CreateMonitor/containers/MonitorDetails/MonitorDetails.js index 3a60d073e..c8599ae36 100644 --- a/public/pages/CreateMonitor/containers/MonitorDetails/MonitorDetails.js +++ b/public/pages/CreateMonitor/containers/MonitorDetails/MonitorDetails.js @@ -1,27 +1,6 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Copyright 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. */ import React from 'react'; diff --git a/public/pages/CreateMonitor/containers/MonitorDetails/index.js b/public/pages/CreateMonitor/containers/MonitorDetails/index.js index 99369dafe..78a127845 100644 --- a/public/pages/CreateMonitor/containers/MonitorDetails/index.js +++ b/public/pages/CreateMonitor/containers/MonitorDetails/index.js @@ -1,12 +1,6 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. */ import MonitorDetails from './MonitorDetails'; diff --git a/public/pages/CreateMonitor/containers/MonitorIndex/MonitorIndex.js b/public/pages/CreateMonitor/containers/MonitorIndex/MonitorIndex.js index 1d1bdcbb2..f7878730c 100644 --- a/public/pages/CreateMonitor/containers/MonitorIndex/MonitorIndex.js +++ b/public/pages/CreateMonitor/containers/MonitorIndex/MonitorIndex.js @@ -1,27 +1,6 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Copyright 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. */ import React from 'react'; diff --git a/public/pages/CreateMonitor/containers/MonitorIndex/MonitorIndex.test.js b/public/pages/CreateMonitor/containers/MonitorIndex/MonitorIndex.test.js index 130a9d701..581170d3a 100644 --- a/public/pages/CreateMonitor/containers/MonitorIndex/MonitorIndex.test.js +++ b/public/pages/CreateMonitor/containers/MonitorIndex/MonitorIndex.test.js @@ -1,27 +1,6 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. */ import React from 'react'; diff --git a/public/pages/CreateMonitor/containers/MonitorIndex/index.js b/public/pages/CreateMonitor/containers/MonitorIndex/index.js index 4a2114ba5..42d7222a1 100644 --- a/public/pages/CreateMonitor/containers/MonitorIndex/index.js +++ b/public/pages/CreateMonitor/containers/MonitorIndex/index.js @@ -1,27 +1,6 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. */ import MonitorIndex from './MonitorIndex'; diff --git a/public/pages/CreateMonitor/containers/MonitorIndex/utils/helpers.js b/public/pages/CreateMonitor/containers/MonitorIndex/utils/helpers.js index 376499fc1..bbf8eb0eb 100644 --- a/public/pages/CreateMonitor/containers/MonitorIndex/utils/helpers.js +++ b/public/pages/CreateMonitor/containers/MonitorIndex/utils/helpers.js @@ -1,27 +1,6 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. */ export function canAppendWildcard(keyPressed) { diff --git a/public/pages/CreateMonitor/index.js b/public/pages/CreateMonitor/index.js index 05d34ed30..57d8cce5b 100644 --- a/public/pages/CreateMonitor/index.js +++ b/public/pages/CreateMonitor/index.js @@ -1,27 +1,6 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. */ import CreateMonitor from './containers/CreateMonitor'; diff --git a/public/pages/CreateTrigger/components/Action/Action.js b/public/pages/CreateTrigger/components/Action/Action.js index d6a999515..5a5f88077 100644 --- a/public/pages/CreateTrigger/components/Action/Action.js +++ b/public/pages/CreateTrigger/components/Action/Action.js @@ -1,27 +1,6 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Copyright 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. */ import React from 'react'; diff --git a/public/pages/CreateTrigger/components/Action/actions/Message.js b/public/pages/CreateTrigger/components/Action/actions/Message.js index f09fcd176..34301811d 100644 --- a/public/pages/CreateTrigger/components/Action/actions/Message.js +++ b/public/pages/CreateTrigger/components/Action/actions/Message.js @@ -1,27 +1,6 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Copyright 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. */ import React, { useState } from 'react'; diff --git a/public/pages/CreateTrigger/components/Action/actions/Message.test.js b/public/pages/CreateTrigger/components/Action/actions/Message.test.js index 5dbce34c3..047a2bec5 100644 --- a/public/pages/CreateTrigger/components/Action/actions/Message.test.js +++ b/public/pages/CreateTrigger/components/Action/actions/Message.test.js @@ -1,27 +1,6 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. */ import React from 'react'; diff --git a/public/pages/CreateTrigger/components/Action/actions/index.js b/public/pages/CreateTrigger/components/Action/actions/index.js index dee0f342a..2b9622512 100644 --- a/public/pages/CreateTrigger/components/Action/actions/index.js +++ b/public/pages/CreateTrigger/components/Action/actions/index.js @@ -1,27 +1,6 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. */ import Message from './Message'; diff --git a/public/pages/CreateTrigger/components/Action/index.js b/public/pages/CreateTrigger/components/Action/index.js index bf9f0a0c9..b59f18ffa 100644 --- a/public/pages/CreateTrigger/components/Action/index.js +++ b/public/pages/CreateTrigger/components/Action/index.js @@ -1,27 +1,6 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. */ import Action from './Action'; diff --git a/public/pages/CreateTrigger/components/Action/utils/constants.js b/public/pages/CreateTrigger/components/Action/utils/constants.js index 494e7591d..a9d4ed1d9 100644 --- a/public/pages/CreateTrigger/components/Action/utils/constants.js +++ b/public/pages/CreateTrigger/components/Action/utils/constants.js @@ -1,27 +1,6 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. */ import React from 'react'; diff --git a/public/pages/CreateTrigger/components/Action/utils/validate.js b/public/pages/CreateTrigger/components/Action/utils/validate.js index 761f8244f..e8a54a1f8 100644 --- a/public/pages/CreateTrigger/components/Action/utils/validate.js +++ b/public/pages/CreateTrigger/components/Action/utils/validate.js @@ -1,12 +1,6 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. */ export const validateDestination = (destinations) => (value) => { diff --git a/public/pages/CreateTrigger/components/ActionEmptyPrompt/ActionEmptyPrompt.js b/public/pages/CreateTrigger/components/ActionEmptyPrompt/ActionEmptyPrompt.js index 8d5f328db..2de9b03e7 100644 --- a/public/pages/CreateTrigger/components/ActionEmptyPrompt/ActionEmptyPrompt.js +++ b/public/pages/CreateTrigger/components/ActionEmptyPrompt/ActionEmptyPrompt.js @@ -1,27 +1,6 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Copyright 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. */ import React from 'react'; diff --git a/public/pages/CreateTrigger/components/ActionEmptyPrompt/index.js b/public/pages/CreateTrigger/components/ActionEmptyPrompt/index.js index 469ae8efa..f72641b99 100644 --- a/public/pages/CreateTrigger/components/ActionEmptyPrompt/index.js +++ b/public/pages/CreateTrigger/components/ActionEmptyPrompt/index.js @@ -1,27 +1,6 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. */ import ActionEmptyPrompt from './ActionEmptyPrompt'; diff --git a/public/pages/CreateTrigger/components/AddActionButton/AddActionButton.js b/public/pages/CreateTrigger/components/AddActionButton/AddActionButton.js index b6f8ce353..9ac42a238 100644 --- a/public/pages/CreateTrigger/components/AddActionButton/AddActionButton.js +++ b/public/pages/CreateTrigger/components/AddActionButton/AddActionButton.js @@ -1,27 +1,6 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Copyright 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. */ import React from 'react'; diff --git a/public/pages/CreateTrigger/components/AddActionButton/index.js b/public/pages/CreateTrigger/components/AddActionButton/index.js index 18f7473dd..d1abc17c4 100644 --- a/public/pages/CreateTrigger/components/AddActionButton/index.js +++ b/public/pages/CreateTrigger/components/AddActionButton/index.js @@ -1,27 +1,6 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. */ import AddActionButton from './AddActionButton'; diff --git a/public/pages/CreateTrigger/components/AddTriggerButton/AddTriggerButton.js b/public/pages/CreateTrigger/components/AddTriggerButton/AddTriggerButton.js index 3321e932c..89d78f47c 100644 --- a/public/pages/CreateTrigger/components/AddTriggerButton/AddTriggerButton.js +++ b/public/pages/CreateTrigger/components/AddTriggerButton/AddTriggerButton.js @@ -1,16 +1,6 @@ /* - * Copyright 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. + * Copyright OpenSearch Contributors + * SPDX-License-Identifier: Apache-2.0 */ import React from 'react'; diff --git a/public/pages/CreateTrigger/components/AddTriggerButton/index.js b/public/pages/CreateTrigger/components/AddTriggerButton/index.js index c2dcdd406..cf7541153 100644 --- a/public/pages/CreateTrigger/components/AddTriggerButton/index.js +++ b/public/pages/CreateTrigger/components/AddTriggerButton/index.js @@ -1,16 +1,6 @@ /* - * Copyright 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. + * Copyright OpenSearch Contributors + * SPDX-License-Identifier: Apache-2.0 */ import AddTriggerButton from './AddTriggerButton'; diff --git a/public/pages/CreateTrigger/components/AddTriggerConditionButton/AddTriggerConditionButton.js b/public/pages/CreateTrigger/components/AddTriggerConditionButton/AddTriggerConditionButton.js index 4a5c87646..4b3a572d8 100644 --- a/public/pages/CreateTrigger/components/AddTriggerConditionButton/AddTriggerConditionButton.js +++ b/public/pages/CreateTrigger/components/AddTriggerConditionButton/AddTriggerConditionButton.js @@ -1,16 +1,6 @@ /* - * Copyright 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. + * Copyright OpenSearch Contributors + * SPDX-License-Identifier: Apache-2.0 */ import React from 'react'; diff --git a/public/pages/CreateTrigger/components/AddTriggerConditionButton/index.js b/public/pages/CreateTrigger/components/AddTriggerConditionButton/index.js index 504a21731..c4f26e204 100644 --- a/public/pages/CreateTrigger/components/AddTriggerConditionButton/index.js +++ b/public/pages/CreateTrigger/components/AddTriggerConditionButton/index.js @@ -1,16 +1,6 @@ /* - * Copyright 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. + * Copyright OpenSearch Contributors + * SPDX-License-Identifier: Apache-2.0 */ import AddTriggerConditionButton from './AddTriggerConditionButton'; diff --git a/public/pages/CreateTrigger/components/BucketLevelTriggerExpression/BucketLevelTriggerExpression.js b/public/pages/CreateTrigger/components/BucketLevelTriggerExpression/BucketLevelTriggerExpression.js index bb92e227b..fa2bdaa8c 100644 --- a/public/pages/CreateTrigger/components/BucketLevelTriggerExpression/BucketLevelTriggerExpression.js +++ b/public/pages/CreateTrigger/components/BucketLevelTriggerExpression/BucketLevelTriggerExpression.js @@ -1,27 +1,6 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Copyright 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. */ import React, { Component } from 'react'; diff --git a/public/pages/CreateTrigger/components/BucketLevelTriggerExpression/index.js b/public/pages/CreateTrigger/components/BucketLevelTriggerExpression/index.js index 07c840b98..4b0f347df 100644 --- a/public/pages/CreateTrigger/components/BucketLevelTriggerExpression/index.js +++ b/public/pages/CreateTrigger/components/BucketLevelTriggerExpression/index.js @@ -1,16 +1,6 @@ /* - * Copyright 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. + * Copyright OpenSearch Contributors + * SPDX-License-Identifier: Apache-2.0 */ import BucketLevelTriggerExpression from './BucketLevelTriggerExpression'; diff --git a/public/pages/CreateTrigger/components/BucketLevelTriggerGraph.js b/public/pages/CreateTrigger/components/BucketLevelTriggerGraph.js index 50d2b30f5..be0806802 100644 --- a/public/pages/CreateTrigger/components/BucketLevelTriggerGraph.js +++ b/public/pages/CreateTrigger/components/BucketLevelTriggerGraph.js @@ -1,16 +1,6 @@ /* - * Copyright 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. + * Copyright OpenSearch Contributors + * SPDX-License-Identifier: Apache-2.0 */ import React from 'react'; diff --git a/public/pages/CreateTrigger/components/BucketLevelTriggerQuery/BucketLevelTriggerQuery.js b/public/pages/CreateTrigger/components/BucketLevelTriggerQuery/BucketLevelTriggerQuery.js index 1ffd3a574..33f9d2fb1 100644 --- a/public/pages/CreateTrigger/components/BucketLevelTriggerQuery/BucketLevelTriggerQuery.js +++ b/public/pages/CreateTrigger/components/BucketLevelTriggerQuery/BucketLevelTriggerQuery.js @@ -1,27 +1,6 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Copyright 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. */ import React from 'react'; diff --git a/public/pages/CreateTrigger/components/BucketLevelTriggerQuery/index.js b/public/pages/CreateTrigger/components/BucketLevelTriggerQuery/index.js index f72814da8..e23f0df7d 100644 --- a/public/pages/CreateTrigger/components/BucketLevelTriggerQuery/index.js +++ b/public/pages/CreateTrigger/components/BucketLevelTriggerQuery/index.js @@ -1,16 +1,6 @@ /* - * Copyright 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. + * Copyright OpenSearch Contributors + * SPDX-License-Identifier: Apache-2.0 */ import BucketLevelTriggerQuery from './BucketLevelTriggerQuery'; diff --git a/public/pages/CreateTrigger/components/TriggerEmptyPrompt/TriggerEmptyPrompt.js b/public/pages/CreateTrigger/components/TriggerEmptyPrompt/TriggerEmptyPrompt.js index e0c7dc3d3..38b91e83d 100644 --- a/public/pages/CreateTrigger/components/TriggerEmptyPrompt/TriggerEmptyPrompt.js +++ b/public/pages/CreateTrigger/components/TriggerEmptyPrompt/TriggerEmptyPrompt.js @@ -1,27 +1,6 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Copyright 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. */ import React from 'react'; diff --git a/public/pages/CreateTrigger/components/TriggerEmptyPrompt/index.js b/public/pages/CreateTrigger/components/TriggerEmptyPrompt/index.js index 40f5a0c0d..64c412489 100644 --- a/public/pages/CreateTrigger/components/TriggerEmptyPrompt/index.js +++ b/public/pages/CreateTrigger/components/TriggerEmptyPrompt/index.js @@ -1,16 +1,6 @@ /* - * Copyright 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. + * Copyright OpenSearch Contributors + * SPDX-License-Identifier: Apache-2.0 */ import TriggerEmptyPrompt from './TriggerEmptyPrompt'; diff --git a/public/pages/CreateTrigger/components/TriggerExpressions/TriggerExpressions.js b/public/pages/CreateTrigger/components/TriggerExpressions/TriggerExpressions.js index 43493a0b7..a96414e7a 100644 --- a/public/pages/CreateTrigger/components/TriggerExpressions/TriggerExpressions.js +++ b/public/pages/CreateTrigger/components/TriggerExpressions/TriggerExpressions.js @@ -1,27 +1,6 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Copyright 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. */ import React, { Component } from 'react'; diff --git a/public/pages/CreateTrigger/components/TriggerExpressions/TriggerExpressions.test.js b/public/pages/CreateTrigger/components/TriggerExpressions/TriggerExpressions.test.js index e9037ec65..809261909 100644 --- a/public/pages/CreateTrigger/components/TriggerExpressions/TriggerExpressions.test.js +++ b/public/pages/CreateTrigger/components/TriggerExpressions/TriggerExpressions.test.js @@ -1,27 +1,6 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. */ import React from 'react'; diff --git a/public/pages/CreateTrigger/components/TriggerExpressions/index.js b/public/pages/CreateTrigger/components/TriggerExpressions/index.js index e3a1f616c..2cf9f6073 100644 --- a/public/pages/CreateTrigger/components/TriggerExpressions/index.js +++ b/public/pages/CreateTrigger/components/TriggerExpressions/index.js @@ -1,27 +1,6 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. */ import TriggerExpressions from './TriggerExpressions'; diff --git a/public/pages/CreateTrigger/components/TriggerGraph.js b/public/pages/CreateTrigger/components/TriggerGraph.js index bf76b304f..2e56b0b56 100644 --- a/public/pages/CreateTrigger/components/TriggerGraph.js +++ b/public/pages/CreateTrigger/components/TriggerGraph.js @@ -1,27 +1,6 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Copyright 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. */ import React from 'react'; diff --git a/public/pages/CreateTrigger/components/TriggerQuery/TriggerQuery.js b/public/pages/CreateTrigger/components/TriggerQuery/TriggerQuery.js index 175d22952..5d1b57ca1 100644 --- a/public/pages/CreateTrigger/components/TriggerQuery/TriggerQuery.js +++ b/public/pages/CreateTrigger/components/TriggerQuery/TriggerQuery.js @@ -1,27 +1,6 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Copyright 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. */ import React from 'react'; diff --git a/public/pages/CreateTrigger/components/TriggerQuery/TriggerQuery.test.js b/public/pages/CreateTrigger/components/TriggerQuery/TriggerQuery.test.js index 87612d319..e1bbe5b1e 100644 --- a/public/pages/CreateTrigger/components/TriggerQuery/TriggerQuery.test.js +++ b/public/pages/CreateTrigger/components/TriggerQuery/TriggerQuery.test.js @@ -1,27 +1,6 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. */ import React from 'react'; diff --git a/public/pages/CreateTrigger/components/TriggerQuery/index.js b/public/pages/CreateTrigger/components/TriggerQuery/index.js index 7320af8c4..f407ac4b1 100644 --- a/public/pages/CreateTrigger/components/TriggerQuery/index.js +++ b/public/pages/CreateTrigger/components/TriggerQuery/index.js @@ -1,27 +1,6 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. */ import TriggerQuery from './TriggerQuery'; diff --git a/public/pages/CreateTrigger/containers/ConfigureActions/ConfigureActions.js b/public/pages/CreateTrigger/containers/ConfigureActions/ConfigureActions.js index 6a028fa33..d1cfcb2cc 100644 --- a/public/pages/CreateTrigger/containers/ConfigureActions/ConfigureActions.js +++ b/public/pages/CreateTrigger/containers/ConfigureActions/ConfigureActions.js @@ -1,27 +1,6 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Copyright 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. */ import React from 'react'; diff --git a/public/pages/CreateTrigger/containers/ConfigureActions/ConfigureActions.test.js b/public/pages/CreateTrigger/containers/ConfigureActions/ConfigureActions.test.js index 1da00692e..d2e26a6a6 100644 --- a/public/pages/CreateTrigger/containers/ConfigureActions/ConfigureActions.test.js +++ b/public/pages/CreateTrigger/containers/ConfigureActions/ConfigureActions.test.js @@ -1,27 +1,6 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. */ import { checkForError } from './ConfigureActions'; diff --git a/public/pages/CreateTrigger/containers/ConfigureActions/index.js b/public/pages/CreateTrigger/containers/ConfigureActions/index.js index 0d3abd603..24abccc8a 100644 --- a/public/pages/CreateTrigger/containers/ConfigureActions/index.js +++ b/public/pages/CreateTrigger/containers/ConfigureActions/index.js @@ -1,27 +1,6 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. */ import ConfigureActions from './ConfigureActions'; diff --git a/public/pages/CreateTrigger/containers/ConfigureTriggers/ConfigureTriggers.js b/public/pages/CreateTrigger/containers/ConfigureTriggers/ConfigureTriggers.js index 95ab7e4a9..f7ef0c569 100644 --- a/public/pages/CreateTrigger/containers/ConfigureTriggers/ConfigureTriggers.js +++ b/public/pages/CreateTrigger/containers/ConfigureTriggers/ConfigureTriggers.js @@ -1,27 +1,6 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Copyright 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. */ import React from 'react'; diff --git a/public/pages/CreateTrigger/containers/ConfigureTriggers/index.js b/public/pages/CreateTrigger/containers/ConfigureTriggers/index.js index 9a19e776c..08b5549d5 100644 --- a/public/pages/CreateTrigger/containers/ConfigureTriggers/index.js +++ b/public/pages/CreateTrigger/containers/ConfigureTriggers/index.js @@ -1,16 +1,6 @@ /* - * Copyright 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. + * Copyright OpenSearch Contributors + * SPDX-License-Identifier: Apache-2.0 */ import ConfigureTriggers from './ConfigureTriggers'; diff --git a/public/pages/CreateTrigger/containers/CreateTrigger/CreateTrigger/CreateTrigger.js b/public/pages/CreateTrigger/containers/CreateTrigger/CreateTrigger/CreateTrigger.js index 469087304..517ac51a3 100644 --- a/public/pages/CreateTrigger/containers/CreateTrigger/CreateTrigger/CreateTrigger.js +++ b/public/pages/CreateTrigger/containers/CreateTrigger/CreateTrigger/CreateTrigger.js @@ -1,16 +1,6 @@ /* - * Copyright 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. + * Copyright OpenSearch Contributors + * SPDX-License-Identifier: Apache-2.0 */ import React, { Component, Fragment } from 'react'; diff --git a/public/pages/CreateTrigger/containers/CreateTrigger/CreateTrigger/index.js b/public/pages/CreateTrigger/containers/CreateTrigger/CreateTrigger/index.js index f9aa5d767..6d9c1ddf2 100644 --- a/public/pages/CreateTrigger/containers/CreateTrigger/CreateTrigger/index.js +++ b/public/pages/CreateTrigger/containers/CreateTrigger/CreateTrigger/index.js @@ -1,27 +1,6 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. */ import CreateTrigger from './CreateTrigger'; diff --git a/public/pages/CreateTrigger/containers/CreateTrigger/utils/constants.js b/public/pages/CreateTrigger/containers/CreateTrigger/utils/constants.js index b45aa4338..93990c60b 100644 --- a/public/pages/CreateTrigger/containers/CreateTrigger/utils/constants.js +++ b/public/pages/CreateTrigger/containers/CreateTrigger/utils/constants.js @@ -1,27 +1,6 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Copyright 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. */ export const TRIGGER_TYPE = { diff --git a/public/pages/CreateTrigger/containers/CreateTrigger/utils/formikToTrigger.js b/public/pages/CreateTrigger/containers/CreateTrigger/utils/formikToTrigger.js index fdf47190a..631698ea6 100644 --- a/public/pages/CreateTrigger/containers/CreateTrigger/utils/formikToTrigger.js +++ b/public/pages/CreateTrigger/containers/CreateTrigger/utils/formikToTrigger.js @@ -1,27 +1,6 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Copyright 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. */ import _ from 'lodash'; diff --git a/public/pages/CreateTrigger/containers/CreateTrigger/utils/formikToTrigger.test.js b/public/pages/CreateTrigger/containers/CreateTrigger/utils/formikToTrigger.test.js index 005f2fa25..350251469 100644 --- a/public/pages/CreateTrigger/containers/CreateTrigger/utils/formikToTrigger.test.js +++ b/public/pages/CreateTrigger/containers/CreateTrigger/utils/formikToTrigger.test.js @@ -1,27 +1,6 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Copyright 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. */ import _ from 'lodash'; diff --git a/public/pages/CreateTrigger/containers/CreateTrigger/utils/triggerToFormik.js b/public/pages/CreateTrigger/containers/CreateTrigger/utils/triggerToFormik.js index c3aacb16b..538904839 100644 --- a/public/pages/CreateTrigger/containers/CreateTrigger/utils/triggerToFormik.js +++ b/public/pages/CreateTrigger/containers/CreateTrigger/utils/triggerToFormik.js @@ -1,27 +1,6 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Copyright 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. */ import _ from 'lodash'; diff --git a/public/pages/CreateTrigger/containers/DefineBucketLevelTrigger/DefineBucketLevelTrigger.js b/public/pages/CreateTrigger/containers/DefineBucketLevelTrigger/DefineBucketLevelTrigger.js index 093bc3550..e63ac45a6 100644 --- a/public/pages/CreateTrigger/containers/DefineBucketLevelTrigger/DefineBucketLevelTrigger.js +++ b/public/pages/CreateTrigger/containers/DefineBucketLevelTrigger/DefineBucketLevelTrigger.js @@ -1,27 +1,6 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Copyright 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. */ import React, { Component } from 'react'; diff --git a/public/pages/CreateTrigger/containers/DefineBucketLevelTrigger/index.js b/public/pages/CreateTrigger/containers/DefineBucketLevelTrigger/index.js index f23a9a6c6..402ada6fa 100644 --- a/public/pages/CreateTrigger/containers/DefineBucketLevelTrigger/index.js +++ b/public/pages/CreateTrigger/containers/DefineBucketLevelTrigger/index.js @@ -1,16 +1,6 @@ /* - * Copyright 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. + * Copyright OpenSearch Contributors + * SPDX-License-Identifier: Apache-2.0 */ import DefineBucketLevelTrigger from './DefineBucketLevelTrigger'; diff --git a/public/pages/CreateTrigger/containers/DefineTrigger/AnomalyDetectorTrigger.js b/public/pages/CreateTrigger/containers/DefineTrigger/AnomalyDetectorTrigger.js index 03798e4a7..8f9be5374 100644 --- a/public/pages/CreateTrigger/containers/DefineTrigger/AnomalyDetectorTrigger.js +++ b/public/pages/CreateTrigger/containers/DefineTrigger/AnomalyDetectorTrigger.js @@ -1,27 +1,6 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Copyright 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. */ import React from 'react'; diff --git a/public/pages/CreateTrigger/containers/DefineTrigger/DefineTrigger.js b/public/pages/CreateTrigger/containers/DefineTrigger/DefineTrigger.js index 998b86540..0e2a2bbbd 100644 --- a/public/pages/CreateTrigger/containers/DefineTrigger/DefineTrigger.js +++ b/public/pages/CreateTrigger/containers/DefineTrigger/DefineTrigger.js @@ -1,27 +1,6 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Copyright 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. */ import React, { Component } from 'react'; diff --git a/public/pages/CreateTrigger/containers/DefineTrigger/index.js b/public/pages/CreateTrigger/containers/DefineTrigger/index.js index c0756f037..e40883096 100644 --- a/public/pages/CreateTrigger/containers/DefineTrigger/index.js +++ b/public/pages/CreateTrigger/containers/DefineTrigger/index.js @@ -1,27 +1,6 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. */ import DefineTrigger from './DefineTrigger'; diff --git a/public/pages/CreateTrigger/containers/DefineTrigger/utils/validation.js b/public/pages/CreateTrigger/containers/DefineTrigger/utils/validation.js index 26620bd72..f40111b99 100644 --- a/public/pages/CreateTrigger/containers/DefineTrigger/utils/validation.js +++ b/public/pages/CreateTrigger/containers/DefineTrigger/utils/validation.js @@ -1,27 +1,6 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Copyright 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. */ import _ from 'lodash'; diff --git a/public/pages/CreateTrigger/containers/DefineTrigger/utils/validation.test.js b/public/pages/CreateTrigger/containers/DefineTrigger/utils/validation.test.js index f141d1936..480606be4 100644 --- a/public/pages/CreateTrigger/containers/DefineTrigger/utils/validation.test.js +++ b/public/pages/CreateTrigger/containers/DefineTrigger/utils/validation.test.js @@ -1,27 +1,6 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. */ import { validateTriggerName } from './validation'; diff --git a/public/pages/CreateTrigger/index.js b/public/pages/CreateTrigger/index.js index 32d8059fc..0ec2e305e 100644 --- a/public/pages/CreateTrigger/index.js +++ b/public/pages/CreateTrigger/index.js @@ -1,27 +1,6 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. */ import CreateMultipleTriggers from './containers/CreateTrigger/CreateMultipleTriggers'; diff --git a/public/pages/CreateTrigger/utils/constants.js b/public/pages/CreateTrigger/utils/constants.js index ba21ce98e..d0b5768ae 100644 --- a/public/pages/CreateTrigger/utils/constants.js +++ b/public/pages/CreateTrigger/utils/constants.js @@ -1,27 +1,6 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Copyright 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. */ export const DEFAULT_MESSAGE_SOURCE = { diff --git a/public/pages/Dashboard/components/DashboardControls/DashboardControls.js b/public/pages/Dashboard/components/DashboardControls/DashboardControls.js index 3b728921a..709e80839 100644 --- a/public/pages/Dashboard/components/DashboardControls/DashboardControls.js +++ b/public/pages/Dashboard/components/DashboardControls/DashboardControls.js @@ -1,27 +1,6 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Copyright 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. */ import React from 'react'; diff --git a/public/pages/Dashboard/components/DashboardControls/DashboardControls.test.js b/public/pages/Dashboard/components/DashboardControls/DashboardControls.test.js index 23f00e473..fa9804d27 100644 --- a/public/pages/Dashboard/components/DashboardControls/DashboardControls.test.js +++ b/public/pages/Dashboard/components/DashboardControls/DashboardControls.test.js @@ -1,27 +1,6 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. */ import React from 'react'; diff --git a/public/pages/Dashboard/components/DashboardControls/index.js b/public/pages/Dashboard/components/DashboardControls/index.js index 4d4248b03..5814677d8 100644 --- a/public/pages/Dashboard/components/DashboardControls/index.js +++ b/public/pages/Dashboard/components/DashboardControls/index.js @@ -1,27 +1,6 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. */ import DashboardControls from './DashboardControls'; diff --git a/public/pages/Dashboard/components/DashboardEmptyPrompt/DashboardEmptyPrompt.js b/public/pages/Dashboard/components/DashboardEmptyPrompt/DashboardEmptyPrompt.js index 557f23028..ee52c205c 100644 --- a/public/pages/Dashboard/components/DashboardEmptyPrompt/DashboardEmptyPrompt.js +++ b/public/pages/Dashboard/components/DashboardEmptyPrompt/DashboardEmptyPrompt.js @@ -1,27 +1,6 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Copyright 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. */ import React from 'react'; diff --git a/public/pages/Dashboard/components/DashboardEmptyPrompt/DashboardEmptyPrompt.test.js b/public/pages/Dashboard/components/DashboardEmptyPrompt/DashboardEmptyPrompt.test.js index 9adf06f38..5a3d660e9 100644 --- a/public/pages/Dashboard/components/DashboardEmptyPrompt/DashboardEmptyPrompt.test.js +++ b/public/pages/Dashboard/components/DashboardEmptyPrompt/DashboardEmptyPrompt.test.js @@ -1,27 +1,6 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. */ import React from 'react'; diff --git a/public/pages/Dashboard/components/DashboardEmptyPrompt/index.js b/public/pages/Dashboard/components/DashboardEmptyPrompt/index.js index 6f98cc3e1..58e1741bf 100644 --- a/public/pages/Dashboard/components/DashboardEmptyPrompt/index.js +++ b/public/pages/Dashboard/components/DashboardEmptyPrompt/index.js @@ -1,27 +1,6 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. */ import DashboardEmptyPrompt from './DashboardEmptyPrompt'; diff --git a/public/pages/Dashboard/containers/Dashboard.js b/public/pages/Dashboard/containers/Dashboard.js index 444f2994f..5e3908bd1 100644 --- a/public/pages/Dashboard/containers/Dashboard.js +++ b/public/pages/Dashboard/containers/Dashboard.js @@ -1,27 +1,6 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Copyright 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. */ import React, { Component } from 'react'; diff --git a/public/pages/Dashboard/containers/Dashboard.test.js b/public/pages/Dashboard/containers/Dashboard.test.js index 4f440e976..06811d23b 100644 --- a/public/pages/Dashboard/containers/Dashboard.test.js +++ b/public/pages/Dashboard/containers/Dashboard.test.js @@ -1,27 +1,6 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. */ import React from 'react'; diff --git a/public/pages/Dashboard/utils/constants.js b/public/pages/Dashboard/utils/constants.js index 1ed5b8c6d..e11841df8 100644 --- a/public/pages/Dashboard/utils/constants.js +++ b/public/pages/Dashboard/utils/constants.js @@ -1,12 +1,6 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. */ export const EMPTY_ALERT_LIST = { diff --git a/public/pages/Dashboard/utils/helpers.js b/public/pages/Dashboard/utils/helpers.js index 75852b31f..c3e1b9094 100644 --- a/public/pages/Dashboard/utils/helpers.js +++ b/public/pages/Dashboard/utils/helpers.js @@ -1,27 +1,6 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Copyright 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. */ import _ from 'lodash'; diff --git a/public/pages/Dashboard/utils/helpers.test.js b/public/pages/Dashboard/utils/helpers.test.js index 8188572c8..57c906561 100644 --- a/public/pages/Dashboard/utils/helpers.test.js +++ b/public/pages/Dashboard/utils/helpers.test.js @@ -1,27 +1,6 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Copyright 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. */ import _ from 'lodash'; diff --git a/public/pages/Dashboard/utils/tableUtils.js b/public/pages/Dashboard/utils/tableUtils.js index 8fc877db1..d18a57fb6 100644 --- a/public/pages/Dashboard/utils/tableUtils.js +++ b/public/pages/Dashboard/utils/tableUtils.js @@ -1,27 +1,6 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Copyright 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. */ import React from 'react'; diff --git a/public/pages/Destinations/components/DestinationsList/DeleteConfirmation/DeleteConfirmation.js b/public/pages/Destinations/components/DestinationsList/DeleteConfirmation/DeleteConfirmation.js index 0cdb2dd18..638113361 100644 --- a/public/pages/Destinations/components/DestinationsList/DeleteConfirmation/DeleteConfirmation.js +++ b/public/pages/Destinations/components/DestinationsList/DeleteConfirmation/DeleteConfirmation.js @@ -1,27 +1,6 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. */ import React from 'react'; diff --git a/public/pages/Destinations/components/DestinationsList/DeleteConfirmation/DeleteConfirmation.test.js b/public/pages/Destinations/components/DestinationsList/DeleteConfirmation/DeleteConfirmation.test.js index 34c1e6544..66a3888d9 100644 --- a/public/pages/Destinations/components/DestinationsList/DeleteConfirmation/DeleteConfirmation.test.js +++ b/public/pages/Destinations/components/DestinationsList/DeleteConfirmation/DeleteConfirmation.test.js @@ -1,27 +1,6 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. */ import React from 'react'; diff --git a/public/pages/Destinations/components/DestinationsList/DeleteConfirmation/index.js b/public/pages/Destinations/components/DestinationsList/DeleteConfirmation/index.js index 333509f3f..6092904ca 100644 --- a/public/pages/Destinations/components/DestinationsList/DeleteConfirmation/index.js +++ b/public/pages/Destinations/components/DestinationsList/DeleteConfirmation/index.js @@ -1,27 +1,6 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. */ import DeleteConfirmation from './DeleteConfirmation'; diff --git a/public/pages/Destinations/components/DestinationsList/DestinationsActions/DestinationsActions.js b/public/pages/Destinations/components/DestinationsList/DestinationsActions/DestinationsActions.js index 57dd2f930..7aefcfaaf 100644 --- a/public/pages/Destinations/components/DestinationsList/DestinationsActions/DestinationsActions.js +++ b/public/pages/Destinations/components/DestinationsList/DestinationsActions/DestinationsActions.js @@ -1,27 +1,6 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. */ import React, { Component } from 'react'; diff --git a/public/pages/Destinations/components/DestinationsList/DestinationsActions/DestinationsActions.test.js b/public/pages/Destinations/components/DestinationsList/DestinationsActions/DestinationsActions.test.js index fa7eb3758..b6ccdf5da 100644 --- a/public/pages/Destinations/components/DestinationsList/DestinationsActions/DestinationsActions.test.js +++ b/public/pages/Destinations/components/DestinationsList/DestinationsActions/DestinationsActions.test.js @@ -1,27 +1,6 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. */ import React from 'react'; diff --git a/public/pages/Destinations/components/DestinationsList/DestinationsActions/index.js b/public/pages/Destinations/components/DestinationsList/DestinationsActions/index.js index 3cb4ac664..698e1936b 100644 --- a/public/pages/Destinations/components/DestinationsList/DestinationsActions/index.js +++ b/public/pages/Destinations/components/DestinationsList/DestinationsActions/index.js @@ -1,27 +1,6 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. */ import DestinationsActions from './DestinationsActions'; diff --git a/public/pages/Destinations/components/DestinationsList/DestinationsControls/DestinationsControls.js b/public/pages/Destinations/components/DestinationsList/DestinationsControls/DestinationsControls.js index c741fe017..bf01d95cc 100644 --- a/public/pages/Destinations/components/DestinationsList/DestinationsControls/DestinationsControls.js +++ b/public/pages/Destinations/components/DestinationsList/DestinationsControls/DestinationsControls.js @@ -1,27 +1,6 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. */ import React from 'react'; diff --git a/public/pages/Destinations/components/DestinationsList/DestinationsControls/DestinationsControls.test.js b/public/pages/Destinations/components/DestinationsList/DestinationsControls/DestinationsControls.test.js index fcd7aea7c..ce5c5fa84 100644 --- a/public/pages/Destinations/components/DestinationsList/DestinationsControls/DestinationsControls.test.js +++ b/public/pages/Destinations/components/DestinationsList/DestinationsControls/DestinationsControls.test.js @@ -1,27 +1,6 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. */ import React from 'react'; diff --git a/public/pages/Destinations/components/DestinationsList/DestinationsControls/index.js b/public/pages/Destinations/components/DestinationsList/DestinationsControls/index.js index cc89a96b3..0f70c7e87 100644 --- a/public/pages/Destinations/components/DestinationsList/DestinationsControls/index.js +++ b/public/pages/Destinations/components/DestinationsList/DestinationsControls/index.js @@ -1,27 +1,6 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. */ import DestinationsControls from './DestinationsControls'; diff --git a/public/pages/Destinations/components/DestinationsList/EmptyDestinations/EmptyDestinations.js b/public/pages/Destinations/components/DestinationsList/EmptyDestinations/EmptyDestinations.js index 4ff4f3a35..024fe9506 100644 --- a/public/pages/Destinations/components/DestinationsList/EmptyDestinations/EmptyDestinations.js +++ b/public/pages/Destinations/components/DestinationsList/EmptyDestinations/EmptyDestinations.js @@ -1,27 +1,6 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. */ import React from 'react'; diff --git a/public/pages/Destinations/components/DestinationsList/EmptyDestinations/EmptyDestinations.test.js b/public/pages/Destinations/components/DestinationsList/EmptyDestinations/EmptyDestinations.test.js index be04b682f..84bcbefdc 100644 --- a/public/pages/Destinations/components/DestinationsList/EmptyDestinations/EmptyDestinations.test.js +++ b/public/pages/Destinations/components/DestinationsList/EmptyDestinations/EmptyDestinations.test.js @@ -1,27 +1,6 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. */ import React from 'react'; diff --git a/public/pages/Destinations/components/DestinationsList/EmptyDestinations/index.js b/public/pages/Destinations/components/DestinationsList/EmptyDestinations/index.js index 30f0aeef0..bcdaacd2b 100644 --- a/public/pages/Destinations/components/DestinationsList/EmptyDestinations/index.js +++ b/public/pages/Destinations/components/DestinationsList/EmptyDestinations/index.js @@ -1,27 +1,6 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. */ import EmptyDestinations from './EmptyDestinations'; diff --git a/public/pages/Destinations/components/DestinationsList/index.js b/public/pages/Destinations/components/DestinationsList/index.js index 661d72a97..0b05f5c3b 100644 --- a/public/pages/Destinations/components/DestinationsList/index.js +++ b/public/pages/Destinations/components/DestinationsList/index.js @@ -1,27 +1,6 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. */ import DeleteConfirmation from './DeleteConfirmation'; diff --git a/public/pages/Destinations/components/createDestinations/AddEmailGroupButton/AddEmailGroupButton.js b/public/pages/Destinations/components/createDestinations/AddEmailGroupButton/AddEmailGroupButton.js index 45c738b45..fc70c2b70 100644 --- a/public/pages/Destinations/components/createDestinations/AddEmailGroupButton/AddEmailGroupButton.js +++ b/public/pages/Destinations/components/createDestinations/AddEmailGroupButton/AddEmailGroupButton.js @@ -1,27 +1,6 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. */ import React from 'react'; diff --git a/public/pages/Destinations/components/createDestinations/AddSenderButton/AddSenderButton.js b/public/pages/Destinations/components/createDestinations/AddSenderButton/AddSenderButton.js index 1559e83f7..366e32672 100644 --- a/public/pages/Destinations/components/createDestinations/AddSenderButton/AddSenderButton.js +++ b/public/pages/Destinations/components/createDestinations/AddSenderButton/AddSenderButton.js @@ -1,27 +1,6 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. */ import React from 'react'; diff --git a/public/pages/Destinations/components/createDestinations/CustomWebhook/CustomWebhook.js b/public/pages/Destinations/components/createDestinations/CustomWebhook/CustomWebhook.js index e8691762f..2755d8ef3 100644 --- a/public/pages/Destinations/components/createDestinations/CustomWebhook/CustomWebhook.js +++ b/public/pages/Destinations/components/createDestinations/CustomWebhook/CustomWebhook.js @@ -1,27 +1,6 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. */ import React from 'react'; diff --git a/public/pages/Destinations/components/createDestinations/CustomWebhook/HeaderParamsEditor.js b/public/pages/Destinations/components/createDestinations/CustomWebhook/HeaderParamsEditor.js index 92d4a04ea..08371dfda 100644 --- a/public/pages/Destinations/components/createDestinations/CustomWebhook/HeaderParamsEditor.js +++ b/public/pages/Destinations/components/createDestinations/CustomWebhook/HeaderParamsEditor.js @@ -1,27 +1,6 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. */ import React, { Fragment } from 'react'; diff --git a/public/pages/Destinations/components/createDestinations/CustomWebhook/MethodEditor.js b/public/pages/Destinations/components/createDestinations/CustomWebhook/MethodEditor.js index b08baa857..1c31c36f0 100644 --- a/public/pages/Destinations/components/createDestinations/CustomWebhook/MethodEditor.js +++ b/public/pages/Destinations/components/createDestinations/CustomWebhook/MethodEditor.js @@ -1,12 +1,6 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. */ import React, { Fragment } from 'react'; diff --git a/public/pages/Destinations/components/createDestinations/CustomWebhook/QueryParamsEditor.js b/public/pages/Destinations/components/createDestinations/CustomWebhook/QueryParamsEditor.js index 9b915b8f5..1d0a5f4b4 100644 --- a/public/pages/Destinations/components/createDestinations/CustomWebhook/QueryParamsEditor.js +++ b/public/pages/Destinations/components/createDestinations/CustomWebhook/QueryParamsEditor.js @@ -1,27 +1,6 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. */ import React from 'react'; diff --git a/public/pages/Destinations/components/createDestinations/CustomWebhook/URLInfo.js b/public/pages/Destinations/components/createDestinations/CustomWebhook/URLInfo.js index 82c4ff076..3bbc499cf 100644 --- a/public/pages/Destinations/components/createDestinations/CustomWebhook/URLInfo.js +++ b/public/pages/Destinations/components/createDestinations/CustomWebhook/URLInfo.js @@ -1,27 +1,6 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. */ import React, { Fragment } from 'react'; diff --git a/public/pages/Destinations/components/createDestinations/CustomWebhook/index.js b/public/pages/Destinations/components/createDestinations/CustomWebhook/index.js index f073b5a0b..07b764ae7 100644 --- a/public/pages/Destinations/components/createDestinations/CustomWebhook/index.js +++ b/public/pages/Destinations/components/createDestinations/CustomWebhook/index.js @@ -1,27 +1,6 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. */ import CustomWebhook from './CustomWebhook'; diff --git a/public/pages/Destinations/components/createDestinations/CustomWebhook/validate.js b/public/pages/Destinations/components/createDestinations/CustomWebhook/validate.js index 5ea42f255..822d9630a 100644 --- a/public/pages/Destinations/components/createDestinations/CustomWebhook/validate.js +++ b/public/pages/Destinations/components/createDestinations/CustomWebhook/validate.js @@ -1,27 +1,6 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. */ import { URL_TYPE } from '../../../containers/CreateDestination/utils/constants'; diff --git a/public/pages/Destinations/components/createDestinations/CustomWebhook/validate.test.js b/public/pages/Destinations/components/createDestinations/CustomWebhook/validate.test.js index 6f0b90d96..be18e2adf 100644 --- a/public/pages/Destinations/components/createDestinations/CustomWebhook/validate.test.js +++ b/public/pages/Destinations/components/createDestinations/CustomWebhook/validate.test.js @@ -1,27 +1,6 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. */ import { validateUrl, validateHost } from './validate'; diff --git a/public/pages/Destinations/components/createDestinations/Email/Email.js b/public/pages/Destinations/components/createDestinations/Email/Email.js index 113ebdeb1..158ce3562 100644 --- a/public/pages/Destinations/components/createDestinations/Email/Email.js +++ b/public/pages/Destinations/components/createDestinations/Email/Email.js @@ -1,27 +1,6 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. */ import React from 'react'; diff --git a/public/pages/Destinations/components/createDestinations/Email/EmailGroup.js b/public/pages/Destinations/components/createDestinations/Email/EmailGroup.js index b4ec69650..28d1a8ec1 100644 --- a/public/pages/Destinations/components/createDestinations/Email/EmailGroup.js +++ b/public/pages/Destinations/components/createDestinations/Email/EmailGroup.js @@ -1,27 +1,6 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Copyright 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. */ import React from 'react'; diff --git a/public/pages/Destinations/components/createDestinations/Email/Sender.js b/public/pages/Destinations/components/createDestinations/Email/Sender.js index a428a268e..c9cff2013 100644 --- a/public/pages/Destinations/components/createDestinations/Email/Sender.js +++ b/public/pages/Destinations/components/createDestinations/Email/Sender.js @@ -1,27 +1,6 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. */ import React from 'react'; diff --git a/public/pages/Destinations/components/createDestinations/Email/index.js b/public/pages/Destinations/components/createDestinations/Email/index.js index 83b1ee47a..528e65cca 100644 --- a/public/pages/Destinations/components/createDestinations/Email/index.js +++ b/public/pages/Destinations/components/createDestinations/Email/index.js @@ -1,27 +1,6 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. */ import Email from './Email'; diff --git a/public/pages/Destinations/components/createDestinations/Email/utils/constants.js b/public/pages/Destinations/components/createDestinations/Email/utils/constants.js index 4dd1d31b9..c342daeeb 100644 --- a/public/pages/Destinations/components/createDestinations/Email/utils/constants.js +++ b/public/pages/Destinations/components/createDestinations/Email/utils/constants.js @@ -1,27 +1,6 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. */ export const METHOD_TYPE = { diff --git a/public/pages/Destinations/components/createDestinations/Email/utils/validate.js b/public/pages/Destinations/components/createDestinations/Email/utils/validate.js index a8ace1d2c..2edcdbe6c 100644 --- a/public/pages/Destinations/components/createDestinations/Email/utils/validate.js +++ b/public/pages/Destinations/components/createDestinations/Email/utils/validate.js @@ -1,27 +1,6 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. */ import _ from 'lodash'; diff --git a/public/pages/Destinations/components/createDestinations/EmailGroupEmptyPrompt/EmailGroupEmptyPrompt.js b/public/pages/Destinations/components/createDestinations/EmailGroupEmptyPrompt/EmailGroupEmptyPrompt.js index 98d0c9e70..5f6531665 100644 --- a/public/pages/Destinations/components/createDestinations/EmailGroupEmptyPrompt/EmailGroupEmptyPrompt.js +++ b/public/pages/Destinations/components/createDestinations/EmailGroupEmptyPrompt/EmailGroupEmptyPrompt.js @@ -1,27 +1,6 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. */ import React from 'react'; diff --git a/public/pages/Destinations/components/createDestinations/EmailGroupEmptyPrompt/index.js b/public/pages/Destinations/components/createDestinations/EmailGroupEmptyPrompt/index.js index ef7be9765..2e8188780 100644 --- a/public/pages/Destinations/components/createDestinations/EmailGroupEmptyPrompt/index.js +++ b/public/pages/Destinations/components/createDestinations/EmailGroupEmptyPrompt/index.js @@ -1,27 +1,6 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. */ import EmailGroupEmptyPrompt from './EmailGroupEmptyPrompt'; diff --git a/public/pages/Destinations/components/createDestinations/SenderEmptyPrompt/SenderEmptyPrompt.js b/public/pages/Destinations/components/createDestinations/SenderEmptyPrompt/SenderEmptyPrompt.js index 2684acef6..d1902f729 100644 --- a/public/pages/Destinations/components/createDestinations/SenderEmptyPrompt/SenderEmptyPrompt.js +++ b/public/pages/Destinations/components/createDestinations/SenderEmptyPrompt/SenderEmptyPrompt.js @@ -1,27 +1,6 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. */ import React from 'react'; diff --git a/public/pages/Destinations/components/createDestinations/SenderEmptyPrompt/index.js b/public/pages/Destinations/components/createDestinations/SenderEmptyPrompt/index.js index 9fdf62782..2643b005c 100644 --- a/public/pages/Destinations/components/createDestinations/SenderEmptyPrompt/index.js +++ b/public/pages/Destinations/components/createDestinations/SenderEmptyPrompt/index.js @@ -1,27 +1,6 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. */ import SenderEmptyPrompt from './SenderEmptyPrompt'; diff --git a/public/pages/Destinations/components/createDestinations/Webhook/Webhook.js b/public/pages/Destinations/components/createDestinations/Webhook/Webhook.js index 587222853..7eed3de5b 100644 --- a/public/pages/Destinations/components/createDestinations/Webhook/Webhook.js +++ b/public/pages/Destinations/components/createDestinations/Webhook/Webhook.js @@ -1,27 +1,6 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. */ import React from 'react'; diff --git a/public/pages/Destinations/components/createDestinations/index.js b/public/pages/Destinations/components/createDestinations/index.js index e5cabcb50..715faa070 100644 --- a/public/pages/Destinations/components/createDestinations/index.js +++ b/public/pages/Destinations/components/createDestinations/index.js @@ -1,27 +1,6 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. */ import Webhook from './Webhook/Webhook'; diff --git a/public/pages/Destinations/containers/CreateDestination/CreateDestination.js b/public/pages/Destinations/containers/CreateDestination/CreateDestination.js index 4e2faa7fb..cea7b2f8d 100644 --- a/public/pages/Destinations/containers/CreateDestination/CreateDestination.js +++ b/public/pages/Destinations/containers/CreateDestination/CreateDestination.js @@ -1,27 +1,6 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. */ import React, { Fragment } from 'react'; diff --git a/public/pages/Destinations/containers/CreateDestination/EmailRecipients/EmailRecipients.js b/public/pages/Destinations/containers/CreateDestination/EmailRecipients/EmailRecipients.js index 4b291f6af..a4281285a 100644 --- a/public/pages/Destinations/containers/CreateDestination/EmailRecipients/EmailRecipients.js +++ b/public/pages/Destinations/containers/CreateDestination/EmailRecipients/EmailRecipients.js @@ -1,27 +1,6 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. */ import React, { Fragment } from 'react'; diff --git a/public/pages/Destinations/containers/CreateDestination/EmailRecipients/index.js b/public/pages/Destinations/containers/CreateDestination/EmailRecipients/index.js index 23d6999f5..9079fc6df 100644 --- a/public/pages/Destinations/containers/CreateDestination/EmailRecipients/index.js +++ b/public/pages/Destinations/containers/CreateDestination/EmailRecipients/index.js @@ -1,27 +1,6 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. */ import EmailRecipients from './EmailRecipients'; diff --git a/public/pages/Destinations/containers/CreateDestination/EmailRecipients/utils/constants.js b/public/pages/Destinations/containers/CreateDestination/EmailRecipients/utils/constants.js index 8453f96cc..3562834a2 100644 --- a/public/pages/Destinations/containers/CreateDestination/EmailRecipients/utils/constants.js +++ b/public/pages/Destinations/containers/CreateDestination/EmailRecipients/utils/constants.js @@ -1,27 +1,6 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. */ export const RECIPIENT_TYPE = { diff --git a/public/pages/Destinations/containers/CreateDestination/EmailRecipients/utils/helpers.js b/public/pages/Destinations/containers/CreateDestination/EmailRecipients/utils/helpers.js index c67e08aea..a07299939 100644 --- a/public/pages/Destinations/containers/CreateDestination/EmailRecipients/utils/helpers.js +++ b/public/pages/Destinations/containers/CreateDestination/EmailRecipients/utils/helpers.js @@ -1,27 +1,6 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. */ import { MAX_QUERY_RESULT_SIZE } from '../../../../../../utils/constants'; diff --git a/public/pages/Destinations/containers/CreateDestination/EmailRecipients/utils/validate.js b/public/pages/Destinations/containers/CreateDestination/EmailRecipients/utils/validate.js index 92cd25aab..b38283a7c 100644 --- a/public/pages/Destinations/containers/CreateDestination/EmailRecipients/utils/validate.js +++ b/public/pages/Destinations/containers/CreateDestination/EmailRecipients/utils/validate.js @@ -1,27 +1,6 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. */ import _ from 'lodash'; diff --git a/public/pages/Destinations/containers/CreateDestination/EmailSender/EmailSender.js b/public/pages/Destinations/containers/CreateDestination/EmailSender/EmailSender.js index 187fe66aa..9f5a197d0 100644 --- a/public/pages/Destinations/containers/CreateDestination/EmailSender/EmailSender.js +++ b/public/pages/Destinations/containers/CreateDestination/EmailSender/EmailSender.js @@ -1,27 +1,6 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. */ import React, { Fragment } from 'react'; diff --git a/public/pages/Destinations/containers/CreateDestination/EmailSender/index.js b/public/pages/Destinations/containers/CreateDestination/EmailSender/index.js index 111af6616..719f3f846 100644 --- a/public/pages/Destinations/containers/CreateDestination/EmailSender/index.js +++ b/public/pages/Destinations/containers/CreateDestination/EmailSender/index.js @@ -1,27 +1,6 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. */ import EmailSender from './EmailSender'; diff --git a/public/pages/Destinations/containers/CreateDestination/EmailSender/utils/helpers.js b/public/pages/Destinations/containers/CreateDestination/EmailSender/utils/helpers.js index 2b992db92..470293f76 100644 --- a/public/pages/Destinations/containers/CreateDestination/EmailSender/utils/helpers.js +++ b/public/pages/Destinations/containers/CreateDestination/EmailSender/utils/helpers.js @@ -1,27 +1,6 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. */ import { MAX_QUERY_RESULT_SIZE } from '../../../../../../utils/constants'; diff --git a/public/pages/Destinations/containers/CreateDestination/EmailSender/utils/validate.js b/public/pages/Destinations/containers/CreateDestination/EmailSender/utils/validate.js index 0048254f7..6cb23c0ab 100644 --- a/public/pages/Destinations/containers/CreateDestination/EmailSender/utils/validate.js +++ b/public/pages/Destinations/containers/CreateDestination/EmailSender/utils/validate.js @@ -1,27 +1,6 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. */ import _ from 'lodash'; diff --git a/public/pages/Destinations/containers/CreateDestination/ManageEmailGroups/ManageEmailGroups.js b/public/pages/Destinations/containers/CreateDestination/ManageEmailGroups/ManageEmailGroups.js index 42a67988e..453a70bbb 100644 --- a/public/pages/Destinations/containers/CreateDestination/ManageEmailGroups/ManageEmailGroups.js +++ b/public/pages/Destinations/containers/CreateDestination/ManageEmailGroups/ManageEmailGroups.js @@ -1,27 +1,6 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. */ import React from 'react'; diff --git a/public/pages/Destinations/containers/CreateDestination/ManageEmailGroups/ManageEmailGroups.test.js b/public/pages/Destinations/containers/CreateDestination/ManageEmailGroups/ManageEmailGroups.test.js index 52e1cd689..4a2267bd4 100644 --- a/public/pages/Destinations/containers/CreateDestination/ManageEmailGroups/ManageEmailGroups.test.js +++ b/public/pages/Destinations/containers/CreateDestination/ManageEmailGroups/ManageEmailGroups.test.js @@ -1,27 +1,6 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. */ import React from 'react'; diff --git a/public/pages/Destinations/containers/CreateDestination/ManageEmailGroups/index.js b/public/pages/Destinations/containers/CreateDestination/ManageEmailGroups/index.js index 741ff0c42..a607ec176 100644 --- a/public/pages/Destinations/containers/CreateDestination/ManageEmailGroups/index.js +++ b/public/pages/Destinations/containers/CreateDestination/ManageEmailGroups/index.js @@ -1,27 +1,6 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. */ import ManageEmailGroups from './ManageEmailGroups'; diff --git a/public/pages/Destinations/containers/CreateDestination/ManageEmailGroups/utils/helpers.js b/public/pages/Destinations/containers/CreateDestination/ManageEmailGroups/utils/helpers.js index 5b65d6422..0388e71ca 100644 --- a/public/pages/Destinations/containers/CreateDestination/ManageEmailGroups/utils/helpers.js +++ b/public/pages/Destinations/containers/CreateDestination/ManageEmailGroups/utils/helpers.js @@ -1,27 +1,6 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. */ import _ from 'lodash'; diff --git a/public/pages/Destinations/containers/CreateDestination/ManageSenders/ManageSenders.js b/public/pages/Destinations/containers/CreateDestination/ManageSenders/ManageSenders.js index 3541f1da2..d9ba2dad1 100644 --- a/public/pages/Destinations/containers/CreateDestination/ManageSenders/ManageSenders.js +++ b/public/pages/Destinations/containers/CreateDestination/ManageSenders/ManageSenders.js @@ -1,27 +1,6 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. */ import React from 'react'; diff --git a/public/pages/Destinations/containers/CreateDestination/ManageSenders/ManageSenders.test.js b/public/pages/Destinations/containers/CreateDestination/ManageSenders/ManageSenders.test.js index 225ea7218..1ba938f36 100644 --- a/public/pages/Destinations/containers/CreateDestination/ManageSenders/ManageSenders.test.js +++ b/public/pages/Destinations/containers/CreateDestination/ManageSenders/ManageSenders.test.js @@ -1,27 +1,6 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. */ import React from 'react'; diff --git a/public/pages/Destinations/containers/CreateDestination/ManageSenders/index.js b/public/pages/Destinations/containers/CreateDestination/ManageSenders/index.js index 56875a8b8..1fe9f2871 100644 --- a/public/pages/Destinations/containers/CreateDestination/ManageSenders/index.js +++ b/public/pages/Destinations/containers/CreateDestination/ManageSenders/index.js @@ -1,27 +1,6 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. */ import ManageSenders from './ManageSenders'; diff --git a/public/pages/Destinations/containers/CreateDestination/ManageSenders/utils/helpers.js b/public/pages/Destinations/containers/CreateDestination/ManageSenders/utils/helpers.js index a4dc26294..c7dae1422 100644 --- a/public/pages/Destinations/containers/CreateDestination/ManageSenders/utils/helpers.js +++ b/public/pages/Destinations/containers/CreateDestination/ManageSenders/utils/helpers.js @@ -1,27 +1,6 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. */ import _ from 'lodash'; diff --git a/public/pages/Destinations/containers/CreateDestination/index.js b/public/pages/Destinations/containers/CreateDestination/index.js index fed70c073..7f2256409 100644 --- a/public/pages/Destinations/containers/CreateDestination/index.js +++ b/public/pages/Destinations/containers/CreateDestination/index.js @@ -1,27 +1,6 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. */ import CreateDestination from './CreateDestination'; diff --git a/public/pages/Destinations/containers/CreateDestination/utils/__tests__/destinationToFormik.test.js b/public/pages/Destinations/containers/CreateDestination/utils/__tests__/destinationToFormik.test.js index 5e6bdd77b..fb8551c95 100644 --- a/public/pages/Destinations/containers/CreateDestination/utils/__tests__/destinationToFormik.test.js +++ b/public/pages/Destinations/containers/CreateDestination/utils/__tests__/destinationToFormik.test.js @@ -1,27 +1,6 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. */ import { destinationToFormik } from '../destinationToFormik'; diff --git a/public/pages/Destinations/containers/CreateDestination/utils/__tests__/formikToDestination.test.js b/public/pages/Destinations/containers/CreateDestination/utils/__tests__/formikToDestination.test.js index 50ebe00a1..e4564beac 100644 --- a/public/pages/Destinations/containers/CreateDestination/utils/__tests__/formikToDestination.test.js +++ b/public/pages/Destinations/containers/CreateDestination/utils/__tests__/formikToDestination.test.js @@ -1,27 +1,6 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. */ import { formikToDestination } from '../formikToDestination'; diff --git a/public/pages/Destinations/containers/CreateDestination/utils/__tests__/validation.test.js b/public/pages/Destinations/containers/CreateDestination/utils/__tests__/validation.test.js index 798fbb3c4..cb29ce035 100644 --- a/public/pages/Destinations/containers/CreateDestination/utils/__tests__/validation.test.js +++ b/public/pages/Destinations/containers/CreateDestination/utils/__tests__/validation.test.js @@ -1,27 +1,6 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. */ import { validateDestinationName } from '../validations'; diff --git a/public/pages/Destinations/containers/CreateDestination/utils/constants.js b/public/pages/Destinations/containers/CreateDestination/utils/constants.js index 649ccf814..6c7ed571b 100644 --- a/public/pages/Destinations/containers/CreateDestination/utils/constants.js +++ b/public/pages/Destinations/containers/CreateDestination/utils/constants.js @@ -1,27 +1,6 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. */ import { DESTINATION_TYPE } from '../../../utils/constants'; diff --git a/public/pages/Destinations/containers/CreateDestination/utils/destinationToFormik.js b/public/pages/Destinations/containers/CreateDestination/utils/destinationToFormik.js index 8406f3633..7cc138553 100644 --- a/public/pages/Destinations/containers/CreateDestination/utils/destinationToFormik.js +++ b/public/pages/Destinations/containers/CreateDestination/utils/destinationToFormik.js @@ -1,27 +1,6 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. */ import _ from 'lodash'; diff --git a/public/pages/Destinations/containers/CreateDestination/utils/formikToDestination.js b/public/pages/Destinations/containers/CreateDestination/utils/formikToDestination.js index 39d895766..2d06f842f 100644 --- a/public/pages/Destinations/containers/CreateDestination/utils/formikToDestination.js +++ b/public/pages/Destinations/containers/CreateDestination/utils/formikToDestination.js @@ -1,27 +1,6 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. */ import { DESTINATION_TYPE } from '../../../utils/constants'; diff --git a/public/pages/Destinations/containers/CreateDestination/utils/validations.js b/public/pages/Destinations/containers/CreateDestination/utils/validations.js index 8176ef1ac..c176802bc 100644 --- a/public/pages/Destinations/containers/CreateDestination/utils/validations.js +++ b/public/pages/Destinations/containers/CreateDestination/utils/validations.js @@ -1,27 +1,6 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. */ import _ from 'lodash'; diff --git a/public/pages/Destinations/containers/DestinationsList/DestinationsList.js b/public/pages/Destinations/containers/DestinationsList/DestinationsList.js index 60ce93a4c..583118b3c 100644 --- a/public/pages/Destinations/containers/DestinationsList/DestinationsList.js +++ b/public/pages/Destinations/containers/DestinationsList/DestinationsList.js @@ -1,27 +1,6 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. */ import React from 'react'; diff --git a/public/pages/Destinations/containers/DestinationsList/DestinationsList.test.js b/public/pages/Destinations/containers/DestinationsList/DestinationsList.test.js index 43beafa82..9d6e928d8 100644 --- a/public/pages/Destinations/containers/DestinationsList/DestinationsList.test.js +++ b/public/pages/Destinations/containers/DestinationsList/DestinationsList.test.js @@ -1,27 +1,6 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. */ import React from 'react'; diff --git a/public/pages/Destinations/containers/DestinationsList/index.js b/public/pages/Destinations/containers/DestinationsList/index.js index 9319ffc3e..6ddfdcd97 100644 --- a/public/pages/Destinations/containers/DestinationsList/index.js +++ b/public/pages/Destinations/containers/DestinationsList/index.js @@ -1,27 +1,6 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. */ import DestinationsList from './DestinationsList'; diff --git a/public/pages/Destinations/containers/DestinationsList/utils/__tests__/helpers.test.js b/public/pages/Destinations/containers/DestinationsList/utils/__tests__/helpers.test.js index 1ce5f9690..9a69afd0b 100644 --- a/public/pages/Destinations/containers/DestinationsList/utils/__tests__/helpers.test.js +++ b/public/pages/Destinations/containers/DestinationsList/utils/__tests__/helpers.test.js @@ -1,27 +1,6 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. */ import { getURLQueryParams } from '../helpers'; diff --git a/public/pages/Destinations/containers/DestinationsList/utils/constants.js b/public/pages/Destinations/containers/DestinationsList/utils/constants.js index 3024c4abc..dd179cb6d 100644 --- a/public/pages/Destinations/containers/DestinationsList/utils/constants.js +++ b/public/pages/Destinations/containers/DestinationsList/utils/constants.js @@ -1,27 +1,6 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. */ import { DESTINATION_OPTIONS } from '../../../utils/constants'; diff --git a/public/pages/Destinations/containers/DestinationsList/utils/deleteHelpers.js b/public/pages/Destinations/containers/DestinationsList/utils/deleteHelpers.js index 9a81aa92f..9951a374f 100644 --- a/public/pages/Destinations/containers/DestinationsList/utils/deleteHelpers.js +++ b/public/pages/Destinations/containers/DestinationsList/utils/deleteHelpers.js @@ -1,27 +1,6 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. */ export const isDeleteAllowedQuery = (type, id) => ({ diff --git a/public/pages/Destinations/containers/DestinationsList/utils/helpers.js b/public/pages/Destinations/containers/DestinationsList/utils/helpers.js index 47a3eef9f..ce63ec21d 100644 --- a/public/pages/Destinations/containers/DestinationsList/utils/helpers.js +++ b/public/pages/Destinations/containers/DestinationsList/utils/helpers.js @@ -1,27 +1,6 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. */ import queryString from 'query-string'; diff --git a/public/pages/Destinations/utils/constants.js b/public/pages/Destinations/utils/constants.js index 1b5366390..16d497c49 100644 --- a/public/pages/Destinations/utils/constants.js +++ b/public/pages/Destinations/utils/constants.js @@ -1,27 +1,6 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. */ export const DESTINATION_TYPE = { diff --git a/public/pages/Destinations/utils/helpers.js b/public/pages/Destinations/utils/helpers.js index 7e6256989..563101e01 100644 --- a/public/pages/Destinations/utils/helpers.js +++ b/public/pages/Destinations/utils/helpers.js @@ -1,27 +1,6 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. */ import _ from 'lodash'; diff --git a/public/pages/Home/Home.js b/public/pages/Home/Home.js index e3721c12d..17208745b 100644 --- a/public/pages/Home/Home.js +++ b/public/pages/Home/Home.js @@ -1,27 +1,6 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Copyright 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. */ import React, { Component } from 'react'; diff --git a/public/pages/Home/Home.test.js b/public/pages/Home/Home.test.js index 5f3de168d..8e2fa723a 100644 --- a/public/pages/Home/Home.test.js +++ b/public/pages/Home/Home.test.js @@ -1,27 +1,6 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. */ import React from 'react'; diff --git a/public/pages/Home/index.js b/public/pages/Home/index.js index 86a0501e8..e93899b5c 100644 --- a/public/pages/Home/index.js +++ b/public/pages/Home/index.js @@ -1,27 +1,6 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. */ import Home from './Home'; diff --git a/public/pages/Main/Main.js b/public/pages/Main/Main.js index e424ac325..1c1a7bb77 100644 --- a/public/pages/Main/Main.js +++ b/public/pages/Main/Main.js @@ -1,27 +1,6 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. */ import React, { Component } from 'react'; diff --git a/public/pages/Main/Main.test.js b/public/pages/Main/Main.test.js index 302b7fe25..d0c34d7ce 100644 --- a/public/pages/Main/Main.test.js +++ b/public/pages/Main/Main.test.js @@ -1,27 +1,6 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. */ import React from 'react'; diff --git a/public/pages/Main/index.js b/public/pages/Main/index.js index e73ff39d7..65d8003ee 100644 --- a/public/pages/Main/index.js +++ b/public/pages/Main/index.js @@ -1,27 +1,6 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. */ import Main from './Main'; diff --git a/public/pages/MonitorDetails/components/MonitorHistory/EmptyHistory/EmptyHistory.js b/public/pages/MonitorDetails/components/MonitorHistory/EmptyHistory/EmptyHistory.js index de130ba5a..102451b7a 100644 --- a/public/pages/MonitorDetails/components/MonitorHistory/EmptyHistory/EmptyHistory.js +++ b/public/pages/MonitorDetails/components/MonitorHistory/EmptyHistory/EmptyHistory.js @@ -1,27 +1,6 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. */ import React from 'react'; diff --git a/public/pages/MonitorDetails/components/MonitorHistory/EmptyHistory/EmptyHistory.test.js b/public/pages/MonitorDetails/components/MonitorHistory/EmptyHistory/EmptyHistory.test.js index 0338c385b..1c53cfa01 100644 --- a/public/pages/MonitorDetails/components/MonitorHistory/EmptyHistory/EmptyHistory.test.js +++ b/public/pages/MonitorDetails/components/MonitorHistory/EmptyHistory/EmptyHistory.test.js @@ -1,27 +1,6 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. */ import React from 'react'; diff --git a/public/pages/MonitorDetails/components/MonitorHistory/Legend/Legend.js b/public/pages/MonitorDetails/components/MonitorHistory/Legend/Legend.js index d5f6927cb..f75585438 100644 --- a/public/pages/MonitorDetails/components/MonitorHistory/Legend/Legend.js +++ b/public/pages/MonitorDetails/components/MonitorHistory/Legend/Legend.js @@ -1,27 +1,6 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. */ import React from 'react'; diff --git a/public/pages/MonitorDetails/components/MonitorHistory/Legend/Legende.test.js b/public/pages/MonitorDetails/components/MonitorHistory/Legend/Legende.test.js index 9f0508911..91d93eb31 100644 --- a/public/pages/MonitorDetails/components/MonitorHistory/Legend/Legende.test.js +++ b/public/pages/MonitorDetails/components/MonitorHistory/Legend/Legende.test.js @@ -1,27 +1,6 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. */ import React from 'react'; diff --git a/public/pages/MonitorDetails/components/MonitorHistory/POIChart/POIChart.js b/public/pages/MonitorDetails/components/MonitorHistory/POIChart/POIChart.js index 6bf11f53b..bcd7c5508 100644 --- a/public/pages/MonitorDetails/components/MonitorHistory/POIChart/POIChart.js +++ b/public/pages/MonitorDetails/components/MonitorHistory/POIChart/POIChart.js @@ -1,27 +1,6 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. */ import React from 'react'; diff --git a/public/pages/MonitorDetails/components/MonitorHistory/POIChart/POIChart.test.js b/public/pages/MonitorDetails/components/MonitorHistory/POIChart/POIChart.test.js index 34252abeb..ccf5dc991 100644 --- a/public/pages/MonitorDetails/components/MonitorHistory/POIChart/POIChart.test.js +++ b/public/pages/MonitorDetails/components/MonitorHistory/POIChart/POIChart.test.js @@ -1,27 +1,6 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. */ import React from 'react'; diff --git a/public/pages/MonitorDetails/components/MonitorHistory/TriggersTimeSeries/TriggersTimeSeries.js b/public/pages/MonitorDetails/components/MonitorHistory/TriggersTimeSeries/TriggersTimeSeries.js index 810d9dc08..207e6cd57 100644 --- a/public/pages/MonitorDetails/components/MonitorHistory/TriggersTimeSeries/TriggersTimeSeries.js +++ b/public/pages/MonitorDetails/components/MonitorHistory/TriggersTimeSeries/TriggersTimeSeries.js @@ -1,27 +1,6 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. */ import React, { Component } from 'react'; diff --git a/public/pages/MonitorDetails/components/MonitorHistory/TriggersTimeSeries/TriggersTimeSeries.test.js b/public/pages/MonitorDetails/components/MonitorHistory/TriggersTimeSeries/TriggersTimeSeries.test.js index ad6a58d5b..cb9e426fc 100644 --- a/public/pages/MonitorDetails/components/MonitorHistory/TriggersTimeSeries/TriggersTimeSeries.test.js +++ b/public/pages/MonitorDetails/components/MonitorHistory/TriggersTimeSeries/TriggersTimeSeries.test.js @@ -1,27 +1,6 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. */ import React from 'react'; diff --git a/public/pages/MonitorDetails/components/MonitorHistory/TriggersTimeSeries/utils/helpers.js b/public/pages/MonitorDetails/components/MonitorHistory/TriggersTimeSeries/utils/helpers.js index bd24aa1f6..e1aef3e5d 100644 --- a/public/pages/MonitorDetails/components/MonitorHistory/TriggersTimeSeries/utils/helpers.js +++ b/public/pages/MonitorDetails/components/MonitorHistory/TriggersTimeSeries/utils/helpers.js @@ -1,27 +1,6 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. */ import moment from 'moment'; diff --git a/public/pages/MonitorDetails/components/MonitorHistory/TriggersTimeSeries/utils/helpers.test.js b/public/pages/MonitorDetails/components/MonitorHistory/TriggersTimeSeries/utils/helpers.test.js index 326e0c68b..30a72319f 100644 --- a/public/pages/MonitorDetails/components/MonitorHistory/TriggersTimeSeries/utils/helpers.test.js +++ b/public/pages/MonitorDetails/components/MonitorHistory/TriggersTimeSeries/utils/helpers.test.js @@ -1,27 +1,6 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. */ import moment from 'moment'; diff --git a/public/pages/MonitorDetails/components/MonitorHistory/index.js b/public/pages/MonitorDetails/components/MonitorHistory/index.js index fd8ccc086..ad75ec8f8 100644 --- a/public/pages/MonitorDetails/components/MonitorHistory/index.js +++ b/public/pages/MonitorDetails/components/MonitorHistory/index.js @@ -1,27 +1,6 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. */ export { default as TriggersTimeSeries } from './TriggersTimeSeries/TriggersTimeSeries'; diff --git a/public/pages/MonitorDetails/components/MonitorOverview/MonitorOverview.js b/public/pages/MonitorDetails/components/MonitorOverview/MonitorOverview.js index ddbfe131e..6707dec3e 100644 --- a/public/pages/MonitorDetails/components/MonitorOverview/MonitorOverview.js +++ b/public/pages/MonitorDetails/components/MonitorOverview/MonitorOverview.js @@ -1,27 +1,6 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Copyright 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. */ import React from 'react'; diff --git a/public/pages/MonitorDetails/components/MonitorOverview/MonitorOverview.test.js b/public/pages/MonitorDetails/components/MonitorOverview/MonitorOverview.test.js index 8155affcc..9cd36e61a 100644 --- a/public/pages/MonitorDetails/components/MonitorOverview/MonitorOverview.test.js +++ b/public/pages/MonitorDetails/components/MonitorOverview/MonitorOverview.test.js @@ -1,27 +1,6 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. */ import React from 'react'; diff --git a/public/pages/MonitorDetails/components/MonitorOverview/index.js b/public/pages/MonitorDetails/components/MonitorOverview/index.js index 8f76d2b22..06b7e4e71 100644 --- a/public/pages/MonitorDetails/components/MonitorOverview/index.js +++ b/public/pages/MonitorDetails/components/MonitorOverview/index.js @@ -1,27 +1,6 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. */ import MonitorOverview from './MonitorOverview'; diff --git a/public/pages/MonitorDetails/components/MonitorOverview/utils/constants.js b/public/pages/MonitorDetails/components/MonitorOverview/utils/constants.js index fe9b68dd4..8752bf3a5 100644 --- a/public/pages/MonitorDetails/components/MonitorOverview/utils/constants.js +++ b/public/pages/MonitorDetails/components/MonitorOverview/utils/constants.js @@ -1,27 +1,6 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. */ export const weekdays = [ diff --git a/public/pages/MonitorDetails/components/MonitorOverview/utils/getOverviewStats.js b/public/pages/MonitorDetails/components/MonitorOverview/utils/getOverviewStats.js index c30d7ae39..2a7e39fa9 100644 --- a/public/pages/MonitorDetails/components/MonitorOverview/utils/getOverviewStats.js +++ b/public/pages/MonitorDetails/components/MonitorOverview/utils/getOverviewStats.js @@ -1,27 +1,6 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Copyright 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. */ import React from 'react'; diff --git a/public/pages/MonitorDetails/components/MonitorOverview/utils/getOverviewStats.test.js b/public/pages/MonitorDetails/components/MonitorOverview/utils/getOverviewStats.test.js index 20d4ca5fd..2bf486470 100644 --- a/public/pages/MonitorDetails/components/MonitorOverview/utils/getOverviewStats.test.js +++ b/public/pages/MonitorDetails/components/MonitorOverview/utils/getOverviewStats.test.js @@ -1,27 +1,6 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. */ import getOverviewStats from './getOverviewStats'; diff --git a/public/pages/MonitorDetails/components/MonitorOverview/utils/getScheduleFromMonitor.js b/public/pages/MonitorDetails/components/MonitorOverview/utils/getScheduleFromMonitor.js index c2beeee8d..2dc0d16ee 100644 --- a/public/pages/MonitorDetails/components/MonitorOverview/utils/getScheduleFromMonitor.js +++ b/public/pages/MonitorDetails/components/MonitorOverview/utils/getScheduleFromMonitor.js @@ -1,27 +1,6 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. */ import _ from 'lodash'; diff --git a/public/pages/MonitorDetails/components/MonitorOverview/utils/getScheduleFromMonitor.test.js b/public/pages/MonitorDetails/components/MonitorOverview/utils/getScheduleFromMonitor.test.js index 395b9b754..c8a066118 100644 --- a/public/pages/MonitorDetails/components/MonitorOverview/utils/getScheduleFromMonitor.test.js +++ b/public/pages/MonitorDetails/components/MonitorOverview/utils/getScheduleFromMonitor.test.js @@ -1,27 +1,6 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. */ import getScheduleFromMonitor from './getScheduleFromMonitor'; diff --git a/public/pages/MonitorDetails/components/OverviewStat/OverviewStat.js b/public/pages/MonitorDetails/components/OverviewStat/OverviewStat.js index c4a944a72..b277bf812 100644 --- a/public/pages/MonitorDetails/components/OverviewStat/OverviewStat.js +++ b/public/pages/MonitorDetails/components/OverviewStat/OverviewStat.js @@ -1,27 +1,6 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. */ import React from 'react'; diff --git a/public/pages/MonitorDetails/components/OverviewStat/OverviewStat.test.js b/public/pages/MonitorDetails/components/OverviewStat/OverviewStat.test.js index 0417c52a8..036d3ba1f 100644 --- a/public/pages/MonitorDetails/components/OverviewStat/OverviewStat.test.js +++ b/public/pages/MonitorDetails/components/OverviewStat/OverviewStat.test.js @@ -1,27 +1,6 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. */ import React from 'react'; diff --git a/public/pages/MonitorDetails/components/OverviewStat/index.js b/public/pages/MonitorDetails/components/OverviewStat/index.js index 848a6db72..ab37bd6fc 100644 --- a/public/pages/MonitorDetails/components/OverviewStat/index.js +++ b/public/pages/MonitorDetails/components/OverviewStat/index.js @@ -1,27 +1,6 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. */ import OverviewStat from './OverviewStat'; diff --git a/public/pages/MonitorDetails/containers/AnomalyHistory/AnomalyHistory.js b/public/pages/MonitorDetails/containers/AnomalyHistory/AnomalyHistory.js index 54b78f397..eb2af0f15 100644 --- a/public/pages/MonitorDetails/containers/AnomalyHistory/AnomalyHistory.js +++ b/public/pages/MonitorDetails/containers/AnomalyHistory/AnomalyHistory.js @@ -1,27 +1,6 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. */ import React, { Component } from 'react'; diff --git a/public/pages/MonitorDetails/containers/MonitorDetails.js b/public/pages/MonitorDetails/containers/MonitorDetails.js index fb27ba87f..52a62df0c 100644 --- a/public/pages/MonitorDetails/containers/MonitorDetails.js +++ b/public/pages/MonitorDetails/containers/MonitorDetails.js @@ -1,27 +1,6 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Copyright 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. */ import React, { Component, Fragment } from 'react'; diff --git a/public/pages/MonitorDetails/containers/MonitorHistory/DateRangePicker.js b/public/pages/MonitorDetails/containers/MonitorHistory/DateRangePicker.js index c44e55ebc..39358b8c9 100644 --- a/public/pages/MonitorDetails/containers/MonitorHistory/DateRangePicker.js +++ b/public/pages/MonitorDetails/containers/MonitorHistory/DateRangePicker.js @@ -1,27 +1,6 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. */ import React from 'react'; diff --git a/public/pages/MonitorDetails/containers/MonitorHistory/MonitorHistory.js b/public/pages/MonitorDetails/containers/MonitorHistory/MonitorHistory.js index 0c7c8d085..df28cb33e 100644 --- a/public/pages/MonitorDetails/containers/MonitorHistory/MonitorHistory.js +++ b/public/pages/MonitorDetails/containers/MonitorHistory/MonitorHistory.js @@ -1,27 +1,6 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. */ import React, { PureComponent } from 'react'; diff --git a/public/pages/MonitorDetails/containers/MonitorHistory/__mocks__/ui/chrome.js b/public/pages/MonitorDetails/containers/MonitorHistory/__mocks__/ui/chrome.js index 8c4408779..9fcfbfc62 100644 --- a/public/pages/MonitorDetails/containers/MonitorHistory/__mocks__/ui/chrome.js +++ b/public/pages/MonitorDetails/containers/MonitorHistory/__mocks__/ui/chrome.js @@ -1,12 +1,6 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. */ const chrome = { diff --git a/public/pages/MonitorDetails/containers/MonitorHistory/__tests__/DateRangePicker.test.js b/public/pages/MonitorDetails/containers/MonitorHistory/__tests__/DateRangePicker.test.js index f893ccef9..0669e5da0 100644 --- a/public/pages/MonitorDetails/containers/MonitorHistory/__tests__/DateRangePicker.test.js +++ b/public/pages/MonitorDetails/containers/MonitorHistory/__tests__/DateRangePicker.test.js @@ -1,27 +1,6 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. */ import React from 'react'; diff --git a/public/pages/MonitorDetails/containers/MonitorHistory/__tests__/MonitorHistory.test.js b/public/pages/MonitorDetails/containers/MonitorHistory/__tests__/MonitorHistory.test.js index a75901801..75e8db814 100644 --- a/public/pages/MonitorDetails/containers/MonitorHistory/__tests__/MonitorHistory.test.js +++ b/public/pages/MonitorDetails/containers/MonitorHistory/__tests__/MonitorHistory.test.js @@ -1,27 +1,6 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. */ import React from 'react'; diff --git a/public/pages/MonitorDetails/containers/MonitorHistory/__tests__/testHelpers.js b/public/pages/MonitorDetails/containers/MonitorHistory/__tests__/testHelpers.js index 1414de136..03b714bbb 100644 --- a/public/pages/MonitorDetails/containers/MonitorHistory/__tests__/testHelpers.js +++ b/public/pages/MonitorDetails/containers/MonitorHistory/__tests__/testHelpers.js @@ -1,27 +1,6 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. */ const getRandomInt = () => Math.floor(Math.random() * 10) + 1; diff --git a/public/pages/MonitorDetails/containers/MonitorHistory/index.js b/public/pages/MonitorDetails/containers/MonitorHistory/index.js index fb590ee98..3fbe5aa81 100644 --- a/public/pages/MonitorDetails/containers/MonitorHistory/index.js +++ b/public/pages/MonitorDetails/containers/MonitorHistory/index.js @@ -1,27 +1,6 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. */ import MonitorHistory from './MonitorHistory'; diff --git a/public/pages/MonitorDetails/containers/MonitorHistory/utils/__tests__/chartHelpers.test.js b/public/pages/MonitorDetails/containers/MonitorHistory/utils/__tests__/chartHelpers.test.js index 907b04634..94f40b712 100644 --- a/public/pages/MonitorDetails/containers/MonitorHistory/utils/__tests__/chartHelpers.test.js +++ b/public/pages/MonitorDetails/containers/MonitorHistory/utils/__tests__/chartHelpers.test.js @@ -1,27 +1,6 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. */ import moment from 'moment-timezone'; diff --git a/public/pages/MonitorDetails/containers/MonitorHistory/utils/__tests__/timeUtils.test.js b/public/pages/MonitorDetails/containers/MonitorHistory/utils/__tests__/timeUtils.test.js index 8e50dbf0b..c244e57d0 100644 --- a/public/pages/MonitorDetails/containers/MonitorHistory/utils/__tests__/timeUtils.test.js +++ b/public/pages/MonitorDetails/containers/MonitorHistory/utils/__tests__/timeUtils.test.js @@ -1,27 +1,6 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. */ import moment from 'moment'; diff --git a/public/pages/MonitorDetails/containers/MonitorHistory/utils/chartHelpers.js b/public/pages/MonitorDetails/containers/MonitorHistory/utils/chartHelpers.js index 3eb67ae60..b56be05fa 100644 --- a/public/pages/MonitorDetails/containers/MonitorHistory/utils/chartHelpers.js +++ b/public/pages/MonitorDetails/containers/MonitorHistory/utils/chartHelpers.js @@ -1,27 +1,6 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. */ import { ALERT_STATE } from '../../../../../utils/constants'; diff --git a/public/pages/MonitorDetails/containers/MonitorHistory/utils/constants.js b/public/pages/MonitorDetails/containers/MonitorHistory/utils/constants.js index dd2f5cf3d..d760251b7 100644 --- a/public/pages/MonitorDetails/containers/MonitorHistory/utils/constants.js +++ b/public/pages/MonitorDetails/containers/MonitorHistory/utils/constants.js @@ -1,27 +1,6 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. */ export const TIME_SERIES_ALERT_STATE = Object.freeze({ diff --git a/public/pages/MonitorDetails/containers/MonitorHistory/utils/timeUtils.js b/public/pages/MonitorDetails/containers/MonitorHistory/utils/timeUtils.js index 9836f025c..0e950bd08 100644 --- a/public/pages/MonitorDetails/containers/MonitorHistory/utils/timeUtils.js +++ b/public/pages/MonitorDetails/containers/MonitorHistory/utils/timeUtils.js @@ -1,27 +1,6 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. */ import moment from 'moment'; diff --git a/public/pages/MonitorDetails/containers/Triggers/Triggers.js b/public/pages/MonitorDetails/containers/Triggers/Triggers.js index f92399abc..37cdca1c9 100644 --- a/public/pages/MonitorDetails/containers/Triggers/Triggers.js +++ b/public/pages/MonitorDetails/containers/Triggers/Triggers.js @@ -1,27 +1,6 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Copyright 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. */ import React, { Component } from 'react'; diff --git a/public/pages/MonitorDetails/containers/Triggers/Triggers.test.js b/public/pages/MonitorDetails/containers/Triggers/Triggers.test.js index 8d2672ddc..49261b6c5 100644 --- a/public/pages/MonitorDetails/containers/Triggers/Triggers.test.js +++ b/public/pages/MonitorDetails/containers/Triggers/Triggers.test.js @@ -1,27 +1,6 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. */ import React from 'react'; diff --git a/public/pages/MonitorDetails/containers/Triggers/index.js b/public/pages/MonitorDetails/containers/Triggers/index.js index e22c8256b..074a69673 100644 --- a/public/pages/MonitorDetails/containers/Triggers/index.js +++ b/public/pages/MonitorDetails/containers/Triggers/index.js @@ -1,27 +1,6 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. */ import Triggers from './Triggers'; diff --git a/public/pages/MonitorDetails/containers/utils/__tests__/helper.test.js b/public/pages/MonitorDetails/containers/utils/__tests__/helper.test.js index c5d2ad036..4d32e9654 100644 --- a/public/pages/MonitorDetails/containers/utils/__tests__/helper.test.js +++ b/public/pages/MonitorDetails/containers/utils/__tests__/helper.test.js @@ -1,27 +1,6 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. */ import { migrateTriggerMetadata } from '../helpers'; diff --git a/public/pages/MonitorDetails/containers/utils/helpers.js b/public/pages/MonitorDetails/containers/utils/helpers.js index a31c48220..5d69163b5 100644 --- a/public/pages/MonitorDetails/containers/utils/helpers.js +++ b/public/pages/MonitorDetails/containers/utils/helpers.js @@ -1,27 +1,6 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. */ import { get, isEmpty } from 'lodash'; diff --git a/public/pages/Monitors/components/AcknowledgeModal/AcknowledgeModal.js b/public/pages/Monitors/components/AcknowledgeModal/AcknowledgeModal.js index d93d4e1c1..f573a568b 100644 --- a/public/pages/Monitors/components/AcknowledgeModal/AcknowledgeModal.js +++ b/public/pages/Monitors/components/AcknowledgeModal/AcknowledgeModal.js @@ -1,27 +1,6 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. */ import React, { Component } from 'react'; diff --git a/public/pages/Monitors/components/AcknowledgeModal/AcknowledgeModal.test.js b/public/pages/Monitors/components/AcknowledgeModal/AcknowledgeModal.test.js index e12e9db9d..d7cf45bc5 100644 --- a/public/pages/Monitors/components/AcknowledgeModal/AcknowledgeModal.test.js +++ b/public/pages/Monitors/components/AcknowledgeModal/AcknowledgeModal.test.js @@ -1,27 +1,6 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. */ import React from 'react'; diff --git a/public/pages/Monitors/components/AcknowledgeModal/index.js b/public/pages/Monitors/components/AcknowledgeModal/index.js index a83c78acb..14b0540be 100644 --- a/public/pages/Monitors/components/AcknowledgeModal/index.js +++ b/public/pages/Monitors/components/AcknowledgeModal/index.js @@ -1,27 +1,6 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. */ import AcknowledgeModal from './AcknowledgeModal'; diff --git a/public/pages/Monitors/components/MonitorActions/MonitorActions.js b/public/pages/Monitors/components/MonitorActions/MonitorActions.js index b34ffe163..fb580b3d5 100644 --- a/public/pages/Monitors/components/MonitorActions/MonitorActions.js +++ b/public/pages/Monitors/components/MonitorActions/MonitorActions.js @@ -1,27 +1,6 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. */ import React, { Component } from 'react'; diff --git a/public/pages/Monitors/components/MonitorActions/MonitorActions.test.js b/public/pages/Monitors/components/MonitorActions/MonitorActions.test.js index bfbc5c4a6..94fb381b3 100644 --- a/public/pages/Monitors/components/MonitorActions/MonitorActions.test.js +++ b/public/pages/Monitors/components/MonitorActions/MonitorActions.test.js @@ -1,27 +1,6 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. */ import React from 'react'; diff --git a/public/pages/Monitors/components/MonitorActions/index.js b/public/pages/Monitors/components/MonitorActions/index.js index 03a3538eb..2023af1f7 100644 --- a/public/pages/Monitors/components/MonitorActions/index.js +++ b/public/pages/Monitors/components/MonitorActions/index.js @@ -1,27 +1,6 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. */ import MonitorActions from './MonitorActions'; diff --git a/public/pages/Monitors/components/MonitorControls/MonitorControls.js b/public/pages/Monitors/components/MonitorControls/MonitorControls.js index 62d9afe97..c13e9acfb 100644 --- a/public/pages/Monitors/components/MonitorControls/MonitorControls.js +++ b/public/pages/Monitors/components/MonitorControls/MonitorControls.js @@ -1,27 +1,6 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Copyright 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. */ import React from 'react'; diff --git a/public/pages/Monitors/components/MonitorControls/index.js b/public/pages/Monitors/components/MonitorControls/index.js index 273c2713b..6a77102db 100644 --- a/public/pages/Monitors/components/MonitorControls/index.js +++ b/public/pages/Monitors/components/MonitorControls/index.js @@ -1,27 +1,6 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. */ import MonitorControls from './MonitorControls'; diff --git a/public/pages/Monitors/components/MonitorEmptyPrompt/MonitorEmptyPrompt.js b/public/pages/Monitors/components/MonitorEmptyPrompt/MonitorEmptyPrompt.js index 011ce30eb..db5549294 100644 --- a/public/pages/Monitors/components/MonitorEmptyPrompt/MonitorEmptyPrompt.js +++ b/public/pages/Monitors/components/MonitorEmptyPrompt/MonitorEmptyPrompt.js @@ -1,27 +1,6 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. */ import React from 'react'; diff --git a/public/pages/Monitors/components/MonitorEmptyPrompt/MonitorEmptyPrompt.test.js b/public/pages/Monitors/components/MonitorEmptyPrompt/MonitorEmptyPrompt.test.js index a4b8f6fb2..c18ce6ed4 100644 --- a/public/pages/Monitors/components/MonitorEmptyPrompt/MonitorEmptyPrompt.test.js +++ b/public/pages/Monitors/components/MonitorEmptyPrompt/MonitorEmptyPrompt.test.js @@ -1,27 +1,6 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. */ import React from 'react'; diff --git a/public/pages/Monitors/components/MonitorEmptyPrompt/index.js b/public/pages/Monitors/components/MonitorEmptyPrompt/index.js index 2d3489539..3226016a8 100644 --- a/public/pages/Monitors/components/MonitorEmptyPrompt/index.js +++ b/public/pages/Monitors/components/MonitorEmptyPrompt/index.js @@ -1,27 +1,6 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. */ import MonitorEmptyPrompt from './MonitorEmptyPrompt'; diff --git a/public/pages/Monitors/containers/Monitors/Monitors.js b/public/pages/Monitors/containers/Monitors/Monitors.js index 234fd4b55..0465bbd70 100644 --- a/public/pages/Monitors/containers/Monitors/Monitors.js +++ b/public/pages/Monitors/containers/Monitors/Monitors.js @@ -1,27 +1,6 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Copyright 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. */ import React, { Component } from 'react'; diff --git a/public/pages/Monitors/containers/Monitors/Monitors.test.js b/public/pages/Monitors/containers/Monitors/Monitors.test.js index 526b33a12..8d94801a2 100644 --- a/public/pages/Monitors/containers/Monitors/Monitors.test.js +++ b/public/pages/Monitors/containers/Monitors/Monitors.test.js @@ -1,27 +1,6 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. */ import React from 'react'; diff --git a/public/pages/Monitors/containers/Monitors/index.js b/public/pages/Monitors/containers/Monitors/index.js index 0eb9fa196..6177ecac6 100644 --- a/public/pages/Monitors/containers/Monitors/index.js +++ b/public/pages/Monitors/containers/Monitors/index.js @@ -1,27 +1,6 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. */ import Monitors from './Monitors'; diff --git a/public/pages/Monitors/containers/Monitors/utils/constants.js b/public/pages/Monitors/containers/Monitors/utils/constants.js index 025273850..db17f3e8f 100644 --- a/public/pages/Monitors/containers/Monitors/utils/constants.js +++ b/public/pages/Monitors/containers/Monitors/utils/constants.js @@ -1,27 +1,6 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. */ export const DEFAULT_PAGE_SIZE_OPTIONS = [5, 10, 20, 50]; diff --git a/public/pages/Monitors/containers/Monitors/utils/helpers.js b/public/pages/Monitors/containers/Monitors/utils/helpers.js index ec8ea1e0b..806fb74d0 100644 --- a/public/pages/Monitors/containers/Monitors/utils/helpers.js +++ b/public/pages/Monitors/containers/Monitors/utils/helpers.js @@ -1,27 +1,6 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. */ import { DEFAULT_QUERY_PARAMS } from './constants'; diff --git a/public/pages/Monitors/containers/Monitors/utils/tableUtils.js b/public/pages/Monitors/containers/Monitors/utils/tableUtils.js index a1b18c7bb..c8b92249f 100644 --- a/public/pages/Monitors/containers/Monitors/utils/tableUtils.js +++ b/public/pages/Monitors/containers/Monitors/utils/tableUtils.js @@ -1,27 +1,6 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. */ import React from 'react'; diff --git a/public/plugin.js b/public/plugin.js index 3fda1d623..35965a095 100644 --- a/public/plugin.js +++ b/public/plugin.js @@ -1,27 +1,6 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. */ import { PLUGIN_NAME } from '../utils/constants'; diff --git a/public/utils/CoreContext.js b/public/utils/CoreContext.js index 6661482ef..5f7155e58 100644 --- a/public/utils/CoreContext.js +++ b/public/utils/CoreContext.js @@ -1,27 +1,6 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. */ import React from 'react'; diff --git a/public/utils/SubmitErrorHandler.js b/public/utils/SubmitErrorHandler.js index 1bef87376..575eb2d08 100644 --- a/public/utils/SubmitErrorHandler.js +++ b/public/utils/SubmitErrorHandler.js @@ -1,27 +1,6 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. */ import { useEffect } from 'react'; diff --git a/public/utils/constants.js b/public/utils/constants.js index 571b79178..e784b15a7 100644 --- a/public/utils/constants.js +++ b/public/utils/constants.js @@ -1,27 +1,6 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Copyright 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. */ export const ALERT_STATE = Object.freeze({ diff --git a/public/utils/helpers.js b/public/utils/helpers.js index d5541ec9a..b4fcb58a1 100644 --- a/public/utils/helpers.js +++ b/public/utils/helpers.js @@ -1,27 +1,6 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Copyright 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. */ import React from 'react'; diff --git a/public/utils/helpers.test.js b/public/utils/helpers.test.js index 6e2b42059..e2b11fc5c 100644 --- a/public/utils/helpers.test.js +++ b/public/utils/helpers.test.js @@ -1,27 +1,6 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. */ import { backendErrorNotification } from './helpers'; diff --git a/public/utils/validate.js b/public/utils/validate.js index 6f66edcab..e4b0cb211 100644 --- a/public/utils/validate.js +++ b/public/utils/validate.js @@ -1,27 +1,6 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Copyright 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. */ import _ from 'lodash'; diff --git a/public/utils/validate.test.js b/public/utils/validate.test.js index a4704b8fc..af5094193 100644 --- a/public/utils/validate.test.js +++ b/public/utils/validate.test.js @@ -1,27 +1,6 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. */ import { diff --git a/server/clusters/alerting/adPlugin.js b/server/clusters/alerting/adPlugin.js index 53fde6a16..0feb06402 100644 --- a/server/clusters/alerting/adPlugin.js +++ b/server/clusters/alerting/adPlugin.js @@ -1,27 +1,6 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. */ import { AD_BASE_API } from '../../services/utils/constants'; diff --git a/server/clusters/alerting/alertingPlugin.js b/server/clusters/alerting/alertingPlugin.js index 1e72d8107..8004da57a 100644 --- a/server/clusters/alerting/alertingPlugin.js +++ b/server/clusters/alerting/alertingPlugin.js @@ -1,27 +1,6 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. */ import { diff --git a/server/clusters/alerting/createAlertingADCluster.js b/server/clusters/alerting/createAlertingADCluster.js index f66f90969..65f3d22b3 100644 --- a/server/clusters/alerting/createAlertingADCluster.js +++ b/server/clusters/alerting/createAlertingADCluster.js @@ -1,27 +1,6 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. */ import alertingADPlugin from './adPlugin'; diff --git a/server/clusters/alerting/createAlertingCluster.js b/server/clusters/alerting/createAlertingCluster.js index 4bdf79d06..69309f906 100644 --- a/server/clusters/alerting/createAlertingCluster.js +++ b/server/clusters/alerting/createAlertingCluster.js @@ -1,27 +1,6 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. */ import alertingPlugin from './alertingPlugin'; diff --git a/server/clusters/index.js b/server/clusters/index.js index 1077e353c..6d7a3e826 100644 --- a/server/clusters/index.js +++ b/server/clusters/index.js @@ -1,27 +1,6 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. */ import createAlertingCluster from './alerting/createAlertingCluster'; diff --git a/server/index.js b/server/index.js index c25f53c39..0b66484ee 100644 --- a/server/index.js +++ b/server/index.js @@ -1,27 +1,6 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. */ import { schema } from '@osd/config-schema'; diff --git a/server/plugin.js b/server/plugin.js index 80b4a079f..647eb1114 100644 --- a/server/plugin.js +++ b/server/plugin.js @@ -1,27 +1,6 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. */ import { first } from 'rxjs/operators'; diff --git a/server/routes/alerts.js b/server/routes/alerts.js index 95c862887..15b7da2ac 100644 --- a/server/routes/alerts.js +++ b/server/routes/alerts.js @@ -1,27 +1,6 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. */ import { schema } from '@osd/config-schema'; diff --git a/server/routes/anomalyDetector.js b/server/routes/anomalyDetector.js index 1373fd047..95b7be03a 100644 --- a/server/routes/anomalyDetector.js +++ b/server/routes/anomalyDetector.js @@ -1,27 +1,6 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. */ import { schema } from '@osd/config-schema'; diff --git a/server/routes/destinations.js b/server/routes/destinations.js index 1d841bc48..ad6a589db 100644 --- a/server/routes/destinations.js +++ b/server/routes/destinations.js @@ -1,27 +1,6 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. */ import { schema } from '@osd/config-schema'; diff --git a/server/routes/index.js b/server/routes/index.js index 152168eec..aca1baea4 100644 --- a/server/routes/index.js +++ b/server/routes/index.js @@ -1,27 +1,6 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. */ import alerts from './alerts'; diff --git a/server/routes/monitors.js b/server/routes/monitors.js index 37323d2b0..520c95c73 100644 --- a/server/routes/monitors.js +++ b/server/routes/monitors.js @@ -1,27 +1,6 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. */ import { schema } from '@osd/config-schema'; diff --git a/server/routes/opensearch.js b/server/routes/opensearch.js index e67c2b35d..1bb0ab70d 100644 --- a/server/routes/opensearch.js +++ b/server/routes/opensearch.js @@ -1,27 +1,6 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. */ import { schema } from '@osd/config-schema'; diff --git a/server/services/AlertService.js b/server/services/AlertService.js index ca59d1746..c52ae917a 100644 --- a/server/services/AlertService.js +++ b/server/services/AlertService.js @@ -1,27 +1,6 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. */ export default class AlertService { diff --git a/server/services/AnomalyDetectorService.js b/server/services/AnomalyDetectorService.js index 42748d1f9..628ef228b 100644 --- a/server/services/AnomalyDetectorService.js +++ b/server/services/AnomalyDetectorService.js @@ -1,27 +1,6 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. */ import { get } from 'lodash'; import { mapKeysDeep, toCamel } from './utils/helpers'; diff --git a/server/services/DestinationsService.js b/server/services/DestinationsService.js index 92bbfd98d..34e9c4d26 100644 --- a/server/services/DestinationsService.js +++ b/server/services/DestinationsService.js @@ -1,27 +1,6 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. */ import _ from 'lodash'; diff --git a/server/services/MonitorService.js b/server/services/MonitorService.js index a83979d87..6c0646e12 100644 --- a/server/services/MonitorService.js +++ b/server/services/MonitorService.js @@ -1,27 +1,6 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. */ import _ from 'lodash'; diff --git a/server/services/OpensearchService.js b/server/services/OpensearchService.js index b838cc922..30b28c499 100644 --- a/server/services/OpensearchService.js +++ b/server/services/OpensearchService.js @@ -1,27 +1,6 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. */ export default class OpensearchService { diff --git a/server/services/index.js b/server/services/index.js index 69c6f8ef1..ce75d617f 100644 --- a/server/services/index.js +++ b/server/services/index.js @@ -1,27 +1,6 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. */ import AlertService from './AlertService'; diff --git a/server/services/utils/__tests__/adHelpers.test.js b/server/services/utils/__tests__/adHelpers.test.js index aa0ec6339..16a2dc613 100644 --- a/server/services/utils/__tests__/adHelpers.test.js +++ b/server/services/utils/__tests__/adHelpers.test.js @@ -1,27 +1,6 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. */ import { anomalyResultMapper } from '../adHelpers'; diff --git a/server/services/utils/__tests__/helpers.test.js b/server/services/utils/__tests__/helpers.test.js index 84f7e36ae..190ffb247 100644 --- a/server/services/utils/__tests__/helpers.test.js +++ b/server/services/utils/__tests__/helpers.test.js @@ -1,27 +1,6 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. */ import { mapKeysDeep, toSnake } from '../helpers'; diff --git a/server/services/utils/adHelpers.js b/server/services/utils/adHelpers.js index 8e883bdd7..96b047d80 100644 --- a/server/services/utils/adHelpers.js +++ b/server/services/utils/adHelpers.js @@ -1,27 +1,6 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. */ export const anomalyResultMapper = (anomalyResults) => { diff --git a/server/services/utils/constants.js b/server/services/utils/constants.js index 39631cc0e..d43b8fe8a 100644 --- a/server/services/utils/constants.js +++ b/server/services/utils/constants.js @@ -1,27 +1,6 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. */ export const API_ROUTE_PREFIX = '/_plugins/_alerting'; diff --git a/server/services/utils/helpers.js b/server/services/utils/helpers.js index fbf0f8630..ecc189e74 100644 --- a/server/services/utils/helpers.js +++ b/server/services/utils/helpers.js @@ -1,27 +1,6 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. */ import { get, map, mapKeys, mapValues, isPlainObject, snakeCase, camelCase } from 'lodash'; diff --git a/test/enzyme.js b/test/enzyme.js index 2f5518cbc..033f7d76c 100644 --- a/test/enzyme.js +++ b/test/enzyme.js @@ -1,27 +1,6 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. */ import { configure } from 'enzyme'; diff --git a/test/functional/config.js b/test/functional/config.js index 482e50cf6..fe3e3bbd8 100644 --- a/test/functional/config.js +++ b/test/functional/config.js @@ -1,27 +1,6 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. */ import { resolve } from 'path'; diff --git a/test/functional/pageObjects/alerting-common.js b/test/functional/pageObjects/alerting-common.js index 35f9b47fa..0c2302601 100644 --- a/test/functional/pageObjects/alerting-common.js +++ b/test/functional/pageObjects/alerting-common.js @@ -1,27 +1,6 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. */ export function AlertingPageProvider({ getService, getPageObjects }) { diff --git a/test/functional/pageObjects/index.js b/test/functional/pageObjects/index.js index 0da4e3a68..749a37aa8 100644 --- a/test/functional/pageObjects/index.js +++ b/test/functional/pageObjects/index.js @@ -1,27 +1,6 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. */ export { AlertingPageProvider } from './alerting-common'; diff --git a/test/functional/tests/alerting-app.js b/test/functional/tests/alerting-app.js index 59c6ec777..2c09a1ceb 100644 --- a/test/functional/tests/alerting-app.js +++ b/test/functional/tests/alerting-app.js @@ -1,27 +1,6 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. */ import expect from 'expect'; diff --git a/test/functional/tests/index.js b/test/functional/tests/index.js index 64e3e83ff..fbd37836c 100644 --- a/test/functional/tests/index.js +++ b/test/functional/tests/index.js @@ -1,27 +1,6 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. */ export default function ({ loadTestFile }) { diff --git a/test/jest.config.js b/test/jest.config.js index 72a308dca..5ce6e4ddf 100644 --- a/test/jest.config.js +++ b/test/jest.config.js @@ -1,27 +1,6 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. */ module.exports = { diff --git a/test/mocks/CoreMock.js b/test/mocks/CoreMock.js index ede80ab98..ae9df2698 100644 --- a/test/mocks/CoreMock.js +++ b/test/mocks/CoreMock.js @@ -1,27 +1,6 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. */ const coreMock = { diff --git a/test/mocks/historyMock.js b/test/mocks/historyMock.js index b959c244f..afe9faec0 100644 --- a/test/mocks/historyMock.js +++ b/test/mocks/historyMock.js @@ -1,27 +1,6 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. */ const historyMock = { diff --git a/test/mocks/httpClientMock.js b/test/mocks/httpClientMock.js index 66932a07e..cc37d94e4 100644 --- a/test/mocks/httpClientMock.js +++ b/test/mocks/httpClientMock.js @@ -1,27 +1,6 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. */ const httpClientMock = jest.fn(); diff --git a/test/mocks/index.js b/test/mocks/index.js index 42af28d38..055a22a63 100644 --- a/test/mocks/index.js +++ b/test/mocks/index.js @@ -1,27 +1,6 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. */ import historyMock from './historyMock'; diff --git a/test/mocks/styleMock.js b/test/mocks/styleMock.js index 7f32062c8..28de3c8b1 100644 --- a/test/mocks/styleMock.js +++ b/test/mocks/styleMock.js @@ -1,27 +1,6 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. */ module.exports = {}; diff --git a/test/polyfills.js b/test/polyfills.js index 51c5707ab..e84c7f3b7 100644 --- a/test/polyfills.js +++ b/test/polyfills.js @@ -1,27 +1,6 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. */ import { MutationObserver } from './polyfills/mutationObserver'; diff --git a/test/polyfills/mutationObserver.js b/test/polyfills/mutationObserver.js index 18b36c828..c7d9a9122 100644 --- a/test/polyfills/mutationObserver.js +++ b/test/polyfills/mutationObserver.js @@ -1,12 +1,6 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. */ /* eslint-disable */ diff --git a/test/setup.jest.js b/test/setup.jest.js index 6a2cceb83..e5fbbdf93 100644 --- a/test/setup.jest.js +++ b/test/setup.jest.js @@ -1,27 +1,6 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. */ import React from 'react'; diff --git a/test/setupTests.js b/test/setupTests.js index c6a17985b..aae14dd4c 100644 --- a/test/setupTests.js +++ b/test/setupTests.js @@ -1,27 +1,6 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. This file is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. See the License for the specific language governing - * permissions and limitations under the License. */ require('babel-polyfill'); diff --git a/test/utils/helpers.js b/test/utils/helpers.js index d413bf4b9..b869dfbcd 100644 --- a/test/utils/helpers.js +++ b/test/utils/helpers.js @@ -1,12 +1,6 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. */ import { TRIGGER_TYPE } from '../../public/pages/CreateTrigger/containers/CreateTrigger/utils/constants'; diff --git a/utils/constants.js b/utils/constants.js index 4c4332c9c..2ce35d7ca 100644 --- a/utils/constants.js +++ b/utils/constants.js @@ -1,12 +1,6 @@ /* + * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. */ // Keeping index prefix as 'opendistro' as migrating the system index is currently difficult to complete From ecd47f9f851439a90efa1c40bf7fab75868d1bfb Mon Sep 17 00:00:00 2001 From: AWSHurneyt <79280347+AWSHurneyt@users.noreply.github.com> Date: Thu, 17 Feb 2022 10:29:48 -0800 Subject: [PATCH 14/22] Refactored acknowledge alerts button on Alerts by trigger dashboard page to be a modal experience. (#167) * Refactored Acknowledge button on Alerts by trigger dashboard to display a modal. Signed-off-by: AWSHurneyt <79280347+AWSHurneyt@users.noreply.github.com> * Updated license headers. Signed-off-by: AWSHurneyt <79280347+AWSHurneyt@users.noreply.github.com> Signed-off-by: AWSHurneyt --- .../acknowledge_alerts_modal_spec.js | 192 ++++++++ .../AcknowledgeAlertsModal.js | 454 ++++++++++++++++++ .../AcknowledgeAlertsModal.test.js | 41 ++ .../AcknowledgeAlertsModal.test.js.snap | 106 ++++ .../AcknowledgeAlertsModal/index.js | 8 + .../DashboardEmptyPrompt.js | 16 +- .../pages/Dashboard/containers/Dashboard.js | 101 ++-- .../__snapshots__/Dashboard.test.js.snap | 6 + 8 files changed, 856 insertions(+), 68 deletions(-) create mode 100644 cypress/integration/acknowledge_alerts_modal_spec.js create mode 100644 public/pages/Dashboard/components/AcknowledgeAlertsModal/AcknowledgeAlertsModal.js create mode 100644 public/pages/Dashboard/components/AcknowledgeAlertsModal/AcknowledgeAlertsModal.test.js create mode 100644 public/pages/Dashboard/components/AcknowledgeAlertsModal/__snapshots__/AcknowledgeAlertsModal.test.js.snap create mode 100644 public/pages/Dashboard/components/AcknowledgeAlertsModal/index.js diff --git a/cypress/integration/acknowledge_alerts_modal_spec.js b/cypress/integration/acknowledge_alerts_modal_spec.js new file mode 100644 index 000000000..daf439b05 --- /dev/null +++ b/cypress/integration/acknowledge_alerts_modal_spec.js @@ -0,0 +1,192 @@ +/* + * Copyright OpenSearch Contributors + * SPDX-License-Identifier: Apache-2.0 + */ + +import React from 'react'; +import { INDEX, PLUGIN_NAME } from '../support/constants'; +import sampleAlertsFlyoutBucketMonitor from '../fixtures/sample_alerts_flyout_bucket_level_monitor.json'; +import sampleAlertsFlyoutQueryMonitor from '../fixtures/sample_alerts_flyout_query_level_monitor.json'; + +const BUCKET_MONITOR = 'sample_alerts_flyout_bucket_level_monitor'; +const BUCKET_TRIGGER = 'sample_alerts_flyout_bucket_level_trigger'; +const QUERY_MONITOR = 'sample_alerts_flyout_query_level_monitor'; +const QUERY_TRIGGER = 'sample_alerts_flyout_query_level_trigger'; + +const TWENTY_SECONDS = 20000; + +describe('AcknowledgeAlertsModal', () => { + before(() => { + // Delete any existing monitors + cy.deleteAllMonitors(); + + // Load sample data + cy.loadSampleEcommerceData(); + + // Create the test monitors + cy.createMonitor(sampleAlertsFlyoutBucketMonitor); + cy.createMonitor(sampleAlertsFlyoutQueryMonitor); + + // Visit Alerting OpenSearch Dashboards + cy.visit(`${Cypress.env('opensearch_dashboards')}/app/${PLUGIN_NAME}#/monitors`); + + // Confirm test monitors were created successfully + cy.contains(BUCKET_MONITOR, { timeout: TWENTY_SECONDS }); + cy.contains(QUERY_MONITOR, { timeout: TWENTY_SECONDS }); + + // Wait 1 minute for the test monitors to trigger alerts, then go to the 'Alerts by trigger' dashboard page to view alerts + cy.wait(60000); + }); + + beforeEach(() => { + // Reloading the page to close any modals that were not closed by other tests that had failures. + cy.visit(`${Cypress.env('opensearch_dashboards')}/app/${PLUGIN_NAME}#/dashboard`); + + // Confirm dashboard is displaying rows for the test monitors. + cy.contains(BUCKET_MONITOR, { timeout: TWENTY_SECONDS }); + cy.contains(QUERY_MONITOR, { timeout: TWENTY_SECONDS }); + }); + + it('Acknowledge button disabled when more than 1 trigger selected', () => { + // Set the 'severity' filter to only display rows with ACTIVE alerts. + cy.get('[data-test-subj="dashboardAlertStateFilter"]').select('Active'); + + // Confirm the 'Alerts by trigger' dashboard contains more than 1 row. + cy.get('tbody > tr', { timeout: TWENTY_SECONDS }).should(($tr) => + expect($tr).to.have.length.greaterThan(1) + ); + + // Select the first and last rows in the table. + cy.get('input[data-test-subj^="checkboxSelectRow-"]').first().click(); + cy.get('input[data-test-subj^="checkboxSelectRow-"]').last().click(); + + // Click the 'Alerts by trigger' dashboard 'Acknowledge' button. + cy.get('[data-test-subj="acknowledgeAlertsButton"]').should('be.disabled'); + }); + + it('Bucket-level monitor modal test', () => { + // To simplify testing, filter the dashboard to only display the desired trigger. + cy.get(`input[type="search"]`).focus().type(BUCKET_TRIGGER); + + // Confirm the dashboard is displaying only 1 row. + cy.get('tbody > tr', { timeout: TWENTY_SECONDS }).should(($tr) => + expect($tr).to.have.length(1) + ); + + // Find the row for the trigger, and check off the checkbox. + cy.get('input[data-test-subj^="checkboxSelectRow-"]').first().click(); + + // Click the 'Alerts by trigger' dashboard 'Acknowledge' button. + cy.get('[data-test-subj="acknowledgeAlertsButton"]').click(); + + // Perform the test checks within the modal component. + cy.get(`[data-test-subj="alertsDashboardModal_${BUCKET_TRIGGER}"]`).within(() => { + // Confirm modal header contains expected text. + cy.get(`[data-test-subj="alertsDashboardModal_header_${BUCKET_TRIGGER}"]`).contains( + `Select which alerts to acknowledge for ${BUCKET_TRIGGER}` + ); + + // Set the 'severity' filter to only display ACTIVE alerts. + cy.get('[data-test-subj="dashboardAlertStateFilter"]').select('Active'); + + // This monitor configuration consistently returns 46 alerts when testing locally. + // Confirm the modal dashboard contains more than 1 ACTIVE alert. + cy.get('tbody > tr', { timeout: TWENTY_SECONDS }).should(($tr) => + expect($tr).to.have.length.greaterThan(1) + ); + + // Select the first and last alerts in the table. + cy.get('input[data-test-subj^="checkboxSelectRow-"]', { timeout: TWENTY_SECONDS }) + .first() + .click(); + cy.get('input[data-test-subj^="checkboxSelectRow-"]', { timeout: TWENTY_SECONDS }) + .last() + .click(); + + // Press the modal 'Acknowledge button, and wait for the AcknowledgeAlerts API call to complete. + cy.get('[data-test-subj="alertsDashboardModal_acknowledgeAlertsButton"]').click(); + }); + + // Confirm acknowledge alerts toast displays expected text. + cy.contains('Successfully acknowledged 2 alerts.'); + + // Confirm alerts were acknowledged as expected. + cy.get(`[data-test-subj="alertsDashboardModal_${BUCKET_TRIGGER}"]`).within(() => { + // Set the 'severity' filter to only display ACKNOWLEDGED alerts. + cy.get('[data-test-subj="dashboardAlertStateFilter"]').select('Acknowledged'); + + // Confirm the table displays 2 acknowledged alerts. + cy.get('tbody > tr', { timeout: TWENTY_SECONDS }).should(($tr) => + expect($tr).to.have.length(2) + ); + }); + + // Confirm close button hides the modal. + cy.get(`[data-test-subj="alertsDashboardModal_closeButton_${BUCKET_TRIGGER}"]`).click(); + cy.contains(`[data-test-subj="alertsDashboardModal_${BUCKET_TRIGGER}"]`).should('not.exist'); + }); + + it('Query-level monitor modal test', () => { + // To simplify testing, filter the dashboard to only display the desired trigger. + cy.get(`input[type="search"]`).focus().type(QUERY_TRIGGER); + + // Confirm the dashboard is displaying only 1 row. + cy.get('tbody > tr', { timeout: TWENTY_SECONDS }).should(($tr) => + expect($tr).to.have.length(1) + ); + + // Find the row for the trigger, and check off the checkbox. + cy.get('input[data-test-subj^="checkboxSelectRow-"]').first().click(); + + // Click the 'Alerts by trigger' dashboard 'Acknowledge' button. + cy.get('[data-test-subj="acknowledgeAlertsButton"]').click(); + + // Perform the test checks within the modal component. + cy.get(`[data-test-subj="alertsDashboardModal_${QUERY_TRIGGER}"]`).within(() => { + // Confirm modal header contains expected text. + cy.get(`[data-test-subj="alertsDashboardModal_header_${QUERY_TRIGGER}"]`).contains( + `Select which alerts to acknowledge for ${QUERY_TRIGGER}` + ); + + // Set the 'severity' filter to only display ACTIVE alerts. + cy.get('[data-test-subj="dashboardAlertStateFilter"]').select('Active'); + + // Confirm the modal dashboard contains 1 alert. + cy.get('tbody > tr', { timeout: TWENTY_SECONDS }).should(($tr) => + expect($tr).to.have.length(1) + ); + + // Select the alert. + cy.get('input[data-test-subj^="checkboxSelectRow-"]').first().click(); + + // Press the modal 'Acknowledge' button, and wait for the AcknowledgeAlerts API call to complete. + cy.get('[data-test-subj="alertsDashboardModal_acknowledgeAlertsButton"]').click(); + }); + + // Confirm acknowledge alerts toast displays expected text. + cy.contains('Successfully acknowledged 1 alert.'); + + // Confirm alerts were acknowledged as expected. + cy.get(`[data-test-subj="alertsDashboardModal_${QUERY_TRIGGER}"]`).within(() => { + // Set the 'severity' filter to only display ACKNOWLEDGED alerts. + cy.get('[data-test-subj="dashboardAlertStateFilter"]').select('Acknowledged'); + + // Confirm the table displays 1 acknowledged alert. + cy.get('tbody > tr', { timeout: TWENTY_SECONDS }).should(($tr) => + expect($tr).to.have.length(1) + ); + }); + + // Confirm close button hides the modal. + cy.get(`[data-test-subj="alertsDashboardModal_closeButton_${QUERY_TRIGGER}"]`).click(); + cy.contains(`[data-test-subj="alertsDashboardModal_${QUERY_TRIGGER}"]`).should('not.exist'); + }); + + after(() => { + // Delete all monitors + cy.deleteAllMonitors(); + + // Delete sample data + cy.deleteIndexByName(`${INDEX.SAMPLE_DATA_ECOMMERCE}`); + }); +}); diff --git a/public/pages/Dashboard/components/AcknowledgeAlertsModal/AcknowledgeAlertsModal.js b/public/pages/Dashboard/components/AcknowledgeAlertsModal/AcknowledgeAlertsModal.js new file mode 100644 index 000000000..9ebb84b46 --- /dev/null +++ b/public/pages/Dashboard/components/AcknowledgeAlertsModal/AcknowledgeAlertsModal.js @@ -0,0 +1,454 @@ +/* + * Copyright OpenSearch Contributors + * SPDX-License-Identifier: Apache-2.0 + */ + +import React, { Component } from 'react'; +import _ from 'lodash'; +import queryString from 'query-string'; +import PropTypes from 'prop-types'; +import { + EuiBasicTable, + EuiButton, + EuiFlexGroup, + EuiFlexItem, + EuiHorizontalRule, + EuiIcon, + EuiModal, + EuiModalBody, + EuiModalFooter, + EuiModalHeader, + EuiModalHeaderTitle, + EuiOverlayMask, +} from '@elastic/eui'; +import { + ALERT_STATE, + MONITOR_ACTIONS, + MONITOR_GROUP_BY, + MONITOR_INPUT_DETECTOR_ID, + MONITOR_TYPE, + OPENSEARCH_DASHBOARDS_AD_PLUGIN, +} from '../../../../utils/constants'; +import { + displayAcknowledgedAlertsToast, + filterActiveAlerts, + getQueryObjectFromState, + getURLQueryParams, + insertGroupByColumn, + removeColumns, +} from '../../utils/helpers'; +import { backendErrorNotification } from '../../../../utils/helpers'; +import { MAX_ALERT_COUNT } from '../../utils/constants'; +import { DEFAULT_PAGE_SIZE_OPTIONS } from '../../../Monitors/containers/Monitors/utils/constants'; +import DashboardControls from '../DashboardControls'; +import ContentPanel from '../../../../components/ContentPanel'; +import { queryColumns } from '../../utils/tableUtils'; +import DashboardEmptyPrompt from '../DashboardEmptyPrompt'; + +export const DEFAULT_NUM_MODAL_ROWS = 10; + +export default class AcknowledgeAlertsModal extends Component { + constructor(props) { + super(props); + const { location, monitor_id } = this.props; + + const { + alertState, + from, + search, + severityLevel, + size, + sortDirection, + sortField, + } = getURLQueryParams(location); + + this.state = { + alerts: [], + alertState: alertState, + loading: true, + monitors: [], + monitorIds: [monitor_id], + page: Math.floor(from / size), + search: search, + selectedItems: [], + severityLevel: severityLevel, + size: DEFAULT_NUM_MODAL_ROWS, + sortDirection: sortDirection, + sortField: sortField, + totalAlerts: 0, + }; + } + + componentDidMount() { + const { + alertState, + page, + search, + severityLevel, + size, + sortDirection, + sortField, + monitorIds, + } = this.state; + this.getAlerts( + page * size, + size, + search, + sortField, + sortDirection, + severityLevel, + alertState, + monitorIds + ); + } + + componentDidUpdate(prevProps, prevState) { + const prevQuery = getQueryObjectFromState(prevState); + const currQuery = getQueryObjectFromState(this.state); + if (!_.isEqual(prevQuery, currQuery)) { + const { + page, + size, + search, + sortField, + sortDirection, + severityLevel, + alertState, + monitorIds, + } = this.state; + this.getAlerts( + page * size, + size, + search, + sortField, + sortDirection, + severityLevel, + alertState, + monitorIds + ); + } + } + + getAlerts = async () => { + this.setState({ ...this.state, loading: true }); + const { + from, + search, + sortField, + sortDirection, + severityLevel, + alertState, + monitorIds, + } = this.state; + + const { httpClient, history, notifications, triggerId } = this.props; + + const params = { + from, + size: MAX_ALERT_COUNT, + search, + sortField, + sortDirection, + severityLevel, + alertState, + monitorIds, + }; + + const queryParamsString = queryString.stringify(params); + history.replace({ ...this.props.location, search: queryParamsString }); + + httpClient.get('../api/alerting/alerts', { query: params }).then((resp) => { + if (resp.ok) { + const { alerts } = resp; + const filteredAlerts = _.filter(alerts, { trigger_id: triggerId }); + this.setState({ + ...this.state, + alerts: filteredAlerts, + totalAlerts: filteredAlerts.length, + }); + } else { + console.log('error getting alerts:', resp); + backendErrorNotification(notifications, 'get', 'alerts', resp.err); + } + }); + + this.setState({ ...this.state, loading: false }); + }; + + acknowledgeAlerts = async () => { + const { selectedItems } = this.state; + const { httpClient, notifications } = this.props; + + if (!selectedItems.length) return; + + const selectedAlerts = filterActiveAlerts(selectedItems); + + const monitorAlerts = selectedAlerts.reduce((monitorAlerts, alert) => { + const { id, monitor_id: monitorId } = alert; + if (monitorAlerts[monitorId]) monitorAlerts[monitorId].push(id); + else monitorAlerts[monitorId] = [id]; + return monitorAlerts; + }, {}); + + Object.entries(monitorAlerts).map(([monitorId, alerts]) => + httpClient + .post(`../api/alerting/monitors/${monitorId}/_acknowledge/alerts`, { + body: JSON.stringify({ alerts }), + }) + .then((resp) => { + if (!resp.ok) { + backendErrorNotification(notifications, 'acknowledge', 'alert', resp.resp); + } else { + const successfulCount = _.get(resp, 'resp.success', []).length; + displayAcknowledgedAlertsToast(notifications, successfulCount); + } + }) + .catch((error) => error) + ); + + const { + page, + size, + search, + sortField, + sortDirection, + severityLevel, + alertState, + monitorIds, + } = this.state; + await this.getAlerts( + page * size, + size, + search, + sortField, + sortDirection, + severityLevel, + alertState, + monitorIds + ); + this.setState({ ...this.state, selectedItems: [] }); + }; + + onSeverityLevelChange = (e) => { + this.setState({ page: 0, severityLevel: e.target.value }); + }; + + onAlertStateChange = (e) => { + this.setState({ page: 0, alertState: e.target.value }); + }; + + onPageClick = (page) => { + this.setState({ page }); + }; + + onSearchChange = (e) => { + this.setState({ page: 0, search: e.target.value }); + }; + + onSelectionChange = (selectedItems) => { + this.setState({ selectedItems }); + }; + + onTableChange = ({ page: tablePage = {}, sort = {} }) => { + const { index: page, size } = tablePage; + + const { field: sortField, direction: sortDirection } = sort; + this.setState({ + page, + size, + sortField, + sortDirection, + }); + + const { alerts } = this.props; + this.setState({ alerts }); + }; + + onCreateTrigger = () => { + const { history, monitorId, onClose } = this.props; + onClose(); + history.push(`/monitors/${monitorId}?action=${MONITOR_ACTIONS.UPDATE_MONITOR}`); + }; + + render() { + const { monitor, onClose, triggerName } = this.props; + const detectorId = _.get(monitor, MONITOR_INPUT_DETECTOR_ID); + const groupBy = _.get(monitor, MONITOR_GROUP_BY); + const monitorType = _.get(monitor, 'monitor_type', MONITOR_TYPE.QUERY_LEVEL); + + const actions = () => { + const { selectedItems } = this.state; + const actions = [ + + Acknowledge + , + ]; + if (!_.isEmpty(detectorId)) { + actions.unshift( + + View detector + + ); + } + return actions; + }; + + const getItemId = (item) => { + switch (monitorType) { + case MONITOR_TYPE.QUERY_LEVEL: + return `${item.id}-${item.version}`; + case MONITOR_TYPE.BUCKET_LEVEL: + return item.id; + } + }; + + const { + alerts = [], + alertState, + loading, + page, + search, + selectable, + selectedItems, + severityLevel, + size, + sortDirection, + sortField, + totalAlerts, + } = this.state; + + const columnType = () => { + let columns = []; + switch (monitorType) { + case MONITOR_TYPE.QUERY_LEVEL: + columns = queryColumns; + break; + case MONITOR_TYPE.BUCKET_LEVEL: + columns = insertGroupByColumn(groupBy); + break; + } + return removeColumns(['trigger_name'], columns); + }; + + const pagination = { + pageIndex: page, + pageSize: size, + totalItemCount: totalAlerts, + pageSizeOptions: DEFAULT_PAGE_SIZE_OPTIONS, + }; + + const selection = { + onSelectionChange: this.onSelectionChange, + selectable: (item) => item.state === ALERT_STATE.ACTIVE, + selectableMessage: (selectable) => + selectable ? undefined : 'Only active alerts can be acknowledged.', + }; + + const sorting = { + sort: { + direction: sortDirection, + field: sortField, + }, + }; + + const trimmedAlerts = alerts.slice(page * size, page * size + size); + + return ( + + + + + {`Select which alerts to acknowledge for ${triggerName}`} + + + + + + + + + + + + ) + } + data-test-subj={`alertsDashboardModal_table_${triggerName}`} + /> + + + + + + + Close + + + + + ); + } +} + +AcknowledgeAlertsModal.propTypes = { + httpClient: PropTypes.object.isRequired, + history: PropTypes.object.isRequired, + location: PropTypes.object.isRequired, + monitor: PropTypes.object.isRequired, + monitorId: PropTypes.string.isRequired, + notifications: PropTypes.object.isRequired, + triggerId: PropTypes.string.isRequired, + triggerName: PropTypes.string.isRequired, + onClose: PropTypes.func.isRequired, +}; diff --git a/public/pages/Dashboard/components/AcknowledgeAlertsModal/AcknowledgeAlertsModal.test.js b/public/pages/Dashboard/components/AcknowledgeAlertsModal/AcknowledgeAlertsModal.test.js new file mode 100644 index 000000000..8c7678b73 --- /dev/null +++ b/public/pages/Dashboard/components/AcknowledgeAlertsModal/AcknowledgeAlertsModal.test.js @@ -0,0 +1,41 @@ +/* + * Copyright OpenSearch Contributors + * SPDX-License-Identifier: Apache-2.0 + */ + +import React from 'react'; +import _ from 'lodash'; +import { historyMock, httpClientMock } from '../../../../../test/mocks'; +import AcknowledgeAlertsModal from './AcknowledgeAlertsModal'; +import { FORMIK_INITIAL_VALUES } from '../../../CreateMonitor/containers/CreateMonitor/utils/constants'; +import coreMock from '../../../../../test/mocks/CoreMock'; + +beforeEach(() => { + jest.clearAllMocks(); +}); + +describe('AcknowledgeAlertsModal', () => { + test('renders', () => { + const location = { + hash: '', + pathname: '/dashboard', + search: '', + state: undefined, + }; + const notifications = _.cloneDeep(coreMock.notifications); + const component = ( + {}} + /> + ); + expect(component).toMatchSnapshot(); + }); +}); diff --git a/public/pages/Dashboard/components/AcknowledgeAlertsModal/__snapshots__/AcknowledgeAlertsModal.test.js.snap b/public/pages/Dashboard/components/AcknowledgeAlertsModal/__snapshots__/AcknowledgeAlertsModal.test.js.snap new file mode 100644 index 000000000..1f8fd9c33 --- /dev/null +++ b/public/pages/Dashboard/components/AcknowledgeAlertsModal/__snapshots__/AcknowledgeAlertsModal.test.js.snap @@ -0,0 +1,106 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AcknowledgeAlertsModal renders 1`] = ` + +`; diff --git a/public/pages/Dashboard/components/AcknowledgeAlertsModal/index.js b/public/pages/Dashboard/components/AcknowledgeAlertsModal/index.js new file mode 100644 index 000000000..559466507 --- /dev/null +++ b/public/pages/Dashboard/components/AcknowledgeAlertsModal/index.js @@ -0,0 +1,8 @@ +/* + * Copyright OpenSearch Contributors + * SPDX-License-Identifier: Apache-2.0 + */ + +import AcknowledgeAlertsModal from './AcknowledgeAlertsModal'; + +export default AcknowledgeAlertsModal; diff --git a/public/pages/Dashboard/components/DashboardEmptyPrompt/DashboardEmptyPrompt.js b/public/pages/Dashboard/components/DashboardEmptyPrompt/DashboardEmptyPrompt.js index ee52c205c..c1ca17d80 100644 --- a/public/pages/Dashboard/components/DashboardEmptyPrompt/DashboardEmptyPrompt.js +++ b/public/pages/Dashboard/components/DashboardEmptyPrompt/DashboardEmptyPrompt.js @@ -14,6 +14,9 @@ const createMonitorText = 'There are no existing alerts. Create a monitor to add triggers and actions. Once an alarm is triggered, the state will show in this table.'; const createTriggerText = 'There are no existing alerts. Create a trigger to start alerting. Once an alarm is triggered, the state will show in this table.'; +const editTriggerConditionsText = + 'There are no existing alerts. Adjust trigger conditions to start alerting. Once an alarm is triggered, the state will show in this table.'; + const createMonitorButton = ( Create monitor @@ -25,17 +28,24 @@ const editMonitorButton = (onCreateTrigger) => ( ); -const DashboardEmptyPrompt = ({ onCreateTrigger }) => { +const DashboardEmptyPrompt = ({ onCreateTrigger, isModal = false }) => { const inMonitorDetails = typeof onCreateTrigger === 'function'; + const displayText = isModal + ? editTriggerConditionsText + : inMonitorDetails + ? createTriggerText + : createMonitorText; return ( -

      {inMonitorDetails ? createTriggerText : createMonitorText}

      +

      {displayText}

      } - actions={inMonitorDetails ? editMonitorButton(onCreateTrigger) : createMonitorButton} + actions={ + inMonitorDetails || isModal ? editMonitorButton(onCreateTrigger) : createMonitorButton + } /> ); }; diff --git a/public/pages/Dashboard/containers/Dashboard.js b/public/pages/Dashboard/containers/Dashboard.js index 5e3908bd1..a170b465e 100644 --- a/public/pages/Dashboard/containers/Dashboard.js +++ b/public/pages/Dashboard/containers/Dashboard.js @@ -18,8 +18,6 @@ import { } from '../../../utils/constants'; import { backendErrorNotification } from '../../../utils/helpers'; import { - displayAcknowledgedAlertsToast, - filterActiveAlerts, getInitialSize, getQueryObjectFromState, getURLQueryParams, @@ -28,8 +26,7 @@ import { } from '../utils/helpers'; import { DEFAULT_PAGE_SIZE_OPTIONS } from '../../Monitors/containers/Monitors/utils/constants'; import { MAX_ALERT_COUNT } from '../utils/constants'; - -// TODO: Abstract out a Table component to be used in both Dashboard and Monitors +import AcknowledgeAlertsModal from '../components/AcknowledgeAlertsModal'; export default class Dashboard extends Component { constructor(props) { @@ -59,6 +56,7 @@ export default class Dashboard extends Component { search, selectedItems: [], severityLevel, + showAlertsModal: false, size: getInitialSize(perAlertView, size), sortDirection, sortField, @@ -141,10 +139,7 @@ export default class Dashboard extends Component { httpClient.get('../api/alerting/alerts', { query: params }).then((resp) => { if (resp.ok) { const { alerts, totalAlerts } = resp; - this.setState({ - alerts, - totalAlerts, - }); + this.setState({ alerts, totalAlerts }); if (!perAlertView) { const alertsByTriggers = groupAlertsByTrigger(alerts); @@ -194,62 +189,6 @@ export default class Dashboard extends Component { this.setState({ ...this.state, loadingMonitors: false, monitors: monitors }); } - // TODO: exists in both Dashboard and Monitors, should be moved to redux when implemented - acknowledgeAlert = async () => { - const { selectedItems } = this.state; - const { httpClient, notifications, perAlertView } = this.props; - - if (!selectedItems.length) return; - - let selectedAlerts = perAlertView ? selectedItems : _.get(selectedItems, '0.alerts', []); - selectedAlerts = filterActiveAlerts(selectedAlerts); - - const monitorAlerts = selectedAlerts.reduce((monitorAlerts, alert) => { - const { id, monitor_id: monitorId } = alert; - if (monitorAlerts[monitorId]) monitorAlerts[monitorId].push(id); - else monitorAlerts[monitorId] = [id]; - return monitorAlerts; - }, {}); - - Object.entries(monitorAlerts).map(([monitorId, alerts]) => - httpClient - .post(`../api/alerting/monitors/${monitorId}/_acknowledge/alerts`, { - body: JSON.stringify({ alerts }), - }) - .then((resp) => { - if (!resp.ok) { - backendErrorNotification(notifications, 'acknowledge', 'alert', resp.resp); - } else { - const successfulCount = _.get(resp, 'resp.success', []).length; - displayAcknowledgedAlertsToast(notifications, successfulCount); - } - }) - .catch((error) => error) - ); - - const { - page, - size, - search, - sortField, - sortDirection, - severityLevel, - alertState, - monitorIds, - } = this.state; - this.getAlerts( - page * size, - size, - search, - sortField, - sortDirection, - severityLevel, - alertState, - monitorIds - ); - this.setState({ selectedItems: [] }); - }; - onTableChange = ({ page: tablePage = {}, sort = {} }) => { const { index: page, size } = tablePage; const { field: sortField, direction: sortDirection } = sort; @@ -312,6 +251,35 @@ export default class Dashboard extends Component { ); }; + openModal = () => { + this.setState({ ...this.state, showAlertsModal: true }); + }; + + closeModal = () => { + this.setState({ ...this.state, search: '', showAlertsModal: false }); + this.refreshDashboard(); + }; + + renderModal = () => { + const { history, httpClient, location, notifications } = this.props; + const { monitors, selectedItems } = this.state; + const { monitor_id, triggerID, trigger_name } = selectedItems[0]; + const monitor = _.get(_.find(monitors, { _id: monitor_id }), '_source'); + return ( + + ); + }; + render() { const { alerts, @@ -392,7 +360,7 @@ export default class Dashboard extends Component { // The acknowledge button is disabled when viewing by per alerts, and no item selected or per trigger view and item selected is not 1. const actions = [ @@ -480,7 +448,10 @@ export default class Dashboard extends Component { selection={selection} onChange={this.onTableChange} noItemsMessage={} + data-test-subj={'alertsDashboard_table'} /> + + {this.state.showAlertsModal && this.renderModal()} ); } diff --git a/public/pages/Dashboard/containers/__snapshots__/Dashboard.test.js.snap b/public/pages/Dashboard/containers/__snapshots__/Dashboard.test.js.snap index 0476105c2..c35a36524 100644 --- a/public/pages/Dashboard/containers/__snapshots__/Dashboard.test.js.snap +++ b/public/pages/Dashboard/containers/__snapshots__/Dashboard.test.js.snap @@ -760,6 +760,7 @@ exports[`Dashboard renders in flyout 1`] = ` }, ] } + data-test-subj="alertsDashboard_table" isSelectable={true} itemId={[Function]} items={Array []} @@ -798,6 +799,7 @@ exports[`Dashboard renders in flyout 1`] = ` >
      @@ -2497,6 +2499,7 @@ exports[`Dashboard renders with alert by triggers view 1`] = ` }, ] } + data-test-subj="alertsDashboard_table" isSelectable={true} itemId={[Function]} items={Array []} @@ -2522,6 +2525,7 @@ exports[`Dashboard renders with alert by triggers view 1`] = ` >
      @@ -4404,6 +4408,7 @@ exports[`Dashboard renders with per alert view 1`] = ` }, ] } + data-test-subj="alertsDashboard_table" isSelectable={true} itemId={[Function]} items={Array []} @@ -4442,6 +4447,7 @@ exports[`Dashboard renders with per alert view 1`] = ` >
      From 6588090a7ac80b9035464a7731f0cc6b11a1eb7a Mon Sep 17 00:00:00 2001 From: Annie Lee <71157062+leeyun-amzn@users.noreply.github.com> Date: Mon, 28 Feb 2022 15:34:23 -0800 Subject: [PATCH 15/22] Adding a few more basic unit tests (#180) * Add alerting dashboards flyout render unit test Signed-off-by: Annie Lee * Add MonitorTimeFields validation tests Signed-off-by: Annie Lee * Refactor error messages to add period Signed-off-by: Annie Lee Signed-off-by: AWSHurneyt --- .../AlertsDashboardFlyoutComponent.test.js | 21 ++ ...lertsDashboardFlyoutComponent.test.js.snap | 268 ++++++++++++++++++ .../MonitorTimeField/utils/validation.js | 5 +- .../MonitorTimeField/utils/validation.test.js | 24 ++ 4 files changed, 316 insertions(+), 2 deletions(-) create mode 100644 public/components/Flyout/flyouts/components/AlertsDashboardFlyoutComponent.test.js create mode 100644 public/components/Flyout/flyouts/components/__snapshots__/AlertsDashboardFlyoutComponent.test.js.snap create mode 100644 public/pages/CreateMonitor/components/MonitorTimeField/utils/validation.test.js diff --git a/public/components/Flyout/flyouts/components/AlertsDashboardFlyoutComponent.test.js b/public/components/Flyout/flyouts/components/AlertsDashboardFlyoutComponent.test.js new file mode 100644 index 000000000..a9332e5b2 --- /dev/null +++ b/public/components/Flyout/flyouts/components/AlertsDashboardFlyoutComponent.test.js @@ -0,0 +1,21 @@ +/* + * Copyright OpenSearch Contributors + * SPDX-License-Identifier: Apache-2.0 + */ + +import React from 'react'; +import { shallow } from 'enzyme'; +import AlertsDashboardFlyoutComponent from './AlertsDashboardFlyoutComponent'; + +describe('AlertsDashboardFlyoutComponent', () => { + test('renders', () => { + const wrapper = shallow( + + ); + expect(wrapper).toMatchSnapshot(); + }); +}); diff --git a/public/components/Flyout/flyouts/components/__snapshots__/AlertsDashboardFlyoutComponent.test.js.snap b/public/components/Flyout/flyouts/components/__snapshots__/AlertsDashboardFlyoutComponent.test.js.snap new file mode 100644 index 000000000..9e8cd1f3d --- /dev/null +++ b/public/components/Flyout/flyouts/components/__snapshots__/AlertsDashboardFlyoutComponent.test.js.snap @@ -0,0 +1,268 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AlertsDashboardFlyoutComponent renders 1`] = ` +
      + + + + + Trigger name + +

      + + + + + + Severity + +

      + - +

      +
      +
      +
      + + + + + + Trigger start time + +

      + - +

      +
      +
      + + + + Trigger last updated + +

      + - +

      +
      +
      +
      + + + + + + Monitor + +

      + +

      +
      +
      +
      + + + + + + Condition + +

      + Loading conditions... +

      +
      +
      + + + + Time range for the last + +

      + - +

      +
      +
      +
      + + + + + + Filters + +

      + Loading filters... +

      +
      +
      + + + + Group by + +

      + Loading groups... +

      +
      +
      +
      + + + + + Acknowledge + , + ] + } + bodyStyles={ + Object { + "padding": "initial", + } + } + title="Alerts" + titleSize="s" + > + + + + + + + +
      +`; diff --git a/public/pages/CreateMonitor/components/MonitorTimeField/utils/validation.js b/public/pages/CreateMonitor/components/MonitorTimeField/utils/validation.js index 251216a7d..b15658f6c 100644 --- a/public/pages/CreateMonitor/components/MonitorTimeField/utils/validation.js +++ b/public/pages/CreateMonitor/components/MonitorTimeField/utils/validation.js @@ -3,8 +3,9 @@ * SPDX-License-Identifier: Apache-2.0 */ +// dateFields is a string array of available time field names export const validateTimeField = (dateFields) => (value) => { - if (!value) return 'Select a time field'; + if (!value) return 'Select a time field.'; if (!dateFields.filter((opt) => opt === value).length) - return `The field "${value}" does not exist in the selected index mappings, please choose a new time field`; + return `The field "${value}" does not exist in the selected index mappings, please choose a new time field.`; }; diff --git a/public/pages/CreateMonitor/components/MonitorTimeField/utils/validation.test.js b/public/pages/CreateMonitor/components/MonitorTimeField/utils/validation.test.js new file mode 100644 index 000000000..b98abe7e5 --- /dev/null +++ b/public/pages/CreateMonitor/components/MonitorTimeField/utils/validation.test.js @@ -0,0 +1,24 @@ +/* + * Copyright OpenSearch Contributors + * SPDX-License-Identifier: Apache-2.0 + */ + +import React from 'react'; + +import { validateTimeField } from './validation'; + +describe('validation', () => { + test('prompts user to select time field when no value is selected', () => { + const dateFields = ['customer_birth_date', 'order_date', 'products.created_on']; + const value = undefined; + expect(validateTimeField(dateFields)(value)).toBe('Select a time field.'); + }); + + test('shows error message if the option is not in dateFields', () => { + const dateFields = ['customer_birth_date', 'order_date', 'products.created_on']; + const value = 'invalidValue'; + expect(validateTimeField(dateFields)(value)).toBe( + `The field "${value}" does not exist in the selected index mappings, please choose a new time field.` + ); + }); +}); From 15fc4ccb3e656b437e18555f115d93f8ef490206 Mon Sep 17 00:00:00 2001 From: Annie Lee <71157062+leeyun-amzn@users.noreply.github.com> Date: Tue, 1 Mar 2022 15:18:20 -0800 Subject: [PATCH 16/22] Remove node version declaration in package.json (#166) * Remove node version declaration in package.json Signed-off-by: Annie Lee * Remove react-router-dom version declaration Signed-off-by: Annie Lee Signed-off-by: AWSHurneyt --- package.json | 2 -- yarn.lock | 98 +++------------------------------------------------- 2 files changed, 5 insertions(+), 95 deletions(-) diff --git a/package.json b/package.json index 4c26edb66..f31323e0d 100644 --- a/package.json +++ b/package.json @@ -38,7 +38,6 @@ "formik": "^2.2.6", "lodash": "^4.17.21", "query-string": "^6.13.2", - "react-router-dom": "^5.2.0", "react-vis": "^1.8.1" }, "resolutions": { @@ -46,7 +45,6 @@ "glob-parent": "^5.1.2" }, "engines": { - "node": "10.24.1", "yarn": "^1.21.1" } } diff --git a/yarn.lock b/yarn.lock index 2fa22000c..741d970e6 100644 --- a/yarn.lock +++ b/yarn.lock @@ -23,13 +23,6 @@ chalk "^2.0.0" js-tokens "^4.0.0" -"@babel/runtime@^7.1.2", "@babel/runtime@^7.12.1": - version "7.14.6" - resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.14.6.tgz#535203bc0892efc7dec60bdc27b2ecf6e409062d" - integrity sha512-/PCB2uJ7oM44tz8YhC4Z/6PeOKXp4K588f+5M3clr1M4zbqztlo0XEfJ2LEzj/FgwfgGcIdl8n7YYjTCI0BYwg== - dependencies: - regenerator-runtime "^0.13.4" - "@cypress/listr-verbose-renderer@^0.4.1": version "0.4.1" resolved "https://registry.yarnpkg.com/@cypress/listr-verbose-renderer/-/listr-verbose-renderer-0.4.1.tgz#a77492f4b11dcc7c446a34b3e28721afd33c642a" @@ -2163,18 +2156,6 @@ hash.js@^1.0.0, hash.js@^1.0.3: inherits "^2.0.3" minimalistic-assert "^1.0.1" -history@^4.9.0: - version "4.10.1" - resolved "https://registry.yarnpkg.com/history/-/history-4.10.1.tgz#33371a65e3a83b267434e2b3f3b1b4c58aad4cf3" - integrity sha512-36nwAD620w12kuzPAsyINPWJqlNbij+hpK1k9XRloDtym8mxzGYl2c17LnV6IAGB2Dmg4tEa7G7DlawS0+qjew== - dependencies: - "@babel/runtime" "^7.1.2" - loose-envify "^1.2.0" - resolve-pathname "^3.0.0" - tiny-invariant "^1.0.2" - tiny-warning "^1.0.0" - value-equal "^1.0.1" - hmac-drbg@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/hmac-drbg/-/hmac-drbg-1.0.1.tgz#d2745701025a6c775a6c545793ed502fc0c649a1" @@ -2189,7 +2170,7 @@ hoek@4.2.1: resolved "https://registry.yarnpkg.com/hoek/-/hoek-4.2.1.tgz#9634502aa12c445dd5a7c5734b572bb8738aacbb" integrity sha512-QLg82fGkfnJ/4iy1xZ81/9SIJiq1NGFUMGs6ParyjBZr6jW2Ufj/snDqTHixNlHdPNwN2RLVD0Pi3igeK9+JfA== -hoist-non-react-statics@^3.1.0, hoist-non-react-statics@^3.3.0: +hoist-non-react-statics@^3.3.0: version "3.3.2" resolved "https://registry.yarnpkg.com/hoist-non-react-statics/-/hoist-non-react-statics-3.3.2.tgz#ece0acaf71d62c2969c2ec59feff42a4b1a85b45" integrity sha512-/gGivxi8JPKWNm/W0jSmzcMPpfpPLc3dY/6GxhX2hQ9iGj3aDfklV4ET7NjKpSinLpJ5vafa9iiGIEZg10SfBw== @@ -2552,11 +2533,6 @@ is-wsl@^1.1.0: resolved "https://registry.yarnpkg.com/is-wsl/-/is-wsl-1.1.0.tgz#1f16e4aa22b04d1336b66188a66af3c600c3a66d" integrity sha1-HxbkqiKwTRM2tmGIpmrzxgDDpm0= -isarray@0.0.1: - version "0.0.1" - resolved "https://registry.yarnpkg.com/isarray/-/isarray-0.0.1.tgz#8a18acfca9a8f4177e09abfc6038939b05d1eedf" - integrity sha1-ihis/Kmo9Bd+Cav8YDiTmwXR7t8= - isarray@1.0.0, isarray@^1.0.0, isarray@~1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/isarray/-/isarray-1.0.0.tgz#bb935d48582cba168c06834957a54a3e07124f11" @@ -2826,7 +2802,7 @@ log-update@^2.3.0: cli-cursor "^2.0.0" wrap-ansi "^3.0.1" -loose-envify@^1.2.0, loose-envify@^1.3.1, loose-envify@^1.4.0: +loose-envify@^1.4.0: version "1.4.0" resolved "https://registry.yarnpkg.com/loose-envify/-/loose-envify-1.4.0.tgz#71ee51fa7be4caec1a63839f7e682d8132d30caf" integrity sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q== @@ -2972,14 +2948,6 @@ min-document@^2.19.0: dependencies: dom-walk "^0.1.0" -mini-create-react-context@^0.4.0: - version "0.4.1" - resolved "https://registry.yarnpkg.com/mini-create-react-context/-/mini-create-react-context-0.4.1.tgz#072171561bfdc922da08a60c2197a497cc2d1d5e" - integrity sha512-YWCYEmd5CQeHGSAKrYvXgmzzkrvssZcuuQDDeqkT+PziKGMgE+0MCCtcKbROzocGBG1meBLl2FotlRwf4gAzbQ== - dependencies: - "@babel/runtime" "^7.12.1" - tiny-warning "^1.0.3" - minimalistic-assert@^1.0.0, minimalistic-assert@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/minimalistic-assert/-/minimalistic-assert-1.0.1.tgz#2e194de044626d4a10e7f7fbc00ce73e83e4d5c7" @@ -3392,13 +3360,6 @@ path-parse@^1.0.6: resolved "https://registry.yarnpkg.com/path-parse/-/path-parse-1.0.7.tgz#fbc114b60ca42b30d9daf5858e4bd68bbedb6735" integrity sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw== -path-to-regexp@^1.7.0: - version "1.8.0" - resolved "https://registry.yarnpkg.com/path-to-regexp/-/path-to-regexp-1.8.0.tgz#887b3ba9d84393e87a0a0b9f4cb756198b53548a" - integrity sha512-n43JRhlUKUAlibEJhPeir1ncUID16QnEjNpwzNdO3Lm4ywrBpBZ5oLD0I6br9evr1Y9JTqwRtAh7JLoOzAQdVA== - dependencies: - isarray "0.0.1" - path-type@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/path-type/-/path-type-4.0.0.tgz#84ed01c0a7ba380afe09d90a8c180dcd9d03043b" @@ -3491,7 +3452,7 @@ promise-inflight@^1.0.1: resolved "https://registry.yarnpkg.com/promise-inflight/-/promise-inflight-1.0.1.tgz#98472870bf228132fcbdd868129bad12c3c029e3" integrity sha1-mEcocL8igTL8vdhoEputEsPAKeM= -prop-types@^15.5.8, prop-types@^15.6.2: +prop-types@^15.5.8: version "15.7.2" resolved "https://registry.yarnpkg.com/prop-types/-/prop-types-15.7.2.tgz#52c41e75b8c87e72b9d9360e0206b99dcbffa6c5" integrity sha512-8QQikdH7//R2vurIJSutZ1smHYTcLpRWEOlHnzcWHmBYrOGUysKwSsrC89BCiFj3CbrfJ/nXFdJepOVrY1GCHQ== @@ -3629,7 +3590,7 @@ react-fast-compare@^2.0.1: resolved "https://registry.yarnpkg.com/react-fast-compare/-/react-fast-compare-2.0.4.tgz#e84b4d455b0fec113e0402c329352715196f81f9" integrity sha512-suNP+J1VU1MWFKcyt7RtjiSWUjvidmQSlqu+eHslq+342xCbGTYmC0mEhPCOHxlW0CywylOC1u2DFAT+bv4dBw== -react-is@^16.6.0, react-is@^16.7.0, react-is@^16.8.1: +react-is@^16.7.0, react-is@^16.8.1: version "16.13.1" resolved "https://registry.yarnpkg.com/react-is/-/react-is-16.13.1.tgz#789729a4dc36de2999dc156dd6c1d9c18cea56a4" integrity sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ== @@ -3643,35 +3604,6 @@ react-motion@^0.5.2: prop-types "^15.5.8" raf "^3.1.0" -react-router-dom@^5.2.0: - version "5.2.0" - resolved "https://registry.yarnpkg.com/react-router-dom/-/react-router-dom-5.2.0.tgz#9e65a4d0c45e13289e66c7b17c7e175d0ea15662" - integrity sha512-gxAmfylo2QUjcwxI63RhQ5G85Qqt4voZpUXSEqCwykV0baaOTQDR1f0PmY8AELqIyVc0NEZUj0Gov5lNGcXgsA== - dependencies: - "@babel/runtime" "^7.1.2" - history "^4.9.0" - loose-envify "^1.3.1" - prop-types "^15.6.2" - react-router "5.2.0" - tiny-invariant "^1.0.2" - tiny-warning "^1.0.0" - -react-router@5.2.0: - version "5.2.0" - resolved "https://registry.yarnpkg.com/react-router/-/react-router-5.2.0.tgz#424e75641ca8747fbf76e5ecca69781aa37ea293" - integrity sha512-smz1DUuFHRKdcJC0jobGo8cVbhO3x50tCL4icacOlcwDOEQPq4TMqwx3sY1TP+DvtTgz4nm3thuo7A+BK2U0Dw== - dependencies: - "@babel/runtime" "^7.1.2" - history "^4.9.0" - hoist-non-react-statics "^3.1.0" - loose-envify "^1.3.1" - mini-create-react-context "^0.4.0" - path-to-regexp "^1.7.0" - prop-types "^15.6.2" - react-is "^16.6.0" - tiny-invariant "^1.0.2" - tiny-warning "^1.0.0" - react-vis@^1.8.1: version "1.11.7" resolved "https://registry.yarnpkg.com/react-vis/-/react-vis-1.11.7.tgz#909902af00158895d14da1adfe1d0dc0045228ff" @@ -3744,11 +3676,6 @@ readdirp@~3.6.0: dependencies: picomatch "^2.2.1" -regenerator-runtime@^0.13.4: - version "0.13.7" - resolved "https://registry.yarnpkg.com/regenerator-runtime/-/regenerator-runtime-0.13.7.tgz#cac2dacc8a1ea675feaabaeb8ae833898ae46f55" - integrity sha512-a54FxoJDIr27pgf7IgeQGxmqUNYrcV338lf/6gH456HZ/PhX+5BcwHXG9ajESmwe6WRO0tAzRUrRmNONWgkrew== - regex-not@^1.0.0, regex-not@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/regex-not/-/regex-not-1.0.2.tgz#1f4ece27e00b0b65e0247a6810e6a85d83a5752c" @@ -3802,11 +3729,6 @@ resolve-from@^3.0.0: resolved "https://registry.yarnpkg.com/resolve-from/-/resolve-from-3.0.0.tgz#b22c7af7d9d6881bc8b6e653335eebcb0a188748" integrity sha1-six699nWiBvItuZTM17rywoYh0g= -resolve-pathname@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/resolve-pathname/-/resolve-pathname-3.0.0.tgz#99d02224d3cf263689becbb393bc560313025dcd" - integrity sha512-C7rARubxI8bXFNB/hqcp/4iUeIXJhJZvFPFPiSPRnhU5UPxzMFIl+2E6yY6c4k9giDJAhtV+enfA+G89N6Csng== - resolve-url@^0.2.1: version "0.2.1" resolved "https://registry.yarnpkg.com/resolve-url/-/resolve-url-0.2.1.tgz#2c637fe77c893afd2a663fe21aa9080068e2052a" @@ -4351,12 +4273,7 @@ timers-browserify@^2.0.4: dependencies: setimmediate "^1.0.4" -tiny-invariant@^1.0.2: - version "1.1.0" - resolved "https://registry.yarnpkg.com/tiny-invariant/-/tiny-invariant-1.1.0.tgz#634c5f8efdc27714b7f386c35e6760991d230875" - integrity sha512-ytxQvrb1cPc9WBEI/HSeYYoGD0kWnGEOR8RY6KomWLBVhqz0RgTwVO9dLrGz7dC+nN9llyI7OKAgRq8Vq4ZBSw== - -tiny-warning@^1.0.0, tiny-warning@^1.0.2, tiny-warning@^1.0.3: +tiny-warning@^1.0.2: version "1.0.3" resolved "https://registry.yarnpkg.com/tiny-warning/-/tiny-warning-1.0.3.tgz#94a30db453df4c643d0fd566060d60a875d84754" integrity sha512-lBN9zLN/oAf68o3zNXYrdCt1kP8WsiGW8Oo2ka41b2IM5JL/S1CTyX1rW0mb/zSuJun0ZUrDxx4sqvYS2FWzPA== @@ -4549,11 +4466,6 @@ validate-npm-package-license@^3.0.1: spdx-correct "^3.0.0" spdx-expression-parse "^3.0.0" -value-equal@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/value-equal/-/value-equal-1.0.1.tgz#1e0b794c734c5c0cade179c437d356d931a34d6c" - integrity sha512-NOJ6JZCAWr0zlxZt+xqCHNTEKOsrks2HQd4MqhP1qy4z1SkbEP467eNx6TgDKXMvUOb+OENfJCZwM+16n7fRfw== - verror@1.10.0: version "1.10.0" resolved "https://registry.yarnpkg.com/verror/-/verror-1.10.0.tgz#3a105ca17053af55d6e270c1f8288682e18da400" From cb6dbaea09e051062dcd377c4d9a989c24ad9829 Mon Sep 17 00:00:00 2001 From: Annie Lee Date: Fri, 4 Mar 2022 17:06:01 -0800 Subject: [PATCH 17/22] Update DestinationsService.js (#182) Signed-off-by: Annie Lee Signed-off-by: AWSHurneyt --- server/services/DestinationsService.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/services/DestinationsService.js b/server/services/DestinationsService.js index 34e9c4d26..5e8af5255 100644 --- a/server/services/DestinationsService.js +++ b/server/services/DestinationsService.js @@ -180,7 +180,7 @@ export default class DestinationsService { } catch (err) { if (isIndexNotFoundError(err)) { return res.ok({ - body: { ok: true, resp: { totalDestinations: 0, destinations: [] } }, + body: { ok: false, resp: {} }, }); } return res.ok({ From e4c83cf421b1ab7e359c5e65149ca04b976141c8 Mon Sep 17 00:00:00 2001 From: Annie Lee Date: Mon, 7 Mar 2022 16:01:02 -0800 Subject: [PATCH 18/22] Add backport workflow (#176) * Add backport workflow Signed-off-by: Annie Lee * Create delete_backport_branch.yml Signed-off-by: Annie Lee Signed-off-by: AWSHurneyt --- .github/workflows/backport.yml | 29 ++++++++++++++++++++ .github/workflows/delete_backport_branch.yml | 15 ++++++++++ 2 files changed, 44 insertions(+) create mode 100644 .github/workflows/backport.yml create mode 100644 .github/workflows/delete_backport_branch.yml diff --git a/.github/workflows/backport.yml b/.github/workflows/backport.yml new file mode 100644 index 000000000..e3f96a44f --- /dev/null +++ b/.github/workflows/backport.yml @@ -0,0 +1,29 @@ + +name: Backport +on: + pull_request_target: + types: + - closed + - labeled + +jobs: + backport: + runs-on: ubuntu-latest + permissions: + contents: write + pull-requests: write + name: Backport + steps: + - name: GitHub App token + id: github_app_token + uses: tibdex/github-app-token@v1.5.0 + with: + app_id: ${{ secrets.APP_ID }} + private_key: ${{ secrets.APP_PRIVATE_KEY }} + installation_id: 22958780 + + - name: Backport + uses: VachaShah/backport@v1.1.4 + with: + github_token: ${{ steps.github_app_token.outputs.token }} + branch_name: backport/backport-${{ github.event.number }} diff --git a/.github/workflows/delete_backport_branch.yml b/.github/workflows/delete_backport_branch.yml new file mode 100644 index 000000000..f24f022b0 --- /dev/null +++ b/.github/workflows/delete_backport_branch.yml @@ -0,0 +1,15 @@ +name: Delete merged branch of the backport PRs +on: + pull_request: + types: + - closed + +jobs: + delete-branch: + runs-on: ubuntu-latest + if: startsWith(github.event.pull_request.head.ref,'backport/') + steps: + - name: Delete merged branch + uses: SvanBoxel/delete-merged-branch@main + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} From 7b6ad7c165ba83350a8b680ebfdbdbb97865075e Mon Sep 17 00:00:00 2001 From: Annie Lee Date: Tue, 8 Mar 2022 14:23:08 -0800 Subject: [PATCH 19/22] Configure test workflows to run on 1.x branches (#183) Signed-off-by: Annie Lee Signed-off-by: AWSHurneyt --- .github/workflows/cypress-workflow.yml | 2 ++ .github/workflows/unit-tests-workflow.yml | 2 ++ 2 files changed, 4 insertions(+) diff --git a/.github/workflows/cypress-workflow.yml b/.github/workflows/cypress-workflow.yml index dc177e033..43ea9916d 100644 --- a/.github/workflows/cypress-workflow.yml +++ b/.github/workflows/cypress-workflow.yml @@ -3,9 +3,11 @@ on: pull_request: branches: - main + - 1.x push: branches: - main + - 1.x env: OPENSEARCH_DASHBOARDS_VERSION: '1.x' OPENSEARCH_VERSION: '1.3.0-SNAPSHOT' diff --git a/.github/workflows/unit-tests-workflow.yml b/.github/workflows/unit-tests-workflow.yml index d89b763e1..8a617e849 100644 --- a/.github/workflows/unit-tests-workflow.yml +++ b/.github/workflows/unit-tests-workflow.yml @@ -3,9 +3,11 @@ on: push: branches: - main + - 1.x pull_request: branches: - main + - 1.x env: OPENSEARCH_DASHBOARDS_VERSION: '1.x' jobs: From 7480540817eedb569c979d433ab739f1d98e8f9c Mon Sep 17 00:00:00 2001 From: "opensearch-trigger-bot[bot]" <98922864+opensearch-trigger-bot[bot]@users.noreply.github.com> Date: Wed, 9 Mar 2022 01:08:44 -0800 Subject: [PATCH 20/22] Add 1.3 release notes (#175) (#185) * Create opensearch-alerting-dashboards-plugin.release-notes-1.3.0.0.md Signed-off-by: Annie Lee * Update opensearch-alerting-dashboards-plugin.release-notes-1.3.0.0.md Signed-off-by: Annie Lee (cherry picked from commit 98f790486297c7cf003f025eb778029c28a351c3) Co-authored-by: Annie Lee Signed-off-by: AWSHurneyt --- ...dashboards-plugin.release-notes-1.3.0.0.md | 27 +++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 release-notes/opensearch-alerting-dashboards-plugin.release-notes-1.3.0.0.md diff --git a/release-notes/opensearch-alerting-dashboards-plugin.release-notes-1.3.0.0.md b/release-notes/opensearch-alerting-dashboards-plugin.release-notes-1.3.0.0.md new file mode 100644 index 000000000..4e9fe755b --- /dev/null +++ b/release-notes/opensearch-alerting-dashboards-plugin.release-notes-1.3.0.0.md @@ -0,0 +1,27 @@ +## Version 1.3.0.0 2022-02-17 +Compatible with OpenSearch Dashboards 1.3.0 + +### Enhancements +* Implemented a toast to display successful attempts to acknowledge alerts. Refactored alerts dashboard flyout to refresh its alerts table when alerts are acknowledged. ([#160](https://github.com/opensearch-project/alerting-dashboards-plugin/pull/160)) +* Refactored acknowledge alerts button on Alerts by trigger dashboard page to be a modal experience. ([#167](https://github.com/opensearch-project/alerting-dashboards-plugin/pull/167)) + +### Maintenance +* Bumping version to 1.3. ([#159](https://github.com/opensearch-project/alerting-dashboards-plugin/pull/159)) +* adding CODEOWNERS file ([#150](https://github.com/opensearch-project/alerting-dashboards-plugin/pull/150)) +* Configure WhiteSource for GitHub.com ([#153](https://github.com/opensearch-project/alerting-dashboards-plugin/pull/153)) +* Adding basic unit tests ([#151](https://github.com/opensearch-project/alerting-dashboards-plugin/pull/151)) +* Updated copyright notices and headers. ([#168](https://github.com/opensearch-project/alerting-dashboards-plugin/pull/168)) +* Adding a few more basic unit tests ([#180](https://github.com/opensearch-project/alerting-dashboards-plugin/pull/180)) +* Add backport workflow ([#176](https://github.com/opensearch-project/alerting-dashboards-plugin/pull/176)) + +### Bug Fixes +* Fix error handling when config index is not found ([#173](https://github.com/opensearch-project/alerting-dashboards-plugin/pull/173)) +* Update getDestination response ([#182](https://github.com/opensearch-project/alerting-dashboards-plugin/pull/182)) + +### Infrastructure +* Remove node version declaration in package.json ([#166](https://github.com/opensearch-project/alerting-dashboards-plugin/pull/166)) + + + + + From 26ac128673d82c662c9cc5c7426c6630fae17dc9 Mon Sep 17 00:00:00 2001 From: "opensearch-trigger-bot[bot]" <98922864+opensearch-trigger-bot[bot]@users.noreply.github.com> Date: Thu, 10 Mar 2022 10:17:28 -0800 Subject: [PATCH 21/22] Add backport documentation link (#184) (#187) * Create BACKPORT.md Signed-off-by: Annie Lee * Replace documentation with a link Signed-off-by: Annie Lee (cherry picked from commit 0a0c8c50ab97393fac4cd3cddabbfb86794d1794) Co-authored-by: Annie Lee Signed-off-by: AWSHurneyt --- DEVELOPER_GUIDE.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/DEVELOPER_GUIDE.md b/DEVELOPER_GUIDE.md index a2cf3d901..58851e793 100644 --- a/DEVELOPER_GUIDE.md +++ b/DEVELOPER_GUIDE.md @@ -76,4 +76,8 @@ Example output: `./build/alertingDashboards-1.0.0-rc1.zip` If you are running Cypress tests with OpenSearch-Dashboards development server, pass these 2 options to `yarn start`: 1. `--no-base-path`: opt out the BasePathProxy. - 1. `--no-watch`: make sure your server has not restarted. \ No newline at end of file + 1. `--no-watch`: make sure your server has not restarted. + +### Backport + +- [Link to backport documentation](https://github.com/opensearch-project/opensearch-plugins/blob/main/BACKPORT.md) \ No newline at end of file From a5d42d7797ce217d8da7f802f01b8ca66e5138fd Mon Sep 17 00:00:00 2001 From: AWSHurneyt Date: Thu, 10 Mar 2022 18:17:07 -0800 Subject: [PATCH 22/22] Implemented support for cluster metrics monitors (#162) (#189) * Implemented LocalUriInput component, and supporting methods. Implemented unit and integration tests for LocalUriInput. Refactored various other classes and components to support LocalUriInput. Signed-off-by: AWSHurneyt * Refactored learn more links to open new tabs. Signed-off-by: AWSHurneyt * Implemented default trigger conditions for API supported by the LocalUriInput feature. Signed-off-by: AWSHurneyt * Refactored button text and size based on UX reviewer feedback. Signed-off-by: AWSHurneyt * Added documentation link for cluster stats API. Signed-off-by: AWSHurneyt * Adjusted some wording based on UX reviewer feedback. Implemented modal that displays when changing request type. Signed-off-by: AWSHurneyt * Refactored feature assets to use ClusterMetrics naming convention instead of LocalUriInput. Signed-off-by: AWSHurneyt * Refactored behavior of cluster metrics clear triggers modal, and implemented tests. Signed-off-by: AWSHurneyt * Added periods to error messages. Signed-off-by: AWSHurneyt * Removed fixed width for clearTriggersModal. Signed-off-by: AWSHurneyt * Refactored the cluster metrics radio card to be a monitor type instead of monitor definition type. Refactored request type selection combobox so it's not clearable, and reworded the clearTriggersModal text and refactored tests accordingly. Signed-off-by: AWSHurneyt * Updated copyright headers. Signed-off-by: AWSHurneyt * Refactoring monitorType checking logic to accommodate cluster metrics monitors. Signed-off-by: AWSHurneyt * Refactored help text to use lowercase letters. Signed-off-by: AWSHurneyt * Implemented a helper method as a temporary solution to some incorrect formatting of cluster metrics monitors returned by the getMonitors API. Signed-off-by: AWSHurneyt * Refactored cluster metrics feature to remove support for CAT repositories. Signed-off-by: AWSHurneyt * Refactored cluster metrics request types labels to no longer reference CAT. Signed-off-by: AWSHurneyt * Adjusted the example trigger conditions for two request types. Signed-off-by: AWSHurneyt --- .../sample_cluster_metrics_monitor.json | 64 ++ .../cluster_metrics_monitor_spec.js | 388 ++++++++ .../AlertsDashboardFlyoutComponent.js | 14 +- .../ClusterMetricsMonitor.js | 293 ++++++ .../ClusterMetricsMonitor.test.js | 21 + .../ClusterMetricsMonitor.test.js.snap | 184 ++++ .../components/ClusterMetricsMonitor/index.js | 8 + .../utils/clusterMetricsMonitorConstants.js | 178 ++++ .../utils/clusterMetricsMonitorHelpers.js | 118 +++ .../clusterMetricsMonitorHelpers.test.js | 940 ++++++++++++++++++ .../MonitorDefinitionCard.js | 5 +- .../MonitorDefinitionCard.test.js.snap | 10 +- .../components/MonitorType/MonitorType.js | 26 +- .../__snapshots__/MonitorType.test.js.snap | 71 +- .../AnomalyDetector.test.js.snap | 36 + .../containers/CreateMonitor/CreateMonitor.js | 1 + .../__snapshots__/CreateMonitor.test.js.snap | 6 + .../formikToMonitor.test.js.snap | 33 + .../CreateMonitor/utils/constants.js | 6 + .../CreateMonitor/utils/formikToMonitor.js | 30 + .../utils/formikToMonitor.test.js | 23 + .../CreateMonitor/utils/monitorToFormik.js | 13 +- .../utils/monitorToFormik.test.js | 32 + .../containers/DefineMonitor/DefineMonitor.js | 107 +- .../__snapshots__/DefineMonitor.test.js.snap | 6 + .../MonitorDetails/MonitorDetails.js | 11 +- .../__snapshots__/MonitorIndex.test.js.snap | 30 + .../CreateTrigger/components/Action/Action.js | 1 + .../components/Action/utils/validate.js | 4 +- .../AddActionButton/AddActionButton.js | 1 + .../AddTriggerButton/AddTriggerButton.js | 10 +- .../BucketLevelTriggerQuery.js | 164 +-- .../TriggerEmptyPrompt/TriggerEmptyPrompt.js | 9 +- .../components/TriggerQuery/TriggerQuery.js | 195 ++-- .../__snapshots__/TriggerQuery.test.js.snap | 152 ++- .../ConfigureActions/ConfigureActions.js | 2 + .../ConfigureTriggers/ConfigureTriggers.js | 180 ++-- .../CreateTrigger/CreateTrigger.js | 48 +- .../CreateTrigger/utils/formikToTrigger.js | 15 +- .../utils/formikToTrigger.test.js | 7 + .../CreateTrigger/utils/triggerToFormik.js | 10 +- .../containers/DefineTrigger/DefineTrigger.js | 19 +- .../AcknowledgeAlertsModal.js | 2 + .../AcknowledgeAlertsModal.test.js.snap | 6 + .../MonitorOverview/utils/getOverviewStats.js | 18 +- .../Monitors/containers/Monitors/Monitors.js | 25 +- public/utils/constants.js | 2 + public/utils/validate.js | 17 +- 48 files changed, 3147 insertions(+), 394 deletions(-) create mode 100644 cypress/fixtures/sample_cluster_metrics_monitor.json create mode 100644 cypress/integration/cluster_metrics_monitor_spec.js create mode 100644 public/pages/CreateMonitor/components/ClusterMetricsMonitor/ClusterMetricsMonitor.js create mode 100644 public/pages/CreateMonitor/components/ClusterMetricsMonitor/ClusterMetricsMonitor.test.js create mode 100644 public/pages/CreateMonitor/components/ClusterMetricsMonitor/__snapshots__/ClusterMetricsMonitor.test.js.snap create mode 100644 public/pages/CreateMonitor/components/ClusterMetricsMonitor/index.js create mode 100644 public/pages/CreateMonitor/components/ClusterMetricsMonitor/utils/clusterMetricsMonitorConstants.js create mode 100644 public/pages/CreateMonitor/components/ClusterMetricsMonitor/utils/clusterMetricsMonitorHelpers.js create mode 100644 public/pages/CreateMonitor/components/ClusterMetricsMonitor/utils/clusterMetricsMonitorHelpers.test.js diff --git a/cypress/fixtures/sample_cluster_metrics_monitor.json b/cypress/fixtures/sample_cluster_metrics_monitor.json new file mode 100644 index 000000000..9b6ccfae9 --- /dev/null +++ b/cypress/fixtures/sample_cluster_metrics_monitor.json @@ -0,0 +1,64 @@ +{ + "name": "sample_cluster_metrics_health_monitor", + "type": "monitor", + "monitor_type": "cluster_metrics_monitor", + "enabled": true, + "schedule": { + "period": { + "unit": "MINUTES", + "interval": 1 + } + }, + "inputs": [ + { + "uri": { + "api_type": "CLUSTER_HEALTH", + "path": "_cluster/health/", + "path_params": "", + "url": "http://localhost:9200/_cluster/health/" + } + } + ], + "triggers": [], + "ui_metadata": { + "schedule": { + "timezone": null, + "frequency": "interval", + "period": { + "unit": "MINUTES", + "interval": 1 + }, + "daily": 0, + "weekly": { + "tue": false, + "wed": false, + "thur": false, + "sat": false, + "fri": false, + "mon": false, + "sun": false + }, + "monthly": { + "type": "day", + "day": 1 + }, + "cronExpression": "0 */1 * * *" + }, + "search": { + "searchType": "clusterMetrics", + "timeField": "", + "aggregations": [], + "groupBy": [], + "bucketValue": 1, + "bucketUnitOfTime": "h", + "where": { + "fieldName": [], + "fieldRangeEnd": 0, + "fieldRangeStart": 0, + "fieldValue": "", + "operator": "is" + } + }, + "monitor_type": "cluster_metrics_monitor" + } +} diff --git a/cypress/integration/cluster_metrics_monitor_spec.js b/cypress/integration/cluster_metrics_monitor_spec.js new file mode 100644 index 000000000..5bb6d81a1 --- /dev/null +++ b/cypress/integration/cluster_metrics_monitor_spec.js @@ -0,0 +1,388 @@ +/* + * Copyright OpenSearch Contributors + * SPDX-License-Identifier: Apache-2.0 + */ + +import sampleDestination from '../fixtures/sample_destination_custom_webhook'; +import sampleClusterMetricsMonitor from '../fixtures/sample_cluster_metrics_monitor.json'; +import { INDEX, PLUGIN_NAME } from '../../cypress/support/constants'; + +const SAMPLE_CLUSTER_METRICS_HEALTH_MONITOR = 'sample_cluster_metrics_health_monitor'; +const SAMPLE_CLUSTER_METRICS_NODES_STATS_MONITOR = 'sample_cluster_metrics_nodes_stats_monitor'; +const SAMPLE_CLUSTER_METRICS_CAT_SNAPSHOTS_MONITOR = 'sample_cluster_metrics_cat_snapshots_monitor'; +const SAMPLE_TRIGGER = 'sample_trigger'; +const SAMPLE_ACTION = 'sample_action'; +const SAMPLE_DESTINATION = 'sample_destination'; + +const addClusterMetricsTrigger = (triggerName, triggerIndex, actionName, isEdit, source) => { + // Click 'Add trigger' button + cy.contains('Add trigger', { timeout: 20000 }).click({ force: true }); + + if (isEdit === true) { + // TODO: Passing button props in EUI accordion was added in newer versions (31.7.0+). + // If this ever becomes available, it can be used to pass data-test-subj for the button. + // Since the above is currently not possible, referring to the accordion button using its content + cy.get('button').contains('New trigger').click(); + } + + // Type in the trigger name + cy.get(`input[name="triggerDefinitions[${triggerIndex}].name"]`).type(triggerName); + + // Clear the default trigger condition source, and type the sample source + cy.get('[data-test-subj="triggerQueryCodeEditor"]').within(() => { + // If possible, a data-test-subj attribute should be added to access the code editor input directly + cy.get('.ace_text-input') + .focus() + .clear({ force: true }) + .type(JSON.stringify(source), { + force: true, + parseSpecialCharSequences: false, + delay: 5, + timeout: 20000, + }) + .trigger('blur', { force: true }); + }); + + // Type in the action name + cy.get(`input[name="triggerDefinitions[${triggerIndex}].actions.0.name"]`).type(actionName, { + force: true, + }); + + // Click the combo box to list all the destinations + // Using key typing instead of clicking the menu option to avoid occasional failure + cy.get(`[data-test-subj="triggerDefinitions[${triggerIndex}].actions.0_actionDestination"]`) + .click({ force: true }) + .type(`${SAMPLE_DESTINATION}{downarrow}{enter}`); +}; + +describe('ClusterMetricsMonitor', () => { + before(() => { + cy.createDestination(sampleDestination); + + // Load sample data + cy.loadSampleEcommerceData(); + }); + + beforeEach(() => { + // Set welcome screen tracking to false + localStorage.setItem('home:welcome:show', 'false'); + + // Visit Alerting OpenSearch Dashboards + cy.visit(`${Cypress.env('opensearch_dashboards')}/app/${PLUGIN_NAME}#/monitors`); + + // Common text to wait for to confirm page loaded, give up to 20 seconds for initial load + cy.contains('Create monitor', { timeout: 20000 }); + }); + + describe('can be created', () => { + beforeEach(() => { + cy.deleteAllMonitors(); + cy.reload(); + }); + + it('for the Cluster Health API', () => { + // Confirm empty monitor list is loaded + cy.contains('There are no existing monitors'); + + // Go to create monitor page + cy.contains('Create monitor').click(); + + // Select ClusterMetrics radio card + cy.get('[data-test-subj="clusterMetricsMonitorRadioCard"]').click(); + + // Wait for input to load and then type in the monitor name + cy.get('input[name="name"]').type(SAMPLE_CLUSTER_METRICS_HEALTH_MONITOR); + + // Wait for the API types to load and then type in the Cluster Health API + cy.get('[data-test-subj="clusterMetricsApiTypeComboBox"]').type('cluster health{enter}'); + + // Confirm the Query parameters field is present and described as "optional" + cy.contains('Query parameters - optional'); + cy.get('[data-test-subj="clusterMetricsParamsFieldText"]'); + + // Press the 'Run for response' button + cy.get('[data-test-subj="clusterMetricsPreviewButton"]').click(); + + // Add a trigger + cy.contains('Add trigger').click({ force: true }); + + // Type in the trigger name + cy.get('input[name="triggerDefinitions[0].name"]').type(SAMPLE_TRIGGER); + + // Type in the action name + cy.get('input[name="triggerDefinitions[0].actions.0.name"]').type(SAMPLE_ACTION); + + // Click the combo box to list all the destinations + // Using key typing instead of clicking the menu option to avoid occasional failure + cy.get('div[name="triggerDefinitions[0].actions.0.destination_id"]') + .click({ force: true }) + .type('{downarrow}{enter}'); + + // Click the create button + cy.get('button').contains('Create').click(); + + // Confirm we can see only one row in the trigger list by checking
      element + cy.contains('This table contains 1 row'); + + // Confirm we can see the new trigger + cy.contains(SAMPLE_TRIGGER); + + // Go back to the Monitors list + cy.get('a').contains('Monitors').click(); + + // Confirm we can see the created monitor in the list + cy.contains(SAMPLE_CLUSTER_METRICS_HEALTH_MONITOR); + }); + + it('for the Nodes Stats API', () => { + // Confirm empty monitor list is loaded + cy.contains('There are no existing monitors'); + + // Go to create monitor page + cy.contains('Create monitor').click(); + + // Select ClusterMetrics radio card + cy.get('[data-test-subj="clusterMetricsMonitorRadioCard"]').click(); + + // Wait for input to load and then type in the monitor name + cy.get('input[name="name"]').type(SAMPLE_CLUSTER_METRICS_NODES_STATS_MONITOR); + + // Wait for the API types to load and then type in the Cluster Health API + cy.get('[data-test-subj="clusterMetricsApiTypeComboBox"]').type('nodes stats{enter}'); + + // Confirm the Query parameters field is not present + cy.contains('Query parameters').should('not.exist'); + cy.get('[data-test-subj="clusterMetricsParamsFieldText"]').should('not.exist'); + + // Press the 'Run for response' button + cy.get('[data-test-subj="clusterMetricsPreviewButton"]').click(); + + // Add a trigger + cy.contains('Add trigger').click({ force: true }); + + // Type in the trigger name + cy.get('input[name="triggerDefinitions[0].name"]').type(SAMPLE_TRIGGER); + + // Type in the action name + cy.get('input[name="triggerDefinitions[0].actions.0.name"]').type(SAMPLE_ACTION); + + // Click the combo box to list all the destinations + // Using key typing instead of clicking the menu option to avoid occasional failure + cy.get('div[name="triggerDefinitions[0].actions.0.destination_id"]') + .click({ force: true }) + .type('{downarrow}{enter}'); + + // Click the create button + cy.get('button').contains('Create').click(); + + // Confirm we can see only one row in the trigger list by checking element + cy.contains('This table contains 1 row'); + + // Confirm we can see the new trigger + cy.contains(SAMPLE_TRIGGER); + + // Go back to the Monitors list + cy.get('a').contains('Monitors').click(); + + // Confirm we can see the created monitor in the list + cy.contains(SAMPLE_CLUSTER_METRICS_NODES_STATS_MONITOR); + }); + }); + + describe('displays Query parameters field appropriately', () => { + beforeEach(() => { + cy.deleteAllMonitors(); + cy.reload(); + }); + + it('for the CAT Snapshots API', () => { + // Confirm empty monitor list is loaded + cy.contains('There are no existing monitors'); + + // Go to create monitor page + cy.contains('Create monitor').click(); + + // Select ClusterMetrics radio card + cy.get('[data-test-subj="clusterMetricsMonitorRadioCard"]').click(); + + // Wait for input to load and then type in the monitor name + cy.get('input[name="name"]').type(SAMPLE_CLUSTER_METRICS_CAT_SNAPSHOTS_MONITOR); + + // Wait for the API types to load and then type in the Cluster Health API + cy.get('[data-test-subj="clusterMetricsApiTypeComboBox"]').type('list snapshots{enter}'); + + // Confirm the Query parameters field is present and is not described as "optional" + cy.contains('Query parameters - optional').should('not.exist'); + cy.contains('Query parameters'); + cy.get('[data-test-subj="clusterMetricsParamsFieldText"]'); + }); + }); + + describe('clearTriggersModal renders and behaves as expected', () => { + beforeEach(() => { + // Visit Alerting OpenSearch Dashboards + cy.visit(`${Cypress.env('opensearch_dashboards')}/app/${PLUGIN_NAME}#/monitors`); + + // Begin monitor creation + // Confirm empty monitor list is loaded + cy.contains('There are no existing monitors'); + + // Go to create monitor page + cy.contains('Create monitor').click(); + + // Select ClusterMetrics radio card + cy.get('[data-test-subj="clusterMetricsMonitorRadioCard"]').click(); + + // Wait for input to load and then type in the monitor name + cy.get('input[name="name"]').type(SAMPLE_CLUSTER_METRICS_HEALTH_MONITOR); + }); + + it('when no triggers exist', () => { + // Confirm there are 0 triggers defined + cy.contains('Triggers (0)'); + + describe('blank API type is defined', () => { + // Select the Cluster Health API + cy.get('[data-test-subj="clusterMetricsApiTypeComboBox"]').type('cluster health{enter}'); + + // Confirm clearTriggersModal is not displayed + cy.get('[data-test-subj="clusterMetricsClearTriggersModal"]').should('not.exist'); + }); + + describe('API type is changed', () => { + // Change the API type to Cluster Stats + cy.get('[data-test-subj="clusterMetricsApiTypeComboBox"]').type('cluster stats{enter}'); + + // Confirm clearTriggersModal is not displayed + cy.get('[data-test-subj="clusterMetricsClearTriggersModal"]').should('not.exist'); + }); + }); + + it('when triggers exist', () => { + // Add a trigger for testing purposes + addClusterMetricsTrigger( + SAMPLE_TRIGGER, + 0, + SAMPLE_ACTION, + false, + 'ctx.results[0].number_of_pending_tasks >= 0' + ); + + // Confirm there is 1 trigger defined + cy.contains('Triggers (1)'); + + describe('blank API type is defined', () => { + // Select the Cluster Health API + cy.get('[data-test-subj="clusterMetricsApiTypeComboBox"]').type('cluster health{enter}'); + + // Confirm clearTriggersModal did not open + cy.get('[data-test-subj="clusterMetricsClearTriggersModal"]').should('not.exist'); + }); + + describe('API type is changed', () => { + // Change the API type to Cluster Stats + cy.get('[data-test-subj="clusterMetricsApiTypeComboBox"]').type('cluster stats{enter}'); + + // Confirm clearTriggersModal displays appropriate text + cy.contains( + 'You are about to change the request type. The existing trigger conditions may not be supported. Would you like to clear the existing trigger conditions?' + ); + }); + + describe('the modal CLOSE (i.e., the X button) button is clicked', () => { + // Click the CLOSE button + cy.get('[class="euiButtonIcon euiButtonIcon--text euiModal__closeIcon"]').click(); + + // Confirm clearTriggersModal closed + cy.get('[data-test-subj="clusterMetricsClearTriggersModal"]').should('not.exist'); + + // Confirm API type reverted back to Cluster Health + cy.get('[data-test-subj="clusterMetricsApiTypeComboBox"]').contains('Cluster health'); + + // Confirm there is 1 trigger defined + cy.contains('Triggers (1)'); + }); + + describe('the modal KEEP button is clicked', () => { + // Change the API type to Cluster Stats + cy.get('[data-test-subj="clusterMetricsApiTypeComboBox"]').type('cluster stats{enter}'); + + // Click the KEEP button + cy.get('[data-test-subj="clusterMetricsClearTriggersModalKeepButton"]').click(); + + // Confirm clearTriggersModal closed + cy.get('[data-test-subj="clusterMetricsClearTriggersModal"]').should('not.exist'); + + // Confirm there is 1 trigger defined + cy.contains('Triggers (1)'); + }); + + describe('the modal CLEAR button is clicked', () => { + // Change the API type to Cluster Settings + cy.get('[data-test-subj="clusterMetricsApiTypeComboBox"]').type('cluster settings{enter}'); + + // Click the CLEAR button + cy.get('[data-test-subj="clusterMetricsClearTriggersModalClearButton"]').click(); + + // Confirm clearTriggersModal closed + cy.get('[data-test-subj="clusterMetricsClearTriggersModal"]').should('not.exist'); + + // Confirm API type changed to Cluster Stats + cy.get('[data-test-subj="clusterMetricsApiTypeComboBox"]').contains('Cluster settings'); + + // Confirm there are 0 triggers defined + cy.contains('Triggers (0)', { timeout: 20000 }); + }); + }); + }); + + describe('can update', () => { + beforeEach(() => { + cy.deleteAllMonitors(); + }); + + describe('Cluster Health API monitor', () => { + it('with a new trigger', () => { + // Create the sample monitor + cy.createMonitor(sampleClusterMetricsMonitor); + cy.reload(); + + // Confirm the created monitor can be seen + cy.contains(SAMPLE_CLUSTER_METRICS_HEALTH_MONITOR); + + // Select the monitor + cy.get('a').contains(SAMPLE_CLUSTER_METRICS_HEALTH_MONITOR).click({ force: true }); + + // Click Edit button + cy.contains('Edit').click({ force: true }); + + // Add a trigger + addClusterMetricsTrigger( + SAMPLE_TRIGGER, + 0, + SAMPLE_ACTION, + true, + 'ctx.results[0].number_of_pending_tasks >= 0' + ); + + // Click update button to save monitor changes + cy.get('button').contains('Update').last().click({ force: true }); + + // Confirm we can see only one row in the trigger list by checking element + cy.contains('This table contains 1 row'); + + // Confirm we can see the new trigger + cy.contains(SAMPLE_TRIGGER); + }); + }); + }); + + after(() => { + // Delete all monitors and destinations + cy.deleteAllMonitors(); + cy.deleteAllDestinations(); + + // Delete sample data + cy.deleteIndexByName(`${INDEX.SAMPLE_DATA_ECOMMERCE}`); + }); +}); diff --git a/public/components/Flyout/flyouts/components/AlertsDashboardFlyoutComponent.js b/public/components/Flyout/flyouts/components/AlertsDashboardFlyoutComponent.js index ebd3b0878..9d72546d8 100644 --- a/public/components/Flyout/flyouts/components/AlertsDashboardFlyoutComponent.js +++ b/public/components/Flyout/flyouts/components/AlertsDashboardFlyoutComponent.js @@ -301,13 +301,13 @@ export default class AlertsDashboardFlyoutComponent extends Component { const detectorId = _.get(monitor, MONITOR_INPUT_DETECTOR_ID); const triggerType = - monitorType === MONITOR_TYPE.QUERY_LEVEL - ? TRIGGER_TYPE.QUERY_LEVEL - : TRIGGER_TYPE.BUCKET_LEVEL; + monitorType === MONITOR_TYPE.BUCKET_LEVEL + ? TRIGGER_TYPE.BUCKET_LEVEL + : TRIGGER_TYPE.QUERY_LEVEL; - let trigger = _.get(monitor, 'triggers', []).find((trigger) => { - return trigger[triggerType].id === triggerID; - }); + let trigger = _.get(monitor, 'triggers', []).find( + (trigger) => trigger[triggerType].id === triggerID + ); trigger = _.get(trigger, triggerType); const severity = _.get(trigger, 'severity'); @@ -360,6 +360,7 @@ export default class AlertsDashboardFlyoutComponent extends Component { const getItemId = (item) => { switch (monitorType) { case MONITOR_TYPE.QUERY_LEVEL: + case MONITOR_TYPE.CLUSTER_METRICS: return `${item.id}-${item.version}`; case MONITOR_TYPE.BUCKET_LEVEL: return item.id; @@ -384,6 +385,7 @@ export default class AlertsDashboardFlyoutComponent extends Component { let columns = []; switch (monitorType) { case MONITOR_TYPE.QUERY_LEVEL: + case MONITOR_TYPE.CLUSTER_METRICS: columns = queryColumns; break; case MONITOR_TYPE.BUCKET_LEVEL: diff --git a/public/pages/CreateMonitor/components/ClusterMetricsMonitor/ClusterMetricsMonitor.js b/public/pages/CreateMonitor/components/ClusterMetricsMonitor/ClusterMetricsMonitor.js new file mode 100644 index 000000000..d4fc032f0 --- /dev/null +++ b/public/pages/CreateMonitor/components/ClusterMetricsMonitor/ClusterMetricsMonitor.js @@ -0,0 +1,293 @@ +/* + * Copyright OpenSearch Contributors + * SPDX-License-Identifier: Apache-2.0 + */ + +import React, { useState } from 'react'; +import _ from 'lodash'; +import { + EuiButton, + EuiButtonEmpty, + EuiCodeEditor, + EuiFlexGroup, + EuiFlexItem, + EuiFormRow, + EuiLink, + EuiModal, + EuiModalBody, + EuiModalFooter, + EuiModalHeader, + EuiModalHeaderTitle, + EuiOverlayMask, + EuiSpacer, + EuiText, +} from '@elastic/eui'; +import { isInvalidApiPath } from '../../../../utils/validate'; +import { FormikComboBox, FormikFieldText } from '../../../../components/FormControls'; +import { + API_PATH_REQUIRED_PLACEHOLDER_TEXT, + EMPTY_PATH_PARAMS_TEXT, + REST_API_REFERENCE, + API_TYPES, +} from './utils/clusterMetricsMonitorConstants'; +import { + getApiPath, + getExamplePathParams, + isInvalidApiPathParameter, + validateApiPathParameter, +} from './utils/clusterMetricsMonitorHelpers'; +import { FORMIK_INITIAL_VALUES } from '../../containers/CreateMonitor/utils/constants'; + +const setApiType = (form, apiType) => { + const pathParams = _.get(form, 'uri.path_params', FORMIK_INITIAL_VALUES.uri.path_params); + form.setFieldValue('uri.api_type', apiType); + form.setFieldValue('uri.path', getApiPath(_.isEmpty(pathParams), apiType)); +}; + +const renderModal = (closeModal, prevApiType, selectedApiType, form) => { + const onClear = () => { + setApiType(form, selectedApiType); + form.setFieldValue('triggerDefinitions', []); + closeModal(); + }; + const onKeep = () => { + setApiType(form, selectedApiType); + closeModal(); + }; + const onClose = () => { + setApiType(form, prevApiType); + closeModal(); + }; + return ( + + + + Clear all trigger conditions? + + + You are about to change the request type. The existing trigger conditions may not be + supported. Would you like to clear the existing trigger conditions? + + + + + + + Keep + + + + + + Clear + + + + + + + ); +}; + +const ClusterMetricsMonitor = ({ + isDarkMode, + loadingResponse = false, + loadingSupportedApiList = false, + onRunQuery, + resetResponse, + response, + supportedApiList = [], + values, +}) => { + const apiType = _.get(values, 'uri.api_type'); + const path = _.get(values, 'uri.path'); + const pathIsEmpty = _.isEmpty(path); + const pathParams = _.get(values, 'uri.path_params', FORMIK_INITIAL_VALUES.uri.path_params); + const supportsPathParams = !_.isEmpty(_.get(API_TYPES, `${apiType}.paths.withPathParams`)); + const requirePathParams = _.isEmpty(_.get(API_TYPES, `${apiType}.paths.withoutPathParams`)); + const hidePathParams = pathIsEmpty || loadingSupportedApiList || !supportsPathParams; + const disableRunButton = pathIsEmpty || (_.isEmpty(pathParams) && requirePathParams); + const hasTriggers = _.get(values, 'triggerDefinitions', []).length > 0; + + const [displayingModal, setDisplayingModal] = useState(false); + const [clearTriggersModal, setClearTriggersModal] = useState(undefined); + const closeModal = () => { + setDisplayingModal(false); + setClearTriggersModal(undefined); + }; + const openModal = (prevApiType, selectedApiType, form) => { + setDisplayingModal(true); + setClearTriggersModal(renderModal(closeModal, prevApiType, selectedApiType, form)); + }; + + return ( +
      + + + + + Request type + + + Specify a request type to monitor cluster metrics such as health, JVM, and CPU + usage.{' '} + + Learn more + + +
      + ), + isInvalid: isInvalidApiPath, + error: API_PATH_REQUIRED_PLACEHOLDER_TEXT, + }} + inputProps={{ + placeholder: loadingSupportedApiList ? 'Loading API options' : 'Select an API', + options: supportedApiList, + onBlur: (e, field, form) => { + form.setFieldTouched('uri.api_type'); + }, + onChange: (options, field, form) => { + const selectedApiType = _.get(options, '0.value'); + let changingApiType = true; + if (selectedApiType !== apiType) { + const doesNotUsePathParams = _.isEmpty( + _.get(API_TYPES, `${selectedApiType}.paths.withPathParams`) + ); + if (doesNotUsePathParams) + form.setFieldValue('uri.path_params', FORMIK_INITIAL_VALUES.uri.path_params); + if (hasTriggers && !_.isEmpty(apiType)) { + changingApiType = false; + openModal(apiType, selectedApiType, form); + } + resetResponse(); + form.setFieldTouched('uri.path_params', false); + } + if (changingApiType) setApiType(form, selectedApiType); + }, + isClearable: false, + singleSelection: { asPlainText: true }, + selectedOptions: !_.isEmpty(apiType) + ? [ + { + value: _.get(API_TYPES, `${apiType}.type`), + label: _.get(API_TYPES, `${apiType}.label`), + }, + ] + : undefined, + isDisabled: loadingSupportedApiList, + isLoading: loadingSupportedApiList, + 'data-test-subj': 'clusterMetricsApiTypeComboBox', + }} + /> + + {displayingModal && clearTriggersModal} + + + {!hidePathParams ? ( +
      + + validateApiPathParameter(field, hidePathParams, pathParams, requirePathParams), + }} + rowProps={{ + label: ( +
      + + Query parameters + {!requirePathParams && - optional } + + + Filter responses by providing path parameters for the{' '} + {_.lowerCase(_.get(API_TYPES, `${apiType}.label`)) || 'selected'} API.{' '} + {!pathIsEmpty && !_.isEmpty(_.get(API_TYPES, `${apiType}.documentation`)) && ( + + Learn more + + )} + +
      + ), + style: { maxWidth: '600px' }, + isInvalid: (value, field) => + isInvalidApiPathParameter(field, hidePathParams, pathParams, requirePathParams), + error: (value, field) => + validateApiPathParameter(field, hidePathParams, pathParams, requirePathParams), + }} + inputProps={{ + placeholder: pathIsEmpty ? EMPTY_PATH_PARAMS_TEXT : getExamplePathParams(apiType), + fullWidth: true, + prepend: ( + + GET {_.get(API_TYPES, `${apiType}.prependText`)} + + ), + append: !_.isEmpty(_.get(API_TYPES, `${apiType}.appendText`)) && ( + + {_.get(API_TYPES, `${apiType}.appendText`)} + + ), + 'data-test-subj': 'clusterMetricsParamsFieldText', + }} + /> + + +
      + ) : null} + + + Preview query + + + + + + + + + ); +}; + +export default ClusterMetricsMonitor; diff --git a/public/pages/CreateMonitor/components/ClusterMetricsMonitor/ClusterMetricsMonitor.test.js b/public/pages/CreateMonitor/components/ClusterMetricsMonitor/ClusterMetricsMonitor.test.js new file mode 100644 index 000000000..f9d2f7482 --- /dev/null +++ b/public/pages/CreateMonitor/components/ClusterMetricsMonitor/ClusterMetricsMonitor.test.js @@ -0,0 +1,21 @@ +/* + * Copyright OpenSearch Contributors + * SPDX-License-Identifier: Apache-2.0 + */ + +import React from 'react'; +import { render } from 'enzyme'; +import { Formik } from 'formik'; + +import ClusterMetricsMonitor from './ClusterMetricsMonitor'; + +describe('ClusterMetricsMonitor', () => { + test('renders', () => { + const component = ( + + + + ); + expect(render(component)).toMatchSnapshot(); + }); +}); diff --git a/public/pages/CreateMonitor/components/ClusterMetricsMonitor/__snapshots__/ClusterMetricsMonitor.test.js.snap b/public/pages/CreateMonitor/components/ClusterMetricsMonitor/__snapshots__/ClusterMetricsMonitor.test.js.snap new file mode 100644 index 000000000..ce04d6453 --- /dev/null +++ b/public/pages/CreateMonitor/components/ClusterMetricsMonitor/__snapshots__/ClusterMetricsMonitor.test.js.snap @@ -0,0 +1,184 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`ClusterMetricsMonitor renders 1`] = ` +
      +
      +
      +
      + +
      +
      + +
      +
      + +
      +
      +
      + +
      +
      +
      +
      +

      + Press Enter to start editing. +

      +

      + When you're done, press Escape to stop editing. +

      +
      +
      +
      +
      +
      +
      +`; diff --git a/public/pages/CreateMonitor/components/ClusterMetricsMonitor/index.js b/public/pages/CreateMonitor/components/ClusterMetricsMonitor/index.js new file mode 100644 index 000000000..f0dc16876 --- /dev/null +++ b/public/pages/CreateMonitor/components/ClusterMetricsMonitor/index.js @@ -0,0 +1,8 @@ +/* + * Copyright OpenSearch Contributors + * SPDX-License-Identifier: Apache-2.0 + */ + +import ClusterMetricsImport from './ClusterMetricsMonitor'; + +export default ClusterMetricsImport; diff --git a/public/pages/CreateMonitor/components/ClusterMetricsMonitor/utils/clusterMetricsMonitorConstants.js b/public/pages/CreateMonitor/components/ClusterMetricsMonitor/utils/clusterMetricsMonitorConstants.js new file mode 100644 index 000000000..9245d1aee --- /dev/null +++ b/public/pages/CreateMonitor/components/ClusterMetricsMonitor/utils/clusterMetricsMonitorConstants.js @@ -0,0 +1,178 @@ +/* + * Copyright OpenSearch Contributors + * SPDX-License-Identifier: Apache-2.0 + */ + +export const API_PATH_REQUIRED_PLACEHOLDER_TEXT = 'Select an API.'; +export const EMPTY_PATH_PARAMS_TEXT = 'Enter remaining path components and path parameters'; +export const GET_API_TYPE_DEBUG_TEXT = + 'Cannot determine ApiType in clusterMetricsMonitorHelpers::getSelectedApiType.'; +export const ILLEGAL_PATH_PARAMETER_CHARACTERS = [ + ':', + '"', + '+', + '\\', + '|', + '?', + '#', + '>', + '<', + ' ', +]; +export const NO_PATH_PARAMS_PLACEHOLDER_TEXT = 'No path parameter options'; +export const PATH_PARAMETER_ILLEGAL_CHARACTER_TEXT = `The provided path parameters contain invalid characters or spaces. Please omit: ${ILLEGAL_PATH_PARAMETER_CHARACTERS.join( + ' ' +)}`; +export const PATH_PARAMETERS_REQUIRED_TEXT = 'Path parameters are required for this API.'; +export const REST_API_REFERENCE = 'https://opensearch.org/docs/latest/opensearch/rest-api/index/'; +export const DEFAULT_CLUSTER_METRICS_SCRIPT = { + lang: 'painless', + source: 'ctx.results[0] != null', +}; + +export const API_TYPES = { + CLUSTER_HEALTH: { + type: 'CLUSTER_HEALTH', + documentation: 'https://opensearch.org/docs/latest/opensearch/rest-api/cluster-health/', + exampleText: 'indexAlias1,indexAlias2...', + label: 'Cluster health', + paths: { + withPathParams: '_cluster/health/', + withoutPathParams: '_cluster/health', + }, + get prependText() { + return this.paths.withPathParams || this.paths.withoutPathParams; + }, + appendText: '', + defaultCondition: { + ...DEFAULT_CLUSTER_METRICS_SCRIPT, + source: 'ctx.results[0].status != "green"', + }, + }, + CLUSTER_STATS: { + type: 'CLUSTER_STATS', + documentation: 'https://opensearch.org/docs/latest/opensearch/rest-api/cluster-stats/', + exampleText: 'nodeFilter1,nodeFilter2...', + label: 'Cluster stats', + paths: { + withPathParams: '_cluster/stats/nodes/', + withoutPathParams: '_cluster/stats', + }, + get prependText() { + return this.paths.withPathParams || this.paths.withoutPathParams; + }, + appendText: '', + defaultCondition: { + ...DEFAULT_CLUSTER_METRICS_SCRIPT, + source: 'ctx.results[0].indices.count <= 0', + }, + }, + CLUSTER_SETTINGS: { + type: 'CLUSTER_SETTINGS', + documentation: 'https://opensearch.org/docs/latest/opensearch/rest-api/cluster-settings/', + exampleText: undefined, + label: 'Cluster settings', + paths: { + withPathParams: undefined, + withoutPathParams: '_cluster/settings', + }, + get prependText() { + return this.paths.withPathParams || this.paths.withoutPathParams; + }, + appendText: '', + defaultCondition: { + ...DEFAULT_CLUSTER_METRICS_SCRIPT, + source: 'ctx.results[0].transient != null', + }, + }, + NODES_STATS: { + type: 'NODES_STATS', + documentation: 'https://opensearch.org/docs/latest/opensearch/popular-api/#get-node-statistics', + exampleText: undefined, + label: 'Nodes stats', + paths: { + withPathParams: undefined, + withoutPathParams: '_nodes/stats', + }, + get prependText() { + return this.paths.withPathParams || this.paths.withoutPathParams; + }, + appendText: '', + defaultCondition: { + ...DEFAULT_CLUSTER_METRICS_SCRIPT, + source: 'ctx.results[0].nodes.NODE_ID.jvm.mem.heap_used_percent > 60', + }, + }, + CAT_PENDING_TASKS: { + type: 'CAT_PENDING_TASKS', + documentation: 'https://opensearch.org/docs/latest/opensearch/rest-api/cat/cat-pending-tasks/', + exampleText: undefined, + label: 'List pending tasks', + paths: { + withPathParams: undefined, + withoutPathParams: '_cat/pending_tasks', + }, + get prependText() { + return this.paths.withPathParams || this.paths.withoutPathParams; + }, + appendText: '', + defaultCondition: { + ...DEFAULT_CLUSTER_METRICS_SCRIPT, + source: 'ctx.results[0].tasks.size() >= 0', + }, + }, + CAT_RECOVERY: { + type: 'CAT_RECOVERY', + documentation: 'https://opensearch.org/docs/latest/opensearch/rest-api/cat/cat-recovery/', + exampleText: 'index1,index2...', + label: 'Recovery', + paths: { + withPathParams: '_cat/recovery/', + withoutPathParams: '_cat/recovery', + }, + get prependText() { + return this.paths.withPathParams || this.paths.withoutPathParams; + }, + appendText: '', + defaultCondition: { + ...DEFAULT_CLUSTER_METRICS_SCRIPT, + source: 'ctx.results[0].INDEX_NAME.shards.length <= 0', + }, + }, + CAT_SNAPSHOTS: { + type: 'CAT_SNAPSHOTS', + documentation: 'https://opensearch.org/docs/latest/opensearch/rest-api/cat/cat-snapshots/', + exampleText: 'repositoryName', + label: 'List snapshots', + paths: { + withPathParams: '_cat/snapshots/', + withoutPathParams: undefined, + }, + get prependText() { + return this.paths.withPathParams || this.paths.withoutPathParams; + }, + appendText: '', + defaultCondition: { + ...DEFAULT_CLUSTER_METRICS_SCRIPT, + source: 'ctx.results[0].SNAPSHOT_ID.status == "FAILED"', + }, + }, + CAT_TASKS: { + type: 'CAT_TASKS', + documentation: 'https://opensearch.org/docs/latest/opensearch/rest-api/cat/cat-tasks/', + exampleText: undefined, + label: 'List tasks', + paths: { + withPathParams: undefined, + withoutPathParams: '_cat/tasks', + }, + get prependText() { + return this.paths.withPathParams || this.paths.withoutPathParams; + }, + appendText: '', + defaultCondition: { + ...DEFAULT_CLUSTER_METRICS_SCRIPT, + source: 'ctx.results[0].tasks.length > 0', + }, + }, +}; diff --git a/public/pages/CreateMonitor/components/ClusterMetricsMonitor/utils/clusterMetricsMonitorHelpers.js b/public/pages/CreateMonitor/components/ClusterMetricsMonitor/utils/clusterMetricsMonitorHelpers.js new file mode 100644 index 000000000..929f64aad --- /dev/null +++ b/public/pages/CreateMonitor/components/ClusterMetricsMonitor/utils/clusterMetricsMonitorHelpers.js @@ -0,0 +1,118 @@ +/* + * Copyright OpenSearch Contributors + * SPDX-License-Identifier: Apache-2.0 + */ + +import _ from 'lodash'; +import { formikToClusterMetricsInput } from '../../../containers/CreateMonitor/utils/formikToMonitor'; +import { + DEFAULT_CLUSTER_METRICS_SCRIPT, + ILLEGAL_PATH_PARAMETER_CHARACTERS, + PATH_PARAMETER_ILLEGAL_CHARACTER_TEXT, + PATH_PARAMETERS_REQUIRED_TEXT, + API_TYPES, + NO_PATH_PARAMS_PLACEHOLDER_TEXT, + GET_API_TYPE_DEBUG_TEXT, +} from './clusterMetricsMonitorConstants'; +import { SEARCH_TYPE } from '../../../../../utils/constants'; +import { FORMIK_INITIAL_TRIGGER_VALUES } from '../../../../CreateTrigger/containers/CreateTrigger/utils/constants'; +import { FORMIK_INITIAL_VALUES } from '../../../containers/CreateMonitor/utils/constants'; + +export function buildClusterMetricsRequest(values) { + return _.get(formikToClusterMetricsInput(values), 'uri'); +} + +export const canExecuteClusterMetricsMonitor = (uri = {}) => { + const { + api_type = FORMIK_INITIAL_VALUES.uri.api_type, + path_params = FORMIK_INITIAL_VALUES.uri.path_params, + } = uri; + if (_.isEmpty(api_type)) return false; + const requiresPathParams = _.isEmpty(_.get(API_TYPES, `${api_type}.paths.withoutPathParams`)); + const hasPathParams = !_.isEmpty(path_params); + if (pathParamsContainIllegalCharacters(path_params)) return false; + return requiresPathParams ? hasPathParams : true; +}; + +export const pathParamsContainIllegalCharacters = (pathParams) => { + if (_.isEmpty(pathParams)) return false; + const foundIllegalCharacters = ILLEGAL_PATH_PARAMETER_CHARACTERS.find((illegalCharacter) => + _.includes(pathParams, illegalCharacter) + ); + return !_.isEmpty(foundIllegalCharacters); +}; + +export const getApiPath = (hasPathParams = false, apiType) => { + let path = hasPathParams + ? _.get( + API_TYPES, + `${apiType}.paths.withPathParams`, + _.get(API_TYPES, `${apiType}.paths.withoutPathParams`) + ) + : _.get(API_TYPES, `${apiType}.paths.withoutPathParams`); + return path || FORMIK_INITIAL_VALUES.uri.path; +}; + +export const getApiTypesRequiringPathParams = () => { + const apiList = []; + _.keys(API_TYPES).forEach((api) => { + const withoutPathParams = _.get(API_TYPES, `${api}.paths.withoutPathParams`, ''); + if (_.isEmpty(withoutPathParams)) + apiList.push({ + value: _.get(API_TYPES, `${api}.type`), + label: _.get(API_TYPES, `${api}.label`), + }); + }); + return apiList; +}; + +export const getDefaultScript = (monitorValues) => { + const searchType = _.get(monitorValues, 'searchType', FORMIK_INITIAL_VALUES.searchType); + switch (searchType) { + case SEARCH_TYPE.CLUSTER_METRICS: + const apiType = _.get(monitorValues, 'uri.api_type'); + return _.get(API_TYPES, `${apiType}.defaultCondition`, DEFAULT_CLUSTER_METRICS_SCRIPT); + default: + return FORMIK_INITIAL_TRIGGER_VALUES.script; + } +}; + +export const getExamplePathParams = (apiType) => { + if (_.isEmpty(apiType)) return NO_PATH_PARAMS_PLACEHOLDER_TEXT; + let exampleText = _.get(API_TYPES, `${apiType}.exampleText`, ''); + _.isEmpty(exampleText) + ? (exampleText = NO_PATH_PARAMS_PLACEHOLDER_TEXT) + : (exampleText = `e.g., ${exampleText}`); + return exampleText; +}; + +export const getApiType = (uri) => { + let apiType = ''; + const path = _.get(uri, 'path'); + if (_.isEmpty(path)) return apiType; + _.keys(API_TYPES).forEach((apiTypeKey) => { + const withPathParams = _.get(API_TYPES, `${apiTypeKey}.paths.withPathParams`); + const withoutPathParams = _.get(API_TYPES, `${apiTypeKey}.paths.withoutPathParams`); + if (path === withPathParams || path === withoutPathParams) apiType = apiTypeKey; + }); + if (_.isEmpty(apiType)) console.debug(GET_API_TYPE_DEBUG_TEXT); + return apiType; +}; + +export const isInvalidApiPathParameter = (field, hidePathParams, pathParams, requirePathParams) => { + if (hidePathParams) return false; + const pathParamsTouched = _.get(field, 'touched.uri.path_params', false); + if (pathParamsTouched) { + if (requirePathParams && _.isEmpty(pathParams)) return true; + return pathParamsContainIllegalCharacters(pathParams); + } else return pathParamsTouched; +}; + +export const validateApiPathParameter = (field, hidePathParams, pathParams, requirePathParams) => { + if (hidePathParams) return NO_PATH_PARAMS_PLACEHOLDER_TEXT; + const pathParamsTouched = _.get(field, 'touched.uri.path_params', false); + if (requirePathParams && pathParamsTouched && _.isEmpty(pathParams)) + return PATH_PARAMETERS_REQUIRED_TEXT; + if (isInvalidApiPathParameter(field, hidePathParams, pathParams, requirePathParams)) + return PATH_PARAMETER_ILLEGAL_CHARACTER_TEXT; +}; diff --git a/public/pages/CreateMonitor/components/ClusterMetricsMonitor/utils/clusterMetricsMonitorHelpers.test.js b/public/pages/CreateMonitor/components/ClusterMetricsMonitor/utils/clusterMetricsMonitorHelpers.test.js new file mode 100644 index 000000000..f2c2cf35f --- /dev/null +++ b/public/pages/CreateMonitor/components/ClusterMetricsMonitor/utils/clusterMetricsMonitorHelpers.test.js @@ -0,0 +1,940 @@ +/* + * Copyright OpenSearch Contributors + * SPDX-License-Identifier: Apache-2.0 + */ + +import _ from 'lodash'; +import { + API_TYPES, + DEFAULT_CLUSTER_METRICS_SCRIPT, + GET_API_TYPE_DEBUG_TEXT, + ILLEGAL_PATH_PARAMETER_CHARACTERS, + NO_PATH_PARAMS_PLACEHOLDER_TEXT, + PATH_PARAMETER_ILLEGAL_CHARACTER_TEXT, + PATH_PARAMETERS_REQUIRED_TEXT, +} from './clusterMetricsMonitorConstants'; +import { + buildClusterMetricsRequest, + canExecuteClusterMetricsMonitor, + getApiPath, + getApiType, + getApiTypesRequiringPathParams, + getDefaultScript, + getExamplePathParams, + isInvalidApiPathParameter, + pathParamsContainIllegalCharacters, + validateApiPathParameter, +} from './clusterMetricsMonitorHelpers'; +import { FORMIK_INITIAL_VALUES } from '../../../containers/CreateMonitor/utils/constants'; +import { SEARCH_TYPE } from '../../../../../utils/constants'; +import { FORMIK_INITIAL_TRIGGER_VALUES } from '../../../../CreateTrigger/containers/CreateTrigger/utils/constants'; + +describe('clusterMetricsMonitorHelpers', () => { + describe('buildClusterMetricsRequest', () => { + test('when all fields are blank', () => { + const values = { + uri: { + api_type: '', + path: '', + path_params: '', + url: '', + }, + }; + expect(buildClusterMetricsRequest(values)).toEqual(FORMIK_INITIAL_VALUES.uri); + }); + + test('when all fields are undefined', () => { + const values = { + uri: { + api_type: undefined, + path: undefined, + path_params: undefined, + url: undefined, + }, + }; + expect(buildClusterMetricsRequest(values)).toEqual(FORMIK_INITIAL_VALUES.uri); + }); + + describe('when api_type is blank', () => { + test('path is provided', () => { + const path = API_TYPES[API_TYPES.CLUSTER_HEALTH.type].paths.withoutPathParams; + const values = { + uri: { + api_type: '', + path: path, + path_params: '', + url: '', + }, + }; + const expectedResult = { + uri: { + api_type: API_TYPES.CLUSTER_HEALTH.type, + path: path, + path_params: '', + url: `http://localhost:9200/${path}`, + }, + }; + expect(buildClusterMetricsRequest(values)).toEqual(expectedResult.uri); + }); + + test('path and path_params are provided', () => { + const path = API_TYPES[API_TYPES.CLUSTER_HEALTH.type].paths.withoutPathParams; + const pathParams = 'params'; + const values = { + uri: { + api_type: '', + path: path, + path_params: pathParams, + url: '', + }, + }; + const expectedResult = { + uri: { + api_type: API_TYPES.CLUSTER_HEALTH.type, + path: path, + path_params: pathParams, + url: `http://localhost:9200/${path}${pathParams}`, + }, + }; + expect(buildClusterMetricsRequest(values)).toEqual(expectedResult.uri); + }); + }); + }); + + describe('canExecuteClusterMetricsMonitor', () => { + test('with blank apiType and other fields defined', () => { + const testUri = { + ...FORMIK_INITIAL_VALUES.uri, + api_type: '', + path: '_cluster/health/', + path_params: 'params', + }; + expect(canExecuteClusterMetricsMonitor(testUri)).toEqual(false); + }); + test('with blank apiType and other fields empty', () => { + const testUri = { + ...FORMIK_INITIAL_VALUES.uri, + api_type: '', + }; + expect(canExecuteClusterMetricsMonitor(testUri)).toEqual(false); + }); + test('with undefined apiType and other fields defined', () => { + const testUri = { + ...FORMIK_INITIAL_VALUES.uri, + api_type: undefined, + path: '_cluster/health/', + path_params: 'params', + }; + expect(canExecuteClusterMetricsMonitor(testUri)).toEqual(false); + }); + test('with undefined apiType and other fields empty', () => { + const testUri = { + ...FORMIK_INITIAL_VALUES.uri, + api_type: undefined, + }; + expect(canExecuteClusterMetricsMonitor(testUri)).toEqual(false); + }); + test('with pathParams when apiType requires pathParams', () => { + const testUri = { + ...FORMIK_INITIAL_VALUES.uri, + api_type: 'CAT_SNAPSHOTS', + path_params: 'params', + }; + expect(canExecuteClusterMetricsMonitor(testUri)).toEqual(true); + }); + test('with pathParams containing illegal characters when apiType requires pathParams', () => { + const testUri = { + ...FORMIK_INITIAL_VALUES.uri, + api_type: 'CAT_SNAPSHOTS', + path_params: 'par?ams', + }; + expect(canExecuteClusterMetricsMonitor(testUri)).toEqual(false); + }); + test('with blank pathParams when apiType requires pathParams', () => { + const testUri = { + ...FORMIK_INITIAL_VALUES.uri, + api_type: 'CAT_SNAPSHOTS', + path_params: '', + }; + expect(canExecuteClusterMetricsMonitor(testUri)).toEqual(false); + }); + test('with undefined pathParams when apiType requires pathParams', () => { + const testUri = { + ...FORMIK_INITIAL_VALUES.uri, + api_type: 'CAT_SNAPSHOTS', + path_params: undefined, + }; + expect(canExecuteClusterMetricsMonitor(testUri)).toEqual(false); + }); + + test('with pathParams when apiType supports pathParams', () => { + const testUri = { + ...FORMIK_INITIAL_VALUES.uri, + api_type: 'CLUSTER_HEALTH', + path_params: 'params', + }; + expect(canExecuteClusterMetricsMonitor(testUri)).toEqual(true); + }); + test('with pathParams containing illegal characters when apiType supports pathParams', () => { + const testUri = { + ...FORMIK_INITIAL_VALUES.uri, + api_type: 'CLUSTER_HEALTH', + path_params: 'par?ams', + }; + expect(canExecuteClusterMetricsMonitor(testUri)).toEqual(false); + }); + test('with blank pathParams when apiType supports pathParams', () => { + const testUri = { + ...FORMIK_INITIAL_VALUES.uri, + api_type: 'CLUSTER_HEALTH', + path_params: '', + }; + expect(canExecuteClusterMetricsMonitor(testUri)).toEqual(true); + }); + test('with undefined pathParams when apiType supports pathParams', () => { + const testUri = { + ...FORMIK_INITIAL_VALUES.uri, + api_type: 'CLUSTER_HEALTH', + path_params: undefined, + }; + expect(canExecuteClusterMetricsMonitor(testUri)).toEqual(true); + }); + }); + + describe('pathParamsContainIllegalCharacters', () => { + test('with blank pathParams', () => { + const testPathParams = ''; + expect(pathParamsContainIllegalCharacters(testPathParams)).toEqual(false); + }); + test('with undefined pathParams', () => { + const testPathParams = undefined; + expect(pathParamsContainIllegalCharacters(testPathParams)).toEqual(false); + }); + test('with pathParams containing illegal characters', () => { + ILLEGAL_PATH_PARAMETER_CHARACTERS.forEach((char) => { + const testPathParams = `par${char}ams`; + expect(pathParamsContainIllegalCharacters(testPathParams)).toEqual(true); + }); + }); + test('with valid pathParams', () => { + const testPathParams = 'params'; + expect(pathParamsContainIllegalCharacters(testPathParams)).toEqual(false); + }); + }); + + describe('getApiPath', () => { + describe('when hasPathParams is FALSE', () => { + test('apiType is blank', () => { + const apiType = ''; + expect(getApiPath(false, apiType)).toEqual(FORMIK_INITIAL_VALUES.uri.path); + }); + test('apiType is undefined', () => { + const apiType = undefined; + expect(getApiPath(false, apiType)).toEqual(FORMIK_INITIAL_VALUES.uri.path); + }); + }); + + describe('when hasPathParams is TRUE', () => { + test('apiType is blank', () => { + const apiType = ''; + expect(getApiPath(true, apiType)).toEqual(FORMIK_INITIAL_VALUES.uri.path); + }); + test('apiType is undefined', () => { + const apiType = undefined; + expect(getApiPath(true, apiType)).toEqual(FORMIK_INITIAL_VALUES.uri.path); + }); + }); + + _.keys(API_TYPES).forEach((apiType) => { + test(`for ${apiType} when hasPathParams is FALSE`, () => { + const withoutPathParams = _.get(API_TYPES, `${apiType}.paths.withoutPathParams`, ''); + expect(getApiPath(false, apiType)).toEqual(withoutPathParams); + }); + test(`for ${apiType} when hasPathParams is TRUE`, () => { + const withPathParams = _.get( + API_TYPES, + `${apiType}.paths.withPathParams`, + _.get(API_TYPES, `${apiType}.paths.withoutPathParams`) + ); + expect(getApiPath(true, apiType)).toEqual(withPathParams); + }); + }); + }); + + describe('getApiTypesRequiringPathParams', () => { + const expectedApiTypes = [API_TYPES.CAT_SNAPSHOTS.type]; + test('returns expected apiTypes', () => { + const results = getApiTypesRequiringPathParams(); + expect(results.length).toEqual(expectedApiTypes.length); + results.forEach((entry) => { + const entryExpected = _.includes(expectedApiTypes, entry.value); + expect(entryExpected).toEqual(true); + }); + }); + }); + + describe('getDefaultScript', () => { + test('when searchType is undefined', () => { + const monitorValues = undefined; + expect(getDefaultScript(monitorValues)).toEqual(FORMIK_INITIAL_TRIGGER_VALUES.script); + }); + test('when searchType is clusterMetrics and api_type is undefined', () => { + const monitorValues = { + searchType: SEARCH_TYPE.CLUSTER_METRICS, + uri: undefined, + }; + expect(getDefaultScript(monitorValues)).toEqual(DEFAULT_CLUSTER_METRICS_SCRIPT); + }); + test('when searchType is clusterMetrics and api_type is empty', () => { + const monitorValues = { + searchType: SEARCH_TYPE.CLUSTER_METRICS, + uri: { + api_type: '', + }, + }; + expect(getDefaultScript(monitorValues)).toEqual(DEFAULT_CLUSTER_METRICS_SCRIPT); + }); + test('when searchType is clusterMetrics and api_type does not have a default condition', () => { + const monitorValues = { + searchType: SEARCH_TYPE.CLUSTER_METRICS, + uri: { + api_type: 'unknownApi', + }, + }; + expect(getDefaultScript(monitorValues)).toEqual(DEFAULT_CLUSTER_METRICS_SCRIPT); + }); + + _.keys(SEARCH_TYPE).forEach((searchType) => { + test(`when searchType is ${searchType}`, () => { + if (SEARCH_TYPE[searchType] !== SEARCH_TYPE.CLUSTER_METRICS) { + const monitorValues = { searchType: searchType }; + expect(getDefaultScript(monitorValues)).toEqual(FORMIK_INITIAL_TRIGGER_VALUES.script); + } + }); + }); + + _.keys(API_TYPES).forEach((apiType) => { + test(`when searchType is clusterMetrics and api_type is ${apiType}`, () => { + const monitorValues = { + searchType: SEARCH_TYPE.CLUSTER_METRICS, + uri: { + api_type: apiType, + }, + }; + const expectedOutput = _.get(API_TYPES, `${apiType}.defaultCondition`); + if (!_.isEmpty(expectedOutput)) + expect(getDefaultScript(monitorValues)).toEqual(expectedOutput); + }); + }); + }); + + describe('getExamplePathParams', () => { + test('when apiType has no example text', () => { + const apiType = 'apiTypeWithoutExampleText'; + expect(getExamplePathParams(apiType)).toEqual(NO_PATH_PARAMS_PLACEHOLDER_TEXT); + }); + test('when apiType is blank', () => { + const apiType = ''; + expect(getExamplePathParams(apiType)).toEqual(NO_PATH_PARAMS_PLACEHOLDER_TEXT); + }); + test('when apiType is undefined', () => { + const apiType = undefined; + expect(getExamplePathParams(apiType)).toEqual(NO_PATH_PARAMS_PLACEHOLDER_TEXT); + }); + _.keys(API_TYPES).forEach((apiType) => { + const withPathParams = _.get(API_TYPES, `${apiType}.paths.withPathParams`); + const supportsPathParams = !_.isEmpty(withPathParams); + test(`when apiType is ${apiType}`, () => { + const expectedResults = supportsPathParams + ? `e.g., ${API_TYPES[apiType].exampleText}` + : NO_PATH_PARAMS_PLACEHOLDER_TEXT; + expect(getExamplePathParams(apiType)).toEqual(expectedResults); + }); + }); + }); + + describe('getApiType', () => { + test(`when uri.path is blank`, () => { + const uri = { + ...FORMIK_INITIAL_VALUES.uri, + path: '', + }; + expect(getApiType(uri)).toEqual(''); + }); + test(`when uri.path is blank and has path params`, () => { + const uri = { + ...FORMIK_INITIAL_VALUES.uri, + path: '', + path_params: 'params', + }; + expect(getApiType(uri)).toEqual(''); + }); + + test(`when uri.path is undefined`, () => { + const uri = { + ...FORMIK_INITIAL_VALUES.uri, + path: undefined, + }; + expect(getApiType(uri)).toEqual(''); + }); + test(`when uri.path is undefined and has path params`, () => { + const uri = { + ...FORMIK_INITIAL_VALUES.uri, + path: undefined, + path_params: 'params', + }; + expect(getApiType(uri)).toEqual(''); + }); + + test(`when uri.path is unsupported`, () => { + const uri = { + ...FORMIK_INITIAL_VALUES.uri, + path: '_unsupported/api', + }; + console.debug = jest.fn(); + expect(getApiType(uri)).toEqual(''); + expect(console.debug).toHaveBeenCalledWith(GET_API_TYPE_DEBUG_TEXT); + }); + test(`when uri.path is unsupported and has path params`, () => { + const uri = { + ...FORMIK_INITIAL_VALUES.uri, + path: '_unsupported/api', + path_params: 'params', + }; + console.debug = jest.fn(); + expect(getApiType(uri)).toEqual(''); + expect(console.debug).toHaveBeenCalledWith(GET_API_TYPE_DEBUG_TEXT); + }); + + _.keys(API_TYPES).forEach((apiType) => { + const withPathParams = _.get(API_TYPES, `${apiType}.paths.withPathParams`); + if (!_.isEmpty(withPathParams)) { + test(`when apiType is ${apiType} and has path params`, () => { + const uri = { + ...FORMIK_INITIAL_VALUES.uri, + path: withPathParams, + path_params: 'params', + }; + expect(getApiType(uri)).toEqual(apiType); + }); + } + + const withoutPathParams = _.get(API_TYPES, `${apiType}.paths.withoutPathParams`); + if (!_.isEmpty(withoutPathParams)) { + test(`when apiType is ${apiType} and has no path params`, () => { + const uri = { + ...FORMIK_INITIAL_VALUES.uri, + path: withoutPathParams, + }; + expect(getApiType(uri)).toEqual(apiType); + }); + } + }); + }); + + describe('isInvalidApiPathParameter', () => { + describe('when hidePathParams is TRUE', () => { + const hidePathParams = true; + describe('pathParams fieldTouched is TRUE', () => { + const field = _.set({}, 'touched.uri.path_params', true); + describe('pathParams are required', () => { + const requirePathParams = true; + test('pathParams are blank', () => { + const pathParams = ''; + expect( + isInvalidApiPathParameter(field, hidePathParams, pathParams, requirePathParams) + ).toEqual(false); + }); + test('pathParams are undefined', () => { + const pathParams = undefined; + expect( + isInvalidApiPathParameter(field, hidePathParams, pathParams, requirePathParams) + ).toEqual(false); + }); + test('pathParams contain illegal character', () => { + ILLEGAL_PATH_PARAMETER_CHARACTERS.forEach((char) => { + const pathParams = `par${char}ams`; + expect( + isInvalidApiPathParameter(field, hidePathParams, pathParams, requirePathParams) + ).toEqual(false); + }); + }); + test('pathParams are valid', () => { + const pathParams = 'params'; + expect( + isInvalidApiPathParameter(field, hidePathParams, pathParams, requirePathParams) + ).toEqual(false); + }); + }); + describe('pathParams are not required', () => { + const requirePathParams = false; + test('pathParams are blank', () => { + const pathParams = ''; + expect( + isInvalidApiPathParameter(field, hidePathParams, pathParams, requirePathParams) + ).toEqual(false); + }); + test('pathParams are undefined', () => { + const pathParams = undefined; + expect( + isInvalidApiPathParameter(field, hidePathParams, pathParams, requirePathParams) + ).toEqual(false); + }); + test('pathParams contain illegal character', () => { + ILLEGAL_PATH_PARAMETER_CHARACTERS.forEach((char) => { + const pathParams = `par${char}ams`; + expect( + isInvalidApiPathParameter(field, hidePathParams, pathParams, requirePathParams) + ).toEqual(false); + }); + }); + test('pathParams are valid', () => { + const pathParams = 'params'; + expect( + isInvalidApiPathParameter(field, hidePathParams, pathParams, requirePathParams) + ).toEqual(false); + }); + }); + }); + describe('pathParams fieldTouched is false', () => { + const field = _.set({}, 'touched.uri.path_params', false); + describe('pathParams are required', () => { + const requirePathParams = true; + test('pathParams are blank', () => { + const pathParams = ''; + expect( + isInvalidApiPathParameter(field, hidePathParams, pathParams, requirePathParams) + ).toEqual(false); + }); + test('pathParams are undefined', () => { + const pathParams = undefined; + expect( + isInvalidApiPathParameter(field, hidePathParams, pathParams, requirePathParams) + ).toEqual(false); + }); + test('pathParams contain illegal character', () => { + ILLEGAL_PATH_PARAMETER_CHARACTERS.forEach((char) => { + const pathParams = `par${char}ams`; + expect( + isInvalidApiPathParameter(field, hidePathParams, pathParams, requirePathParams) + ).toEqual(false); + }); + }); + test('pathParams are valid', () => { + const pathParams = 'params'; + expect( + isInvalidApiPathParameter(field, hidePathParams, pathParams, requirePathParams) + ).toEqual(false); + }); + }); + describe('pathParams are not required', () => { + const requirePathParams = false; + test('pathParams are blank', () => { + const pathParams = ''; + expect( + isInvalidApiPathParameter(field, hidePathParams, pathParams, requirePathParams) + ).toEqual(false); + }); + test('pathParams are undefined', () => { + const pathParams = undefined; + expect( + isInvalidApiPathParameter(field, hidePathParams, pathParams, requirePathParams) + ).toEqual(false); + }); + test('pathParams contain illegal character', () => { + ILLEGAL_PATH_PARAMETER_CHARACTERS.forEach((char) => { + const pathParams = `par${char}ams`; + expect( + isInvalidApiPathParameter(field, hidePathParams, pathParams, requirePathParams) + ).toEqual(false); + }); + }); + test('pathParams are valid', () => { + const pathParams = 'params'; + expect( + isInvalidApiPathParameter(field, hidePathParams, pathParams, requirePathParams) + ).toEqual(false); + }); + }); + }); + }); + describe('when hidePathParams is FALSE', () => { + const hidePathParams = false; + describe('pathParams fieldTouched is TRUE', () => { + const field = _.set({}, 'touched.uri.path_params', true); + describe('pathParams are required', () => { + const requirePathParams = true; + test('pathParams are blank', () => { + const pathParams = ''; + expect( + isInvalidApiPathParameter(field, hidePathParams, pathParams, requirePathParams) + ).toEqual(true); + }); + test('pathParams are undefined', () => { + const pathParams = undefined; + expect( + isInvalidApiPathParameter(field, hidePathParams, pathParams, requirePathParams) + ).toEqual(true); + }); + test('pathParams contain illegal character', () => { + ILLEGAL_PATH_PARAMETER_CHARACTERS.forEach((char) => { + const pathParams = `par${char}ams`; + expect( + isInvalidApiPathParameter(field, hidePathParams, pathParams, requirePathParams) + ).toEqual(true); + }); + }); + test('pathParams are valid', () => { + const pathParams = 'params'; + expect( + isInvalidApiPathParameter(field, hidePathParams, pathParams, requirePathParams) + ).toEqual(false); + }); + }); + describe('pathParams are not required', () => { + const requirePathParams = false; + test('pathParams are blank', () => { + const pathParams = ''; + expect( + isInvalidApiPathParameter(field, hidePathParams, pathParams, requirePathParams) + ).toEqual(false); + }); + test('pathParams are undefined', () => { + const pathParams = undefined; + expect( + isInvalidApiPathParameter(field, hidePathParams, pathParams, requirePathParams) + ).toEqual(false); + }); + test('pathParams contain illegal character', () => { + ILLEGAL_PATH_PARAMETER_CHARACTERS.forEach((char) => { + const pathParams = `par${char}ams`; + expect( + isInvalidApiPathParameter(field, hidePathParams, pathParams, requirePathParams) + ).toEqual(true); + }); + }); + test('pathParams are valid', () => { + const pathParams = 'params'; + expect( + isInvalidApiPathParameter(field, hidePathParams, pathParams, requirePathParams) + ).toEqual(false); + }); + }); + }); + describe('pathParams fieldTouched is false', () => { + const field = _.set({}, 'touched.uri.path_params', false); + describe('pathParams are required', () => { + const requirePathParams = true; + test('pathParams are blank', () => { + const pathParams = ''; + expect( + isInvalidApiPathParameter(field, hidePathParams, pathParams, requirePathParams) + ).toEqual(false); + }); + test('pathParams are undefined', () => { + const pathParams = undefined; + expect( + isInvalidApiPathParameter(field, hidePathParams, pathParams, requirePathParams) + ).toEqual(false); + }); + test('pathParams contain illegal character', () => { + ILLEGAL_PATH_PARAMETER_CHARACTERS.forEach((char) => { + const pathParams = `par${char}ams`; + expect( + isInvalidApiPathParameter(field, hidePathParams, pathParams, requirePathParams) + ).toEqual(false); + }); + }); + test('pathParams are valid', () => { + const pathParams = 'params'; + expect( + isInvalidApiPathParameter(field, hidePathParams, pathParams, requirePathParams) + ).toEqual(false); + }); + }); + describe('pathParams are not required', () => { + const requirePathParams = false; + test('pathParams are blank', () => { + const pathParams = ''; + expect( + isInvalidApiPathParameter(field, hidePathParams, pathParams, requirePathParams) + ).toEqual(false); + }); + test('pathParams are undefined', () => { + const pathParams = undefined; + expect( + isInvalidApiPathParameter(field, hidePathParams, pathParams, requirePathParams) + ).toEqual(false); + }); + test('pathParams contain illegal character', () => { + ILLEGAL_PATH_PARAMETER_CHARACTERS.forEach((char) => { + const pathParams = `par${char}ams`; + expect( + isInvalidApiPathParameter(field, hidePathParams, pathParams, requirePathParams) + ).toEqual(false); + }); + }); + test('pathParams are valid', () => { + const pathParams = 'params'; + expect( + isInvalidApiPathParameter(field, hidePathParams, pathParams, requirePathParams) + ).toEqual(false); + }); + }); + }); + }); + }); + + describe('validateApiPathParameter', () => { + describe('when hidePathParams is TRUE', () => { + const hidePathParams = true; + describe('pathParams fieldTouched is TRUE', () => { + const field = _.set({}, 'touched.uri.path_params', true); + describe('pathParams are required', () => { + const requirePathParams = true; + test('pathParams are blank', () => { + const pathParams = ''; + expect( + validateApiPathParameter(field, hidePathParams, pathParams, requirePathParams) + ).toEqual(NO_PATH_PARAMS_PLACEHOLDER_TEXT); + }); + test('pathParams are undefined', () => { + const pathParams = undefined; + expect( + validateApiPathParameter(field, hidePathParams, pathParams, requirePathParams) + ).toEqual(NO_PATH_PARAMS_PLACEHOLDER_TEXT); + }); + test('pathParams contain illegal character', () => { + ILLEGAL_PATH_PARAMETER_CHARACTERS.forEach((char) => { + const pathParams = `par${char}ams`; + expect( + validateApiPathParameter(field, hidePathParams, pathParams, requirePathParams) + ).toEqual(NO_PATH_PARAMS_PLACEHOLDER_TEXT); + }); + }); + test('pathParams are valid', () => { + const pathParams = 'params'; + expect( + validateApiPathParameter(field, hidePathParams, pathParams, requirePathParams) + ).toEqual(NO_PATH_PARAMS_PLACEHOLDER_TEXT); + }); + }); + describe('pathParams are not required', () => { + const requirePathParams = false; + test('pathParams are blank', () => { + const pathParams = ''; + expect( + validateApiPathParameter(field, hidePathParams, pathParams, requirePathParams) + ).toEqual(NO_PATH_PARAMS_PLACEHOLDER_TEXT); + }); + test('pathParams are undefined', () => { + const pathParams = undefined; + expect( + validateApiPathParameter(field, hidePathParams, pathParams, requirePathParams) + ).toEqual(NO_PATH_PARAMS_PLACEHOLDER_TEXT); + }); + test('pathParams contain illegal character', () => { + ILLEGAL_PATH_PARAMETER_CHARACTERS.forEach((char) => { + const pathParams = `par${char}ams`; + expect( + validateApiPathParameter(field, hidePathParams, pathParams, requirePathParams) + ).toEqual(NO_PATH_PARAMS_PLACEHOLDER_TEXT); + }); + }); + test('pathParams are valid', () => { + const pathParams = 'params'; + expect( + validateApiPathParameter(field, hidePathParams, pathParams, requirePathParams) + ).toEqual(NO_PATH_PARAMS_PLACEHOLDER_TEXT); + }); + }); + }); + describe('pathParams fieldTouched is false', () => { + const field = _.set({}, 'touched.uri.path_params', false); + describe('pathParams are required', () => { + const requirePathParams = true; + test('pathParams are blank', () => { + const pathParams = ''; + expect( + validateApiPathParameter(field, hidePathParams, pathParams, requirePathParams) + ).toEqual(NO_PATH_PARAMS_PLACEHOLDER_TEXT); + }); + test('pathParams are undefined', () => { + const pathParams = undefined; + expect( + validateApiPathParameter(field, hidePathParams, pathParams, requirePathParams) + ).toEqual(NO_PATH_PARAMS_PLACEHOLDER_TEXT); + }); + test('pathParams contain illegal character', () => { + ILLEGAL_PATH_PARAMETER_CHARACTERS.forEach((char) => { + const pathParams = `par${char}ams`; + expect( + validateApiPathParameter(field, hidePathParams, pathParams, requirePathParams) + ).toEqual(NO_PATH_PARAMS_PLACEHOLDER_TEXT); + }); + }); + test('pathParams are valid', () => { + const pathParams = 'params'; + expect( + validateApiPathParameter(field, hidePathParams, pathParams, requirePathParams) + ).toEqual(NO_PATH_PARAMS_PLACEHOLDER_TEXT); + }); + }); + describe('pathParams are not required', () => { + const requirePathParams = false; + test('pathParams are blank', () => { + const pathParams = ''; + expect( + validateApiPathParameter(field, hidePathParams, pathParams, requirePathParams) + ).toEqual(NO_PATH_PARAMS_PLACEHOLDER_TEXT); + }); + test('pathParams are undefined', () => { + const pathParams = undefined; + expect( + validateApiPathParameter(field, hidePathParams, pathParams, requirePathParams) + ).toEqual(NO_PATH_PARAMS_PLACEHOLDER_TEXT); + }); + test('pathParams contain illegal character', () => { + ILLEGAL_PATH_PARAMETER_CHARACTERS.forEach((char) => { + const pathParams = `par${char}ams`; + expect( + validateApiPathParameter(field, hidePathParams, pathParams, requirePathParams) + ).toEqual(NO_PATH_PARAMS_PLACEHOLDER_TEXT); + }); + }); + test('pathParams are valid', () => { + const pathParams = 'params'; + expect( + validateApiPathParameter(field, hidePathParams, pathParams, requirePathParams) + ).toEqual(NO_PATH_PARAMS_PLACEHOLDER_TEXT); + }); + }); + }); + }); + describe('when hidePathParams is FALSE', () => { + const hidePathParams = false; + describe('pathParams fieldTouched is TRUE', () => { + const field = _.set({}, 'touched.uri.path_params', true); + describe('pathParams are required', () => { + const requirePathParams = true; + test('pathParams are blank', () => { + const pathParams = ''; + expect( + validateApiPathParameter(field, hidePathParams, pathParams, requirePathParams) + ).toEqual(PATH_PARAMETERS_REQUIRED_TEXT); + }); + test('pathParams are undefined', () => { + const pathParams = undefined; + expect( + validateApiPathParameter(field, hidePathParams, pathParams, requirePathParams) + ).toEqual(PATH_PARAMETERS_REQUIRED_TEXT); + }); + test('pathParams contain illegal character', () => { + ILLEGAL_PATH_PARAMETER_CHARACTERS.forEach((char) => { + const pathParams = `par${char}ams`; + expect( + validateApiPathParameter(field, hidePathParams, pathParams, requirePathParams) + ).toEqual(PATH_PARAMETER_ILLEGAL_CHARACTER_TEXT); + }); + }); + test('pathParams are valid', () => { + const pathParams = 'params'; + expect( + validateApiPathParameter(field, hidePathParams, pathParams, requirePathParams) + ).toEqual(undefined); + }); + }); + describe('pathParams are not required', () => { + const requirePathParams = false; + test('pathParams are blank', () => { + const pathParams = ''; + expect( + validateApiPathParameter(field, hidePathParams, pathParams, requirePathParams) + ).toEqual(undefined); + }); + test('pathParams are undefined', () => { + const pathParams = undefined; + expect( + validateApiPathParameter(field, hidePathParams, pathParams, requirePathParams) + ).toEqual(undefined); + }); + test('pathParams contain illegal character', () => { + ILLEGAL_PATH_PARAMETER_CHARACTERS.forEach((char) => { + const pathParams = `par${char}ams`; + expect( + validateApiPathParameter(field, hidePathParams, pathParams, requirePathParams) + ).toEqual(PATH_PARAMETER_ILLEGAL_CHARACTER_TEXT); + }); + }); + test('pathParams are valid', () => { + const pathParams = 'params'; + expect( + validateApiPathParameter(field, hidePathParams, pathParams, requirePathParams) + ).toEqual(undefined); + }); + }); + }); + describe('pathParams fieldTouched is false', () => { + const field = _.set({}, 'touched.uri.path_params', false); + describe('pathParams are required', () => { + const requirePathParams = true; + test('pathParams are blank', () => { + const pathParams = ''; + expect( + validateApiPathParameter(field, hidePathParams, pathParams, requirePathParams) + ).toEqual(undefined); + }); + test('pathParams are undefined', () => { + const pathParams = undefined; + expect( + validateApiPathParameter(field, hidePathParams, pathParams, requirePathParams) + ).toEqual(undefined); + }); + test('pathParams contain illegal character', () => { + ILLEGAL_PATH_PARAMETER_CHARACTERS.forEach((char) => { + const pathParams = `par${char}ams`; + expect( + validateApiPathParameter(field, hidePathParams, pathParams, requirePathParams) + ).toEqual(undefined); + }); + }); + test('pathParams are valid', () => { + const pathParams = 'params'; + expect( + validateApiPathParameter(field, hidePathParams, pathParams, requirePathParams) + ).toEqual(undefined); + }); + }); + describe('pathParams are not required', () => { + const requirePathParams = false; + test('pathParams are blank', () => { + const pathParams = ''; + expect( + validateApiPathParameter(field, hidePathParams, pathParams, requirePathParams) + ).toEqual(undefined); + }); + test('pathParams are undefined', () => { + const pathParams = undefined; + expect( + validateApiPathParameter(field, hidePathParams, pathParams, requirePathParams) + ).toEqual(undefined); + }); + test('pathParams contain illegal character', () => { + ILLEGAL_PATH_PARAMETER_CHARACTERS.forEach((char) => { + const pathParams = `par${char}ams`; + expect( + validateApiPathParameter(field, hidePathParams, pathParams, requirePathParams) + ).toEqual(undefined); + }); + }); + test('pathParams are valid', () => { + const pathParams = 'params'; + expect( + validateApiPathParameter(field, hidePathParams, pathParams, requirePathParams) + ).toEqual(undefined); + }); + }); + }); + }); + }); +}); diff --git a/public/pages/CreateMonitor/components/MonitorDefinitionCard/MonitorDefinitionCard.js b/public/pages/CreateMonitor/components/MonitorDefinitionCard/MonitorDefinitionCard.js index 7f686ff56..bbeebfed2 100644 --- a/public/pages/CreateMonitor/components/MonitorDefinitionCard/MonitorDefinitionCard.js +++ b/public/pages/CreateMonitor/components/MonitorDefinitionCard/MonitorDefinitionCard.js @@ -4,15 +4,12 @@ */ import React from 'react'; -import _ from 'lodash'; import { EuiFlexGroup, EuiFlexItem, EuiLink, EuiText } from '@elastic/eui'; import FormikCheckableCard from '../../../../components/FormControls/FormikCheckableCard/FormikCheckableCard'; import { OS_AD_PLUGIN, MONITOR_TYPE, SEARCH_TYPE } from '../../../../utils/constants'; -import { MONITOR_TYPE_CARD_WIDTH } from '../MonitorType/MonitorType'; import { URL } from '../../../../../utils/constants'; -const MONITOR_DEFINITION_CARD_WIDTH = - (MONITOR_TYPE_CARD_WIDTH * _.keys(MONITOR_TYPE).length) / _.keys(SEARCH_TYPE).length; +const MONITOR_DEFINITION_CARD_WIDTH = '275'; const onChangeDefinition = (e, form) => { const type = e.target.value; diff --git a/public/pages/CreateMonitor/components/MonitorDefinitionCard/__snapshots__/MonitorDefinitionCard.test.js.snap b/public/pages/CreateMonitor/components/MonitorDefinitionCard/__snapshots__/MonitorDefinitionCard.test.js.snap index 906c9d308..ef4e5e1f9 100644 --- a/public/pages/CreateMonitor/components/MonitorDefinitionCard/__snapshots__/MonitorDefinitionCard.test.js.snap +++ b/public/pages/CreateMonitor/components/MonitorDefinitionCard/__snapshots__/MonitorDefinitionCard.test.js.snap @@ -36,7 +36,7 @@ exports[`MonitorDefinitionCard renders without AD plugin 1`] = ` >
      ); +const clusterMetricsDescription = ( + + Per cluster metrics monitors allow you to alert based on responses to common REST APIs. + +); + const MonitorType = ({ values }) => ( @@ -43,7 +49,6 @@ const MonitorType = ({ values }) => ( formRow rowProps={{ label: 'Monitor type', - style: { width: `${MONITOR_TYPE_CARD_WIDTH}px` }, }} inputProps={{ id: 'queryLevelMonitorRadioCard', @@ -62,7 +67,6 @@ const MonitorType = ({ values }) => ( ( }} /> + + { + form.setFieldValue('searchType', SEARCH_TYPE.CLUSTER_METRICS); + onChangeDefinition(e, form); + }, + children: clusterMetricsDescription, + 'data-test-subj': 'clusterMetricsMonitorRadioCard', + }} + /> + ); diff --git a/public/pages/CreateMonitor/components/MonitorType/__snapshots__/MonitorType.test.js.snap b/public/pages/CreateMonitor/components/MonitorType/__snapshots__/MonitorType.test.js.snap index 97be8378c..290af85b3 100644 --- a/public/pages/CreateMonitor/components/MonitorType/__snapshots__/MonitorType.test.js.snap +++ b/public/pages/CreateMonitor/components/MonitorType/__snapshots__/MonitorType.test.js.snap @@ -10,7 +10,6 @@ exports[`MonitorType renders 1`] = `
      +
      +
      +
      +
      +
      +
      +
      + +
      +
      +
      + +
      +
      +
      +
      +
      +
      + Per cluster metrics monitors allow you to alert based on responses to common REST APIs. +
      +
      +
      +
      +
      +
      +
      +
      `; diff --git a/public/pages/CreateMonitor/containers/AnomalyDetectors/__tests__/__snapshots__/AnomalyDetector.test.js.snap b/public/pages/CreateMonitor/containers/AnomalyDetectors/__tests__/__snapshots__/AnomalyDetector.test.js.snap index 741d3566c..83fd74f79 100644 --- a/public/pages/CreateMonitor/containers/AnomalyDetectors/__tests__/__snapshots__/AnomalyDetector.test.js.snap +++ b/public/pages/CreateMonitor/containers/AnomalyDetectors/__tests__/__snapshots__/AnomalyDetector.test.js.snap @@ -43,6 +43,12 @@ exports[`AnomalyDetectors renders 1`] = ` "searchType": "graph", "timeField": "", "timezone": Array [], + "uri": Object { + "api_type": "", + "path": "", + "path_params": "", + "url": "", + }, "weekly": Object { "fri": false, "mon": false, @@ -105,6 +111,12 @@ exports[`AnomalyDetectors renders 1`] = ` "searchType": "graph", "timeField": "", "timezone": Array [], + "uri": Object { + "api_type": "", + "path": "", + "path_params": "", + "url": "", + }, "weekly": Object { "fri": false, "mon": false, @@ -228,6 +240,12 @@ exports[`AnomalyDetectors renders 1`] = ` "searchType": "graph", "timeField": "", "timezone": Array [], + "uri": Object { + "api_type": "", + "path": "", + "path_params": "", + "url": "", + }, "weekly": Object { "fri": false, "mon": false, @@ -309,6 +327,12 @@ exports[`AnomalyDetectors renders 1`] = ` "searchType": "graph", "timeField": "", "timezone": Array [], + "uri": Object { + "api_type": "", + "path": "", + "path_params": "", + "url": "", + }, "weekly": Object { "fri": false, "mon": false, @@ -438,6 +462,12 @@ exports[`AnomalyDetectors renders 1`] = ` "searchType": "graph", "timeField": "", "timezone": Array [], + "uri": Object { + "api_type": "", + "path": "", + "path_params": "", + "url": "", + }, "weekly": Object { "fri": false, "mon": false, @@ -519,6 +549,12 @@ exports[`AnomalyDetectors renders 1`] = ` "searchType": "graph", "timeField": "", "timezone": Array [], + "uri": Object { + "api_type": "", + "path": "", + "path_params": "", + "url": "", + }, "weekly": Object { "fri": false, "mon": false, diff --git a/public/pages/CreateMonitor/containers/CreateMonitor/CreateMonitor.js b/public/pages/CreateMonitor/containers/CreateMonitor/CreateMonitor.js index 63e4a3050..70921780f 100644 --- a/public/pages/CreateMonitor/containers/CreateMonitor/CreateMonitor.js +++ b/public/pages/CreateMonitor/containers/CreateMonitor/CreateMonitor.js @@ -152,6 +152,7 @@ export default class CreateMonitor extends Component { let triggerType; switch (monitor_type) { case MONITOR_TYPE.QUERY_LEVEL: + case MONITOR_TYPE.CLUSTER_METRICS: triggerType = TRIGGER_TYPE.QUERY_LEVEL; break; case MONITOR_TYPE.BUCKET_LEVEL: diff --git a/public/pages/CreateMonitor/containers/CreateMonitor/__snapshots__/CreateMonitor.test.js.snap b/public/pages/CreateMonitor/containers/CreateMonitor/__snapshots__/CreateMonitor.test.js.snap index 2edf2b131..f62889ba0 100644 --- a/public/pages/CreateMonitor/containers/CreateMonitor/__snapshots__/CreateMonitor.test.js.snap +++ b/public/pages/CreateMonitor/containers/CreateMonitor/__snapshots__/CreateMonitor.test.js.snap @@ -51,6 +51,12 @@ exports[`CreateMonitor renders 1`] = ` "searchType": "graph", "timeField": "", "timezone": Array [], + "uri": Object { + "api_type": "", + "path": "", + "path_params": "", + "url": "", + }, "weekly": Object { "fri": false, "mon": false, diff --git a/public/pages/CreateMonitor/containers/CreateMonitor/utils/__snapshots__/formikToMonitor.test.js.snap b/public/pages/CreateMonitor/containers/CreateMonitor/utils/__snapshots__/formikToMonitor.test.js.snap index a898d4d74..250e4a6da 100644 --- a/public/pages/CreateMonitor/containers/CreateMonitor/utils/__snapshots__/formikToMonitor.test.js.snap +++ b/public/pages/CreateMonitor/containers/CreateMonitor/utils/__snapshots__/formikToMonitor.test.js.snap @@ -45,6 +45,28 @@ Object { } `; +exports[`formikToClusterMetricsUri can build a ClusterMetricsMonitor request with path params 1`] = ` +Object { + "uri": Object { + "api_type": "", + "path": "params", + "path_params": "", + "url": "", + }, +} +`; + +exports[`formikToClusterMetricsUri can build a ClusterMetricsMonitor request without path params 1`] = ` +Object { + "uri": Object { + "api_type": "CLUSTER_HEALTH", + "path": "_cluster/health", + "path_params": "", + "url": "http://localhost:9200/_cluster/health", + }, +} +`; + exports[`formikToDetector can build detector 1`] = ` Object { "anomaly_detector": Object { @@ -91,6 +113,17 @@ Array [ ] `; +exports[`formikToInputs can call formikToClusterMetricsUri 1`] = ` +Object { + "uri": Object { + "api_type": "", + "path": "", + "path_params": "", + "url": "", + }, +} +`; + exports[`formikToMonitor can build monitor 1`] = ` Object { "enabled": false, diff --git a/public/pages/CreateMonitor/containers/CreateMonitor/utils/constants.js b/public/pages/CreateMonitor/containers/CreateMonitor/utils/constants.js index 1536f76c0..c16b6ea42 100644 --- a/public/pages/CreateMonitor/containers/CreateMonitor/utils/constants.js +++ b/public/pages/CreateMonitor/containers/CreateMonitor/utils/constants.js @@ -25,6 +25,12 @@ export const FORMIK_INITIAL_VALUES = { /* DEFINE MONITOR */ monitor_type: MONITOR_TYPE.QUERY_LEVEL, searchType: 'graph', + uri: { + api_type: '', + path: '', + path_params: '', + url: '', + }, index: [], timeField: '', query: MATCH_ALL_QUERY, diff --git a/public/pages/CreateMonitor/containers/CreateMonitor/utils/formikToMonitor.js b/public/pages/CreateMonitor/containers/CreateMonitor/utils/formikToMonitor.js index 27a7153b9..0c9fc50a5 100644 --- a/public/pages/CreateMonitor/containers/CreateMonitor/utils/formikToMonitor.js +++ b/public/pages/CreateMonitor/containers/CreateMonitor/utils/formikToMonitor.js @@ -8,6 +8,11 @@ import moment from 'moment-timezone'; import { BUCKET_COUNT, DEFAULT_COMPOSITE_AGG_SIZE, FORMIK_INITIAL_VALUES } from './constants'; import { MONITOR_TYPE, SEARCH_TYPE } from '../../../../../utils/constants'; import { OPERATORS_QUERY_MAP } from './whereFilters'; +import { API_TYPES } from '../../../components/ClusterMetricsMonitor/utils/clusterMetricsMonitorConstants'; +import { + getApiPath, + getApiType, +} from '../../../components/ClusterMetricsMonitor/utils/clusterMetricsMonitorHelpers'; export function formikToMonitor(values) { const uiSchedule = formikToUiSchedule(values); @@ -31,6 +36,8 @@ export function formikToMonitor(values) { export function formikToInputs(values) { switch (values.searchType) { + case SEARCH_TYPE.CLUSTER_METRICS: + return formikToClusterMetricsInput(values); default: return formikToSearch(values); } @@ -87,6 +94,29 @@ export function formikToAdQuery(values) { }; } +export function formikToClusterMetricsInput(values) { + let apiType = _.get(values, 'uri.api_type', FORMIK_INITIAL_VALUES.uri.api_type); + if (_.isEmpty(apiType)) apiType = getApiType(_.get(values, 'uri')); + let pathParams = _.get(values, 'uri.path_params', FORMIK_INITIAL_VALUES.uri.path_params); + pathParams = _.trim(pathParams); + const hasPathParams = !_.isEmpty(pathParams); + if (hasPathParams) _.concat(pathParams, _.get(API_TYPES, `${apiType}.appendText`, '')); + let path = _.get(values, 'uri.path', FORMIK_INITIAL_VALUES.uri.path); + if (_.isEmpty(path)) path = getApiPath(hasPathParams, apiType); + const canConstructUrl = !_.isEmpty(apiType); + const url = canConstructUrl + ? `http://localhost:9200/${path}${pathParams}` + : FORMIK_INITIAL_VALUES.uri.url; + return { + uri: { + api_type: apiType, + path: path, + path_params: pathParams, + url: url, + }, + }; +} + export function formikToAd(values) { return { anomaly_detector: { diff --git a/public/pages/CreateMonitor/containers/CreateMonitor/utils/formikToMonitor.test.js b/public/pages/CreateMonitor/containers/CreateMonitor/utils/formikToMonitor.test.js index e598bf555..4edd969cc 100644 --- a/public/pages/CreateMonitor/containers/CreateMonitor/utils/formikToMonitor.test.js +++ b/public/pages/CreateMonitor/containers/CreateMonitor/utils/formikToMonitor.test.js @@ -19,6 +19,7 @@ import { formikToWhereClause, formikToAd, formikToInputs, + formikToClusterMetricsInput, } from './formikToMonitor'; import { FORMIK_INITIAL_VALUES } from './constants'; @@ -42,6 +43,14 @@ describe('formikToMonitor', () => { }); }); +describe('formikToInputs', () => { + const formikValues = _.cloneDeep(FORMIK_INITIAL_VALUES); + test('can call formikToClusterMetricsUri', () => { + formikValues.searchType = 'clusterMetrics'; + expect(formikToInputs(formikValues)).toMatchSnapshot(); + }); +}); + describe('formikToDetector', () => { const formikValues = _.cloneDeep(FORMIK_INITIAL_VALUES); formikValues.detectorId = 'temp_detector'; @@ -50,6 +59,20 @@ describe('formikToDetector', () => { }); }); +describe('formikToClusterMetricsUri', () => { + test('can build a ClusterMetricsMonitor request with path params', () => { + const formikValues = _.cloneDeep(FORMIK_INITIAL_VALUES); + formikValues.uri.path = '_cluster/health'; + formikValues.uri.path = 'params'; + expect(formikToClusterMetricsInput(formikValues)).toMatchSnapshot(); + }); + test('can build a ClusterMetricsMonitor request without path params', () => { + const formikValues = _.cloneDeep(FORMIK_INITIAL_VALUES); + formikValues.uri.path = '_cluster/health'; + expect(formikToClusterMetricsInput(formikValues)).toMatchSnapshot(); + }); +}); + describe('formikToUiSearch', () => { const formikValues = _.cloneDeep(FORMIK_INITIAL_VALUES); formikValues.fieldName = [{ label: 'bytes' }]; diff --git a/public/pages/CreateMonitor/containers/CreateMonitor/utils/monitorToFormik.js b/public/pages/CreateMonitor/containers/CreateMonitor/utils/monitorToFormik.js index 7fe188e56..c97adf1fe 100644 --- a/public/pages/CreateMonitor/containers/CreateMonitor/utils/monitorToFormik.js +++ b/public/pages/CreateMonitor/containers/CreateMonitor/utils/monitorToFormik.js @@ -21,9 +21,10 @@ export default function monitorToFormik(monitor) { } = monitor; // Default searchType to query, because if there is no ui_metadata or search then it was created through API or overwritten by API // In that case we don't want to guess on the UI what selections a user made, so we will default to just showing the extraction query - const { searchType = 'query', fieldName } = search; + let { searchType = 'query', fieldName } = search; + if (_.isEmpty(search) && 'uri' in inputs[0]) searchType = SEARCH_TYPE.CLUSTER_METRICS; const isAD = searchType === SEARCH_TYPE.AD; - + const isClusterMetrics = searchType === SEARCH_TYPE.CLUSTER_METRICS; return { /* INITIALIZE WITH DEFAULTS */ ...formikValues, @@ -44,8 +45,10 @@ export default function monitorToFormik(monitor) { timezone: timezone ? [{ label: timezone }] : [], detectorId: isAD ? _.get(inputs, INPUTS_DETECTOR_ID) : undefined, - index: inputs[0].search.indices.map((index) => ({ label: index })), - adResultIndex: isAD ? _.get(inputs, '0.search.indices.0') : undefined, - query: JSON.stringify(inputs[0].search.query, null, 4), + index: !isClusterMetrics + ? inputs[0].search.indices.map((index) => ({ label: index })) + : FORMIK_INITIAL_VALUES.index, + query: !isClusterMetrics ? JSON.stringify(inputs[0].search.query, null, 4) : undefined, + uri: isClusterMetrics ? inputs[0].uri : undefined, }; } diff --git a/public/pages/CreateMonitor/containers/CreateMonitor/utils/monitorToFormik.test.js b/public/pages/CreateMonitor/containers/CreateMonitor/utils/monitorToFormik.test.js index 2faf440f6..d26f84283 100644 --- a/public/pages/CreateMonitor/containers/CreateMonitor/utils/monitorToFormik.test.js +++ b/public/pages/CreateMonitor/containers/CreateMonitor/utils/monitorToFormik.test.js @@ -108,6 +108,7 @@ describe('monitorToFormik', () => { const formikValues = monitorToFormik(localExampleMonitor); expect(formikValues.cronExpression).toBe(FORMIK_INITIAL_VALUES.cronExpression); }); + test('can build AD monitor', () => { const adMonitor = _.cloneDeep(exampleMonitor); adMonitor.ui_metadata.search.searchType = 'ad'; @@ -151,4 +152,35 @@ describe('monitorToFormik', () => { expect(formikValues.query).toContain('zIqG0nABwoJjo1UZKHnL'); }); }); + + describe('can build ClusterMetricsMonitor', () => { + test('with path params', () => { + const clusterMetricsMonitor = _.cloneDeep(exampleMonitor); + clusterMetricsMonitor.ui_metadata.search.searchType = 'clusterMetrics'; + clusterMetricsMonitor.inputs = [ + { + uri: { + path: '/_cluster/health', + path_params: 'params', + }, + }, + ]; + const formikValues = monitorToFormik(clusterMetricsMonitor); + expect(formikValues.uri.path).toBe('/_cluster/health'); + expect(formikValues.uri.path_params).toBe('params'); + }); + test('without path params', () => { + const clusterMetricsMonitor = _.cloneDeep(exampleMonitor); + clusterMetricsMonitor.ui_metadata.search.searchType = 'clusterMetrics'; + clusterMetricsMonitor.inputs = [ + { + uri: { + path: '/_cluster/health', + }, + }, + ]; + const formikValues = monitorToFormik(clusterMetricsMonitor); + expect(formikValues.uri.path).toBe('/_cluster/health'); + }); + }); }); diff --git a/public/pages/CreateMonitor/containers/DefineMonitor/DefineMonitor.js b/public/pages/CreateMonitor/containers/DefineMonitor/DefineMonitor.js index eed26d5f7..559b85350 100644 --- a/public/pages/CreateMonitor/containers/DefineMonitor/DefineMonitor.js +++ b/public/pages/CreateMonitor/containers/DefineMonitor/DefineMonitor.js @@ -18,6 +18,14 @@ import { buildSearchRequest } from './utils/searchRequests'; import { SEARCH_TYPE, OS_AD_PLUGIN, MONITOR_TYPE } from '../../../../utils/constants'; import { backendErrorNotification } from '../../../../utils/helpers'; import DataSource from '../DataSource'; +import { + buildClusterMetricsRequest, + getApiType, + getApiTypesRequiringPathParams, +} from '../../components/ClusterMetricsMonitor/utils/clusterMetricsMonitorHelpers'; +import ClusterMetricsMonitor from '../../components/ClusterMetricsMonitor'; +import { FORMIK_INITIAL_VALUES } from '../CreateMonitor/utils/constants'; +import { API_TYPES } from '../../components/ClusterMetricsMonitor/utils/clusterMetricsMonitorConstants'; function renderEmptyMessage(message) { return ( @@ -53,6 +61,7 @@ class DefineMonitor extends Component { response: null, formikSnapshot: this.props.values, plugins: [], + loadingResponse: false, }; this.renderGraph = this.renderGraph.bind(this); @@ -62,8 +71,10 @@ class DefineMonitor extends Component { this.queryMappings = this.queryMappings.bind(this); this.renderVisualMonitor = this.renderVisualMonitor.bind(this); this.renderExtractionQuery = this.renderExtractionQuery.bind(this); + this.renderClusterMetricsMonitor = this.renderClusterMetricsMonitor.bind(this); this.getMonitorContent = this.getMonitorContent.bind(this); this.getPlugins = this.getPlugins.bind(this); + this.getSupportedApiList = this.getSupportedApiList.bind(this); this.showPluginWarning = this.showPluginWarning.bind(this); } @@ -77,6 +88,7 @@ class DefineMonitor extends Component { this.onQueryMappings(); if (hasTimeField) this.onRunQuery(); } + if (searchType === SEARCH_TYPE.CLUSTER_METRICS) this.getSupportedApiList(); } componentDidUpdate(prevProps) { @@ -139,8 +151,10 @@ class DefineMonitor extends Component { this.onRunQuery(); // Reset response when monitor type or definition method is changed - if (prevSearchType !== searchType || prevMonitorType !== monitor_type || groupByCleared) + if (prevSearchType !== searchType || prevMonitorType !== monitor_type || groupByCleared) { this.resetResponse(); + if (searchType === SEARCH_TYPE.CLUSTER_METRICS) this.getSupportedApiList(); + } } async getPlugins() { @@ -216,6 +230,7 @@ class DefineMonitor extends Component { } async onRunQuery() { + this.setState({ loadingResponse: true }); const { httpClient, values, notifications } = this.props; const formikSnapshot = _.cloneDeep(values); @@ -234,6 +249,9 @@ class DefineMonitor extends Component { requests = [buildSearchRequest(values)]; requests.push(buildSearchRequest(values, false)); break; + case SEARCH_TYPE.CLUSTER_METRICS: + requests = [buildClusterMetricsRequest(values)]; + break; } try { @@ -250,6 +268,9 @@ class DefineMonitor extends Component { case SEARCH_TYPE.GRAPH: _.set(monitor, 'inputs[0].search', request); break; + case SEARCH_TYPE.CLUSTER_METRICS: + _.set(monitor, 'inputs[0].uri', request); + break; default: console.log(`Unsupported searchType found: ${JSON.stringify(searchType)}`, searchType); } @@ -276,6 +297,7 @@ class DefineMonitor extends Component { } catch (err) { console.error('There was an error running the query', err); } + this.setState({ loadingResponse: false }); } resetResponse() { @@ -368,11 +390,94 @@ class DefineMonitor extends Component { }; } + renderClusterMetricsMonitor() { + const { values } = this.props; + const { + loadingResponse, + loadingSupportedApiList = false, + response, + supportedApiList, + } = this.state; + return { + content: ( +
      + +
      + ), + }; + } + + async getSupportedApiList() { + this.setState({ loadingSupportedApiList: true }); + const { httpClient, values } = this.props; + const requests = []; + _.keys(API_TYPES).forEach((apiKey) => { + let requiresPathParams = _.get(API_TYPES, `${apiKey}.paths.withoutPathParams`); + requiresPathParams = _.isEmpty(requiresPathParams); + if (!requiresPathParams) { + const path = _.get(API_TYPES, `${apiKey}.paths.withoutPathParams`); + const values = { uri: { ...FORMIK_INITIAL_VALUES.uri, path } }; + requests.push(buildClusterMetricsRequest(values)); + } + }); + + const promises = requests.map((request) => { + const monitor = formikToMonitor(values); + const tempMonitorName = getApiType(request); + _.set(monitor, 'name', tempMonitorName); + _.set(monitor, 'triggers', []); + _.set(monitor, 'inputs[0].uri', request); + return httpClient.post('../api/alerting/monitors/_execute', { + body: JSON.stringify(monitor), + }); + }); + + let supportedApiList = []; + await Promise.all(promises).then((responses) => { + responses.forEach((response) => { + if (response.ok) { + const supportedApi = _.get(response, 'resp.monitor_name'); + supportedApiList.push({ + value: supportedApi, + label: _.get(API_TYPES, `${supportedApi}.label`), + }); + } + }); + }); + + // DefineMonitor::getSupportedApiList attempts to create a list of API for which the user can create monitors. + // It does this by calling all of the feature-supported API without parameters, and adding successful API to a list. + // However, some API require path parameters. The below logic will add those API to the list by default. + // Attempting to create a monitor using one of those API will still throw an exception from the backend if the user + // has configured the OpenSearch-Alerting Plugin supported_json_payloads.json to restrict access to those API. + let clonedSupportedApiList = _.cloneDeep(supportedApiList); + getApiTypesRequiringPathParams().forEach((apiType) => { + if (!supportedApiList.includes(apiType)) clonedSupportedApiList.push(apiType); + }); + clonedSupportedApiList = _.orderBy(clonedSupportedApiList, (api) => api.label); + + this.setState({ + loadingSupportedApiList: false, + supportedApiList: clonedSupportedApiList, + }); + } + getMonitorContent() { const { values } = this.props; switch (values.searchType) { case SEARCH_TYPE.GRAPH: return this.renderVisualMonitor(); + case SEARCH_TYPE.CLUSTER_METRICS: + return this.renderClusterMetricsMonitor(); default: return this.renderExtractionQuery(); } diff --git a/public/pages/CreateMonitor/containers/DefineMonitor/__snapshots__/DefineMonitor.test.js.snap b/public/pages/CreateMonitor/containers/DefineMonitor/__snapshots__/DefineMonitor.test.js.snap index 667ce9e32..ca81b4831 100644 --- a/public/pages/CreateMonitor/containers/DefineMonitor/__snapshots__/DefineMonitor.test.js.snap +++ b/public/pages/CreateMonitor/containers/DefineMonitor/__snapshots__/DefineMonitor.test.js.snap @@ -48,6 +48,12 @@ exports[`DefineMonitor renders 1`] = ` "searchType": "graph", "timeField": "", "timezone": Array [], + "uri": Object { + "api_type": "", + "path": "", + "path_params": "", + "url": "", + }, "weekly": Object { "fri": false, "mon": false, diff --git a/public/pages/CreateMonitor/containers/MonitorDetails/MonitorDetails.js b/public/pages/CreateMonitor/containers/MonitorDetails/MonitorDetails.js index c8599ae36..327b886f5 100644 --- a/public/pages/CreateMonitor/containers/MonitorDetails/MonitorDetails.js +++ b/public/pages/CreateMonitor/containers/MonitorDetails/MonitorDetails.js @@ -12,6 +12,7 @@ import Schedule from '../../components/Schedule'; import MonitorDefinitionCard from '../../components/MonitorDefinitionCard'; import MonitorType from '../../components/MonitorType'; import AnomalyDetectors from '../AnomalyDetectors/AnomalyDetectors'; +import { MONITOR_TYPE } from '../../../../utils/constants'; const renderAnomalyDetector = (httpClient, values, detectorId) => { return { @@ -51,6 +52,7 @@ const MonitorDetails = ({ detectorId, }) => { const anomalyDetectorContent = isAd && renderAnomalyDetector(httpClient, values, detectorId); + const displayMonitorDefinitionCards = values.monitor_type !== MONITOR_TYPE.CLUSTER_METRICS; return ( - - + + {displayMonitorDefinitionCards ? ( +
      + + +
      + ) : null} {isAd ? (
      diff --git a/public/pages/CreateMonitor/containers/MonitorIndex/__snapshots__/MonitorIndex.test.js.snap b/public/pages/CreateMonitor/containers/MonitorIndex/__snapshots__/MonitorIndex.test.js.snap index 84940ee25..edc02cc3b 100644 --- a/public/pages/CreateMonitor/containers/MonitorIndex/__snapshots__/MonitorIndex.test.js.snap +++ b/public/pages/CreateMonitor/containers/MonitorIndex/__snapshots__/MonitorIndex.test.js.snap @@ -43,6 +43,12 @@ exports[`MonitorIndex renders 1`] = ` "searchType": "graph", "timeField": "", "timezone": Array [], + "uri": Object { + "api_type": "", + "path": "", + "path_params": "", + "url": "", + }, "weekly": Object { "fri": false, "mon": false, @@ -177,6 +183,12 @@ exports[`MonitorIndex renders 1`] = ` "searchType": "graph", "timeField": "", "timezone": Array [], + "uri": Object { + "api_type": "", + "path": "", + "path_params": "", + "url": "", + }, "weekly": Object { "fri": false, "mon": false, @@ -258,6 +270,12 @@ exports[`MonitorIndex renders 1`] = ` "searchType": "graph", "timeField": "", "timezone": Array [], + "uri": Object { + "api_type": "", + "path": "", + "path_params": "", + "url": "", + }, "weekly": Object { "fri": false, "mon": false, @@ -403,6 +421,12 @@ exports[`MonitorIndex renders 1`] = ` "searchType": "graph", "timeField": "", "timezone": Array [], + "uri": Object { + "api_type": "", + "path": "", + "path_params": "", + "url": "", + }, "weekly": Object { "fri": false, "mon": false, @@ -484,6 +508,12 @@ exports[`MonitorIndex renders 1`] = ` "searchType": "graph", "timeField": "", "timezone": Array [], + "uri": Object { + "api_type": "", + "path": "", + "path_params": "", + "url": "", + }, "weekly": Object { "fri": false, "mon": false, diff --git a/public/pages/CreateTrigger/components/Action/Action.js b/public/pages/CreateTrigger/components/Action/Action.js index 5a5f88077..f8bf7179c 100644 --- a/public/pages/CreateTrigger/components/Action/Action.js +++ b/public/pages/CreateTrigger/components/Action/Action.js @@ -102,6 +102,7 @@ const Action = ({ }, singleSelection: { asPlainText: true }, isClearable: false, + 'data-test-subj': `${fieldPath}actions.${index}_actionDestination`, }} /> diff --git a/public/pages/CreateTrigger/components/Action/utils/validate.js b/public/pages/CreateTrigger/components/Action/utils/validate.js index e8a54a1f8..4bb6ec360 100644 --- a/public/pages/CreateTrigger/components/Action/utils/validate.js +++ b/public/pages/CreateTrigger/components/Action/utils/validate.js @@ -4,10 +4,10 @@ */ export const validateDestination = (destinations) => (value) => { - if (!value) return 'Required'; + if (!value) return 'Required.'; // In case existing destination doesn't exist in list , invalidate the field const destinationMatches = destinations.filter((destination) => destination.value === value); if (destinationMatches.length === 0) { - return 'Required'; + return 'Required.'; } }; diff --git a/public/pages/CreateTrigger/components/AddActionButton/AddActionButton.js b/public/pages/CreateTrigger/components/AddActionButton/AddActionButton.js index 9ac42a238..553d27ae3 100644 --- a/public/pages/CreateTrigger/components/AddActionButton/AddActionButton.js +++ b/public/pages/CreateTrigger/components/AddActionButton/AddActionButton.js @@ -24,6 +24,7 @@ const AddActionButton = ({ arrayHelpers, type = 'slack', numOfActions }) => { ); break; case MONITOR_TYPE.QUERY_LEVEL: + case MONITOR_TYPE.CLUSTER_METRICS: _.set( initialActionValues, 'message_template.source', diff --git a/public/pages/CreateTrigger/components/AddTriggerButton/AddTriggerButton.js b/public/pages/CreateTrigger/components/AddTriggerButton/AddTriggerButton.js index 89d78f47c..856399fa2 100644 --- a/public/pages/CreateTrigger/components/AddTriggerButton/AddTriggerButton.js +++ b/public/pages/CreateTrigger/components/AddTriggerButton/AddTriggerButton.js @@ -8,17 +8,21 @@ import _ from 'lodash'; import { EuiButton } from '@elastic/eui'; import { FORMIK_INITIAL_TRIGGER_VALUES } from '../../containers/CreateTrigger/utils/constants'; -const AddTriggerButton = ({ arrayHelpers, disabled }) => { +const AddTriggerButton = ({ + arrayHelpers, + disabled, + script = FORMIK_INITIAL_TRIGGER_VALUES.script, +}) => { const buttonText = _.get(arrayHelpers, 'form.values.triggerDefinitions', []).length === 0 ? 'Add trigger' : 'Add another trigger'; - + const values = _.cloneDeep({ ...FORMIK_INITIAL_TRIGGER_VALUES, script }); return ( arrayHelpers.push(_.cloneDeep(FORMIK_INITIAL_TRIGGER_VALUES))} + onClick={() => arrayHelpers.push(values)} disabled={disabled} > {buttonText} diff --git a/public/pages/CreateTrigger/components/BucketLevelTriggerQuery/BucketLevelTriggerQuery.js b/public/pages/CreateTrigger/components/BucketLevelTriggerQuery/BucketLevelTriggerQuery.js index 33f9d2fb1..bfc7545b7 100644 --- a/public/pages/CreateTrigger/components/BucketLevelTriggerQuery/BucketLevelTriggerQuery.js +++ b/public/pages/CreateTrigger/components/BucketLevelTriggerQuery/BucketLevelTriggerQuery.js @@ -62,90 +62,90 @@ const BucketLevelTriggerQuery = ({ _.set(trigger, `${TRIGGER_TYPE.BUCKET_LEVEL}.actions`, []); const fieldName = `${fieldPath}bucketSelector`; return ( - - - - - - {({ - field: { value }, - form: { errors, touched, setFieldValue, setFieldTouched }, - }) => ( - - - - Trigger condition - - - - - { - setFlyout({ type: 'triggerCondition', payload: context }); - }} - > - Info - - - - - } - fullWidth={true} - isInvalid={_.get(touched, fieldName, false) && !!_.get(errors, fieldName)} - error={_.get(errors, fieldName)} - > - { - setFieldValue(fieldName, source); - }} - onBlur={() => setFieldTouched(fieldName, true)} - value={value} - /> - - )} - - +
      + + + + + + {({ + field: { value }, + form: { errors, touched, setFieldValue, setFieldTouched }, + }) => ( + + + + Trigger condition + + + + + { + setFlyout({ type: 'triggerCondition', payload: context }); + }} + > + Info + + + + + } + fullWidth={true} + isInvalid={_.get(touched, fieldName, false) && !!_.get(errors, fieldName)} + error={_.get(errors, fieldName)} + > + { + setFieldValue(fieldName, source); + }} + onBlur={() => setFieldTouched(fieldName, true)} + value={value} + /> + + )} + + - - - Trigger condition response - - } - > - - - - - + + + Trigger condition response + + } + > + + + + + + - - onRun(_.isArray(trigger) ? trigger : [trigger])} - size={'s'} - style={{ width: '250px' }} - > - Run for condition response - - - + onRun(_.isArray(trigger) ? trigger : [trigger])} + size={'s'} + style={{ marginLeft: '10px' }} + > + Preview condition response + +
      ); }; diff --git a/public/pages/CreateTrigger/components/TriggerEmptyPrompt/TriggerEmptyPrompt.js b/public/pages/CreateTrigger/components/TriggerEmptyPrompt/TriggerEmptyPrompt.js index 38b91e83d..2fdaff087 100644 --- a/public/pages/CreateTrigger/components/TriggerEmptyPrompt/TriggerEmptyPrompt.js +++ b/public/pages/CreateTrigger/components/TriggerEmptyPrompt/TriggerEmptyPrompt.js @@ -6,10 +6,13 @@ import React from 'react'; import { EuiEmptyPrompt, EuiText } from '@elastic/eui'; import AddTriggerButton from '../AddTriggerButton'; +import { FORMIK_INITIAL_TRIGGER_VALUES } from '../../containers/CreateTrigger/utils/constants'; -const addTriggerButton = (arrayHelpers) => ; +const addTriggerButton = (arrayHelpers, script) => ( + +); -const TriggerEmptyPrompt = ({ arrayHelpers }) => ( +const TriggerEmptyPrompt = ({ arrayHelpers, script = FORMIK_INITIAL_TRIGGER_VALUES.script }) => ( (

      Add a trigger to define conditions and actions.

      } - actions={addTriggerButton(arrayHelpers)} + actions={addTriggerButton(arrayHelpers, script)} /> ); diff --git a/public/pages/CreateTrigger/components/TriggerQuery/TriggerQuery.js b/public/pages/CreateTrigger/components/TriggerQuery/TriggerQuery.js index 5d1b57ca1..7679ce1a7 100644 --- a/public/pages/CreateTrigger/components/TriggerQuery/TriggerQuery.js +++ b/public/pages/CreateTrigger/components/TriggerQuery/TriggerQuery.js @@ -55,106 +55,107 @@ const TriggerQuery = ({ const fieldName = `${fieldPath}script.source`; return ( - - - - -
      - {isAd ? ( -
      - - - - - -
      - ) : null} +
      + + + + +
      + {isAd ? ( +
      + + + + + +
      + ) : null} - - {({ - field: { value }, - form: { errors, touched, setFieldValue, setFieldTouched }, - }) => ( - - - - Trigger condition - - - - - { - setFlyout({ type: 'triggerCondition', payload: context }); - }} - > - Info - - - - - } - fullWidth={true} - isInvalid={_.get(touched, fieldName, false) && !!_.get(errors, fieldName)} - error={_.get(errors, fieldName)} - > - { - setFieldValue(fieldName, source); - }} - onBlur={() => setFieldTouched(fieldName, true)} - value={value} - /> - - )} - -
      -
      + + {({ + field: { value }, + form: { errors, touched, setFieldValue, setFieldTouched }, + }) => ( + + + + Trigger condition + + + + + { + setFlyout({ type: 'triggerCondition', payload: context }); + }} + > + Info + + + +
      + } + fullWidth={true} + isInvalid={_.get(touched, fieldName, false) && !!_.get(errors, fieldName)} + error={_.get(errors, fieldName)} + > + { + setFieldValue(fieldName, source); + }} + onBlur={() => setFieldTouched(fieldName, true)} + value={value} + data-test-subj={'triggerQueryCodeEditor'} + /> + + )} + +
      + - - - Trigger condition response - - } - > - - - - - + + + Trigger condition response + + } + > + + + + + + - - onRun([trigger])} size={'s'} style={{ width: '250px' }}> - Run for condition response - - - + onRun([trigger])} size={'s'} style={{ marginLeft: '10px' }}> + Preview condition response + +
      ); }; diff --git a/public/pages/CreateTrigger/components/TriggerQuery/__snapshots__/TriggerQuery.test.js.snap b/public/pages/CreateTrigger/components/TriggerQuery/__snapshots__/TriggerQuery.test.js.snap index 9a2b588b5..4f3710f0d 100644 --- a/public/pages/CreateTrigger/components/TriggerQuery/__snapshots__/TriggerQuery.test.js.snap +++ b/public/pages/CreateTrigger/components/TriggerQuery/__snapshots__/TriggerQuery.test.js.snap @@ -1,95 +1,89 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP exports[`TriggerQuery renders 1`] = ` - - + - - + -
      - - - -
      -
      - - +
      + - - Trigger condition response - - + + +
      +
      + - - - -
      -
      - + + Trigger condition response + + + } + labelType="label" + > + + + +
      +
      +
      + - - Run for condition response - -
      -
      + Preview condition response +
      +
      `; diff --git a/public/pages/CreateTrigger/containers/ConfigureActions/ConfigureActions.js b/public/pages/CreateTrigger/containers/ConfigureActions/ConfigureActions.js index d1cfcb2cc..19bfd1f22 100644 --- a/public/pages/CreateTrigger/containers/ConfigureActions/ConfigureActions.js +++ b/public/pages/CreateTrigger/containers/ConfigureActions/ConfigureActions.js @@ -97,6 +97,7 @@ class ConfigureActions extends React.Component { ); break; case MONITOR_TYPE.QUERY_LEVEL: + case MONITOR_TYPE.CLUSTER_METRICS: _.set( initialActionValues, 'message_template.source', @@ -147,6 +148,7 @@ class ConfigureActions extends React.Component { _.set(testTrigger, `${TRIGGER_TYPE.BUCKET_LEVEL}.condition`, condition); break; case MONITOR_TYPE.QUERY_LEVEL: + case MONITOR_TYPE.CLUSTER_METRICS: action = _.get(testTrigger, `actions[${index}]`); condition = { ..._.get(testTrigger, 'condition'), diff --git a/public/pages/CreateTrigger/containers/ConfigureTriggers/ConfigureTriggers.js b/public/pages/CreateTrigger/containers/ConfigureTriggers/ConfigureTriggers.js index f7ef0c569..c46c39550 100644 --- a/public/pages/CreateTrigger/containers/ConfigureTriggers/ConfigureTriggers.js +++ b/public/pages/CreateTrigger/containers/ConfigureTriggers/ConfigureTriggers.js @@ -19,6 +19,12 @@ import { buildSearchRequest } from '../../../CreateMonitor/containers/DefineMoni import { backendErrorNotification, inputLimitText } from '../../../../utils/helpers'; import moment from 'moment'; import { formikToTrigger } from '../CreateTrigger/utils/formikToTrigger'; +import { + buildClusterMetricsRequest, + canExecuteClusterMetricsMonitor, + getDefaultScript, +} from '../../../CreateMonitor/components/ClusterMetricsMonitor/utils/clusterMetricsMonitorHelpers'; +import { FORMIK_INITIAL_VALUES } from '../../../CreateMonitor/containers/CreateMonitor/utils/constants'; class ConfigureTriggers extends React.Component { constructor(props) { @@ -31,14 +37,24 @@ class ConfigureTriggers extends React.Component { _.get(props, 'monitor.monitor_type', MONITOR_TYPE.QUERY_LEVEL) === MONITOR_TYPE.BUCKET_LEVEL, triggerDeleted: false, + addTriggerButton: this.prepareAddTriggerButton(), + triggerEmptyPrompt: this.prepareTriggerEmptyPrompt(), }; this.onQueryMappings = this.onQueryMappings.bind(this); this.onRunExecute = this.onRunExecute.bind(this); + this.prepareAddTriggerButton = this.prepareAddTriggerButton.bind(this); + this.prepareTriggerEmptyPrompt = this.prepareTriggerEmptyPrompt.bind(this); } componentDidMount() { - if (this.state.isBucketLevelMonitor) this.onQueryMappings(); + const { + monitorValues: { searchType, uri }, + } = this.props; + const { isBucketLevelMonitor } = this.state; + if (searchType === SEARCH_TYPE.CLUSTER_METRICS && canExecuteClusterMetricsMonitor(uri)) + this.onRunExecute(); + if (isBucketLevelMonitor) this.onQueryMappings(); } componentDidUpdate(prevProps) { @@ -47,13 +63,66 @@ class ConfigureTriggers extends React.Component { if (prevMonitorType !== currMonitorType) _.set(this.state, 'isBucketLevelMonitor', currMonitorType === MONITOR_TYPE.BUCKET_LEVEL); + const prevSearchType = _.get( + prevProps, + 'monitorValues.searchType', + FORMIK_INITIAL_VALUES.searchType + ); + const currSearchType = _.get( + this.props, + 'monitorValues.searchType', + FORMIK_INITIAL_VALUES.searchType + ); + const prevApiType = _.get( + prevProps, + 'monitorValues.uri.api_type', + FORMIK_INITIAL_VALUES.uri.api_type + ); + const currApiType = _.get( + this.props, + 'monitorValues.uri.api_type', + FORMIK_INITIAL_VALUES.uri.api_type + ); + if (prevSearchType !== currSearchType || prevApiType !== currApiType) { + switch (currSearchType) { + case SEARCH_TYPE.CLUSTER_METRICS: + _.set(this.state, 'addTriggerButton', this.prepareAddTriggerButton()); + _.set(this.state, 'triggerEmptyPrompt', this.prepareTriggerEmptyPrompt()); + break; + } + } + const prevInputs = prevProps.monitor.inputs[0]; const currInputs = this.props.monitor.inputs[0]; if (!_.isEqual(prevInputs, currInputs)) { - if (this.state.isBucketLevelMonitor) this.onQueryMappings(); + const { isBucketLevelMonitor } = this.state; + if (isBucketLevelMonitor) this.onQueryMappings(); } } + prepareAddTriggerButton = () => { + const { monitorValues, triggerArrayHelpers, triggerValues } = this.props; + const disableAddTriggerButton = + _.get(triggerValues, 'triggerDefinitions', []).length >= MAX_TRIGGERS; + return ( + + ); + }; + + prepareTriggerEmptyPrompt = () => { + const { monitorValues, triggerArrayHelpers } = this.props; + return ( + + ); + }; + onRunExecute = (triggers = []) => { const { httpClient, monitor, notifications } = this.props; const formikValues = monitorToFormik(monitor); @@ -67,6 +136,10 @@ class ConfigureTriggers extends React.Component { const searchRequest = buildSearchRequest(formikValues); _.set(monitorToExecute, 'inputs[0].search', searchRequest); break; + case SEARCH_TYPE.CLUSTER_METRICS: + const clusterMetricsRequest = buildClusterMetricsRequest(formikValues); + _.set(monitorToExecute, 'inputs[0].uri', clusterMetricsRequest); + break; default: console.log(`Unsupported searchType found: ${JSON.stringify(searchType)}`, searchType); } @@ -140,62 +213,58 @@ class ConfigureTriggers extends React.Component { httpClient, notifications, } = this.props; - - const { dataTypes, executeResponse, isBucketLevelMonitor } = this.state; + const { dataTypes, executeResponse, isBucketLevelMonitor, triggerEmptyPrompt } = this.state; const hasTriggers = !_.isEmpty(_.get(triggerValues, 'triggerDefinitions')); - return hasTriggers ? ( - triggerValues.triggerDefinitions.map((trigger, index) => { - return ( -
      - {isBucketLevelMonitor ? ( - - ) : ( - - )} - -
      - ); - }) - ) : ( - - ); + return hasTriggers + ? triggerValues.triggerDefinitions.map((trigger, index) => { + return ( +
      + {isBucketLevelMonitor ? ( + + ) : ( + + )} + +
      + ); + }) + : triggerEmptyPrompt; }; render() { const { triggerArrayHelpers, triggerValues } = this.props; - const disableAddTriggerButton = - _.get(triggerValues, 'triggerDefinitions', []).length >= MAX_TRIGGERS; + const { addTriggerButton } = this.state; const numOfTriggers = _.get(triggerValues, 'triggerDefinitions', []).length; const displayAddTriggerButton = numOfTriggers > 0; return ( @@ -210,10 +279,7 @@ class ConfigureTriggers extends React.Component { {displayAddTriggerButton ? (
      - + {addTriggerButton} {inputLimitText(numOfTriggers, MAX_TRIGGERS, 'trigger', 'triggers')}
      diff --git a/public/pages/CreateTrigger/containers/CreateTrigger/CreateTrigger/CreateTrigger.js b/public/pages/CreateTrigger/containers/CreateTrigger/CreateTrigger/CreateTrigger.js index 517ac51a3..d4fa69b1b 100644 --- a/public/pages/CreateTrigger/containers/CreateTrigger/CreateTrigger/CreateTrigger.js +++ b/public/pages/CreateTrigger/containers/CreateTrigger/CreateTrigger/CreateTrigger.js @@ -28,13 +28,14 @@ import monitorToFormik from '../../../../CreateMonitor/containers/CreateMonitor/ import { buildSearchRequest } from '../../../../CreateMonitor/containers/DefineMonitor/utils/searchRequests'; import { formikToTrigger, formikToTriggerUiMetadata } from '../utils/formikToTrigger'; import { triggerToFormik } from '../utils/triggerToFormik'; -import { FORMIK_INITIAL_TRIGGER_VALUES } from '../utils/constants'; +import { FORMIK_INITIAL_TRIGGER_VALUES, TRIGGER_TYPE } from '../utils/constants'; import { SEARCH_TYPE } from '../../../../../utils/constants'; import { SubmitErrorHandler } from '../../../../../utils/SubmitErrorHandler'; import { backendErrorNotification } from '../../../../../utils/helpers'; import DefineBucketLevelTrigger from '../../DefineBucketLevelTrigger'; import { getPathsPerDataType } from '../../../../CreateMonitor/containers/DefineMonitor/utils/mappings'; import { MONITOR_TYPE } from '../../../../../utils/constants'; +import { buildClusterMetricsRequest } from '../../../../CreateMonitor/components/ClusterMetricsMonitor/utils/clusterMetricsMonitorHelpers'; export const DEFAULT_CLOSED_STATES = { WHEN: false, @@ -99,10 +100,11 @@ export default class CreateTrigger extends Component { onEdit = (trigger, triggerMetadata, { setSubmitting, setErrors }) => { const { monitor, updateMonitor, onCloseTrigger, triggerToEdit } = this.props; const { ui_metadata: uiMetadata = {}, triggers, monitor_type } = monitor; - const { name } = - monitor_type === MONITOR_TYPE.QUERY_LEVEL - ? triggerToEdit.query_level_trigger - : triggerToEdit.bucket_level_trigger; + const triggerType = + monitor_type === MONITOR_TYPE.BUCKET_LEVEL + ? TRIGGER_TYPE.BUCKET_LEVEL + : TRIGGER_TYPE.QUERY_LEVEL; + const { name } = triggerToEdit[triggerType]; const updatedTriggersMetadata = _.cloneDeep(uiMetadata.triggers || {}); delete updatedTriggersMetadata[name]; const updatedUiMetadata = { @@ -110,11 +112,7 @@ export default class CreateTrigger extends Component { triggers: { ...updatedTriggersMetadata, ...triggerMetadata }, }; - const findTriggerName = (element) => { - return monitor_type === MONITOR_TYPE.QUERY_LEVEL - ? name === element.query_level_trigger.name - : name === element.bucket_level_trigger.name; - }; + const findTriggerName = (element) => element[triggerType].name; const indexToUpdate = _.findIndex(triggers, findTriggerName); const updatedTriggers = triggers.slice(); @@ -147,6 +145,10 @@ export default class CreateTrigger extends Component { const searchRequest = buildSearchRequest(formikValues); _.set(monitorToExecute, 'inputs[0].search', searchRequest); break; + case SEARCH_TYPE.CLUSTER_METRICS: + const clusterMetricsRequest = buildClusterMetricsRequest(formikValues); + _.set(monitorToExecute, 'inputs[0].uri', clusterMetricsRequest); + break; default: console.log(`Unsupported searchType found: ${JSON.stringify(searchType)}`, searchType); } @@ -280,7 +282,7 @@ export default class CreateTrigger extends Component { render() { const { monitor, onCloseTrigger, setFlyout, edit, httpClient, notifications } = this.props; const { dataTypes, initialValues, executeResponse } = this.state; - const isQueryLevelMonitor = _.get(monitor, 'monitor_type') === MONITOR_TYPE.QUERY_LEVEL; + const isBucketLevelMonitor = _.get(monitor, 'monitor_type') === MONITOR_TYPE.BUCKET_LEVEL; return (
      @@ -292,18 +294,7 @@ export default class CreateTrigger extends Component {

      {edit ? 'Edit' : 'Create'} trigger

      - {isQueryLevelMonitor ? ( - - ) : ( + {isBucketLevelMonitor ? ( {(arrayHelpers) => ( )} + ) : ( + )} diff --git a/public/pages/CreateTrigger/containers/CreateTrigger/utils/formikToTrigger.js b/public/pages/CreateTrigger/containers/CreateTrigger/utils/formikToTrigger.js index 631698ea6..845499f18 100644 --- a/public/pages/CreateTrigger/containers/CreateTrigger/utils/formikToTrigger.js +++ b/public/pages/CreateTrigger/containers/CreateTrigger/utils/formikToTrigger.js @@ -29,11 +29,12 @@ export function formikToTriggerDefinitions(values, monitorUiMetadata) { } export function formikToTriggerDefinition(values, monitorUiMetadata) { - const isQueryLevelMonitor = - _.get(monitorUiMetadata, 'monitor_type', MONITOR_TYPE.QUERY_LEVEL) === MONITOR_TYPE.QUERY_LEVEL; - return isQueryLevelMonitor - ? formikToQueryLevelTrigger(values, monitorUiMetadata) - : formikToBucketLevelTrigger(values, monitorUiMetadata); + const isBucketLevelMonitor = + _.get(monitorUiMetadata, 'monitor_type', MONITOR_TYPE.QUERY_LEVEL) === + MONITOR_TYPE.BUCKET_LEVEL; + return isBucketLevelMonitor + ? formikToBucketLevelTrigger(values, monitorUiMetadata) + : formikToQueryLevelTrigger(values, monitorUiMetadata); } export function formikToQueryLevelTrigger(values, monitorUiMetadata) { @@ -127,6 +128,7 @@ export function formikToBucketLevelTriggerAction(values) { export function formikToTriggerUiMetadata(values, monitorUiMetadata) { switch (monitorUiMetadata.monitor_type) { case MONITOR_TYPE.QUERY_LEVEL: + case MONITOR_TYPE.CLUSTER_METRICS: const searchType = _.get(monitorUiMetadata, 'search.searchType', 'query'); const queryLevelTriggersUiMetadata = {}; _.get(values, 'triggerDefinitions', []).forEach((trigger) => { @@ -170,7 +172,8 @@ export function formikToCondition(values, monitorUiMetadata = {}) { const searchType = _.get(monitorUiMetadata, 'search.searchType', 'query'); const aggregationType = _.get(monitorUiMetadata, 'search.aggregations.0.aggregationType'); - if (searchType === SEARCH_TYPE.QUERY) return { script: values.script }; + if (searchType === SEARCH_TYPE.QUERY || searchType === SEARCH_TYPE.CLUSTER_METRICS) + return { script: values.script }; if (searchType === SEARCH_TYPE.AD) return getADCondition(values); // If no aggregation type defined, default to count of documents situation diff --git a/public/pages/CreateTrigger/containers/CreateTrigger/utils/formikToTrigger.test.js b/public/pages/CreateTrigger/containers/CreateTrigger/utils/formikToTrigger.test.js index 350251469..768bc440a 100644 --- a/public/pages/CreateTrigger/containers/CreateTrigger/utils/formikToTrigger.test.js +++ b/public/pages/CreateTrigger/containers/CreateTrigger/utils/formikToTrigger.test.js @@ -78,6 +78,13 @@ describe('formikToCondition', () => { }); }); + test('can return condition when searchType is clusterMetrics', () => { + const formikValues = _.cloneDeep(FORMIK_INITIAL_TRIGGER_VALUES); + expect(formikToCondition(formikValues, { search: { searchType: 'clusterMetrics' } })).toEqual({ + script: formikValues.script, + }); + }); + test('can return condition when searchType is ad', () => { const formikValues = _.cloneDeep(FORMIK_INITIAL_TRIGGER_VALUES); expect(formikToCondition(formikValues, { search: { searchType: 'ad' } })).toEqual({ diff --git a/public/pages/CreateTrigger/containers/CreateTrigger/utils/triggerToFormik.js b/public/pages/CreateTrigger/containers/CreateTrigger/utils/triggerToFormik.js index 538904839..66c4b60dc 100644 --- a/public/pages/CreateTrigger/containers/CreateTrigger/utils/triggerToFormik.js +++ b/public/pages/CreateTrigger/containers/CreateTrigger/utils/triggerToFormik.js @@ -29,11 +29,11 @@ export function triggerDefinitionsToFormik(triggers, monitor) { } export function triggerDefinitionToFormik(trigger, monitor) { - const isQueryLevelMonitor = - _.get(monitor, 'monitor_type', MONITOR_TYPE.QUERY_LEVEL) === MONITOR_TYPE.QUERY_LEVEL; - return isQueryLevelMonitor - ? queryLevelTriggerToFormik(trigger, monitor) - : bucketLevelTriggerToFormik(trigger, monitor); + const isBucketLevelMonitor = + _.get(monitor, 'monitor_type', MONITOR_TYPE.QUERY_LEVEL) === MONITOR_TYPE.BUCKET_LEVEL; + return isBucketLevelMonitor + ? bucketLevelTriggerToFormik(trigger, monitor) + : queryLevelTriggerToFormik(trigger, monitor); } export function queryLevelTriggerToFormik(trigger, monitor) { diff --git a/public/pages/CreateTrigger/containers/DefineTrigger/DefineTrigger.js b/public/pages/CreateTrigger/containers/DefineTrigger/DefineTrigger.js index 0e2a2bbbd..cf77a8d50 100644 --- a/public/pages/CreateTrigger/containers/DefineTrigger/DefineTrigger.js +++ b/public/pages/CreateTrigger/containers/DefineTrigger/DefineTrigger.js @@ -21,6 +21,10 @@ import ConfigureActions from '../ConfigureActions'; import monitorToFormik from '../../../CreateMonitor/containers/CreateMonitor/utils/monitorToFormik'; import { buildSearchRequest } from '../../../CreateMonitor/containers/DefineMonitor/utils/searchRequests'; import { backendErrorNotification } from '../../../../utils/helpers'; +import { + buildClusterMetricsRequest, + canExecuteClusterMetricsMonitor, +} from '../../../CreateMonitor/components/ClusterMetricsMonitor/utils/clusterMetricsMonitorHelpers'; const defaultRowProps = { label: 'Trigger name', @@ -83,7 +87,16 @@ class DefineTrigger extends Component { // when this component mount (new trigger added) // see how to subscribe the formik related value change componentDidMount() { - this.onRunExecute(); + const { + monitorValues: { searchType, uri }, + } = this.props; + switch (searchType) { + case SEARCH_TYPE.CLUSTER_METRICS: + if (canExecuteClusterMetricsMonitor(uri)) this.onRunExecute(); + break; + default: + this.onRunExecute(); + } } onRunExecute = (triggers = []) => { @@ -101,6 +114,10 @@ class DefineTrigger extends Component { break; case SEARCH_TYPE.AD: break; + case SEARCH_TYPE.CLUSTER_METRICS: + const clusterMetricsRequest = buildClusterMetricsRequest(formikValues); + _.set(monitorToExecute, 'inputs[0].uri', clusterMetricsRequest); + break; default: console.log(`Unsupported searchType found: ${JSON.stringify(searchType)}`, searchType); } diff --git a/public/pages/Dashboard/components/AcknowledgeAlertsModal/AcknowledgeAlertsModal.js b/public/pages/Dashboard/components/AcknowledgeAlertsModal/AcknowledgeAlertsModal.js index 9ebb84b46..2c9475eb1 100644 --- a/public/pages/Dashboard/components/AcknowledgeAlertsModal/AcknowledgeAlertsModal.js +++ b/public/pages/Dashboard/components/AcknowledgeAlertsModal/AcknowledgeAlertsModal.js @@ -303,6 +303,7 @@ export default class AcknowledgeAlertsModal extends Component { const getItemId = (item) => { switch (monitorType) { case MONITOR_TYPE.QUERY_LEVEL: + case MONITOR_TYPE.CLUSTER_METRICS: return `${item.id}-${item.version}`; case MONITOR_TYPE.BUCKET_LEVEL: return item.id; @@ -328,6 +329,7 @@ export default class AcknowledgeAlertsModal extends Component { let columns = []; switch (monitorType) { case MONITOR_TYPE.QUERY_LEVEL: + case MONITOR_TYPE.CLUSTER_METRICS: columns = queryColumns; break; case MONITOR_TYPE.BUCKET_LEVEL: diff --git a/public/pages/Dashboard/components/AcknowledgeAlertsModal/__snapshots__/AcknowledgeAlertsModal.test.js.snap b/public/pages/Dashboard/components/AcknowledgeAlertsModal/__snapshots__/AcknowledgeAlertsModal.test.js.snap index 1f8fd9c33..c3c08a463 100644 --- a/public/pages/Dashboard/components/AcknowledgeAlertsModal/__snapshots__/AcknowledgeAlertsModal.test.js.snap +++ b/public/pages/Dashboard/components/AcknowledgeAlertsModal/__snapshots__/AcknowledgeAlertsModal.test.js.snap @@ -72,6 +72,12 @@ exports[`AcknowledgeAlertsModal renders 1`] = ` "searchType": "graph", "timeField": "", "timezone": Array [], + "uri": Object { + "api_type": "", + "path": "", + "path_params": "", + "url": "", + }, "weekly": Object { "fri": false, "mon": false, diff --git a/public/pages/MonitorDetails/components/MonitorOverview/utils/getOverviewStats.js b/public/pages/MonitorDetails/components/MonitorOverview/utils/getOverviewStats.js index 2a7e39fa9..aa0768a5e 100644 --- a/public/pages/MonitorDetails/components/MonitorOverview/utils/getOverviewStats.js +++ b/public/pages/MonitorDetails/components/MonitorOverview/utils/getOverviewStats.js @@ -14,6 +14,8 @@ import { OPENSEARCH_DASHBOARDS_AD_PLUGIN, SEARCH_TYPE, } from '../../../../../utils/constants'; +import { API_TYPES } from '../../../../CreateMonitor/components/ClusterMetricsMonitor/utils/clusterMetricsMonitorConstants'; +import { getApiType } from '../../../../CreateMonitor/components/ClusterMetricsMonitor/utils/clusterMetricsMonitorHelpers'; // TODO: used in multiple places, move into helper export function getTime(time) { @@ -23,12 +25,17 @@ export function getTime(time) { return DEFAULT_EMPTY_DATA; } -function getMonitorType(searchType) { +function getMonitorType(searchType, monitor) { switch (searchType) { case SEARCH_TYPE.GRAPH: return 'Visual Graph'; case SEARCH_TYPE.AD: return 'Anomaly Detector'; + case SEARCH_TYPE.CLUSTER_METRICS: + const uri = _.get(monitor, 'inputs.0.uri'); + const apiType = getApiType(uri); + const apiTypeLabel = _.get(API_TYPES, `${apiType}.label`); + return apiTypeLabel; default: return 'Extraction Query'; } @@ -40,6 +47,8 @@ function getMonitorLevelType(monitorType) { return 'Per query monitor'; case MONITOR_TYPE.BUCKET_LEVEL: return 'Per bucket monitor'; + case MONITOR_TYPE.CLUSTER_METRICS: + return 'Per cluster metrics monitor'; default: // TODO: May be valuable to implement a toast that displays in this case. console.log('Unexpected monitor type:', monitorType); @@ -55,7 +64,10 @@ export default function getOverviewStats( detector, detectorId ) { - const searchType = _.get(monitor, 'ui_metadata.search.searchType', 'query'); + const searchType = _.has(monitor, 'inputs[0].uri') + ? SEARCH_TYPE.CLUSTER_METRICS + : _.get(monitor, 'ui_metadata.search.searchType', 'query'); + const detectorOverview = detector ? [ { @@ -79,7 +91,7 @@ export default function getOverviewStats( }, { header: 'Monitor definition type', - value: getMonitorType(searchType), + value: getMonitorType(searchType, monitor), }, ...detectorOverview, { diff --git a/public/pages/Monitors/containers/Monitors/Monitors.js b/public/pages/Monitors/containers/Monitors/Monitors.js index 0465bbd70..21f9de5a5 100644 --- a/public/pages/Monitors/containers/Monitors/Monitors.js +++ b/public/pages/Monitors/containers/Monitors/Monitors.js @@ -15,7 +15,7 @@ import MonitorEmptyPrompt from '../../components/MonitorEmptyPrompt'; import { DEFAULT_PAGE_SIZE_OPTIONS, DEFAULT_QUERY_PARAMS } from './utils/constants'; import { getURLQueryParams } from './utils/helpers'; import { columns as staticColumns } from './utils/tableUtils'; -import { MONITOR_ACTIONS } from '../../../../utils/constants'; +import { MONITOR_ACTIONS, MONITOR_TYPE } from '../../../../utils/constants'; import { backendErrorNotification } from '../../../../utils/helpers'; import { displayAcknowledgedAlertsToast } from '../../../Dashboard/utils/helpers'; @@ -127,6 +127,27 @@ export default class Monitors extends Component { }; } + // TODO: The getMonitors API is wrapping the 'monitor' field for ClusterMetrics monitors in an additional 'monitor' object. + // This formatGetMonitorsResponse method is a temporary means of resolving that issue until it can be debugged on the backend. + formatGetMonitorsResponse = (monitors) => { + const unwrappedMonitors = []; + monitors.forEach((monitor) => { + const monitorType = _.get(monitor, 'monitor.monitor.monitor_type', 'monitor.monitor_type'); + switch (monitorType) { + case MONITOR_TYPE.CLUSTER_METRICS: + let unwrappedMonitor = monitor.monitor; + _.set(monitor, 'monitor', unwrappedMonitor.monitor); + _.set(monitor, 'name', monitor.monitor.name); + _.set(monitor, 'enabled', monitor.monitor.enabled); + unwrappedMonitors.push(monitor); + break; + default: + unwrappedMonitors.push(monitor); + } + }); + return unwrappedMonitors; + }; + async getMonitors(from, size, search, sortField, sortDirection, state) { this.setState({ loadingMonitors: true }); try { @@ -137,7 +158,7 @@ export default class Monitors extends Component { const response = await httpClient.get('../api/alerting/monitors', { query: params }); if (response.ok) { const { monitors, totalMonitors } = response; - this.setState({ monitors, totalMonitors }); + this.setState({ monitors: this.formatGetMonitorsResponse(monitors), totalMonitors }); } else { console.log('error getting monitors:', response); // TODO: 'response.ok' is 'false' when there is no alerting config index in the cluster, and notification should not be shown to new Alerting users diff --git a/public/utils/constants.js b/public/utils/constants.js index e784b15a7..21900fae4 100644 --- a/public/utils/constants.js +++ b/public/utils/constants.js @@ -22,11 +22,13 @@ export const SEARCH_TYPE = { GRAPH: 'graph', QUERY: 'query', AD: 'ad', + CLUSTER_METRICS: 'clusterMetrics', }; export const MONITOR_TYPE = { QUERY_LEVEL: 'query_level_monitor', BUCKET_LEVEL: 'bucket_level_monitor', + CLUSTER_METRICS: 'cluster_metrics_monitor', }; export const DESTINATION_ACTIONS = { diff --git a/public/utils/validate.js b/public/utils/validate.js index e4b0cb211..6b03a0d09 100644 --- a/public/utils/validate.js +++ b/public/utils/validate.js @@ -23,10 +23,14 @@ export const validateActionName = (monitor, trigger) => (value) => { // TODO: Expand on this validation by passing in triggerValues and comparing the current // action's name with names of other actions in the trigger creation form. let actions; - if (monitor.monitor_type === MONITOR_TYPE.QUERY_LEVEL) { - actions = _.get(trigger, `${TRIGGER_TYPE.QUERY_LEVEL}.actions`, []); - } else if (monitor.monitor_type === MONITOR_TYPE.BUCKET_LEVEL) { - actions = _.get(trigger, `${TRIGGER_TYPE.BUCKET_LEVEL}.actions`, []); + switch (monitor.monitor_type) { + case MONITOR_TYPE.QUERY_LEVEL: + case MONITOR_TYPE.CLUSTER_METRICS: + actions = _.get(trigger, `${TRIGGER_TYPE.QUERY_LEVEL}.actions`, []); + break; + case MONITOR_TYPE.BUCKET_LEVEL: + actions = _.get(trigger, `${TRIGGER_TYPE.BUCKET_LEVEL}.actions`, []); + break; } const matches = actions.filter((action) => action.name === value); if (matches.length > 1) return 'Action name is already used.'; @@ -56,6 +60,11 @@ export const validateRequiredNumber = (value) => { if (value === undefined || typeof value === 'string') return 'Provide a value.'; }; +export const isInvalidApiPath = (name, form) => { + const path = _.get(form, `values.${name}`); + return _.get(form.touched, name, false) && _.isEmpty(path); +}; + export const validateMonitorName = (httpClient, monitorToEdit) => async (value) => { try { if (!value) return 'Required.';