Skip to content

refactor: move admin search page to DEMI - #975

Merged
danieltruong merged 3 commits into
developfrom
chore-demi-search
Oct 14, 2026
Merged

danieltruong merged 3 commits into
developfrom
chore-demi-search

Conversation

@danieltruong

Copy link
Copy Markdown
Collaborator

Moves the eagle-admin search page to DEMI native routes and removes the last eagle-api read helpers (slice A7b of the frontend read migration). After this, the only eagle-api reads left are the /api/config fetch, ProjectService.getForEdit and full-project.resolver.ts, which the edit forms keep until the write migration.

Search page:

  • The Documents tab reads /documents and the Projects tab reads /projects, each with q, page, pageSize, count=true, native filter names and one sort key from DEMI's allow-list. Documents sort on datePosted and displayName, projects on name; other columns are not sortable.
  • The pcp filter is gone. Proponents load from /organizations?companyType=.
  • Searches and page reads share one stream, so the newest request wins. Paging stops at DEMI's 20000-row depth. A failed page read restores the pager. Search state round-trips through the URL.
  • The 'Search Executed' event stops: eagle-api logged it inside /search, which nothing calls now.

Deleted: search.service.ts, metrics/** and its route, OrgService.getByCompanyType, ApiService.head, PCP_COLLECTION.

Also:

  • full-project.resolver.ts calls eagle-api search itself and skips ids that are not Eagle ids.
  • One shared PROJECT_FILTERS const for the project list and the search page.
  • TableTemplateUtils.updateUrl escapes keywords, sort and filter values for every caller.
  • Application sort: saving warns which documents were skipped for lack of an Eagle id; edited rows are tracked by id, so rows without an Eagle id are all kept and a re-edited row sends its latest order.

Checks: yarn test-ci 771 passed; yarn lint and npm run build clean. Anonymous parity on test: projects 203 match (176 known Track-mastered field differences), organizations 734 match, documents (project 5885109faaecd9001b81314c) 871 match. Staff parity and the signed-in browser check still need a staff token and login.

- Documents and Projects tabs read /documents and /projects with q,
  page, pageSize, count and native filter names. Only columns on the
  DEMI sort allow-list sort. The comment period filter is gone.
- fullProjectResolver keeps its eagle-api read: DEMI rows hold only
  the current legislation version.
- Drop the metrics page (eagle-api /audit has no controller),
  SearchService, OrgService.getByCompanyType and ApiService.head.
- One PROJECT_FILTERS map feeds the project list and search pages.
- updateUrl escapes keywords, sort and filter values, so a ; ? # or %
  in them no longer breaks the URL on reload.
- Application sort save names the documents it skips because they
  have no Eagle id.
- Remove the unused PCP_COLLECTION.
Rows not in Eagle yet all have no _id, so matching on _id kept only
the first of them. A re-edit of a row seen again also left the stale
entry in place, so save sent the older sort order.
@danieltruong
danieltruong merged commit 593e910 into develop Oct 14, 2026
4 checks passed
@danieltruong
danieltruong deleted the chore-demi-search branch October 14, 2026 18:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant