Skip to content

Commit

Permalink
Make sure reconnect and formSchema operate on the same type
Browse files Browse the repository at this point in the history
  • Loading branch information
ravicious committed Jan 15, 2025
1 parent f266bf6 commit 2ca17ea
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions web/packages/teleterm/src/ui/components/OfflineGateway.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,11 @@ import { Attempt } from 'shared/hooks/useAsync';

import { useLogger } from 'teleterm/ui/hooks/useLogger';

export function OfflineGateway(props: {
export function OfflineGateway<
FormFieldsT extends Partial<Record<FormFieldNames, string>>,
>(props: {
connectAttempt: Attempt<void>;
reconnect(args: { localPort?: string }): void;
reconnect(args: FormFieldsT): void;
/** Gateway target displayed in the UI, for example, 'cockroachdb'. */
targetName: string;
/** Gateway kind displayed in the UI, for example, 'database'. */
Expand All @@ -39,7 +41,7 @@ export function OfflineGateway(props: {
* emptyFormSchema. We cannot do params.formSchema || emptyFormSchema, as that would mess with
* type inference.
*/
formSchema: z.ZodType<Partial<Record<FormFieldNames, string>>>;
formSchema: z.ZodType<FormFieldsT>;
/**
* renderFormControls allows each consumer to provide its own form fields with specific HTML form
* validation rules. The form fields are read through FormData – names on the inputs must match
Expand Down

0 comments on commit 2ca17ea

Please sign in to comment.