Skip to content

Commit 6009a5e

Browse files
committed
support data source disabled case
Signed-off-by: Hailong Cui <[email protected]>
1 parent d4dbf89 commit 6009a5e

File tree

3 files changed

+7
-4
lines changed

3 files changed

+7
-4
lines changed

.github/workflows/cypress-workflow.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ jobs:
7474
uses: cypress-io/github-action@v2
7575
with:
7676
working-directory: OpenSearch-Dashboards/plugins/alerting-dashboards-plugin
77-
command: yarn run cypress run
77+
command: yarn run cypress run --browser firefox
7878

7979
# Screenshots are only captured on failure, will change this once we do visual regression tests
8080
- uses: actions/upload-artifact@v4

cypress.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ module.exports = defineConfig({
1414
// We've imported your old cypress plugins here.
1515
// You may want to clean this up later by importing these.
1616
setupNodeEvents(on, config) {
17-
config.env.NODE_OPTIONS = '—max-old-space-size=40960';
17+
config.env.NODE_OPTIONS = '—max-old-space-size=8192';
1818
return require('./.cypress/plugins/index.js')(on, config);
1919
},
2020
specPattern: '.cypress/integration/*.spec.js',

public/components/AlertInsight/AlertInsight.tsx

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ import {
2424
searchQuery,
2525
} from '../../pages/Dashboard/utils/helpers';
2626
import { getApplication, getAssistantDashboards, getClient } from '../../services';
27+
import { dataSourceEnabled } from '../../pages/utils/helpers';
2728

2829
export interface AlertInsightProps {
2930
alert: any;
@@ -36,7 +37,9 @@ export interface AlertInsightProps {
3637
export const AlertInsight: React.FC<AlertInsightProps> = (props: AlertInsightProps) => {
3738
const { alert, children, isAgentConfigured, alertId, datasourceId } = props;
3839
const httpClient = getClient();
39-
const dataSourceQuery = { query: { dataSourceId: datasourceId || '' } };
40+
const dataSourceQuery = dataSourceEnabled()
41+
? { query: { dataSourceId: datasourceId || '' } }
42+
: undefined;
4043

4144
const contextProvider = async () => {
4245
// 1. get monitor definition
@@ -197,7 +200,7 @@ export const AlertInsight: React.FC<AlertInsightProps> = (props: AlertInsightPro
197200
{
198201
key: alertId,
199202
type: 'generate',
200-
suggestions: [`Please summarize this alert, do not use any tool.`],
203+
suggestions: [`Please summarize this alert`],
201204
contextProvider,
202205
},
203206
]);

0 commit comments

Comments
 (0)