Skip to content

Commit

Permalink
Bug fixes and retracting some formatting changes (opensearch-project#…
Browse files Browse the repository at this point in the history
…1141)

* A couple of bug fixes and Look Good Feel Good changes

Signed-off-by: Kshitij Tandon <[email protected]>

* Revert yarn.lock changes

Signed-off-by: Kshitij Tandon <[email protected]>

* Bug fix in Indexes page and worked on comments on previous commit

Signed-off-by: Kshitij Tandon <[email protected]>

* Add yarn file

Signed-off-by: Kshitij Tandon <[email protected]>

* Removing feel good changes from prior commit

Signed-off-by: Kshitij Tandon <[email protected]>

* Fixed rerendering of pages on clicking change and create buttons

Signed-off-by: Kshitij Tandon <[email protected]>

* Adding MDS support in Shrink page in Indexes in ISM

Signed-off-by: Kshitij Tandon <[email protected]>

* Fixed a test file and removed couple of reduntant flag uses

Signed-off-by: Kshitij Tandon <[email protected]>

* Some more frivolous code from last commit

Signed-off-by: Kshitij Tandon <[email protected]>

* Some snap file changes

Signed-off-by: Kshitij Tandon <[email protected]>

* Resolved comments

Signed-off-by: Kshitij Tandon <[email protected]>

* Import issue in Templates

Signed-off-by: Kshitij Tandon <[email protected]>

* Description changes

Signed-off-by: Kshitij Tandon <[email protected]>

---------

Signed-off-by: Kshitij Tandon <[email protected]>
  • Loading branch information
tandonks committed Aug 22, 2024
1 parent 14e4662 commit 83eb575
Show file tree
Hide file tree
Showing 28 changed files with 558 additions and 408 deletions.
63 changes: 33 additions & 30 deletions public/pages/Aliases/components/IndexControls/IndexControls.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down Expand Up @@ -42,35 +42,38 @@ export default function SearchControls(props: SearchControlsProps) {
const useUpdatedUX = uiSettings.get("home:useNewHomePage");

return useUpdatedUX ? (
<EuiFlexGroup style={{ padding: "0px 5px" }} alignItems="center">
<EuiFlexItem>
<EuiCompressedFieldSearch
fullWidth
placeholder="Search"
value={state.search}
onChange={(e) => onChange("search", e.target.value)}
/>
</EuiFlexItem>
<EuiFlexItem style={{ flexBasis: "100px" }} grow={false}>
<FilterGroup
filterButtonProps={{
children: "Status",
}}
onChange={(val) => onChange("status", (val || []).map((item) => item).join(","))}
value={state.status ? state.status.split(",").map((label) => label) : []}
options={ALIAS_STATUS_OPTIONS}
useNewUX={useUpdatedUX}
/>
</EuiFlexItem>
<EuiFlexItem grow={false}>
<AliasesActions
onUpdateAlias={props.onUpdateAlias}
selectedItems={props.value.selectedItems}
onDelete={props.onDelete}
history={props.history}
/>
</EuiFlexItem>
</EuiFlexGroup>
<>
<EuiFlexGroup alignItems="center" gutterSize="s">
<EuiFlexItem>
<EuiCompressedFieldSearch
fullWidth
placeholder="Search"
value={state.search}
onChange={(e) => onChange("search", e.target.value)}
/>
</EuiFlexItem>
<EuiFlexItem style={{ flexBasis: "100px" }} grow={false}>
<FilterGroup
filterButtonProps={{
children: "Status",
}}
onChange={(val) => onChange("status", (val || []).map((item) => item).join(","))}
value={state.status ? state.status.split(",").map((label) => label) : []}
options={ALIAS_STATUS_OPTIONS}
useNewUX={useUpdatedUX}
/>
</EuiFlexItem>
<EuiFlexItem grow={false}>
<AliasesActions
onUpdateAlias={props.onUpdateAlias}
selectedItems={props.value.selectedItems}
onDelete={props.onDelete}
history={props.history}
/>
</EuiFlexItem>
</EuiFlexGroup>
<EuiSpacer size="m" />
</>
) : (
<EuiFlexGroup style={{ padding: "0px 5px" }} alignItems="center">
<EuiFlexItem>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ interface ChangeManagedIndicesProps {
onChangeManagedIndices: (selectedManagedIndices: { label: string; value?: ManagedIndexItem }[]) => void;
onChangeStateFilters: (stateFilter: { label: string }[]) => void;
managedIndicesError: string;
useUpdatedUX?: boolean;
}

interface ChangeManagedIndicesState {
Expand Down Expand Up @@ -72,7 +71,7 @@ export default class ChangeManagedIndices extends Component<ChangeManagedIndices

render() {
const { managedIndices, managedIndicesIsLoading, stateFilterSearchValue } = this.state;
const { selectedManagedIndices, selectedStateFilters, managedIndicesError, useUpdatedUX } = this.props;
const { selectedManagedIndices, selectedStateFilters, managedIndicesError } = this.props;
const uniqueStates = selectedManagedIndices.reduce(
(accu: Set<any>, selectedManagedIndex: { label: string; value?: ManagedIndexItem }) => {
if (!selectedManagedIndex.value) return accu;
Expand Down Expand Up @@ -109,7 +108,6 @@ export default class ChangeManagedIndices extends Component<ChangeManagedIndices
// @ts-ignore
onChange={this.props.onChangeManagedIndices}
onSearchChange={this.onManagedIndexSearchChange}
compressed={useUpdatedUX ? true : false}
/>
</EuiCompressedFormRow>

Expand All @@ -122,7 +120,6 @@ export default class ChangeManagedIndices extends Component<ChangeManagedIndices
// @ts-ignore
onChange={this.props.onChangeStateFilters}
onSearchChange={this.onStateFilterSearchChange}
compressed={useUpdatedUX ? true : false}
/>
</EuiCompressedFormRow>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,17 +59,17 @@ exports[`<ChangeManagedIndices /> 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"
>
<div
class="euiFormControlLayout"
class="euiFormControlLayout euiFormControlLayout--compressed"
>
<div
class="euiFormControlLayout__childrenWrapper"
>
<div
class="euiComboBox__inputWrap euiComboBox__inputWrap-isClearable"
class="euiComboBox__inputWrap euiComboBox__inputWrap--compressed euiComboBox__inputWrap-isClearable"
data-test-subj="comboBoxInput"
tabindex="-1"
>
Expand Down Expand Up @@ -134,17 +134,17 @@ exports[`<ChangeManagedIndices /> 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"
>
<div
class="euiFormControlLayout"
class="euiFormControlLayout euiFormControlLayout--compressed"
>
<div
class="euiFormControlLayout__childrenWrapper"
>
<div
class="euiComboBox__inputWrap"
class="euiComboBox__inputWrap euiComboBox__inputWrap--compressed"
data-test-subj="comboBoxInput"
tabindex="-1"
>
Expand Down
3 changes: 0 additions & 3 deletions public/pages/ChangePolicy/components/NewPolicy/NewPolicy.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ interface NewPolicyProps {
onChangePolicy: (selectedPolicies: PolicyOption[]) => void;
onChangeStateRadio: (optionId: string) => void;
onStateSelectChange: (e: React.ChangeEvent<HTMLSelectElement>) => void;
useUpdatedUX?: boolean;
}

interface NewPolicyState {
Expand Down Expand Up @@ -123,7 +122,6 @@ export default class NewPolicy extends React.Component<NewPolicyProps, NewPolicy
// @ts-ignore
onChange={this.props.onChangePolicy}
onSearchChange={this.onPolicySearchChange}
compressed={useUpdatedUX ? true : false}
/>
</EuiCompressedFormRow>

Expand All @@ -140,7 +138,6 @@ export default class NewPolicy extends React.Component<NewPolicyProps, NewPolicy
value={stateSelected}
onChange={this.props.onStateSelectChange}
aria-label="Start state for new policy"
compressed={useUpdatedUX ? true : false}
/>
</EuiCompressedFormRow>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,17 +80,17 @@ exports[`<NewPolicy /> spec renders the component 1`] = `
<div
aria-expanded="false"
aria-haspopup="listbox"
class="euiComboBox"
class="euiComboBox euiComboBox--compressed"
role="combobox"
>
<div
class="euiFormControlLayout"
class="euiFormControlLayout euiFormControlLayout--compressed"
>
<div
class="euiFormControlLayout__childrenWrapper"
>
<div
class="euiComboBox__inputWrap euiComboBox__inputWrap--noWrap euiComboBox__inputWrap-isClearable"
class="euiComboBox__inputWrap euiComboBox__inputWrap--compressed euiComboBox__inputWrap--noWrap euiComboBox__inputWrap-isClearable"
data-test-subj="comboBoxInput"
tabindex="-1"
>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,6 @@ export class ChangePolicy extends Component<ChangePolicyProps, ChangePolicyState
onChangeManagedIndices={this.onChangeManagedIndices}
onChangeStateFilters={this.onChangeStateFilters}
managedIndicesError={hasSubmitted ? managedIndicesError : ""}
useUpdatedUX={useUpdatedUX}
/>

<EuiSpacer />
Expand All @@ -187,7 +186,6 @@ export class ChangePolicy extends Component<ChangePolicyProps, ChangePolicyState
onChangeStateRadio={this.onChangeStateRadio}
onStateSelectChange={this.onStateSelectChange}
selectedPoliciesError={hasSubmitted ? selectedPoliciesError : ""}
useUpdatedUX={useUpdatedUX}
/>

<EuiSpacer />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,17 +70,17 @@ exports[`<ChangePolicy /> 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"
>
<div
class="euiFormControlLayout"
class="euiFormControlLayout euiFormControlLayout--compressed"
>
<div
class="euiFormControlLayout__childrenWrapper"
>
<div
class="euiComboBox__inputWrap euiComboBox__inputWrap-isClearable"
class="euiComboBox__inputWrap euiComboBox__inputWrap--compressed euiComboBox__inputWrap-isClearable"
data-test-subj="comboBoxInput"
tabindex="-1"
>
Expand Down Expand Up @@ -145,17 +145,17 @@ exports[`<ChangePolicy /> 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"
>
<div
class="euiFormControlLayout"
class="euiFormControlLayout euiFormControlLayout--compressed"
>
<div
class="euiFormControlLayout__childrenWrapper"
>
<div
class="euiComboBox__inputWrap"
class="euiComboBox__inputWrap euiComboBox__inputWrap--compressed"
data-test-subj="comboBoxInput"
tabindex="-1"
>
Expand Down Expand Up @@ -291,17 +291,17 @@ exports[`<ChangePolicy /> spec renders the component 1`] = `
<div
aria-expanded="false"
aria-haspopup="listbox"
class="euiComboBox"
class="euiComboBox euiComboBox--compressed"
role="combobox"
>
<div
class="euiFormControlLayout"
class="euiFormControlLayout euiFormControlLayout--compressed"
>
<div
class="euiFormControlLayout__childrenWrapper"
>
<div
class="euiComboBox__inputWrap euiComboBox__inputWrap--noWrap euiComboBox__inputWrap-isClearable"
class="euiComboBox__inputWrap euiComboBox__inputWrap--compressed euiComboBox__inputWrap--noWrap euiComboBox__inputWrap-isClearable"
data-test-subj="comboBoxInput"
tabindex="-1"
>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ export interface SearchControlsProps {
search: string;
selectedTypes: string[];
};
useNewUX?: boolean;
onSearchChange: (args: SearchControlsProps["value"]) => void;
}

Expand Down Expand Up @@ -47,7 +46,6 @@ export default function SearchControls(props: SearchControlsProps) {
}}
onChange={(val) => onChange("selectedTypes", val || [])}
value={state.selectedTypes}
useNewUx={props.useNewUX}
options={[
{
label: IndicesUpdateMode.alias,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -436,7 +436,6 @@ class ComposableTemplates extends MDSEnabledComponent<ComposableTemplatesProps,
search: this.state.search,
selectedTypes: this.state.selectedTypes,
}}
useNewUX={useNewUX}
onSearchChange={this.onSearchChange}
/>
<EuiHorizontalRule margin="xs" />
Expand Down Expand Up @@ -515,7 +514,6 @@ class ComposableTemplates extends MDSEnabledComponent<ComposableTemplatesProps,
search: this.state.search,
selectedTypes: this.state.selectedTypes,
}}
useNewUX={useNewUX}
onSearchChange={this.onSearchChange}
/>
<EuiHorizontalRule margin="xs" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ import JobNameAndIndices from "../../components/JobNameAndIndices";
import ReviewDefinition from "../../components/ReviewDefinition";
import ReviewSchedule from "../../components/ReviewSchedule";
import { CoreServicesContext } from "../../../../components/core_services";
import { getUISettings } from "../../../../services/Services";

interface ReviewAndCreateStepProps extends RouteComponentProps {
transformService: TransformService;
Expand Down
Loading

0 comments on commit 83eb575

Please sign in to comment.