Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sync anywhere-dev with main #479

Merged
merged 24 commits into from
Feb 13, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
362a553
Bumped version from 2.3 to 2.4. (#346)
AWSHurneyt Oct 17, 2022
de7be74
Bumped d3-color version. (#350)
AWSHurneyt Oct 17, 2022
db49f60
Support windows CI (#354)
lezzago Nov 3, 2022
7d074c0
Add 2.4 release notes (#357)
lezzago Nov 4, 2022
9b74c2a
Fix confidence bug (#360)
kaituo Nov 8, 2022
4ba04f0
Bumped loader-utils version to address dependabot alert. (#361)
AWSHurneyt Nov 17, 2022
a36942e
updated link to dashboards developer guide (#349)
amsiglan Nov 23, 2022
6287bd5
Fixed a bug that prevented the throttling settings from displaying fo…
AWSHurneyt Nov 30, 2022
6dbff48
Adjust OpenSearch-Dashboards version used by test workflows. (#363)
AWSHurneyt Nov 30, 2022
27ceb55
avoid nesting search inside search (#382)
amsiglan Dec 2, 2022
e8572fc
Bumped loader-utils version to address dependabot alert. (#379)
AWSHurneyt Dec 2, 2022
a4f8bd0
[BUG] Issues in the UI above 200 destinations paging issue #195 (#375)
jovancvetkovic3006 Dec 2, 2022
c117f3f
sorted data by date (#385)
amsiglan Dec 2, 2022
bcfe119
Align all flyout components to be overlay kind and add close button X…
djindjic Dec 6, 2022
939b1bc
Bumped decode-uri-component version to address CVE-2022-38900. (#400)
AWSHurneyt Dec 6, 2022
e34fa02
Fixed an issue that was causing the results of the ctx object to be e…
AWSHurneyt Dec 8, 2022
bd62a0b
Keep monitor table cell width flexible; Check for whether monitor is …
amsiglan Dec 9, 2022
8dfe242
Add release notes for 2.4.1 (#420)
getsaurabh02 Dec 13, 2022
1e70149
Bumped version to 2.5. (#437)
AWSHurneyt Jan 10, 2023
cfc60b6
2.5.0 release notes. (#440)
AWSHurneyt Jan 10, 2023
99b0bd5
Refactored the help text elements displayed when users access the des…
AWSHurneyt Jan 12, 2023
6ee1dc7
Fix CVE-2022-46175 (#453)
bowenlan-amzn Jan 23, 2023
bbdd683
Updated MAINTAINERS.md to match recommended opensearch-project format…
dblock Jan 27, 2023
903e85b
Refactored cypress and unit test workflows to use the 2.5.0 tag as th…
AWSHurneyt Jan 27, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions .github/workflows/cypress-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,9 @@ on:
branches:
- "*"
env:
OPENSEARCH_DASHBOARDS_VERSION: '2.3'
OPENSEARCH_VERSION: '2.3.0-SNAPSHOT'
OPENSEARCH_DASHBOARDS_VERSION: '2.5.0'
OPENSEARCH_VERSION: '2.5.0-SNAPSHOT'
ALERTING_PLUGIN_BRANCH: '2.5'
jobs:
tests:
name: Run Cypress E2E tests
Expand All @@ -29,7 +30,7 @@ jobs:
with:
path: alerting
repository: opensearch-project/alerting
ref: 'main'
ref: ${{ env.ALERTING_PLUGIN_BRANCH }}
- name: Run Opensearch with plugin
run: |
cd alerting
Expand Down
20 changes: 17 additions & 3 deletions .github/workflows/unit-tests-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,19 @@ on:
branches:
- "*"
env:
OPENSEARCH_DASHBOARDS_VERSION: '2.2'
OPENSEARCH_DASHBOARDS_VERSION: '2.5.0'
jobs:
tests:
name: Run unit tests
runs-on: ubuntu-latest
strategy:
matrix:
os: [ ubuntu-latest, macos-latest, windows-latest ]
runs-on: ${{ matrix.os }}
steps:
# Enable longer filenames for windows
- name: Enable longer filenames
if: ${{ matrix.os == 'windows-latest' }}
run: git config --system core.longpaths true
- name: Checkout OpenSearch Dashboards
uses: actions/checkout@v2
with:
Expand Down Expand Up @@ -42,9 +49,16 @@ jobs:
run: |
cd OpenSearch-Dashboards/plugins/alerting-dashboards-plugin
yarn osd bootstrap
- name: Run tests
- name: Run window tests
if: ${{ matrix.os == 'windows-latest' }}
run: |
cd OpenSearch-Dashboards/plugins/alerting-dashboards-plugin
yarn run test:jest:windows --coverage
- name: Run non-window tests
if: ${{ matrix.os != 'windows-latest' }}
run: |
cd OpenSearch-Dashboards/plugins/alerting-dashboards-plugin
yarn run test:jest --coverage
- name: Uploads coverage
if: ${{ matrix.os == 'ubuntu-latest' }}
uses: codecov/codecov-action@v1
2 changes: 1 addition & 1 deletion DEVELOPER_GUIDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ You will need to install [node.js](https://nodejs.org/en/), [nvm](https://github
1. Download and install the appropriate [OpenSearch Alerting plugin](https://github.com/opensearch-project/alerting).
1. Download the OpenSearch-Dashboards source code for the [version specified in package.json](./package.json#L9) you want to set up.

See the [OpenSearch Dashboards developer guide](https://github.com/opensearch-project/OpenSearch/blob/main/DEVELOPER_GUIDE.md) for more instructions on setting up your development environment.
See the [OpenSearch Dashboards developer guide](https://github.com/opensearch-project/OpenSearch-Dashboards/blob/main/DEVELOPER_GUIDE.md) for more instructions on setting up your development environment.

1. Change your node version to the version specified in `.node-version` inside the OpenSearch-Dashboards root directory.
1. cd into the `plugins` directory of the OpenSearch-Dashboards source code directory.
Expand Down
25 changes: 13 additions & 12 deletions MAINTAINERS.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
# OpenSearch Maintainers
## Overview

## Maintainers
| Maintainer | GitHub ID | Affiliation |
| --------------- | --------- | ----------- |
| Ashish Agrawal | [lezzago](https://github.com/lezzago) | Amazon |
| Mohammad Qureshi | [qreshi](https://github.com/qreshi) | Amazon |
| Sriram | [skkosuri-amzn](https://github.com/skkosuri-amzn) | Amazon |
| Bowen Lan | [bowenlan-amzn](https://github.com/bowenlan-amzn) | Amazon |
| Rishabh Maurya | [rishabhmaurya](https://github.com/rishabhmaurya) | Amazon |
| Tianli Feng | [tlfeng](https://github.com/tlfeng) | Amazon |
| Annie Lee | [leeyun-amzn](https://github.com/leeyun-amzn) | Amazon |
This document contains a list of maintainers in this repo. See [opensearch-project/.github/RESPONSIBILITIES.md](https://github.com/opensearch-project/.github/blob/main/RESPONSIBILITIES.md#maintainer-responsibilities) that explains what the role of maintainer means, what maintainers do in this and other repos, and how they should be doing it. If you're interested in contributing, and becoming a maintainer, see [CONTRIBUTING](CONTRIBUTING.md).

[This document](https://github.com/opensearch-project/.github/blob/main/MAINTAINERS.md) explains what maintainers do in this repo, and how they should be doing it. If you're interested in contributing, see [CONTRIBUTING](CONTRIBUTING.md).
## Current Maintainers

| Maintainer | GitHub ID | Affiliation |
| ---------------- | ------------------------------------------------- | ----------- |
| Ashish Agrawal | [lezzago](https://github.com/lezzago) | Amazon |
| Mohammad Qureshi | [qreshi](https://github.com/qreshi) | Amazon |
| Sriram | [skkosuri-amzn](https://github.com/skkosuri-amzn) | Amazon |
| Bowen Lan | [bowenlan-amzn](https://github.com/bowenlan-amzn) | Amazon |
| Rishabh Maurya | [rishabhmaurya](https://github.com/rishabhmaurya) | Amazon |
| Tianli Feng | [tlfeng](https://github.com/tlfeng) | Amazon |
| Annie Lee | [leeyun-amzn](https://github.com/leeyun-amzn) | Amazon |
1 change: 1 addition & 0 deletions babel.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,6 @@ module.exports = {
plugins: [
require('@babel/plugin-proposal-class-properties'),
require('@babel/plugin-proposal-object-rest-spread'),
require('@babel/plugin-transform-modules-commonjs'),
],
};
10 changes: 5 additions & 5 deletions cypress/integration/query_level_monitor_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ describe('Query-Level Monitors', () => {
cy.contains(SAMPLE_MONITOR, { timeout: 20000 });

// Select the existing monitor
cy.get('a').contains(SAMPLE_MONITOR, { timeout: 20000 }).click();
cy.get(`[data-test-subj="${SAMPLE_MONITOR}"]`).click();

// Click Edit button
cy.contains('Edit', { timeout: 20000 }).click({ force: true });
Expand Down Expand Up @@ -195,7 +195,7 @@ describe('Query-Level Monitors', () => {
cy.contains(SAMPLE_MONITOR, { timeout: 20000 });

// Select the existing monitor
cy.get('a').contains(SAMPLE_MONITOR, { timeout: 20000 }).click({ force: true });
cy.get(`[data-test-subj="${SAMPLE_MONITOR}"]`).click({ force: true });

// Click Edit button
cy.contains('Edit', { timeout: 20000 }).click({ force: true });
Expand Down Expand Up @@ -304,7 +304,7 @@ describe('Query-Level Monitors', () => {
cy.contains(SAMPLE_MONITOR);

// Select the existing monitor
cy.get('a').contains(SAMPLE_MONITOR).click();
cy.get(`[data-test-subj="${SAMPLE_MONITOR}"]`).click();

// Click Edit button
cy.contains('Edit').click({ force: true });
Expand Down Expand Up @@ -373,7 +373,7 @@ describe('Query-Level Monitors', () => {
cy.contains(SAMPLE_DAYS_INTERVAL_MONITOR, { timeout: 20000 });

// Select the existing monitor
cy.get('a').contains(SAMPLE_DAYS_INTERVAL_MONITOR).click({ force: true });
cy.get(`[data-test-subj="${SAMPLE_DAYS_INTERVAL_MONITOR}"]`).click({ force: true });

// Click Edit button
cy.contains('Edit').click({ force: true });
Expand All @@ -398,7 +398,7 @@ describe('Query-Level Monitors', () => {
cy.contains(SAMPLE_CRON_EXPRESSION_MONITOR, { timeout: 20000 });

// Select the existing monitor
cy.get('a').contains(SAMPLE_CRON_EXPRESSION_MONITOR).click({ force: true });
cy.get(`[data-test-subj="${SAMPLE_CRON_EXPRESSION_MONITOR}"]`).click({ force: true });

// Click Edit button
cy.contains('Edit').click({ force: true });
Expand Down
4 changes: 2 additions & 2 deletions opensearch_dashboards.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"id": "alertingDashboards",
"version": "2.3.0.0",
"opensearchDashboardsVersion": "2.3.0",
"version": "2.5.0.0",
"opensearchDashboardsVersion": "2.5.0",
"configPath": ["opensearch_alerting"],
"requiredPlugins": [],
"server": true,
Expand Down
11 changes: 8 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "opensearch-alerting-dashboards",
"version": "2.3.0.0",
"version": "2.5.0.0",
"description": "OpenSearch Dashboards Alerting Plugin",
"main": "index.js",
"license": "Apache-2.0",
Expand All @@ -16,6 +16,7 @@
"osd": "node ../../scripts/osd",
"opensearch": "node ../../scripts/opensearch",
"lint": "../../node_modules/.bin/eslint '**/*.js' -c .eslintrc --ignore-path .gitignore",
"test:jest:windows": "SET TZ=UTC ../../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",
Expand All @@ -31,7 +32,8 @@
"@elastic/eslint-import-resolver-kibana": "link:../../packages/osd-eslint-import-resolver-opensearch-dashboards",
"cypress": "^6.0.0",
"husky": "^3.0.0",
"lint-staged": "^10.0.0"
"lint-staged": "^10.0.0",
"@babel/plugin-transform-modules-commonjs": "^7.16.5"
},
"dependencies": {
"brace": "0.11.1",
Expand All @@ -43,12 +45,15 @@
"resolutions": {
"ansi-regex": "^5.0.1",
"async": "^3.2.3",
"decode-uri-component": "^0.2.1",
"fstream": "1.0.12",
"glob-parent": "^5.1.2",
"json-schema": "^0.4.0",
"loader-utils": "1.4.2",
"minimist": "^1.2.6",
"moment": "^2.29.4",
"terser": "^4.8.1"
"terser": "^4.8.1",
"**/d3-color": "^3.1.0"
},
"engines": {
"yarn": "^1.21.1"
Expand Down
47 changes: 27 additions & 20 deletions public/components/Flyout/flyouts/__snapshots__/flyouts.test.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -8,33 +8,40 @@ Object {
"data-test-subj": "alertsDashboardFlyout_undefined",
"hideCloseButton": true,
"size": "m",
"type": "push",
},
"footer": <EuiButtonEmpty
data-test-subj="alertsDashboardFlyout_closeButton_undefined"
iconType="cross"
onClick={[Function]}
style={
Object {
"marginLeft": "0px",
"paddingLeft": "0px",
}
}
>
Close
</EuiButtonEmpty>,
"footerProps": Object {
"style": Object {
"backgroundColor": "#F5F7FA",
},
},
"header": <EuiText
data-test-subj="alertsDashboardFlyout_header_undefined"
"header": <EuiFlexGroup
alignItems="center"
justifyContent="flexStart"
>
<h2>
Alerts by undefined
</h2>
</EuiText>,
<EuiFlexItem
className="eui-textTruncate"
>
<EuiTitle
className="eui-textTruncate"
data-test-subj="alertsDashboardFlyout_header_undefined"
size="m"
>
<h3>
Alerts by undefined
</h3>
</EuiTitle>
</EuiFlexItem>
<EuiFlexItem
grow={false}
>
<EuiButtonIcon
data-test-subj="alertsDashboardFlyout_closeButton_undefined"
display="empty"
iconSize="m"
iconType="cross"
/>
</EuiFlexItem>
</EuiFlexGroup>,
"headerProps": Object {
"hasBorder": true,
},
Expand Down
36 changes: 21 additions & 15 deletions public/components/Flyout/flyouts/alertsDashboard.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
*/

import React from 'react';
import { EuiButtonEmpty, EuiText } from '@elastic/eui';
import { EuiFlexGroup, EuiButtonIcon, EuiTitle, EuiFlexItem } from '@elastic/eui';
import AlertsDashboardFlyoutComponent from './components/AlertsDashboardFlyoutComponent';

const alertsDashboard = (payload) => {
Expand All @@ -15,25 +15,31 @@ const alertsDashboard = (payload) => {
size: 'm',
hideCloseButton: true,
'data-test-subj': `alertsDashboardFlyout_${trigger_name}`,
type: 'push',
},
headerProps: { hasBorder: true },
header: (
<EuiText data-test-subj={`alertsDashboardFlyout_header_${trigger_name}`}>
<h2>{`Alerts by ${trigger_name}`}</h2>
</EuiText>
<EuiFlexGroup justifyContent="flexStart" alignItems="center">
<EuiFlexItem className="eui-textTruncate">
<EuiTitle
className="eui-textTruncate"
size={'m'}
data-test-subj={`alertsDashboardFlyout_header_${trigger_name}`}
>
<h3>{`Alerts by ${trigger_name}`}</h3>
</EuiTitle>
</EuiFlexItem>
<EuiFlexItem grow={false}>
<EuiButtonIcon
data-test-subj={`alertsDashboardFlyout_closeButton_${trigger_name}`}
iconType="cross"
display="empty"
iconSize="m"
onClick={closeFlyout}
/>
</EuiFlexItem>
</EuiFlexGroup>
),
footerProps: { style: { backgroundColor: '#F5F7FA' } },
footer: (
<EuiButtonEmpty
iconType={'cross'}
onClick={() => closeFlyout()}
style={{ paddingLeft: '0px', marginLeft: '0px' }}
data-test-subj={`alertsDashboardFlyout_closeButton_${trigger_name}`}
>
Close
</EuiButtonEmpty>
),
body: <AlertsDashboardFlyoutComponent {...payload} />,
};
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -361,7 +361,7 @@ export default class AlertsDashboardFlyoutComponent extends Component {
columns.splice(
0,
0,
getAlertsFindingColumn(httpClient, history, true, location, notifications)
getAlertsFindingColumn(httpClient, history, location, notifications)
);
break;
default:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,8 @@ export function getDataFromResponse(response, fieldName, monitorType) {
const buckets = _.get(response, 'aggregations.composite_agg.buckets', []);
return buckets
.map((bucket) => getXYValuesByFieldName(bucket, fieldName))
.filter(filterInvalidYValues);
.filter(filterInvalidYValues)
.sort((a, b) => a.x - b.x);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -286,6 +286,7 @@ export default class CreateMonitor extends Component {
plugins={plugins}
isAd={values.searchType === SEARCH_TYPE.AD}
detectorId={this.props.detectorId}
setFlyout={this.props.setFlyout}
/>
<EuiSpacer />

Expand Down
3 changes: 1 addition & 2 deletions public/pages/CreateTrigger/components/Action/Action.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ const Action = ({
// Just a swap correct fields.
arrayHelpers.replace(index, {
...action,
destination_id: options[0].value,
destination_id: options[0]?.value,
});
},
onBlur: (e, field, form) => {
Expand All @@ -96,7 +96,6 @@ const Action = ({
</React.Fragment>
),
rowHeight: 45,
async: true,
isLoading: loadingDestinations,
}}
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,7 @@ export default function Message(
switch (monitorType) {
case MONITOR_TYPE.BUCKET_LEVEL:
displayActionableAlertsOptions = true;
displayThrottlingSettings = actionExecutionScopeId === NOTIFY_OPTIONS_VALUES.PER_ALERT;
actionableAlertsSelections = _.get(values, actionableAlertsSelectionsPath);
break;
case MONITOR_TYPE.DOC_LEVEL:
Expand All @@ -194,6 +195,8 @@ export default function Message(
_.set(values, actionableAlertsSelectionsPath, actionableAlertsSelections);
}

if (!displayThrottlingSettings) _.set(values, `${actionPath}.throttle_enabled`, false);

let preview = '';
try {
preview = Mustache.render(action.message_template.source, context);
Expand Down
Loading