-
Notifications
You must be signed in to change notification settings - Fork 37
feat(admin): add user-scoped Gastown admin panel #1052
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
3003d77
bc85b1e
6d37d54
a7d0d17
b4d22d4
4a205f9
4b7ea44
3638aa9
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -671,18 +671,11 @@ export function getConvoyDependencyEdges( | |
| } | ||
|
|
||
| /** | ||
| * Find the convoy a bead belongs to (if any). | ||
| * | ||
| * Two cases: | ||
| * 1. Normal source bead: tracked by a convoy via bead_dependencies | ||
| * (bead_id = sourceBeadId, depends_on_bead_id = convoyId, type = 'tracks'). | ||
| * Returns the convoy bead_id. | ||
| * 2. The bead IS the convoy (e.g. for the final landing MR where processConvoyLandings | ||
| * passes the convoy bead_id as the source). Returns beadId itself. | ||
| * Find the convoy a bead belongs to (if any) via 'tracks' dependencies. | ||
| * Returns the convoy bead_id or null. | ||
| */ | ||
| export function getConvoyForBead(sql: SqlStorage, beadId: string): string | null { | ||
| // Case 1: bead is tracked by a convoy | ||
| const trackRows = [ | ||
| const rows = [ | ||
| ...query( | ||
| sql, | ||
| /* sql */ ` | ||
|
|
@@ -694,24 +687,8 @@ export function getConvoyForBead(sql: SqlStorage, beadId: string): string | null | |
| [beadId] | ||
| ), | ||
| ]; | ||
| if (trackRows.length > 0) { | ||
| return z.object({ depends_on_bead_id: z.string() }).parse(trackRows[0]).depends_on_bead_id; | ||
| } | ||
|
|
||
| // Case 2: bead is itself a convoy (has convoy_metadata) | ||
| const metaRows = [ | ||
| ...query( | ||
| sql, | ||
| /* sql */ ` | ||
| SELECT 1 FROM ${convoy_metadata} | ||
| WHERE ${convoy_metadata.bead_id} = ? | ||
| `, | ||
| [beadId] | ||
| ), | ||
| ]; | ||
| if (metaRows.length > 0) return beadId; | ||
|
|
||
| return null; | ||
| if (rows.length === 0) return null; | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. WARNING: Convoy self-lookups now drop landing MR context
|
||
| return z.object({ depends_on_bead_id: z.string() }).parse(rows[0]).depends_on_bead_id; | ||
| } | ||
|
|
||
| /** | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.