Skip to content

feat: read comment periods from DEMI - #969

Merged
danieltruong merged 3 commits into
developfrom
feat-demi-comment-periods
Oct 14, 2026
Merged

danieltruong merged 3 commits into
developfrom
feat-demi-comment-periods

Conversation

@danieltruong

Copy link
Copy Markdown
Collaborator

The comment period list, the period resolver and the comment exports now read from DEMI instead of eagle-api.

  • A new mapper, toLegacyCommentPeriod, turns a DEMI period into the shape the screens already use. It adds demiId and readOnly. Before an edit is saved, these fields and userCan are removed, so they never reach Eagle.
  • readOnly is true for ENGAGE periods, periods with no Eagle id, rows read without staff fields, and users without the sysadmin role. On read-only periods, Edit, Add a comment, Publish/Un-Publish and Delete are hidden. Opening the edit route for one returns you to the previous page with a message.
  • The list sends the DEMI project id, or the notification id for notification periods. Only Start and End dates sort; anything else falls back to newest start date.
  • Both exports use DEMI's export route. The proponent export adds audience=proponent. A failed export shows a message and is logged.
  • Comment stats ask for the summary by DEMI id when there is one.

eagle-api reads removed: the period list by project, period by id, and the comment export.

Tests: export URLs and the failure case, the resolver shape and redirect, list parameters, readOnly from roles, the save body, and the menu for Eagle and ENGAGE periods.

- List, resolver and details read DEMI comment periods. The list
  filters on the DEMI project id (notification id for notification
  periods) and sorts only on dateStarted or dateCompleted.
- Comment export calls DEMI /commentperiods/:id/comments/export; the
  proponent file sends audience=proponent.
- ENGAGE periods, periods with no Eagle id and tokens without the
  staff role are read-only.
- Cover the edit-route guard that keeps read-only periods out of the
  form.
- Remove DocumentService.exportComments; the details tab exports
  through DEMI.
@danieltruong
danieltruong merged commit aafb358 into develop Oct 14, 2026
4 checks passed
@danieltruong
danieltruong deleted the feat-demi-comment-periods branch October 14, 2026 04:03
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