-
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] Implement data fetch, index pattern, saved search for table vis #4564
[Data Explorer][Discover 2.0] Implement data fetch, index pattern, saved search for table vis #4564
Conversation
Codecov Report
@@ Coverage Diff @@
## feature/data-explorer #4564 +/- ##
=========================================================
+ Coverage 66.58% 66.60% +0.02%
=========================================================
Files 3278 3282 +4
Lines 62645 62732 +87
Branches 9759 9780 +21
=========================================================
+ Hits 41710 41782 +72
- Misses 18569 18574 +5
- Partials 2366 2376 +10
Flags with carried forward coverage won't be shown. Click here to find out more.
|
99f3371
to
f3d17ed
Compare
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.
The PR looks good to me, just one blocking change to add the doc_viewer_links
service back. Unit tests would be really appreciated since we will need them before merge to main anyways.
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
export const toolbarVisibility = { |
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.
export const toolbarVisibility = { | |
export const TOOLBAR_VISIBILITY = { |
nit:
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 change
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.
do we need all this custom css?
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.
As we discussed earlier, lets add this back to the app. Its an api we expose that is not used in our project but is used by the community
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 add it back
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.
Can you add a unit test for this file? it looks like it wont change in future.
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 add an initial unit test for now. This data_grid_table_cell_value.tsx will need further polish to include nested fields and others.
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.
The same goes for this. Unit tests will be useful here
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 add a unit test
const { core, chrome, data, uiSettings: config, toastNotifications } = services; | ||
const [savedSearch, setSavedSearch] = useState<SavedSearch>(); | ||
const [indexPattern, setIndexPattern] = useState<IndexPattern | undefined>(undefined); | ||
// ToDo: get id from data explorer since it is handling the routing logic |
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: I usually have my case sensitivity turned on so i dont want to accidentally miss this
// ToDo: get id from data explorer since it is handling the routing logic | |
// TODO: get id from data explorer since it is handling the routing logic |
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 replace all ToDo to TODO
}; | ||
}, [data$, fetchState]); | ||
|
||
// ToDo: implement columns, onAddColumn, onRemoveColumn, onMoveColumn, onSetColumns using config, indexPattern, appState |
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.
most of these are already done in my side panel PR so i'd hold off implementing this until then :)
<EuiPage className="dscCanvasAppPage"> | ||
<EuiPageBody className="dscCanvasAppPageBody"> |
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.
Do we need EuiPage
and EuiPageBody
? We already have them at the app root level
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
indexPattern: IndexPattern; | ||
} | ||
|
||
export const DiscoverTableService = ({ |
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.
Do we need this? Right now the React tree looks like:
Canvas
-> DiscoverTable
-> DiscoverTableService
-> DiscoverTableApplication
-> DataGrid
Cant we instead simplify this to just be
Canvas
-> DiscoverTable
-> DataGrid
?
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 DiscoverTableApplication actually need to rename. It will include DiscoverChart (HitsCount, TimeChartHeader and Histogram) and DiscoverTable.
This discover_table_service is used to have any updates on services, like data & saved search for both DiscoverChart and DiscoverTable.
We could re-evaluate and simply after canvas parts all implemented.
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.
All files inside utils need to have unit tests. I wont hold back the PR if they arent there, but before we merge to main, we definitely need to add them
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.
Yes and will do. Currently, use_discover_canvas_service is not done. We will add tests for every utility functions after canvas is done.
Issue Resolve opensearch-project#4442 Signed-off-by: ananzh <ananzh@amazon.com>
Issue Resolve: opensearch-project#4397 Signed-off-by: ananzh <ananzh@amazon.com>
f3d17ed
to
84bb885
Compare
Signed-off-by: ananzh <ananzh@amazon.com>
84bb885
to
859432b
Compare
@ashwin-pc fixed all your comments. Some major changes are 1) add some initial tests. I put index pattern mock into a common mock folder bc it will be used by many other comps. Currently |
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.
Wont block on the new index pattern mock, but in a followup PR can you replace the custom mock with an existing one so that we dont have many ways to mock the same thing. Index patterns may change soon and custom mocks like this will make it annoying to update tests that rely on them.
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.
Do we need this? Cant we use import { getStubIndexPattern } from '../../../../../../data/public/test_utils';
like the one found in src/plugins/discover/public/application/components/sidebar/lib/field_calculator.test.ts
?
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.
Yes we could. This is a great finding. I think we just need to add a new data in fixture. Let me do it in a follow up PR.
146cc36
into
opensearch-project:feature/data-explorer
Description
Issues Resolved
#4224
Screenshot
Testing the changes
Check List
yarn test:jest
yarn test:jest_integration
yarn test:ftr