From 222947292b7da4ad7156273a44f17c70f54bb85e Mon Sep 17 00:00:00 2001 From: Luke Vella Date: Tue, 1 Aug 2023 21:27:20 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=93=A2=20Add=20Featurebase=20(#796)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 13 +- apps/landing/src/pages/privacy-policy.tsx | 18 ++- apps/web/public/locales/en/app.json | 12 +- apps/web/src/components/featurebase.tsx | 44 ++++++ apps/web/src/components/feedback.tsx | 166 +++++++++------------- assets/images/featurebase.svg | 16 +++ packages/backend/trpc/routers/feedback.ts | 37 ----- packages/backend/trpc/routers/index.ts | 2 - 8 files changed, 151 insertions(+), 157 deletions(-) create mode 100644 apps/web/src/components/featurebase.tsx create mode 100644 assets/images/featurebase.svg delete mode 100644 packages/backend/trpc/routers/feedback.ts diff --git a/README.md b/README.md index 9dabeef58..de35c56b4 100644 --- a/README.md +++ b/README.md @@ -89,13 +89,14 @@ Thank you to our sponsors for making this project possible. [Become a sponsor →](https://github.com/sponsors/lukevella) -This project is also supported by the following companies through their open-source sponsorships. +And thank you to these companies for sponsoring and showing support for this project. -appwrite +appwrite     -Powered by Vercel +Powered by Vercel     -Digital Ocean +Digital Ocean     -Sentry    -Cloudron +Sentry    +Cloudron    +Featurebase diff --git a/apps/landing/src/pages/privacy-policy.tsx b/apps/landing/src/pages/privacy-policy.tsx index 3a137aa55..b175d54f1 100644 --- a/apps/landing/src/pages/privacy-policy.tsx +++ b/apps/landing/src/pages/privacy-policy.tsx @@ -9,7 +9,7 @@ const PrivacyPolicy = () => {

Privacy Policy

-

Last updated: 19 April 2023

+

Last updated: 1 August 2023

At rallly.co, we take your privacy seriously. This privacy policy explains how we collect, use, and disclose your personal data, and @@ -66,10 +66,18 @@ const PrivacyPolicy = () => {

Sharing of personal data

- We do not share your personal data with third parties, except for our - data processor, Posthog, which is based in the United States. We have - implemented appropriate safeguards to protect your personal data when - it is transferred outside of the European Economic Area. + We do not share your personal data with any third parties for + marketing or commercial purposes. We may share your personal data with + third parties to provide you with our services, to comply with + applicable laws and regulations, to respond to a subpoena, search + warrant or other lawful request for information we receive, or to + otherwise protect our rights. +

+ +

+ For example, we use Featurebase to make it easy for users to submit + feedback. Your name and email may be shared with Featurbase to provide + a seamless transition between the two services.

Your rights

diff --git a/apps/web/public/locales/en/app.json b/apps/web/public/locales/en/app.json index 5969d960b..46269b3bd 100644 --- a/apps/web/public/locales/en/app.json +++ b/apps/web/public/locales/en/app.json @@ -10,7 +10,6 @@ "settings": "Settings", "changeNameDescription": "Enter a new name for this participant.", "changeNameInfo": "This will not affect any votes you have already made.", - "close": "Close", "comments": "Comments", "continue": "Continue", "copied": "Copied", @@ -36,11 +35,6 @@ "emailPlaceholder": "jessie.smith@example.com", "expiredOrInvalidLink": "This link is expired or invalid. Please request a new link.", "exportToCsv": "Export to CSV", - "feedbackFormFooter": "Need help? Visit the support page.", - "feedbackFormLabel": "How can we improve ?", - "feedbackFormPlaceholder": "Share your thoughts…", - "feedbackFormTitle": "Feedback Form", - "feedbackSent": "Thank you! Your feedback has been sent.", "forgetMe": "Forget me", "guest": "Guest", "ifNeedBe": "If need be", @@ -76,7 +70,6 @@ "response": "Response", "save": "Save", "saveInstruction": "Select your availability and click {action}", - "send": "Send", "sendFeedback": "Send Feedback", "specifyTimes": "Specify times", "specifyTimesDescription": "Include start and end times for each option", @@ -213,5 +206,8 @@ "disableCommentsDescription": "Remove the option to leave a comment on the poll", "planCustomizablePollSettings": "Customizable poll settings", "clockPreferences": "Clock Preferences", - "clockPreferencesDescription": "Set your preferred time zone and time format." + "clockPreferencesDescription": "Set your preferred time zone and time format.", + "featureRequest": "Request a Feature", + "bugReport": "Report an Issue", + "getSupport": "Get Support" } diff --git a/apps/web/src/components/featurebase.tsx b/apps/web/src/components/featurebase.tsx new file mode 100644 index 000000000..3bba4e59b --- /dev/null +++ b/apps/web/src/components/featurebase.tsx @@ -0,0 +1,44 @@ +import Script from "next/script"; +import React from "react"; + +import { useUser } from "@/components/user-provider"; + +export const FeaturebaseProvider = ({ children }: React.PropsWithChildren) => { + const { user } = useUser(); + + React.useEffect(() => { + if (user.isGuest) return; + // eslint-disable-next-line @typescript-eslint/no-explicit-any + const win = window as any; + + if (typeof win.Featurebase !== "function") { + win.Featurebase = function () { + // eslint-disable-next-line prefer-rest-params + (win.Featurebase.q = win.Featurebase.q || []).push(arguments); + }; + } + win.Featurebase( + "identify", + { + organization: "rallly", + + // Required. Replace with your customers data. + email: user.email, + name: user.name, + id: user.id, + }, + (err: Error) => { + // Callback function. Called when identify completed. + if (err) { + console.error(err); + } + }, + ); + }, [user]); + return ( + <> +