-
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.
Signed-off-by: bowenlan-amzn <[email protected]>
- Loading branch information
1 parent
f08cbe2
commit de433d2
Showing
10 changed files
with
123 additions
and
51 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
59 changes: 59 additions & 0 deletions
59
public/pages/CreateSnapshotPolicy/components/Notification/Notification.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,59 @@ | ||
/* | ||
* Copyright OpenSearch Contributors | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
import React, { ChangeEvent } from "react"; | ||
import { EuiFormRow, EuiSelect, EuiButton, EuiFlexGroup, EuiFlexItem } from "@elastic/eui"; | ||
import "brace/theme/github"; | ||
import "brace/mode/json"; | ||
import { FeatureChannelList } from "../../../../../server/models/interfaces"; | ||
import CustomLabel from "../../../../components/CustomLabel"; | ||
|
||
interface NotificationProps { | ||
channelId: string; | ||
channels: FeatureChannelList[]; | ||
loadingChannels: boolean; | ||
onChangeChannelId: (value: ChangeEvent<HTMLSelectElement>) => void; | ||
getChannels: () => void; | ||
} | ||
|
||
const Notification = ({ channelId, channels, loadingChannels, onChangeChannelId, getChannels }: NotificationProps) => { | ||
return ( | ||
<> | ||
<CustomLabel title="Select notification channels" /> | ||
<EuiFlexGroup gutterSize="s" style={{ maxWidth: 600 }}> | ||
<EuiFlexItem> | ||
<EuiFormRow> | ||
<EuiSelect | ||
id="channel-id" | ||
placeholder="Select channel ID" | ||
hasNoInitialSelection | ||
isLoading={loadingChannels} | ||
options={channels.map((channel) => ({ value: channel.config_id, text: channel.name }))} | ||
value={channelId} | ||
onChange={onChangeChannelId} | ||
data-test-subj="create-policy-notification-channel-id" | ||
/> | ||
</EuiFormRow> | ||
</EuiFlexItem> | ||
<EuiFlexItem grow={false}> | ||
<EuiButton | ||
iconType="refresh" | ||
onClick={getChannels} | ||
disabled={loadingChannels} | ||
className="refresh-button" | ||
data-test-subj="channel-notification-refresh" | ||
/> | ||
</EuiFlexItem> | ||
<EuiFlexItem grow={false}> | ||
<EuiButton iconType="popout" href="notifications-dashboards#/channels" target="_blank"> | ||
Manage channels | ||
</EuiButton> | ||
</EuiFlexItem> | ||
</EuiFlexGroup> | ||
</> | ||
); | ||
}; | ||
|
||
export default Notification; |
8 changes: 8 additions & 0 deletions
8
public/pages/CreateSnapshotPolicy/components/Notification/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,8 @@ | ||
/* | ||
* Copyright OpenSearch Contributors | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
import Notification from "./Notification"; | ||
|
||
export default Notification; |
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
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