Skip to content

Commit

Permalink
Backport commits from main (#90)
Browse files Browse the repository at this point in the history
* Release 1.1.0.0 (#83)

* Release 1.1.0.0

Signed-off-by: bowenlan-amzn <[email protected]>

* Correct copyright notices

* UI fixes for new ISM UI (#84)

* Removes X icon from action/transition flyout footer next to cancel

Signed-off-by: Drew Baugher <[email protected]>

* Adds tooltips to edit/delete icon buttons on the draggable action/transition components

Signed-off-by: Drew Baugher <[email protected]>

* Removes overlay for flyout so clicking outside doesn't close flyout and removes X close button on top right

Signed-off-by: Drew Baugher <[email protected]>

* Adds edit/delete tooltips for state component and removes underline from hovering states

Signed-off-by: Drew Baugher <[email protected]>

* Changes state flyout from X Close to Cancel

Signed-off-by: Drew Baugher <[email protected]>

* Adds JSON editor for allocation action

Signed-off-by: Drew Baugher <[email protected]>

* Adds isValid to action interface and implements in actions

Signed-off-by: Drew Baugher <[email protected]>

* Correctly removes unused rollover keys from rollover object, handles uncontrolled inputs and NaN minDocs

Signed-off-by: Drew Baugher <[email protected]>

* Adds error for state name already existing in policy

Signed-off-by: Drew Baugher <[email protected]>

* Fixes duplicated actions when editing as previously we had a new ID and matching logic didn't find an action

Signed-off-by: Drew Baugher <[email protected]>

* Fixes other action inputs that can return NaN and creates a no conditions option that is the default

Signed-off-by: Drew Baugher <[email protected]>

* Updates snapshot

Signed-off-by: Drew Baugher <[email protected]>

* Correctly show danger toast on update/create failures

Signed-off-by: Drew Baugher <[email protected]>

* Fixes rollup action nesting multiple ism_template keys

Signed-off-by: Drew Baugher <[email protected]>

* Fixes timeout/retry settings turning into uncontrolled inputs and NaN value

Signed-off-by: Drew Baugher <[email protected]>

* Removes text transformation on inputs and updates isValid methods and passes to form labels

Signed-off-by: Drew Baugher <[email protected]>

* Fixes allocation and rollup adding UIAction properties to policy JSON on updates

Signed-off-by: Drew Baugher <[email protected]>

* Updates release notes w/ new PR changes

Signed-off-by: Drew Baugher <[email protected]>

* Wraps actions/transitions in states component and updates default rollup to include ism_rollup key

Signed-off-by: Drew Baugher <[email protected]>

* Fixes some small UI touchups/issues for new ISM UI (#85)

* Moves cancel secondary button next to primary on action/transition flyout

Signed-off-by: Drew Baugher <[email protected]>

* Removes default ISM template and increases width of empty prompt

Signed-off-by: Drew Baugher <[email protected]>

* Adds punctuation

Signed-off-by: Drew Baugher <[email protected]>

* Adds back X icon next to cancel for state flyout

Signed-off-by: Drew Baugher <[email protected]>

* Makes inputs in flyout full width, updates help text, and adds some spacing

Signed-off-by: Drew Baugher <[email protected]>

* Updates transition default to not include conditions empty object, and on change transition to delete conditions when selecting none

Signed-off-by: Drew Baugher <[email protected]>

* Moves edit button out of policy settings content panel and on to global page for view policy

Signed-off-by: Drew Baugher <[email protected]>

* Updates release note

Signed-off-by: Drew Baugher <[email protected]>

* Fixes broken link

Signed-off-by: Drew Baugher <[email protected]>

* Fixes small issues on new ISM UI (#88)

* Fixes small issues on new ISM UI

Signed-off-by: Drew Baugher <[email protected]>

* Updates snapshots

Signed-off-by: Drew Baugher <[email protected]>

* Updates release notes

Signed-off-by: Drew Baugher <[email protected]>

* Updates workflows to trigger on 1.* branches

Signed-off-by: Drew Baugher <[email protected]>

Co-authored-by: Bowen Lan <[email protected]>
  • Loading branch information
dbbaughe and bowenlan-amzn authored Sep 10, 2021
1 parent b8aa974 commit 7d50077
Show file tree
Hide file tree
Showing 70 changed files with 1,017 additions and 826 deletions.
9 changes: 1 addition & 8 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,11 @@
### Description

[Describe what this change achieves]

### Issues Resolved

[List any issues this PR will resolve]

### Check List

- [ ] New functionality includes testing.
- [ ] All tests pass
- [ ] New functionality has been documented.
- [ ] Commits are signed per the DCO using `--signoff`
- [ ] Commits are signed per the DCO using --signoff

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check [here](https://github.com/opensearch-project/OpenSearch/blob/main/CONTRIBUTING.md#developer-certificate-of-origin).

3 changes: 1 addition & 2 deletions .github/draft-release-notes-config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ replacers:
- search: '##'
replace: '###'

# Organizing the tagged PRs into unified ODFE categories
# Organizing the tagged PRs into unified OpenSearch categories
categories:
- title: 'Breaking changes'
labels:
Expand All @@ -41,7 +41,6 @@ categories:
- 'documentation'
- title: 'Maintenance'
labels:
- 'security'
- 'version support'
- 'backwards-compatibility'
- title: 'Refactoring'
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/cypress-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,11 @@ on:
pull_request:
branches:
- main
- 1.*
push:
branches:
- main
- development-*
- 1.*
env:
OPENSEARCH_DASHBOARDS_VERSION: '1.x'
OPENSEARCH_VERSION: '1.1.0-SNAPSHOT'
Expand Down
8 changes: 6 additions & 2 deletions .github/workflows/links.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
name: Link Checker
on:
push:
branches: [ main ]
branches:
- main
- 1.*
pull_request:
branches: [ main ]
branches:
- main
- 1.*

jobs:
linkchecker:
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/unit-tests-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,11 @@ on:
pull_request:
branches:
- main
- 1.*
push:
branches:
- main
- development-*
- 1.*

jobs:
tests:
Expand Down
4 changes: 2 additions & 2 deletions NOTICE
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
index-management-dashboards-plugin
Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
OpenSearch (https://opensearch.org/)
Copyright OpenSearch Contributors
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ If you discover a potential security issue in this project we ask that you notif

## License

This project is licensed under the [Apache v2.0 License](LICENSE.txt).
This project is licensed under the [Apache v2.0 License](LICENSE).

## Copyright

Copyright 2020-2021 Amazon.com, Inc. or its affiliates. All Rights Reserved.
Copyright OpenSearch Contributors. See [NOTICE](NOTICE) for details.
31 changes: 17 additions & 14 deletions models/interfaces.ts
Original file line number Diff line number Diff line change
Expand Up @@ -150,14 +150,15 @@ export interface UIAction<Data> {
id: string;
type: ActionType | string;
render: (uiAction: UIAction<Data>, onChangeAction: (uiAction: UIAction<Data>) => void) => JSX.Element | null;
isValid: () => boolean;
clone: (action: Data) => UIAction<Data>;
content: () => JSX.Element | string | null;
toAction: () => Action;
}

export interface ForceMergeAction extends Action {
force_merge: {
max_num_segments: number;
max_num_segments?: number;
};
}

Expand All @@ -171,7 +172,7 @@ export interface ReadWriteAction extends Action {

export interface ReplicaCountAction extends Action {
replica_count: {
number_of_replicas: number;
number_of_replicas?: number;
};
}

Expand Down Expand Up @@ -207,7 +208,7 @@ export interface Transition {

export interface Condition {
min_index_age?: string;
min_doc_count?: number;
min_doc_count?: number | undefined;
min_size?: string;
cron?: Cron;
}
Expand Down Expand Up @@ -238,22 +239,24 @@ export interface SnapshotAction extends Action {

export interface IndexPriorityAction extends Action {
index_priority: {
priority: number;
priority?: number;
};
}

export interface AllocationAction extends Action {
allocation: {
require: {
[key: string]: string;
};
include: {
[key: string]: string;
};
exclude: {
[key: string]: string;
};
wait_for: boolean;
// TODO: These require a complete UI and we are only supporting JSON editor for allocation for now
// require: {
// [key: string]: string;
// };
// include: {
// [key: string]: string;
// };
// exclude: {
// [key: string]: string;
// };
// wait_for: boolean;
jsonString: string;
};
}

Expand Down
2 changes: 1 addition & 1 deletion opensearch_dashboards.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"id": "indexManagementDashboards",
"version": "1.0.0.0",
"version": "1.1.0.0",
"opensearchDashboardsVersion": "1.1.0",
"configPath": ["opensearch_index_management"],
"requiredPlugins": ["navigation"],
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "opensearch_index_management_dashboards",
"version": "1.0.0.0",
"version": "1.1.0.0",
"description": "Opensearch Dashboards plugin for Index Management",
"main": "index.js",
"license": "Apache-2.0",
Expand Down
4 changes: 4 additions & 0 deletions public/app.scss
Original file line number Diff line number Diff line change
Expand Up @@ -50,3 +50,7 @@ $euiTextColor: $euiColorDarkestShade !default;
}
}
}

.state-accordion:hover {
text-decoration: none;
}
4 changes: 2 additions & 2 deletions public/components/JSONModal/JSONModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,13 @@ interface JSONModalProps {
const JSONModal: React.SFC<JSONModalProps> = ({ title, json, onClose }) => {
return (
<EuiOverlayMask>
<EuiModal onClose={onClose} style={{ padding: "5px 30px" }}>
<EuiModal onClose={onClose}>
<EuiModalHeader>
<EuiModalHeaderTitle>{title}</EuiModalHeaderTitle>
</EuiModalHeader>

<EuiModalBody>
<EuiCodeBlock language="json" fontSize="m" paddingSize="m" overflowHeight={600} inline={false} isCopyable>
<EuiCodeBlock language="json" fontSize="m" paddingSize="m" inline={false} isCopyable>
{JSON.stringify(json, null, 4)}
</EuiCodeBlock>
</EuiModalBody>
Expand Down
10 changes: 0 additions & 10 deletions public/components/JSONModal/__snapshots__/JSONModal.test.tsx.snap
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ exports[`<JSONModal /> spec renders the component 1`] = `
>
<div
class="euiModal euiModal--maxWidth-default"
style="padding: 5px 30px;"
tabindex="0"
>
<button
Expand Down Expand Up @@ -53,11 +52,9 @@ exports[`<JSONModal /> spec renders the component 1`] = `
>
<div
class="euiCodeBlock euiCodeBlock--fontMedium euiCodeBlock--paddingMedium euiCodeBlock--hasControls"
style="max-height: 600px;"
>
<pre
class="euiCodeBlock__pre euiCodeBlock__pre--whiteSpacePreWrap"
style="max-height: 600px;"
>
<code
class="euiCodeBlock__code json hljs"
Expand Down Expand Up @@ -119,13 +116,6 @@ exports[`<JSONModal /> spec renders the component 1`] = `
<div
class="euiCodeBlock__controls"
>
<button
aria-label="Expand"
class="euiButtonIcon euiButtonIcon--text euiCodeBlock__fullScreenButton"
type="button"
>
EuiIconMock
</button>
<div
class="euiCodeBlock__copyButton"
>
Expand Down
73 changes: 36 additions & 37 deletions public/pages/PolicyDetails/components/DeleteModal/DeleteModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,50 +13,49 @@ import React, { ChangeEvent, Component, Fragment } from "react";
import { EuiConfirmModal, EuiForm, EuiFormRow, EuiFieldText, EuiOverlayMask, EuiSpacer } from "@elastic/eui";

interface DeleteModalProps {
policyId: string;
closeDeleteModal: (event?: any) => void;
onClickDelete: (event?: any) => void;
policyId: string;
closeDeleteModal: (event?: any) => void;
onClickDelete: (event?: any) => void;
}

interface DeleteModalState {
confirmDeleteText: string;
confirmDeleteText: string;
}

export default class DeleteModal extends Component<DeleteModalProps, DeleteModalState> {
state = { confirmDeleteText: "" };
state = { confirmDeleteText: "" };

onChange = (e: ChangeEvent<HTMLInputElement>): void => {
this.setState({ confirmDeleteText: e.target.value });
};
onChange = (e: ChangeEvent<HTMLInputElement>): void => {
this.setState({ confirmDeleteText: e.target.value });
};

render() {
const { policyId, closeDeleteModal, onClickDelete } = this.props;
const { confirmDeleteText } = this.state;
render() {
const { policyId, closeDeleteModal, onClickDelete } = this.props;
const { confirmDeleteText } = this.state;

return (
<EuiOverlayMask>
<EuiConfirmModal
title="Delete policy"
onCancel={closeDeleteModal}
onConfirm={onClickDelete}
cancelButtonText="Cancel"
confirmButtonText="Delete policy"
buttonColor="danger"
defaultFocusedButton="confirm"
confirmButtonDisabled={confirmDeleteText != "delete"}
>
<EuiForm>
<Fragment>
Delete "<strong>{policyId}</strong>" permanently? Indices will no
longer be managed using this policy
</Fragment>
<EuiSpacer size="s" />
<EuiFormRow helpText="To confirm deletion, type delete">
<EuiFieldText value={confirmDeleteText} placeholder="delete" onChange={this.onChange} data-test-subj="deleteTextField" />
</EuiFormRow>
</EuiForm>
</EuiConfirmModal>
</EuiOverlayMask>
);
}
return (
<EuiOverlayMask>
<EuiConfirmModal
title="Delete policy"
onCancel={closeDeleteModal}
onConfirm={onClickDelete}
cancelButtonText="Cancel"
confirmButtonText="Delete policy"
buttonColor="danger"
defaultFocusedButton="confirm"
confirmButtonDisabled={confirmDeleteText != "delete"}
>
<EuiForm>
<Fragment>
Delete "<strong>{policyId}</strong>" permanently? Indices will no longer be managed using this policy.
</Fragment>
<EuiSpacer size="s" />
<EuiFormRow helpText={`To confirm deletion, type "delete".`}>
<EuiFieldText value={confirmDeleteText} placeholder="delete" onChange={this.onChange} data-test-subj="deleteTextField" />
</EuiFormRow>
</EuiForm>
</EuiConfirmModal>
</EuiOverlayMask>
);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ exports[`<DeleteModal /> spec renders the component 1`] = `
<strong>
some_id
</strong>
" permanently? Indices will no longer be managed using this policy
" permanently? Indices will no longer be managed using this policy.
<div
class="euiSpacer euiSpacer--s"
/>
Expand Down Expand Up @@ -101,7 +101,7 @@ exports[`<DeleteModal /> spec renders the component 1`] = `
class="euiFormHelpText euiFormRow__text"
id="some_html_id-help"
>
To confirm deletion, type delete
To confirm deletion, type "delete".
</div>
</div>
</div>
Expand Down
Loading

0 comments on commit 7d50077

Please sign in to comment.