Skip to content

Commit

Permalink
Removing feel good changes from prior commit
Browse files Browse the repository at this point in the history
Signed-off-by: Kshitij Tandon <tandonks@amazon.com>
  • Loading branch information
tandonks committed Aug 20, 2024
1 parent 53dd53d commit d0d4f93
Show file tree
Hide file tree
Showing 17 changed files with 22 additions and 84 deletions.
4 changes: 2 additions & 2 deletions public/components/ContentPanel/ContentPanelActions.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ interface ContentPanelActionsProps {
onClickModal: (onShow: (component: any, props: object) => void) => () => void;
};
}[];
size?: "s" | "m" | undefined;
size?: "s" | "m";
}

const ContentPanelActions: React.SFC<ContentPanelActionsProps> = ({ actions, size }) => (
Expand All @@ -26,7 +26,7 @@ const ContentPanelActions: React.SFC<ContentPanelActionsProps> = ({ actions, siz
let button = children ? (
children
) : (
<EuiButton {...buttonProps} data-test-subj={`${text}Button`} size={size}>
<EuiButton {...buttonProps} data-test-subj={`${text}Button`} size={size ? size : "m"}>
{text}
</EuiButton>
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ import {
EuiComboBoxOptionOption,
EuiFieldNumber,
EuiAccordion,
EuiRadioGroup,
EuiText,
EuiCheckbox,
EuiPanel,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ interface ConfigureTransformProps {
onChangeName: (value: ChangeEvent<HTMLInputElement>) => void;
onChangeDescription: (value: ChangeEvent<HTMLTextAreaElement>) => void;
description: string;
useUpdatedUX: boolean;
}

const ConfigureTransform = ({
Expand All @@ -24,14 +23,8 @@ const ConfigureTransform = ({
onChangeName,
onChangeDescription,
description,
useUpdatedUX,
}: ConfigureTransformProps) => (
<ContentPanel
panelStyles={{ padding: "20px 20px" }}
bodyStyles={{ padding: "10px" }}
title="Job name and description"
titleSize={useUpdatedUX ? "s" : "m"}
>
<ContentPanel panelStyles={{ padding: "20px 20px" }} bodyStyles={{ padding: "10px" }} title="Job name and description" titleSize="m">
<div>
<EuiFormRow label="Name" helpText="Specify a unique, descriptive name." isInvalid={!!transformIdError} error={transformIdError}>
<EuiFieldText
Expand All @@ -40,7 +33,6 @@ const ConfigureTransform = ({
value={transformId}
onChange={onChangeName}
disabled={isEdit}
compressed={useUpdatedUX}
/>
</EuiFormRow>
<EuiSpacer />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ interface DefineTransformsProps {
onRemoveTransformation: (name: string) => void;
previewTransform: any[];
isReadOnly: boolean;
useUpdatedUX?: boolean;
}

export default function DefineTransforms({
Expand All @@ -48,7 +47,6 @@ export default function DefineTransforms({
onRemoveTransformation,
previewTransform,
isReadOnly,
useUpdatedUX,
}: DefineTransformsProps) {
let columns: EuiDataGridColumn[] = [];

Expand Down Expand Up @@ -212,12 +210,7 @@ export default function DefineTransforms({
);

return (
<ContentPanel
panelStyles={{ padding: "20px 20px" }}
bodyStyles={{ padding: "10px" }}
title="Select fields to transform"
titleSize={useUpdatedUX ? "s" : "m"}
>
<ContentPanel panelStyles={{ padding: "20px 20px" }} bodyStyles={{ padding: "10px" }} title="Select fields to transform" titleSize="m">
<EuiText>
<h5>Original fields with sample data</h5>
</EuiText>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ interface JobNameAndIndicesProps {
targetIndex: { label: string; value?: IndexItem }[];
sourceIndexFilter: string;
onChangeStep: (step: number) => void;
useUpdatedUX: boolean;
}

export default class JobNameAndIndices extends Component<JobNameAndIndicesProps> {
Expand All @@ -25,7 +24,7 @@ export default class JobNameAndIndices extends Component<JobNameAndIndicesProps>
}

render() {
const { transformId, description, onChangeStep, sourceIndex, targetIndex, sourceIndexFilter, useUpdatedUX } = this.props;
const { transformId, description, onChangeStep, sourceIndex, targetIndex, sourceIndexFilter } = this.props;

return (
<ContentPanel
Expand All @@ -41,15 +40,14 @@ export default class JobNameAndIndices extends Component<JobNameAndIndicesProps>
},
},
]}
size={useUpdatedUX ? "s" : undefined}
/>
)}
</ModalConsumer>
}
panelStyles={{ padding: "20px 20px" }}
bodyStyles={{ padding: "10px" }}
title="Set up indices"
titleSize={useUpdatedUX ? "s" : "m"}
titleSize="m"
>
<div>
<EuiFlexGrid columns={3}>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ interface ReviewDefinitionProps {
onRemoveTransformation: (name: string) => void;
previewTransform: any[];
onChangeStep: (step: number) => void;
useUpdatedUX: boolean;
}

export default class ReviewDefinition extends Component<ReviewDefinitionProps> {
Expand All @@ -45,7 +44,6 @@ export default class ReviewDefinition extends Component<ReviewDefinitionProps> {
onRemoveTransformation,
onChangeStep,
aggList,
useUpdatedUX,
} = this.props;

const aggListItems = () => {
Expand Down Expand Up @@ -97,15 +95,14 @@ export default class ReviewDefinition extends Component<ReviewDefinitionProps> {
},
},
]}
size={useUpdatedUX ? "s" : undefined}
/>
)}
</ModalConsumer>
}
panelStyles={{ padding: "20px 20px" }}
bodyStyles={{ padding: "10px" }}
title="Define transforms"
titleSize={useUpdatedUX ? "s" : "m"}
titleSize="m"
>
<div>
<EuiFlexGrid columns={4}>{aggListItems()}</EuiFlexGrid>
Expand All @@ -124,7 +121,6 @@ export default class ReviewDefinition extends Component<ReviewDefinitionProps> {
onAggregationSelectionChange={onAggregationSelectionChange}
onRemoveTransformation={onRemoveTransformation}
isReadOnly={true}
useUpdatedUX={useUpdatedUX}
/>
</div>
</EuiAccordion>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ interface ReviewScheduleProps {
intervalTimeunit: string;
pageSize: number;
onChangeStep: (step: number) => void;
useUpdatedUX: boolean;
}

export default class ReviewSchedule extends Component<ReviewScheduleProps> {
Expand All @@ -25,7 +24,7 @@ export default class ReviewSchedule extends Component<ReviewScheduleProps> {
}

render() {
const { jobEnabledByDefault, continuousJob, interval, intervalTimeunit, pageSize, onChangeStep, useUpdatedUX } = this.props;
const { jobEnabledByDefault, continuousJob, interval, intervalTimeunit, pageSize, onChangeStep } = this.props;

const enabled = jobEnabledByDefault ? "Yes" : "No";

Expand All @@ -45,15 +44,14 @@ export default class ReviewSchedule extends Component<ReviewScheduleProps> {
},
},
]}
size={useUpdatedUX ? "s" : undefined}
/>
)}
</ModalConsumer>
}
panelStyles={{ padding: "20px 20px" }}
bodyStyles={{ padding: "10px" }}
title="Specify schedule"
titleSize={useUpdatedUX ? "s" : "m"}
titleSize="m"
>
<div>
<EuiFlexGrid columns={4}>
Expand Down
19 changes: 3 additions & 16 deletions public/pages/CreateTransform/components/Schedule/Schedule.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ interface ScheduleProps {
onChangeIntervalTime: (e: ChangeEvent<HTMLInputElement>) => void;
onChangeIntervalTimeunit: (e: ChangeEvent<HTMLSelectElement>) => void;
onChangePage: (e: ChangeEvent<HTMLInputElement>) => void;
useUpdatedUX: boolean;
}

const radios = [
Expand Down Expand Up @@ -65,15 +64,9 @@ export default class Schedule extends Component<ScheduleProps> {
onChangeIntervalTime,
onChangeIntervalTimeunit,
onChangePage,
useUpdatedUX,
} = this.props;
return (
<ContentPanel
panelStyles={{ padding: "20px 20px" }}
bodyStyles={{ padding: "10px" }}
title="Schedule"
titleSize={useUpdatedUX ? "s" : "m"}
>
<ContentPanel panelStyles={{ padding: "20px 20px" }} bodyStyles={{ padding: "10px" }} title="Schedule" titleSize="m">
<div>
{!isEdit && (
<EuiCheckbox
Expand All @@ -89,7 +82,7 @@ export default class Schedule extends Component<ScheduleProps> {
{!isEdit && isContinuous(continuousJob, onChangeContinuousJob)}

{/* TODO: Replace with switch block when define by cron expressions is supported. */}
{selectInterval(interval, intervalTimeunit, intervalError, onChangeIntervalTime, onChangeIntervalTimeunit, useUpdatedUX)}
{selectInterval(interval, intervalTimeunit, intervalError, onChangeIntervalTime, onChangeIntervalTimeunit)}
<EuiSpacer size="m" />
<EuiHorizontalRule margin="xs" />
<EuiSpacer size="m" />
Expand All @@ -105,13 +98,7 @@ export default class Schedule extends Component<ScheduleProps> {
you to start with the default value, and adjust based
on your use case and shard size.`}
>
<EuiFieldNumber
min={1}
placeholder="1000"
value={pageSize}
onChange={onChangePage}
compressed={useUpdatedUX ? true : undefined}
/>
<EuiFieldNumber min={1} placeholder="1000" value={pageSize} onChange={onChangePage} />
</EuiFormRow>
</EuiAccordion>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ interface TransformIndicesProps {
hasAggregation: boolean;
fields: FieldItem[];
beenWarned: boolean;
useUpdatedUX: boolean;
}

interface TransformIndicesState {
Expand Down Expand Up @@ -154,7 +153,6 @@ export default class TransformIndices extends Component<TransformIndicesProps, T
onChangeTargetIndex,
hasAggregation,
beenWarned,
useUpdatedUX,
} = this.props;

const { isLoading, indexOptions, targetIndexOptions, isPopoverOpen } = this.state;
Expand All @@ -165,12 +163,7 @@ export default class TransformIndices extends Component<TransformIndicesProps, T

return (
<div>
<ContentPanel
panelStyles={{ padding: "20px 20px" }}
bodyStyles={{ padding: "10px" }}
title="Indices"
titleSize={useUpdatedUX ? "s" : "m"}
>
<ContentPanel panelStyles={{ padding: "20px 20px" }} bodyStyles={{ padding: "10px" }} title="Indices" titleSize="m">
<div>
{hasAggregation && (
<Fragment>
Expand All @@ -195,7 +188,6 @@ export default class TransformIndices extends Component<TransformIndicesProps, T
isLoading={isLoading}
isInvalid={sourceIndexError != ""}
data-test-subj="sourceIndexCombobox"
compressed={useUpdatedUX}
/>
</EuiFormRow>
<EuiSpacer size="s" />
Expand Down Expand Up @@ -277,7 +269,6 @@ export default class TransformIndices extends Component<TransformIndicesProps, T
isLoading={isLoading}
isInvalid={targetIndexError != ""}
data-test-subj="targetIndexCombobox"
compressed={useUpdatedUX}
/>
</EuiFormRow>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,6 @@ export default class DefineTransformsStep extends Component<DefineTransformsStep
onEditTransformation={onEditTransformation}
onRemoveTransformation={onRemoveTransformation}
isReadOnly={false}
useUpdatedUX={this.props.useUpdatedUX}
/>
</EuiFlexItem>
</EuiFlexGroup>
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 Expand Up @@ -82,16 +81,11 @@ export default class ReviewAndCreateStep extends Component<ReviewAndCreateStepPr
</EuiFlexItem>
<EuiFlexItem style={{ overflow: "auto", flex: 1 }} grow={false}>
{Title()}
<JobNameAndIndices {...this.props} useUpdatedUX={this.props.useUpdatedUX} />
<JobNameAndIndices {...this.props} />
<EuiSpacer />
<ReviewDefinition
{...this.props}
notifications={this.context.notifications}
sourceIndex={this.props.sourceIndex[0].label}
useUpdatedUX={this.props.useUpdatedUX}
/>
<ReviewDefinition {...this.props} notifications={this.context.notifications} sourceIndex={this.props.sourceIndex[0].label} />
<EuiSpacer />
<ReviewSchedule {...this.props} useUpdatedUX={this.props.useUpdatedUX} />
<ReviewSchedule {...this.props} />
<EuiSpacer />
<EuiCallOut color="warning">
<p>You can only change the description and schedule after creating a job. Double-check your choices before proceeding.</p>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,9 @@ export default class SetUpIndicesStep extends Component<SetUpIndicesStepProps> {
</EuiFlexItem>
<EuiFlexItem>
{Title()}
<ConfigureTransform isEdit={false} {...this.props} useUpdatedUX={this.props.useUpdatedUX} />
<ConfigureTransform isEdit={false} {...this.props} />
<EuiSpacer />
<TransformIndices key={this.props.dataSourceId} {...this.props} useUpdatedUX={this.props.useUpdatedUX} />
<TransformIndices key={this.props.dataSourceId} {...this.props} />
</EuiFlexItem>
</EuiFlexGroup>
<EuiSpacer />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,6 @@ export default class SpecifyScheduleStep extends Component<SpecifyScheduleStepPr
onChangeIntervalTime={onChangeIntervalTime}
onChangeIntervalTimeunit={onChangeIntervalTimeunit}
onChangePage={onChangePage}
useUpdatedUX={this.props.useUpdatedUX}
/>
</EuiFlexItem>
</EuiFlexGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ import {
EuiToolTip,
EuiFlexGroup,
EuiFlexItem,
EuiSmallButton,
} from "@elastic/eui";
import { ContentPanel, ContentPanelActions } from "../../../../components/ContentPanel";
import { DEFAULT_PAGE_SIZE_OPTIONS, DEFAULT_QUERY_PARAMS, HEALTH_TO_COLOR } from "../../utils/constants";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ import {
EuiFlexGroup,
EuiButtonIcon,
EuiCompressedFieldSearch,
EuiSmallButton,
} from "@elastic/eui";
import { BREADCRUMBS, PLUGIN_NAME, ROUTES, SNAPSHOT_MANAGEMENT_DOCUMENTATION_URL } from "../../../../utils/constants";
import { getMessagePrompt, getSMPoliciesQueryParamsFromURL, renderTimestampMillis } from "../../helpers";
Expand Down Expand Up @@ -453,15 +452,15 @@ export class SnapshotPolicies extends MDSEnabledComponent<SnapshotPoliciesProps,
</EuiContextMenuItem>,
];
const actionsButton = (
<EuiSmallButton
<EuiButton
iconType="arrowDown"
iconSide="right"
disabled={!selectedItems.length}
onClick={this.onActionButtonClick}
data-test-subj="actionButton"
>
Actions
</EuiSmallButton>
</EuiButton>
);
const actions = [
<EuiButton iconType="refresh" onClick={this.getPolicies} data-test-subj="refreshButton">
Expand Down
2 changes: 1 addition & 1 deletion public/pages/Transforms/components/Schedule/Schedule.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ interface ScheduleProps {
onCronTimeZoneChange: (e: ChangeEvent<HTMLSelectElement>) => void;
onIntervalChange: (e: ChangeEvent<HTMLInputElement>) => void;
onIntervalTimeUnitChange: (e: ChangeEvent<HTMLSelectElement>) => void;
size: "s" | "m" | undefined;
size: "s" | "m";
}

export default class Schedule extends Component<ScheduleProps> {
Expand Down
Loading

0 comments on commit d0d4f93

Please sign in to comment.