Skip to content

Commit

Permalink
Rename indices to indexes (opensearch-project#926)
Browse files Browse the repository at this point in the history
* OSCI: rename indices to indexes

Signed-off-by: Mansi Shinde <shinde.mansi55@gmail.com>

* OSCI: rename indices to indexes

Signed-off-by: Mansi Shinde <shinde.mansi55@gmail.com>

* update test snapshot

Signed-off-by: Mansi Shinde <shinde.mansi55@gmail.com>

* updated files based on cypress test result

Signed-off-by: Mansi Shinde <shinde.mansi55@gmail.com>

---------

Signed-off-by: Mansi Shinde <shinde.mansi55@gmail.com>
Co-authored-by: bowenlan-amzn <bowenlan23@gmail.com>
  • Loading branch information
MansiShinde and bowenlan-amzn authored Nov 17, 2023
1 parent ab2c497 commit 03f268d
Show file tree
Hide file tree
Showing 30 changed files with 57 additions and 57 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import samplePolicy from "../../../fixtures/plugins/index-management-dashboards-
const POLICY_ID = "test_policy_id";
const SAMPLE_INDEX = "sample_index";

describe("Indices", () => {
describe("Indexes", () => {
beforeEach(() => {
// Set welcome screen tracking to false
localStorage.setItem("home:welcome:show", "false");
Expand Down Expand Up @@ -52,7 +52,7 @@ describe("Indices", () => {
});
});

describe("can show data stream indices", () => {
describe("can show data stream indexes", () => {
before(() => {
cy.deleteAllIndices();
cy.deleteIMJobs();
Expand Down Expand Up @@ -169,7 +169,7 @@ describe("Indices", () => {
});
});

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

// Check for close index modal
cy.contains("Close indices");
cy.contains("Close indexes");

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

// Check for open index modal
cy.contains("Open indices");
cy.contains("Open indexes");

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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ const POLICY_ID_ROLLOVER = "test_policy_rollover";
const SAMPLE_INDEX = "sample_index";
const SAMPLE_INDEX_ROLLOVER = "sample_index-01";

describe("Managed indices", () => {
describe("Managed indexes", () => {
beforeEach(() => {
// Set welcome screen tracking to false
localStorage.setItem("home:welcome:show", "false");
Expand Down Expand Up @@ -58,13 +58,13 @@ describe("Managed indices", () => {
});

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

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

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

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

// Confirm we got retry toaster
cy.contains("Retried 1 managed indices");
cy.contains("Retried 1 managed indexes");

// Reload the page
cy.reload();
Expand Down Expand Up @@ -238,10 +238,10 @@ describe("Managed indices", () => {
});

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

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

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

describe("can manage data stream indices", () => {
describe("can manage data stream indexes", () => {
before(() => {
cy.deleteAllIndices();
cy.deleteIMJobs();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ describe("Rollups", () => {
cy.get("button").contains("Next").click({ force: true });

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

// Click the create button
cy.get("button").contains("Create").click({ force: true });
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ describe("Snapshots", () => {
});

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

Expand Down
4 changes: 2 additions & 2 deletions cypress/utils/commands.js
Original file line number Diff line number Diff line change
Expand Up @@ -97,13 +97,13 @@ Cypress.Commands.add("login", () => {
});

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

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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ export default class ChangePolicy extends Component<ChangePolicyProps, ChangePol
if (changePolicyResponse.ok) {
const { updatedIndices, failedIndices, failures } = changePolicyResponse.response;
if (updatedIndices) {
this.context.notifications.toasts.addSuccess(`Changed policy on ${updatedIndices} indices`);
this.context.notifications.toasts.addSuccess(`Changed policy on ${updatedIndices} indexes`);
}
if (failures) {
this.context.notifications.toasts.addDanger(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ export default class JobNameAndIndices extends Component<JobNameAndIndicesProps>
</ModalConsumer>
}
bodyStyles={{ padding: "initial" }}
title="Job name and indices"
title="Job name and indexes"
titleSize="m"
>
<div style={{ padding: "15px" }}>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,7 @@ describe("<CreateRollupForm /> creation", () => {
userEvent.click(getByTestId("createRollupNextButton"));

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

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

//Check that it routes to step 4
userEvent.click(getByTestId("createRollupNextButton"));
expect(queryByText("Job name and indices")).not.toBeNull();
expect(queryByText("Job name and indexes")).not.toBeNull();
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ export default function CloseIndexModal(props: CloseIndexModalProps) {
return (
<EuiModal onClose={onClose}>
<EuiModalHeader>
<EuiModalHeaderTitle>Close indices</EuiModalHeaderTitle>
<EuiModalHeaderTitle>Close indexes</EuiModalHeaderTitle>
</EuiModalHeader>

<EuiModalBody>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ HTMLCollection [
<div
class="euiModalHeader__title"
>
Close indices
Close indexes
</div>
</div>
<div
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ export default function DeleteIndexModal(props: DeleteIndexModalProps) {
return (
<EuiModal onClose={onClose}>
<EuiModalHeader>
<EuiModalHeaderTitle>Delete indices</EuiModalHeaderTitle>
<EuiModalHeaderTitle>Delete indexes</EuiModalHeaderTitle>
</EuiModalHeader>

<EuiModalBody>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ HTMLCollection [
<div
class="euiModalHeader__title"
>
Delete indices
Delete indexes
</div>
</div>
<div
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ export default class IndexControls extends Component<IndexControlsProps, IndexCo
</EuiFlexItem>
<EuiFlexItem grow={false}>
<EuiSwitch
label="Show data stream indices"
label="Show data stream indexes"
checked={showDataStreams}
onChange={toggleShowDataStreams}
data-test-subj="toggleShowDataStreams"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ exports[`<IndexControls /> spec renders data streams selection field 1`] = `
class="euiSwitch__label"
id="some_html_id"
>
Show data stream indices
Show data stream indexes
</span>
</div>
</div>
Expand Down Expand Up @@ -215,7 +215,7 @@ exports[`<IndexControls /> spec renders the component 1`] = `
class="euiSwitch__label"
id="some_html_id"
>
Show data stream indices
Show data stream indexes
</span>
</div>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ export default function OpenIndexModal(props: OpenIndexModalProps) {
return (
<EuiModal onClose={onClose}>
<EuiModalHeader>
<EuiModalHeaderTitle>Open indices</EuiModalHeaderTitle>
<EuiModalHeaderTitle>Open indexes</EuiModalHeaderTitle>
</EuiModalHeader>

<EuiModalBody>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ HTMLCollection [
<div
class="euiModalHeader__title"
>
Open indices
Open indexes
</div>
</div>
<div
Expand Down
2 changes: 1 addition & 1 deletion public/pages/Indices/containers/Indices/Indices.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,7 @@ export default class Indices extends Component<IndicesProps, IndicesState> {
/>
}
bodyStyles={{ padding: "initial" }}
title="Indices"
title="Indexes"
itemCount={totalIndices}
>
<IndexControls
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ exports[`<Indices /> spec renders the component 1`] = `
<h3
class="euiTitle euiTitle--large"
>
Indices
Indexes
<span
class="panel-header-count"
>
Expand Down Expand Up @@ -187,7 +187,7 @@ exports[`<Indices /> spec renders the component 1`] = `
class="euiSwitch__label"
id="some_html_id"
>
Show data stream indices
Show data stream indexes
</span>
</div>
</div>
Expand Down
4 changes: 2 additions & 2 deletions public/pages/Main/Main.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,8 @@ import CreateComposableTemplate from "../CreateComposableTemplate";
enum Navigation {
IndexManagement = "Index Management",
IndexPolicies = "State management policies",
ManagedIndices = "Policy managed indices",
Indices = "Indices",
ManagedIndices = "Policy managed indexes",
Indices = "Indexes",
Rollups = "Rollup jobs",
Transforms = "Transform jobs",
SnapshotManagement = "Snapshot Management",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ export default class ManagedIndexControls extends Component<ManagedIndexControls
</EuiFlexItem>
<EuiFlexItem grow={false}>
<EuiSwitch
label="Show data stream indices"
label="Show data stream indexes"
checked={showDataStreams}
onChange={toggleShowDataStreams}
data-test-subj="toggleShowDataStreams"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ exports[`<ManagedIndexControls /> spec renders data streams selection field 1`]
class="euiSwitch__label"
id="some_html_id"
>
Show data stream indices
Show data stream indexes
</span>
</div>
</div>
Expand Down Expand Up @@ -204,7 +204,7 @@ exports[`<ManagedIndexControls /> spec renders the component 1`] = `
class="euiSwitch__label"
id="some_html_id"
>
Show data stream indices
Show data stream indexes
</span>
</div>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ import CreatePolicyModal from "../../../../components/CreatePolicyModal";
import { ROUTES } from "../../../../utils/constants";

export const TEXT = {
RESET_FILTERS: "There are no managed indices matching your applied filters. Reset your filters to view your managed indices.",
NO_MANAGED_INDICES: "There are no existing managed indices. Create a policy to add to an index.",
LOADING: "Loading managed indices...",
RESET_FILTERS: "There are no managed indexes matching your applied filters. Reset your filters to view your managed indexes.",
NO_MANAGED_INDICES: "There are no existing managed indexes. Create a policy to add to an index.",
LOADING: "Loading managed indexes...",
};

const getMessagePrompt = ({ filterIsApplied, loading }: ManagedIndexEmptyPromptProps): string => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ exports[`<ManagedIndexEmptyPrompt /> spec renders the component 1`] = `
class="euiText euiText--medium"
>
<p>
There are no existing managed indices. Create a policy to add to an index.
There are no existing managed indexes. Create a policy to add to an index.
</p>
</div>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ describe("<RetryModal /> spec", () => {

expect(browserServicesMock.managedIndexService.retryManagedIndexPolicy).toHaveBeenCalledWith(["some_index"], "two");
expect(coreServicesMock.notifications.toasts.addSuccess).toHaveBeenCalledTimes(1);
expect(coreServicesMock.notifications.toasts.addSuccess).toHaveBeenCalledWith("Retried 1 managed indices");
expect(coreServicesMock.notifications.toasts.addSuccess).toHaveBeenCalledWith("Retried 1 managed indexes");
});

it("shows error toaster when error is thrown", async () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,14 +103,14 @@ export default class RetryModal extends Component<RetryModalProps, RetryModalSta
}

if (updatedIndices) {
this.context.notifications.toasts.addSuccess(`Retried ${updatedIndices} managed indices`);
this.context.notifications.toasts.addSuccess(`Retried ${updatedIndices} managed indexes`);
}
} else {
this.context.notifications.toasts.addDanger(response.error);
}
onClose();
} catch (err) {
this.context.notifications.toasts.addDanger(getErrorMessage(err, "There was a problem retrying managed indices"));
this.context.notifications.toasts.addDanger(getErrorMessage(err, "There was a problem retrying managed indexes"));
}
};

Expand Down Expand Up @@ -142,7 +142,7 @@ export default class RetryModal extends Component<RetryModalProps, RetryModalSta
<EuiRadioGroup options={radioOptions} idSelected={radioIdSelected} onChange={this.onChange} />

<EuiSpacer size="s" />
<EuiFormRow label="Start state" helpText="Only common states shared across all selected indices are available">
<EuiFormRow label="Start state" helpText="Only common states shared across all selected indexes are available">
<EuiSelect
disabled={radioIdSelected !== Radio.State}
options={stateOptions}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ exports[`<RetryModal /> spec renders the component 1`] = `
class="euiFormHelpText euiFormRow__text"
id="some_html_id-help-0"
>
Only common states shared across all selected indices are available
Only common states shared across all selected indexes are available
</div>
</div>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ describe("<ManagedIndices /> spec", () => {
await waitFor(() => {});

expect(coreServicesMock.notifications.toasts.addSuccess).toHaveBeenCalledTimes(1);
expect(coreServicesMock.notifications.toasts.addSuccess).toHaveBeenCalledWith("Removed policy from 1 managed indices");
expect(coreServicesMock.notifications.toasts.addSuccess).toHaveBeenCalledWith("Removed policy from 1 managed indexes");
});

it("sorts/paginates the table", async () => {
Expand Down
Loading

0 comments on commit 03f268d

Please sign in to comment.