Harvest source 'Add' page: Organization dropdown sort is inconsistent (U.S. vs US)

Open
#6,437 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
45/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Active
Tech stack
python
Domain
backend

Research direction

The payload names no files. Start by finding where the /harvest_source/add form builds its Organization choices and where that list gets sorted. Done when "U.S." and "US" entries group together, but the issue leaves open whether to sort by slug or normalize the prefixes, so confirm the approach with a maintainer before writing code.

Written by the indexing model from the issue text.

Description

Description

On the "Add Harvest Source" page (e.g. https://harvest-stage.data.gov/harvest_source/add), the Organization dropdown lists every organization as <Name> - <uuid>, sorted alphabetically by name. This sort is inconsistent because some organization names start with "U.S." (with periods) and others with "US" (no periods), so logically related federal entries end up scattered rather than grouped together.

Requested change

Either of these would fix it:

  • Show the organization slug at the front of each dropdown entry and sort by slug instead of display name, or
  • Sort the dropdown in a more logical/normalized way (e.g. normalize "U.S."/"US" prefixes before sorting) so related entries group together.

Screenshot

Image

How to reproduce

  1. Go to https://harvest-stage.data.gov/harvest_source/add
  2. Open the Organization dropdown
  3. Note "U.S. Census Bureau...", "U.S. Department of..." entries are separated from "US Agency for International Development", "US Consumer Product Safety Commission", etc. due to the period difference.
Dominant language
Python
Stars
1.2k
Forks
207
Avg merge
3d 16h
Merged PRs (30d)
5

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from GSA/data.gov

All issues in GSA/data.gov

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.