You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: AGENTS.md
+14Lines changed: 14 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -22,3 +22,17 @@ If a library component (e.g. in orcid-registry-ui) looks correct in the docs app
22
22
## Dialogs and async data
23
23
24
24
When a dialog or view needs data from an HTTP (or other async) call, opening the dialog only after the request completes can feel slow. Consider opening the dialog **immediately** with skeleton or static data (e.g. labels, empty lists, or a `loading: true` flag), then assigning the full payload to the dialog’s component instance when the observable emits. The dialog can show placeholders or a loading state until then.
25
+
26
+
## RUM / Observability
27
+
28
+
The app sends events to **New Relic** (and optionally logs them in the console) for analytics and debugging. The central service is **`RumJourneyEventService`** (`src/app/rum/service/customEvent.service.ts`).
29
+
30
+
### Two ways to record events
31
+
32
+
1.**`recordSimpleEvent(eventName, attrs?)`** — Standalone one-off events. No journey lifecycle. Use for: record page actions (expand featured work, summary toggle), errors (`http_error`, `client_error`), or any action that isn't part of a multi-step journey.
33
+
2.**`recordEvent(journeyType, eventName, eventAttrs?)`** — Events inside a **journey**. Requires `startJourney(journeyType, context)` first; events are tied to that journey (elapsed time, journey id). Use for: registration flow, OAuth, notifications. If no journey is active, the event is ignored (and logged in console when debug is on).
34
+
35
+
### Event names: use the enum
36
+
37
+
-**All event name strings** live in **`AppEventName`** in `src/app/register/app-event-names.ts`. Do not hardcode event names elsewhere.
38
+
- For **dynamic** names (e.g. `step-${step}-loaded`), add a small helper in the same file (e.g. `stepLoadedEvent(step)`) and use it when calling `recordEvent`.
0 commit comments