feat: disallow env vars for extensions with spaces in the name (#2066)
This commit is contained in:
@@ -30,6 +30,7 @@ export default function EnvVarsSection({
|
|||||||
const handleAdd = () => {
|
const handleAdd = () => {
|
||||||
const keyEmpty = !newKey.trim();
|
const keyEmpty = !newKey.trim();
|
||||||
const valueEmpty = !newValue.trim();
|
const valueEmpty = !newValue.trim();
|
||||||
|
const keyHasSpaces = newKey.includes(' ');
|
||||||
|
|
||||||
if (keyEmpty || valueEmpty) {
|
if (keyEmpty || valueEmpty) {
|
||||||
setInvalidFields({
|
setInvalidFields({
|
||||||
@@ -40,6 +41,15 @@ export default function EnvVarsSection({
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (keyHasSpaces) {
|
||||||
|
setInvalidFields({
|
||||||
|
key: true,
|
||||||
|
value: false,
|
||||||
|
});
|
||||||
|
setValidationError('Variable name cannot contain spaces');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
setValidationError(null);
|
setValidationError(null);
|
||||||
setInvalidFields({ key: false, value: false });
|
setInvalidFields({ key: false, value: false });
|
||||||
onAdd(newKey, newValue);
|
onAdd(newKey, newValue);
|
||||||
|
|||||||
Reference in New Issue
Block a user