-
Notifications
You must be signed in to change notification settings - Fork 2
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
Module Issue with useOpensearchDashboards method #5
Module Issue with useOpensearchDashboards method #5
Conversation
Signed-off-by: keskami <kkak808@gmail.com>
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.
@keskami Close! Just 3 issues that were causing the error.
"optionalPlugins": [], | ||
"requiredBundles": ["opensearchDashboardsUtils", "opensearchDashboardsReact", "home"] |
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.
No need to add these required bundles, as opensearchDashboardsReact
is already in the requiredPlugins
section. We may eventually decide to move it to requiredBundles
, but it should only be in one or the other.
"optionalPlugins": [], | |
"requiredBundles": ["opensearchDashboardsUtils", "opensearchDashboardsReact", "home"] | |
"optionalPlugins": [], |
|
||
import { VisOptionsProps } from 'src/plugins/vis_default_editor/public'; | ||
import { DrilldownVisParams } from './types'; | ||
import { useOpenSearchDashboards } from 'src/plugins/opensearch_dashboards_react/public'; |
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.
Looking at most other imports, I think this needs to be relative:
import { useOpenSearchDashboards } from 'src/plugins/opensearch_dashboards_react/public'; | |
import { useOpenSearchDashboards } from '../../opensearch_dashboards_react/public'; |
services: { savedObjectsClient }, | ||
} = useOpenSearchDashboards<DrilldownServices>(); | ||
|
||
useEffect(() => { | ||
const saved = savedObjectsClient.find({ |
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.
That's not quite the right format for the service. It should be:
services: { savedObjectsClient }, | |
} = useOpenSearchDashboards<DrilldownServices>(); | |
useEffect(() => { | |
const saved = savedObjectsClient.find({ | |
services: { savedObjects }, | |
} = useOpenSearchDashboards<DrilldownServices>(); | |
useEffect(() => { | |
const saved = savedObjects?.client.find({ |
…rds' Signed-off-by: keskami <kkak808@gmail.com>
Description
for review, when using useOpensearchDashboards to find all saved objects, I get this error:
Module not found: Error: Can't resolve 'src/plugins/opensearch_dashboards_react/public' in '/Users/kk/Desktop/Github/OpenSearch-Dashboards/src/plugins/vis_type_drilldown/public'
Other than that, added a EuiSuperSelect which will eventually hold the saved objects
Issues Resolved
Screenshot
Error:
Testing the changes
Check List
yarn test:jest
yarn test:jest_integration