-
Notifications
You must be signed in to change notification settings - Fork 913
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
[BUG][Data Explorer][Discover] Automatically load solo added default index pattern #5171
Conversation
Codecov Report
@@ Coverage Diff @@
## main #5171 +/- ##
==========================================
- Coverage 66.76% 66.73% -0.04%
==========================================
Files 3278 3278
Lines 62999 62999
Branches 10031 10031
==========================================
- Hits 42061 42041 -20
+ Misses 18552 18487 -65
- Partials 2386 2471 +85
Flags with carried forward coverage won't be shown. Click here to find out more. |
const indexPatternMissingWarning = i18n.translate( | ||
'discover.valueIsNotConfiguredIndexPatternIDWarningTitle', | ||
{ | ||
defaultMessage: '{id} is not a configured index pattern ID', | ||
values: { | ||
id: `"${id}"`, | ||
}, | ||
} | ||
); | ||
|
||
data.indexPatterns | ||
.get(id) | ||
.then((result) => { | ||
if (isMounted) { | ||
setIndexPattern(result); | ||
} | ||
}) | ||
.catch(() => { | ||
if (isMounted) { | ||
toastNotifications.addDanger({ | ||
title: indexPatternMissingWarning, | ||
}); | ||
} | ||
}); | ||
}; |
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 move indexPatternMissingWarning
inside the catch
, where it is being used.
const indexPatternMissingWarning = i18n.translate( | |
'discover.valueIsNotConfiguredIndexPatternIDWarningTitle', | |
{ | |
defaultMessage: '{id} is not a configured index pattern ID', | |
values: { | |
id: `"${id}"`, | |
}, | |
} | |
); | |
data.indexPatterns | |
.get(id) | |
.then((result) => { | |
if (isMounted) { | |
setIndexPattern(result); | |
} | |
}) | |
.catch(() => { | |
if (isMounted) { | |
toastNotifications.addDanger({ | |
title: indexPatternMissingWarning, | |
}); | |
} | |
}); | |
}; | |
data.indexPatterns | |
.get(id) | |
.then((result) => { | |
if (isMounted) { | |
setIndexPattern(result); | |
} | |
}) | |
.catch(() => { | |
if (isMounted) { | |
const indexPatternMissingWarning = i18n.translate( | |
'discover.valueIsNotConfiguredIndexPatternIDWarningTitle', | |
{ | |
defaultMessage: '{id} is not a configured index pattern ID', | |
values: { | |
id: `"${id}"`, | |
}, | |
} | |
); | |
toastNotifications.addDanger({ | |
title: indexPatternMissingWarning, | |
}); | |
} | |
}); | |
}; |
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.
This looks good, needs to be rebased based on https://github.com/opensearch-project/OpenSearch-Dashboards/pull/5168/files#diff-663ffea1a92b4c32f69ad6a65f15d9b07ae759bc026568db627d950842fcad07 though since there is a little overlap
@@ -71,7 +72,7 @@ export const DiscoverTable = ({ history }: Props) => { | |||
); | |||
|
|||
const { rows } = fetchState || {}; | |||
const { savedSearch } = useSearch(services); | |||
const { savedSearch } = useSearch(services, store); |
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.
We dont need to use useSearch here again. useDiscoverContext
should have all the values you need i.e. savedSearch
} = useOpenSearchDashboards<DataExplorerServices>(); | ||
|
||
const searchParams = useSearch(services, store); |
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.
This change wont be necessary with my change here: https://github.com/opensearch-project/OpenSearch-Dashboards/pull/5168/files#diff-663ffea1a92b4c32f69ad6a65f15d9b07ae759bc026568db627d950842fcad07
…index pattern This fix ensures that when add a default index pattern, Discover will automatically select and load its details. Issue Resolve opensearch-project#5128 Signed-off-by: ananzh <[email protected]>
Signed-off-by: ananzh <[email protected]>
…index pattern (#5171) * [BUG][Data Explorer][Discover] Automatically load solo added default index pattern This fix ensures that when add a default index pattern, Discover will automatically select and load its details. Issue Resolve #5128 --------- Signed-off-by: ananzh <[email protected]> (cherry picked from commit 9601c6c) Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> # Conflicts: # CHANGELOG.md
…index pattern (#5171) (#5189) * [BUG][Data Explorer][Discover] Automatically load solo added default index pattern This fix ensures that when add a default index pattern, Discover will automatically select and load its details. Issue Resolve #5128 --------- Signed-off-by: ananzh <[email protected]> (cherry picked from commit 9601c6c) Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
The backport to 2.x was reverted to orchestrate the merging of all the 2.x PRs. |
…index pattern (opensearch-project#5171) * [BUG][Data Explorer][Discover] Automatically load solo added default index pattern This fix ensures that when add a default index pattern, Discover will automatically select and load its details. Issue Resolve opensearch-project#5128 --------- Signed-off-by: ananzh <[email protected]> (cherry picked from commit 9601c6c) Signed-off-by: Miki <[email protected]>
* [BUG][Discover] Add onQuerySubmit to top nav and allow force update to embeddable (#5160) * all reload to force update embeddable * add onQuerySubmit to top nav Issue Resolve #5116 #5159 Signed-off-by: ananzh <[email protected]> Co-authored-by: Miki <[email protected]> Co-authored-by: Ashwin P Chandran <[email protected]> (cherry picked from commit 7d89cca) Signed-off-by: Miki <[email protected]> * [Discover] A bunch of navigation fixes (#5168) * Discover: Fixes state persistence after nav * Fixed breadcrumbs and navigation * fixes mobile view --------- Signed-off-by: Ashwin P Chandran <[email protected]> (cherry picked from commit cb6e0f0) Signed-off-by: Miki <[email protected]> * [BUG][Data Explorer][Discover] Automatically load solo added default index pattern (#5171) * [BUG][Data Explorer][Discover] Automatically load solo added default index pattern This fix ensures that when add a default index pattern, Discover will automatically select and load its details. Issue Resolve #5128 --------- Signed-off-by: ananzh <[email protected]> (cherry picked from commit 9601c6c) Signed-off-by: Miki <[email protected]> * [BUG][Data Explorer][Discover] Allow data grid to auto adjust size based on fetched data count (#5191) * This PR adds a new rows state to the DiscoverCanvas component and updated it whenever the data$ observable emitted new row data. * The DiscoverTable component was then refactored to accept rows as a prop, making it dependent on the parent component to provide the correct set of data. This ensures that the table renders correctly based on the current data and doesn't rely on its internal state, which could be outdated. Issue Resolve #5181 Signed-off-by: ananzh <[email protected]> (cherry picked from commit 677fdf5) Signed-off-by: Miki <[email protected]> * Fixes mobile layout (#5195) Signed-off-by: Ashwin P Chandran <[email protected]> (cherry picked from commit 0ffd2ab) * [BUG][Data Explorer][Discover] Allow filter and query persist when refresh page or paste url to a new tab (#5206) Issue Resolve #5179 #5071 Signed-off-by: ananzh <[email protected]> (cherry picked from commit 5623cef) Signed-off-by: Miki <[email protected]> * fixes DataTable rendering in doscover (#5207) Signed-off-by: Ashwin P Chandran <[email protected]> (cherry picked from commit c70125f) --------- Signed-off-by: ananzh <[email protected]> Signed-off-by: Miki <[email protected]> Signed-off-by: Ashwin P Chandran <[email protected]> Co-authored-by: Anan Zhuang <[email protected]> Co-authored-by: Ashwin P Chandran <[email protected]>
…index pattern (opensearch-project#5171) * [BUG][Data Explorer][Discover] Automatically load solo added default index pattern This fix ensures that when add a default index pattern, Discover will automatically select and load its details. Issue Resolve opensearch-project#5128 --------- Signed-off-by: ananzh <[email protected]> Signed-off-by: Willie Hung <[email protected]>
…index pattern (opensearch-project#5171) * [BUG][Data Explorer][Discover] Automatically load solo added default index pattern This fix ensures that when add a default index pattern, Discover will automatically select and load its details. Issue Resolve opensearch-project#5128 --------- Signed-off-by: ananzh <[email protected]>
Description
This fix ensures that when add a default index pattern, Discover will automatically select and load its details.
before.mov
after.mov
Issues Resolved
closes #5128
Check List
yarn test:jest
yarn test:jest_integration
yarn test:ftr