-
Notifications
You must be signed in to change notification settings - Fork 560
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add TextBox to Event Builder (#1657)
* Add payload textbox to Event Builder * Create payload textbox, begin payload formatting logic * Added format Payload button; able to format payload * Add format Payload ability before validate event * Payload is now being validated, bug still bugs * Able to validate payload from textbox on first entry * Add payload formatting errors * Fix formatting issues * Remove console logs * Cleanup * Fix typescript errors * Improve design, fix linter errors * Only validate payload for textbox entries * Validate api_secret exists * Fix linter errors * Update naming * Change payload URL * Update styling
- Loading branch information
1 parent
77e25a9
commit c8da06f
Showing
13 changed files
with
746 additions
and
337 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
import React from "react" | ||
import { TextField } from "@material-ui/core" | ||
import ExternalLink from "./ExternalLink" | ||
|
||
export interface TextBoxProps { | ||
href: string | ||
linkTitle: string | ||
value: string | undefined | object | ||
label: string | ||
onChange: (e: string) => void | ||
helperText?: string | JSX.Element | ||
extraAction?: JSX.Element | ||
required?: true | ||
disabled?: boolean | ||
id?: string | ||
} | ||
|
||
const TextBox: React.FC<TextBoxProps> = ({ | ||
href, | ||
linkTitle, | ||
label, | ||
value, | ||
onChange, | ||
required, | ||
helperText, | ||
disabled, | ||
extraAction, | ||
id, | ||
}) => { | ||
return ( | ||
<TextField | ||
InputProps={{ | ||
endAdornment: ( | ||
<span | ||
style={{ | ||
display: "inline-flex", | ||
}} | ||
> | ||
{extraAction} | ||
<ExternalLink href={href} title={linkTitle} hover /> | ||
</span> | ||
), | ||
}} | ||
id={id} | ||
size="medium" | ||
variant="outlined" | ||
fullWidth | ||
label={label} | ||
value={value === undefined ? "" : value} | ||
onChange={e => onChange(e.target.value)} | ||
required={required} | ||
helperText={helperText} | ||
disabled={disabled} | ||
multiline={true} | ||
maxRows={15} | ||
minRows={15} | ||
/> | ||
) | ||
} | ||
|
||
export default TextBox |
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
Oops, something went wrong.