Skip to content

Commit ff0e438

Browse files
jpoplegalvana
andcommitted
System integrations form: remove empty integer values on submission (#6626)
Co-authored-by: Adrian Galvan <adrian@ethyca.com>
1 parent 3ea377d commit ff0e438

4 files changed

Lines changed: 12 additions & 2 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ Changes can also be flagged with a GitHub label for tracking purposes. The URL o
4040
- Inconsistent location values displayed on action center [#6599](https://github.com/ethyca/fides/pull/6599)
4141
- Incorrect location display in system inventory screen [#6598](https://github.com/ethyca/fides/pull/6598)
4242
- Fixed an issue that allowed new taxonomy items to be submitted multiple times [#6609](https://github.com/ethyca/fides/pull/6609)
43+
- Fixed an error on trying to submit optional integer fields in the integration form [#6626](https://github.com/ethyca/fides/pull/6626)
4344

4445
## [2.70.2](https://github.com/ethyca/fides/compare/2.70.1...2.70.2)
4546

clients/admin-ui/src/features/common/form/useFormFieldsFromSchema.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,15 @@ export const useFormFieldsFromSchema = (
7575
`https://${updatedValues.secrets[key]}`;
7676
}
7777
}
78+
// sending "" when the backend expects an integer will cause an error
79+
if (secretsSchema.properties[key].type === "integer") {
80+
if (
81+
typeof updatedValues.secrets[key] === "string" &&
82+
updatedValues.secrets[key].trim() === ""
83+
) {
84+
updatedValues.secrets[key] = undefined;
85+
}
86+
}
7887
});
7988
}
8089
return updatedValues;

src/fides/api/schemas/connection_configuration/connection_secrets_mongodb.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ class MongoDBSchema(ConnectionConfigSecretsSchema):
1818
port: int = Field(
1919
27017,
2020
title="Port",
21-
description="The network port number on which the server is listening for incoming connections (default: 27017).",
21+
description="The network port number on which the server is listening for incoming connections (default: 27017). Port will be ignored if using SRV.",
2222
)
2323
username: str = Field(
2424
title="Username",

tests/ops/api/v1/endpoints/test_connection_template_endpoints.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -976,7 +976,7 @@ def test_get_connection_secret_schema_mongodb(
976976
"port": {
977977
"default": 27017,
978978
"title": "Port",
979-
"description": "The network port number on which the server is listening for incoming connections (default: 27017).",
979+
"description": "The network port number on which the server is listening for incoming connections (default: 27017). Port will be ignored if using SRV.",
980980
"type": "integer",
981981
},
982982
"username": {

0 commit comments

Comments
 (0)