🐛 Implement clearing for credentials

This commit is contained in:
Manuel Ruwe
2023-01-10 21:42:37 +01:00
parent 48b7564910
commit d2101fbc1e
2 changed files with 11 additions and 1 deletions

View File

@@ -104,7 +104,15 @@ export const GenericSecretInput = ({
</Grid.Col>
<Grid.Col xs={12} md={6}>
<Flex gap={10} justify="end" align="end">
<Button variant="subtle" color="gray" px="xl">
<Button
onClick={() => {
setDisplayUpdateField(false);
onClickUpdateButton(undefined);
}}
variant="subtle"
color="gray"
px="xl"
>
{t('integration.secrets.clear')}
</Button>
{displayUpdateField === true ? (

View File

@@ -52,6 +52,7 @@ export const IntegrationOptionsRenderer = ({ form }: IntegrationOptionsRendererP
<GenericSecretInput
onClickUpdateButton={(value) => {
form.setFieldValue(`integration.properties.${index}.value`, value);
form.setFieldValue(`integration.properties.${index}.isDefined`, value !== undefined);
}}
key={`input-${property}`}
label={`${property} (potentionally unmapped)`}
@@ -68,6 +69,7 @@ export const IntegrationOptionsRenderer = ({ form }: IntegrationOptionsRendererP
<GenericSecretInput
onClickUpdateButton={(value) => {
form.setFieldValue(`integration.properties.${index}.value`, value);
form.setFieldValue(`integration.properties.${index}.isDefined`, value !== undefined);
}}
key={`input-${definition.label}`}
label={definition.label}