Skip to content

Add basic metrics to user notifications

Administrator requested to merge ar/cloud-62-notifications-metrics into main

Created by: artemruts

Description

This PR adds basic metrics to user notifications, specifically:

  • when a user opens a notifications dropdown
  • when a user clicks on the notification link

User notifications are loaded, tracking cases:

event name: UserNotificationsLoaded payload: see UserNotificationsOpened, payload variations are the same

User opens notifications dropdown, tracking cases:

  1. No notifications, everything is synced and up-to-date

    event name: UserNotificationsOpened payload:

    {
      "status": "success"
    }
    Everything is up-to-date demo
    All OK
  2. No added code hosts

    event name: UserNotificationsOpened payload:

    {
      "status": "NoCodehosts"
    }
    No code hosts demo
    No Codehosts
  3. No added repositories

    event name: UserNotificationsOpened payload:

    {
      "status": "NoRepos"
    }
    No repos demo
    No Repos
  4. Multiple in-progress and error notifications

    event name: UserNotificationsOpened payload:

    {
      "status":  ["CloningProgress" | "IndexingProgress" | "ExternalServiceSyncError" | "SyncError" | "IndexingError"] 
    }
    multiple notifications demo
    Multiple notification statuses

User clicks a notifications link:

event name: UserNotificationsLinkClicked payload:

{
  "href": string,
  "notificationType":  "not-active" | "progress" | "warning" | "success" | "error"
}
notifications link tracking demo

https://user-images.githubusercontent.com/1319181/135966649-78ccfc6c-b4c9-4d5e-a0a0-2e0b53485111.mov

Tests

Tested locally and on .com

Merge request reports

Loading