diff --git a/CHANGELOG b/CHANGELOG index 52a5ce5..5dc0e72 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -7,6 +7,8 @@ Dates should be in`YYYY-MM-DD` format and versions are in [semantic versioning]( ### Added +- Added a "lead" on a change to keep track of who is currently in charge of managing the change. + ### Fixed - Disabled keyboard shortcuts on how view to avoid conflicting with text editing shortcuts. diff --git a/src/database/OrganizationsDB.ts b/src/database/OrganizationsDB.ts index 2f57300..c69f543 100644 --- a/src/database/OrganizationsDB.ts +++ b/src/database/OrganizationsDB.ts @@ -959,10 +959,18 @@ class OrganizationsDB { .single(); } - async updateChangeVisibility(how: ChangeRow, vis: string) { + async updateChangeVisibility(change: ChangeRow, vis: string) { const { error } = await this.supabase .from('suggestions') .update({ visibility: vis }) + .eq('id', change.id); + return error; + } + + async updateChangeLead(how: ChangeRow, lead: string | null) { + const { error } = await this.supabase + .from('suggestions') + .update({ lead: lead }) .eq('id', how.id); return error; } diff --git a/src/database/database.types.ts b/src/database/database.types.ts index 71edd67..500471e 100644 --- a/src/database/database.types.ts +++ b/src/database/database.types.ts @@ -451,6 +451,7 @@ export type Database = { comments: string[] description: string id: string + lead: string | null orgid: string processes: string[] proposal: string @@ -467,6 +468,7 @@ export type Database = { comments?: string[] description?: string id?: string + lead?: string | null orgid: string processes?: string[] proposal?: string @@ -483,6 +485,7 @@ export type Database = { comments?: string[] description?: string id?: string + lead?: string | null orgid?: string processes?: string[] proposal?: string @@ -495,6 +498,13 @@ export type Database = { who?: string } Relationships: [ + { + foreignKeyName: "suggestions_lead_fkey" + columns: ["lead"] + isOneToOne: false + referencedRelation: "people" + referencedColumns: ["id"] + }, { foreignKeyName: "suggestions_orgid_fkey" columns: ["orgid"] diff --git a/src/lib/ChangeView.svelte b/src/lib/ChangeView.svelte index 6a8ca2d..c3fd213 100644 --- a/src/lib/ChangeView.svelte +++ b/src/lib/ChangeView.svelte @@ -98,6 +98,27 @@ />. + + {#if editable}