diff --git a/packages/sanity/src/tasks/__telemetry__/tasks.telemetry.ts b/packages/sanity/src/tasks/__telemetry__/tasks.telemetry.ts index f75ead3ac284..7edb7750c671 100644 --- a/packages/sanity/src/tasks/__telemetry__/tasks.telemetry.ts +++ b/packages/sanity/src/tasks/__telemetry__/tasks.telemetry.ts @@ -18,43 +18,38 @@ export const TaskStatusChanged = defineEvent<{ }) // A comment is added in a task -export const TaskCommentAdded = defineEvent({ - name: 'Task comment added', +export const TaskCommentAdded = defineEvent<{ + is_reply: boolean +}>({ + name: 'Task Comment Added', version: 1, description: 'A comment was added in a task', }) -// A reply is added -export const TaskCommentReplyAdded = defineEvent({ - name: 'Task comment reply added', - version: 1, - description: 'A reply was added to a comment in a task', -}) - // A task is duplicated export const TaskDuplicated = defineEvent({ - name: 'Task duplicated', + name: 'Task Duplicated', version: 1, description: 'A task is duplicated', }) // A task is removed export const TaskRemoved = defineEvent({ - name: 'Task removed', + name: 'Task Removed', version: 1, description: 'A task is removed', }) // The link to a task is copied export const TaskLinkCopied = defineEvent({ - name: 'Task link copied', + name: 'Task Link Copied', version: 1, description: 'The link to a task is copied', }) // User visited the studio through a link with a task export const TaskLinkOpened = defineEvent({ - name: 'Task link opened', + name: 'Task Link Opened', version: 1, description: 'User visited the studio through a link with a task', }) diff --git a/packages/sanity/src/tasks/src/tasks/components/activity/TasksActivityLog.tsx b/packages/sanity/src/tasks/src/tasks/components/activity/TasksActivityLog.tsx index b27ff8e5bbba..d172976e96eb 100644 --- a/packages/sanity/src/tasks/src/tasks/components/activity/TasksActivityLog.tsx +++ b/packages/sanity/src/tasks/src/tasks/components/activity/TasksActivityLog.tsx @@ -25,7 +25,7 @@ import { type CommentUpdatePayload, useComments, } from '../../../../../structure/comments' -import {TaskCommentAdded, TaskCommentReplyAdded} from '../../../../__telemetry__/tasks.telemetry' +import {TaskCommentAdded} from '../../../../__telemetry__/tasks.telemetry' import {tasksLocaleNamespace} from '../../../../i18n' import {type TaskDocument} from '../../types' import {getMentionedUsers} from '../form/utils' @@ -119,7 +119,8 @@ export function TasksActivityLog(props: TasksActivityLogProps) { onChange(set(notification.subscribers, ['subscribers'])) operation.create(nextComment).then(() => { - telemetry.log(TaskCommentAdded) + // eslint-disable-next-line camelcase + telemetry.log(TaskCommentAdded, {is_reply: false}) }) }, [handleGetNotificationValue, onChange, operation, telemetry], @@ -147,7 +148,8 @@ export function TasksActivityLog(props: TasksActivityLogProps) { }, }) .then(() => { - telemetry.log(TaskCommentReplyAdded) + // eslint-disable-next-line camelcase + telemetry.log(TaskCommentAdded, {is_reply: true}) }) }, [handleGetNotificationValue, onChange, operation, telemetry], @@ -178,7 +180,8 @@ export function TasksActivityLog(props: TasksActivityLogProps) { }, }) .then(() => { - telemetry.log(TaskCommentReplyAdded) + // eslint-disable-next-line camelcase + telemetry.log(TaskCommentAdded, {is_reply: !!comment.parentCommentId}) }) }, [getComment, handleGetNotificationValue, onChange, operation, telemetry],