Support multiline text in plugin configuration secret field
This commit is contained in:
parent
054c067653
commit
b7294e9cbc
5 changed files with 10 additions and 3 deletions
|
@ -1147,6 +1147,7 @@ enum ConfigurationTypeFieldEnum {
|
||||||
STRING
|
STRING
|
||||||
BOOLEAN
|
BOOLEAN
|
||||||
SECRET
|
SECRET
|
||||||
|
SECRETMULTILINE
|
||||||
PASSWORD
|
PASSWORD
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -5241,4 +5242,4 @@ union _Entity = Address | User | Group | App | ProductVariant | Product | Produc
|
||||||
|
|
||||||
type _Service {
|
type _Service {
|
||||||
sdl: String
|
sdl: String
|
||||||
}
|
}
|
|
@ -59,7 +59,8 @@ const PluginAuthorization: React.FC<PluginAuthorizationProps> = props => {
|
||||||
{secretFields.map((field, fieldIndex) => (
|
{secretFields.map((field, fieldIndex) => (
|
||||||
<React.Fragment key={field.name}>
|
<React.Fragment key={field.name}>
|
||||||
<div className={classes.item} key={field.name}>
|
<div className={classes.item} key={field.name}>
|
||||||
{field.type === ConfigurationTypeFieldEnum.SECRET ? (
|
{field.type === ConfigurationTypeFieldEnum.SECRET ||
|
||||||
|
field.type === ConfigurationTypeFieldEnum.SECRETMULTILINE ? (
|
||||||
<div>
|
<div>
|
||||||
<Typography variant="body1">{field.label}</Typography>
|
<Typography variant="body1">{field.label}</Typography>
|
||||||
{field.value !== null && (
|
{field.value !== null && (
|
||||||
|
|
|
@ -63,6 +63,9 @@ const PluginSecretFieldDialog: React.FC<PluginSecretFieldDialogProps> = ({
|
||||||
<>
|
<>
|
||||||
<DialogContent>
|
<DialogContent>
|
||||||
<TextField
|
<TextField
|
||||||
|
multiline={
|
||||||
|
field?.type === ConfigurationTypeFieldEnum.SECRETMULTILINE
|
||||||
|
}
|
||||||
autoComplete="off"
|
autoComplete="off"
|
||||||
fullWidth
|
fullWidth
|
||||||
label={field && field.label}
|
label={field && field.label}
|
||||||
|
|
|
@ -8,6 +8,7 @@ export function isSecretField(
|
||||||
) {
|
) {
|
||||||
return [
|
return [
|
||||||
ConfigurationTypeFieldEnum.PASSWORD,
|
ConfigurationTypeFieldEnum.PASSWORD,
|
||||||
ConfigurationTypeFieldEnum.SECRET
|
ConfigurationTypeFieldEnum.SECRET,
|
||||||
|
ConfigurationTypeFieldEnum.SECRETMULTILINE
|
||||||
].includes(config.find(configField => configField.name === field).type);
|
].includes(config.find(configField => configField.name === field).type);
|
||||||
}
|
}
|
||||||
|
|
|
@ -125,6 +125,7 @@ export enum ConfigurationTypeFieldEnum {
|
||||||
BOOLEAN = "BOOLEAN",
|
BOOLEAN = "BOOLEAN",
|
||||||
PASSWORD = "PASSWORD",
|
PASSWORD = "PASSWORD",
|
||||||
SECRET = "SECRET",
|
SECRET = "SECRET",
|
||||||
|
SECRETMULTILINE = "SECRETMULTILINE",
|
||||||
STRING = "STRING",
|
STRING = "STRING",
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue