galaxyproject / galaxyproject/brc-analytics
Account workspace: build entity links from ROUTES instead of hand-rolled paths
- Dominant language
- TypeScript
- Stars
- 7
- Forks
- 11
- Avg merge
- 3d 15h
- Merged PRs (30d)
- 15
Description
Part of #1707. Found in the review of #1689.
## Problem
`packages/shared/views/AccountView/components/FavoritesSection/favoritesSection.tsx` (around line 57) builds the **Open** link as `` `/data/${entityRoute}/${sanitizeEntityId(id)}` ``, with the path fragments in `FavoritesSection/utils.ts` and a literal `"/data/assemblies"` in `EmptyWorkspace`. The existing view-model builders build the same URLs with `ROUTES.GENOME` / `ROUTES.ORGANISM` / `ROUTES.GENOMES` and `replaceParameters`.
Entity routes now live in two places: renaming a detail route updates `ROUTES` and every builder and breadcrumb but leaves the account workspace linking to dead pages. It's also already inconsistent with the organism builders (`packages/shared/viewModelBuilders/viewModelBuilders.tsx:365` wraps the id in `encodeURIComponent`; the new code doesn't). Harmless for today's numeric tax ids and sanitized accessions, but a divergence a shared helper would prevent.
## Suggested fix
Store `ROUTES.GENOME` / `ROUTES.ORGANISM` in `ENTITY_TYPE_DISPLAY` and call `replaceParameters(route, { entityId: sanitizeEntityId(id) })`. Use `ROUTES.GENOMES` in `EmptyWorkspace`.
Contributor guide
No contributing guide indexed for this repository
Research direction
Start in packages/shared/views/AccountView/components/FavoritesSection/favoritesSection.tsx and its utils.ts, then inspect EmptyWorkspace and the ROUTES/replacеParameters usage in packages/shared/viewModelBuilders/viewModelBuilders.tsx. Replace the hand-built entity links with the named ROUTES entries and use ROUTES.GENOMES for EmptyWorkspace. Done means account workspace links remain correct and entity IDs are encoded consistently.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- frontend
- Issue type
- Refactor
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Active
- Clarity
- Clearly specified
- Newbie friendliness
- 88/100