-
Notifications
You must be signed in to change notification settings - Fork 3.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(notifications/teams): add UI to manage teams endpoints and rules
- Loading branch information
Showing
11 changed files
with
148 additions
and
3 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
57 changes: 57 additions & 0 deletions
57
ui/src/notifications/endpoints/components/EndpointOptionsTeams.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,57 @@ | ||
// Libraries | ||
import React, {FC, ChangeEvent} from 'react' | ||
|
||
// Components | ||
import { | ||
Input, | ||
FormElement, | ||
Panel, | ||
Grid, | ||
Columns, | ||
InputType, | ||
} from '@influxdata/clockface' | ||
|
||
interface Props { | ||
url: string | ||
secretURLSuffix: string | ||
onChange: (e: ChangeEvent<HTMLInputElement>) => void | ||
} | ||
|
||
const EndpointOptionsTeams: FC<Props> = ({url, secretURLSuffix, onChange}) => { | ||
return ( | ||
<Panel> | ||
<Panel.Header> | ||
<h4>Teams Options</h4> | ||
</Panel.Header> | ||
<Panel.Body> | ||
<Grid> | ||
<Grid.Row> | ||
<Grid.Column widthXS={Columns.Twelve}> | ||
<FormElement label="Incoming Webhook URL"> | ||
<Input | ||
name="url" | ||
value={url} | ||
testID="teams-url" | ||
onChange={onChange} | ||
/> | ||
</FormElement> | ||
</Grid.Column> | ||
<Grid.Column widthXS={Columns.Twelve}> | ||
<FormElement label="Webhook URL Secret Suffix"> | ||
<Input | ||
name="secretURLSuffix" | ||
value={secretURLSuffix} | ||
testID="teams-secretURLSuffix" | ||
onChange={onChange} | ||
type={InputType.Password} | ||
/> | ||
</FormElement> | ||
</Grid.Column> | ||
</Grid.Row> | ||
</Grid> | ||
</Panel.Body> | ||
</Panel> | ||
) | ||
} | ||
|
||
export default EndpointOptionsTeams |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
// Libraries | ||
import React, {FC, ChangeEvent} from 'react' | ||
|
||
// Components | ||
import {Form, Input, TextArea} from '@influxdata/clockface' | ||
|
||
interface Props { | ||
title: string | ||
messageTemplate: string | ||
onChange: (e: ChangeEvent) => void | ||
} | ||
|
||
const TeamsMessage: FC<Props> = ({title, messageTemplate, onChange}) => { | ||
return ( | ||
<> | ||
<Form.Element label="Title"> | ||
<Input value={title} name="title" onChange={onChange} /> | ||
</Form.Element> | ||
<Form.Element label="Message Template"> | ||
<TextArea | ||
name="messageTemplate" | ||
testID="teams-message-template--textarea" | ||
value={messageTemplate} | ||
onChange={onChange} | ||
rows={3} | ||
/> | ||
</Form.Element> | ||
</> | ||
) | ||
} | ||
|
||
export default TeamsMessage |
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