From 0efb09c615b2d721fc659a96e218caa80283e368 Mon Sep 17 00:00:00 2001 From: Eugene Lee Date: Mon, 21 Mar 2022 11:03:31 -0700 Subject: [PATCH 1/6] Bump version to 2.0 Signed-off-by: Eugene Lee --- .../workflows/dashboards-reports-test-and-build-workflow.yml | 4 ++-- .github/workflows/draft-release-notes-workflow.yml | 2 +- dashboards-reports/opensearch_dashboards.json | 4 ++-- dashboards-reports/package.json | 4 ++-- dashboards-reports/test/jest.config.js | 1 + 5 files changed, 8 insertions(+), 7 deletions(-) diff --git a/.github/workflows/dashboards-reports-test-and-build-workflow.yml b/.github/workflows/dashboards-reports-test-and-build-workflow.yml index 599adc1c..6702e1ba 100644 --- a/.github/workflows/dashboards-reports-test-and-build-workflow.yml +++ b/.github/workflows/dashboards-reports-test-and-build-workflow.yml @@ -5,8 +5,8 @@ on: [pull_request, push] env: PLUGIN_NAME: reportsDashboards ARTIFACT_NAME: reports-dashboards - OPENSEARCH_VERSION: '1.x' - OPENSEARCH_PLUGIN_VERSION: 1.3.0.0 + OPENSEARCH_VERSION: 'main' + OPENSEARCH_PLUGIN_VERSION: 2.0.0.0 jobs: build: diff --git a/.github/workflows/draft-release-notes-workflow.yml b/.github/workflows/draft-release-notes-workflow.yml index 0d7f1eb6..2162586c 100644 --- a/.github/workflows/draft-release-notes-workflow.yml +++ b/.github/workflows/draft-release-notes-workflow.yml @@ -16,6 +16,6 @@ jobs: with: config-name: draft-release-notes-config.yml tag: (None) - version: 1.3.0.0 + version: 2.0.0.0 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/dashboards-reports/opensearch_dashboards.json b/dashboards-reports/opensearch_dashboards.json index 31ac6c14..d43fcffa 100644 --- a/dashboards-reports/opensearch_dashboards.json +++ b/dashboards-reports/opensearch_dashboards.json @@ -1,7 +1,7 @@ { "id": "reportsDashboards", - "version": "1.3.0.0", - "opensearchDashboardsVersion": "1.3.0", + "version": "2.0.0.0", + "opensearchDashboardsVersion": "2.0.0", "requiredPlugins": ["navigation", "data", "opensearchDashboardsUtils"], "optionalPlugins": ["share"], "server": true, diff --git a/dashboards-reports/package.json b/dashboards-reports/package.json index 8f1226db..6ccf09db 100644 --- a/dashboards-reports/package.json +++ b/dashboards-reports/package.json @@ -1,11 +1,11 @@ { "name": "reports-dashboards", - "version": "1.3.0.0", + "version": "2.0.0.0", "description": "OpenSearch Dashboards Reports Plugin", "license": "Apache-2.0", "main": "index.ts", "opensearchDashboards": { - "version": "1.3.0", + "version": "2.0.0", "templateVersion": "1.0.0" }, "scripts": { diff --git a/dashboards-reports/test/jest.config.js b/dashboards-reports/test/jest.config.js index cfbfff71..ec861b87 100644 --- a/dashboards-reports/test/jest.config.js +++ b/dashboards-reports/test/jest.config.js @@ -19,4 +19,5 @@ module.exports = { '\\.(css|less|sass|scss)$': '/test/__mocks__/styleMock.js', '\\.(gif|ttf|eot|svg)$': '/test/__mocks__/fileMock.js', }, + testEnvironment: 'jsdom', }; From 248dfa22b9462aa9e78b4893dd7c234d57fd9ccb Mon Sep 17 00:00:00 2001 From: Eugene Lee Date: Mon, 21 Mar 2022 12:17:48 -0700 Subject: [PATCH 2/6] Revert jest config for build failure Signed-off-by: Eugene Lee --- dashboards-reports/test/jest.config.js | 1 - 1 file changed, 1 deletion(-) diff --git a/dashboards-reports/test/jest.config.js b/dashboards-reports/test/jest.config.js index ec861b87..cfbfff71 100644 --- a/dashboards-reports/test/jest.config.js +++ b/dashboards-reports/test/jest.config.js @@ -19,5 +19,4 @@ module.exports = { '\\.(css|less|sass|scss)$': '/test/__mocks__/styleMock.js', '\\.(gif|ttf|eot|svg)$': '/test/__mocks__/fileMock.js', }, - testEnvironment: 'jsdom', }; From b5063b3d04e196b222e30c8416e30fd9ce767490 Mon Sep 17 00:00:00 2001 From: Eugene Lee Date: Mon, 21 Mar 2022 14:04:38 -0700 Subject: [PATCH 3/6] Use dashboards 1.3 for build Signed-off-by: Eugene Lee --- dashboards-reports/package.json | 2 +- dashboards-reports/test/jest.config.js | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/dashboards-reports/package.json b/dashboards-reports/package.json index 6ccf09db..3d086203 100644 --- a/dashboards-reports/package.json +++ b/dashboards-reports/package.json @@ -5,7 +5,7 @@ "license": "Apache-2.0", "main": "index.ts", "opensearchDashboards": { - "version": "2.0.0", + "version": "1.3.0", "templateVersion": "1.0.0" }, "scripts": { diff --git a/dashboards-reports/test/jest.config.js b/dashboards-reports/test/jest.config.js index cfbfff71..ec861b87 100644 --- a/dashboards-reports/test/jest.config.js +++ b/dashboards-reports/test/jest.config.js @@ -19,4 +19,5 @@ module.exports = { '\\.(css|less|sass|scss)$': '/test/__mocks__/styleMock.js', '\\.(gif|ttf|eot|svg)$': '/test/__mocks__/fileMock.js', }, + testEnvironment: 'jsdom', }; From 6707fac2f26988fd4d2794c3aa7b677618e96df7 Mon Sep 17 00:00:00 2001 From: Eugene Lee Date: Wed, 23 Mar 2022 11:34:42 -0700 Subject: [PATCH 4/6] Bump node version Signed-off-by: Eugene Lee --- .../workflows/dashboards-reports-test-and-build-workflow.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/dashboards-reports-test-and-build-workflow.yml b/.github/workflows/dashboards-reports-test-and-build-workflow.yml index 6702e1ba..400db797 100644 --- a/.github/workflows/dashboards-reports-test-and-build-workflow.yml +++ b/.github/workflows/dashboards-reports-test-and-build-workflow.yml @@ -25,7 +25,7 @@ jobs: - name: Setup Node uses: actions/setup-node@v1 with: - node-version: "10.24.1" + node-version: "14.18.2" - name: Move Dashboards Reports to Plugins Dir run: mv dashboards-reports OpenSearch-Dashboards/plugins/${{ env.PLUGIN_NAME }} From c3233cb89ac979eb1fe2b499f0a5a205472af70f Mon Sep 17 00:00:00 2001 From: David Cui Date: Wed, 23 Mar 2022 13:33:28 -0700 Subject: [PATCH 5/6] resolve package conflict versions Signed-off-by: David Cui --- dashboards-reports/package.json | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/dashboards-reports/package.json b/dashboards-reports/package.json index 3d086203..d39342db 100644 --- a/dashboards-reports/package.json +++ b/dashboards-reports/package.json @@ -38,7 +38,7 @@ "react-native-base64": "^0.0.2", "react-native-i18n": "^2.0.15", "react-navigation": "^4.3.9", - "react-router-dom": "^5.2.0", + "react-router-dom": "^5.3.0", "react-toast-notifications": "^2.4.0", "set-interval-async": "1.0.33", "showdown": "^1.9.1" @@ -49,16 +49,16 @@ "@types/enzyme-adapter-react-16": "^1.0.6", "@types/jsdom": "^16.2.3", "@types/puppeteer-core": "^2.0.0", - "@types/react": "^16.9.36", + "@types/react": "^16.14.23", "@types/react-addons-test-utils": "^0.14.25", "@types/react-dom": "^16.9.8", "@types/react-test-renderer": "^16.9.1", "@types/set-interval-async": "^1.0.0", "@types/showdown": "^1.9.3", - "babel-jest": "^26.3.0", + "babel-jest": "^27.5.1", "cypress": "^5.0.0", "elastic-builder": "^2.7.1", - "eslint-plugin-babel": "^5.3.0", + "eslint-plugin-babel": "^5.3.1", "eslint-plugin-no-unsanitized": "^3.0.2", "eslint-plugin-prefer-object-spread": "^1.2.1", "identity-obj-proxy": "^3.0.0", From 100cba9a653eb34e2d2e0e0fd0b61be285a58a84 Mon Sep 17 00:00:00 2001 From: David Cui Date: Wed, 23 Mar 2022 14:55:16 -0700 Subject: [PATCH 6/6] update main test to use done() instead of both done() and async/await Signed-off-by: David Cui --- .../public/components/main/__tests__/main.test.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dashboards-reports/public/components/main/__tests__/main.test.tsx b/dashboards-reports/public/components/main/__tests__/main.test.tsx index 8445d31d..3142326e 100644 --- a/dashboards-reports/public/components/main/__tests__/main.test.tsx +++ b/dashboards-reports/public/components/main/__tests__/main.test.tsx @@ -17,7 +17,7 @@ function setBreadcrumbs(array: []) { describe('
panel', () => { configure({ adapter: new Adapter() }); - test('render component', async (done) => { + test('render component', (done) => { window = Object.create(window); Object.defineProperty(window, 'location', { configurable: true, @@ -27,7 +27,7 @@ describe('
panel', () => { }, }); - const { container } = await render( + const { container } = render(
);