Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fit and Finish changes for Indexes and Transform pages #1154

Merged
merged 6 commits into from
Sep 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ exports[`<IndexDetail /> spec render the component 1`] = `
class="euiHorizontalRule euiHorizontalRule--full euiHorizontalRule--marginXSmall"
/>
<div
class="euiSpacer euiSpacer--l"
class="euiSpacer euiSpacer--s"
/>
<div
class="euiSpacer euiSpacer--l"
Expand Down
26 changes: 21 additions & 5 deletions public/containers/IndexDetail/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -47,25 +47,41 @@ export default function IndexDetail(props: IIndexDetailProps) {
<h2>Source index details</h2>
</EuiText>
<EuiHorizontalRule margin="xs" />
<EuiSpacer />
<EuiSpacer size="s" />
{items && items.length ? (
<DescriptionListHoz
compressed
listItems={[
{
title: "Index name",
title: (
<EuiText size="s">
<h4>Index name</h4>
</EuiText>
),
description: items[0].index,
},
{
title: "Primary shards",
title: (
<EuiText size="s">
<h4>Primary shards</h4>
</EuiText>
),
description: items[0].pri,
},
{
title: "Replica shards",
title: (
<EuiText size="s">
<h4>Replica shards</h4>
</EuiText>
),
description: items[0].rep,
},
{
title: "Total index size",
title: (
<EuiText size="s">
<h4>Total index size</h4>
</EuiText>
),
description: items[0]["store.size"],
},
]}
Expand Down
8 changes: 7 additions & 1 deletion public/pages/CreateIndex/containers/IndexForm/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -472,7 +472,13 @@ export class IndexForm extends Component<IndexFormProps & { services: BrowserSer
</EuiSmallButtonEmpty>
</EuiFlexItem>
<EuiFlexItem grow={false}>
<EuiSmallButton fill onClick={this.onSubmit} isLoading={isSubmitting} data-test-subj="createIndexCreateButton">
<EuiSmallButton
fill
onClick={this.onSubmit}
isLoading={isSubmitting}
data-test-subj="createIndexCreateButton"
iconType={isEdit ? undefined : "plus"}
>
{isEdit ? "Update" : "Create"}
</EuiSmallButton>
</EuiFlexItem>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,17 @@
*/

import React, { ChangeEvent } from "react";
import { EuiSpacer, EuiCompressedFormRow, EuiCompressedFieldText, EuiTextArea, EuiText, EuiFlexGroup, EuiFlexItem } from "@elastic/eui";
import { ContentPanel } from "../../../../components/ContentPanel";
import {
EuiSpacer,
EuiCompressedFormRow,
EuiCompressedFieldText,
EuiTextArea,
EuiText,
EuiFlexGroup,
EuiFlexItem,
EuiPanel,
EuiHorizontalRule,
} from "@elastic/eui";

interface ConfigureTransformProps {
isEdit: boolean;
Expand All @@ -24,10 +33,18 @@ const ConfigureTransform = ({
onChangeDescription,
description,
}: ConfigureTransformProps) => (
<ContentPanel panelStyles={{ padding: "20px 20px" }} bodyStyles={{ padding: "10px" }} title="Job name and description" titleSize="m">
<EuiPanel>
<EuiText size="s">
<h2>Job name and description</h2>
</EuiText>
<EuiHorizontalRule margin="xs" />
<div>
<EuiCompressedFormRow
label="Name"
label={
<EuiText size="s">
<h3>Name</h3>
</EuiText>
}
helpText="Specify a unique, descriptive name."
isInvalid={!!transformIdError}
error={transformIdError}
Expand All @@ -43,13 +60,15 @@ const ConfigureTransform = ({
<EuiSpacer />
<EuiFlexGroup gutterSize="xs">
<EuiFlexItem grow={false}>
<EuiText size="xs">
<h4>Description</h4>
<EuiText size="s">
<h3>Description</h3>
</EuiText>
</EuiFlexItem>
<EuiFlexItem>
<EuiText size="xs" color="subdued">
<i> – optional</i>
<EuiText size="s" color="subdued">
<h3>
<i> – optional</i>
</h3>
</EuiText>
</EuiFlexItem>
</EuiFlexGroup>
Expand All @@ -58,6 +77,6 @@ const ConfigureTransform = ({
<EuiTextArea compressed={true} value={description} onChange={onChangeDescription} data-test-subj="description" />
</EuiCompressedFormRow>
</div>
</ContentPanel>
</EuiPanel>
);
export default ConfigureTransform;
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ const setOfSteps = (step: number) => {

const CreateTransformSteps = ({ step }: CreateTransformStepsProps) => (
<div style={{ paddingLeft: "10px" }}>
<EuiSteps steps={setOfSteps(step)} headingElement="h6" />
<EuiSteps steps={setOfSteps(step)} headingElement="h6" titleSize="xs" />
</div>
);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -168,8 +168,8 @@ export default function DefineTransforms({
if (isReadOnly)
return (
<div>
<EuiText>
<h5>Original fields with sample data</h5>
<EuiText size="s">
<h3>Original fields with sample data</h3>
</EuiText>
<EuiSpacer size="s" />
<EuiDataGrid
Expand All @@ -195,8 +195,8 @@ export default function DefineTransforms({
gridStyle={{ rowHover: "none" }}
/>
<EuiSpacer size="l" />
<EuiText>
<h5>Transformed fields preview based on sample data</h5>
<EuiText size="s">
<h3>Transformed fields preview based on sample data</h3>
</EuiText>
<EuiSpacer size="s" />
<PreviewTransform
Expand All @@ -210,9 +210,18 @@ export default function DefineTransforms({
);

return (
<ContentPanel panelStyles={{ padding: "20px 20px" }} bodyStyles={{ padding: "10px" }} title="Select fields to transform" titleSize="m">
<EuiText>
<h5>Original fields with sample data</h5>
<ContentPanel
panelStyles={{ padding: "16px 16px" }}
bodyStyles={{ padding: "10px" }}
title={
<EuiText size="s">
<h2>Select fields to transform</h2>
</EuiText>
}
titleSize="m"
>
<EuiText size="s">
<h3>Original fields with sample data</h3>
</EuiText>
<EuiSpacer size="s" />
{/*TODO: Substitute "source index", and "filtered by" fields with actual values*/}
Expand Down Expand Up @@ -242,8 +251,8 @@ export default function DefineTransforms({
}}
/>
<EuiSpacer size="l" />
<EuiText>
<h5>Transformed fields preview based on sample data</h5>
<EuiText size="s">
<h3>Transformed fields preview based on sample data</h3>
</EuiText>
<EuiSpacer size="s" />
<EuiText color="subdued" size="xs">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
*/

import React, { Component } from "react";
import { EuiFlexGrid, EuiSpacer, EuiFlexItem, EuiText } from "@elastic/eui";
import { ContentPanel, ContentPanelActions } from "../../../../components/ContentPanel";
import { EuiFlexGrid, EuiSpacer, EuiFlexItem, EuiText, EuiPanel, EuiFlexGroup, EuiHorizontalRule } from "@elastic/eui";
import { ContentPanelActions } from "../../../../components/ContentPanel";
import { ModalConsumer } from "../../../../components/Modal";
import { IndexItem } from "../../../../../models/interfaces";

Expand All @@ -27,28 +27,31 @@ export default class JobNameAndIndices extends Component<JobNameAndIndicesProps>
const { transformId, description, onChangeStep, sourceIndex, targetIndex, sourceIndexFilter } = this.props;

return (
<ContentPanel
actions={
<ModalConsumer>
{() => (
<ContentPanelActions
actions={[
{
text: "Edit",
buttonProps: {
onClick: () => onChangeStep(1),
<EuiPanel>
<EuiFlexGroup>
<EuiFlexItem>
<EuiText size="s">
<h2>Set up indices</h2>
</EuiText>
</EuiFlexItem>
<EuiFlexItem grow={false}>
<ModalConsumer>
{() => (
<ContentPanelActions
actions={[
{
text: "Edit",
buttonProps: {
onClick: () => onChangeStep(1),
},
},
},
]}
/>
)}
</ModalConsumer>
}
panelStyles={{ padding: "20px 20px" }}
bodyStyles={{ padding: "10px" }}
title="Set up indices"
titleSize="m"
>
]}
/>
)}
</ModalConsumer>
</EuiFlexItem>
</EuiFlexGroup>
<EuiHorizontalRule margin="xs" />
<div>
<EuiFlexGrid columns={3}>
<EuiFlexItem>
Expand Down Expand Up @@ -84,7 +87,7 @@ export default class JobNameAndIndices extends Component<JobNameAndIndicesProps>
</EuiFlexGrid>
<EuiSpacer size="s" />
</div>
</ContentPanel>
</EuiPanel>
);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -24,16 +24,18 @@ export default function PreviewEmptyPrompt({ isReadOnly }: PreviewEmptyPromptPro
) : (
<EuiEmptyPrompt
title={
<EuiText size="m">
<EuiText size="s">
<h4> No fields selected </h4>
</EuiText>
}
body={
<p>
{" "}
From the table above, select a field you want to transform by clicking <EuiIcon type="plusInCircleFilled" /> next to the field
name.
</p>
<EuiText size="s">
<p>
{" "}
From the table above, select a field you want to transform by clicking <EuiIcon type="plusInCircleFilled" /> next to the
field name.
</p>
</EuiText>
}
/>
)}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
*/

import React, { Component } from "react";
import { EuiFlexGrid, EuiSpacer, EuiFlexItem, EuiText, EuiAccordion } from "@elastic/eui";
import { ContentPanel, ContentPanelActions } from "../../../../components/ContentPanel";
import { EuiFlexGrid, EuiSpacer, EuiFlexItem, EuiText, EuiAccordion, EuiFlexGroup, EuiPanel, EuiHorizontalRule } from "@elastic/eui";
import { ContentPanelActions } from "../../../../components/ContentPanel";
import { ModalConsumer } from "../../../../components/Modal";
import { TransformGroupItem, FieldItem, TransformAggItem, TRANSFORM_AGG_TYPE } from "../../../../../models/interfaces";
import DefineTransforms from "../DefineTransforms";
Expand Down Expand Up @@ -82,32 +82,42 @@ export default class ReviewDefinition extends Component<ReviewDefinitionProps> {
};

return (
<ContentPanel
actions={
<ModalConsumer>
{() => (
<ContentPanelActions
actions={[
{
text: "Edit",
buttonProps: {
onClick: () => onChangeStep(2),
<EuiPanel>
<EuiFlexGroup>
<EuiFlexItem>
<EuiText size="s">
<h2>Define transforms</h2>
</EuiText>
</EuiFlexItem>
<EuiFlexItem grow={false}>
<ModalConsumer>
{() => (
<ContentPanelActions
actions={[
{
text: "Edit",
buttonProps: {
onClick: () => onChangeStep(2),
},
},
},
]}
/>
)}
</ModalConsumer>
}
panelStyles={{ padding: "20px 20px" }}
bodyStyles={{ padding: "10px" }}
title="Define transforms"
titleSize="m"
>
]}
/>
)}
</ModalConsumer>
</EuiFlexItem>
</EuiFlexGroup>
<EuiHorizontalRule margin="xs" />
<div>
<EuiFlexGrid columns={4}>{aggListItems()}</EuiFlexGrid>
<EuiSpacer />
<EuiAccordion id="" buttonContent="Sample source index and transform result">
<EuiAccordion
id=""
buttonContent={
<EuiText size="s">
<h3>Sample source index and transform result</h3>
</EuiText>
}
>
<div style={{ padding: "10px" }}>
<EuiSpacer size="m" />
<DefineTransforms
Expand All @@ -125,7 +135,7 @@ export default class ReviewDefinition extends Component<ReviewDefinitionProps> {
</div>
</EuiAccordion>
</div>
</ContentPanel>
</EuiPanel>
);
}
}
Loading
Loading