mirror of
https://github.com/formbricks/formbricks.git
synced 2025-12-27 08:50:38 -06:00
Compare commits
1 Commits
helm-secur
...
4.1.0-rc.1
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f9835dd5c1 |
6
.github/workflows/formbricks-release.yml
vendored
6
.github/workflows/formbricks-release.yml
vendored
@@ -89,7 +89,7 @@ jobs:
|
||||
- check-latest-release
|
||||
with:
|
||||
IS_PRERELEASE: ${{ github.event.release.prerelease }}
|
||||
MAKE_LATEST: ${{ needs.check-latest-release.outputs.is_latest }}
|
||||
MAKE_LATEST: ${{ needs.check-latest-release.outputs.is_latest == 'true' }}
|
||||
|
||||
docker-build-cloud:
|
||||
name: Build & push Formbricks Cloud to ECR
|
||||
@@ -101,7 +101,7 @@ jobs:
|
||||
with:
|
||||
image_tag: ${{ needs.docker-build-community.outputs.VERSION }}
|
||||
IS_PRERELEASE: ${{ github.event.release.prerelease }}
|
||||
MAKE_LATEST: ${{ needs.check-latest-release.outputs.is_latest }}
|
||||
MAKE_LATEST: ${{ needs.check-latest-release.outputs.is_latest == 'true' }}
|
||||
needs:
|
||||
- check-latest-release
|
||||
- docker-build-community
|
||||
@@ -154,4 +154,4 @@ jobs:
|
||||
release_tag: ${{ github.event.release.tag_name }}
|
||||
commit_sha: ${{ github.sha }}
|
||||
is_prerelease: ${{ github.event.release.prerelease }}
|
||||
make_latest: ${{ needs.check-latest-release.outputs.is_latest }}
|
||||
make_latest: ${{ needs.check-latest-release.outputs.is_latest == 'true' }}
|
||||
|
||||
3
apps/web/app/s/[surveyId]/loading.tsx
Normal file
3
apps/web/app/s/[surveyId]/loading.tsx
Normal file
@@ -0,0 +1,3 @@
|
||||
import { LinkSurveyLoading } from "@/modules/survey/link/loading";
|
||||
|
||||
export default LinkSurveyLoading;
|
||||
@@ -53,9 +53,9 @@ export const I18nProvider = ({ children, language, defaultLanguage }: I18nProvid
|
||||
initializeI18n();
|
||||
}, [locale, defaultLanguage]);
|
||||
|
||||
// Don't render children until i18n is ready to prevent race conditions
|
||||
// Don't render children until i18n is ready to prevent hydration issues
|
||||
if (!isReady) {
|
||||
return null;
|
||||
return <div style={{ visibility: "hidden" }}>{children}</div>;
|
||||
}
|
||||
|
||||
return (
|
||||
|
||||
@@ -85,6 +85,6 @@ export const middleware = async (originalRequest: NextRequest) => {
|
||||
|
||||
export const config = {
|
||||
matcher: [
|
||||
"/((?!_next/static|_next/image|favicon.ico|sitemap.xml|robots.txt|js|css|images|fonts|icons|public|animated-bgs).*)",
|
||||
"/((?!_next/static|_next/image|favicon.ico|sitemap.xml|robots.txt|js|css|images|fonts|icons|public).*)",
|
||||
],
|
||||
};
|
||||
|
||||
@@ -32,16 +32,6 @@ vi.mock("@/lib/styling/constants", () => ({
|
||||
},
|
||||
}));
|
||||
|
||||
// Mock recall utility
|
||||
vi.mock("@/lib/utils/recall", () => ({
|
||||
recallToHeadline: vi.fn((headline) => headline),
|
||||
}));
|
||||
|
||||
// Mock text content extraction
|
||||
vi.mock("@formbricks/types/surveys/validation", () => ({
|
||||
getTextContent: vi.fn((text) => text),
|
||||
}));
|
||||
|
||||
describe("Metadata Utils", () => {
|
||||
// Reset all mocks before each test
|
||||
beforeEach(() => {
|
||||
@@ -183,75 +173,6 @@ describe("Metadata Utils", () => {
|
||||
WEBAPP_URL: "https://test.formbricks.com",
|
||||
}));
|
||||
});
|
||||
|
||||
test("handles welcome card headline with HTML content", async () => {
|
||||
const { getTextContent } = await import("@formbricks/types/surveys/validation");
|
||||
|
||||
const mockSurvey = {
|
||||
id: mockSurveyId,
|
||||
environmentId: mockEnvironmentId,
|
||||
name: "Test Survey",
|
||||
metadata: {},
|
||||
languages: [],
|
||||
welcomeCard: {
|
||||
enabled: true,
|
||||
timeToFinish: false,
|
||||
showResponseCount: false,
|
||||
headline: {
|
||||
default: "<p>Welcome <strong>Headline</strong></p>",
|
||||
},
|
||||
html: {
|
||||
default: "Welcome Description",
|
||||
},
|
||||
} as TSurveyWelcomeCard,
|
||||
} as TSurvey;
|
||||
|
||||
vi.mocked(getSurvey).mockResolvedValue(mockSurvey);
|
||||
vi.mocked(getTextContent).mockReturnValue("Welcome Headline");
|
||||
|
||||
const result = await getBasicSurveyMetadata(mockSurveyId);
|
||||
|
||||
expect(getTextContent).toHaveBeenCalled();
|
||||
expect(result.title).toBe("Welcome Headline");
|
||||
});
|
||||
|
||||
test("handles welcome card headline with recall variables", async () => {
|
||||
const { recallToHeadline } = await import("@/lib/utils/recall");
|
||||
|
||||
const mockSurvey = {
|
||||
id: mockSurveyId,
|
||||
environmentId: mockEnvironmentId,
|
||||
name: "Test Survey",
|
||||
metadata: {},
|
||||
languages: [],
|
||||
welcomeCard: {
|
||||
enabled: true,
|
||||
timeToFinish: false,
|
||||
showResponseCount: false,
|
||||
headline: {
|
||||
default: "Welcome #recall:name/fallback:User#",
|
||||
},
|
||||
html: {
|
||||
default: "Welcome Description",
|
||||
},
|
||||
} as TSurveyWelcomeCard,
|
||||
} as TSurvey;
|
||||
|
||||
vi.mocked(getSurvey).mockResolvedValue(mockSurvey);
|
||||
vi.mocked(recallToHeadline).mockReturnValue({
|
||||
default: "Welcome @User",
|
||||
});
|
||||
|
||||
const result = await getBasicSurveyMetadata(mockSurveyId);
|
||||
|
||||
expect(recallToHeadline).toHaveBeenCalledWith(
|
||||
mockSurvey.welcomeCard.headline,
|
||||
mockSurvey,
|
||||
false,
|
||||
"default"
|
||||
);
|
||||
expect(result.title).toBe("Welcome @User");
|
||||
});
|
||||
});
|
||||
|
||||
describe("getSurveyOpenGraphMetadata", () => {
|
||||
|
||||
@@ -1,10 +1,8 @@
|
||||
import { Metadata } from "next";
|
||||
import { getTextContent } from "@formbricks/types/surveys/validation";
|
||||
import { IS_FORMBRICKS_CLOUD } from "@/lib/constants";
|
||||
import { getPublicDomain } from "@/lib/getPublicUrl";
|
||||
import { getLocalizedValue } from "@/lib/i18n/utils";
|
||||
import { COLOR_DEFAULTS } from "@/lib/styling/constants";
|
||||
import { recallToHeadline } from "@/lib/utils/recall";
|
||||
import { getSurvey } from "@/modules/survey/lib/survey";
|
||||
|
||||
type TBasicSurveyMetadata = {
|
||||
@@ -50,9 +48,7 @@ export const getBasicSurveyMetadata = async (
|
||||
const titleFromMetadata = metadata?.title ? getLocalizedValue(metadata.title, langCode) || "" : undefined;
|
||||
const titleFromWelcome =
|
||||
welcomeCard?.enabled && welcomeCard.headline
|
||||
? getTextContent(
|
||||
getLocalizedValue(recallToHeadline(welcomeCard.headline, survey, false, langCode), langCode)
|
||||
) || ""
|
||||
? getLocalizedValue(welcomeCard.headline, langCode) || ""
|
||||
: undefined;
|
||||
let title = titleFromMetadata || titleFromWelcome || survey.name;
|
||||
|
||||
|
||||
11
apps/web/modules/survey/link/loading.tsx
Normal file
11
apps/web/modules/survey/link/loading.tsx
Normal file
@@ -0,0 +1,11 @@
|
||||
"use client";
|
||||
export const LinkSurveyLoading = () => {
|
||||
return (
|
||||
<div className="flex h-full w-full items-center justify-center">
|
||||
<div className="flex h-1/2 w-3/4 flex-col sm:w-1/2 lg:w-1/4">
|
||||
<div className="ph-no-capture h-16 w-1/3 animate-pulse rounded-lg bg-slate-200 font-medium text-slate-900"></div>
|
||||
<div className="ph-no-capture mt-4 h-full animate-pulse rounded-lg bg-slate-200 text-slate-900"></div>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
@@ -102,7 +102,7 @@
|
||||
"markdown-it": "14.1.0",
|
||||
"mime-types": "3.0.1",
|
||||
"next": "15.5.6",
|
||||
"next-auth": "4.24.12",
|
||||
"next-auth": "4.24.11",
|
||||
"next-safe-action": "7.10.8",
|
||||
"node-fetch": "3.3.2",
|
||||
"nodemailer": "7.0.9",
|
||||
|
||||
@@ -102,7 +102,6 @@ When PUBLIC_URL is configured, the following routes are automatically served fro
|
||||
- `/fonts/*` - Font files
|
||||
- `/icons/*` - Icon assets
|
||||
- `/public/*` - Public static files
|
||||
- `/animated-bgs/*` - Animated Background assets
|
||||
|
||||
#### Storage Routes
|
||||
|
||||
|
||||
@@ -74,7 +74,7 @@ spec:
|
||||
{{- end }}
|
||||
{{- if .Values.deployment.securityContext }}
|
||||
securityContext:
|
||||
{{ toYaml .Values.deployment.securityContext | nindent 8 }}
|
||||
{{ toYaml .Values.deployment.securityContext | indent 8 }}
|
||||
{{- end }}
|
||||
terminationGracePeriodSeconds: {{ .Values.deployment.terminationGracePeriodSeconds | default 30 }}
|
||||
containers:
|
||||
|
||||
@@ -79,7 +79,7 @@
|
||||
},
|
||||
"pnpm": {
|
||||
"patchedDependencies": {
|
||||
"next-auth@4.24.12": "patches/next-auth@4.24.12.patch"
|
||||
"next-auth@4.24.11": "patches/next-auth@4.24.11.patch"
|
||||
},
|
||||
"overrides": {
|
||||
"axios": ">=1.12.2",
|
||||
|
||||
5361
pnpm-lock.yaml
generated
5361
pnpm-lock.yaml
generated
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user