fix: final bugs in release 2.5 (#3084)

This commit is contained in:
Piyush Gupta
2024-09-03 17:52:28 +05:30
committed by GitHub
parent 492729baf3
commit a1d83ac7b9
3 changed files with 13 additions and 1 deletions

View File

@@ -94,7 +94,7 @@ docker pull ghcr.io/formbricks/data-migrations:latest && \
docker run --rm \
--network=formbricks_default \
-e DATABASE_URL="postgresql://postgres:postgres@postgres:5432/formbricks?schema=public" \
-e UPGRADE_TO_VERSION="v2.4" \
-e UPGRADE_TO_VERSION="v2.5" \
ghcr.io/formbricks/data-migrations:latest
```

View File

@@ -1,3 +1,5 @@
/* eslint-disable @typescript-eslint/restrict-template-expressions -- using template strings for logging */
/* eslint-disable no-console -- logging is allowed in migration scripts */
import { PrismaClient } from "@prisma/client";
import { type TSurveyQuestion, TSurveyQuestionTypeEnum } from "@formbricks/types/surveys/types";
@@ -69,6 +71,8 @@ async function runMigration(): Promise<void> {
await Promise.all(migrationPromises);
console.log(`Updated ${migrationPromises.length} questions in ${relevantSurveys.length} surveys`);
const endTime = Date.now();
console.log(`Data migration completed. Total time: ${((endTime - startTime) / 1000).toString()}s`);
},

View File

@@ -35,6 +35,14 @@ export const RenderResponse: React.FC<RenderResponseProps> = ({
language,
isExpanded = true,
}) => {
if (
(typeof responseData === "string" && responseData === "") ||
(Array.isArray(responseData) && responseData.length === 0) ||
(typeof responseData === "object" && Object.keys(responseData).length === 0)
) {
return <p className="ph-no-capture my-1 font-normal text-slate-700">-</p>;
}
const handleArray = (data: string | number | string[]): string => {
if (Array.isArray(data)) {
return data.join(", ");