-
Notifications
You must be signed in to change notification settings - Fork 892
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
[Data Explorer][Discover 2.0] Fix issues when change index pattern #4875
[Data Explorer][Discover 2.0] Fix issues when change index pattern #4875
Conversation
Codecov Report
@@ Coverage Diff @@
## main #4875 +/- ##
==========================================
- Coverage 66.42% 66.39% -0.04%
==========================================
Files 3398 3397 -1
Lines 64893 64804 -89
Branches 10359 10360 +1
==========================================
- Hits 43108 43028 -80
+ Misses 19225 19217 -8
+ Partials 2560 2559 -1
Flags with carried forward coverage won't be shown. Click here to find out more.
|
src/plugins/discover/public/application/components/sidebar/lib/get_index_pattern_field_list.ts
Show resolved
Hide resolved
* Helper function to filter columns based on the fields of the index pattern. | ||
* This function is used when we switch between index patterns. We want to keep the columns that are | ||
* still available in the new index pattern and remove the ones that are not. | ||
* If the resulting array is empty, it provides a fallback to a single '_source' column. |
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 should use the default column from advanced settings and not hardcode _source
. DEFAULT_COLUMNS_SETTING
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.
will update
const filteredColumns = filterColumns(columns, indexPattern); | ||
const dispatch = useDispatch(); | ||
|
||
const prevColumns = useRef(filteredColumns); |
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.
Doesn't look like we are using this. Do we need it?
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.
will remove.
1eaf649
to
16b5cf8
Compare
* allow side nav show only selected index pattern fields when switch * allow reset column state when switch index pattern Issue Resolve: opensearch-project#4840 opensearch-project#4846 Signed-off-by: ananzh <ananzh@amazon.com>
16b5cf8
to
9e23490
Compare
…4875) * allow side nav show only selected index pattern fields when switch * allow reset column state when switch index pattern Issue Resolve: #4840 #4846 Signed-off-by: ananzh <ananzh@amazon.com> (cherry picked from commit 9958799) Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
…4875) (#4885) * allow side nav show only selected index pattern fields when switch * allow reset column state when switch index pattern Issue Resolve: #4840 #4846 (cherry picked from commit 9958799) Signed-off-by: ananzh <ananzh@amazon.com> Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
…ttern (opensearch-project#4875) (opensearch-project#4885)" This reverts commit 0102a32. try revert:
…CH (#5508) * Revert "[Data Explorer][Discover 2.0] Fix issues when change index pattern (#4875) (#4885)" This reverts commit 0102a32. try revert: * [osci23] implmented advance setting in Dicover: MODIFY_COLUMN_ON_SWITCH Signed-off-by: qiwen li <qiwen_li@brown.edu> * fix deps Signed-off-by: qiwen li <qiwen_li@brown.edu> * Update CHANGELOG.md Signed-off-by: Qiwen Li <qiwen_li@brown.edu> * modify to match discover legacy behavior, columns from previous column are only shown in canvas area Signed-off-by: qiwen li <qiwen_li@brown.edu> * Update CHANGELOG.md Co-authored-by: Anan Zhuang <ananzh@amazon.com> Signed-off-by: Qiwen Li <qiwen_li@brown.edu> * removed unused variables, added comments and @param Signed-off-by: Qiwen Li <qiwen_li@brown.edu> --------- Signed-off-by: qiwen li <qiwen_li@brown.edu> Signed-off-by: Qiwen Li <qiwen_li@brown.edu> Signed-off-by: Anan Zhuang <ananzh@amazon.com> Signed-off-by: Ashwin P Chandran <ashwinpc@amazon.com> Co-authored-by: Anan Zhuang <ananzh@amazon.com> Co-authored-by: Ashwin P Chandran <ashwinpc@amazon.com>
…CH (#5508) * Revert "[Data Explorer][Discover 2.0] Fix issues when change index pattern (#4875) (#4885)" This reverts commit 0102a32. try revert: * [osci23] implmented advance setting in Dicover: MODIFY_COLUMN_ON_SWITCH Signed-off-by: qiwen li <qiwen_li@brown.edu> * fix deps Signed-off-by: qiwen li <qiwen_li@brown.edu> * Update CHANGELOG.md Signed-off-by: Qiwen Li <qiwen_li@brown.edu> * modify to match discover legacy behavior, columns from previous column are only shown in canvas area Signed-off-by: qiwen li <qiwen_li@brown.edu> * Update CHANGELOG.md Co-authored-by: Anan Zhuang <ananzh@amazon.com> Signed-off-by: Qiwen Li <qiwen_li@brown.edu> * removed unused variables, added comments and @param Signed-off-by: Qiwen Li <qiwen_li@brown.edu> --------- Signed-off-by: qiwen li <qiwen_li@brown.edu> Signed-off-by: Qiwen Li <qiwen_li@brown.edu> Signed-off-by: Anan Zhuang <ananzh@amazon.com> Signed-off-by: Ashwin P Chandran <ashwinpc@amazon.com> Co-authored-by: Anan Zhuang <ananzh@amazon.com> Co-authored-by: Ashwin P Chandran <ashwinpc@amazon.com> (cherry picked from commit 34994f8) Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> # Conflicts: # CHANGELOG.md
…CH (#5508) * Revert "[Data Explorer][Discover 2.0] Fix issues when change index pattern (#4875) (#4885)" This reverts commit 0102a32. try revert: * [osci23] implmented advance setting in Dicover: MODIFY_COLUMN_ON_SWITCH Signed-off-by: qiwen li <qiwen_li@brown.edu> * fix deps Signed-off-by: qiwen li <qiwen_li@brown.edu> * Update CHANGELOG.md Signed-off-by: Qiwen Li <qiwen_li@brown.edu> * modify to match discover legacy behavior, columns from previous column are only shown in canvas area Signed-off-by: qiwen li <qiwen_li@brown.edu> * Update CHANGELOG.md Co-authored-by: Anan Zhuang <ananzh@amazon.com> Signed-off-by: Qiwen Li <qiwen_li@brown.edu> * removed unused variables, added comments and @param Signed-off-by: Qiwen Li <qiwen_li@brown.edu> --------- Signed-off-by: qiwen li <qiwen_li@brown.edu> Signed-off-by: Qiwen Li <qiwen_li@brown.edu> Signed-off-by: Anan Zhuang <ananzh@amazon.com> Signed-off-by: Ashwin P Chandran <ashwinpc@amazon.com> Co-authored-by: Anan Zhuang <ananzh@amazon.com> Co-authored-by: Ashwin P Chandran <ashwinpc@amazon.com> (cherry picked from commit 34994f8) Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> # Conflicts: # CHANGELOG.md
…CH (#5508) * Revert "[Data Explorer][Discover 2.0] Fix issues when change index pattern (#4875) (#4885)" This reverts commit 0102a32. try revert: * [osci23] implmented advance setting in Dicover: MODIFY_COLUMN_ON_SWITCH Signed-off-by: qiwen li <qiwen_li@brown.edu> * fix deps Signed-off-by: qiwen li <qiwen_li@brown.edu> * Update CHANGELOG.md Signed-off-by: Qiwen Li <qiwen_li@brown.edu> * modify to match discover legacy behavior, columns from previous column are only shown in canvas area Signed-off-by: qiwen li <qiwen_li@brown.edu> * Update CHANGELOG.md Co-authored-by: Anan Zhuang <ananzh@amazon.com> Signed-off-by: Qiwen Li <qiwen_li@brown.edu> * removed unused variables, added comments and @param Signed-off-by: Qiwen Li <qiwen_li@brown.edu> --------- Signed-off-by: qiwen li <qiwen_li@brown.edu> Signed-off-by: Qiwen Li <qiwen_li@brown.edu> Signed-off-by: Anan Zhuang <ananzh@amazon.com> Signed-off-by: Ashwin P Chandran <ashwinpc@amazon.com> Co-authored-by: Anan Zhuang <ananzh@amazon.com> Co-authored-by: Ashwin P Chandran <ashwinpc@amazon.com> (cherry picked from commit 34994f8) Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> # Conflicts: # CHANGELOG.md
…CH (#5508) * Revert "[Data Explorer][Discover 2.0] Fix issues when change index pattern (#4875) (#4885)" This reverts commit 0102a32. try revert: * [osci23] implmented advance setting in Dicover: MODIFY_COLUMN_ON_SWITCH Signed-off-by: qiwen li <qiwen_li@brown.edu> * fix deps Signed-off-by: qiwen li <qiwen_li@brown.edu> * Update CHANGELOG.md Signed-off-by: Qiwen Li <qiwen_li@brown.edu> * modify to match discover legacy behavior, columns from previous column are only shown in canvas area Signed-off-by: qiwen li <qiwen_li@brown.edu> * Update CHANGELOG.md Co-authored-by: Anan Zhuang <ananzh@amazon.com> Signed-off-by: Qiwen Li <qiwen_li@brown.edu> * removed unused variables, added comments and @param Signed-off-by: Qiwen Li <qiwen_li@brown.edu> --------- Signed-off-by: qiwen li <qiwen_li@brown.edu> Signed-off-by: Qiwen Li <qiwen_li@brown.edu> Signed-off-by: Anan Zhuang <ananzh@amazon.com> Signed-off-by: Ashwin P Chandran <ashwinpc@amazon.com> Co-authored-by: Anan Zhuang <ananzh@amazon.com> Co-authored-by: Ashwin P Chandran <ashwinpc@amazon.com> (cherry picked from commit 34994f8) Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> # Conflicts: # CHANGELOG.md
…CH (#5508) (#5746) * Revert "[Data Explorer][Discover 2.0] Fix issues when change index pattern (#4875) (#4885)" This reverts commit 0102a32. try revert: * [osci23] implmented advance setting in Dicover: MODIFY_COLUMN_ON_SWITCH Signed-off-by: qiwen li <qiwen_li@brown.edu> * fix deps Signed-off-by: qiwen li <qiwen_li@brown.edu> * Update CHANGELOG.md Signed-off-by: Qiwen Li <qiwen_li@brown.edu> * modify to match discover legacy behavior, columns from previous column are only shown in canvas area Signed-off-by: qiwen li <qiwen_li@brown.edu> * Update CHANGELOG.md Co-authored-by: Anan Zhuang <ananzh@amazon.com> Signed-off-by: Qiwen Li <qiwen_li@brown.edu> * removed unused variables, added comments and @param Signed-off-by: Qiwen Li <qiwen_li@brown.edu> --------- Signed-off-by: qiwen li <qiwen_li@brown.edu> Signed-off-by: Qiwen Li <qiwen_li@brown.edu> Signed-off-by: Anan Zhuang <ananzh@amazon.com> Signed-off-by: Ashwin P Chandran <ashwinpc@amazon.com> Co-authored-by: Anan Zhuang <ananzh@amazon.com> Co-authored-by: Ashwin P Chandran <ashwinpc@amazon.com> (cherry picked from commit 34994f8) Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> # Conflicts: # CHANGELOG.md Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
…CH (#5508) (#5638) * Revert "[Data Explorer][Discover 2.0] Fix issues when change index pattern (#4875) (#4885)" This reverts commit 0102a32. try revert: * [osci23] implmented advance setting in Dicover: MODIFY_COLUMN_ON_SWITCH Signed-off-by: qiwen li <qiwen_li@brown.edu> * fix deps Signed-off-by: qiwen li <qiwen_li@brown.edu> * Update CHANGELOG.md Signed-off-by: Qiwen Li <qiwen_li@brown.edu> * modify to match discover legacy behavior, columns from previous column are only shown in canvas area Signed-off-by: qiwen li <qiwen_li@brown.edu> * Update CHANGELOG.md Co-authored-by: Anan Zhuang <ananzh@amazon.com> Signed-off-by: Qiwen Li <qiwen_li@brown.edu> * removed unused variables, added comments and @param Signed-off-by: Qiwen Li <qiwen_li@brown.edu> --------- Signed-off-by: qiwen li <qiwen_li@brown.edu> Signed-off-by: Qiwen Li <qiwen_li@brown.edu> Signed-off-by: Anan Zhuang <ananzh@amazon.com> Signed-off-by: Ashwin P Chandran <ashwinpc@amazon.com> Co-authored-by: Anan Zhuang <ananzh@amazon.com> Co-authored-by: Ashwin P Chandran <ashwinpc@amazon.com> (cherry picked from commit 34994f8) Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> # Conflicts: # CHANGELOG.md Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Description
There are two conditions: 1) If there is common field, common field will be saved.
_source
after switchIssues Resolved
#4840 #4846
Check List
yarn test:jest
yarn test:jest_integration
yarn test:ftr