Skip to content

Commit

Permalink
Create Data sources plugin with Manage Datasources Flow (#1035)
Browse files Browse the repository at this point in the history
* Manage datasources (#967)

* fix name change bug and modify test to test behavior

Signed-off-by: Derek Ho <[email protected]>

* get rid of lint

Signed-off-by: Derek Ho <[email protected]>

* test for flyout

Signed-off-by: Derek Ho <[email protected]>

* flyout to medium size

Signed-off-by: Derek Ho <[email protected]>

* make accelerate extensible

Signed-off-by: Derek Ho <[email protected]>

* get datasources and hook up to pplservice

Signed-off-by: Derek Ho <[email protected]>

* get flint working

Signed-off-by: Derek Ho <[email protected]>

* add datasource page with steps and buttons on bottom bar

Signed-off-by: Derek Ho <[email protected]>

* datasources as a new plugin and mostly working

Signed-off-by: Derek Ho <[email protected]>

* hook up manage to show datasources call

Signed-off-by: Derek Ho <[email protected]>

* update two tables with descriptions

Signed-off-by: Derek Ho <[email protected]>

* make some updates to the page

Signed-off-by: Derek Ho <[email protected]>

* cleanup unused files for data connections

Signed-off-by: Derek Ho <[email protected]>

* cleanup and add overview panel columns

Signed-off-by: Derek Ho <[email protected]>

* render tabs

Signed-off-by: Derek Ho <[email protected]>

* add unit tests

Signed-off-by: Derek Ho <[email protected]>

* update data test subj and snapshot

Signed-off-by: Derek Ho <[email protected]>

* Add datasources to management overview

Signed-off-by: Derek Ho <[email protected]>

* remove spark logo and update snapshot

Signed-off-by: Derek Ho <[email protected]>

* refactor routes out

Signed-off-by: Derek Ho <[email protected]>

* separate out the roles

Signed-off-by: Derek Ho <[email protected]>

* bump version back to 3.0

Signed-off-by: Derek Ho <[email protected]>

---------

Signed-off-by: Derek Ho <[email protected]>

* Add acceleration management UI  (#989)

* add acceleration management UI skeleton

Signed-off-by: Shenoy Pratik <[email protected]>

* Create new documentation link for acc

Signed-off-by: Shenoy Pratik <[email protected]>

* fix typos and minor bugs

Signed-off-by: Shenoy Pratik <[email protected]>

* update snapshot

Signed-off-by: Shenoy Pratik <[email protected]>

* update window location to hash

Signed-off-by: Shenoy Pratik <[email protected]>

* remove unused headers

Signed-off-by: Shenoy Pratik <[email protected]>

---------

Signed-off-by: Shenoy Pratik <[email protected]>

* Rename data sources to data connections (#1004)

* rename data sources to data connections

Signed-off-by: Derek Ho <[email protected]>

* final cleanup

Signed-off-by: Derek Ho <[email protected]>

* update acceleration breadcrumb

Signed-off-by: Derek Ho <[email protected]>

* fix API call for data connection page

Signed-off-by: Derek Ho <[email protected]>

* fix integ test and data test subj and snapshot

Signed-off-by: Derek Ho <[email protected]>

---------

Signed-off-by: Derek Ho <[email protected]>

* Add fallback to show if user does not have datasource API permissions (#1008)

* add fallback ui for manage and view datasources

Signed-off-by: Derek Ho <[email protected]>

* always show datasources via pplservice

Signed-off-by: Derek Ho <[email protected]>

---------

Signed-off-by: Derek Ho <[email protected]>

* Add access control tab content (#992)

* basic rendering for the access control tab

Signed-off-by: Derek Ho <[email protected]>

* hook up basic radio groups and euicombo boxes for query and acceleration permissions

Signed-off-by: Derek Ho <[email protected]>

* refactor and clean up unuseed inports

Signed-off-by: Derek Ho <[email protected]>

* remove unused import

Signed-off-by: Derek Ho <[email protected]>

* fix import and snapshot

Signed-off-by: Derek Ho <[email protected]>

* fix test

Signed-off-by: Derek Ho <[email protected]>

* Address PR comments

Signed-off-by: Derek Ho <[email protected]>

* Address PR comments

Signed-off-by: Derek Ho <[email protected]>

* Remove unused files and variables

Signed-off-by: Derek Ho <[email protected]>

---------

Signed-off-by: Derek Ho <[email protected]>

* Delete datasource and Connection Configuration Tab (#1024)

* Address previous PR comments and implement rudimentary delete

Signed-off-by: Derek Ho <[email protected]>

* Implement modal and instant delete showing up in list

Signed-off-by: Derek Ho <[email protected]>

* Refactor save or cancel to a shared component, implement hard coded datasource configurations tab

Signed-off-by: Derek Ho <[email protected]>

* Update test with mock role data

Signed-off-by: Derek Ho <[email protected]>

* Add most functionality of edit connectiondetails

Signed-off-by: Derek Ho <[email protected]>

* Address PR comments

Signed-off-by: Derek Ho <[email protected]>

---------

Signed-off-by: Derek Ho <[email protected]>

* remove acceleration components

Signed-off-by: Shenoy Pratik <[email protected]>

---------

Signed-off-by: Derek Ho <[email protected]>
Signed-off-by: Shenoy Pratik <[email protected]>
Co-authored-by: Shenoy Pratik <[email protected]>
  • Loading branch information
derek-ho and ps48 authored Sep 25, 2023
1 parent d67ec95 commit 6efa950
Show file tree
Hide file tree
Showing 33 changed files with 3,344 additions and 8 deletions.
20 changes: 20 additions & 0 deletions .cypress/integration/10_datasources.spec.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
/*
* Copyright OpenSearch Contributors
* SPDX-License-Identifier: Apache-2.0
*/

/// <reference types="cypress" />

const moveToDatasourcesHome = () => {
cy.visit(`${Cypress.env('opensearchDashboards')}/app/dataconnections`);
};

describe('Basic sanity test for datasources plugin', () => {
it('Navigates to datasources plugin and expects the correct header', () => {
moveToDatasourcesHome();
cy.get('[data-test-subj="dataconnections-header"]').should('exist');
});
});



10 changes: 10 additions & 0 deletions common/constants/data_connections.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
/*
* Copyright OpenSearch Contributors
* SPDX-License-Identifier: Apache-2.0
*/

export const OPENSEARCH_DOCUMENTATION_URL =
'https://opensearch.org/docs/latest/data-connections/index';

export const QUERY_RESTRICTED = 'query-restricted';
export const QUERY_ALL = 'query-all';
11 changes: 10 additions & 1 deletion common/constants/shared.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ export const DSL_CAT = '/cat.indices';
export const DSL_MAPPING = '/indices.getFieldMapping';
export const OBSERVABILITY_BASE = '/api/observability';
export const INTEGRATIONS_BASE = '/api/integrations';
export const DATACONNECTIONS_BASE = '/api/dataconnections';
export const EVENT_ANALYTICS = '/event_analytics';
export const SAVED_OBJECTS = '/saved_objects';
export const SAVED_QUERY = '/query';
Expand All @@ -23,6 +24,7 @@ export const SAVED_VISUALIZATION = '/vis';
export const PPL_ENDPOINT = '/_plugins/_ppl';
export const SQL_ENDPOINT = '/_plugins/_sql';
export const DSL_ENDPOINT = '/_plugins/_dsl';
export const DATACONNECTIONS_ENDPOINT = '/_plugins/_query/_datasources';

export const observabilityID = 'observability-logs';
export const observabilityTitle = 'Observability';
Expand Down Expand Up @@ -56,6 +58,10 @@ export const observabilityIntegrationsID = 'integrations';
export const observabilityIntegrationsTitle = 'Integrations';
export const observabilityIntegrationsPluginOrder = 9020;

export const observabilityDataConnectionsID = 'dataconnections';
export const observabilityDataConnectionsTitle = 'Data Connections';
export const observabilityDataConnectionsPluginOrder = 9030;

// Shared Constants
export const SQL_DOCUMENTATION_URL = 'https://opensearch.org/docs/latest/search-plugins/sql/index/';
export const PPL_DOCUMENTATION_URL =
Expand All @@ -74,10 +80,13 @@ export const PPL_NEWLINE_REGEX = /[\n\r]+/g;

// Observability plugin URI
const BASE_OBSERVABILITY_URI = '/_plugins/_observability';
const BASE_INTEGRATIONS_URI = '/_plugins/_integrations'; // Used later in front-end for routing
const BASE_DATACONNECTIONS_URI = '/_plugins/_query/_datasources';
export const OPENSEARCH_PANELS_API = {
OBJECT: `${BASE_OBSERVABILITY_URI}/object`,
};
export const OPENSEARCH_DATACONNECTIONS_API = {
DATACONNECTION: `${BASE_DATACONNECTIONS_URI}`,
};

// Saved Objects
export const SAVED_OBJECT = '/object';
Expand Down
10 changes: 10 additions & 0 deletions common/types/data_connections.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
/*
* Copyright OpenSearch Contributors
* SPDX-License-Identifier: Apache-2.0
*/

export interface PermissionsConfigurationProps {
roles: Array<{ label: string }>;
selectedRoles: Array<{ label: string }>;
setSelectedRoles: React.Dispatch<React.SetStateAction<Array<{ label: string }>>>;
}
5 changes: 3 additions & 2 deletions opensearch_dashboards.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,6 @@
"uiActions",
"urlForwarding",
"visualizations"
]
}
],
"optionalPlugins": ["managementOverview"]
}
2 changes: 2 additions & 0 deletions public/components/app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import { EventAnalytics } from './event_analytics';
import { Home as MetricsHome } from './metrics/index';
import { Main as NotebooksHome } from './notebooks/components/main';
import { Home as TraceAnalyticsHome } from './trace_analytics/home';
import { Home as DataConnectionsHome } from './data_connections/home';

interface ObservabilityAppDeps {
CoreStartProp: CoreStart;
Expand All @@ -44,6 +45,7 @@ const pages = {
notebooks: NotebooksHome,
dashboards: CustomPanelsHome,
integrations: IntegrationsHome,
dataconnections: DataConnectionsHome,
};

export const App = ({
Expand Down
Loading

0 comments on commit 6efa950

Please sign in to comment.