Skip to content

Commit 826c794

Browse files
Merge branch 'main' into #86_lint_precommit_check
2 parents 277f73c + 03f268d commit 826c794

File tree

32 files changed

+82
-61
lines changed

32 files changed

+82
-61
lines changed

babel.config.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ module.exports = function (api) {
1212
presets: [require("@babel/preset-env"), require("@babel/preset-react"), require("@babel/preset-typescript")],
1313
plugins: [
1414
[require("@babel/plugin-transform-runtime"), { regenerator: true }],
15-
require("@babel/plugin-proposal-class-properties"),
16-
require("@babel/plugin-proposal-object-rest-spread"),
15+
require("@babel/plugin-transform-class-properties"),
16+
require("@babel/plugin-transform-object-rest-spread"),
1717
[require("@babel/plugin-transform-modules-commonjs"), { allowTopLevelThis: true }],
1818
],
1919
};

cypress/integration/plugins/index-management-dashboards-plugin/aliases.js

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,32 @@ describe("Aliases", () => {
2626
});
2727

2828
beforeEach(() => {
29+
// Intercept the specific POST request
30+
cy.intercept("POST", "/api/ism/apiCaller", (req) => {
31+
if (req.body.data && req.body.data.name === "**" && req.body.data.s === "alias:desc" && req.body.endpoint === "cat.aliases") {
32+
req.alias = "apiCaller"; // Assign an alias directly if the condition is met
33+
}
34+
});
35+
2936
// Visit ISM OSD
3037
cy.visit(`${BASE_PATH}/app/${IM_PLUGIN_NAME}#/aliases`);
3138

32-
// Common text to wait for to confirm page loaded, give up to 60 seconds for initial load
33-
cy.contains("Rows per page", { timeout: 60000 });
39+
// Wait for 120 seconds for OSD to start.
40+
// eslint-disable-next-line cypress/no-unnecessary-waiting
41+
// cy.wait(120000);
42+
43+
const startTime = new Date().getTime();
44+
45+
// Wait for the API call to complete
46+
cy.wait("@apiCaller", { timeout: 240000 }).then(() => {
47+
// Log the calculated duration
48+
const endTime = new Date().getTime();
49+
const duration = endTime - startTime; // Duration in milliseconds
50+
cy.log(`@apiCaller completed in ${duration} milliseconds`);
51+
});
52+
53+
// Common text to wait for to confirm page loaded, give up to 120 seconds for initial load
54+
cy.contains("Rows per page", { timeout: 120000 }).should("be.visible");
3455
});
3556

3657
describe("can be searched / sorted / paginated", () => {

cypress/integration/plugins/index-management-dashboards-plugin/indices_spec.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import samplePolicy from "../../../fixtures/plugins/index-management-dashboards-
99
const POLICY_ID = "test_policy_id";
1010
const SAMPLE_INDEX = "sample_index";
1111

12-
describe("Indices", () => {
12+
describe("Indexes", () => {
1313
beforeEach(() => {
1414
// Set welcome screen tracking to false
1515
localStorage.setItem("home:welcome:show", "false");
@@ -52,7 +52,7 @@ describe("Indices", () => {
5252
});
5353
});
5454

55-
describe("can show data stream indices", () => {
55+
describe("can show data stream indexes", () => {
5656
before(() => {
5757
cy.deleteAllIndices();
5858
cy.deleteIMJobs();
@@ -169,7 +169,7 @@ describe("Indices", () => {
169169
});
170170
});
171171

172-
describe("can make indices deleted", () => {
172+
describe("can make indexes deleted", () => {
173173
before(() => {
174174
cy.deleteAllIndices();
175175
cy.deleteIMJobs();
@@ -417,7 +417,7 @@ describe("Indices", () => {
417417
cy.get('[data-test-subj="Close Action"]').should("exist").should("not.have.class", "euiContextMenuItem-isDisabled").click();
418418

419419
// Check for close index modal
420-
cy.contains("Close indices");
420+
cy.contains("Close indexes");
421421

422422
// Close confirm button should be disabled
423423
cy.get('[data-test-subj="Close Confirm button"]').should("have.class", "euiButton-isDisabled");
@@ -457,7 +457,7 @@ describe("Indices", () => {
457457
cy.get('[data-test-subj="Open Action"]').should("exist").should("not.have.class", "euiContextMenuItem-isDisabled").click();
458458

459459
// Check for open index modal
460-
cy.contains("Open indices");
460+
cy.contains("Open indexes");
461461

462462
cy.get('[data-test-subj="Open Confirm button"]').click();
463463

cypress/integration/plugins/index-management-dashboards-plugin/managed_indices_spec.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ const POLICY_ID_ROLLOVER = "test_policy_rollover";
1414
const SAMPLE_INDEX = "sample_index";
1515
const SAMPLE_INDEX_ROLLOVER = "sample_index-01";
1616

17-
describe("Managed indices", () => {
17+
describe("Managed indexes", () => {
1818
beforeEach(() => {
1919
// Set welcome screen tracking to false
2020
localStorage.setItem("home:welcome:show", "false");
@@ -58,13 +58,13 @@ describe("Managed indices", () => {
5858
});
5959

6060
// Confirm we got a remove policy toaster
61-
cy.contains("Removed policy from 1 managed indices");
61+
cy.contains("Removed policy from 1 managed indexes");
6262

6363
// Wait some time for remove policy to execute before reload
6464
cy.wait(3000).reload();
6565

6666
// Confirm we are back to empty loading state, give 20 seconds as OSD takes a while to load
67-
cy.contains("There are no existing managed indices.", { timeout: 20000 });
67+
cy.contains("There are no existing managed indexes.", { timeout: 20000 });
6868
});
6969
});
7070

@@ -121,7 +121,7 @@ describe("Managed indices", () => {
121121
cy.get(`[data-test-subj="retryModalRetryButton"]`).click({ force: true });
122122

123123
// Confirm we got retry toaster
124-
cy.contains("Retried 1 managed indices");
124+
cy.contains("Retried 1 managed indexes");
125125

126126
// Reload the page
127127
cy.reload();
@@ -238,10 +238,10 @@ describe("Managed indices", () => {
238238
});
239239

240240
// Confirm we got the change policy toaster
241-
cy.contains("Changed policy on 1 indices");
241+
cy.contains("Changed policy on 1 indexes");
242242

243243
// Click back to Managed Indices page by clicking "Managed indices" breadcrumb
244-
cy.contains("Policy managed indices").click();
244+
cy.contains("Policy managed indexes").click();
245245

246246
// Speed up execution of managed index
247247
cy.updateManagedIndexConfigStartTime(SAMPLE_INDEX);
@@ -257,7 +257,7 @@ describe("Managed indices", () => {
257257
});
258258
});
259259

260-
describe("can manage data stream indices", () => {
260+
describe("can manage data stream indexes", () => {
261261
before(() => {
262262
cy.deleteAllIndices();
263263
cy.deleteIMJobs();

cypress/integration/plugins/index-management-dashboards-plugin/rollups_spec.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ describe("Rollups", () => {
142142
cy.get("button").contains("Next").click({ force: true });
143143

144144
// Confirm that we got to step 4 of creation page
145-
cy.contains("Job name and indices");
145+
cy.contains("Job name and indexes");
146146

147147
// Click the create button
148148
cy.get("button").contains("Create").click({ force: true });

cypress/integration/plugins/index-management-dashboards-plugin/snapshots_spec.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ describe("Snapshots", () => {
8383
});
8484

8585
describe("Snapshot can be restored", () => {
86-
it("Successfully restores indices from snapshot", () => {
86+
it("Successfully restores indexes from snapshot", () => {
8787
// Must wait here before refreshing so snapshot status becomes 'success'
8888
cy.wait(5000);
8989

cypress/utils/commands.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,13 +97,13 @@ Cypress.Commands.add("login", () => {
9797
});
9898

9999
Cypress.Commands.add("deleteAllIndices", () => {
100-
cy.log("Deleting all indices");
100+
cy.log("Deleting all indexes");
101101
cy.request("DELETE", `${Cypress.env("openSearchUrl")}/index*,sample*,opensearch_dashboards*`);
102102
cy.request("DELETE", `${Cypress.env("openSearchUrl")}/.opendistro-ism*?expand_wildcards=all`);
103103
});
104104

105105
Cypress.Commands.add("deleteADSystemIndices", () => {
106-
cy.log("Deleting AD system indices");
106+
cy.log("Deleting AD system indexes");
107107
cy.request("DELETE", `${Cypress.env("openSearchUrl")}/.opendistro-anomaly*`);
108108
});
109109

public/pages/ChangePolicy/containers/ChangePolicy/ChangePolicy.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ export default class ChangePolicy extends Component<ChangePolicyProps, ChangePol
9898
if (changePolicyResponse.ok) {
9999
const { updatedIndices, failedIndices, failures } = changePolicyResponse.response;
100100
if (updatedIndices) {
101-
this.context.notifications.toasts.addSuccess(`Changed policy on ${updatedIndices} indices`);
101+
this.context.notifications.toasts.addSuccess(`Changed policy on ${updatedIndices} indexes`);
102102
}
103103
if (failures) {
104104
this.context.notifications.toasts.addDanger(

public/pages/CreateRollup/components/JobNameAndIndices/JobNameAndIndices.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ export default class JobNameAndIndices extends Component<JobNameAndIndicesProps>
4444
</ModalConsumer>
4545
}
4646
bodyStyles={{ padding: "initial" }}
47-
title="Job name and indices"
47+
title="Job name and indexes"
4848
titleSize="m"
4949
>
5050
<div style={{ padding: "15px" }}>

public/pages/CreateRollup/containers/CreateRollupForm/CreateRollupForm.test.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -303,7 +303,7 @@ describe("<CreateRollupForm /> creation", () => {
303303
userEvent.click(getByTestId("createRollupNextButton"));
304304

305305
//Check that it routes to step 4
306-
expect(queryByText("Job name and indices")).not.toBeNull();
306+
expect(queryByText("Job name and indexes")).not.toBeNull();
307307

308308
//Test create
309309
userEvent.click(getByTestId("createRollupSubmitButton"));
@@ -430,6 +430,6 @@ describe("<CreateRollupForm /> creation", () => {
430430

431431
//Check that it routes to step 4
432432
userEvent.click(getByTestId("createRollupNextButton"));
433-
expect(queryByText("Job name and indices")).not.toBeNull();
433+
expect(queryByText("Job name and indexes")).not.toBeNull();
434434
});
435435
});

0 commit comments

Comments
 (0)