Scheduling infrastructure for absolutely everyone.
- Updated jitsu to 2.0.1 - Mask sensitive information (such as page title and IP address)
vklimontovichca1979fac24d
diff --git a/components/Shell.tsx b/components/Shell.tsxindex e0a8fe0f6f1..e0cd0f892b5 100644--- a/components/Shell.tsx+++ b/components/Shell.tsx@@ -14,7 +14,7 @@ export default function Shell(props) {useEffect(() => {telemetry.withJitsu((jitsu) => {- return jitsu.track('page_view', {page_url: router.pathname})+ return jitsu.track('page_view', {page_url: router.pathname, page_title: "", source_ip: ""})});}, [telemetry])diff --git a/package.json b/package.jsonindex f881d951f31..6f8c814773b 100644--- a/package.json+++ b/package.json@@ -11,7 +11,7 @@"dependencies": {"@headlessui/react": "^1.0.0","@heroicons/react": "^1.0.1",- "@jitsu/sdk-js": "^2.0.0",+ "@jitsu/sdk-js": "^2.0.1","@prisma/client": "2.21.2","@tailwindcss/forms": "^0.2.1","bcryptjs": "^2.4.3",diff --git a/pages/[user]/[type].tsx b/pages/[user]/[type].tsxindex ec8398eb7b5..c33d0956085 100644--- a/pages/[user]/[type].tsx+++ b/pages/[user]/[type].tsx@@ -68,10 +68,10 @@ export default function Type(props) {for (let i = 1; i <= daysInMonth; i++) {days.push(i);}-+// Create placeholder elements for empty days in first weekconst weekdayOfFirst = dayjs().month(selectedMonth).date(1).day();- const emptyDays = Array(weekdayOfFirst).fill(null).map((day, i) =>+ const emptyDays = Array(weekdayOfFirst).fill(null).map((day, i) =><div key={`e-${i}`} className={"text-center w-10 h-10 rounded-full mx-auto"}>{null}</div>@@ -80,7 +80,7 @@ export default function Type(props) {// Combine placeholder days with actual daysconst calendar = [...emptyDays, ...days.map((day) =><button key={day} onClick={(e) => {- telemetry.withJitsu((jitsu) => jitsu.track('date_selected'))+ telemetry.withJitsu((jitsu) => jitsu.track('date_selected', {page_title: "", source_ip: ""}))setSelectedDate(dayjs().tz(dayjs.tz.guess()).month(selectedMonth).date(day))}} disabled={selectedMonth < parseInt(dayjs().format('MM')) && dayjs().month(selectedMonth).format("D") > day} className={"text-center w-10 h-10 rounded-full mx-auto " + (dayjs().isSameOrBefore(dayjs().date(day).month(selectedMonth)) ? 'bg-blue-50 text-blue-600 font-medium' : 'text-gray-400 font-light') + (dayjs(selectedDate).month(selectedMonth).format("D") == day ? ' bg-blue-600 text-white-important' : '')}>{day}@@ -93,7 +93,7 @@ export default function Type(props) {if (!selectedDate) {return}-+setLoading(true);const res = await fetch(`/api/availability/${user}?dateFrom=${lowerBound.utc().format()}&dateTo=${upperBound.utc().format()}`);const busyTimes = await res.json();diff --git a/pages/[user]/book.tsx b/pages/[user]/book.tsxindex faef74b8d5e..9e270b84e18 100644--- a/pages/[user]/book.tsx+++ b/pages/[user]/book.tsx@@ -12,12 +12,12 @@ export default function Book(props) {const { date, user } = router.query;const telemetry = useTelemetry();useEffect(() => {- telemetry.withJitsu(jitsu => jitsu.track('time_selected'));+ telemetry.withJitsu(jitsu => jitsu.track('time_selected', { page_title: "", source_ip: "" }));})const bookingHandler = event => {event.preventDefault();- telemetry.withJitsu(jitsu => jitsu.track('booking_confirmed'));+ telemetry.withJitsu(jitsu => jitsu.track('booking_confirmed', { page_title: "", source_ip: "" }));const res = fetch('/api/book/' + user,{diff --git a/yarn.lock b/yarn.lockindex 62cb3042f87..35d9f46fd99 100644--- a/yarn.lock+++ b/yarn.lock@@ -155,6 +155,11 @@resolved "https://registry.yarnpkg.com/@heroicons/react/-/react-1.0.1.tgz#66d25f6441920bd5c2146ea27fd33995885452dd"integrity sha512-uikw2gKCmqnvjVxitecWfFLMOKyL9BTFcU4VM3hHj9OMwpkCr5Ke+MRMyY2/aQVmsYs4VTq7NCFX05MYwAHi3g==+"@jitsu/sdk-js@^2.0.1":+ version "2.0.1"+ resolved "https://registry.yarnpkg.com/@jitsu/sdk-js/-/sdk-js-2.0.1.tgz#7b400f314e042236f994f0cac766712320290fe9"+ integrity sha512-PPtbNZosEGZ+rWefYodstAA69eJSHMgWfufqZ1ATiYUrobpbGQsLQBKxI0fJ+YvO1oryfYLlJqgJe0X12vNraQ==+"@next-auth/prisma-legacy-adapter@canary":version "0.0.1-canary.115"resolved "https://registry.yarnpkg.com/@next-auth/prisma-legacy-adapter/-/prisma-legacy-adapter-0.0.1-canary.115.tgz#ef291c865f1ce9d85f660c85b0b0be16bd89c641"@@ -168,11 +173,6 @@crypto-js "^4.0.0"require_optional "^1.0.1"typeorm "^0.2.30"--"@jitsu/sdk-js@^2.0.0":- version "2.0.0"- resolved "https://registry.yarnpkg.com/@jitsu/sdk-js/-/sdk-js-2.0.0.tgz#01ef96c602b3b2aa1e1a4bf87e868f7a5bfe3b35"- integrity sha512-+IQLEbzrIpuXKmP2bLbD7eAdF1WaEcZ2eaSMl6AAwcE0BEFctjNG8QhQYWsMgb+KahNKFz1ARll3aJegkqgrew=="@next/[email protected]":version "10.2.0"