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 (#7731)

* Initial updates to new interfaces Discover expects

Signed-off-by: Kawika Avilla <kavilla414@gmail.com>

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

* Move dataset location

Signed-off-by: Kawika Avilla <kavilla414@gmail.com>

* update interfaces

Signed-off-by: Kawika Avilla <kavilla414@gmail.com>

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

Co-authored-by: Ashwin P Chandran <ashwinpc1993@gmail.com>
Signed-off-by: Kawika Avilla <kavilla414@gmail.com>

---------

Signed-off-by: Kawika Avilla <kavilla414@gmail.com>
Co-authored-by: Ashwin P Chandran <ashwinpc1993@gmail.com>

* fix rebase errors

Signed-off-by: abbyhu2000 <abigailhu2000@gmail.com>

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

* dataset handler and move manager

Signed-off-by: Kawika Avilla <kavilla414@gmail.com>

* Adds new Data selector

Signed-off-by: Ashwin P Chandran <ashwinpc@amazon.com>

fixes loading state

Signed-off-by: Ashwin P Chandran <ashwinpc@amazon.com>

* start wiring into the selector

Signed-off-by: Kawika Avilla <kavilla414@gmail.com>

no more white screen

Signed-off-by: Kawika Avilla <kavilla414@gmail.com>

updating handler

Signed-off-by: Kawika Avilla <kavilla414@gmail.com>

rendering data

Signed-off-by: Kawika Avilla <kavilla414@gmail.com>

data structures working ok

Signed-off-by: Kawika Avilla <kavilla414@gmail.com>

need to add datasets

Signed-off-by: Kawika Avilla <kavilla414@gmail.com>

clean up

Signed-off-by: Kawika Avilla <kavilla414@gmail.com>

deleted unneeded types

Signed-off-by: Kawika Avilla <kavilla414@gmail.com>

* still working on the data structure and field

Signed-off-by: Kawika Avilla <kavilla414@gmail.com>

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

Signed-off-by: Kawika Avilla <kavilla414@gmail.com>

* indices

Signed-off-by: Kawika Avilla <kavilla414@gmail.com>

* pushing datasets

Signed-off-by: Kawika Avilla <kavilla414@gmail.com>

* fix index pattern

Signed-off-by: Kawika Avilla <kavilla414@gmail.com>

* fixes with column

Signed-off-by: Kawika Avilla <kavilla414@gmail.com>

* working creation step

Signed-off-by: Kawika Avilla <kavilla414@gmail.com>

* get dataset from state in use index pattern

Signed-off-by: Kawika Avilla <kavilla414@gmail.com>

* dataset selector working

Signed-off-by: Kawika Avilla <kavilla414@gmail.com>

* update ppl interceptor

Signed-off-by: Kawika Avilla <kavilla414@gmail.com>

* add dataset service

Signed-off-by: Kawika Avilla <kavilla414@gmail.com>

* language service

Signed-off-by: Kawika Avilla <kavilla414@gmail.com>

* wired up but the dataset is off

Signed-off-by: Kawika Avilla <kavilla414@gmail.com>

* Address review comments

Signed-off-by: Kawika Avilla <kavilla414@gmail.com>

* ppl query

Signed-off-by: Kawika Avilla <kavilla414@gmail.com>

* dql and lucene working again

Signed-off-by: Kawika Avilla <kavilla414@gmail.com>

* fix issue that would deselect dataset

Signed-off-by: Kawika Avilla <kavilla414@gmail.com>

* language switches and sets the query correctly

Signed-off-by: Kawika Avilla <kavilla414@gmail.com>

* upating query

Signed-off-by: Kawika Avilla <kavilla414@gmail.com>

* fix the styling a little

Signed-off-by: Kawika Avilla <kavilla414@gmail.com>

* little bit width

Signed-off-by: Kawika Avilla <kavilla414@gmail.com>

* submit on update

Signed-off-by: Kawika Avilla <kavilla414@gmail.com>

* fix sql

Signed-off-by: Kawika Avilla <kavilla414@gmail.com>

* ppl working better

Signed-off-by: Kawika Avilla <kavilla414@gmail.com>

* need to still fix the aggregations

Signed-off-by: Kawika Avilla <kavilla414@gmail.com>

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

Signed-off-by: Kawika Avilla <kavilla414@gmail.com>

* use patch

Signed-off-by: Kawika Avilla <kavilla414@gmail.com>

* Metadata slice

Signed-off-by: Kawika Avilla <kavilla414@gmail.com>

* index pattern updates

Signed-off-by: Kawika Avilla <kavilla414@gmail.com>

* types and datasource prepend

Signed-off-by: Kawika Avilla <kavilla414@gmail.com>

---------

Signed-off-by: Kawika Avilla <kavilla414@gmail.com>
Signed-off-by: Ashwin P Chandran <ashwinpc@amazon.com>
Co-authored-by: Ashwin P Chandran <ashwinpc@amazon.com>

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

* progress

Signed-off-by: abbyhu2000 <abigailhu2000@gmail.com>

* get rid of setting class

Signed-off-by: abbyhu2000 <abigailhu2000@gmail.com>

* register editor inside language

Signed-off-by: abbyhu2000 <abigailhu2000@gmail.com>

* address commits

Signed-off-by: abbyhu2000 <abigailhu2000@gmail.com>

* address more comments

Signed-off-by: abbyhu2000 <abigailhu2000@gmail.com>

* change editor

Signed-off-by: abbyhu2000 <abigailhu2000@gmail.com>

---------

Signed-off-by: abbyhu2000 <abigailhu2000@gmail.com>

* minor fixes (#7850)

Signed-off-by: Ashwin P Chandran <ashwinpc@amazon.com>

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

* update manager

Signed-off-by: Kawika Avilla <kavilla414@gmail.com>

* Extension passing

Signed-off-by: Kawika Avilla <kavilla414@gmail.com>

* mock getIndexPatterns

Signed-off-by: Kawika Avilla <kavilla414@gmail.com>

---------

Signed-off-by: Kawika Avilla <kavilla414@gmail.com>

* include create and save

Signed-off-by: Kawika Avilla <kavilla414@gmail.com>

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

* Fix Nav Bar layout in New Discover

Signed-off-by: Suchit Sahoo <suchsah@amazon.com>

* Changeset file for PR #7853 created/updated

---------

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

* [discover] keep fixing mocks (#7855)

* Updating mocks still

Signed-off-by: Kawika Avilla <kavilla414@gmail.com>

* Keep fixing mocks

Signed-off-by: Kawika Avilla <kavilla414@gmail.com>

* update to not use getter

Signed-off-by: Kawika Avilla <kavilla414@gmail.com>

* fix the query being updated twice

Signed-off-by: Kawika Avilla <kavilla414@gmail.com>

* update snapshot

Signed-off-by: Kawika Avilla <kavilla414@gmail.com>

---------

Signed-off-by: Kawika Avilla <kavilla414@gmail.com>

* fix remaining failures

Signed-off-by: Kawika Avilla <kavilla414@gmail.com>

* manual changelog

Signed-off-by: Kawika Avilla <kavilla414@gmail.com>

* update snapshot

Signed-off-by: Kawika Avilla <kavilla414@gmail.com>

---------

Signed-off-by: Kawika Avilla <kavilla414@gmail.com>
Signed-off-by: abbyhu2000 <abigailhu2000@gmail.com>
Signed-off-by: Ashwin P Chandran <ashwinpc@amazon.com>
Signed-off-by: Suchit Sahoo <suchsah@amazon.com>
Co-authored-by: Ashwin P Chandran <ashwinpc1993@gmail.com>
Co-authored-by: abbyhu2000 <abigailhu2000@gmail.com>
Co-authored-by: Ashwin P Chandran <ashwinpc@amazon.com>
Co-authored-by: Suchit Sahoo <38322563+LDrago27@users.noreply.github.com>
Co-authored-by: opensearch-changeset-bot[bot] <154024398+opensearch-changeset-bot[bot]@users.noreply.github.com>
  • Loading branch information
6 people authored Aug 27, 2024
1 parent 6931a41 commit 1976ecf
Show file tree
Hide file tree
Showing 143 changed files with 2,845 additions and 4,603 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 @@ -65,7 +65,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 1976ecf

Please sign in to comment.