-
Notifications
You must be signed in to change notification settings - Fork 89
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into ismtemplate
- Loading branch information
Showing
27 changed files
with
1,390 additions
and
81 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 22 additions & 0 deletions
22
public/pages/VisualCreatePolicy/components/Transition/TransitionContent.test.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
/* | ||
* SPDX-License-Identifier: Apache-2.0 | ||
* | ||
* The OpenSearch Contributors require contributions made to | ||
* this file be licensed under the Apache-2.0 license or a | ||
* compatible open source license. | ||
* | ||
* Modifications Copyright OpenSearch Contributors. See | ||
* GitHub history for details. | ||
*/ | ||
|
||
import React from "react"; | ||
import "@testing-library/jest-dom/extend-expect"; | ||
import { render } from "@testing-library/react"; | ||
import TransitionContent from "./TransitionContent"; | ||
|
||
describe("<TransitionContent /> spec", () => { | ||
it("renders the component", () => { | ||
const { container } = render(<TransitionContent transition={{ state_name: "some_state", conditions: { min_index_age: "30d" } }} />); | ||
expect(container.firstChild).toMatchSnapshot(); | ||
}); | ||
}); |
32 changes: 32 additions & 0 deletions
32
public/pages/VisualCreatePolicy/components/Transition/TransitionContent.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
/* | ||
* SPDX-License-Identifier: Apache-2.0 | ||
* | ||
* The OpenSearch Contributors require contributions made to | ||
* this file be licensed under the Apache-2.0 license or a | ||
* compatible open source license. | ||
* | ||
* Modifications Copyright OpenSearch Contributors. See | ||
* GitHub history for details. | ||
*/ | ||
|
||
import React from "react"; | ||
import { EuiText } from "@elastic/eui"; | ||
import { Transition } from "../../../../../models/interfaces"; | ||
import { getConditionContent } from "../../utils/helpers"; | ||
|
||
interface TransitionContentProps { | ||
transition: Transition; | ||
} | ||
|
||
const TransitionContent = ({ transition }: TransitionContentProps) => ( | ||
<EuiText> | ||
<dl> | ||
<dt>Destination state</dt> | ||
<dd>{transition.state_name}</dd> | ||
<dt>Transition trigger logic</dt> | ||
<dd>{getConditionContent(transition)}</dd> | ||
</dl> | ||
</EuiText> | ||
); | ||
|
||
export default TransitionContent; |
22 changes: 22 additions & 0 deletions
22
...es/VisualCreatePolicy/components/Transition/__snapshots__/TransitionContent.test.tsx.snap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`<TransitionContent /> spec renders the component 1`] = ` | ||
<div | ||
class="euiText euiText--medium" | ||
> | ||
<dl> | ||
<dt> | ||
Destination state | ||
</dt> | ||
<dd> | ||
some_state | ||
</dd> | ||
<dt> | ||
Transition trigger logic | ||
</dt> | ||
<dd> | ||
Minimum index age is 30d | ||
</dd> | ||
</dl> | ||
</div> | ||
`; |
16 changes: 16 additions & 0 deletions
16
public/pages/VisualCreatePolicy/components/Transition/index.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
/* | ||
* SPDX-License-Identifier: Apache-2.0 | ||
* | ||
* The OpenSearch Contributors require contributions made to | ||
* this file be licensed under the Apache-2.0 license or a | ||
* compatible open source license. | ||
* | ||
* Modifications Copyright OpenSearch Contributors. See | ||
* GitHub history for details. | ||
*/ | ||
|
||
import TransitionContent from "./TransitionContent"; | ||
|
||
export { TransitionContent }; | ||
|
||
export default Transition; |
Oops, something went wrong.