From 559b479ba25feb54022b5420d304a6e794cf8768 Mon Sep 17 00:00:00 2001 From: Annie Lee Date: Thu, 9 Sep 2021 15:04:49 -0700 Subject: [PATCH 1/6] Add icon tooltip --- public/components/IconToolTip/IconToolTip.js | 43 +++++++++++++++++++ public/components/IconToolTip/index.js | 29 +++++++++++++ .../expressions/ForExpression.js | 5 ++- .../expressions/GroupByExpression.js | 10 ++++- .../expressions/MetricExpression.js | 11 +++-- .../expressions/WhereExpression.js | 10 ++++- .../CreateMonitor/utils/constants.js | 6 +++ 7 files changed, 106 insertions(+), 8 deletions(-) create mode 100644 public/components/IconToolTip/IconToolTip.js create mode 100644 public/components/IconToolTip/index.js diff --git a/public/components/IconToolTip/IconToolTip.js b/public/components/IconToolTip/IconToolTip.js new file mode 100644 index 000000000..9c774774e --- /dev/null +++ b/public/components/IconToolTip/IconToolTip.js @@ -0,0 +1,43 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file 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 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..6c79c2a29 --- /dev/null +++ b/public/components/IconToolTip/index.js @@ -0,0 +1,29 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file 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 IconToolTip from './IconToolTip'; + +export default IconToolTip; 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/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.'; From 05b8bcc7b8cd6330c10dfaea16904724901f796e Mon Sep 17 00:00:00 2001 From: Annie Lee Date: Thu, 9 Sep 2021 15:15:03 -0700 Subject: [PATCH 2/6] Update text and rename MonitorDefinitionCard directory --- .../MonitorDefinitionCard.js | 0 .../index.js | 0 .../CreateMonitor/components/MonitorType/MonitorType.js | 6 +++--- .../containers/MonitorDetails/MonitorDetails.js | 3 +-- 4 files changed, 4 insertions(+), 5 deletions(-) rename public/pages/CreateMonitor/components/{MonitorDefinitionCards => MonitorDefinitionCard}/MonitorDefinitionCard.js (100%) rename public/pages/CreateMonitor/components/{MonitorDefinitionCards => MonitorDefinitionCard}/index.js (100%) 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/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/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, From 0ec3567c191f63af3331cb18ca08a11e61d0c690 Mon Sep 17 00:00:00 2001 From: Annie Lee Date: Fri, 10 Sep 2021 09:40:10 -0700 Subject: [PATCH 3/6] Update Schedule.js --- public/pages/CreateMonitor/components/Schedule/Schedule.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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} From 985651d465c00f422422eb9e2fadf219dffb8c52 Mon Sep 17 00:00:00 2001 From: Annie Lee Date: Fri, 10 Sep 2021 09:40:10 -0700 Subject: [PATCH 4/6] Update Schedule.js Signed-off-by: Annie Lee --- public/pages/CreateMonitor/components/Schedule/Schedule.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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} From 6719d1d09bb577f08d303524131726fedd19da50 Mon Sep 17 00:00:00 2001 From: Annie Lee Date: Fri, 10 Sep 2021 10:10:53 -0700 Subject: [PATCH 5/6] Update opensearch-alerting-dashboards-plugin.release-notes-1.1.0.0.md --- ...pensearch-alerting-dashboards-plugin.release-notes-1.1.0.0.md | 1 + 1 file changed, 1 insertion(+) 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 08a5d3ce9..1069c108e 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 @@ -38,6 +38,7 @@ Compatible with OpenSearch Dashboards 1.1.0 * 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 From 3156bb71512b9e07e5ca49de6df408c703d10642 Mon Sep 17 00:00:00 2001 From: Annie Lee Date: Fri, 10 Sep 2021 10:13:17 -0700 Subject: [PATCH 6/6] Remove license Signed-off-by: Annie Lee --- public/components/IconToolTip/IconToolTip.js | 15 --------------- public/components/IconToolTip/index.js | 15 --------------- 2 files changed, 30 deletions(-) diff --git a/public/components/IconToolTip/IconToolTip.js b/public/components/IconToolTip/IconToolTip.js index 9c774774e..bc9ac2366 100644 --- a/public/components/IconToolTip/IconToolTip.js +++ b/public/components/IconToolTip/IconToolTip.js @@ -9,21 +9,6 @@ * 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 PropTypes from 'prop-types'; import { EuiIcon, EuiToolTip } from '@elastic/eui'; diff --git a/public/components/IconToolTip/index.js b/public/components/IconToolTip/index.js index 6c79c2a29..7421fd0a2 100644 --- a/public/components/IconToolTip/index.js +++ b/public/components/IconToolTip/index.js @@ -9,21 +9,6 @@ * 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 IconToolTip from './IconToolTip'; export default IconToolTip;