Skip to content

Commit 5beaa70

Browse files
committed
feat: add connector name field to form and update submission logic
Signed-off-by: Tomas Weiss <tomas.weiss2@gmail.com>
1 parent 79f5179 commit 5beaa70

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

apps/agentstack-ui/src/modules/connectors/components/AddConnectorForm.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import { useForm } from 'react-hook-form';
88
export interface CreateConnectorForm {
99
client_id?: string;
1010
client_secret?: string;
11+
name: string;
1112
url: string;
1213
}
1314

@@ -26,6 +27,7 @@ export const AddConnectorForm = (props: AddConnectorFormProps) => {
2627

2728
return (
2829
<form onSubmit={handleSubmit(props.onSubmit)}>
30+
<input type="text" placeholder="Connector Name" {...register('name', { required: true })} />
2931
<input type="text" placeholder="URL" {...register('url', { required: true })} />
3032
<input type="text" placeholder="Client ID" {...register('client_id')} />
3133
<input

apps/agentstack-ui/src/modules/connectors/components/ConnectorsView.tsx

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,15 +21,14 @@ export const ConnectorsView = () => {
2121
const authorize = useAuthorize();
2222

2323
const onSubmit = useCallback(
24-
({ url, client_id, client_secret }: CreateConnectorForm) => {
24+
({ url, client_id, client_secret, name }: CreateConnectorForm) => {
2525
createConnector({
2626
url,
2727
client_id,
2828
client_secret,
2929
match_preset: false,
30-
// TODO: get name from the form
3130
metadata: {
32-
name: 'GitHub',
31+
name,
3332
},
3433
});
3534
},

0 commit comments

Comments
 (0)