From a239f6fe879cbc4a8f253968ac16c10f723c4680 Mon Sep 17 00:00:00 2001 From: "opensearch-trigger-bot[bot]" <98922864+opensearch-trigger-bot[bot]@users.noreply.github.com> Date: Wed, 23 Oct 2024 13:23:14 -0700 Subject: [PATCH 1/7] Added 2.18.0 release notes. (#1132) (#1134) * Added 2.18.0 release notes. * Added 2.18.0 release notes. --------- (cherry picked from commit 37a6ce588174201353fbcf54497de4e22dcc6cdd) Signed-off-by: AWSHurneyt Signed-off-by: github-actions[bot] Co-authored-by: github-actions[bot] --- ...ashboards-plugin.release-notes-2.18.0.0.md | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 release-notes/opensearch-alerting-dashboards-plugin.release-notes-2.18.0.0.md diff --git a/release-notes/opensearch-alerting-dashboards-plugin.release-notes-2.18.0.0.md b/release-notes/opensearch-alerting-dashboards-plugin.release-notes-2.18.0.0.md new file mode 100644 index 00000000..0f55feb4 --- /dev/null +++ b/release-notes/opensearch-alerting-dashboards-plugin.release-notes-2.18.0.0.md @@ -0,0 +1,20 @@ +## Version 2.18.0.0 2024-10-15 +Compatible with OpenSearch Dashboards 2.18.0 + +### Maintenance +* Increment version to 2.18.0.0 ([#1098](https://github.com/opensearch-project/alerting-dashboards-plugin/pull/1098)) + +### Enhancements +* Context aware alert analysis ([#996](https://github.com/opensearch-project/alerting-dashboards-plugin/pull/996)) +* [navigation]feat: update category to flatten menus in analytics(all) use case ([#1114](https://github.com/opensearch-project/alerting-dashboards-plugin/pull/1114)) +* Support top N log pattern data in summary context provider for visual editor monitor ([#1119](https://github.com/opensearch-project/alerting-dashboards-plugin/pull/1119)) + +### Bug fixes +* Fit and Finish UX Fixes ([#1092](https://github.com/opensearch-project/alerting-dashboards-plugin/pull/1092)) +* Fit and Finish UX changes Pt 2 ([#1099](https://github.com/opensearch-project/alerting-dashboards-plugin/pull/1099)) +* Fix assistant plugin override issue and return dataSourceId in context ([#1102](https://github.com/opensearch-project/alerting-dashboards-plugin/pull/1102)) +* add width for recent alerts card ([#1117](https://github.com/opensearch-project/alerting-dashboards-plugin/pull/1117)) +* Fix ui_metadata is not fetched when MDS client is used ([#1124](https://github.com/opensearch-project/alerting-dashboards-plugin/pull/1124)) + +### Documentation +* Added 2.18.0 release notes. ([#1132](https://github.com/opensearch-project/alerting-dashboards-plugin/pull/1132)) \ No newline at end of file From 4dfa34f5e4e939d8acfa0f151d20e604c23fe05b Mon Sep 17 00:00:00 2001 From: "opensearch-trigger-bot[bot]" <98922864+opensearch-trigger-bot[bot]@users.noreply.github.com> Date: Wed, 23 Oct 2024 13:35:38 -0700 Subject: [PATCH 2/7] fix: data source picker is remounted multiple times (#1131) (#1137) (cherry picked from commit 7deec899da935484f1a48de3dbb29f4d74dc4f51) Signed-off-by: SuZhou-Joe Signed-off-by: github-actions[bot] Co-authored-by: github-actions[bot] --- .../DataSourceAlertsCard/DataSourceAlertsCard.tsx | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/public/components/DataSourceAlertsCard/DataSourceAlertsCard.tsx b/public/components/DataSourceAlertsCard/DataSourceAlertsCard.tsx index 6dd41b89..2e91ea87 100644 --- a/public/components/DataSourceAlertsCard/DataSourceAlertsCard.tsx +++ b/public/components/DataSourceAlertsCard/DataSourceAlertsCard.tsx @@ -3,7 +3,7 @@ * SPDX-License-Identifier: Apache-2.0 */ -import React, { useCallback, useEffect, useState } from "react"; +import React, { useCallback, useEffect, useMemo, useState } from "react"; import { EuiBadge, EuiDescriptionList, EuiEmptyPrompt, EuiFlexGroup, EuiFlexItem, EuiHorizontalRule, EuiLink, EuiLoadingContent, EuiPanel, EuiText, EuiTitle } from "@elastic/eui"; import { DataSourceManagementPluginSetup, DataSourceOption } from "../../../../../src/plugins/data_source_management/public"; import { getApplication, getClient, getNotifications, getSavedObjectsClient } from "../../services"; @@ -18,7 +18,13 @@ export interface DataSourceAlertsCardProps { } export const DataSourceAlertsCard: React.FC = ({ getDataSourceMenu }) => { - const DataSourceSelector = getDataSourceMenu?.(); + const DataSourceSelector = useMemo(() => { + if (getDataSourceMenu) { + return getDataSourceMenu(); + } + + return null; + }, [getDataSourceMenu]); const [loading, setLoading] = useState(false); const [dataSource, setDataSource] = useState({ label: 'Local cluster', From 2725e5d41949c864655381d0b74c1fc500531d0b Mon Sep 17 00:00:00 2001 From: "opensearch-trigger-bot[bot]" <98922864+opensearch-trigger-bot[bot]@users.noreply.github.com> Date: Mon, 28 Oct 2024 11:15:24 -0700 Subject: [PATCH 3/7] fix: default data source (#1143) (#1145) * fix: default data source * feat: optimize * feat: update comment --------- (cherry picked from commit 40baf85ec5164f189ae58c3012b29e3d8fff4cd5) Signed-off-by: SuZhou-Joe Signed-off-by: github-actions[bot] Co-authored-by: github-actions[bot] --- public/pages/utils/constants.ts | 15 ++++++++------- public/plugin.tsx | 9 ++++++++- 2 files changed, 16 insertions(+), 8 deletions(-) diff --git a/public/pages/utils/constants.ts b/public/pages/utils/constants.ts index a08e2ba2..ff30dd07 100644 --- a/public/pages/utils/constants.ts +++ b/public/pages/utils/constants.ts @@ -9,10 +9,11 @@ import { DataSourceOption } from "../../../../../src/plugins/data_source_managem export const COMMENTS_ENABLED_SETTING = "plugins.alerting.comments_enabled"; const LocalCluster: DataSourceOption = { - label: i18n.translate("dataSource.localCluster", { - defaultMessage: "Local cluster", - }), - id: "", - }; - - export const dataSourceObservable = new BehaviorSubject(LocalCluster); \ No newline at end of file + label: i18n.translate("dataSource.localCluster", { + defaultMessage: "Local cluster", + }), + id: "", +}; + +// We should use empty object for default value as local cluster may be disabled +export const dataSourceObservable = new BehaviorSubject({}); \ No newline at end of file diff --git a/public/plugin.tsx b/public/plugin.tsx index 82ce91b7..bc63d80b 100644 --- a/public/plugin.tsx +++ b/public/plugin.tsx @@ -62,7 +62,14 @@ export interface AlertingStartDeps { export class AlertingPlugin implements Plugin { private updateDefaultRouteOfManagementApplications: AppUpdater = () => { - const hash = `#/?dataSourceId=${dataSourceObservable.value?.id || ""}`; + const dataSourceValue = dataSourceObservable.value?.id; + let hash = `#/`; + // When data source value is undefined, + // it means the data source picker has not determine which data source to use(local or default data source) + // so we should not append any data source id into hash to avoid impacting the data source picker. + if (dataSourceValue !== undefined) { + hash = `#/?dataSourceId=${dataSourceValue}`; + } return { defaultPath: hash, }; From 02e0ac538e30a7f6a8e6ef2b64b7ec799dced09e Mon Sep 17 00:00:00 2001 From: "opensearch-trigger-bot[bot]" <98922864+opensearch-trigger-bot[bot]@users.noreply.github.com> Date: Mon, 28 Oct 2024 11:35:16 -0700 Subject: [PATCH 4/7] make data source default cluster for alerts card (#1146) (#1148) (cherry picked from commit ab65362e76f053e750be8433689dea06fb4e4f7e) Signed-off-by: Joanne Wang Signed-off-by: github-actions[bot] Co-authored-by: github-actions[bot] --- .../components/DataSourceAlertsCard/DataSourceAlertsCard.tsx | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/public/components/DataSourceAlertsCard/DataSourceAlertsCard.tsx b/public/components/DataSourceAlertsCard/DataSourceAlertsCard.tsx index 2e91ea87..00b2e395 100644 --- a/public/components/DataSourceAlertsCard/DataSourceAlertsCard.tsx +++ b/public/components/DataSourceAlertsCard/DataSourceAlertsCard.tsx @@ -26,10 +26,7 @@ export const DataSourceAlertsCard: React.FC = ({ get return null; }, [getDataSourceMenu]); const [loading, setLoading] = useState(false); - const [dataSource, setDataSource] = useState({ - label: 'Local cluster', - id: '', - }); + const [dataSource, setDataSource] = useState(); const [alerts, setAlerts] = useState([]); useEffect(() => { From ea3b1641bd076039e68b4d13000e40120351ade9 Mon Sep 17 00:00:00 2001 From: "opensearch-trigger-bot[bot]" <98922864+opensearch-trigger-bot[bot]@users.noreply.github.com> Date: Tue, 29 Oct 2024 08:04:03 -0700 Subject: [PATCH 5/7] Pass isVisualEditorMonitor flag to downstream for verification (#1139) (#1141) (cherry picked from commit d66c7de4b255f87ac526311245361cd47a5a7c90) Signed-off-by: Songkan Tang Signed-off-by: github-actions[bot] Co-authored-by: github-actions[bot] --- public/pages/Dashboard/utils/tableUtils.js | 1 + 1 file changed, 1 insertion(+) diff --git a/public/pages/Dashboard/utils/tableUtils.js b/public/pages/Dashboard/utils/tableUtils.js index 3e58cd37..0f35a706 100644 --- a/public/pages/Dashboard/utils/tableUtils.js +++ b/public/pages/Dashboard/utils/tableUtils.js @@ -283,6 +283,7 @@ export const alertColumns = ( dsl: dsl, index: index, topNLogPatternData: topNLogPatternData, + isVisualEditorMonitor: isVisualEditorMonitor, }, dataSourceId: dataSourceQuery?.query?.dataSourceId, }; From a545ffc0b8449d36af277a52893908dee86df155 Mon Sep 17 00:00:00 2001 From: "opensearch-trigger-bot[bot]" <98922864+opensearch-trigger-bot[bot]@users.noreply.github.com> Date: Tue, 29 Oct 2024 13:34:33 -0700 Subject: [PATCH 6/7] fix data source picker for alerts card (#1149) (#1151) (cherry picked from commit 20b50b51e5b411f36b360ba0232b116043563d60) Signed-off-by: Joanne Wang Signed-off-by: github-actions[bot] Co-authored-by: github-actions[bot] --- public/components/DataSourceAlertsCard/DataSourceAlertsCard.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/components/DataSourceAlertsCard/DataSourceAlertsCard.tsx b/public/components/DataSourceAlertsCard/DataSourceAlertsCard.tsx index 00b2e395..77f9089c 100644 --- a/public/components/DataSourceAlertsCard/DataSourceAlertsCard.tsx +++ b/public/components/DataSourceAlertsCard/DataSourceAlertsCard.tsx @@ -49,7 +49,7 @@ export const DataSourceAlertsCard: React.FC = ({ get }, [dataSource]); const onDataSourceSelected = useCallback((options: any[]) => { - if (dataSource?.id !== undefined && dataSource?.id !== options[0]?.id) { + if (dataSource?.id === undefined || dataSource?.id !== options[0]?.id) { setDataSource(options[0]); } }, [dataSource]); From 92153322d4576ccdc3ba643452cec289e39fd097 Mon Sep 17 00:00:00 2001 From: opensearch-ci-bot Date: Wed, 4 Dec 2024 00:25:53 +0000 Subject: [PATCH 7/7] Increment version to 2.18.0.0 Signed-off-by: opensearch-ci-bot --- opensearch_dashboards.json | 16 ++++++++++++---- package.json | 2 +- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/opensearch_dashboards.json b/opensearch_dashboards.json index 49b04f68..d5fa6d7f 100644 --- a/opensearch_dashboards.json +++ b/opensearch_dashboards.json @@ -2,8 +2,14 @@ "id": "alertingDashboards", "version": "2.18.0.0", "opensearchDashboardsVersion": "2.18.0", - "configPath": ["opensearch_alerting"], - "optionalPlugins": ["dataSource", "dataSourceManagement", "assistantDashboards"], + "configPath": [ + "opensearch_alerting" + ], + "optionalPlugins": [ + "dataSource", + "dataSourceManagement", + "assistantDashboards" + ], "requiredPlugins": [ "uiActions", "dashboard", @@ -20,5 +26,7 @@ "server": true, "ui": true, "supportedOSDataSourceVersions": ">=2.13.0", - "requiredOSDataSourcePlugins": ["opensearch-alerting"] -} + "requiredOSDataSourcePlugins": [ + "opensearch-alerting" + ] +} \ No newline at end of file diff --git a/package.json b/package.json index ea185ed3..afe19eb6 100644 --- a/package.json +++ b/package.json @@ -68,4 +68,4 @@ "engines": { "yarn": "^1.21.1" } -} +} \ No newline at end of file