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