Rallly is an open-source scheduling and collaboration tool designed to make organizing events and meetings easier.
TypeScript i18nextnext-authnextjspostgresqlprismareact-emailt3-stacktailwindcsstrpcturborepotypescriptzod
📈 Track poll settings
Luke Vella41781f991c74
diff --git a/apps/web/src/features/analytics/service.ts b/apps/web/src/features/analytics/service.tsindex 891d35285..1efb9e177 100644--- a/apps/web/src/features/analytics/service.ts+++ b/apps/web/src/features/analytics/service.ts@@ -34,14 +34,10 @@ export class AnalyticsService {case "poll_create":// Set up initial group properties for new pollsthis.setPoll(event.pollId, {- title: event.properties.title,status: "live", // New polls start as liveparticipant_count: 0, // New polls start with 0 participantscomment_count: 0, // New polls start with 0 comments- option_count: event.properties.optionCount,- has_location: event.properties.hasLocation,- has_description: event.properties.hasDescription,- timezone: event.properties.timezone,+ ...toSnakeCaseKeys(event.properties),});break;@@ -101,12 +97,14 @@ export class AnalyticsService {setPoll(pollId: string, properties: Partial<PollGroupProperties>): void {if (!this.posthog) return;+ const { title, ...forwardProps } = properties;+this.posthog.groupIdentify({groupType: "poll",groupKey: pollId,properties: {- ...properties,- name: properties.title,+ name: title,+ ...forwardProps,},});}diff --git a/apps/web/src/features/poll/analytics.ts b/apps/web/src/features/poll/analytics.tsindex df64e2b7f..14b3d6a93 100644--- a/apps/web/src/features/poll/analytics.ts+++ b/apps/web/src/features/poll/analytics.ts@@ -53,6 +53,10 @@ export interface PollCreateEvent extends BaseEventData {hasLocation: boolean;hasDescription: boolean;timezone?: string;+ disableCommnets: boolean;+ hideScores: boolean;+ hideParticipants: boolean;+ requireParticipantEmail: boolean;};}diff --git a/apps/web/src/trpc/routers/polls.ts b/apps/web/src/trpc/routers/polls.tsindex c4c9e18f0..97706d98e 100644--- a/apps/web/src/trpc/routers/polls.ts+++ b/apps/web/src/trpc/routers/polls.ts@@ -227,10 +227,7 @@ export const polls = router({}const poll = await prisma.poll.create({- select: {- adminUrlId: true,- id: true,- title: true,+ include: {options: {select: {id: true,@@ -311,6 +308,10 @@ export const polls = router({hasLocation: !!input.location,hasDescription: !!input.description,timezone: input.timeZone,+ disableCommnets: poll.disableComments,+ hideParticipants: poll.hideParticipants,+ hideScores: poll.hideScores,+ requireParticipantEmail: poll.requireParticipantEmail,},});