mirror of
https://github.com/datahub-project/datahub.git
synced 2025-12-25 17:08:29 +00:00
feat(secrets) Allow creating secrets with multiline values in the UI (#6169)
Co-authored-by: Chris Collins <chriscollins@Chriss-MBP-2-273.lan>
This commit is contained in:
parent
e70c0ac4b6
commit
c0d42deab7
@ -41,6 +41,11 @@ export const SecretBuilderModal = ({ initialState, visible, onSubmit, onCancel }
|
||||
querySelectorToExecuteClick: '#createSecretButton',
|
||||
});
|
||||
|
||||
function resetValues() {
|
||||
setSecretBuilderState({});
|
||||
form.resetFields();
|
||||
}
|
||||
|
||||
return (
|
||||
<Modal
|
||||
width={540}
|
||||
@ -55,7 +60,7 @@ export const SecretBuilderModal = ({ initialState, visible, onSubmit, onCancel }
|
||||
</Button>
|
||||
<Button
|
||||
id="createSecretButton"
|
||||
onClick={() => onSubmit?.(secretBuilderState, () => setSecretBuilderState({}))}
|
||||
onClick={() => onSubmit?.(secretBuilderState, resetValues)}
|
||||
disabled={createButtonEnabled}
|
||||
>
|
||||
Create
|
||||
@ -65,7 +70,7 @@ export const SecretBuilderModal = ({ initialState, visible, onSubmit, onCancel }
|
||||
>
|
||||
<Form
|
||||
form={form}
|
||||
initialValues={{}}
|
||||
initialValues={initialState}
|
||||
layout="vertical"
|
||||
onFieldsChange={() =>
|
||||
setCreateButtonEnabled(form.getFieldsError().some((field) => field.errors.length > 0))
|
||||
@ -110,10 +115,11 @@ export const SecretBuilderModal = ({ initialState, visible, onSubmit, onCancel }
|
||||
]}
|
||||
hasFeedback
|
||||
>
|
||||
<Input.Password
|
||||
<Input.TextArea
|
||||
placeholder="The value of your secret"
|
||||
value={secretBuilderState.value}
|
||||
onChange={(event) => setValue(event.target.value)}
|
||||
autoComplete="false"
|
||||
/>
|
||||
</Form.Item>
|
||||
</Form.Item>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user