Skip to content

Commit

Permalink
Data sources UI improvements (opensearch-project#1059)
Browse files Browse the repository at this point in the history
* Make UI changes based on UX feedback

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

* Remove notifications pass through props

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

* Fix steps

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

* Remove edit buttons, delete files, update tests

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

* Finish fixing promtheus flow

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

* fix up s3 flow

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

* Hook up fields to actual call

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

* Update according to UX feedback and tests

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

* Add test

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

* Finish up test coverage for manage flow

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

---------

Signed-off-by: Derek Ho <[email protected]>
  • Loading branch information
derek-ho authored Oct 3, 2023
1 parent 7630b2d commit af822a5
Show file tree
Hide file tree
Showing 28 changed files with 1,690 additions and 618 deletions.
26 changes: 24 additions & 2 deletions .cypress/integration/10_datasources.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,38 @@
*/

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


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

const moveToNewDatasourcesPage = () => {
cy.visit(`${Cypress.env('opensearchDashboards')}/app/datasources#/new`);
};

const moveToCreatePrometheusDatasourcePage = () => {
cy.visit(`${Cypress.env('opensearchDashboards')}/app/datasources#/configure/PROMETHEUS`);
};

describe('Basic sanity test for datasources plugin', () => {
describe('Integration tests for datasources plugin', () => {
const testPrometheusSuffix = (Math.random() + 1).toString(36).substring(7);
const testPrometheusInstance = `Prometheus_${testPrometheusSuffix}`;
const testS3Suffix = (Math.random() + 1).toString(36).substring(7);
const testS3Instance = `S3_${testS3Suffix}`;
it('Navigates to datasources plugin and expects the correct header', () => {
moveToDatasourcesHome();
cy.get('[data-test-subj="dataconnections-header"]').should('exist');
});

it('Tests navigation between tabs and goes to Prometheus creation flow', () => {
moveToDatasourcesHome();
cy.get('[data-test-subj="new"]').click();
cy.url().should('include', '/new')
cy.get('[data-test-subj="datasource_card_prometheus"]').click();
cy.url().should('include', '/configure/PROMETHEUS');
});

});


Expand Down
12 changes: 10 additions & 2 deletions common/constants/data_connections.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,16 @@
* SPDX-License-Identifier: Apache-2.0
*/

export const OPENSEARCH_DOCUMENTATION_URL =
'https://opensearch.org/docs/latest/data-connections/index';
import { DatasourceType } from '../../common/types/data_connections';

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

export const QUERY_RESTRICTED = 'query-restricted';
export const QUERY_ALL = 'query-all';

export const DatasourceTypeToDisplayName: { [key in DatasourceType]: string } = {
PROMETHEUS: 'Prometheus',
S3GLUE: 'S3',
};

export type AuthMethod = 'noauth' | 'basicauth' | 'awssigv4';
2 changes: 1 addition & 1 deletion common/types/data_connections.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@ export interface PermissionsConfigurationProps {

export type Role = EuiComboBoxOptionOption;

export type DatasourceType = 'SPARK' | 'S3GLUE' | 'OPENSEARCH' | 'PROMETHEUS';
export type DatasourceType = 'S3GLUE' | 'PROMETHEUS';
Loading

0 comments on commit af822a5

Please sign in to comment.