Skip to content

Commit

Permalink
feat: use AuthFields to for git password and username
Browse files Browse the repository at this point in the history
  • Loading branch information
mainawycliffe committed Nov 6, 2023
1 parent 43e7df6 commit 775a481
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 3 deletions.
15 changes: 15 additions & 0 deletions src/components/Connections/RenderConnectionFormFields.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import FormikCheckbox from "../Forms/Formik/FormikCheckbox";
import { FormikEnvVarSource } from "../Forms/Formik/FormikEnvVarSource";
import FormikTextInput from "../Forms/Formik/FormikTextInput";
import { ConnectionFormFields } from "./connectionTypes";
import FormikAuthFields from "../Forms/Formik/FormikAuthFields";

interface FieldViewProps {
field: ConnectionFormFields;
Expand Down Expand Up @@ -54,6 +55,20 @@ export default function RenderConnectionFormFields({ field }: FieldViewProps) {
);
case "switch":
return <FormikConnectionOptionsSwitchField field={field} />;

case "authentication":
return (
<FormikAuthFields
name={field.key}
types={[
{
value: { basic: true },
label: "Basic"
}
]}
label={field.label}
/>
);
default:
return null;
}
Expand Down
7 changes: 4 additions & 3 deletions src/components/Connections/connectionTypes.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ const enum ConnectionsFieldTypes {
input = "input",
numberInput = "numberInput",
EnvVarSource = "EnvVarSource",
switch = "switch"
switch = "switch",
Authentication = "authentication"
}

type Variant = "small" | "large";
Expand Down Expand Up @@ -1844,12 +1845,12 @@ export const connectionTypes: ConnectionType[] = [
{
label: "Username",
key: "username",
type: ConnectionsFieldTypes.EnvVarSource
type: ConnectionsFieldTypes.Authentication
},
{
label: "Password",
key: "password",
type: ConnectionsFieldTypes.EnvVarSource
type: ConnectionsFieldTypes.Authentication
}
]
},
Expand Down

0 comments on commit 775a481

Please sign in to comment.