-
Notifications
You must be signed in to change notification settings - Fork 885
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
Highlight the anchor row in surrounding doc view #7025
Highlight the anchor row in surrounding doc view #7025
Conversation
Signed-off-by: abbyhu2000 <abigailhu2000@gmail.com>
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #7025 +/- ##
=======================================
Coverage 67.44% 67.44%
=======================================
Files 3444 3444
Lines 67873 67873
Branches 11029 11029
=======================================
Hits 45777 45777
Misses 19431 19431
Partials 2665 2665
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
@@ -48,7 +48,7 @@ const TableRowUI = ({ | |||
]); | |||
|
|||
const tableRow = ( | |||
<tr key={row._id}> | |||
<tr key={row._id} className={row.isAnchor ? 'osdDocTable__row--highlight' : ''}> |
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.
Is there a test for this or is it covered in some other way?
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.
I don't think default discover table is covered by any unit tests. src/plugins/discover/public/application/components/default_discover_table
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.
Should we add a ftr test? cuz we want to gradually build up the test coverage.
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.
I think we want to add unit tests and functional tests for default discover table overall. Created an issue to track it here: #7048
@@ -32,7 +32,9 @@ import { ComponentType } from 'react'; | |||
import { SearchResponse } from 'elasticsearch'; | |||
import { IndexPattern } from '../../../../data/public'; | |||
|
|||
export type OpenSearchSearchHit<T = unknown> = SearchResponse<T>['hits']['hits'][number]; | |||
export type OpenSearchSearchHit<T = unknown> = SearchResponse<T>['hits']['hits'][number] & { |
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.
nit: the name OpenSearchSearchHit
is confusing for me because it seems like OpenSearch is returning back to us if it is an anchor or not. Can we create another alias for this to be more descriptive that shims to the hit response if it isAnchor or not based on the context?
that would help me as well not worry if there is potential issues changing the type (even though it is just an optional field). if this type is actually only used within Discover in context then perhaps the name can be reconsidered since OpenSearchSearchHit
implies to me it has more purposes than just for table rows.
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.
approving assuming its going to be tested in tracked issue
(cherry picked from commit 4b78b36) Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Description
Highlight the anchor row in surrounding doc view.
Issues Resolved
resolves #6457
Screenshot
Changelog