mirror of
https://github.com/datahub-project/datahub.git
synced 2025-12-27 01:48:24 +00:00
fix(ui) Make LookML deploy key a textarea and format key (#5946)
Co-authored-by: Chris Collins <chriscollins@Chriss-MBP-2.lan>
This commit is contained in:
parent
9384a52b23
commit
a3af5106e8
@ -100,7 +100,9 @@ function FormField(props: Props) {
|
||||
if (field.type === FieldType.DICT) return <DictField field={field} />;
|
||||
|
||||
const isBoolean = field.type === FieldType.BOOLEAN;
|
||||
const input = isBoolean ? <Checkbox /> : <Input placeholder={field.placeholder} />;
|
||||
let input = <Input placeholder={field.placeholder} />;
|
||||
if (isBoolean) input = <Checkbox />;
|
||||
if (field.type === FieldType.TEXTAREA) input = <Input.TextArea placeholder={field.placeholder} />;
|
||||
const valuePropName = isBoolean ? 'checked' : 'value';
|
||||
const getValueFromEvent = isBoolean ? undefined : (e) => (e.target.value === '' ? null : e.target.value);
|
||||
|
||||
|
||||
@ -8,6 +8,7 @@ export enum FieldType {
|
||||
SELECT,
|
||||
SECRET,
|
||||
DICT,
|
||||
TEXTAREA,
|
||||
}
|
||||
|
||||
interface Option {
|
||||
|
||||
@ -24,14 +24,19 @@ export const LOOKML_GITHUB_INFO_REPO: RecipeField = {
|
||||
rules: [{ required: true, message: 'Github Repo is required' }],
|
||||
};
|
||||
|
||||
const deployKeyFieldPath = 'source.config.github_info.deploy_key';
|
||||
export const DEPLOY_KEY: RecipeField = {
|
||||
name: 'github_info.deploy_key',
|
||||
label: 'GitHub Deploy Key',
|
||||
tooltip: 'The SSH private key that has been provisioned for read access on the GitHub repository.',
|
||||
type: FieldType.SECRET,
|
||||
type: FieldType.TEXTAREA,
|
||||
fieldPath: 'source.config.github_info.deploy_key',
|
||||
placeholder: 'DEPLOY_KEY',
|
||||
placeholder: '-----BEGIN OPENSSH PRIVATE KEY-----\n...',
|
||||
rules: [{ required: true, message: 'Github Deploy Key is required' }],
|
||||
setValueOnRecipeOverride: (recipe: any, value: string) => {
|
||||
const valueWithNewLine = `${value}\n`;
|
||||
return setFieldValueOnRecipe(recipe, valueWithNewLine, deployKeyFieldPath);
|
||||
},
|
||||
};
|
||||
|
||||
function validateApiSection(getFieldValue, fieldName) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user