diff --git a/app/@types/graphql/schema.ts b/app/@types/graphql/schema.ts index d09f8c3..a694f4e 100644 --- a/app/@types/graphql/schema.ts +++ b/app/@types/graphql/schema.ts @@ -158,6 +158,11 @@ export type AiEngineType = { title: Scalars['String']['output']; }; +export type AiEngineUpdate = { + id: Scalars['Int']['input']; + settings: Scalars['String']['input']; +}; + /** Autogenerated input type of AnalyzeActivity */ export type AnalyzeActivityInput = { /** A unique identifier for the client performing the mutation. */ @@ -647,6 +652,7 @@ export type OrganizationBasicInfo = { }; export type OrganizationUpdate = { + aiEngines?: InputMaybe>; githubOrgs?: InputMaybe; githubToken?: InputMaybe; name: Scalars['String']['input']; diff --git a/app/components/OrganizationForm.tsx b/app/components/OrganizationForm.tsx index d533343..cc872b6 100644 --- a/app/components/OrganizationForm.tsx +++ b/app/components/OrganizationForm.tsx @@ -7,12 +7,21 @@ import { Card, List, ListItem, + CardBody, + Textarea, } from "@material-tailwind/react"; import { OrganizationUpdate } from "@app-types/graphql"; import { ChangeEventHandler } from "react"; -export type OrganizationFormData = OrganizationUpdate & { isPersonal: boolean }; +export type OrganizationFormData = Omit & { + isPersonal: boolean; +} & { + aiEngines: + | { id: number; title: string; settings: string }[] + | null + | undefined; +}; export interface OrganizationFormProps { id?: string; @@ -47,7 +56,7 @@ export function OrganizationForm({ return (
-
+
{!organization.isPersonal && ( <> @@ -150,7 +159,6 @@ export function OrganizationForm({ /> )} - @@ -175,6 +183,43 @@ export function OrganizationForm({ + {!organization.useSystemAiEngine && ( + <> + + My AI Engines Settings + + + {organization?.aiEngines?.map(({ id, title, settings }) => ( +
+ + + + {title} + +