diff --git a/.cypress/integration/9_integrations.spec.js b/.cypress/integration/9_integrations.spec.js index 2c0f39c39a..6a6ad2fd58 100644 --- a/.cypress/integration/9_integrations.spec.js +++ b/.cypress/integration/9_integrations.spec.js @@ -24,6 +24,12 @@ const moveToAddedIntegrations = () => { cy.visit(`${Cypress.env('opensearchDashboards')}/app/integrations#/installed`); }; +const createSamples = () => { + moveToAvailableNginxIntegration(); + cy.get('[data-test-subj="try-it-button"]').click(); + cy.get('.euiToastHeader__title').should('contain', 'successfully'); +} + describe('Basic sanity test for integrations plugin', () => { it('Navigates to integrations plugin and expects the correct header', () => { @@ -50,12 +56,15 @@ describe('Basic sanity test for integrations plugin', () => { describe('Tests the add nginx integration instance flow', () => { it('Navigates to nginx page and triggers the adds the instance flow', () => { + createSamples(); moveToAvailableNginxIntegration(); cy.get('[data-test-subj="add-integration-button"]').click(); cy.get('[data-test-subj="new-instance-name"]').should('have.value', 'nginx'); cy.get('[data-test-subj="createInstanceButton"]').should('be.disabled') cy.get('[data-test-subj="addIntegrationFlyoutTitle"]').should('exist') - cy.get('[data-test-subj="data-source-name"]').type('test'); + // validates the created sample index + cy.get('[data-test-subj="data-source-name"]').type('ss4o_logs-nginx-sample-sample'); + cy.get('[data-test-subj="validateIndex"]').click() cy.get('[data-test-subj="new-instance-name"]').type(testInstance.substring(5)); cy.get('[data-test-subj="createInstanceButton"]').click(); cy.get('.euiToastHeader__title').should('contain', 'successfully'); diff --git a/.eslintrc.js b/.eslintrc.js index f8dd0a6814..35fde0175d 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -3,6 +3,11 @@ * SPDX-License-Identifier: Apache-2.0 */ +const LICENSE_HEADER = `/* + * Copyright OpenSearch Contributors + * SPDX-License-Identifier: Apache-2.0 + */`; + module.exports = { root: true, extends: [ @@ -15,6 +20,12 @@ module.exports = { files: ['**/*.{js,ts,tsx}'], rules: { 'no-console': 0, + '@osd/eslint/require-license-header': [ + 'error', + { + licenses: [LICENSE_HEADER], + }, + ], }, }, ], diff --git a/common/constants/integrations.ts b/common/constants/integrations.ts index fb0b804067..9c8ca02995 100644 --- a/common/constants/integrations.ts +++ b/common/constants/integrations.ts @@ -3,14 +3,9 @@ * SPDX-License-Identifier: Apache-2.0 */ -export const OPENSEARCH_DOCUMENTATION_URL = 'https://opensearch.org/docs/latest'; +export const OPENSEARCH_DOCUMENTATION_URL = 'https://opensearch.org/docs/latest/integrations/index'; export const ASSET_FILTER_OPTIONS = ['index-pattern', 'search', 'visualization', 'dashboard']; -export const INTEGRATION_TEMPLATE_OPTIONS = ['nginx', 'aws_elb']; -export const INTEGRATION_CATEOGRY_OPTIONS = [ - 'communication', - 'http', - 'cloud', - 'aws_elb', - 'container', - 'logs', -]; +// TODO get this list dynamically from the API +export const INTEGRATION_TEMPLATE_OPTIONS = ['nginx']; +// TODO get this list dynamically from the API +export const INTEGRATION_CATEOGRY_OPTIONS = ['communication', 'http', 'cloud', 'container', 'logs']; diff --git a/common/constants/shared.ts b/common/constants/shared.ts index f3a3cb35cb..2d10c08e2a 100644 --- a/common/constants/shared.ts +++ b/common/constants/shared.ts @@ -52,9 +52,9 @@ export const observabilityPanelsID = 'observability-dashboards'; export const observabilityPanelsTitle = 'Dashboards'; export const observabilityPanelsPluginOrder = 5095; -export const integrationsID = 'integrations'; -export const integrationsTitle = 'Integrations'; -export const integrationsPluginOrder = 9020; +export const observabilityIntegrationsID = 'integrations'; +export const observabilityIntegrationsTitle = 'Integrations'; +export const observabilityIntegrationsPluginOrder = 9020; // Shared Constants export const SQL_DOCUMENTATION_URL = 'https://opensearch.org/docs/latest/search-plugins/sql/index/'; diff --git a/public/components/integrations/components/__tests__/__snapshots__/added_integration.test.tsx.snap b/public/components/integrations/components/__tests__/__snapshots__/added_integration.test.tsx.snap index eae624891e..8c8ad50731 100644 --- a/public/components/integrations/components/__tests__/__snapshots__/added_integration.test.tsx.snap +++ b/public/components/integrations/components/__tests__/__snapshots__/added_integration.test.tsx.snap @@ -221,36 +221,51 @@ exports[`Added Integration View Test Renders added integration view using dummy