- You can think of policies as state machines. "Actions" are the operations ISM performs when an index is in a certain state.
- "Transitions" define when to move from one state to another.{" "}
+ You can think of policies as state machines. "Actions" are the operations ISM performs when an index is in a certain
+ state. "Transitions" define when to move from one state to another.{" "}
Learn more
diff --git a/public/pages/CreatePolicy/containers/CreatePolicy/CreatePolicy.test.tsx b/public/pages/CreatePolicy/containers/CreatePolicy/CreatePolicy.test.tsx
index f99f3a3ec..856f69810 100644
--- a/public/pages/CreatePolicy/containers/CreatePolicy/CreatePolicy.test.tsx
+++ b/public/pages/CreatePolicy/containers/CreatePolicy/CreatePolicy.test.tsx
@@ -98,6 +98,7 @@ describe(" spec", () => {
expect(coreServicesMock.notifications.toasts.addDanger).toHaveBeenCalledWith("Could not load the policy: some error");
});
+ // eslint-disable-next-line jest/no-identical-title
it("routes back to policies if getPolicy gracefully fails", async () => {
browserServicesMock.policyService.getPolicy = jest.fn().mockRejectedValue(new Error("another error"));
const { getByText } = renderCreatePolicyWithRouter([`${ROUTES.EDIT_POLICY}?id=some_id`]);
@@ -203,6 +204,7 @@ describe(" spec", () => {
await waitFor(() => getByText("bad policy"));
});
+ // eslint-disable-next-line jest/no-identical-title
it("shows a danger toaster when getting error from create policy", async () => {
browserServicesMock.policyService.putPolicy = jest.fn().mockRejectedValue(new Error("this is an error"));
browserServicesMock.policyService.getPolicy = jest
diff --git a/public/pages/CreatePolicy/containers/CreatePolicy/CreatePolicy.tsx b/public/pages/CreatePolicy/containers/CreatePolicy/CreatePolicy.tsx
index ffb17b759..cea825cdf 100644
--- a/public/pages/CreatePolicy/containers/CreatePolicy/CreatePolicy.tsx
+++ b/public/pages/CreatePolicy/containers/CreatePolicy/CreatePolicy.tsx
@@ -193,9 +193,9 @@ export default class CreatePolicy extends Component
- This ensures that any update to a policy doesn't harm indices that are running under an older version of the policy. To carry
- over your edits to these indices, please use the "Change Policy" under "Managed Indices" to reapply the policy after submitting
- your edits.{" "}
+ This ensures that any update to a policy doesn't harm indices that are running under an older version of the policy. To
+ carry over your edits to these indices, please use the "Change Policy" under "Managed Indices" to reapply
+ the policy after submitting your edits.{" "}
Learn more
diff --git a/public/pages/CreateRollup/components/AdvancedAggregation/AdvancedAggregation.tsx b/public/pages/CreateRollup/components/AdvancedAggregation/AdvancedAggregation.tsx
index 37d0ca7c1..e8c68c7ce 100644
--- a/public/pages/CreateRollup/components/AdvancedAggregation/AdvancedAggregation.tsx
+++ b/public/pages/CreateRollup/components/AdvancedAggregation/AdvancedAggregation.tsx
@@ -88,8 +88,8 @@ export default class AdvancedAggregation extends Component {
@@ -98,21 +98,21 @@ export default class AdvancedAggregation extends Component {
return isNumericMapping(field.type)
? {
sequence: i++,
- field: field,
+ field,
aggregationMethod: "histogram",
interval: 5,
}
: {
sequence: i++,
- field: field,
+ field,
aggregationMethod: "terms",
};
});
@@ -123,9 +123,9 @@ export default class AdvancedAggregation extends Component[] = [
+ const aggregationColumns: Array> = [
{
field: "sequence",
name: "Sequence",
@@ -317,14 +317,14 @@ export default class AdvancedAggregation extends Component
- {item.sequence != 1 && (
+ {item.sequence !== 1 && (
this.moveUp(item)} data-test-subj={`moveUp-${item.field.label}`}>
Move up
)}
- {item.sequence != selectedDimensionField.length && (
+ {item.sequence !== selectedDimensionField.length && (
this.moveDown(item)} data-test-subj={`moveDown-${item.field.label}`}>
Move down
@@ -379,7 +379,7 @@ export default class AdvancedAggregation extends Component
- {selectedDimensionField.length != 0 && (
+ {selectedDimensionField.length !== 0 && (
diff --git a/public/pages/CreateRollup/components/HistogramAndMetrics/HistogramAndMetrics.tsx b/public/pages/CreateRollup/components/HistogramAndMetrics/HistogramAndMetrics.tsx
index 1768c74a3..10545c89a 100644
--- a/public/pages/CreateRollup/components/HistogramAndMetrics/HistogramAndMetrics.tsx
+++ b/public/pages/CreateRollup/components/HistogramAndMetrics/HistogramAndMetrics.tsx
@@ -37,7 +37,7 @@ import {
interface HistogramAndMetricsProps {
rollupId: string;
onChangeStep: (step: number) => void;
- timestamp: EuiComboBoxOptionOption[];
+ timestamp: Array>;
intervalType: string;
intervalValue: number;
timezone: string;
@@ -51,21 +51,21 @@ interface HistogramAndMetricsState extends BaseAggregationAndMetricsState {
dimensionsShown: DimensionItem[];
}
-const _createFlowAggregateColumns: Readonly>[] = [
+const _createFlowAggregateColumns: Array>> = [
{
field: "field.type",
name: "Field type",
align: "left",
- render: (type) => (type == undefined ? "-" : type),
+ render: (type) => (type === undefined ? "-" : type),
},
];
-const aggregationColumns: Readonly>[] = [
+const aggregationColumns: Array>> = [
...BaseAggregationColumns,
..._createFlowAggregateColumns,
];
-const metricsColumns: EuiTableFieldDataColumnType[] = BaseMetricsColumns;
+const metricsColumns: Array> = BaseMetricsColumns;
export default class HistogramAndMetrics extends Component {
constructor(props: HistogramAndMetricsProps) {
@@ -112,7 +112,7 @@ export default class HistogramAndMetrics extends Component {
- if (metrics.length == 0) return [];
+ if (metrics.length === 0) return [];
const result = metrics.map((metric) => ({
source_field: metric.source_field.label,
all: false,
@@ -126,7 +126,7 @@ export default class HistogramAndMetrics extends Component;
+ targetIndex: Array<{ label: string; value?: IndexItem }>;
onChangeStep: (step: number) => void;
}
+// eslint-disable-next-line react/prefer-stateless-function
export default class JobNameAndIndices extends Component {
constructor(props: JobNameAndIndicesProps) {
super(props);
@@ -71,7 +72,7 @@ export default class JobNameAndIndices extends Component
Description
- {description == "" ? "-" : description}
+ {description === "" ? "-" : description}
diff --git a/public/pages/CreateRollup/components/MetricsCalculation/MetricsCalculation.tsx b/public/pages/CreateRollup/components/MetricsCalculation/MetricsCalculation.tsx
index fbf3981f7..da3d5680f 100644
--- a/public/pages/CreateRollup/components/MetricsCalculation/MetricsCalculation.tsx
+++ b/public/pages/CreateRollup/components/MetricsCalculation/MetricsCalculation.tsx
@@ -53,7 +53,7 @@ interface MetricsCalculationProps {
interface MetricsCalculationState {
isModalVisible: boolean;
searchText: string;
- selectedFieldType: EuiComboBoxOptionOption[];
+ selectedFieldType: Array>;
selectedFields: FieldItem[];
allSelectedFields: FieldItem[];
from: number;
@@ -97,7 +97,7 @@ export default class MetricsCalculation extends Component this.setState({ isEnableOpen: true });
- onChangeFieldType = (options: EuiComboBoxOptionOption[]): void => {
+ onChangeFieldType = (options: Array>): void => {
this.setState({ selectedFieldType: options });
};
@@ -109,7 +109,7 @@ export default class MetricsCalculation extends Component {
this.closeDisable();
this.onClickDisable("min");
@@ -396,7 +396,7 @@ export default class MetricsCalculation extends Component {
this.closeDisable();
this.onClickDisable("max");
@@ -408,7 +408,7 @@ export default class MetricsCalculation extends Component {
this.closeDisable();
this.onClickDisable("sum");
@@ -420,7 +420,7 @@ export default class MetricsCalculation extends Component {
this.closeDisable();
this.onClickDisable("avg");
@@ -432,7 +432,7 @@ export default class MetricsCalculation extends Component {
this.closeDisable();
this.onClickDisable("value_count");
@@ -447,7 +447,7 @@ export default class MetricsCalculation extends Component {
this.closeEnable();
this.onClickEnable("min");
@@ -459,7 +459,7 @@ export default class MetricsCalculation extends Component {
this.closeEnable();
this.onClickEnable("max");
@@ -471,7 +471,7 @@ export default class MetricsCalculation extends Component {
this.closeEnable();
this.onClickEnable("sum");
@@ -483,7 +483,7 @@ export default class MetricsCalculation extends Component {
this.closeEnable();
this.onClickEnable("avg");
@@ -495,7 +495,7 @@ export default class MetricsCalculation extends Component {
this.closeEnable();
this.onClickEnable("value_count");
@@ -534,7 +534,7 @@ export default class MetricsCalculation extends Component
+
Disable all
}
@@ -549,7 +549,7 @@ export default class MetricsCalculation extends Component
+
Enable all
}
@@ -581,7 +581,7 @@ export default class MetricsCalculation extends Component
- {metricError != "" && (
+ {metricError !== "" && (
{metricError}
diff --git a/public/pages/CreateRollup/components/RollupIndices/RollupIndices.tsx b/public/pages/CreateRollup/components/RollupIndices/RollupIndices.tsx
index a33832f32..b4a07af6b 100644
--- a/public/pages/CreateRollup/components/RollupIndices/RollupIndices.tsx
+++ b/public/pages/CreateRollup/components/RollupIndices/RollupIndices.tsx
@@ -16,19 +16,19 @@ import { wildcardOption } from "../../../../utils/helpers";
interface RollupIndicesProps {
indexService: IndexService;
- sourceIndex: { label: string; value?: IndexItem }[];
+ sourceIndex: Array<{ label: string; value?: IndexItem }>;
sourceIndexError: string;
- targetIndex: { label: string; value?: IndexItem }[];
+ targetIndex: Array<{ label: string; value?: IndexItem }>;
targetIndexError: string;
- onChangeSourceIndex: (options: EuiComboBoxOptionOption[]) => void;
- onChangeTargetIndex: (options: EuiComboBoxOptionOption[]) => void;
+ onChangeSourceIndex: (options: Array>) => void;
+ onChangeTargetIndex: (options: Array>) => void;
hasAggregation: boolean;
}
interface RollupIndicesState {
isLoading: boolean;
- indexOptions: { label: string; value?: IndexItem }[];
- targetIndexOptions: { label: string; value?: IndexItem }[];
+ indexOptions: Array<{ label: string; value?: IndexItem }>;
+ targetIndexOptions: Array<{ label: string; value?: IndexItem }>;
}
export const ROLLUP_RESULTS_HELP_TEXT_LINK = "https://opensearch.org/docs/latest/im-plugin/index-rollups/index/#step-1-set-up-indices";
@@ -88,7 +88,7 @@ export default class RollupIndices extends Component {
+ onCreateOption = (searchValue: string, flattenedOptions: Array<{ label: string; value?: IndexItem }>): void => {
const { targetIndexOptions } = this.state;
const { onChangeTargetIndex } = this.props;
const normalizedSearchValue = searchValue.trim();
@@ -104,7 +104,7 @@ export default class RollupIndices extends Component option.label.trim() === normalizedSearchValue) === -1) {
targetIndexOptions.concat(newOption);
- this.setState({ targetIndexOptions: targetIndexOptions });
+ this.setState({ targetIndexOptions });
}
onChangeTargetIndex([newOption]);
};
@@ -125,7 +125,7 @@ export default class RollupIndices extends Component
- You can't change indices after creating a job. Double-check the source and target index names before proceeding.
+ You can't change indices after creating a job. Double-check the source and target index names before proceeding.
{hasAggregation && (
@@ -139,7 +139,7 @@ export default class RollupIndices extends Component
@@ -158,7 +158,7 @@ export default class RollupIndices extends Component
{
@@ -181,7 +181,7 @@ export default class RollupIndices extends Component
diff --git a/public/pages/CreateRollup/components/Schedule/Schedule.tsx b/public/pages/CreateRollup/components/Schedule/Schedule.tsx
index 1162b33f1..8fa92db46 100644
--- a/public/pages/CreateRollup/components/Schedule/Schedule.tsx
+++ b/public/pages/CreateRollup/components/Schedule/Schedule.tsx
@@ -69,8 +69,8 @@ const selectInterval = (
-
-
+
+
@@ -80,7 +80,7 @@ const selectInterval = (
options={ScheduleIntervalTimeunitOptions}
value={intervalTimeunit}
onChange={onChangeTimeunit}
- isInvalid={interval == undefined || interval <= 0}
+ isInvalid={interval === undefined || interval <= 0}
/>
@@ -99,6 +99,7 @@ const isContinuous = (continuousJob: string, onChangeContinuousJob: (optionId: s
const timezones = moment.tz.names().map((tz) => ({ label: tz, text: tz }));
+// eslint-disable-next-line react/prefer-stateless-function
export default class Schedule extends Component {
constructor(props: ScheduleProps) {
super(props);
@@ -157,7 +158,7 @@ export default class Schedule extends Component {
- {continuousDefinition == "fixed" ? (
+ {continuousDefinition === "fixed" ? (
selectInterval(interval, intervalTimeunit, intervalError, onChangeIntervalTime, onChangeIntervalTimeunit)
) : (
diff --git a/public/pages/CreateRollup/components/ScheduleRolesAndNotifications/ScheduleRolesAndNotifications.tsx b/public/pages/CreateRollup/components/ScheduleRolesAndNotifications/ScheduleRolesAndNotifications.tsx
index bc5e36a49..c4c8623a1 100644
--- a/public/pages/CreateRollup/components/ScheduleRolesAndNotifications/ScheduleRolesAndNotifications.tsx
+++ b/public/pages/CreateRollup/components/ScheduleRolesAndNotifications/ScheduleRolesAndNotifications.tsx
@@ -24,6 +24,7 @@ interface ScheduleRolesAndNotificationsProps {
delayTimeunit: string;
}
+// eslint-disable-next-line react/prefer-stateless-function
export default class ScheduleRolesAndNotifications extends Component {
render() {
const {
@@ -39,7 +40,7 @@ export default class ScheduleRolesAndNotifications extends Component
Execution delay
- {isNaN(delayTime) || delayTime == undefined || delayTime == 0 ? "-" : delayTime + " " + parseTimeunit(delayTimeunit)}
+ {isNaN(delayTime) || delayTime === undefined || delayTime === 0 ? "-" : delayTime + " " + parseTimeunit(delayTimeunit)}
diff --git a/public/pages/CreateRollup/components/TimeAggregations/TimeAggregation.tsx b/public/pages/CreateRollup/components/TimeAggregations/TimeAggregation.tsx
index e6b1ba087..e71f003e3 100644
--- a/public/pages/CreateRollup/components/TimeAggregations/TimeAggregation.tsx
+++ b/public/pages/CreateRollup/components/TimeAggregations/TimeAggregation.tsx
@@ -29,7 +29,7 @@ interface TimeAggregationProps {
rollupService: RollupService;
intervalValue: number;
intervalType: string;
- selectedTimestamp: EuiComboBoxOptionOption[];
+ selectedTimestamp: Array>;
timestampError: string;
timeunit: string;
timezone: string;
@@ -37,11 +37,12 @@ interface TimeAggregationProps {
onChangeIntervalType: (optionId: string) => void;
onChangeIntervalValue: (e: ChangeEvent) => void;
- onChangeTimestamp: (options: EuiComboBoxOptionOption[]) => void;
+ onChangeTimestamp: (options: Array>) => void;
onChangeTimeunit: (e: ChangeEvent) => void;
onChangeTimezone: (e: ChangeEvent) => void;
}
+// eslint-disable-next-line @typescript-eslint/no-empty-interface
interface TimeAggregationState {}
const radios = [
@@ -57,6 +58,7 @@ const radios = [
const timezones = moment.tz.names().map((tz) => ({ label: tz, text: tz }));
+// eslint-disable-next-line react/prefer-stateless-function
export default class TimeAggregation extends Component {
constructor(props: TimeAggregationProps) {
super(props);
@@ -79,7 +81,7 @@ export default class TimeAggregation extends Component item.type == "date");
+ const dateFields = fieldsOption.filter((item) => item.type === "date");
return (
@@ -87,7 +89,8 @@ export default class TimeAggregation extends ComponentTime aggregation
- Your source indices must include a timestamp field. The rollup job creates a date histogram for the field you specify." "
+ Your source indices must include a timestamp field. The rollup job creates a date histogram for the field you specify."
+ "
@@ -107,19 +110,19 @@ export default class TimeAggregation extends Component onChangeIntervalType(id)} name="intervalType" />
- {intervalType == "fixed" ? (
+ {intervalType === "fixed" ? (
-
+
@@ -139,7 +142,7 @@ export default class TimeAggregation extends Component
diff --git a/public/pages/CreateRollup/containers/CreateRollup/CreateRollup.tsx b/public/pages/CreateRollup/containers/CreateRollup/CreateRollup.tsx
index a28b4a519..d372cd763 100644
--- a/public/pages/CreateRollup/containers/CreateRollup/CreateRollup.tsx
+++ b/public/pages/CreateRollup/containers/CreateRollup/CreateRollup.tsx
@@ -22,18 +22,19 @@ interface CreateRollupProps extends RouteComponentProps {
isSubmitting: boolean;
hasSubmitted: boolean;
description: string;
- sourceIndex: { label: string; value?: IndexItem }[];
+ sourceIndex: Array<{ label: string; value?: IndexItem }>;
sourceIndexError: string;
- targetIndex: { label: string; value?: IndexItem }[];
+ targetIndex: Array<{ label: string; value?: IndexItem }>;
targetIndexError: string;
onChangeName: (e: ChangeEvent) => void;
onChangeDescription: (value: ChangeEvent) => void;
- onChangeSourceIndex: (options: EuiComboBoxOptionOption[]) => void;
- onChangeTargetIndex: (options: EuiComboBoxOptionOption[]) => void;
+ onChangeSourceIndex: (options: Array>) => void;
+ onChangeTargetIndex: (options: Array