chore: prepare 2.2 launch (#2783)

This commit is contained in:
Matti Nannt
2024-06-19 17:16:57 +02:00
committed by GitHub
parent 83ff98cd3a
commit 5e7fe96ef6
25 changed files with 1732 additions and 1699 deletions
+2 -2
View File
@@ -37,8 +37,8 @@
"@formbricks/config-typescript": "workspace:*",
"@formbricks/types": "workspace:*",
"@formbricks/eslint-config": "workspace:*",
"terser": "^5.31.0",
"vite": "^5.2.11",
"terser": "^5.31.1",
"vite": "^5.3.1",
"vite-plugin-dts": "^3.9.1"
}
}
+7 -7
View File
@@ -3,14 +3,14 @@
"version": "0.0.0",
"private": true,
"devDependencies": {
"@next/eslint-plugin-next": "^14.2.3",
"@typescript-eslint/eslint-plugin": "^7.10.0",
"@typescript-eslint/parser": "^7.10.0",
"@vercel/style-guide": "^5.2.0",
"eslint-config-next": "^14.2.3",
"@next/eslint-plugin-next": "^14.2.4",
"@typescript-eslint/eslint-plugin": "^7.13.1",
"@typescript-eslint/parser": "^7.13.1",
"@vercel/style-guide": "^6.0.0",
"eslint-config-next": "^14.2.4",
"eslint-config-prettier": "^9.1.0",
"eslint-config-turbo": "^2.0.0",
"eslint-plugin-react": "7.34.1",
"eslint-config-turbo": "^2.0.4",
"eslint-plugin-react": "7.34.3",
"eslint-plugin-react-hooks": "^4.6.2",
"eslint-plugin-react-refresh": "^0.4.7"
}
+2 -2
View File
@@ -8,7 +8,7 @@
},
"devDependencies": {
"@trivago/prettier-plugin-sort-imports": "^4.3.0",
"prettier": "^3.2.5",
"prettier-plugin-tailwindcss": "^0.5.14"
"prettier": "^3.3.2",
"prettier-plugin-tailwindcss": "^0.6.5"
}
}
+1 -1
View File
@@ -11,6 +11,6 @@
"@tailwindcss/typography": "^0.5.13",
"autoprefixer": "^10.4.19",
"postcss": "^8.4.38",
"tailwindcss": "^3.4.3"
"tailwindcss": "^3.4.4"
}
}
+1 -1
View File
@@ -7,7 +7,7 @@
"clean": "rimraf node_modules dist turbo"
},
"devDependencies": {
"@types/node": "20.12.12",
"@types/node": "20.14.5",
"@types/react": "18.3.3",
"@types/react-dom": "18.3.0",
"typescript": "5.4.5"
+5 -4
View File
@@ -37,11 +37,12 @@
"data-migration:extended-noCodeActions": "ts-node ./data-migrations/20240524053239_extends_no_code_action_schema/data-migration.ts",
"data-migration:v2.1": "pnpm data-migration:extended-noCodeActions",
"data-migration:adds_app_and_website_status_indicator": "ts-node ./data-migrations/20240610055828_adds_app_and_website_status_indicators/data-migration.ts",
"data-migration:product-config": "ts-node ./data-migrations/20240612115151_adds_product_config/data-migration.ts"
"data-migration:product-config": "ts-node ./data-migrations/20240612115151_adds_product_config/data-migration.ts",
"data-migration:v2.2": "pnpm data-migration:adds_app_and_website_status_indicator && pnpm data-migration:product-config"
},
"dependencies": {
"@prisma/client": "^5.14.0",
"@prisma/extension-accelerate": "^1.0.0",
"@prisma/client": "^5.15.1",
"@prisma/extension-accelerate": "^1.1.0",
"dotenv-cli": "^7.4.2"
},
"devDependencies": {
@@ -49,7 +50,7 @@
"@formbricks/types": "workspace:*",
"@paralleldrive/cuid2": "^2.2.2",
"@formbricks/eslint-config": "workspace:*",
"prisma": "^5.14.0",
"prisma": "^5.15.1",
"prisma-dbml-generator": "^0.12.0",
"prisma-json-types-generator": "^3.0.4",
"ts-node": "^10.9.2",
+4 -4
View File
@@ -25,14 +25,14 @@
"@paralleldrive/cuid2": "^2.2.2",
"@radix-ui/react-collapsible": "^1.0.3",
"https-proxy-agent": "^7.0.4",
"lucide-react": "^0.390.0",
"next": "^14.2.3",
"lucide-react": "^0.395.0",
"next": "^14.2.4",
"next-auth": "^4.24.7",
"node-fetch": "^3.3.2",
"react-hook-form": "^7.51.5",
"react-hook-form": "^7.52.0",
"react-hot-toast": "^2.4.1",
"server-only": "^0.0.1",
"stripe": "^15.8.0",
"stripe": "^15.12.0",
"zod": "^3.23.8"
}
}
@@ -38,7 +38,7 @@ export function PreviewEmailTemplate({ survey, surveyUrl, styling }: PreviewEmai
const defaultLanguageCode = "default";
const firstQuestion = survey.questions[0];
const brandColor = styling.brandColor?.light || COLOR_DEFAULTS.brandColor;
const brandColor = styling.brandColor?.light ?? COLOR_DEFAULTS.brandColor;
switch (firstQuestion.type) {
case TSurveyQuestionTypeEnum.OpenText:
@@ -109,7 +109,7 @@ export function PreviewEmailTemplate({ survey, surveyUrl, styling }: PreviewEmai
{Array.from({ length: 11 }, (_, i) => (
<EmailButton
className="border-input-border-color m-0 inline-flex h-10 w-10 items-center justify-center border p-0 text-slate-800"
href={`${urlWithPrefilling}${firstQuestion.id}=${i}`}
href={`${urlWithPrefilling}${firstQuestion.id}=${i.toString()}`}
key={i}>
{i}
</EmailButton>
@@ -137,7 +137,7 @@ export function PreviewEmailTemplate({ survey, surveyUrl, styling }: PreviewEmai
case TSurveyQuestionTypeEnum.CTA:
return (
<EmailTemplateWrapper styling={styling} surveyUrl={url}>
<Text className="text-question-color m-0 block text-base font-semibold leading-6">
<Text className="text-question-color m-0 block text-base font-semibold leading-6">
{getLocalizedValue(firstQuestion.headline, defaultLanguageCode)}
</Text>
<Container className="text-question-color ml-0 mt-2 text-sm font-normal leading-6">
@@ -193,7 +193,7 @@ export function PreviewEmailTemplate({ survey, surveyUrl, styling }: PreviewEmai
"border border-solid border-gray-200": firstQuestion.scale === "number",
}
)}
href={`${urlWithPrefilling}${firstQuestion.id}=${i + 1}`}
href={`${urlWithPrefilling}${firstQuestion.id}=${(i + 1).toString()}`}
key={i}>
{firstQuestion.scale === "smiley" && (
<RatingSmiley active={false} idx={i} range={firstQuestion.range} />
@@ -214,7 +214,7 @@ export function PreviewEmailTemplate({ survey, surveyUrl, styling }: PreviewEmai
</Text>
</Column>
<Column className="text-right">
<Text className="m-0 inline-block p-0 text-right">
<Text className="m-0 inline-block p-0 text-right">
{getLocalizedValue(firstQuestion.upperLabel, defaultLanguageCode)}
</Text>
</Column>
@@ -311,7 +311,7 @@ export function PreviewEmailTemplate({ survey, surveyUrl, styling }: PreviewEmai
</Text>
<EmailButton
className={cn(
"bg-brand-color rounded-custom mx-auto block w-max cursor-pointer appearance-none px-6 py-3 text-sm font-medium ",
"bg-brand-color rounded-custom mx-auto block w-max cursor-pointer appearance-none px-6 py-3 text-sm font-medium",
isLight(brandColor) ? "text-black" : "text-white"
)}>
Schedule your meeting
@@ -54,7 +54,7 @@ interface ResponseFinishedEmailProps {
response: TResponse;
WEBAPP_URL: string;
environmentId: string;
organization: TOrganization | null;
organization: TOrganization;
}
export function ResponseFinishedEmail({
@@ -92,7 +92,7 @@ export function ResponseFinishedEmail({
href={`${WEBAPP_URL}/environments/${environmentId}/surveys/${survey.id}/responses?utm_source=email_notification&utm_medium=email&utm_content=view_responses_CTA`}
label={
responseCount > 1
? `View ${responseCount - 1} more ${responseCount === 2 ? "response" : "responses"}`
? `View ${String(responseCount - 1).toString()} more ${responseCount === 2 ? "response" : "responses"}`
: `View survey summary`
}
/>
@@ -111,7 +111,7 @@ export function ResponseFinishedEmail({
Turn off notifications for{" "}
<Link
className="text-black underline"
href={`${WEBAPP_URL}/environments/${environmentId}/settings/notifications?type=unsubscribedOrganizationIds&elementId=${organization?.id}`}>
href={`${WEBAPP_URL}/environments/${environmentId}/settings/notifications?type=unsubscribedOrganizationIds&elementId=${organization.id}`}>
all newly created forms{" "}
</Link>
</Text>
@@ -13,7 +13,7 @@ const getButtonLabel = (count: number): string => {
if (count === 1) {
return "View Response";
}
return `View ${count > 2 ? count - 1 : "1"} more Response${count > 2 ? "s" : ""}`;
return `View ${count > 2 ? (count - 1).toString() : "1"} more Response${count > 2 ? "s" : ""}`;
};
const convertSurveyStatus = (status: TSurveyStatus): string => {
@@ -51,7 +51,7 @@ export const LiveSurveyNotification = ({ environmentId, surveys }: LiveSurveyNot
}
surveyFields.push(
<Container className="mt-4" key={`${index}-${surveyResponse.headline}`}>
<Container className="mt-4" key={`${index.toString()}-${surveyResponse.headline}`}>
<Text className="m-0">{surveyResponse.headline}</Text>
{renderEmailResponseValue(surveyResponse.responseValue, surveyResponse.questionType)}
</Container>
@@ -59,7 +59,7 @@ export const LiveSurveyNotification = ({ environmentId, surveys }: LiveSurveyNot
// Add <hr/> only when there are 2 or more responses to display, and it's not the last response
if (responseCount >= 2 && index < responseCount - 1) {
surveyFields.push(<Hr key={`hr-${index}`} />);
surveyFields.push(<Hr key={`hr-${index.toString()}`} />);
}
});
+22 -16
View File
@@ -61,8 +61,6 @@ const getEmailSubject = (productName: string): string => {
return `${productName} User Insights - Last Week by Formbricks`;
};
const monthNames = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"];
export const sendEmail = async (emailData: SendEmailDataProps) => {
if (IS_SMTP_CONFIGURED) {
const transporter = nodemailer.createTransport({
@@ -77,7 +75,7 @@ export const sendEmail = async (emailData: SendEmailDataProps) => {
debug: DEBUG,
} as SMTPTransport.Options);
const emailDefaults = {
from: `Formbricks <${MAIL_FROM || "noreply@formbricks.com"}>`,
from: `Formbricks <${MAIL_FROM ?? "noreply@formbricks.com"}>`,
};
await transporter.sendMail({ ...emailDefaults, ...emailData });
} else {
@@ -170,12 +168,16 @@ export const sendResponseFinishedEmail = async (
const personEmail = response.personAttributes?.email;
const organization = await getOrganizationByEnvironmentId(environmentId);
if (!organization) {
throw new Error("Organization not found");
}
await sendEmail({
to: email,
subject: personEmail
? `${personEmail} just completed your ${survey.name} survey ✅`
: `A response for ${survey.name} was completed ✅`,
replyTo: personEmail?.toString() || MAIL_FROM,
replyTo: personEmail?.toString() ?? MAIL_FROM,
html: render(
EmailTemplate({
content: ResponseFinishedEmail({
@@ -227,12 +229,14 @@ export const sendWeeklySummaryNotificationEmail = async (
email: string,
notificationData: TWeeklySummaryNotificationResponse
) => {
const startDate = `${notificationData.lastWeekDate.getDate()} ${
monthNames[notificationData.lastWeekDate.getMonth()]
}`;
const endDate = `${notificationData.currentDate.getDate()} ${
monthNames[notificationData.currentDate.getMonth()]
}`;
const startDate = `${notificationData.lastWeekDate.getDate().toString()} ${notificationData.lastWeekDate.toLocaleString(
"default",
{ month: "short" }
)}`;
const endDate = `${notificationData.currentDate.getDate().toString()} ${notificationData.currentDate.toLocaleString(
"default",
{ month: "short" }
)}`;
const startYear = notificationData.lastWeekDate.getFullYear();
const endYear = notificationData.currentDate.getFullYear();
await sendEmail({
@@ -256,12 +260,14 @@ export const sendNoLiveSurveyNotificationEmail = async (
email: string,
notificationData: TWeeklySummaryNotificationResponse
) => {
const startDate = `${notificationData.lastWeekDate.getDate()} ${
monthNames[notificationData.lastWeekDate.getMonth()]
}`;
const endDate = `${notificationData.currentDate.getDate()} ${
monthNames[notificationData.currentDate.getMonth()]
}`;
const startDate = `${notificationData.lastWeekDate.getDate().toString()} ${notificationData.lastWeekDate.toLocaleString(
"default",
{ month: "short" }
)}`;
const endDate = `${notificationData.currentDate.getDate().toString()} ${notificationData.currentDate.toLocaleString(
"default",
{ month: "short" }
)}`;
const startYear = notificationData.lastWeekDate.getFullYear();
const endYear = notificationData.currentDate.getFullYear();
await sendEmail({
+1 -1
View File
@@ -14,7 +14,7 @@
"@formbricks/ui": "workspace:*",
"@react-email/components": "^0.0.19",
"@react-email/render": "^0.0.15",
"lucide-react": "^0.390.0",
"lucide-react": "^0.395.0",
"nodemailer": "^6.9.13",
"react-email": "^2.1.4"
},
+2 -2
View File
@@ -59,8 +59,8 @@
"@formbricks/config-typescript": "workspace:*",
"@formbricks/types": "workspace:*",
"@formbricks/eslint-config": "workspace:*",
"terser": "^5.31.0",
"vite": "^5.2.11",
"terser": "^5.31.1",
"vite": "^5.3.1",
"vite-plugin-dts": "^3.9.1"
}
}
+2 -2
View File
@@ -54,8 +54,8 @@
"@formbricks/js-core": "workspace:*",
"@formbricks/config-typescript": "workspace:*",
"@formbricks/eslint-config": "workspace:*",
"terser": "^5.31.0",
"vite": "^5.2.11",
"terser": "^5.31.1",
"vite": "^5.3.1",
"vite-plugin-dts": "^3.9.1"
}
}
+4 -4
View File
@@ -14,16 +14,16 @@
"test": "dotenv -e ../../.env -- vitest run"
},
"dependencies": {
"@aws-sdk/client-s3": "3.583.0",
"@aws-sdk/s3-presigned-post": "3.583.0",
"@aws-sdk/s3-request-presigner": "3.583.0",
"@aws-sdk/client-s3": "3.600.0",
"@aws-sdk/s3-presigned-post": "3.600.0",
"@aws-sdk/s3-request-presigner": "3.600.0",
"@formbricks/api": "*",
"@formbricks/database": "*",
"@formbricks/types": "*",
"@paralleldrive/cuid2": "^2.2.2",
"@t3-oss/env-nextjs": "^0.10.1",
"@ungap/structured-clone": "^1.2.0",
"aws-crt": "^1.21.2",
"aws-crt": "^1.21.3",
"date-fns": "^3.6.0",
"jsonwebtoken": "^9.0.2",
"markdown-it": "^14.1.0",
+4 -4
View File
@@ -44,14 +44,14 @@
"autoprefixer": "^10.4.19",
"concurrently": "8.2.2",
"@formbricks/eslint-config": "workspace:*",
"isomorphic-dompurify": "^2.11.0",
"isomorphic-dompurify": "^2.12.0",
"postcss": "^8.4.38",
"preact": "^10.22.0",
"react-date-picker": "^11.0.0",
"serve": "14.2.3",
"tailwindcss": "^3.4.3",
"terser": "^5.31.0",
"vite": "^5.2.11",
"tailwindcss": "^3.4.4",
"terser": "^5.31.1",
"vite": "^5.3.1",
"vite-plugin-dts": "^3.9.1",
"vite-tsconfig-paths": "^4.3.2"
}
+9 -9
View File
@@ -20,13 +20,13 @@
"@formbricks/database": "workspace:*",
"@formbricks/lib": "workspace:*",
"@formbricks/surveys": "workspace:*",
"@lexical/code": "^0.15.0",
"@lexical/link": "^0.15.0",
"@lexical/list": "^0.15.0",
"@lexical/markdown": "^0.15.0",
"@lexical/react": "^0.15.0",
"@lexical/rich-text": "^0.15.0",
"@lexical/table": "^0.15.0",
"@lexical/code": "^0.16.0",
"@lexical/link": "^0.16.0",
"@lexical/list": "^0.16.0",
"@lexical/markdown": "^0.16.0",
"@lexical/react": "^0.16.0",
"@lexical/rich-text": "^0.16.0",
"@lexical/table": "^0.16.0",
"@radix-ui/react-accordion": "^1.1.2",
"@radix-ui/react-checkbox": "^1.0.4",
"@radix-ui/react-dialog": "^1.0.5",
@@ -42,8 +42,8 @@
"class-variance-authority": "^0.7.0",
"clsx": "^2.1.1",
"cmdk": "^1.0.0",
"lexical": "^0.15.0",
"lucide-react": "^0.379.0",
"lexical": "^0.16.0",
"lucide-react": "^0.395.0",
"mime": "^4.0.3",
"react-colorful": "^5.6.1",
"react-confetti": "^6.1.0",