Skip to content

Commit

Permalink
Correct OSD import path for custom-import-map (opensearch-project#88)
Browse files Browse the repository at this point in the history
* Correct import path for custom-import-map and move plugin to repo root path

Signed-off-by: Junqiu Lei <[email protected]>
  • Loading branch information
junqiu-lei authored Nov 4, 2022
1 parent 67ec513 commit 2bc133e
Show file tree
Hide file tree
Showing 45 changed files with 20 additions and 20 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/unit-tests-workflow-for-customImportMap.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,17 +59,17 @@ jobs:
echo "Installing yarn ${{ steps.versions_step.outputs.yarn_version }}"
npm i -g yarn@${{ steps.versions_step.outputs.yarn_version }}
- name: Move src/plugins/custom_import_map to Plugins Dir
run: mv src/ OpenSearch-Dashboards/plugins/
- name: Move custom_import_map to Plugins Dir
run: mv custom_import_map OpenSearch-Dashboards/plugins/custom_import_map

- name: Bootstrap plugin/opensearch-dashboards
run: |
cd OpenSearch-Dashboards/plugins/src/plugins/custom_import_map
cd OpenSearch-Dashboards/plugins/custom_import_map
yarn osd bootstrap
- name: Run tests with coverage
run: |
cd OpenSearch-Dashboards/plugins/src/plugins/custom_import_map
cd OpenSearch-Dashboards/plugins/custom_import_map
yarn run test:jest --coverage
- name: Uploads coverage
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
"version": "3.0.0.0",
"scripts": {
"build": "yarn plugin-helpers build",
"plugin-helpers": "node ../../../../scripts/plugin_helpers",
"osd": "node ../../../../scripts/osd",
"plugin-helpers": "node ../../scripts/plugin_helpers",
"osd": "node ../../scripts/osd",
"lint": "yarn run lint:es && yarn run lint:style",
"lint:es": "node ../../../../scripts/eslint",
"lint:style": "node ../../../../scripts/stylelint",
"test:jest": "../../../../node_modules/.bin/jest --config ./test/jest.config.js"
"lint:es": "node ../../scripts/eslint",
"lint:style": "node ../../scripts/stylelint",
"test:jest": "../../node_modules/.bin/jest --config ./test/jest.config.js"
},
"husky": {
"hooks": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { fireEvent } from '@testing-library/dom';
import '@testing-library/jest-dom';
import * as serviceApiCalls from '../services';

jest.mock('../../../../../../src/plugins/opensearch_dashboards_react/public', () => ({
jest.mock('../../../../src/plugins/opensearch_dashboards_react/public', () => ({
useOpenSearchDashboards: jest.fn().mockReturnValue({
services: {
http: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ import {
import {
toMountPoint,
useOpenSearchDashboards,
} from '../../../../../../src/plugins/opensearch_dashboards_react/public';
import { RegionMapOptionsProps } from '../../../../../../src/plugins/region_map/public';
} from '../../../../src/plugins/opensearch_dashboards_react/public';
import { RegionMapOptionsProps } from '../../../../src/plugins/region_map/public';

const VectorUploadOptions = (props: RegionMapOptionsProps) => {
const opensearchDashboards = useOpenSearchDashboards();
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@

import React from 'react';
import { i18n } from '@osd/i18n';
import { CoreSetup, CoreStart, Plugin } from '../../../../../src/core/public';
import { CoreSetup, CoreStart, Plugin } from '../../../src/core/public';
import {
CustomImportMapPluginSetup,
CustomImportMapPluginStart,
AppPluginSetupDependencies,
} from './types';
import { RegionMapVisualizationDependencies } from '../../../../../src/plugins/region_map/public';
import { RegionMapVisualizationDependencies } from '../../../src/plugins/region_map/public';
import { VectorUploadOptions } from './components/vector_upload_options';

export class CustomImportMapPlugin
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* SPDX-License-Identifier: Apache-2.0
*/

import { CoreStart } from '../../../../../src/core/public';
import { CoreStart } from '../../../src/core/public';

export const postGeojson = async (requestBody: any, http: CoreStart['http']) => {
try {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
* SPDX-License-Identifier: Apache-2.0
*/

import { NavigationPublicPluginStart } from '../../../../../src/plugins/navigation/public';
import { RegionMapPluginSetup } from '../../../../../src/plugins/region_map/public';
import { NavigationPublicPluginStart } from '../../../src/plugins/navigation/public';
import { RegionMapPluginSetup } from '../../../src/plugins/region_map/public';

// eslint-disable-next-line @typescript-eslint/no-empty-interface
export interface CustomImportMapPluginSetup {}
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* SPDX-License-Identifier: Apache-2.0
*/

import { PluginInitializerContext } from '../../../../../src/core/server';
import { PluginInitializerContext } from '../../../src/core/server';
import { CustomImportMapPlugin } from './plugin';

// This exports static code and TypeScript types,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import {
CoreStart,
Plugin,
Logger,
} from '../../../../../src/core/server';
} from '../../../src/core/server';

import { CustomImportMapPluginSetup, CustomImportMapPluginStart } from './types';
import { createGeospatialCluster } from './clusters';
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ module.exports = {
'\\.(css|less|scss)$': '<rootDir>/test/mocks/styleMock.js',
'^ui/(.*)': '<rootDir>/../../src/legacy/ui/public/$1/',
},
snapshotSerializers: ['../../../../node_modules/enzyme-to-json/serializer'],
snapshotSerializers: ['../../node_modules/enzyme-to-json/serializer'],
coverageReporters: ['lcov', 'text', 'cobertura'],
testMatch: ['**/*.test.js', '**/*.test.ts', '**/*.test.tsx'],
coveragePathIgnorePatterns: ['<rootDir>/build/', '<rootDir>/node_modules/', '<rootDir>/test/'],
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit 2bc133e

Please sign in to comment.