Skip to content

Commit

Permalink
Upgrades IM Dashboard plugin to OpenSearch Dashboards 2.0 (#169)
Browse files Browse the repository at this point in the history
Signed-off-by: Drew Baugher <[email protected]>
  • Loading branch information
dbbaughe authored Apr 4, 2022
1 parent 8155501 commit 7352cdb
Show file tree
Hide file tree
Showing 58 changed files with 738 additions and 968 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/cypress-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ on:
- main
- development-*
env:
OPENSEARCH_DASHBOARDS_VERSION: '1.x'
OPENSEARCH_VERSION: '1.3.0-SNAPSHOT'
OPENSEARCH_DASHBOARDS_VERSION: 'main'
OPENSEARCH_VERSION: '2.0.0-alpha1-SNAPSHOT'
jobs:
tests:
name: Run Cypress E2E tests
Expand All @@ -24,7 +24,7 @@ jobs:
uses: actions/setup-java@v1
with:
# TODO: Parse this from index management plugin
java-version: 14
java-version: 11
- name: Checkout index management
uses: actions/checkout@v2
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/unit-tests-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ on:
- main
- development-*
env:
OPENSEARCH_DASHBOARDS_VERSION: '1.x'
OPENSEARCH_DASHBOARDS_VERSION: 'main'
jobs:
tests:
name: Run unit tests
Expand Down
4 changes: 2 additions & 2 deletions opensearch_dashboards.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"id": "indexManagementDashboards",
"version": "1.3.0.0",
"opensearchDashboardsVersion": "1.3.0",
"version": "2.0.0.0",
"opensearchDashboardsVersion": "2.0.0",
"configPath": ["opensearch_index_management"],
"requiredPlugins": ["navigation"],
"server": true,
Expand Down
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "opensearch_index_management_dashboards",
"version": "1.3.0.0",
"version": "2.0.0.0",
"description": "Opensearch Dashboards plugin for Index Management",
"main": "index.js",
"license": "Apache-2.0",
Expand Down Expand Up @@ -46,10 +46,10 @@
"devDependencies": {
"@elastic/elastic-eslint-config-kibana": "link:../../packages/opensearch-eslint-config-opensearch-dashboards",
"@elastic/eslint-import-resolver-kibana": "link:../../packages/osd-eslint-import-resolver-opensearch-dashboards",
"@testing-library/dom": "^7.24.2",
"@testing-library/dom": "^8.11.3",
"@testing-library/user-event": "^13.1.9",
"@types/react-dom": "^16.9.8",
"@types/react-router-dom": "^5.1.5",
"@types/react-router-dom": "^5.3.2",
"cypress": "^6.0.0",
"eslint-plugin-no-unsanitized": "^3.0.2",
"eslint-plugin-prefer-object-spread": "^1.2.1",
Expand All @@ -58,7 +58,7 @@
"ts-loader": "^6.2.1"
},
"engines": {
"node": "10.24.1",
"node": "14.18.2",
"yarn": "^1.21.1"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@ describe("<ConfirmationModal /> spec", () => {
onAction={() => {}}
/>
);
// EuiOverlayMask appends an element to the body so we should have two, an empty div from react-test-library
// EuiOverlayMask appends an element to the body so we should have three (used to be two, after upgrading appears to have 3 now), an empty div from react-test-library
// and our EuiOverlayMask element
expect(document.body.children).toHaveLength(2);
expect(document.body.children[1]).toMatchSnapshot();
expect(document.body.children).toHaveLength(3);
expect(document.body.children[2]).toMatchSnapshot();
});

it("calls onAction when action button clicked", () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,6 @@ exports[`<ConfirmationModal /> spec renders the component 1`] = `
style="width: 1px; height: 0px; padding: 0px; overflow: hidden; position: fixed; top: 1px; left: 1px;"
tabindex="0"
/>
<div
aria-hidden="true"
data-aria-hidden="true"
data-focus-guard="true"
style="width: 1px; height: 0px; padding: 0px; overflow: hidden; position: fixed; top: 1px; left: 1px;"
tabindex="1"
/>
<div
data-focus-lock-disabled="false"
>
Expand All @@ -28,7 +21,7 @@ exports[`<ConfirmationModal /> spec renders the component 1`] = `
>
<button
aria-label="Closes this modal window"
class="euiButtonIcon euiButtonIcon--text euiModal__closeIcon"
class="euiButtonIcon euiButtonIcon--text euiButtonIcon--empty euiButtonIcon--xSmall euiModal__closeIcon"
type="button"
>
EuiIconMock
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

exports[`<ContentPanel /> spec renders the component 1`] = `
<div
class="euiPanel euiPanel--paddingMedium"
class="euiPanel euiPanel--paddingMedium euiPanel--borderRadiusMedium euiPanel--plain euiPanel--hasShadow"
style="padding-left: 0px; padding-right: 0px;"
>
<div
Expand Down
12 changes: 6 additions & 6 deletions public/components/CreatePolicyModal/CreatePolicyModal.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,18 @@ import CreatePolicyModal from "./CreatePolicyModal";
describe("<CreatePolicyModal /> spec", () => {
it("renders the component", () => {
render(<CreatePolicyModal isEdit={false} onClose={() => {}} onClickContinue={() => {}} />);
// EuiOverlayMask appends an element to the body so we should have two, an empty div from react-test-library
// EuiOverlayMask appends an element to the body so we should have three (used to be two, after upgrading appears to have 3 now), an empty div from react-test-library
// and our EuiOverlayMask element
expect(document.body.children).toHaveLength(2);
expect(document.body.children[1]).toMatchSnapshot();
expect(document.body.children).toHaveLength(3);
expect(document.body.children[2]).toMatchSnapshot();
});

it("renders the component w/ edit", () => {
render(<CreatePolicyModal isEdit={true} onClose={() => {}} onClickContinue={() => {}} />);
// EuiOverlayMask appends an element to the body so we should have two, an empty div from react-test-library
// EuiOverlayMask appends an element to the body so we should have three (used to be two, after upgrading appears to have 3 now), an empty div from react-test-library
// and our EuiOverlayMask element
expect(document.body.children).toHaveLength(2);
expect(document.body.children[1]).toMatchSnapshot();
expect(document.body.children).toHaveLength(3);
expect(document.body.children[2]).toMatchSnapshot();
});

it("calls onAction and onCLose when action button clicked", () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,6 @@ exports[`<CreatePolicyModal /> spec renders the component 1`] = `
style="width: 1px; height: 0px; padding: 0px; overflow: hidden; position: fixed; top: 1px; left: 1px;"
tabindex="0"
/>
<div
aria-hidden="true"
data-aria-hidden="true"
data-focus-guard="true"
style="width: 1px; height: 0px; padding: 0px; overflow: hidden; position: fixed; top: 1px; left: 1px;"
tabindex="1"
/>
<div
data-focus-lock-disabled="false"
>
Expand All @@ -28,7 +21,7 @@ exports[`<CreatePolicyModal /> spec renders the component 1`] = `
>
<button
aria-label="Closes this modal window"
class="euiButtonIcon euiButtonIcon--text euiModal__closeIcon"
class="euiButtonIcon euiButtonIcon--text euiButtonIcon--empty euiButtonIcon--xSmall euiModal__closeIcon"
type="button"
>
EuiIconMock
Expand Down Expand Up @@ -77,7 +70,7 @@ exports[`<CreatePolicyModal /> spec renders the component 1`] = `
class="euiFlexItem"
>
<div
class="euiPanel euiPanel--paddingMedium selected-radio-panel"
class="euiPanel euiPanel--paddingMedium euiPanel--borderRadiusMedium euiPanel--plain euiPanel--hasShadow selected-radio-panel"
>
<div
class="euiFormRow"
Expand All @@ -87,7 +80,7 @@ exports[`<CreatePolicyModal /> spec renders the component 1`] = `
class="euiFormRow__fieldWrapper"
>
<div
aria-describedby="some_html_id-help"
aria-describedby="some_html_id-help-0"
class="euiRadio"
data-test-subj="createPolicyModalVisualRadio"
>
Expand All @@ -110,7 +103,7 @@ exports[`<CreatePolicyModal /> spec renders the component 1`] = `
</div>
<div
class="euiFormHelpText euiFormRow__text"
id="some_html_id-help"
id="some_html_id-help-0"
>
Use the visual editor to create your policy using pre-defined options.
</div>
Expand All @@ -122,7 +115,7 @@ exports[`<CreatePolicyModal /> spec renders the component 1`] = `
class="euiFlexItem"
>
<div
class="euiPanel euiPanel--paddingMedium"
class="euiPanel euiPanel--paddingMedium euiPanel--borderRadiusMedium euiPanel--plain euiPanel--hasShadow"
>
<div
class="euiFormRow"
Expand All @@ -132,7 +125,7 @@ exports[`<CreatePolicyModal /> spec renders the component 1`] = `
class="euiFormRow__fieldWrapper"
>
<div
aria-describedby="some_html_id-help"
aria-describedby="some_html_id-help-0"
class="euiRadio"
data-test-subj="createPolicyModalJsonRadio"
>
Expand All @@ -154,7 +147,7 @@ exports[`<CreatePolicyModal /> spec renders the component 1`] = `
</div>
<div
class="euiFormHelpText euiFormRow__text"
id="some_html_id-help"
id="some_html_id-help-0"
>
Use the JSON editor to create or import your policy using JSON.
</div>
Expand Down Expand Up @@ -237,13 +230,6 @@ exports[`<CreatePolicyModal /> spec renders the component w/ edit 1`] = `
style="width: 1px; height: 0px; padding: 0px; overflow: hidden; position: fixed; top: 1px; left: 1px;"
tabindex="0"
/>
<div
aria-hidden="true"
data-aria-hidden="true"
data-focus-guard="true"
style="width: 1px; height: 0px; padding: 0px; overflow: hidden; position: fixed; top: 1px; left: 1px;"
tabindex="1"
/>
<div
data-focus-lock-disabled="false"
>
Expand All @@ -254,7 +240,7 @@ exports[`<CreatePolicyModal /> spec renders the component w/ edit 1`] = `
>
<button
aria-label="Closes this modal window"
class="euiButtonIcon euiButtonIcon--text euiModal__closeIcon"
class="euiButtonIcon euiButtonIcon--text euiButtonIcon--empty euiButtonIcon--xSmall euiModal__closeIcon"
type="button"
>
EuiIconMock
Expand Down Expand Up @@ -303,7 +289,7 @@ exports[`<CreatePolicyModal /> spec renders the component w/ edit 1`] = `
class="euiFlexItem"
>
<div
class="euiPanel euiPanel--paddingMedium selected-radio-panel"
class="euiPanel euiPanel--paddingMedium euiPanel--borderRadiusMedium euiPanel--plain euiPanel--hasShadow selected-radio-panel"
>
<div
class="euiFormRow"
Expand All @@ -313,7 +299,7 @@ exports[`<CreatePolicyModal /> spec renders the component w/ edit 1`] = `
class="euiFormRow__fieldWrapper"
>
<div
aria-describedby="some_html_id-help"
aria-describedby="some_html_id-help-0"
class="euiRadio"
data-test-subj="createPolicyModalVisualRadio"
>
Expand All @@ -336,7 +322,7 @@ exports[`<CreatePolicyModal /> spec renders the component w/ edit 1`] = `
</div>
<div
class="euiFormHelpText euiFormRow__text"
id="some_html_id-help"
id="some_html_id-help-0"
>
Use the visual editor to update your policy
</div>
Expand All @@ -348,7 +334,7 @@ exports[`<CreatePolicyModal /> spec renders the component w/ edit 1`] = `
class="euiFlexItem"
>
<div
class="euiPanel euiPanel--paddingMedium"
class="euiPanel euiPanel--paddingMedium euiPanel--borderRadiusMedium euiPanel--plain euiPanel--hasShadow"
>
<div
class="euiFormRow"
Expand All @@ -358,7 +344,7 @@ exports[`<CreatePolicyModal /> spec renders the component w/ edit 1`] = `
class="euiFormRow__fieldWrapper"
>
<div
aria-describedby="some_html_id-help"
aria-describedby="some_html_id-help-0"
class="euiRadio"
data-test-subj="createPolicyModalJsonRadio"
>
Expand All @@ -380,7 +366,7 @@ exports[`<CreatePolicyModal /> spec renders the component w/ edit 1`] = `
</div>
<div
class="euiFormHelpText euiFormRow__text"
id="some_html_id-help"
id="some_html_id-help-0"
>
Use the JSON editor to update your policy using JSON.
</div>
Expand Down
6 changes: 3 additions & 3 deletions public/components/JSONModal/JSONModal.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@ describe("<JSONModal /> spec", () => {
onClose={() => {}}
/>
);
// EuiOverlayMask appends an element to the body so we should have two, an empty div from react-test-library
// EuiOverlayMask appends an element to the body so we should have three (used to be two, after upgrading appears to have 3 now), an empty div from react-test-library
// and our EuiOverlayMask element
expect(document.body.children).toHaveLength(2);
expect(document.body.children[1]).toMatchSnapshot();
expect(document.body.children).toHaveLength(3);
expect(document.body.children[2]).toMatchSnapshot();
});

it("calls close when close button clicked", () => {
Expand Down
Loading

0 comments on commit 7352cdb

Please sign in to comment.