diff --git a/client/src/js/Context.ts b/client/src/js/Context.ts index bd2aeca..f3dca99 100644 --- a/client/src/js/Context.ts +++ b/client/src/js/Context.ts @@ -1,3 +1,3 @@ import { createContext } from "react"; type TContext = Record<"params" | "cookies", Record>; -export const AppContext = createContext({params: {}, cookies: {}}); +export const AppContext = createContext({ params: {}, cookies: {} }); diff --git a/client/src/js/components/ProjectSelect.tsx b/client/src/js/components/ProjectSelect.tsx index 20e8bb9..b4d9320 100644 --- a/client/src/js/components/ProjectSelect.tsx +++ b/client/src/js/components/ProjectSelect.tsx @@ -11,6 +11,7 @@ export function ProjectSelect({ onChange, selected }: Props) { const { data, loading } = useProjects(); const projects: Project[] = data?.projects || []; const options: Option[] = projects.map(project => ({ + id: project.id, label: (
{project.name}
), - value: String(project.id), + value: project.name, })); if (loading) { @@ -30,7 +31,7 @@ export function ProjectSelect({ onChange, selected }: Props) { return ( e.stopPropagation()} + onChange={(e: React.ChangeEvent) => { + const { + target: { value: text }, + } = e; + onTextChange(text); + }} + type="text" + placeholder="Filter by text" + /> + ); +} diff --git a/client/src/js/types/schema.ts b/client/src/js/types/schema.ts index 206d793..f245397 100644 --- a/client/src/js/types/schema.ts +++ b/client/src/js/types/schema.ts @@ -1,43 +1,56 @@ export type Maybe = T | null; export type InputMaybe = Maybe; -export type Exact = { [K in keyof T]: T[K] }; -export type MakeOptional = Omit & { [SubKey in K]?: Maybe }; -export type MakeMaybe = Omit & { [SubKey in K]: Maybe }; -export type MakeEmpty = { [_ in K]?: never }; -export type Incremental = T | { [P in keyof T]?: P extends ' $fragmentName' | '__typename' ? T[P] : never }; +export type Exact = { + [K in keyof T]: T[K]; +}; +export type MakeOptional = Omit & { + [SubKey in K]?: Maybe; +}; +export type MakeMaybe = Omit & { + [SubKey in K]: Maybe; +}; +export type MakeEmpty< + T extends { [key: string]: unknown }, + K extends keyof T, +> = { [_ in K]?: never }; +export type Incremental = + | T + | { + [P in keyof T]?: P extends " $fragmentName" | "__typename" ? T[P] : never; + }; /** All built-in and custom scalars, mapped to their actual values */ export type Scalars = { - ID: { input: string; output: string; } - String: { input: string; output: string; } - Boolean: { input: boolean; output: boolean; } - Int: { input: number; output: number; } - Float: { input: number; output: number; } + ID: { input: string; output: string }; + String: { input: string; output: string }; + Boolean: { input: boolean; output: boolean }; + Int: { input: number; output: number }; + Float: { input: number; output: number }; /** An ISO 8601-encoded datetime */ - ISO8601DateTime: { input: any; output: any; } + ISO8601DateTime: { input: any; output: any }; }; /** Autogenerated return type of CompleteTask. */ export type CompleteTaskPayload = { - __typename?: 'CompleteTaskPayload'; - errors?: Maybe>; - ok?: Maybe; + __typename?: "CompleteTaskPayload"; + errors?: Maybe>; + ok?: Maybe; }; /** Autogenerated return type of CreateTask. */ export type CreateTaskPayload = { - __typename?: 'CreateTaskPayload'; - errors: Array; + __typename?: "CreateTaskPayload"; + errors: Array; }; /** Autogenerated return type of DestroyTask. */ export type DestroyTaskPayload = { - __typename?: 'DestroyTaskPayload'; - errors?: Maybe>; - ok?: Maybe; + __typename?: "DestroyTaskPayload"; + errors?: Maybe>; + ok?: Maybe; }; export type Mutation = { - __typename?: 'Mutation'; + __typename?: "Mutation"; completeTask?: Maybe; createTask?: Maybe; destroyTask?: Maybe; @@ -45,96 +58,89 @@ export type Mutation = { updateTask?: Maybe; }; - export type MutationCompleteTaskArgs = { - taskId: Scalars['Int']['input']; + taskId: Scalars["Int"]["input"]; }; - export type MutationCreateTaskArgs = { input: TaskInput; }; - export type MutationDestroyTaskArgs = { - taskId: Scalars['Int']['input']; + taskId: Scalars["Int"]["input"]; }; - export type MutationSetRandomProjectColorArgs = { - projectId: Scalars['Int']['input']; + projectId: Scalars["Int"]["input"]; }; - export type MutationUpdateTaskArgs = { input: TaskInput; - taskId: Scalars['Int']['input']; + taskId: Scalars["Int"]["input"]; }; export type Project = { - __typename?: 'Project'; - color: Scalars['String']['output']; - id: Scalars['Int']['output']; - name: Scalars['String']['output']; - path: Scalars['String']['output']; + __typename?: "Project"; + color: Scalars["String"]["output"]; + id: Scalars["Int"]["output"]; + name: Scalars["String"]["output"]; + path: Scalars["String"]["output"]; tasks: Array; }; export type Query = { - __typename?: 'Query'; + __typename?: "Query"; findTask?: Maybe; projects: Array; tasks: Array; }; - export type QueryFindTaskArgs = { - taskId: Scalars['Int']['input']; + taskId: Scalars["Int"]["input"]; }; - export type QueryTasksArgs = { - projectId?: InputMaybe; + projectId?: InputMaybe; status: TaskStatus; }; /** Autogenerated return type of SetRandomProjectColor. */ export type SetRandomProjectColorPayload = { - __typename?: 'SetRandomProjectColorPayload'; - errors: Array; + __typename?: "SetRandomProjectColorPayload"; + errors: Array; project?: Maybe; }; export type Task = { - __typename?: 'Task'; - content: Scalars['String']['output']; - id: Scalars['Int']['output']; - inProgress: Scalars['Boolean']['output']; - isBacklogged: Scalars['Boolean']['output']; - isComplete: Scalars['Boolean']['output']; - isReady: Scalars['Boolean']['output']; + __typename?: "Task"; + content: Scalars["String"]["output"]; + id: Scalars["Int"]["output"]; + inProgress: Scalars["Boolean"]["output"]; + isBacklogged: Scalars["Boolean"]["output"]; + isComplete: Scalars["Boolean"]["output"]; + isReady: Scalars["Boolean"]["output"]; project: Project; status: TaskStatus; - title: Scalars['String']['output']; - updatedAt: Scalars['ISO8601DateTime']['output']; + title: Scalars["String"]["output"]; + updatedAt: Scalars["ISO8601DateTime"]["output"]; }; export type TaskInput = { - content?: InputMaybe; - projectId?: InputMaybe; + content?: InputMaybe; + projectId?: InputMaybe; status?: InputMaybe; - title?: InputMaybe; + title?: InputMaybe; }; export enum TaskStatus { - Backlog = 'backlog', - Complete = 'complete', - InProgress = 'in_progress', - Ready = 'ready' + Backlog = "backlog", + Complete = "complete", + InProgress = "in_progress", + Ready = "ready", } /** Autogenerated return type of UpdateTask. */ export type UpdateTaskPayload = { - __typename?: 'UpdateTaskPayload'; - errors: Array; + __typename?: "UpdateTaskPayload"; + errors: Array; };