Skip to content

Commit

Permalink
Optimize for v2.6 (#640)
Browse files Browse the repository at this point in the history
* feat: add copyright to all the files

Signed-off-by: suzhou <[email protected]>

* feat: wording update

Signed-off-by: suzhou <[email protected]>

* fix: xxx has been selected issue

Signed-off-by: suzhou <[email protected]>

* feat: add force merge in aliases and data streams page

Signed-off-by: suzhou <[email protected]>

---------

Signed-off-by: suzhou <[email protected]>
  • Loading branch information
SuZhou-Joe authored Feb 22, 2023
1 parent e3fe789 commit 2beb50e
Show file tree
Hide file tree
Showing 99 changed files with 534 additions and 75 deletions.
2 changes: 1 addition & 1 deletion cypress/integration/aliases.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ describe("Aliases", () => {

describe("can create a alias with wildcard and specific name", () => {
it("successfully", () => {
cy.get('[data-test-subj="Create AliasButton"]').click();
cy.get('[data-test-subj="Create aliasButton"]').click();
cy.get('[data-test-subj="form-name-alias"]').type(CREATE_ALIAS);
cy.get('[data-test-subj="form-name-indexArray"] [data-test-subj="comboBoxSearchInput"]').type(
`${EDIT_INDEX}{enter}${SAMPLE_INDEX_PREFIX}-*{enter}`
Expand Down
6 changes: 3 additions & 3 deletions cypress/integration/rollover.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ describe("Rollover", () => {
// click create
cy.get('[data-test-subj="rolloverSubmitButton"]').click({ force: true });

cy.contains(/has been successfully rollover./);
cy.contains(/has been successfully rolled over./);
});

it("rollover valid alias successfully", () => {
Expand All @@ -66,7 +66,7 @@ describe("Rollover", () => {
// click create
cy.get('[data-test-subj="rolloverSubmitButton"]').click({ force: true });

cy.contains(/has been successfully rollover./);
cy.contains(/has been successfully rolled over./);
});

it("rollover invalid alias successfully", () => {
Expand All @@ -84,7 +84,7 @@ describe("Rollover", () => {
// click create
cy.get('[data-test-subj="rolloverSubmitButton"]').click({ force: true });

cy.contains(/has been successfully rollover./);
cy.contains(/has been successfully rolled over./);
});
});

Expand Down
4 changes: 4 additions & 0 deletions public/JobHandler/callbacks/reindex.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
/*
* Copyright OpenSearch Contributors
* SPDX-License-Identifier: Apache-2.0
*/
import React, { ReactChild } from "react";
import { CallbackType } from "../interface";
import { ReindexJobMetaData } from "../../models/interfaces";
Expand Down
4 changes: 4 additions & 0 deletions public/JobHandler/callbacks/shrink.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
/*
* Copyright OpenSearch Contributors
* SPDX-License-Identifier: Apache-2.0
*/
import React from "react";
import { CallbackType } from "../interface";
import { RecoveryJobMetaData } from "../../models/interfaces";
Expand Down
4 changes: 4 additions & 0 deletions public/JobHandler/callbacks/split.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
/*
* Copyright OpenSearch Contributors
* SPDX-License-Identifier: Apache-2.0
*/
import React from "react";
import { CallbackType } from "../interface";
import { RecoveryJobMetaData } from "../../models/interfaces";
Expand Down
4 changes: 4 additions & 0 deletions public/JobHandler/components/DetailLink.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
/*
* Copyright OpenSearch Contributors
* SPDX-License-Identifier: Apache-2.0
*/
import React from "react";
import { EuiLink } from "@elastic/eui";
import { ROUTES } from "../../utils/constants";
Expand Down
4 changes: 4 additions & 0 deletions public/JobHandler/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
/*
* Copyright OpenSearch Contributors
* SPDX-License-Identifier: Apache-2.0
*/
import { jobSchedulerInstance } from "../context/JobSchedulerContext";
import { CoreSetup } from "../../../../src/core/public";
import { callbackForReindex, callbackForReindexTimeout } from "./callbacks/reindex";
Expand Down
4 changes: 4 additions & 0 deletions public/JobHandler/interface.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
/*
* Copyright OpenSearch Contributors
* SPDX-License-Identifier: Apache-2.0
*/
import { IJobItemMetadata } from "../lib/JobScheduler/interface";
import { CoreSetup } from "../../../../src/core/public";

Expand Down
4 changes: 4 additions & 0 deletions public/JobHandler/utils.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
/*
* Copyright OpenSearch Contributors
* SPDX-License-Identifier: Apache-2.0
*/
export const EVENT_MAP = {
REINDEX_COMPLETE: "REINDEX_COMPLETE",
SPLIT_COMPLETE: "SPLIT_COMPLETE",
Expand Down
6 changes: 5 additions & 1 deletion public/components/AdvancedSettings/index.scss
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
/*
* Copyright OpenSearch Contributors
* SPDX-License-Identifier: Apache-2.0
*/
.accordion-in-advanced-settings.euiAccordion-isOpen {
.euiAccordion__childWrapper {
transform: none!important;
}
}
}
4 changes: 4 additions & 0 deletions public/components/AdvancedSettings/index.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
/*
* Copyright OpenSearch Contributors
* SPDX-License-Identifier: Apache-2.0
*/
import React, { forwardRef, useCallback, useImperativeHandle, useMemo, useRef } from "react";
import { EuiAccordion, EuiAccordionProps, EuiSpacer, EuiFormRowProps } from "@elastic/eui";
import SwitchableEditor, { SwitchableEditorProps, ISwitchableEditorRef } from "../SwitchableEditor";
Expand Down
4 changes: 4 additions & 0 deletions public/components/ComboBoxWithoutWarning/index.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
/*
* Copyright OpenSearch Contributors
* SPDX-License-Identifier: Apache-2.0
*/
import { EuiComboBox, EuiComboBoxProps } from "@elastic/eui";

/**
Expand Down
4 changes: 4 additions & 0 deletions public/components/CustomFormRow/index.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
/*
* Copyright OpenSearch Contributors
* SPDX-License-Identifier: Apache-2.0
*/
import React from "react";
import { EuiDescribedFormGroup, EuiFormRow, EuiFormRowProps } from "@elastic/eui";

Expand Down
4 changes: 4 additions & 0 deletions public/components/DescriptionListHoz/DescriptionListHoz.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
/*
* Copyright OpenSearch Contributors
* SPDX-License-Identifier: Apache-2.0
*/
import { EuiDescriptionList, EuiDescriptionListProps, EuiFlexGrid, EuiFlexGridProps, EuiFlexItem } from "@elastic/eui";
import React from "react";

Expand Down
4 changes: 4 additions & 0 deletions public/components/DescriptionListHoz/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
/*
* Copyright OpenSearch Contributors
* SPDX-License-Identifier: Apache-2.0
*/
import DescriptionListHoz from "./DescriptionListHoz";

export default DescriptionListHoz;
4 changes: 4 additions & 0 deletions public/components/EuiToolTipWrapper/index.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
/*
* Copyright OpenSearch Contributors
* SPDX-License-Identifier: Apache-2.0
*/
import React, { forwardRef } from "react";
import ToolTipWithoutWarning from "../ToolTipWithoutWarning";

Expand Down
4 changes: 4 additions & 0 deletions public/components/FormGenerator/built_in_components/index.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
/*
* Copyright OpenSearch Contributors
* SPDX-License-Identifier: Apache-2.0
*/
import React, { forwardRef, useRef } from "react";
import { EuiFieldNumber, EuiFieldText, EuiSwitch, EuiSelect, EuiText, EuiCheckbox } from "@elastic/eui";
import EuiToolTipWrapper, { IEuiToolTipWrapperProps } from "../../EuiToolTipWrapper";
Expand Down
4 changes: 4 additions & 0 deletions public/components/FormGenerator/index.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
/*
* Copyright OpenSearch Contributors
* SPDX-License-Identifier: Apache-2.0
*/
import React, { forwardRef, useRef, useImperativeHandle, useEffect, useMemo } from "react";
import { EuiForm, EuiFormProps, EuiSpacer } from "@elastic/eui";
import { isEqual, omit, pick } from "lodash";
Expand Down
6 changes: 5 additions & 1 deletion public/components/IndexMapping/IndexMapping.scss
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
/*
* Copyright OpenSearch Contributors
* SPDX-License-Identifier: Apache-2.0
*/
.index-mapping-tree {
.euiTreeView__node {
max-height: unset;
Expand All @@ -16,4 +20,4 @@
margin-right: 8px;
vertical-align: middle;
}
}
}
4 changes: 4 additions & 0 deletions public/components/IndexMapping/helper.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
/*
* Copyright OpenSearch Contributors
* SPDX-License-Identifier: Apache-2.0
*/
import { MappingsProperties, MappingsPropertiesObject } from "../../../models/interfaces";

export const transformObjectToArray = (obj: MappingsPropertiesObject): MappingsProperties => {
Expand Down
4 changes: 4 additions & 0 deletions public/components/IndexMapping/interfaces.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
/*
* Copyright OpenSearch Contributors
* SPDX-License-Identifier: Apache-2.0
*/
import { MappingsProperties, MappingsPropertiesObject } from "../../../models/interfaces";

export type IndexMappingsAll = {
Expand Down
6 changes: 5 additions & 1 deletion public/components/JSONDiffEditor/JSONDiffEditor.scss
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
/*
* Copyright OpenSearch Contributors
* SPDX-License-Identifier: Apache-2.0
*/
.json-diff-editor-validate-error {
outline: 1px solid red;
}
}
4 changes: 4 additions & 0 deletions public/components/JSONDiffEditor/interface.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
/*
* Copyright OpenSearch Contributors
* SPDX-License-Identifier: Apache-2.0
*/
import type { MonacoDiffEditorProps } from "react-monaco-editor";
import { JSONEditorProps } from "../JSONEditor";

Expand Down
4 changes: 4 additions & 0 deletions public/components/MappingLabel/MappingLabel.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
/*
* Copyright OpenSearch Contributors
* SPDX-License-Identifier: Apache-2.0
*/
import React, { forwardRef, useCallback, useRef, useImperativeHandle } from "react";
import {
EuiIcon,
Expand Down
4 changes: 4 additions & 0 deletions public/components/MappingLabel/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
/*
* Copyright OpenSearch Contributors
* SPDX-License-Identifier: Apache-2.0
*/
import MappingLabel from "./MappingLabel";

export default MappingLabel;
Expand Down
6 changes: 5 additions & 1 deletion public/components/SwitchableEditor/SwitchableEditor.scss
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
/*
* Copyright OpenSearch Contributors
* SPDX-License-Identifier: Apache-2.0
*/
.switch-diff-editor-modal {
.euiModal__flex {
max-height: unset;
overflow-y: unset;
}
}
}
4 changes: 4 additions & 0 deletions public/components/Toast/index.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
/*
* Copyright OpenSearch Contributors
* SPDX-License-Identifier: Apache-2.0
*/
import React, { useEffect, useState } from "react";
import { render } from "react-dom";
import { EuiGlobalToastList, EuiGlobalToastListProps } from "@elastic/eui";
Expand Down
4 changes: 4 additions & 0 deletions public/components/ToolTipWithoutWarning/index.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
/*
* Copyright OpenSearch Contributors
* SPDX-License-Identifier: Apache-2.0
*/
import { EuiToolTip } from "@elastic/eui";

/**
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
/*
* Copyright OpenSearch Contributors
* SPDX-License-Identifier: Apache-2.0
*/
import React, { useEffect, useRef, useState } from "react";
import { EuiButton, EuiBottomBar, EuiFlexGroup, EuiFlexItem, EuiButtonEmpty } from "@elastic/eui";

Expand Down
4 changes: 4 additions & 0 deletions public/components/UnsavedChangesBottomBar/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
/*
* Copyright OpenSearch Contributors
* SPDX-License-Identifier: Apache-2.0
*/
import UnsavedChangesBottomBar from "./UnsavedChangesBottomBar";

export default UnsavedChangesBottomBar;
4 changes: 4 additions & 0 deletions public/containers/IndexDetail/index.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
/*
* Copyright OpenSearch Contributors
* SPDX-License-Identifier: Apache-2.0
*/
import { EuiSpacer } from "@elastic/eui";
import React, { useContext, useEffect, useState } from "react";
import { CatIndex } from "../../../server/models/interfaces";
Expand Down
4 changes: 4 additions & 0 deletions public/context/JobSchedulerContext.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
/*
* Copyright OpenSearch Contributors
* SPDX-License-Identifier: Apache-2.0
*/
import React from "react";
import { JobScheduler } from "../lib/JobScheduler";

Expand Down
4 changes: 4 additions & 0 deletions public/lib/JobScheduler/JobScheduler.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
/*
* Copyright OpenSearch Contributors
* SPDX-License-Identifier: Apache-2.0
*/
import { IJobSchedulerOptions, IJobItemMetadata, IStorage, JobItemMetadata, TimeoutId } from "./interface";
import { StoreLocalStorage } from "./store-localstorage";

Expand Down
4 changes: 4 additions & 0 deletions public/lib/JobScheduler/index.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,6 @@
/*
* Copyright OpenSearch Contributors
* SPDX-License-Identifier: Apache-2.0
*/
export * from "./interface";
export { JobScheduler } from "./JobScheduler";
4 changes: 4 additions & 0 deletions public/lib/JobScheduler/interface.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
/*
* Copyright OpenSearch Contributors
* SPDX-License-Identifier: Apache-2.0
*/
export interface IJobItemMetadata {
interval: number;
extras: any; // extra fields to store job-related info
Expand Down
4 changes: 4 additions & 0 deletions public/lib/JobScheduler/store-localstorage.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
/*
* Copyright OpenSearch Contributors
* SPDX-License-Identifier: Apache-2.0
*/
import { IStorage, JobItemMetadata } from "./interface";

const JOB_STORAGE_KEY = "ISM_JOBS";
Expand Down
4 changes: 4 additions & 0 deletions public/lib/field/index.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
/*
* Copyright OpenSearch Contributors
* SPDX-License-Identifier: Apache-2.0
*/
import React, { useEffect, useRef, useState } from "react";
import { set, get, unset } from "lodash";
import { Rule, FieldOption, FieldInstance, InitOption, InitResult, ValidateFunction, FieldName } from "./interfaces";
Expand Down
4 changes: 4 additions & 0 deletions public/lib/field/interfaces.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
/*
* Copyright OpenSearch Contributors
* SPDX-License-Identifier: Apache-2.0
*/
import React from "react";

// if it's a string[], the value will become nested.
Expand Down
4 changes: 4 additions & 0 deletions public/lib/field/messages.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
/*
* Copyright OpenSearch Contributors
* SPDX-License-Identifier: Apache-2.0
*/
export default {
default: "%s verification failed",
required: "%s is a required field",
Expand Down
8 changes: 6 additions & 2 deletions public/lib/field/rules/index.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
/*
* Copyright OpenSearch Contributors
* SPDX-License-Identifier: Apache-2.0
*/
import { ValidateFunction } from "../interfaces";
import messages from "../messages";
import { format as messageFormat } from "../util";

const pattern = {
email: /[\w\u4E00-\u9FA5]+([-+.][\w\u4E00-\u9FA5]+)*@[\w\u4E00-\u9FA5]+([-.][\w\u4E00-\u9FA5]+)*\.[\w\u4E00-\u9FA5]+([-.][\w\u4E00-\u9FA5]+)*/,
url: /^(?:(?:http|https|ftp):\/\/|\/\/)(?:(?:(?:[-\w\u00a1-\uffff]+)(?:\.[-\w\u00a1-\uffff]+)+|localhost)(?::\d{2,5})?(?:(?:\/|#)[^\s]*)?)$/,
email: /[\w一-龥]+([-+.][\w一-龥]+)*@[\w一-龥]+([-.][\w一-龥]+)*\.[\w一-龥]+([-.][\w一-龥]+)*/,
url: /^(?:(?:http|https|ftp):\/\/|\/\/)(?:(?:(?:[-\w¡-]+)(?:\.[-\w¡-]+)+|localhost)(?::\d{2,5})?(?:(?:\/|#)[^\s]*)?)$/,
number: /\d*/,
tel: /^(1\d{10})$|(((400)-(\d{3})-(\d{4}))|^((\d{7,8})|(\d{3,4})-(\d{7,8})|(\d{7,8})-(\d{1,4}))$)$|^([ ]?)$/,
};
Expand Down
4 changes: 4 additions & 0 deletions public/lib/field/util.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
/*
* Copyright OpenSearch Contributors
* SPDX-License-Identifier: Apache-2.0
*/
const formatRegExp = /%[sdj%]/g;

export function format(...args: string[]) {
Expand Down
9 changes: 8 additions & 1 deletion public/pages/Aliases/containers/AliasActions/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,14 @@ export default function AliasesActions(props: AliasesActionsProps) {
onClick: onUpdateAlias,
},
{
name: "Rollover",
name: "Force merge",
"data-test-subj": "ForceMergeAction",
onClick: () => {
props.history.push(`${ROUTES.FORCE_MERGE}/${selectedItems.map((item) => item.alias).join(",")}`);
},
},
{
name: "Roll over",
disabled: selectedItems.length > 1,
"data-test-subj": "rolloverAction",
onClick: () => history.push(selectedItems.length ? `${ROUTES.ROLLOVER}/${selectedItems[0].alias}` : ROUTES.ROLLOVER),
Expand Down
Loading

0 comments on commit 2beb50e

Please sign in to comment.