Skip to content

Commit

Permalink
[discover-2.0] update interfaces and services for query, data, langua…
Browse files Browse the repository at this point in the history
…ges (opensearch-project#7731)

* Initial updates to new interfaces Discover expects

Signed-off-by: Kawika Avilla <[email protected]>

* [discover] update interfaces and move dataset manager (opensearch-project#7745)

* Move dataset location

Signed-off-by: Kawika Avilla <[email protected]>

* update interfaces

Signed-off-by: Kawika Avilla <[email protected]>

* Update src/plugins/data/common/datasets/types.ts

Co-authored-by: Ashwin P Chandran <[email protected]>
Signed-off-by: Kawika Avilla <[email protected]>

---------

Signed-off-by: Kawika Avilla <[email protected]>
Co-authored-by: Ashwin P Chandran <[email protected]>

* fix rebase errors

Signed-off-by: abbyhu2000 <[email protected]>

* [discover] update interfaces and selector (opensearch-project#7835)

* dataset handler and move manager

Signed-off-by: Kawika Avilla <[email protected]>

* Adds new Data selector

Signed-off-by: Ashwin P Chandran <[email protected]>

fixes loading state

Signed-off-by: Ashwin P Chandran <[email protected]>

* start wiring into the selector

Signed-off-by: Kawika Avilla <[email protected]>

no more white screen

Signed-off-by: Kawika Avilla <[email protected]>

updating handler

Signed-off-by: Kawika Avilla <[email protected]>

rendering data

Signed-off-by: Kawika Avilla <[email protected]>

data structures working ok

Signed-off-by: Kawika Avilla <[email protected]>

need to add datasets

Signed-off-by: Kawika Avilla <[email protected]>

clean up

Signed-off-by: Kawika Avilla <[email protected]>

deleted unneeded types

Signed-off-by: Kawika Avilla <[email protected]>

* still working on the data structure and field

Signed-off-by: Kawika Avilla <[email protected]>

* still not working. the leaf logic isnt right i believe

Signed-off-by: Kawika Avilla <[email protected]>

* indices

Signed-off-by: Kawika Avilla <[email protected]>

* pushing datasets

Signed-off-by: Kawika Avilla <[email protected]>

* fix index pattern

Signed-off-by: Kawika Avilla <[email protected]>

* fixes with column

Signed-off-by: Kawika Avilla <[email protected]>

* working creation step

Signed-off-by: Kawika Avilla <[email protected]>

* get dataset from state in use index pattern

Signed-off-by: Kawika Avilla <[email protected]>

* dataset selector working

Signed-off-by: Kawika Avilla <[email protected]>

* update ppl interceptor

Signed-off-by: Kawika Avilla <[email protected]>

* add dataset service

Signed-off-by: Kawika Avilla <[email protected]>

* language service

Signed-off-by: Kawika Avilla <[email protected]>

* wired up but the dataset is off

Signed-off-by: Kawika Avilla <[email protected]>

* Address review comments

Signed-off-by: Kawika Avilla <[email protected]>

* ppl query

Signed-off-by: Kawika Avilla <[email protected]>

* dql and lucene working again

Signed-off-by: Kawika Avilla <[email protected]>

* fix issue that would deselect dataset

Signed-off-by: Kawika Avilla <[email protected]>

* language switches and sets the query correctly

Signed-off-by: Kawika Avilla <[email protected]>

* upating query

Signed-off-by: Kawika Avilla <[email protected]>

* fix the styling a little

Signed-off-by: Kawika Avilla <[email protected]>

* little bit width

Signed-off-by: Kawika Avilla <[email protected]>

* submit on update

Signed-off-by: Kawika Avilla <[email protected]>

* fix sql

Signed-off-by: Kawika Avilla <[email protected]>

* ppl working better

Signed-off-by: Kawika Avilla <[email protected]>

* need to still fix the aggregations

Signed-off-by: Kawika Avilla <[email protected]>

* gotta fix the aggs and still need to update dql lucene dataset

Signed-off-by: Kawika Avilla <[email protected]>

* use patch

Signed-off-by: Kawika Avilla <[email protected]>

* Metadata slice

Signed-off-by: Kawika Avilla <[email protected]>

* index pattern updates

Signed-off-by: Kawika Avilla <[email protected]>

* types and datasource prepend

Signed-off-by: Kawika Avilla <[email protected]>

---------

Signed-off-by: Kawika Avilla <[email protected]>
Signed-off-by: Ashwin P Chandran <[email protected]>
Co-authored-by: Ashwin P Chandran <[email protected]>

* Use language service to render query editor (opensearch-project#7848)

* progress

Signed-off-by: abbyhu2000 <[email protected]>

* get rid of setting class

Signed-off-by: abbyhu2000 <[email protected]>

* register editor inside language

Signed-off-by: abbyhu2000 <[email protected]>

* address commits

Signed-off-by: abbyhu2000 <[email protected]>

* address more comments

Signed-off-by: abbyhu2000 <[email protected]>

* change editor

Signed-off-by: abbyhu2000 <[email protected]>

---------

Signed-off-by: abbyhu2000 <[email protected]>

* minor fixes (opensearch-project#7850)

Signed-off-by: Ashwin P Chandran <[email protected]>

* [discover] Updates to mocks for tests and ci (opensearch-project#7852)

* update manager

Signed-off-by: Kawika Avilla <[email protected]>

* Extension passing

Signed-off-by: Kawika Avilla <[email protected]>

* mock getIndexPatterns

Signed-off-by: Kawika Avilla <[email protected]>

---------

Signed-off-by: Kawika Avilla <[email protected]>

* include create and save

Signed-off-by: Kawika Avilla <[email protected]>

* Fix Nav Bar layout in New Discover (opensearch-project#7853)

* Fix Nav Bar layout in New Discover

Signed-off-by: Suchit Sahoo <[email protected]>

* Changeset file for PR opensearch-project#7853 created/updated

---------

Signed-off-by: Suchit Sahoo <[email protected]>
Co-authored-by: opensearch-changeset-bot[bot] <154024398+opensearch-changeset-bot[bot]@users.noreply.github.com>

* [discover] keep fixing mocks (opensearch-project#7855)

* Updating mocks still

Signed-off-by: Kawika Avilla <[email protected]>

* Keep fixing mocks

Signed-off-by: Kawika Avilla <[email protected]>

* update to not use getter

Signed-off-by: Kawika Avilla <[email protected]>

* fix the query being updated twice

Signed-off-by: Kawika Avilla <[email protected]>

* update snapshot

Signed-off-by: Kawika Avilla <[email protected]>

---------

Signed-off-by: Kawika Avilla <[email protected]>

* fix remaining failures

Signed-off-by: Kawika Avilla <[email protected]>

* manual changelog

Signed-off-by: Kawika Avilla <[email protected]>

* update snapshot

Signed-off-by: Kawika Avilla <[email protected]>

---------

Signed-off-by: Kawika Avilla <[email protected]>
Signed-off-by: abbyhu2000 <[email protected]>
Signed-off-by: Ashwin P Chandran <[email protected]>
Signed-off-by: Suchit Sahoo <[email protected]>
Co-authored-by: Ashwin P Chandran <[email protected]>
Co-authored-by: abbyhu2000 <[email protected]>
Co-authored-by: Ashwin P Chandran <[email protected]>
Co-authored-by: Suchit Sahoo <[email protected]>
Co-authored-by: opensearch-changeset-bot[bot] <154024398+opensearch-changeset-bot[bot]@users.noreply.github.com>
(cherry picked from commit 1976ecf)
  • Loading branch information
kavilla committed Aug 27, 2024
1 parent 05758b3 commit 5111f87
Show file tree
Hide file tree
Showing 137 changed files with 2,853 additions and 2,020 deletions.
2 changes: 2 additions & 0 deletions changelogs/fragments/7731.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
refactor:
- Multi-datasources and multi-query languages features to use generic structured types, abstract data querying, and the language service ([#7731](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/7731))
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@
"start": "scripts/use_node scripts/opensearch_dashboards --dev",
"start:docker": "scripts/use_node scripts/opensearch_dashboards --dev --opensearch.hosts=$OPENSEARCH_HOSTS --opensearch.ignoreVersionMismatch=true --server.host=$SERVER_HOST",
"start:security": "scripts/use_node scripts/opensearch_dashboards --dev --security",
"start:enhancements": "scripts/use_node scripts/opensearch_dashboards --dev --uiSettings.overrides['query:enhancements:enabled']=true --uiSettings.overrides['home:useNewHomePage']=true --uiSettings.overrides['state:storeInSessionStorage']=true",
"start:enhancements": "scripts/use_node scripts/opensearch_dashboards --dev --uiSettings.overrides['query:enhancements:enabled']=true --uiSettings.overrides['home:useNewHomePage']=true",
"debug": "scripts/use_node --nolazy --inspect scripts/opensearch_dashboards --dev",
"debug-break": "scripts/use_node --nolazy --inspect-brk scripts/opensearch_dashboards --dev",
"lint": "yarn run lint:es && yarn run lint:style",
Expand Down
3 changes: 1 addition & 2 deletions packages/osd-stylelint-config/config/global_selectors.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,7 @@
"src/plugins/discover/public/application/view_components/canvas/discover_canvas.scss",
"src/plugins/discover/public/application/components/sidebar/discover_sidebar.scss",
"src/plugins/data/public/ui/query_string_input/_query_bar.scss",
"src/plugins/data/public/ui/query_editor/_query_editor.scss",
"src/plugins/data/public/ui/dataset_navigator/_dataset_navigator.scss"
"src/plugins/data/public/ui/query_editor/_query_editor.scss"
]
}
}
6 changes: 3 additions & 3 deletions src/core/public/saved_objects/saved_objects_client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -457,14 +457,14 @@ export class SavedObjectsClient {
* { id: 'foo', type: 'index-pattern' }
* ])
*/
public bulkGet = (objects: Array<{ id: string; type: string }> = []) => {
public bulkGet = <T = unknown>(objects: Array<{ id: string; type: string }> = []) => {
const filteredObjects = objects.map((obj) => pick(obj, ['id', 'type']));
return this.performBulkGet(filteredObjects).then((resp) => {
resp.saved_objects = resp.saved_objects.map((d) => this.createSavedObject(d));
return renameKeys<
PromiseType<ReturnType<SavedObjectsApi['bulkGet']>>,
SavedObjectsBatchResponse
>({ saved_objects: 'savedObjects' }, resp) as SavedObjectsBatchResponse;
SavedObjectsBatchResponse<T>
>({ saved_objects: 'savedObjects' }, resp) as SavedObjectsBatchResponse<T>;
});
};

Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@

import { SavedObjectMigrationFn } from 'opensearch-dashboards/server';
import { get } from 'lodash';
import { DEFAULT_QUERY_LANGUAGE } from '../../../data/common';
import { DEFAULT_QUERY } from '../../../data/common';

/**
* This migration script is related to:
Expand Down Expand Up @@ -61,7 +61,7 @@ export const migrateMatchAllQuery: SavedObjectMigrationFn<any, any> = (doc) => {
...searchSource,
query: {
query: '',
language: DEFAULT_QUERY_LANGUAGE,
language: DEFAULT_QUERY.LANGUAGE,
},
}),
},
Expand Down
Loading

0 comments on commit 5111f87

Please sign in to comment.