Skip to content

refactor(api): event texts next to their emitter, no central text table - #177

Merged
BatLeDev merged 1 commit into
masterfrom
refactor-event-texts
Nov 13, 2026
Merged

BatLeDev merged 1 commit into
masterfrom
refactor-event-texts

Conversation

@BatLeDev

Copy link
Copy Markdown
Member

The { en, fr } event texts move from the central api/src/utils/event-texts.ts (keys, an interpolation helper and a parity unit test) to their emitters.

  • sendPortalEvent, sendPageEvent, sendReuseEvent and sendGroupEvent hold the titles of their actions; the bodies are written where the event is sent.
  • changesBody() is the one body shared by the portal router and service.
  • switchStandardPages returns the titles of the replaced pages, the publish event builds its body from them.
  • sendGroupEvent no longer takes a body, no caller gave one.
  • Texts unchanged.

Part of the platform-wide fr/en pass of the events (catalogs data-fair/catalogs#46, portals, processings, data-fair, simple-directory, customers, agents), following the standard of the data-fair-service skill (references/events.md in data-fair/lib). Topic keys are unchanged, so users' subscriptions keep working. No release order: the events service already accepts { en, fr } titles, and the inactive queue without events url is in @data-fair/lib-node since 2.17.0.

The { en, fr } titles and bodies were keys of utils/event-texts.ts, filled by an
interpolation helper and checked by a unit test. Each emitter now holds its own texts:
- sendPortalEvent, sendPageEvent, sendReuseEvent and sendGroupEvent hold the titles of
  their actions, the bodies are written where the event is sent
- changesBody() is the one body shared by the portal router and service
- switchStandardPages returns the titles of the replaced pages, the publish event writes
  its body from them
- sendGroupEvent no longer takes a body, none of its callers gave one
- texts and topic keys unchanged
@BatLeDev
BatLeDev marked this pull request as ready for review November 13, 2026 10:03
@BatLeDev
BatLeDev merged commit 8a2a389 into master Nov 13, 2026
8 checks passed
@BatLeDev
BatLeDev deleted the refactor-event-texts branch November 13, 2026 10:03
@BatLeDev
BatLeDev restored the refactor-event-texts branch November 13, 2026 10:03
@BatLeDev
BatLeDev deleted the refactor-event-texts branch November 13, 2026 10:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant