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

[Data Explorer] Initial commit #4292

Conversation

ashwin-pc
Copy link
Member

@ashwin-pc ashwin-pc commented Jun 15, 2023

Description

  • Moves discover to discover_legacy
  • Adds toggle for discover legacy
  • Adds initial data explorer plugin code and routing for discover 2.0
  • Adds initial view service for data explorer

Issues Resolved

closes #4217
closes #4218
closes #4219
closes #4220
closes #4223

Screenshot

Screen.Recording.2023-06-15.at.12.27.22.PM.mov

Testing the changes

Click on the discover tab with both the advanced settings turned on and off for discover legacy. All discover routes should work when discover legacy is turned on.

Check List

  • All tests pass
    • yarn test:jest
    • yarn test:jest_integration
    • yarn test:ftr
  • New functionality includes testing.
  • New functionality has been documented.
  • Update CHANGELOG.md
  • Commits are signed per the DCO using --signoff

Signed-off-by: Ashwin P Chandran <ashwinpc@amazon.com>
Signed-off-by: Ashwin P Chandran <ashwinpc@amazon.com>
Signed-off-by: Ashwin P Chandran <ashwinpc@amazon.com>
Signed-off-by: Ashwin P Chandran <ashwinpc@amazon.com>
Signed-off-by: Ashwin P Chandran <ashwinpc@amazon.com>
Signed-off-by: Ashwin P Chandran <ashwinpc@amazon.com>
@ashwin-pc ashwin-pc added discover for discover reinvent de-angular de-angularize work data explorer Issues related to the Data Explorer project and removed distinguished-contributor labels Jun 15, 2023
@ashwin-pc ashwin-pc changed the title Feature/data explorer [Data Explorer] Initial commit Jun 15, 2023
@codecov
Copy link

codecov bot commented Jun 15, 2023

Codecov Report

❗ No coverage uploaded for pull request base (feature/data-explorer@487cd36). Click here to learn what that means.
The diff coverage is n/a.

@@                   Coverage Diff                    @@
##             feature/data-explorer    #4292   +/-   ##
========================================================
  Coverage                         ?   66.55%           
========================================================
  Files                            ?     3278           
  Lines                            ?    62654           
  Branches                         ?     9760           
========================================================
  Hits                             ?    41702           
  Misses                           ?    18587           
  Partials                         ?     2365           
Flag Coverage Δ
Linux 66.50% <0.00%> (?)
Windows 66.50% <0.00%> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

Copy link
Collaborator

@AMoo-Miki AMoo-Miki left a comment

Choose a reason for hiding this comment

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

Am i correct to assume everything under discover_legacy is just renamed discover with possibly some reference changes?

@@ -0,0 +1,11 @@
# dataExplorer

A OpenSearch Dashboards plugin
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
A OpenSearch Dashboards plugin
An OpenSearch Dashboards plugin to ... ???

Copy link
Member Author

Choose a reason for hiding this comment

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

Most of these are placeholders for now. Just want to setup the initial framework

Comment on lines +24 to +29
<EuiComboBox
placeholder="Select a datasource"
singleSelection={{ asPlainText: true }}
options={[
{
label: 'Select a datasource',
Copy link
Collaborator

Choose a reason for hiding this comment

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

Can we i18nize these?

Copy link
Member Author

Choose a reason for hiding this comment

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

The whole component here will be replaced. This is just a placeholder for now

$osdHeaderOffset: $euiHeaderHeightCompensation;

.dePageTemplate {
height: calc(100vh - #{$osdHeaderOffset});
Copy link
Collaborator

Choose a reason for hiding this comment

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

Does this take into account the expanded header being true or false?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes it does. This is how VisBuilder does it


private registerView(viewDefinition: View) {
if (this.views[viewDefinition.id]) {
throw new Error(`A view with this the id ${viewDefinition.id} already exists!`);
Copy link
Collaborator

Choose a reason for hiding this comment

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

Should we wrap the id in "", `` or []?

      throw new Error(`A view with this the id "${viewDefinition.id}" already exists!`);

Copy link
Member Author

Choose a reason for hiding this comment

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

We could, this is never a user facing error and mostly copied over from a similar service in the other apps. no strong opinions here :)

* returns all registered Views
*/
all: (): View[] => {
return [...Object.values(this.views)];
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why would we need to spread this?

Copy link
Member Author

Choose a reason for hiding this comment

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

good question, I dont remember why i did this. Again something i just referenced from a similar service in VisBuilder.

import React from 'react';

export const createCanvas = () => {
return <div>Test Canvas</div>;
Copy link
Collaborator

Choose a reason for hiding this comment

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

What do we expect to place instead of this Test? Does it need a ToDo: or will this stay as is?

Copy link
Member Author

Choose a reason for hiding this comment

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

Again, this is a placeholder. Will go away before the merge to main.

import React from 'react';

export const createPanel = () => {
return <div>Test Panel</div>;
Copy link
Collaborator

Choose a reason for hiding this comment

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

Is this something we plan on changing?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes, will go away soon. It is a placeholder

@ashwin-pc
Copy link
Member Author

Am i correct to assume everything under discover_legacy is just renamed discover with possibly some reference changes?

Mostly yes, the server component is not moved over from discover since we dont have anything react dependent there. But otherwise yes, its just a reference change.

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

@ananzh ananzh left a comment

Choose a reason for hiding this comment

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

have played with it for table vis
think this is good to merge in as an initial starting point

*/

/*
* Licensed to Elasticsearch B.V. under one or more contributor
Copy link
Member

Choose a reason for hiding this comment

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

do we still need this one?

Copy link
Member Author

Choose a reason for hiding this comment

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

Ah good catch, ill update them in a followup PR

@@ -47,6 +48,17 @@ import {
} from '../common';

export const uiSettings: Record<string, UiSettingsParams> = {
[DISCOVER_LEGACY_TOGGLE]: {
name: i18n.translate('discover.advancedSettings.legacyToggleTitle', {
defaultMessage: 'Disable new discover app',
Copy link
Member

Choose a reason for hiding this comment

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

nit: should we change this to be Disable legacy discover app? Or is there an action item to change the logic above so that it will route to the new discover app on true?

Copy link
Member Author

Choose a reason for hiding this comment

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

The default should be the new app but i set it to the legacy to see if the CI would pass. Looks like the legacy path is causing a problem so i will revert the change

Copy link
Member

@kavilla kavilla left a comment

Choose a reason for hiding this comment

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

I like it. Seems relatively safe to get into main?

I know historically, the legacy suffix has been used in the process of migrating stuff? To which i guess can cause some changes throughout the app if we want full support (for example the routing). I wonder if we want to consider the next suffix to have the new code and a new route and then once we fully adopt it then we either delete or add the legacy suffix if it is still needed.

@ashwin-pc
Copy link
Member Author

I want to fix the functional tests before going into main, so for now ill merge it into the feature branch for now :)

@ashwin-pc ashwin-pc merged commit d4acb33 into opensearch-project:feature/data-explorer Jun 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
data explorer Issues related to the Data Explorer project de-angular de-angularize work discover for discover reinvent
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants