mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-09-22 13:39:35 +00:00
feat(notifications): add notification update posthog telemetry to track
when notifications are clicked / read. also increased popup z index
This commit is contained in:
@@ -3,8 +3,10 @@ import { z } from "zod";
|
||||
import { UserNotificationsSchema } from "@app/db/schemas/user-notifications";
|
||||
import { UnauthorizedError } from "@app/lib/errors";
|
||||
import { readLimit, writeLimit } from "@app/server/config/rateLimiter";
|
||||
import { getTelemetryDistinctId } from "@app/server/lib/telemetry";
|
||||
import { verifyAuth } from "@app/server/plugins/auth/verify-auth";
|
||||
import { AuthMode } from "@app/services/auth/auth-type";
|
||||
import { PostHogEventTypes } from "@app/services/telemetry/telemetry-types";
|
||||
|
||||
export const registerNotificationRouter = async (server: FastifyZodProvider) => {
|
||||
server.route({
|
||||
@@ -97,6 +99,16 @@ export const registerNotificationRouter = async (server: FastifyZodProvider) =>
|
||||
...req.body
|
||||
});
|
||||
|
||||
await server.services.telemetry.sendPostHogEvents({
|
||||
event: PostHogEventTypes.NotificationUpdated,
|
||||
distinctId: getTelemetryDistinctId(req),
|
||||
organizationId: req.permission.orgId,
|
||||
properties: {
|
||||
notificationId: req.params.notificationId,
|
||||
...req.body
|
||||
}
|
||||
});
|
||||
|
||||
return { notification };
|
||||
}
|
||||
});
|
||||
|
||||
@@ -32,7 +32,8 @@ export enum PostHogEventTypes {
|
||||
IssueSshHostHostCert = "Issue SSH Host Host Certificate",
|
||||
SignCert = "Sign PKI Certificate",
|
||||
IssueCert = "Issue PKI Certificate",
|
||||
InvalidateCache = "Invalidate Cache"
|
||||
InvalidateCache = "Invalidate Cache",
|
||||
NotificationUpdated = "Notification Updated"
|
||||
}
|
||||
|
||||
export type TSecretModifiedEvent = {
|
||||
@@ -232,6 +233,14 @@ export type TInvalidateCacheEvent = {
|
||||
};
|
||||
};
|
||||
|
||||
export type TNotificationUpdatedEvent = {
|
||||
event: PostHogEventTypes.NotificationUpdated;
|
||||
properties: {
|
||||
notificationId: string;
|
||||
isRead?: boolean;
|
||||
};
|
||||
};
|
||||
|
||||
export type TPostHogEvent = { distinctId: string; organizationId?: string } & (
|
||||
| TSecretModifiedEvent
|
||||
| TAdminInitEvent
|
||||
@@ -251,4 +260,5 @@ export type TPostHogEvent = { distinctId: string; organizationId?: string } & (
|
||||
| TSignCertificateEvent
|
||||
| TIssueCertificateEvent
|
||||
| TInvalidateCacheEvent
|
||||
| TNotificationUpdatedEvent
|
||||
);
|
||||
|
||||
@@ -46,7 +46,7 @@ export const NotificationDropdown = () => {
|
||||
<DropdownMenuContent
|
||||
align="end"
|
||||
side="bottom"
|
||||
className="mt-3 flex h-[550px] w-[400px] overflow-hidden rounded-lg"
|
||||
className="z-[9999] mt-3 flex h-[550px] w-[400px] overflow-hidden rounded-lg"
|
||||
>
|
||||
<div className="flex w-full flex-col">
|
||||
<div className="flex items-center justify-between border-b border-mineshaft-500 px-3 py-2">
|
||||
|
||||
Reference in New Issue
Block a user