From f097a05c38ccb1355c50fde41648cf1106b78363 Mon Sep 17 00:00:00 2001 From: Ben Arent Date: Wed, 1 Nov 2023 16:54:08 -0700 Subject: [PATCH 1/6] debug posthog data --- components/Feedback/Feedback.tsx | 10 +++++++--- content/12.x | 2 +- content/13.x | 2 +- content/14.x | 2 +- content/15.x | 2 +- utils/posthog.ts | 1 + 6 files changed, 12 insertions(+), 7 deletions(-) diff --git a/components/Feedback/Feedback.tsx b/components/Feedback/Feedback.tsx index b144bed4d0..20ee44c163 100644 --- a/components/Feedback/Feedback.tsx +++ b/components/Feedback/Feedback.tsx @@ -18,7 +18,7 @@ export default function PageWithJSbasedForm(props) { const forwardData = async (data) => { const JSONdata = JSON.stringify(data); const endpoint = "/docs/api/feedback/"; - + console.log("Sending feedback to: " + endpoint); const options = { method: "POST", headers: { @@ -26,11 +26,13 @@ export default function PageWithJSbasedForm(props) { }, body: JSONdata, }; - + console.log("Sending feedback to: " + endpoint); const response = await fetch(endpoint, options); const result = await response.json(); - + console.log(result); + console.log("Feedback sent successfully!"); //Send feedback to posthog + console.log("Sending feedback to PostHog"); void sendDocsFeedback(data.feedback, data.comment); }; @@ -40,6 +42,7 @@ export default function PageWithJSbasedForm(props) { const handleSubmit = async (event: FormEvent) => { event.preventDefault(); + console.log(feedback); const data = { feedback, @@ -60,6 +63,7 @@ export default function PageWithJSbasedForm(props) { const handleFeedbackClick = async (feedbackValue: string) => { let feedback = feedbackValue; + console.log(feedbackValue); setFeedback(feedbackValue); setShowButtons(false); const data = { diff --git a/content/12.x b/content/12.x index 6eb82bdb04..40fae16696 160000 --- a/content/12.x +++ b/content/12.x @@ -1 +1 @@ -Subproject commit 6eb82bdb046ed68ef080c2de28f087dc3e638b75 +Subproject commit 40fae16696910224f8ff33483979c6c8c701d142 diff --git a/content/13.x b/content/13.x index 96cbdac87b..c654dd2ccb 160000 --- a/content/13.x +++ b/content/13.x @@ -1 +1 @@ -Subproject commit 96cbdac87b73e9944072d4dc227f5480b1b66230 +Subproject commit c654dd2ccbbc22db47ef019c6649244ad9fe0aab diff --git a/content/14.x b/content/14.x index 473214eb45..0395991fda 160000 --- a/content/14.x +++ b/content/14.x @@ -1 +1 @@ -Subproject commit 473214eb450361cb068a09af2bca21267a474391 +Subproject commit 0395991fdadcee33dbe52e2b349ef2d7fad8f355 diff --git a/content/15.x b/content/15.x index 50ff9c40c4..b084c7e60f 160000 --- a/content/15.x +++ b/content/15.x @@ -1 +1 @@ -Subproject commit 50ff9c40c48834c6f00b067239a35a09cc448c5f +Subproject commit b084c7e60f7f9185737bb4a53eb4be451bc299aa diff --git a/utils/posthog.ts b/utils/posthog.ts index 8f47892a07..86455c31b6 100644 --- a/utils/posthog.ts +++ b/utils/posthog.ts @@ -42,6 +42,7 @@ export const sendPageview = async () => { export const sendDocsFeedback = async (rating: string, comment: string) => { const ph = await posthog(); + console.log("sendDocsFeedback", rating, comment); ph?.capture("web.docs.feedback", { "web.docs.rating": rating, From 14c8011a418160f57f780d6138b5f555540b0997 Mon Sep 17 00:00:00 2001 From: Ben Arent Date: Thu, 2 Nov 2023 09:49:31 -0700 Subject: [PATCH 2/6] bump posthog-js --- package.json | 2 +- yarn.lock | 11 +++++++++-- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index 9c9ec9c91d..7486ceab7a 100644 --- a/package.json +++ b/package.json @@ -61,7 +61,7 @@ "highlightjs-terraform": "https://github.com/highlightjs/highlightjs-terraform#eb1b9661e143a43dff6b58b391128ce5cdad31d4", "jsdom": "^22.1.0", "next": "13.2.4", - "posthog-js": "^1.57.2", + "posthog-js": "1.88.1", "react": "18.2.0", "react-dom": "18.2.0", "react-use": "^17.3.1", diff --git a/yarn.lock b/yarn.lock index 4b3cfeb3a6..0ee4c2c038 100644 --- a/yarn.lock +++ b/yarn.lock @@ -10620,7 +10620,7 @@ fetch-retry@^5.0.2: fflate@^0.4.1: version "0.4.8" - resolved "https://registry.npmjs.org/fflate/-/fflate-0.4.8.tgz#f90b82aefbd8ac174213abb338bd7ef848f0f5ae" + resolved "https://registry.yarnpkg.com/fflate/-/fflate-0.4.8.tgz#f90b82aefbd8ac174213abb338bd7ef848f0f5ae" integrity sha512-FJqqoDBR00Mdj9ppamLa/Y7vxm+PRmNWA67N846RvsoYVMKB4q3y/de5PA7gUmRMYK/8CMz2GDZQmCRN1wBcWA== figgy-pudding@^3.5.1: @@ -15798,7 +15798,14 @@ postcss@^8.2.14, postcss@^8.4.21, postcss@^8.4.25, postcss@^8.4.31: picocolors "^1.0.0" source-map-js "^1.0.2" -posthog-js@^1.57.2, posthog-js@^1.57.3: +posthog-js@1.88.1: + version "1.88.1" + resolved "https://registry.yarnpkg.com/posthog-js/-/posthog-js-1.88.1.tgz#ab81f21ec158a9c57be0e696744a9c9f6967ba3b" + integrity sha512-+8kFFU5KIcFSm8zB3tX8l0GSPyq/OtMtdrS9dYpMJk6nsEwXvOjkwFEpSrYzL5eGEpTPdbM65M52HvMqqsjpXw== + dependencies: + fflate "^0.4.1" + +posthog-js@^1.57.3: version "1.72.2" resolved "https://registry.npmjs.org/posthog-js/-/posthog-js-1.72.2.tgz#8330bf740b0dda84156816628fe27e4e10a07eeb" integrity sha512-de/AMQ2zgXeEnvMGBrT746VFmvo95Zo+0pqiXc0xwlQPgwDyyxwGgHXBRKRNl5yDGDZ/Nvb2R64Jc+QwV9YYXw== From e2ccca67898c98cbd45b26cfd1db5974db754a5c Mon Sep 17 00:00:00 2001 From: Ben Arent Date: Thu, 2 Nov 2023 15:34:44 -0700 Subject: [PATCH 3/6] Match version with deployed Posthog instance --- package.json | 2 +- yarn.lock | 20 ++++++++++++++++---- 2 files changed, 17 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index 7486ceab7a..b9352da138 100644 --- a/package.json +++ b/package.json @@ -61,7 +61,7 @@ "highlightjs-terraform": "https://github.com/highlightjs/highlightjs-terraform#eb1b9661e143a43dff6b58b391128ce5cdad31d4", "jsdom": "^22.1.0", "next": "13.2.4", - "posthog-js": "1.88.1", + "posthog-js": "1.43.0", "react": "18.2.0", "react-dom": "18.2.0", "react-use": "^17.3.1", diff --git a/yarn.lock b/yarn.lock index 0ee4c2c038..87d9828ee5 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5311,6 +5311,11 @@ "@sentry/types" "7.59.3" "@sentry/utils" "7.59.3" +"@sentry/types@7.22.0": + version "7.22.0" + resolved "https://registry.yarnpkg.com/@sentry/types/-/types-7.22.0.tgz#58e4ce77b523048e0f31e2ea4b597946d76f6079" + integrity sha512-LhCL+wb1Jch+OesB2CIt6xpfO1Ab6CRvoNYRRzVumWPLns1T3ZJkarYfhbLaOEIb38EIbPgREdxn2AJT560U4Q== + "@sentry/types@7.59.3": version "7.59.3" resolved "https://registry.npmjs.org/@sentry/types/-/types-7.59.3.tgz#a3025d05f575b5a6d264b51e5db54470b3c8b922" @@ -15798,12 +15803,14 @@ postcss@^8.2.14, postcss@^8.4.21, postcss@^8.4.25, postcss@^8.4.31: picocolors "^1.0.0" source-map-js "^1.0.2" -posthog-js@1.88.1: - version "1.88.1" - resolved "https://registry.yarnpkg.com/posthog-js/-/posthog-js-1.88.1.tgz#ab81f21ec158a9c57be0e696744a9c9f6967ba3b" - integrity sha512-+8kFFU5KIcFSm8zB3tX8l0GSPyq/OtMtdrS9dYpMJk6nsEwXvOjkwFEpSrYzL5eGEpTPdbM65M52HvMqqsjpXw== +posthog-js@1.43.0: + version "1.43.0" + resolved "https://registry.yarnpkg.com/posthog-js/-/posthog-js-1.43.0.tgz#fb3f97c5687f986450f1dd3227f94b07005eb05c" + integrity sha512-zAGHF8GN0YOLGkFe6pUmtcO+JpdqJiNKsN3D7NyXlam2U2x9w24QHt6uO4xJwfHPDWgpzXFnzZyQZFrVyqPStA== dependencies: + "@sentry/types" "7.22.0" fflate "^0.4.1" + rrweb-snapshot "^1.1.14" posthog-js@^1.57.3: version "1.72.2" @@ -17580,6 +17587,11 @@ rrweb-cssom@^0.6.0: resolved "https://registry.npmjs.org/rrweb-cssom/-/rrweb-cssom-0.6.0.tgz#ed298055b97cbddcdeb278f904857629dec5e0e1" integrity sha512-APM0Gt1KoXBz0iIkkdB/kfvGOwC4UuJFeG/c+yV7wSc7q96cG/kJ0HiYCnzivD9SB53cLV1MlHFNfOuPaadYSw== +rrweb-snapshot@^1.1.14: + version "1.1.14" + resolved "https://registry.yarnpkg.com/rrweb-snapshot/-/rrweb-snapshot-1.1.14.tgz#9d4d9be54a28a893373428ee4393ec7e5bd83fcc" + integrity sha512-eP5pirNjP5+GewQfcOQY4uBiDnpqxNRc65yKPW0eSoU1XamDfc4M8oqpXGMyUyvLyxFDB0q0+DChuxxiU2FXBQ== + rtl-css-js@^1.14.0: version "1.16.1" resolved "https://registry.npmjs.org/rtl-css-js/-/rtl-css-js-1.16.1.tgz#4b48b4354b0ff917a30488d95100fbf7219a3e80" From 2b1dfdfcef1d721b347bcf6057a6976f5f33c895 Mon Sep 17 00:00:00 2001 From: Ben Arent Date: Thu, 2 Nov 2023 15:39:51 -0700 Subject: [PATCH 4/6] bump to 1.88.1 --- package.json | 2 +- yarn.lock | 20 ++++---------------- 2 files changed, 5 insertions(+), 17 deletions(-) diff --git a/package.json b/package.json index b9352da138..7486ceab7a 100644 --- a/package.json +++ b/package.json @@ -61,7 +61,7 @@ "highlightjs-terraform": "https://github.com/highlightjs/highlightjs-terraform#eb1b9661e143a43dff6b58b391128ce5cdad31d4", "jsdom": "^22.1.0", "next": "13.2.4", - "posthog-js": "1.43.0", + "posthog-js": "1.88.1", "react": "18.2.0", "react-dom": "18.2.0", "react-use": "^17.3.1", diff --git a/yarn.lock b/yarn.lock index 87d9828ee5..0ee4c2c038 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5311,11 +5311,6 @@ "@sentry/types" "7.59.3" "@sentry/utils" "7.59.3" -"@sentry/types@7.22.0": - version "7.22.0" - resolved "https://registry.yarnpkg.com/@sentry/types/-/types-7.22.0.tgz#58e4ce77b523048e0f31e2ea4b597946d76f6079" - integrity sha512-LhCL+wb1Jch+OesB2CIt6xpfO1Ab6CRvoNYRRzVumWPLns1T3ZJkarYfhbLaOEIb38EIbPgREdxn2AJT560U4Q== - "@sentry/types@7.59.3": version "7.59.3" resolved "https://registry.npmjs.org/@sentry/types/-/types-7.59.3.tgz#a3025d05f575b5a6d264b51e5db54470b3c8b922" @@ -15803,14 +15798,12 @@ postcss@^8.2.14, postcss@^8.4.21, postcss@^8.4.25, postcss@^8.4.31: picocolors "^1.0.0" source-map-js "^1.0.2" -posthog-js@1.43.0: - version "1.43.0" - resolved "https://registry.yarnpkg.com/posthog-js/-/posthog-js-1.43.0.tgz#fb3f97c5687f986450f1dd3227f94b07005eb05c" - integrity sha512-zAGHF8GN0YOLGkFe6pUmtcO+JpdqJiNKsN3D7NyXlam2U2x9w24QHt6uO4xJwfHPDWgpzXFnzZyQZFrVyqPStA== +posthog-js@1.88.1: + version "1.88.1" + resolved "https://registry.yarnpkg.com/posthog-js/-/posthog-js-1.88.1.tgz#ab81f21ec158a9c57be0e696744a9c9f6967ba3b" + integrity sha512-+8kFFU5KIcFSm8zB3tX8l0GSPyq/OtMtdrS9dYpMJk6nsEwXvOjkwFEpSrYzL5eGEpTPdbM65M52HvMqqsjpXw== dependencies: - "@sentry/types" "7.22.0" fflate "^0.4.1" - rrweb-snapshot "^1.1.14" posthog-js@^1.57.3: version "1.72.2" @@ -17587,11 +17580,6 @@ rrweb-cssom@^0.6.0: resolved "https://registry.npmjs.org/rrweb-cssom/-/rrweb-cssom-0.6.0.tgz#ed298055b97cbddcdeb278f904857629dec5e0e1" integrity sha512-APM0Gt1KoXBz0iIkkdB/kfvGOwC4UuJFeG/c+yV7wSc7q96cG/kJ0HiYCnzivD9SB53cLV1MlHFNfOuPaadYSw== -rrweb-snapshot@^1.1.14: - version "1.1.14" - resolved "https://registry.yarnpkg.com/rrweb-snapshot/-/rrweb-snapshot-1.1.14.tgz#9d4d9be54a28a893373428ee4393ec7e5bd83fcc" - integrity sha512-eP5pirNjP5+GewQfcOQY4uBiDnpqxNRc65yKPW0eSoU1XamDfc4M8oqpXGMyUyvLyxFDB0q0+DChuxxiU2FXBQ== - rtl-css-js@^1.14.0: version "1.16.1" resolved "https://registry.npmjs.org/rtl-css-js/-/rtl-css-js-1.16.1.tgz#4b48b4354b0ff917a30488d95100fbf7219a3e80" From 07ed40a739319a08e8f0bb2876f983b5fe4e34a6 Mon Sep 17 00:00:00 2001 From: Ben Arent Date: Thu, 2 Nov 2023 16:09:58 -0700 Subject: [PATCH 5/6] Clean up console log spam --- components/Feedback/Feedback.tsx | 9 +++------ utils/posthog.ts | 1 - 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/components/Feedback/Feedback.tsx b/components/Feedback/Feedback.tsx index 20ee44c163..4e7bc3a10d 100644 --- a/components/Feedback/Feedback.tsx +++ b/components/Feedback/Feedback.tsx @@ -18,7 +18,7 @@ export default function PageWithJSbasedForm(props) { const forwardData = async (data) => { const JSONdata = JSON.stringify(data); const endpoint = "/docs/api/feedback/"; - console.log("Sending feedback to: " + endpoint); + const options = { method: "POST", headers: { @@ -26,13 +26,11 @@ export default function PageWithJSbasedForm(props) { }, body: JSONdata, }; - console.log("Sending feedback to: " + endpoint); + const response = await fetch(endpoint, options); const result = await response.json(); - console.log(result); - console.log("Feedback sent successfully!"); + //Send feedback to posthog - console.log("Sending feedback to PostHog"); void sendDocsFeedback(data.feedback, data.comment); }; @@ -63,7 +61,6 @@ export default function PageWithJSbasedForm(props) { const handleFeedbackClick = async (feedbackValue: string) => { let feedback = feedbackValue; - console.log(feedbackValue); setFeedback(feedbackValue); setShowButtons(false); const data = { diff --git a/utils/posthog.ts b/utils/posthog.ts index 86455c31b6..8f47892a07 100644 --- a/utils/posthog.ts +++ b/utils/posthog.ts @@ -42,7 +42,6 @@ export const sendPageview = async () => { export const sendDocsFeedback = async (rating: string, comment: string) => { const ph = await posthog(); - console.log("sendDocsFeedback", rating, comment); ph?.capture("web.docs.feedback", { "web.docs.rating": rating, From d33e865a8daeab36f46540d934c44fc2025b905c Mon Sep 17 00:00:00 2001 From: Ben Arent Date: Fri, 3 Nov 2023 08:54:24 -0700 Subject: [PATCH 6/6] remove console log --- components/Feedback/Feedback.tsx | 1 - content/12.x | 2 +- content/13.x | 2 +- content/14.x | 2 +- 4 files changed, 3 insertions(+), 4 deletions(-) diff --git a/components/Feedback/Feedback.tsx b/components/Feedback/Feedback.tsx index 4e7bc3a10d..b144bed4d0 100644 --- a/components/Feedback/Feedback.tsx +++ b/components/Feedback/Feedback.tsx @@ -40,7 +40,6 @@ export default function PageWithJSbasedForm(props) { const handleSubmit = async (event: FormEvent) => { event.preventDefault(); - console.log(feedback); const data = { feedback, diff --git a/content/12.x b/content/12.x index 40fae16696..6eb82bdb04 160000 --- a/content/12.x +++ b/content/12.x @@ -1 +1 @@ -Subproject commit 40fae16696910224f8ff33483979c6c8c701d142 +Subproject commit 6eb82bdb046ed68ef080c2de28f087dc3e638b75 diff --git a/content/13.x b/content/13.x index c654dd2ccb..96cbdac87b 160000 --- a/content/13.x +++ b/content/13.x @@ -1 +1 @@ -Subproject commit c654dd2ccbbc22db47ef019c6649244ad9fe0aab +Subproject commit 96cbdac87b73e9944072d4dc227f5480b1b66230 diff --git a/content/14.x b/content/14.x index 0395991fda..473214eb45 160000 --- a/content/14.x +++ b/content/14.x @@ -1 +1 @@ -Subproject commit 0395991fdadcee33dbe52e2b349ef2d7fad8f355 +Subproject commit 473214eb450361cb068a09af2bca21267a474391