Skip to content

Commit

Permalink
[Look & Feel] Consistency and Density Changes for Snapshot Management (
Browse files Browse the repository at this point in the history
…#1148) (#1159)

* initial changes



* fixed unit tests



---------




(cherry picked from commit a7d317a)

Signed-off-by: Shey Gao <sheygao@amazon.com>
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: Shey Gao <sheygao@amazon.com>
Co-authored-by: Hailong Cui <ihailong@amazon.com>
  • Loading branch information
4 people committed Sep 2, 2024
1 parent 706acd0 commit daed7ef
Show file tree
Hide file tree
Showing 9 changed files with 42 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ const SnapshotIndicesRepoInput = ({

{showFlyout != null && (
<EuiFlexItem grow={false}>
<EuiSmallButton onClick={openFlyout}>Create repository</EuiSmallButton>
<EuiSmallButton onClick={openFlyout} iconType="plus">Create repository</EuiSmallButton>
</EuiFlexItem>
)}
</EuiFlexGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -698,7 +698,7 @@ export class CreateSnapshotPolicy extends MDSEnabledComponent<CreateSMPolicyProp
<EuiAccordion id="additional_delete_conditions" buttonContent="Additional settings">
<EuiSpacer size="m" />

<EuiText>Number of snapshots retained</EuiText>
<EuiText size="s">Number of snapshots retained</EuiText>
<EuiSpacer size="s" />

<EuiFlexGroup alignItems="flexStart">
Expand Down Expand Up @@ -726,7 +726,7 @@ export class CreateSnapshotPolicy extends MDSEnabledComponent<CreateSMPolicyProp

<EuiSpacer size="m" />

<EuiText>Deletion frequency</EuiText>
<EuiText size="s">Deletion frequency</EuiText>
<span style={{ color: "grey", fontWeight: 200, fontSize: "12px" }}>
Configure when to check retention conditions and delete snapshots.
</span>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -860,6 +860,7 @@ Object {
<span
class="euiButtonContent euiButton__content"
>
EuiIconMock
<span
class="euiButton__text"
>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -231,13 +231,15 @@ export class CreateRepositoryFlyout extends MDSEnabledComponent<CreateRepository
configuration = (
<>
<EuiCallOut title="Install and configure custom repository types">
<p>
To use a custom repository, such as Amazon S3, Azure Blob Storage or similar, install and configure the respective repository
plugin on OpenSearch and then define the repository configuration below.{" "}
<EuiLink href={REPOSITORY_DOCUMENTATION_URL} target="_blank" rel="noopener noreferrer">
Learn more
</EuiLink>
</p>
<EuiText size="s">
<p>
To use a custom repository, such as Amazon S3, Azure Blob Storage or similar, install and configure the respective repository
plugin on OpenSearch and then define the repository configuration below.{" "}
<EuiLink href={REPOSITORY_DOCUMENTATION_URL} target="_blank" rel="noopener noreferrer">
Learn more
</EuiLink>
</p>
</EuiText>
</EuiCallOut>

<EuiSpacer size="s" />
Expand Down Expand Up @@ -272,7 +274,7 @@ export class CreateRepositoryFlyout extends MDSEnabledComponent<CreateRepository
return (
<EuiFlyout ownFocus={false} onClose={onCloseFlyout} maxWidth={600} size="m" hideCloseButton>
<EuiFlyoutHeader hasBorder>
<EuiTitle size="m">
<EuiTitle size="s">
<h2 id="flyoutTitle">{!!editRepo ? "Edit" : "Create"} repository</h2>
</EuiTitle>
</EuiFlyoutHeader>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@ export class Repositories extends MDSEnabledComponent<RepositoriesProps, Reposit
<EuiSmallButton disabled={!selectedItems.length} onClick={this.showDeleteModal} data-test-subj="deleteButton" color="danger">
Delete
</EuiSmallButton>,
<EuiSmallButton onClick={this.onClickCreate} fill={true}>
<EuiSmallButton onClick={this.onClickCreate} fill={true} iconType="plus">
Create repository
</EuiSmallButton>,
];
Expand Down Expand Up @@ -341,7 +341,13 @@ export class Repositories extends MDSEnabledComponent<RepositoriesProps, Reposit

const { HeaderControl } = getNavigationUI();
const { setAppRightControls, setAppDescriptionControls } = getApplication();
const useTitle = useNewUX ? undefined : "Repositories";
const useTitle = useNewUX
? undefined
: (
<EuiText size="s">
<h1>Repositories</h1>
</EuiText>
);
const useActions = useNewUX ? undefined : actions;
const useSubTitleText = useNewUX ? undefined : subTitleText;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -483,7 +483,7 @@ export class SnapshotPolicies extends MDSEnabledComponent<SnapshotPoliciesProps,
>
<EuiContextMenuPanel items={popoverActionItems} size="s" />
</EuiPopover>,
<EuiSmallButton onClick={this.onClickCreate} fill={true}>
<EuiSmallButton onClick={this.onClickCreate} fill={true} iconType="plus">
Create policy
</EuiSmallButton>,
];
Expand All @@ -508,7 +508,7 @@ export class SnapshotPolicies extends MDSEnabledComponent<SnapshotPoliciesProps,
</EuiText>
}
actions={
<EuiSmallButton onClick={this.onClickCreate} fill={true}>
<EuiSmallButton onClick={this.onClickCreate} fill={true} iconType="plus">
Create policy
</EuiSmallButton>
}
Expand Down Expand Up @@ -569,7 +569,15 @@ export class SnapshotPolicies extends MDSEnabledComponent<SnapshotPoliciesProps,

return !this.state.useNewUx ? (
<>
<ContentPanel title="Snapshot policies" actions={actions} subTitleText={subTitleText}>
<ContentPanel
title={
<EuiText size="s">
<h1>Snapshot policies</h1>
</EuiText>
}
actions={actions}
subTitleText={subTitleText}
>
<EuiSearchBar
box={{
placeholder: "Search snapshot policies",
Expand Down
8 changes: 7 additions & 1 deletion public/pages/Snapshots/containers/Snapshots/Snapshots.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -574,7 +574,13 @@ export class Snapshots extends MDSEnabledComponent<SnapshotsProps, SnapshotsStat

const { HeaderControl } = getNavigationUI();
const { setAppRightControls, setAppDescriptionControls } = getApplication();
const showTitle = useNewUX ? undefined : "Snapshots";
const showTitle = useNewUX
? undefined
: (
<EuiText size="s">
<h1>Snapshots</h1>
</EuiText>
);
const SnapshotTabName = useNewUX ? "Index snapshots" : "Snapshots";
const useActions = useNewUX ? undefined : actions;
const useSubTitle = useNewUX ? undefined : subTitleText;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ const FlyoutFooter = ({
</EuiSmallButtonEmpty>
</EuiFlexItem>
<EuiFlexItem grow={false}>
<EuiSmallButton disabled={disabledAction} onClick={onClickAction} fill data-test-subj="flyout-footer-action-button">
<EuiSmallButton disabled={disabledAction} onClick={onClickAction} fill data-test-subj="flyout-footer-action-button" iconType={"Add" ? "plusInCircle" : "plus"}>
{text ? text : restore ? "Restore snapshot" : !save ? `${edit ? "Edit" : "Add"} ${action}` : save ? "Save" : "Create"}
</EuiSmallButton>
</EuiFlexItem>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ exports[`<FlyoutFooter /> spec renders the component 1`] = `
<span
class="euiButtonContent euiButton__content"
>
EuiIconMock
<span
class="euiButton__text"
>
Expand Down

0 comments on commit daed7ef

Please sign in to comment.