From 487b9605bbf391b8b1e403a3759220af336aebcc Mon Sep 17 00:00:00 2001 From: Kshitij Tandon Date: Fri, 23 Aug 2024 05:51:35 +0530 Subject: [PATCH] Bug fixes and retracting some formatting changes (#1141) (#1145) * A couple of bug fixes and Look Good Feel Good changes * Revert yarn.lock changes * Bug fix in Indexes page and worked on comments on previous commit * Add yarn file * Removing feel good changes from prior commit * Fixed rerendering of pages on clicking change and create buttons * Adding MDS support in Shrink page in Indexes in ISM * Fixed a test file and removed couple of reduntant flag uses * Some more frivolous code from last commit * Some snap file changes * Resolved comments * Import issue in Templates * Description changes --------- Signed-off-by: Kshitij Tandon --- .../IndexControls/IndexControls.tsx | 63 ++-- .../ChangeManagedIndices.tsx | 5 +- .../ChangeManagedIndices.test.tsx.snap | 12 +- .../components/NewPolicy/NewPolicy.tsx | 3 - .../__snapshots__/NewPolicy.test.tsx.snap | 6 +- .../containers/ChangePolicy/ChangePolicy.tsx | 2 - .../__snapshots__/ChangePolicy.test.tsx.snap | 18 +- .../IndexControls/IndexControls.tsx | 2 - .../ComposableTemplates.tsx | 2 - .../ReviewAndCreateStep.tsx | 1 - .../IndexControls/IndexControls.tsx | 71 ++-- .../Indices/containers/Indices/Indices.tsx | 11 +- public/pages/Main/Main.tsx | 2 + .../ManagedIndexControls.tsx | 49 +-- .../ManagedIndices/ManagedIndices.tsx | 88 +++-- .../container/Reindex/Reindex.test.tsx | 5 + .../Reindex/container/Reindex/Reindex.tsx | 321 ++++++++++-------- .../ShrinkIndex/ShrinkIndex.test.tsx | 5 + .../container/ShrinkIndex/ShrinkIndex.tsx | 125 ++++--- .../container/SplitIndex/SplitIndex.test.tsx | 5 + .../container/SplitIndex/SplitIndex.tsx | 86 +++-- .../IndexControls/IndexControls.tsx | 31 +- .../containers/Templates/Templates.tsx | 10 +- .../Transforms/TransformDetails.tsx | 2 +- .../containers/Transforms/Transforms.tsx | 8 +- .../pages/Transforms/utils/metadataHelper.tsx | 3 +- test/helper.ts | 10 + yarn.lock | 20 +- 28 files changed, 558 insertions(+), 408 deletions(-) create mode 100644 test/helper.ts diff --git a/public/pages/Aliases/components/IndexControls/IndexControls.tsx b/public/pages/Aliases/components/IndexControls/IndexControls.tsx index a4fdf908a..47b0f0d1f 100644 --- a/public/pages/Aliases/components/IndexControls/IndexControls.tsx +++ b/public/pages/Aliases/components/IndexControls/IndexControls.tsx @@ -4,7 +4,7 @@ */ import React, { useEffect, useState } from "react"; -import { EuiCompressedComboBox, EuiCompressedFieldSearch, EuiFlexGroup, EuiFlexItem } from "@elastic/eui"; +import { EuiCompressedComboBox, EuiCompressedFieldSearch, EuiFlexGroup, EuiFlexItem, EuiSpacer } from "@elastic/eui"; import { ALIAS_STATUS_OPTIONS, IndicesUpdateMode } from "../../../../utils/constants"; import { getUISettings } from "../../../../services/Services"; import AliasesActions from "../../containers/AliasActions"; @@ -42,35 +42,38 @@ export default function SearchControls(props: SearchControlsProps) { const useUpdatedUX = uiSettings.get("home:useNewHomePage"); return useUpdatedUX ? ( - - - onChange("search", e.target.value)} - /> - - - onChange("status", (val || []).map((item) => item).join(","))} - value={state.status ? state.status.split(",").map((label) => label) : []} - options={ALIAS_STATUS_OPTIONS} - useNewUX={useUpdatedUX} - /> - - - - - + <> + + + onChange("search", e.target.value)} + /> + + + onChange("status", (val || []).map((item) => item).join(","))} + value={state.status ? state.status.split(",").map((label) => label) : []} + options={ALIAS_STATUS_OPTIONS} + useNewUX={useUpdatedUX} + /> + + + + + + + ) : ( diff --git a/public/pages/ChangePolicy/components/ChangeManagedIndices/ChangeManagedIndices.tsx b/public/pages/ChangePolicy/components/ChangeManagedIndices/ChangeManagedIndices.tsx index 738c761d4..412691818 100644 --- a/public/pages/ChangePolicy/components/ChangeManagedIndices/ChangeManagedIndices.tsx +++ b/public/pages/ChangePolicy/components/ChangeManagedIndices/ChangeManagedIndices.tsx @@ -17,7 +17,6 @@ interface ChangeManagedIndicesProps { onChangeManagedIndices: (selectedManagedIndices: { label: string; value?: ManagedIndexItem }[]) => void; onChangeStateFilters: (stateFilter: { label: string }[]) => void; managedIndicesError: string; - useUpdatedUX?: boolean; } interface ChangeManagedIndicesState { @@ -72,7 +71,7 @@ export default class ChangeManagedIndices extends Component, selectedManagedIndex: { label: string; value?: ManagedIndexItem }) => { if (!selectedManagedIndex.value) return accu; @@ -109,7 +108,6 @@ export default class ChangeManagedIndices extends Component @@ -122,7 +120,6 @@ export default class ChangeManagedIndices extends Component diff --git a/public/pages/ChangePolicy/components/ChangeManagedIndices/__snapshots__/ChangeManagedIndices.test.tsx.snap b/public/pages/ChangePolicy/components/ChangeManagedIndices/__snapshots__/ChangeManagedIndices.test.tsx.snap index d14c359ac..306682fb1 100644 --- a/public/pages/ChangePolicy/components/ChangeManagedIndices/__snapshots__/ChangeManagedIndices.test.tsx.snap +++ b/public/pages/ChangePolicy/components/ChangeManagedIndices/__snapshots__/ChangeManagedIndices.test.tsx.snap @@ -59,17 +59,17 @@ exports[` spec renders the component 1`] = ` aria-describedby="some_html_id-help-0" aria-expanded="false" aria-haspopup="listbox" - class="euiComboBox" + class="euiComboBox euiComboBox--compressed" role="combobox" >
@@ -134,17 +134,17 @@ exports[` spec renders the component 1`] = ` aria-describedby="some_html_id-help-0" aria-expanded="false" aria-haspopup="listbox" - class="euiComboBox euiComboBox-isDisabled" + class="euiComboBox euiComboBox--compressed euiComboBox-isDisabled" role="combobox" >
diff --git a/public/pages/ChangePolicy/components/NewPolicy/NewPolicy.tsx b/public/pages/ChangePolicy/components/NewPolicy/NewPolicy.tsx index 74153cf35..14a1c883d 100644 --- a/public/pages/ChangePolicy/components/NewPolicy/NewPolicy.tsx +++ b/public/pages/ChangePolicy/components/NewPolicy/NewPolicy.tsx @@ -33,7 +33,6 @@ interface NewPolicyProps { onChangePolicy: (selectedPolicies: PolicyOption[]) => void; onChangeStateRadio: (optionId: string) => void; onStateSelectChange: (e: React.ChangeEvent) => void; - useUpdatedUX?: boolean; } interface NewPolicyState { @@ -123,7 +122,6 @@ export default class NewPolicy extends React.Component @@ -140,7 +138,6 @@ export default class NewPolicy extends React.Component
diff --git a/public/pages/ChangePolicy/components/NewPolicy/__snapshots__/NewPolicy.test.tsx.snap b/public/pages/ChangePolicy/components/NewPolicy/__snapshots__/NewPolicy.test.tsx.snap index 4c6f47674..e1b2edcbc 100644 --- a/public/pages/ChangePolicy/components/NewPolicy/__snapshots__/NewPolicy.test.tsx.snap +++ b/public/pages/ChangePolicy/components/NewPolicy/__snapshots__/NewPolicy.test.tsx.snap @@ -80,17 +80,17 @@ exports[` spec renders the component 1`] = `