-
Notifications
You must be signed in to change notification settings - Fork 23
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
Hide incompatible index patterns #354
Changes from 7 commits
d594c41
70584c1
fdddc56
7434436
8a7a5df
592cb9e
2977c31
272d0cb
097523f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,11 +3,12 @@ | |
Inspired from [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) | ||
|
||
### Unreleased | ||
- fix: make sure $schema always added to LLM generated vega json object([252](https://github.com/opensearch-project/dashboards-assistant/pull/252)) | ||
|
||
- fix: make sure \$schema always added to LLM generated vega json object([252](https://github.com/opensearch-project/dashboards-assistant/pull/252)) | ||
- feat: expose a general function for agent execution([268](https://github.com/opensearch-project/dashboards-assistant/pull/268)) | ||
- Fix CVE-2024-4067 ([#269](https://github.com/opensearch-project/dashboards-assistant/pull/269)) | ||
- feat: add a dashboards-assistant trigger in query editor([265](https://github.com/opensearch-project/dashboards-assistant/pull/265)) | ||
- fix: make sure $schema always added to LLM generated vega json object([#252](https://github.com/opensearch-project/dashboards-assistant/pull/252)) | ||
- fix: make sure \$schema always added to LLM generated vega json object([#252](https://github.com/opensearch-project/dashboards-assistant/pull/252)) | ||
- feat: added a new visualization type visualization-nlq to support creating visualization from natural language([#264](https://github.com/opensearch-project/dashboards-assistant/pull/264)) | ||
- feat: only allow to select supported index patterns in text to visualization and code changes related to prompt updates([#310](https://github.com/opensearch-project/dashboards-assistant/pull/310)) | ||
- feat: exposed an API to check if a give agent config name has configured with agent id([#307](https://github.com/opensearch-project/dashboards-assistant/pull/307)) | ||
|
@@ -24,7 +25,6 @@ Inspired from [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) | |
- fix: Fix error time field and add filter for same name index patterns([#345](https://github.com/opensearch-project/dashboards-assistant/pull/345)) | ||
- refactor: Add data source info in discover url when navigating([#347](https://github.com/opensearch-project/dashboards-assistant/pull/347)) | ||
|
||
|
||
### 📈 Features/Enhancements | ||
|
||
- Add support for registerMessageParser ([#5](https://github.com/opensearch-project/dashboards-assistant/pull/5)) | ||
|
@@ -52,3 +52,4 @@ Inspired from [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) | |
- Refactor popover to add message action bar and add metrics to thumb-up and thumb-down([#304](https://github.com/opensearch-project/dashboards-assistant/pull/304)) | ||
- Support log pattern analysis ([#339](https://github.com/opensearch-project/dashboards-assistant/pull/339)) | ||
- Pass top N log pattern data from alerting to agent ([#341] (https://github.com/opensearch-project/dashboards-assistant/pull/341)) | ||
- Hide incompatible index patterns ([#354] (https://github.com/opensearch-project/dashboards-assistant/pull/354)) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. move this to There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ok |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,7 +5,6 @@ | |
|
||
import React, { useCallback, useMemo, useState, useEffect, useRef } from 'react'; | ||
import { i18n } from '@osd/i18n'; | ||
|
||
import { useOpenSearchDashboards } from '../../../../../src/plugins/opensearch_dashboards_react/public'; | ||
import { | ||
DataSource, | ||
|
@@ -139,13 +138,9 @@ export const SourceSelector = ({ | |
} | ||
); | ||
if (!res.exists) { | ||
dataSourceIdToIndexPatternIds[key].forEach((indexPatternId) => { | ||
indexPatternOptions.options.forEach((option) => { | ||
if (option.value === indexPatternId) { | ||
option.disabled = true; | ||
} | ||
}); | ||
}); | ||
indexPatternOptions.options = indexPatternOptions.options.filter( | ||
(option) => !dataSourceIdToIndexPatternIds[key].includes(option.value) | ||
); | ||
} | ||
} | ||
); | ||
|
@@ -171,10 +166,27 @@ export const SourceSelector = ({ | |
dataSources.dataSourceService.reload(); | ||
}, [dataSources.dataSourceService]); | ||
|
||
const options = useMemo(() => { | ||
if (dataSourceOptions[0] && dataSourceOptions[0].options.length > 0) { | ||
return dataSourceOptions; | ||
} | ||
return [ | ||
{ | ||
label: 'Index patterns', | ||
options: [ | ||
{ | ||
label: 'No supported index patterns', | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. i18n There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. sorry I forgot it |
||
disabled: true, | ||
}, | ||
], | ||
}, | ||
]; | ||
}, [dataSourceOptions]); | ||
|
||
return ( | ||
<DataSourceSelectable | ||
dataSources={currentDataSources} | ||
dataSourceOptionList={dataSourceOptions} | ||
dataSourceOptionList={options} | ||
setDataSourceOptionList={onSetDataSourceOptions} | ||
onDataSourceSelect={onDataSourceSelect} | ||
selectedSources={selectedSources} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's revert unrelated changes