Skip to content
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

[MDS] datasource selector added #29

Merged
merged 8 commits into from
Jul 2, 2024
Merged

[MDS] datasource selector added #29

merged 8 commits into from
Jul 2, 2024

Conversation

kavilla
Copy link
Owner

@kavilla kavilla commented Jul 1, 2024

Added data source selector that pulls from saved objects and also added a connections service and passing it with the dataframe.

Related to:
opensearch-project/OpenSearch-Dashboards#7157

With DQL (and Lucene):
Screenshot 2024-07-02 at 12 21 55 PM

With PPL (and SQL):
Screenshot 2024-07-02 at 12 22 11 PM

kavilla added 4 commits July 1, 2024 22:16
Signed-off-by: Kawika Avilla <[email protected]>
Signed-off-by: Kawika Avilla <[email protected]>
Signed-off-by: Kawika Avilla <[email protected]>
Signed-off-by: Kawika Avilla <[email protected]>
@kavilla kavilla marked this pull request as ready for review July 2, 2024 19:21
@kavilla kavilla changed the title [WIP]: datasource select [MDS] datasource selector added Jul 2, 2024
Copy link
Collaborator

@joshuali925 joshuali925 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit type improvements and some questions

public/types.ts Outdated Show resolved Hide resolved
public/plugin.tsx Outdated Show resolved Hide resolved
public/plugin.tsx Outdated Show resolved Hide resolved
Comment on lines +68 to +75
useEffect(() => {
const subscriptions = connectionsService.getSelectedConnection$().subscribe((connection) => {
connectionsService.setSelectedConnection$(connection);
});
return () => {
subscriptions.unsubscribe();
};
}, [connectionsService]);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why is this getting connection and setting the same connection?

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good catch. whenever Discover page just incase the client switched off page i can still set it in the service. but tbh it might just be left over. will look again post merge

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

didn't fully understand.. but i just tested this PR and this section is giving me Uncaught RangeError: Maximum call stack size exceeded

const resp = await context.core.savedObjects.client.find<DataSourceAttributes>({
type: 'data-source',
fields,
perPage: 10000,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should this paginate?

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it could. and probably should once we start adding more to this wrapper

title: string;
endpoint?: string;
installedPlugins?: string[];
auth?: any;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah it should. the original approach i wanted to go with is not requiring any imports from the data source plugin in case it didn't get loaded in browser (data_source.enabled: false) because i dont think they have any lazy loading over there.

i think my goal here is even if we want to take the work for the flint datasources stuff can live in this repo but extend what they have in data sources.

where we can properly lazy loaded and make it a lot easier to use and then eventually unify it with the ds mgmt plugin

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i see. i thought it wouldn't matter for types and import/import type {xxx would be removed when transpiled to js

kavilla and others added 3 commits July 2, 2024 16:48
Signed-off-by: Kawika Avilla <[email protected]>
@kavilla kavilla merged commit e5f626b into main Jul 2, 2024
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants