From ab80bc1bf20704480f07fdedc793d7d84a87cfaa Mon Sep 17 00:00:00 2001 From: Dhruwang Jariwala <67850763+Dhruwang@users.noreply.github.com> Date: Wed, 12 Jun 2024 19:40:22 +0530 Subject: [PATCH] feat: language switch (#2692) Co-authored-by: Johannes Co-authored-by: Matti Nannt --- apps/demo/components/Sidebar.tsx | 1 - apps/demo/pages/_app.tsx | 1 - apps/demo/pages/app/index.tsx | 2 - apps/demo/pages/website/index.tsx | 4 +- .../contributing/components/FAQ.tsx | 1 - apps/docs/components/Footer.tsx | 1 - apps/docs/components/Header.tsx | 1 - apps/docs/components/Layout.tsx | 1 - apps/docs/components/Navigation.tsx | 1 - apps/docs/tailwind.config.ts | 1 - apps/storybook/.storybook/preview.ts | 1 - apps/storybook/src/App.tsx | 1 - apps/storybook/src/main.tsx | 1 - .../environments/[environmentId]/layout.tsx | 1 - .../edit/components/AddQuestionButton.tsx | 1 - .../edit/components/AddressQuestionForm.tsx | 18 +- .../edit/components/AdvancedSettings.tsx | 1 - .../edit/components/BackgroundStylingCard.tsx | 2 - .../edit/components/CalQuestionForm.tsx | 18 +- .../edit/components/ColorSurveyBg.tsx | 1 - .../edit/components/DateQuestionForm.tsx | 19 +- .../edit/components/EditThankYouCard.tsx | 1 - .../components/FileUploadQuestionForm.tsx | 18 +- .../edit/components/HiddenFieldsCard.tsx | 2 - .../edit/components/HowToSendCard.tsx | 1 - .../edit/components/MatrixQuestionForm.tsx | 22 +- .../components/MultipleChoiceQuestionForm.tsx | 17 +- .../edit/components/NPSQuestionForm.tsx | 18 +- .../edit/components/OpenQuestionForm.tsx | 26 +- .../edit/components/PictureSelectionForm.tsx | 19 +- .../edit/components/QuestionsDroppable.tsx | 2 - .../QuestionsStylingSettingsTabs.tsx | 1 - .../edit/components/RatingQuestionForm.tsx | 20 +- .../edit/components/RecontactOptionsCard.tsx | 1 - .../edit/components/ResponseOptionsCard.tsx | 1 - .../edit/components/SavedActionsTab.tsx | 1 - .../edit/components/SelectQuestionChoice.tsx | 7 +- .../edit/components/StylingView.tsx | 2 - .../edit/components/SurveyBgSelectorTab.tsx | 2 - .../edit/components/SurveyEditor.tsx | 2 - .../edit/components/SurveyPlacementCard.tsx | 2 - .../edit/components/TargetingCard.tsx | 2 - .../edit/components/UnsplashImages.tsx | 2 - .../edit/components/UpdateQuestionId.tsx | 2 - .../edit/components/WhenToSendCard.tsx | 2 - .../surveys/[surveyId]/edit/page.tsx | 2 - .../surveys/lib/minimalSurvey.ts | 1 + .../surveys/templates/actions.ts | 1 - .../templates/components/BackButton.tsx | 1 - .../components/TemplateContainer.tsx | 2 - .../surveys/templates/page.tsx | 2 - .../components/ConfirmationPage.tsx | 1 - .../app/(app)/billing-confirmation/page.tsx | 1 - .../app/(app)/components/FormbricksClient.tsx | 1 - .../(people)/attributes/actions.ts | 1 - .../components/AttributeActivityTab.tsx | 2 - .../components/AttributeClassesTable.tsx | 2 - .../components/AttributeDetailModal.tsx | 2 - .../components/AttributeRowData.tsx | 1 - .../components/AttributeSettingsTab.tsx | 1 - .../components/HowToAddAttributesButton.tsx | 1 - .../(people)/attributes/loading.tsx | 1 - .../(people)/attributes/page.tsx | 2 - .../(people)/people/[personId]/actions.ts | 1 - .../components/ActivityItemComponents.tsx | 1 - .../[personId]/components/ActivitySection.tsx | 1 - .../components/ActivityTimeline.tsx | 1 - .../components/DeletePersonButton.tsx | 1 - .../[personId]/components/ResponseSection.tsx | 1 - .../components/ResponseTimeline.tsx | 1 - .../[personId]/components/ResponsesFeed.tsx | 1 - .../(people)/people/[personId]/loading.tsx | 1 - .../(people)/people/[personId]/page.tsx | 1 - .../(people)/people/components/PersonCard.tsx | 1 - .../(people)/people/loading.tsx | 1 - .../[environmentId]/(people)/people/page.tsx | 2 - .../(people)/segments/actions.ts | 1 - .../components/BasicSegmentSettings.tsx | 2 - .../segments/components/SegmentTable.tsx | 1 - .../components/SegmentTableDataRow.tsx | 2 - .../SegmentTableDataRowContainer.tsx | 1 - .../(people)/segments/loading.tsx | 1 - .../environments/[environmentId]/actions.ts | 1 - .../actions/components/ActionActivityTab.tsx | 2 - .../actions/components/ActionClassesTable.tsx | 2 - .../actions/components/ActionDetailModal.tsx | 2 - .../actions/components/ActionRowData.tsx | 1 - .../actions/components/ActionSettingsTab.tsx | 1 - .../[environmentId]/actions/page.tsx | 1 - .../components/AddProductModal.tsx | 1 - .../components/EnvironmentLayout.tsx | 1 - .../components/EnvironmentSwitch.tsx | 1 - .../components/MainNavigation.tsx | 2 - .../components/NavigationLink.tsx | 1 - .../components/PosthogIdentify.tsx | 1 - .../components/TopControlBar.tsx | 1 - .../components/TopControlButtons.tsx | 1 - .../components/UrlShortenerForm.tsx | 2 - .../components/UrlShortenerModal.tsx | 2 - .../components/WidgetStatusIndicator.tsx | 1 - .../[environmentId]/integrations/actions.ts | 1 - .../components/AddIntegrationModal.tsx | 1 - .../airtable/components/AirtableWrapper.tsx | 1 - .../components/BaseSelectDropdown.tsx | 2 - .../airtable/components/ManageIntegration.tsx | 1 - .../integrations/airtable/page.tsx | 1 - .../components/IntegrationsPageTitle.tsx | 1 - .../integrations/google-sheets/actions.ts | 1 - .../components/AddIntegrationModal.tsx | 1 - .../components/GoogleSheetWrapper.tsx | 2 - .../components/ManageIntegration.tsx | 1 - .../integrations/google-sheets/page.tsx | 1 - .../integrations/notion/actions.ts | 1 - .../notion/components/ManageIntegration.tsx | 1 - .../notion/components/NotionWrapper.tsx | 2 - .../integrations/notion/page.tsx | 1 - .../[environmentId]/integrations/page.tsx | 1 - .../integrations/slack/actions.ts | 1 - .../components/AddChannelMappingModal.tsx | 1 - .../slack/components/ManageIntegration.tsx | 1 - .../slack/components/SlackWrapper.tsx | 1 - .../integrations/slack/page.tsx | 1 - .../integrations/webhooks/actions.ts | 1 - .../webhooks/components/AddWebhookButton.tsx | 2 - .../webhooks/components/AddWebhookModal.tsx | 2 - .../components/SurveyCheckboxGroup.tsx | 1 - .../components/TriggerCheckboxGroup.tsx | 1 - .../components/WebhookDetailModal.tsx | 1 - .../components/WebhookSettingsTab.tsx | 2 - .../webhooks/components/WebhookTable.tsx | 1 - .../integrations/webhooks/page.tsx | 1 - .../environments/[environmentId]/layout.tsx | 2 - .../product/api-keys/actions.ts | 1 - .../api-keys/components/AddApiKeyModal.tsx | 1 - .../api-keys/components/ApiKeyList.tsx | 1 - .../api-keys/components/EditApiKeys.tsx | 2 - .../product/api-keys/loading.tsx | 1 - .../[environmentId]/product/api-keys/page.tsx | 2 - .../components/ProductConfigNavigation.tsx | 1 - .../product/general/actions.ts | 1 - .../general/components/DeleteProduct.tsx | 1 - .../components/DeleteProductRender.tsx | 1 - .../components/EditProductNameForm.tsx | 2 - .../components/EditWaitingTimeForm.tsx | 2 - .../product/general/loading.tsx | 1 - .../[environmentId]/product/general/page.tsx | 2 - .../[environmentId]/product/layout.tsx | 1 - .../[environmentId]/product/look/actions.ts | 1 - .../product/look/components/EditBranding.tsx | 2 - .../product/look/components/EditLogo.tsx | 2 - .../look/components/EditPlacementForm.tsx | 2 - .../product/look/components/ThemeStyling.tsx | 2 - .../components/ThemeStylingPreviewSurvey.tsx | 1 - .../[environmentId]/product/look/loading.tsx | 1 - .../[environmentId]/product/look/page.tsx | 2 - .../setup/components/SetupInstructions.tsx | 1 - .../[environmentId]/product/setup/loading.tsx | 1 - .../[environmentId]/product/setup/page.tsx | 2 - .../[environmentId]/product/tags/actions.ts | 1 - .../tags/components/EditTagsWrapper.tsx | 1 - .../tags/components/MergeTagsCombobox.tsx | 1 - .../[environmentId]/product/tags/page.tsx | 2 - .../components/AccountSettingsNavbar.tsx | 1 - .../settings/(account)/layout.tsx | 1 - .../(account)/notifications/actions.ts | 1 - .../notifications/components/EditAlerts.tsx | 2 - .../components/EditWeeklySummary.tsx | 2 - .../components/NotificationSwitch.tsx | 2 - .../settings/(account)/notifications/page.tsx | 2 - .../settings/(account)/profile/actions.ts | 1 - .../profile/components/AccountSecurity.tsx | 1 - .../components/DisableTwoFactorModal.tsx | 1 - .../components/EditProfileAvatarForm.tsx | 1 - .../components/EditProfileDetailsForm.tsx | 2 - .../components/EnableTwoFactorModal.tsx | 1 - .../settings/(account)/profile/page.tsx | 2 - .../billing/components/PricingTable.tsx | 1 - .../(organization)/billing/layout.tsx | 1 - .../settings/(organization)/billing/page.tsx | 2 - .../(organization)/billing/unlimited/page.tsx | 2 - .../billing/unlimited99/page.tsx | 2 - .../components/OrganizationSettingsNavbar.tsx | 1 - .../(organization)/enterprise/page.tsx | 1 - .../settings/(organization)/layout.tsx | 1 - .../(organization)/members/actions.ts | 1 - .../members/components/AddMemberModal.tsx | 1 - .../members/components/BulkInviteTab.tsx | 2 - .../members/components/DeleteOrganization.tsx | 1 - .../EditMemberships/EditMemberships.tsx | 1 - .../EditMemberships/MemberActions.tsx | 1 - .../EditMemberships/OrganizationActions.tsx | 1 - .../components/EditOrganizationNameForm.tsx | 1 - .../members/components/ShareInviteModal.tsx | 1 - .../settings/(organization)/members/page.tsx | 2 - .../surveys/[surveyId]/(analysis)/actions.ts | 1 - .../components/EmptyInAppSurveys.tsx | 1 - .../components/SurveyAnalysisNavigation.tsx | 1 - .../surveys/[surveyId]/(analysis)/layout.tsx | 1 - .../(analysis)/responses/actions.ts | 1 - .../responses/components/ResponsePage.tsx | 1 - .../responses/components/ResponseTimeline.tsx | 1 - .../[surveyId]/(analysis)/responses/page.tsx | 1 - .../[surveyId]/(analysis)/summary/actions.ts | 1 - .../summary/components/AddressSummary.tsx | 2 - .../summary/components/CTASummary.tsx | 2 - .../summary/components/CalSummary.tsx | 2 - .../summary/components/ConsentSummary.tsx | 1 - .../components/DateQuestionSummary.tsx | 2 - .../summary/components/FileUploadSummary.tsx | 2 - .../components/HiddenFieldsSummary.tsx | 1 - .../components/MatrixQuestionSummary.tsx | 1 - .../components/MultipleChoiceSummary.tsx | 2 - .../summary/components/NPSSummary.tsx | 1 - .../summary/components/OpenTextSummary.tsx | 2 - .../components/PictureChoiceSummary.tsx | 2 - .../components/QuestionSummaryHeader.tsx | 1 - .../summary/components/ShareEmbedSurvey.tsx | 2 - .../summary/components/ShareSurveyResults.tsx | 1 - .../summary/components/SuccessMessage.tsx | 2 - .../summary/components/SummaryDropOffs.tsx | 1 - .../summary/components/SummaryPage.tsx | 2 - .../summary/components/SurveyAnalysisCTA.tsx | 1 - .../components/shareEmbedTabs/EmailTab.tsx | 2 - .../components/shareEmbedTabs/LinkTab.tsx | 1 - .../components/shareEmbedTabs/WebpageTab.tsx | 1 - .../[surveyId]/(analysis)/summary/page.tsx | 1 - .../surveys/[surveyId]/actions.ts | 1 - .../[surveyId]/components/CustomFilter.tsx | 2 - .../components/ResultsShareButton.tsx | 2 - .../components/SurveyStatusDropdown.tsx | 2 - .../[environmentId]/surveys/actions.ts | 1 - .../[environmentId]/surveys/page.tsx | 1 - apps/web/app/(app)/layout.tsx | 1 - apps/web/app/(app)/onboarding/actions.ts | 1 - .../onboarding/components/PathwaySelect.tsx | 1 - .../inapp/ConnectWithFormbricks.tsx | 2 - .../inapp/InviteOrganizationMate.tsx | 2 - .../components/inapp/SetupInstructions.tsx | 1 - .../components/inapp/SurveyObjective.tsx | 1 - .../components/inapp/SurveyRole.tsx | 1 - .../components/link/CreateFirstSurvey.tsx | 2 - .../onboarding/components/onboarding.tsx | 2 - apps/web/app/(app)/onboarding/layout.tsx | 1 - apps/web/app/(app)/onboarding/page.tsx | 1 - .../components/PasswordResetForm/index.tsx | 1 - .../components/ResetPasswordForm/index.tsx | 1 - apps/web/app/(auth)/auth/layout.tsx | 1 - .../auth/login/components/SigninForm.tsx | 1 - .../auth/login/components/TwoFactor.tsx | 1 - .../auth/login/components/TwoFactorBackup.tsx | 1 - apps/web/app/(auth)/auth/login/page.tsx | 1 - .../auth/signup/components/SignupForm.tsx | 1 - .../components/RequestVerificationEmail.tsx | 1 - .../organizations/[organizationId]/route.ts | 1 - .../(redirects)/products/[productId]/route.ts | 1 - apps/web/app/[shortUrlId]/page.tsx | 1 - apps/web/app/api/auth/[...nextauth]/route.ts | 1 - .../app/api/billing/stripe-webhook/route.ts | 1 - apps/web/app/api/cron/ping/route.ts | 1 - apps/web/app/api/cron/survey-status/route.ts | 1 - apps/web/app/api/cron/weekly-summary/route.ts | 2 - .../app/api/google-sheet/callback/route.ts | 1 - apps/web/app/api/google-sheet/route.ts | 1 - .../app/api/internal/csv-conversion/route.ts | 1 - .../api/internal/excel-conversion/route.ts | 1 - apps/web/app/api/js/route.ts | 1 - apps/web/app/api/pipeline/route.ts | 2 - .../[environmentId]/people/[userId]/route.ts | 1 - .../people/[userId]/set-attribute/route.ts | 1 - .../displays/[displayId]/responded/route.ts | 1 - .../client/displays/[displayId]/route.ts | 1 - .../api/v1/(legacy)/client/displays/route.ts | 1 - .../people/[personId]/set-attribute/route.ts | 1 - .../client/responses/[responseId]/route.ts | 1 - .../api/v1/(legacy)/client/responses/route.ts | 1 - .../people/[personId]/set-attribute/route.ts | 1 - .../js/people/[personId]/set-user-id/route.ts | 1 - .../app/api/v1/(legacy)/js/people/route.ts | 1 - apps/web/app/api/v1/(legacy)/js/sync/route.ts | 1 - apps/web/app/api/v1/auth.ts | 1 - .../client/[environmentId]/actions/route.ts | 1 - .../app/sync/[userId]/route.ts | 1 - .../displays/[displayId]/route.ts | 1 - .../client/[environmentId]/displays/route.ts | 1 - .../people/[userId]/attributes/route.ts | 1 - .../v1/client/[environmentId]/people/route.ts | 1 - .../responses/[responseId]/route.ts | 1 - .../client/[environmentId]/responses/route.ts | 1 - .../storage/lib/uploadPrivateFile.ts | 1 - .../[environmentId]/storage/local/route.ts | 1 - .../client/[environmentId]/storage/route.ts | 2 - .../[environmentId]/website/sync/route.ts | 1 - .../integrations/airtable/callback/route.ts | 1 - .../app/api/v1/integrations/airtable/route.ts | 1 - .../v1/integrations/airtable/tables/route.ts | 1 - .../v1/integrations/notion/callback/route.ts | 1 - .../app/api/v1/integrations/notion/route.ts | 1 - .../v1/integrations/slack/callback/route.ts | 1 - .../app/api/v1/integrations/slack/route.ts | 1 - .../action-classes/[actionClassId]/route.ts | 1 - .../api/v1/management/action-classes/route.ts | 1 - .../[attributeClassId]/route.ts | 1 - .../v1/management/attribute-classes/route.ts | 1 - apps/web/app/api/v1/management/me/route.ts | 1 - .../v1/management/people/[personId]/route.ts | 1 - .../web/app/api/v1/management/people/route.ts | 1 - .../responses/[responseId]/route.ts | 1 - .../app/api/v1/management/responses/route.ts | 1 - .../v1/management/storage/lib/getSignedUrl.ts | 1 - .../api/v1/management/storage/local/route.ts | 1 - .../app/api/v1/management/storage/route.ts | 2 - .../v1/management/surveys/[surveyId]/route.ts | 1 - .../app/api/v1/management/surveys/route.ts | 1 - apps/web/app/api/v1/users/me/route.ts | 1 - .../app/api/v1/webhooks/[webhookId]/route.ts | 1 - apps/web/app/api/v1/webhooks/route.ts | 1 - apps/web/app/global-error.tsx | 1 - apps/web/app/health/page.tsx | 1 - apps/web/app/layout.tsx | 1 - apps/web/app/lib/api/apiHelper.ts | 1 - apps/web/app/lib/singleUseSurveys.ts | 1 - apps/web/app/middleware/bucket.ts | 1 - apps/web/app/middleware/rateLimit.ts | 1 - apps/web/app/not-found.tsx | 1 - apps/web/app/s/[surveyId]/actions.ts | 1 - .../s/[surveyId]/components/LinkSurvey.tsx | 4 +- .../app/s/[surveyId]/components/PinScreen.tsx | 1 - .../[surveyId]/components/SurveyInactive.tsx | 2 - .../[surveyId]/components/SurveyLinkUsed.tsx | 2 - .../s/[surveyId]/components/VerifyEmail.tsx | 1 - apps/web/app/s/[surveyId]/metadata.ts | 1 - apps/web/app/s/[surveyId]/not-found.tsx | 2 - apps/web/app/s/[surveyId]/page.tsx | 2 - .../app/setup/(fresh-instance)/intro/page.tsx | 1 - .../web/app/setup/(fresh-instance)/layout.tsx | 1 - .../setup/(fresh-instance)/signup/page.tsx | 1 - apps/web/app/setup/layout.tsx | 1 - .../[organizationId]/invite/actions.ts | 1 - .../invite/components/InviteMembers.tsx | 1 - .../[organizationId]/invite/page.tsx | 1 - apps/web/app/share/[sharingKey]/not-found.tsx | 1 - .../[accessType]/[fileName]/lib/deleteFile.ts | 1 - .../[accessType]/[fileName]/lib/getFile.ts | 1 - .../[accessType]/[fileName]/route.ts | 2 - apps/web/middleware.ts | 1 - apps/web/playwright/action.spec.ts | 1 - apps/web/playwright/onboarding.spec.ts | 1 - apps/web/playwright/organization.spec.ts | 1 - apps/web/playwright/signup.spec.ts | 1 - apps/web/playwright/survey.spec.ts | 1 - packages/api/src/api/client/action.ts | 1 - packages/api/src/api/client/attribute.ts | 1 - packages/api/src/api/client/display.ts | 1 - packages/api/src/api/client/people.ts | 1 - packages/api/src/api/client/response.ts | 3 +- .../data-migration.ts | 1 - .../data-migration-fix.ts | 1 - .../data-migration.ts | 1 - .../data-migration.ts | 1 - .../migration.sql | 2 + packages/database/schema.prisma | 11 +- .../components/default-language-select.tsx | 2 +- .../components/edit-language.tsx | 2 +- .../components/language-indicator.tsx | 2 +- .../components/language-select.tsx | 4 +- .../components/language-switch.tsx | 66 - .../components/language-toggle.tsx | 2 +- .../components/multi-language-card.tsx | 15 + .../ee/multi-language/lib/iso-languages.ts | 750 ------- packages/js-core/app.vite.config.ts | 1 - packages/js-core/src/app/lib/actions.ts | 1 - packages/js-core/src/app/lib/api.ts | 1 - packages/js-core/src/app/lib/attributes.ts | 1 - packages/js-core/src/app/lib/config.ts | 1 - packages/js-core/src/app/lib/sync.ts | 1 - packages/js-core/src/app/lib/widget.ts | 4 +- packages/js-core/src/shared/commandQueue.ts | 1 - packages/js-core/src/shared/utils.ts | 1 - packages/js-core/src/website/lib/actions.ts | 1 - packages/js-core/src/website/lib/config.ts | 1 - packages/js-core/src/website/lib/sync.ts | 1 - packages/js-core/src/website/lib/widget.ts | 4 +- packages/js-core/website.vite.config.ts | 1 - packages/js/src/app.ts | 1 - packages/js/src/website.ts | 1 - packages/lib/account/service.ts | 2 - packages/lib/action/service.ts | 3 - packages/lib/actionClass/auth.ts | 2 - packages/lib/actionClass/service.ts | 3 - packages/lib/airtable/service.ts | 2 - packages/lib/apiKey/auth.ts | 2 - packages/lib/apiKey/service.ts | 3 - packages/lib/attribute/service.ts | 3 - packages/lib/attributeClass/auth.ts | 2 - packages/lib/attributeClass/service.ts | 3 - packages/lib/auth.ts | 1 - packages/lib/auth/service.ts | 2 - packages/lib/constants.ts | 1 - packages/lib/crypto.ts | 1 - packages/lib/customerio.ts | 1 - packages/lib/display/service.ts | 3 - .../lib/display/tests/__mocks__/data.mock.ts | 1 - packages/lib/display/tests/display.test.ts | 3 - packages/lib/environment/auth.ts | 2 - packages/lib/environment/service.ts | 3 - packages/lib/googleSheet/service.ts | 3 - packages/lib/i18n/i18n.mock.ts | 1 + packages/lib/i18n/i18n.test.ts | 1 - packages/lib/i18n/reverseTranslation.ts | 2 - packages/lib/i18n/utils.ts | 752 ++++++- packages/lib/instance/service.ts | 3 - packages/lib/integration/auth.ts | 2 - packages/lib/integration/service.ts | 3 - packages/lib/invite/service.ts | 3 - packages/lib/jwt.ts | 2 - packages/lib/language/service.ts | 2 - packages/lib/language/tests/language.unit.ts | 3 - packages/lib/membership/hooks/actions.ts | 3 - .../membership/hooks/useMembershipRole.tsx | 1 - packages/lib/membership/service.ts | 3 - packages/lib/notion/service.ts | 1 - packages/lib/organization/auth.ts | 2 - packages/lib/organization/hooks/actions.ts | 3 - .../organization/hooks/useGetBillingInfo.ts | 2 - packages/lib/organization/service.ts | 3 - packages/lib/person/auth.ts | 2 - packages/lib/person/service.ts | 3 - packages/lib/posthogServer.ts | 1 - packages/lib/product/auth.ts | 1 - packages/lib/product/service.ts | 3 - packages/lib/response/auth.ts | 2 - packages/lib/response/service.ts | 3 - packages/lib/response/tests/response.test.ts | 3 - packages/lib/responseNote/auth.ts | 1 - packages/lib/responseNote/service.ts | 3 - packages/lib/responseQueue.ts | 1 - packages/lib/responses.ts | 1 - packages/lib/segment/tests/segment.test.ts | 3 - packages/lib/segment/utils.ts | 1 - packages/lib/shortUrl/service.ts | 2 - packages/lib/slack/service.ts | 2 - packages/lib/storage/service.ts | 2 - packages/lib/styling/constants.ts | 1 + packages/lib/survey/auth.ts | 1 - packages/lib/survey/service.ts | 4 +- .../lib/survey/tests/__mock__/survey.mock.ts | 1 + packages/lib/survey/tests/survey.test.ts | 3 - packages/lib/survey/utils.ts | 2 - packages/lib/tag/auth.ts | 2 - packages/lib/tag/service.ts | 2 - packages/lib/tagOnResponse/auth.ts | 2 - packages/lib/tagOnResponse/service.ts | 3 - packages/lib/user/service.ts | 3 - packages/lib/utils/recall.ts | 1 - packages/lib/utils/singleUseSurveys.ts | 1 - packages/lib/utils/validate.ts | 1 - packages/lib/vitestSetup.ts | 1 - packages/lib/webhook/auth.ts | 1 - packages/lib/webhook/cache.ts | 1 - packages/lib/webhook/service.ts | 3 - .../src/components/general/CalEmbed.tsx | 1 - .../src/components/general/FileInput.tsx | 1 - .../src/components/general/GlobeIcon.tsx | 22 + .../src/components/general/LanguageSwitch.tsx | 71 + .../src/components/general/ProgressBar.tsx | 2 - .../general/ResponseErrorComponent.tsx | 1 - .../surveys/src/components/general/Survey.tsx | 60 +- .../components/general/SurveyCloseButton.tsx | 8 +- .../src/components/general/SurveyInline.tsx | 1 - .../src/components/general/SurveyModal.tsx | 2 - .../components/questions/AddressQuestion.tsx | 1 - .../src/components/questions/CTAQuestion.tsx | 1 - .../src/components/questions/CalQuestion.tsx | 1 - .../components/questions/ConsentQuestion.tsx | 1 - .../src/components/questions/DateQuestion.tsx | 2 - .../questions/FileUploadQuestion.tsx | 2 - .../components/questions/MatrixQuestion.tsx | 1 - .../questions/MultipleChoiceMultiQuestion.tsx | 1 - .../MultipleChoiceSingleQuestion.tsx | 1 - .../src/components/questions/NPSQuestion.tsx | 1 - .../components/questions/RatingQuestion.tsx | 2 - .../components/wrappers/AutoCloseWrapper.tsx | 1 - .../surveys/src/components/wrappers/Modal.tsx | 1 - .../wrappers/ScrollableContainer.tsx | 2 +- packages/surveys/src/index.ts | 1 - packages/surveys/src/lib/styles.ts | 2 - packages/surveys/src/lib/ttc.ts | 1 - packages/types/actions.ts | 1 - packages/types/auth.ts | 1 - packages/types/integration/airtable.ts | 1 - packages/types/integration/googleSheet.ts | 1 - packages/types/integration/index.ts | 1 - packages/types/integration/notion.ts | 1 - packages/types/integration/slack.ts | 1 - packages/types/invites.ts | 1 - packages/types/js.ts | 1 - packages/types/next-auth.d.ts | 1 - packages/types/pipelines.ts | 1 - packages/types/product.ts | 1 - packages/types/responses.ts | 1 - packages/types/styling.ts | 1 - packages/types/surveys.ts | 1 + packages/types/templates.ts | 1 - packages/types/webhooks.ts | 1 - packages/ui/Accordion/index.tsx | 1 - packages/ui/AdvancedOptionToggle/index.tsx | 1 - packages/ui/Alert/index.tsx | 1 - packages/ui/Alert/stories.tsx | 1 - packages/ui/BasicAddFilterModal/index.tsx | 2 - packages/ui/BasicAddFilterModal/lib/utils.ts | 1 - .../components/AttributeSegmentFilter.tsx | 2 - .../components/BasicSegmentFilter.tsx | 1 - .../components/PersonSegmentFilter.tsx | 2 - .../SegmentFilterItemContextMenu.tsx | 2 - packages/ui/BasicSegmentEditor/index.tsx | 1 - packages/ui/BillingSlider/index.tsx | 1 - packages/ui/Button/index.tsx | 2 - packages/ui/Calendar/index.tsx | 1 - packages/ui/CardArrangementTabs/index.tsx | 1 - packages/ui/Checkbox/index.tsx | 1 - packages/ui/ClientLogo/index.tsx | 1 - packages/ui/CodeBlock/index.tsx | 2 - packages/ui/Command/index.tsx | 2 - .../ui/ConfirmDeleteSegmentModal/index.tsx | 2 - packages/ui/ConfirmationModal/index.tsx | 1 - packages/ui/ConnectIntegration/index.tsx | 2 - packages/ui/CreateOrganizationModal/index.tsx | 1 - packages/ui/DatePicker/index.tsx | 2 - packages/ui/DeleteAccountModal/actions.ts | 1 - packages/ui/Dialog/index.tsx | 1 - packages/ui/DropdownMenu/index.tsx | 1 - packages/ui/DropdownSelector/index.tsx | 1 - .../components/AddVariablesDropdown.tsx | 1 - packages/ui/Editor/components/Editor.tsx | 2 - .../ui/Editor/components/ToolbarPlugin.tsx | 2 - packages/ui/EmptySpaceFiller/index.tsx | 2 - packages/ui/EnvironmentNotice/index.tsx | 1 - packages/ui/FileInput/components/Uploader.tsx | 1 - .../ui/FileInput/components/VideoSettings.tsx | 2 - packages/ui/FileInput/index.tsx | 2 - packages/ui/FileInput/lib/utils.ts | 1 - packages/ui/FileUploadResponse/index.tsx | 1 - packages/ui/Form/index.tsx | 2 - packages/ui/GoBackButton/index.tsx | 1 - packages/ui/Input/index.tsx | 1 - packages/ui/Label/index.tsx | 1 - packages/ui/LoadSegmentModal/index.tsx | 2 - packages/ui/MediaBackground/index.tsx | 1 - packages/ui/OTPInput/index.tsx | 2 - packages/ui/OptionCard/index.tsx | 1 - packages/ui/PasswordInput/index.tsx | 1 - packages/ui/Popover/index.tsx | 1 - packages/ui/PostHogClient/index.tsx | 1 - .../ui/PreviewSurvey/components/Modal.tsx | 2 - packages/ui/PreviewSurvey/index.tsx | 2 - packages/ui/PricingCard/index.tsx | 2 - .../components/FallbackInput.tsx | 2 - packages/ui/QuestionFormInput/index.tsx | 12 +- packages/ui/RadioGroup/index.tsx | 1 - packages/ui/RatingResponse/index.tsx | 1 - packages/ui/ResetProgressButton/index.tsx | 1 - packages/ui/SaveAsNewSegmentModal/index.tsx | 2 - packages/ui/SearchBox/index.tsx | 1 - packages/ui/Select/index.tsx | 1 - packages/ui/ShareSurveyLink/actions.ts | 1 - .../components/LanguageDropdown.tsx | 2 +- packages/ui/ShareSurveyLink/index.tsx | 2 - .../SignupOptions/components/AzureButton.tsx | 1 - .../SignupOptions/components/GithubButton.tsx | 1 - .../SignupOptions/components/GoogleButton.tsx | 1 - .../SignupOptions/components/OpenIdButton.tsx | 1 - packages/ui/SignupOptions/index.tsx | 2 - packages/ui/SingleResponseCard/actions.ts | 1 - .../components/HiddenFields.tsx | 2 - .../components/QuestionSkip.tsx | 2 - .../components/ResponseNote.tsx | 2 - .../components/ResponseTagsWrapper.tsx | 2 - .../components/SingleResponseCardHeader.tsx | 2 +- .../components/VerifiedEmail.tsx | 1 - packages/ui/SingleResponseCard/index.tsx | 2 - packages/ui/Slider/index.tsx | 1 - packages/ui/Survey/index.tsx | 2 - packages/ui/SurveyStatusIndicator/index.tsx | 2 - packages/ui/SurveysList/actions.ts | 1 - .../ui/SurveysList/components/SortOption.tsx | 1 - .../ui/SurveysList/components/SurveyCard.tsx | 2 - .../components/SurveyDropdownMenu.tsx | 2 - .../components/SurveyFilterDropdown.tsx | 2 - .../SurveysList/components/SurveyFilters.tsx | 2 - packages/ui/SurveysList/index.tsx | 2 - packages/ui/Switch/index.tsx | 1 - packages/ui/Tabs/index.tsx | 2 - packages/ui/Tag/index.tsx | 1 - packages/ui/TagsCombobox/index.tsx | 1 - packages/ui/TargetingIndicator/index.tsx | 1 - packages/ui/TemplateList/actions.ts | 1 - packages/ui/TemplateList/index.tsx | 2 - packages/ui/Tooltip/index.tsx | 1 - packages/ui/UpgradePlanNotice/index.tsx | 1 - .../ui/organisms/CodeActionForm/index.tsx | 1 - packages/ui/v2/Button/index.tsx | 1 - packages/ui/v2/Button/stories.ts | 1 - pnpm-lock.yaml | 1829 +++++++---------- 603 files changed, 1738 insertions(+), 2876 deletions(-) create mode 100644 packages/database/migrations/20240612074254_add_show_language_switch_to_survey/migration.sql delete mode 100644 packages/ee/multi-language/components/language-switch.tsx delete mode 100644 packages/ee/multi-language/lib/iso-languages.ts create mode 100644 packages/surveys/src/components/general/GlobeIcon.tsx create mode 100644 packages/surveys/src/components/general/LanguageSwitch.tsx diff --git a/apps/demo/components/Sidebar.tsx b/apps/demo/components/Sidebar.tsx index d8f7c87f99..153c9ec4a3 100644 --- a/apps/demo/components/Sidebar.tsx +++ b/apps/demo/components/Sidebar.tsx @@ -9,7 +9,6 @@ import { ShieldCheckIcon, UsersIcon, } from "lucide-react"; - import { classNames } from "../lib/utils"; const navigation = [ diff --git a/apps/demo/pages/_app.tsx b/apps/demo/pages/_app.tsx index 87e7ffc9db..440e7bc75e 100644 --- a/apps/demo/pages/_app.tsx +++ b/apps/demo/pages/_app.tsx @@ -1,6 +1,5 @@ import type { AppProps } from "next/app"; import Head from "next/head"; - import "../styles/globals.css"; const App = ({ Component, pageProps }: AppProps) => { diff --git a/apps/demo/pages/app/index.tsx b/apps/demo/pages/app/index.tsx index c4a0fad695..ef99c88be2 100644 --- a/apps/demo/pages/app/index.tsx +++ b/apps/demo/pages/app/index.tsx @@ -1,9 +1,7 @@ import Image from "next/image"; import { useRouter } from "next/router"; import { useEffect, useState } from "react"; - import formbricks from "@formbricks/js/app"; - import { SurveySwitch } from "../../components/SurveySwitch"; import fbsetup from "../../public/fb-setup.png"; diff --git a/apps/demo/pages/website/index.tsx b/apps/demo/pages/website/index.tsx index 33ec6bfb8a..d11934dffa 100644 --- a/apps/demo/pages/website/index.tsx +++ b/apps/demo/pages/website/index.tsx @@ -1,9 +1,7 @@ import Image from "next/image"; import { useRouter } from "next/router"; import { useEffect, useState } from "react"; - import formbricks from "@formbricks/js/website"; - import { SurveySwitch } from "../../components/SurveySwitch"; import fbsetup from "../../public/fb-setup.png"; @@ -36,7 +34,7 @@ const AppPage = ({}) => { if (process.env.NEXT_PUBLIC_FORMBRICKS_ENVIRONMENT_ID && process.env.NEXT_PUBLIC_FORMBRICKS_API_HOST) { const defaultAttributes = { - language: "de", + language: "en", }; formbricks.init({ diff --git a/apps/docs/app/developer-docs/contributing/components/FAQ.tsx b/apps/docs/app/developer-docs/contributing/components/FAQ.tsx index fbef080a04..18e6a9b0b1 100644 --- a/apps/docs/app/developer-docs/contributing/components/FAQ.tsx +++ b/apps/docs/app/developer-docs/contributing/components/FAQ.tsx @@ -1,5 +1,4 @@ import { Accordion, AccordionContent, AccordionItem, AccordionTrigger } from "@formbricks/ui/Accordion"; - import { FaqJsonLdComponent } from "./FAQPageJsonLd"; const FAQ_DATA = [ diff --git a/apps/docs/components/Footer.tsx b/apps/docs/components/Footer.tsx index d4743e0a02..f68bc02001 100644 --- a/apps/docs/components/Footer.tsx +++ b/apps/docs/components/Footer.tsx @@ -3,7 +3,6 @@ import { navigation } from "@/lib/navigation"; import Link from "next/link"; import { usePathname } from "next/navigation"; - import { Button } from "./Button"; import { DiscordIcon } from "./icons/DiscordIcon"; import { GithubIcon } from "./icons/GithubIcon"; diff --git a/apps/docs/components/Header.tsx b/apps/docs/components/Header.tsx index d5481da6d1..3f5ff792ab 100644 --- a/apps/docs/components/Header.tsx +++ b/apps/docs/components/Header.tsx @@ -6,7 +6,6 @@ import clsx from "clsx"; import { motion, useScroll, useTransform } from "framer-motion"; import Link from "next/link"; import { forwardRef } from "react"; - import { Button } from "./Button"; import { MobileNavigation, useIsInsideMobileNavigation, useMobileNavigationStore } from "./MobileNavigation"; import { ThemeToggle } from "./ThemeToggle"; diff --git a/apps/docs/components/Layout.tsx b/apps/docs/components/Layout.tsx index f4cc294be2..f55bb628a7 100644 --- a/apps/docs/components/Layout.tsx +++ b/apps/docs/components/Layout.tsx @@ -5,7 +5,6 @@ import { Navigation } from "@/components/Navigation"; import { motion } from "framer-motion"; import Link from "next/link"; import { usePathname } from "next/navigation"; - import { Footer } from "./Footer"; import { Header } from "./Header"; import { type Section, SectionProvider } from "./SectionProvider"; diff --git a/apps/docs/components/Navigation.tsx b/apps/docs/components/Navigation.tsx index 2738794b94..fc0059b858 100644 --- a/apps/docs/components/Navigation.tsx +++ b/apps/docs/components/Navigation.tsx @@ -8,7 +8,6 @@ import { ChevronDownIcon, ChevronUpIcon } from "lucide-react"; import Link from "next/link"; import { usePathname } from "next/navigation"; import { useRef, useState } from "react"; - import { Button } from "./Button"; import { useIsInsideMobileNavigation } from "./MobileNavigation"; import { useSectionStore } from "./SectionProvider"; diff --git a/apps/docs/tailwind.config.ts b/apps/docs/tailwind.config.ts index c34cac903d..8f67d576cf 100644 --- a/apps/docs/tailwind.config.ts +++ b/apps/docs/tailwind.config.ts @@ -3,7 +3,6 @@ import forms from "@tailwindcss/forms"; import typographyPlugin from "@tailwindcss/typography"; import { type Config } from "tailwindcss"; import defaultTheme from "tailwindcss/defaultTheme"; - import typographyStyles from "./typography"; export default { diff --git a/apps/storybook/.storybook/preview.ts b/apps/storybook/.storybook/preview.ts index 4ed6d23aec..60b11a8499 100644 --- a/apps/storybook/.storybook/preview.ts +++ b/apps/storybook/.storybook/preview.ts @@ -1,5 +1,4 @@ import type { Preview } from "@storybook/react"; - import "../../web/app/globals.css"; const preview: Preview = { diff --git a/apps/storybook/src/App.tsx b/apps/storybook/src/App.tsx index ff2354d302..fcb867a418 100644 --- a/apps/storybook/src/App.tsx +++ b/apps/storybook/src/App.tsx @@ -1,5 +1,4 @@ import { useState } from "react"; - import "./App.css"; export const App = () => { diff --git a/apps/storybook/src/main.tsx b/apps/storybook/src/main.tsx index 51f96d81a6..966f17a4b2 100644 --- a/apps/storybook/src/main.tsx +++ b/apps/storybook/src/main.tsx @@ -1,6 +1,5 @@ import React from "react"; import ReactDOM from "react-dom/client"; - import App from "./App.tsx"; import "./index.css"; diff --git a/apps/web/app/(app)/(survey-editor)/environments/[environmentId]/layout.tsx b/apps/web/app/(app)/(survey-editor)/environments/[environmentId]/layout.tsx index d36bae9cfa..4a6d5757a4 100644 --- a/apps/web/app/(app)/(survey-editor)/environments/[environmentId]/layout.tsx +++ b/apps/web/app/(app)/(survey-editor)/environments/[environmentId]/layout.tsx @@ -3,7 +3,6 @@ import { PosthogIdentify } from "@/app/(app)/environments/[environmentId]/compon import { ResponseFilterProvider } from "@/app/(app)/environments/[environmentId]/components/ResponseFilterContext"; import { getServerSession } from "next-auth"; import { redirect } from "next/navigation"; - import { authOptions } from "@formbricks/lib/authOptions"; import { hasUserEnvironmentAccess } from "@formbricks/lib/environment/auth"; import { getEnvironment } from "@formbricks/lib/environment/service"; diff --git a/apps/web/app/(app)/(survey-editor)/environments/[environmentId]/surveys/[surveyId]/edit/components/AddQuestionButton.tsx b/apps/web/app/(app)/(survey-editor)/environments/[environmentId]/surveys/[surveyId]/edit/components/AddQuestionButton.tsx index 0beb7f8fdd..44cbb087c1 100644 --- a/apps/web/app/(app)/(survey-editor)/environments/[environmentId]/surveys/[surveyId]/edit/components/AddQuestionButton.tsx +++ b/apps/web/app/(app)/(survey-editor)/environments/[environmentId]/surveys/[surveyId]/edit/components/AddQuestionButton.tsx @@ -5,7 +5,6 @@ import { createId } from "@paralleldrive/cuid2"; import * as Collapsible from "@radix-ui/react-collapsible"; import { PlusIcon } from "lucide-react"; import { useState } from "react"; - import { cn } from "@formbricks/lib/cn"; import { TProduct } from "@formbricks/types/product"; diff --git a/apps/web/app/(app)/(survey-editor)/environments/[environmentId]/surveys/[surveyId]/edit/components/AddressQuestionForm.tsx b/apps/web/app/(app)/(survey-editor)/environments/[environmentId]/surveys/[surveyId]/edit/components/AddressQuestionForm.tsx index 6be175b8e2..3f534d0c41 100644 --- a/apps/web/app/(app)/(survey-editor)/environments/[environmentId]/surveys/[surveyId]/edit/components/AddressQuestionForm.tsx +++ b/apps/web/app/(app)/(survey-editor)/environments/[environmentId]/surveys/[surveyId]/edit/components/AddressQuestionForm.tsx @@ -1,8 +1,6 @@ "use client"; -import { PlusIcon, TrashIcon } from "lucide-react"; -import { useState } from "react"; - +import { PlusIcon } from "lucide-react"; import { createI18nString, extractLanguageCodes } from "@formbricks/lib/i18n/utils"; import { TAttributeClass } from "@formbricks/types/attributeClasses"; import { TSurvey, TSurveyAddressQuestion } from "@formbricks/types/surveys"; @@ -32,7 +30,6 @@ export const AddressQuestionForm = ({ setSelectedLanguageCode, attributeClasses, }: AddressQuestionFormProps): JSX.Element => { - const [showSubheader, setShowSubheader] = useState(!!question.subheader); const surveyLanguageCodes = extractLanguageCodes(localSurvey.languages ?? []); return ( @@ -51,7 +48,7 @@ export const AddressQuestionForm = ({ />
- {showSubheader && ( + {question.subheader !== undefined && (
- - { - setShowSubheader(false); - updateQuestion(questionIdx, { subheader: undefined }); - }} - />
)} - {!showSubheader && ( + {question.subheader === undefined && ( diff --git a/apps/web/app/(app)/(survey-editor)/environments/[environmentId]/surveys/[surveyId]/edit/components/EditThankYouCard.tsx b/apps/web/app/(app)/(survey-editor)/environments/[environmentId]/surveys/[surveyId]/edit/components/EditThankYouCard.tsx index f8207d40fb..7c2e19ef54 100644 --- a/apps/web/app/(app)/(survey-editor)/environments/[environmentId]/surveys/[surveyId]/edit/components/EditThankYouCard.tsx +++ b/apps/web/app/(app)/(survey-editor)/environments/[environmentId]/surveys/[surveyId]/edit/components/EditThankYouCard.tsx @@ -2,7 +2,6 @@ import * as Collapsible from "@radix-ui/react-collapsible"; import { useState } from "react"; - import { cn } from "@formbricks/lib/cn"; import { getLocalizedValue } from "@formbricks/lib/i18n/utils"; import { TAttributeClass } from "@formbricks/types/attributeClasses"; diff --git a/apps/web/app/(app)/(survey-editor)/environments/[environmentId]/surveys/[surveyId]/edit/components/FileUploadQuestionForm.tsx b/apps/web/app/(app)/(survey-editor)/environments/[environmentId]/surveys/[surveyId]/edit/components/FileUploadQuestionForm.tsx index f2f8b4e743..44aaf8d999 100644 --- a/apps/web/app/(app)/(survey-editor)/environments/[environmentId]/surveys/[surveyId]/edit/components/FileUploadQuestionForm.tsx +++ b/apps/web/app/(app)/(survey-editor)/environments/[environmentId]/surveys/[surveyId]/edit/components/FileUploadQuestionForm.tsx @@ -1,9 +1,8 @@ "use client"; -import { PlusIcon, TrashIcon, XCircleIcon } from "lucide-react"; +import { PlusIcon, XCircleIcon } from "lucide-react"; import { useMemo, useState } from "react"; import { toast } from "react-hot-toast"; - import { extractLanguageCodes } from "@formbricks/lib/i18n/utils"; import { createI18nString } from "@formbricks/lib/i18n/utils"; import { useGetBillingInfo } from "@formbricks/lib/organization/hooks/useGetBillingInfo"; @@ -40,7 +39,6 @@ export const FileUploadQuestionForm = ({ setSelectedLanguageCode, attributeClasses, }: FileUploadFormProps): JSX.Element => { - const [showSubheader, setShowSubheader] = useState(!!question.subheader); const [extension, setExtension] = useState(""); const { billingInfo, @@ -128,7 +126,7 @@ export const FileUploadQuestionForm = ({ attributeClasses={attributeClasses} />
- {showSubheader && ( + {question.subheader !== undefined && (
- - { - setShowSubheader(false); - updateQuestion(questionIdx, { subheader: undefined }); - }} - />
)} - {!showSubheader && ( + {question.subheader === undefined && ( diff --git a/apps/web/app/(app)/(survey-editor)/environments/[environmentId]/surveys/[surveyId]/edit/components/HiddenFieldsCard.tsx b/apps/web/app/(app)/(survey-editor)/environments/[environmentId]/surveys/[surveyId]/edit/components/HiddenFieldsCard.tsx index 892d1da884..729870c351 100644 --- a/apps/web/app/(app)/(survey-editor)/environments/[environmentId]/surveys/[surveyId]/edit/components/HiddenFieldsCard.tsx +++ b/apps/web/app/(app)/(survey-editor)/environments/[environmentId]/surveys/[surveyId]/edit/components/HiddenFieldsCard.tsx @@ -3,7 +3,6 @@ import * as Collapsible from "@radix-ui/react-collapsible"; import { useState } from "react"; import { toast } from "react-hot-toast"; - import { cn } from "@formbricks/lib/cn"; import { TSurvey, TSurveyHiddenFields } from "@formbricks/types/surveys"; import { Button } from "@formbricks/ui/Button"; @@ -11,7 +10,6 @@ import { Input } from "@formbricks/ui/Input"; import { Label } from "@formbricks/ui/Label"; import { Switch } from "@formbricks/ui/Switch"; import { Tag } from "@formbricks/ui/Tag"; - import { validateId } from "../lib/validation"; interface HiddenFieldsCardProps { diff --git a/apps/web/app/(app)/(survey-editor)/environments/[environmentId]/surveys/[surveyId]/edit/components/HowToSendCard.tsx b/apps/web/app/(app)/(survey-editor)/environments/[environmentId]/surveys/[surveyId]/edit/components/HowToSendCard.tsx index d645a4459d..f26ee2fb9b 100644 --- a/apps/web/app/(app)/(survey-editor)/environments/[environmentId]/surveys/[surveyId]/edit/components/HowToSendCard.tsx +++ b/apps/web/app/(app)/(survey-editor)/environments/[environmentId]/surveys/[surveyId]/edit/components/HowToSendCard.tsx @@ -4,7 +4,6 @@ import * as Collapsible from "@radix-ui/react-collapsible"; import { AlertCircleIcon, CheckIcon, EarthIcon, LinkIcon, MonitorIcon, SmartphoneIcon } from "lucide-react"; import Link from "next/link"; import { useEffect, useState } from "react"; - import { cn } from "@formbricks/lib/cn"; import { TEnvironment } from "@formbricks/types/environment"; import { TSegment } from "@formbricks/types/segment"; diff --git a/apps/web/app/(app)/(survey-editor)/environments/[environmentId]/surveys/[surveyId]/edit/components/MatrixQuestionForm.tsx b/apps/web/app/(app)/(survey-editor)/environments/[environmentId]/surveys/[surveyId]/edit/components/MatrixQuestionForm.tsx index 223be2c471..7595e00f36 100644 --- a/apps/web/app/(app)/(survey-editor)/environments/[environmentId]/surveys/[surveyId]/edit/components/MatrixQuestionForm.tsx +++ b/apps/web/app/(app)/(survey-editor)/environments/[environmentId]/surveys/[surveyId]/edit/components/MatrixQuestionForm.tsx @@ -1,16 +1,13 @@ "use client"; import { PlusIcon, TrashIcon } from "lucide-react"; -import { useState } from "react"; import { toast } from "react-hot-toast"; - import { createI18nString, extractLanguageCodes, getLocalizedValue } from "@formbricks/lib/i18n/utils"; import { TAttributeClass } from "@formbricks/types/attributeClasses"; import { TI18nString, TSurvey, TSurveyMatrixQuestion } from "@formbricks/types/surveys"; import { Button } from "@formbricks/ui/Button"; import { Label } from "@formbricks/ui/Label"; import { QuestionFormInput } from "@formbricks/ui/QuestionFormInput"; - import { isLabelValidForAllLanguages } from "../lib/validation"; interface MatrixQuestionFormProps { @@ -35,7 +32,6 @@ export const MatrixQuestionForm = ({ setSelectedLanguageCode, attributeClasses, }: MatrixQuestionFormProps): JSX.Element => { - const [showSubheader, setShowSubheader] = useState(!!question.subheader); const languageCodes = extractLanguageCodes(localSurvey.languages); // Function to add a new Label input field const handleAddLabel = (type: "row" | "column") => { @@ -117,7 +113,7 @@ export const MatrixQuestionForm = ({ attributeClasses={attributeClasses} />
- {showSubheader && ( + {question.subheader !== undefined && (
- - { - setShowSubheader(false); - updateQuestion(questionIdx, { subheader: undefined }); - }} - />
)} - {!showSubheader && ( + {question.subheader === undefined && ( diff --git a/apps/web/app/(app)/(survey-editor)/environments/[environmentId]/surveys/[surveyId]/edit/components/MultipleChoiceQuestionForm.tsx b/apps/web/app/(app)/(survey-editor)/environments/[environmentId]/surveys/[surveyId]/edit/components/MultipleChoiceQuestionForm.tsx index 3c8eb7817d..18d80488cf 100644 --- a/apps/web/app/(app)/(survey-editor)/environments/[environmentId]/surveys/[surveyId]/edit/components/MultipleChoiceQuestionForm.tsx +++ b/apps/web/app/(app)/(survey-editor)/environments/[environmentId]/surveys/[surveyId]/edit/components/MultipleChoiceQuestionForm.tsx @@ -3,7 +3,7 @@ import { DndContext } from "@dnd-kit/core"; import { SortableContext, verticalListSortingStrategy } from "@dnd-kit/sortable"; import { createId } from "@paralleldrive/cuid2"; -import { PlusIcon, TrashIcon } from "lucide-react"; +import { PlusIcon } from "lucide-react"; import { useEffect, useRef, useState } from "react"; import { createI18nString, extractLanguageCodes } from "@formbricks/lib/i18n/utils"; import { getLocalizedValue } from "@formbricks/lib/i18n/utils"; @@ -45,7 +45,6 @@ export const MultipleChoiceQuestionForm = ({ }: OpenQuestionFormProps): JSX.Element => { const lastChoiceRef = useRef(null); const [isNew, setIsNew] = useState(true); - const [showSubheader, setShowSubheader] = useState(!!question.subheader); const [isInvalidValue, setisInvalidValue] = useState(null); const questionRef = useRef(null); @@ -196,7 +195,7 @@ export const MultipleChoiceQuestionForm = ({ />
- {showSubheader && ( + {question.subheader !== undefined && (
- - { - setShowSubheader(false); - updateQuestion(questionIdx, { subheader: undefined }); - }} - />
)} - {!showSubheader && ( + {question.subheader === undefined && ( diff --git a/apps/web/app/(app)/(survey-editor)/environments/[environmentId]/surveys/[surveyId]/edit/components/NPSQuestionForm.tsx b/apps/web/app/(app)/(survey-editor)/environments/[environmentId]/surveys/[surveyId]/edit/components/NPSQuestionForm.tsx index bfd82a0611..140222d6f7 100644 --- a/apps/web/app/(app)/(survey-editor)/environments/[environmentId]/surveys/[surveyId]/edit/components/NPSQuestionForm.tsx +++ b/apps/web/app/(app)/(survey-editor)/environments/[environmentId]/surveys/[surveyId]/edit/components/NPSQuestionForm.tsx @@ -1,8 +1,6 @@ "use client"; -import { PlusIcon, TrashIcon } from "lucide-react"; -import { useState } from "react"; - +import { PlusIcon } from "lucide-react"; import { createI18nString, extractLanguageCodes } from "@formbricks/lib/i18n/utils"; import { TAttributeClass } from "@formbricks/types/attributeClasses"; import { TSurvey, TSurveyNPSQuestion } from "@formbricks/types/surveys"; @@ -32,7 +30,6 @@ export const NPSQuestionForm = ({ setSelectedLanguageCode, attributeClasses, }: NPSQuestionFormProps): JSX.Element => { - const [showSubheader, setShowSubheader] = useState(!!question.subheader); const surveyLanguageCodes = extractLanguageCodes(localSurvey.languages); return (
@@ -50,7 +47,7 @@ export const NPSQuestionForm = ({ />
- {showSubheader && ( + {question.subheader !== undefined && (
- - { - setShowSubheader(false); - updateQuestion(questionIdx, { subheader: undefined }); - }} - />
)} - {!showSubheader && ( + {question.subheader === undefined && ( diff --git a/apps/web/app/(app)/(survey-editor)/environments/[environmentId]/surveys/[surveyId]/edit/components/QuestionsDroppable.tsx b/apps/web/app/(app)/(survey-editor)/environments/[environmentId]/surveys/[surveyId]/edit/components/QuestionsDroppable.tsx index 56834cf58e..dd251fc512 100644 --- a/apps/web/app/(app)/(survey-editor)/environments/[environmentId]/surveys/[surveyId]/edit/components/QuestionsDroppable.tsx +++ b/apps/web/app/(app)/(survey-editor)/environments/[environmentId]/surveys/[surveyId]/edit/components/QuestionsDroppable.tsx @@ -1,9 +1,7 @@ import { SortableContext, verticalListSortingStrategy } from "@dnd-kit/sortable"; - import { TAttributeClass } from "@formbricks/types/attributeClasses"; import { TProduct } from "@formbricks/types/product"; import { TSurvey } from "@formbricks/types/surveys"; - import { QuestionCard } from "./QuestionCard"; interface QuestionsDraggableProps { diff --git a/apps/web/app/(app)/(survey-editor)/environments/[environmentId]/surveys/[surveyId]/edit/components/QuestionsStylingSettingsTabs.tsx b/apps/web/app/(app)/(survey-editor)/environments/[environmentId]/surveys/[surveyId]/edit/components/QuestionsStylingSettingsTabs.tsx index 04aa16e814..5865c62cf8 100644 --- a/apps/web/app/(app)/(survey-editor)/environments/[environmentId]/surveys/[surveyId]/edit/components/QuestionsStylingSettingsTabs.tsx +++ b/apps/web/app/(app)/(survey-editor)/environments/[environmentId]/surveys/[surveyId]/edit/components/QuestionsStylingSettingsTabs.tsx @@ -1,6 +1,5 @@ import { PaintbrushIcon, Rows3Icon, SettingsIcon } from "lucide-react"; import { useMemo } from "react"; - import { cn } from "@formbricks/lib/cn"; import { TSurveyEditorTabs } from "@formbricks/types/surveys"; diff --git a/apps/web/app/(app)/(survey-editor)/environments/[environmentId]/surveys/[surveyId]/edit/components/RatingQuestionForm.tsx b/apps/web/app/(app)/(survey-editor)/environments/[environmentId]/surveys/[surveyId]/edit/components/RatingQuestionForm.tsx index 6c84f035be..2b97c94019 100644 --- a/apps/web/app/(app)/(survey-editor)/environments/[environmentId]/surveys/[surveyId]/edit/components/RatingQuestionForm.tsx +++ b/apps/web/app/(app)/(survey-editor)/environments/[environmentId]/surveys/[surveyId]/edit/components/RatingQuestionForm.tsx @@ -1,13 +1,10 @@ -import { HashIcon, PlusIcon, SmileIcon, StarIcon, TrashIcon } from "lucide-react"; -import { useState } from "react"; - +import { HashIcon, PlusIcon, SmileIcon, StarIcon } from "lucide-react"; import { createI18nString, extractLanguageCodes } from "@formbricks/lib/i18n/utils"; import { TAttributeClass } from "@formbricks/types/attributeClasses"; import { TSurvey, TSurveyRatingQuestion } from "@formbricks/types/surveys"; import { Button } from "@formbricks/ui/Button"; import { Label } from "@formbricks/ui/Label"; import { QuestionFormInput } from "@formbricks/ui/QuestionFormInput"; - import { Dropdown } from "./RatingTypeDropdown"; interface RatingQuestionFormProps { @@ -32,7 +29,6 @@ export const RatingQuestionForm = ({ setSelectedLanguageCode, attributeClasses, }: RatingQuestionFormProps) => { - const [showSubheader, setShowSubheader] = useState(!!question.subheader); const surveyLanguageCodes = extractLanguageCodes(localSurvey.languages); return ( @@ -51,7 +47,7 @@ export const RatingQuestionForm = ({ />
- {showSubheader && ( + {question.subheader !== undefined && (
- - { - setShowSubheader(false); - updateQuestion(questionIdx, { subheader: undefined }); - }} - />
)} - {!showSubheader && ( + {question.subheader === undefined && ( diff --git a/apps/web/app/(app)/(survey-editor)/environments/[environmentId]/surveys/[surveyId]/edit/components/RecontactOptionsCard.tsx b/apps/web/app/(app)/(survey-editor)/environments/[environmentId]/surveys/[surveyId]/edit/components/RecontactOptionsCard.tsx index 36c8fce4f2..b93dacc168 100644 --- a/apps/web/app/(app)/(survey-editor)/environments/[environmentId]/surveys/[surveyId]/edit/components/RecontactOptionsCard.tsx +++ b/apps/web/app/(app)/(survey-editor)/environments/[environmentId]/surveys/[surveyId]/edit/components/RecontactOptionsCard.tsx @@ -4,7 +4,6 @@ import * as Collapsible from "@radix-ui/react-collapsible"; import { CheckIcon } from "lucide-react"; import Link from "next/link"; import { useEffect, useState } from "react"; - import { TSurvey } from "@formbricks/types/surveys"; import { AdvancedOptionToggle } from "@formbricks/ui/AdvancedOptionToggle"; import { Input } from "@formbricks/ui/Input"; diff --git a/apps/web/app/(app)/(survey-editor)/environments/[environmentId]/surveys/[surveyId]/edit/components/ResponseOptionsCard.tsx b/apps/web/app/(app)/(survey-editor)/environments/[environmentId]/surveys/[surveyId]/edit/components/ResponseOptionsCard.tsx index ba54cf3c34..38af12a9e5 100644 --- a/apps/web/app/(app)/(survey-editor)/environments/[environmentId]/surveys/[surveyId]/edit/components/ResponseOptionsCard.tsx +++ b/apps/web/app/(app)/(survey-editor)/environments/[environmentId]/surveys/[surveyId]/edit/components/ResponseOptionsCard.tsx @@ -5,7 +5,6 @@ import { ArrowUpRight, CheckIcon } from "lucide-react"; import Link from "next/link"; import { KeyboardEventHandler, useEffect, useState } from "react"; import toast from "react-hot-toast"; - import { cn } from "@formbricks/lib/cn"; import { TSurvey } from "@formbricks/types/surveys"; import { AdvancedOptionToggle } from "@formbricks/ui/AdvancedOptionToggle"; diff --git a/apps/web/app/(app)/(survey-editor)/environments/[environmentId]/surveys/[surveyId]/edit/components/SavedActionsTab.tsx b/apps/web/app/(app)/(survey-editor)/environments/[environmentId]/surveys/[surveyId]/edit/components/SavedActionsTab.tsx index a848d16ad0..17a202bf8b 100644 --- a/apps/web/app/(app)/(survey-editor)/environments/[environmentId]/surveys/[surveyId]/edit/components/SavedActionsTab.tsx +++ b/apps/web/app/(app)/(survey-editor)/environments/[environmentId]/surveys/[surveyId]/edit/components/SavedActionsTab.tsx @@ -1,6 +1,5 @@ import { Code2Icon, MousePointerClickIcon, SparklesIcon } from "lucide-react"; import { useState } from "react"; - import { TActionClass } from "@formbricks/types/actionClasses"; import { TSurvey } from "@formbricks/types/surveys"; import { Input } from "@formbricks/ui/Input"; diff --git a/apps/web/app/(app)/(survey-editor)/environments/[environmentId]/surveys/[surveyId]/edit/components/SelectQuestionChoice.tsx b/apps/web/app/(app)/(survey-editor)/environments/[environmentId]/surveys/[surveyId]/edit/components/SelectQuestionChoice.tsx index 9d319bd57c..cfb932044d 100644 --- a/apps/web/app/(app)/(survey-editor)/environments/[environmentId]/surveys/[surveyId]/edit/components/SelectQuestionChoice.tsx +++ b/apps/web/app/(app)/(survey-editor)/environments/[environmentId]/surveys/[surveyId]/edit/components/SelectQuestionChoice.tsx @@ -2,7 +2,6 @@ import { useSortable } from "@dnd-kit/sortable"; import { CSS } from "@dnd-kit/utilities"; import { GripVerticalIcon, PlusIcon, TrashIcon } from "lucide-react"; import toast from "react-hot-toast"; - import { cn } from "@formbricks/lib/cn"; import { createI18nString } from "@formbricks/lib/i18n/utils"; import { TAttributeClass } from "@formbricks/types/attributeClasses"; @@ -13,7 +12,6 @@ import { TSurveyMultipleChoiceQuestion, } from "@formbricks/types/surveys"; import { QuestionFormInput } from "@formbricks/ui/QuestionFormInput"; - import { isLabelValidForAllLanguages } from "../lib/validation"; interface ChoiceProps { @@ -70,7 +68,7 @@ export const SelectQuestionChoice = ({ }; return ( -
+
{/* drag handle */}
)}
- -
+
{question.choices && question.choices.length > 2 && ( { diff --git a/apps/web/app/(app)/(survey-editor)/environments/[environmentId]/surveys/lib/minimalSurvey.ts b/apps/web/app/(app)/(survey-editor)/environments/[environmentId]/surveys/lib/minimalSurvey.ts index 8786b6f6a0..04041f06ff 100644 --- a/apps/web/app/(app)/(survey-editor)/environments/[environmentId]/surveys/lib/minimalSurvey.ts +++ b/apps/web/app/(app)/(survey-editor)/environments/[environmentId]/surveys/lib/minimalSurvey.ts @@ -43,4 +43,5 @@ export const minimalSurvey: TSurvey = { resultShareKey: null, segment: null, languages: [], + showLanguageSwitch: false, }; diff --git a/apps/web/app/(app)/(survey-editor)/environments/[environmentId]/surveys/templates/actions.ts b/apps/web/app/(app)/(survey-editor)/environments/[environmentId]/surveys/templates/actions.ts index 047d40281f..4ae89d66a8 100644 --- a/apps/web/app/(app)/(survey-editor)/environments/[environmentId]/surveys/templates/actions.ts +++ b/apps/web/app/(app)/(survey-editor)/environments/[environmentId]/surveys/templates/actions.ts @@ -1,7 +1,6 @@ "use server"; import { getServerSession } from "next-auth"; - import { authOptions } from "@formbricks/lib/authOptions"; import { hasUserEnvironmentAccess } from "@formbricks/lib/environment/auth"; import { createSurvey } from "@formbricks/lib/survey/service"; diff --git a/apps/web/app/(app)/(survey-editor)/environments/[environmentId]/surveys/templates/components/BackButton.tsx b/apps/web/app/(app)/(survey-editor)/environments/[environmentId]/surveys/templates/components/BackButton.tsx index 5b166acbf9..633c153ea4 100644 --- a/apps/web/app/(app)/(survey-editor)/environments/[environmentId]/surveys/templates/components/BackButton.tsx +++ b/apps/web/app/(app)/(survey-editor)/environments/[environmentId]/surveys/templates/components/BackButton.tsx @@ -2,7 +2,6 @@ import { ArrowLeftIcon } from "lucide-react"; import { useRouter } from "next/navigation"; - import { Button } from "@formbricks/ui/Button"; export const BackButton = () => { diff --git a/apps/web/app/(app)/(survey-editor)/environments/[environmentId]/surveys/templates/components/TemplateContainer.tsx b/apps/web/app/(app)/(survey-editor)/environments/[environmentId]/surveys/templates/components/TemplateContainer.tsx index f66a17270a..a98cdbbc69 100644 --- a/apps/web/app/(app)/(survey-editor)/environments/[environmentId]/surveys/templates/components/TemplateContainer.tsx +++ b/apps/web/app/(app)/(survey-editor)/environments/[environmentId]/surveys/templates/components/TemplateContainer.tsx @@ -2,7 +2,6 @@ import { MenuBar } from "@/app/(app)/(survey-editor)/environments/[environmentId]/surveys/templates/components/MenuBar"; import { useState } from "react"; - import { customSurvey } from "@formbricks/lib/templates"; import type { TEnvironment } from "@formbricks/types/environment"; import type { TProduct } from "@formbricks/types/product"; @@ -11,7 +10,6 @@ import { TUser } from "@formbricks/types/user"; import { PreviewSurvey } from "@formbricks/ui/PreviewSurvey"; import { SearchBox } from "@formbricks/ui/SearchBox"; import { TemplateList } from "@formbricks/ui/TemplateList"; - import { minimalSurvey } from "../../lib/minimalSurvey"; type TemplateContainerWithPreviewProps = { diff --git a/apps/web/app/(app)/(survey-editor)/environments/[environmentId]/surveys/templates/page.tsx b/apps/web/app/(app)/(survey-editor)/environments/[environmentId]/surveys/templates/page.tsx index e35eaf5faa..8dd84fb7ac 100644 --- a/apps/web/app/(app)/(survey-editor)/environments/[environmentId]/surveys/templates/page.tsx +++ b/apps/web/app/(app)/(survey-editor)/environments/[environmentId]/surveys/templates/page.tsx @@ -1,9 +1,7 @@ import { getServerSession } from "next-auth"; - import { authOptions } from "@formbricks/lib/authOptions"; import { getEnvironment } from "@formbricks/lib/environment/service"; import { getProductByEnvironmentId } from "@formbricks/lib/product/service"; - import { TemplateContainerWithPreview } from "./components/TemplateContainer"; const Page = async ({ params }) => { diff --git a/apps/web/app/(app)/billing-confirmation/components/ConfirmationPage.tsx b/apps/web/app/(app)/billing-confirmation/components/ConfirmationPage.tsx index ca18dc56a1..1ba5497f9b 100644 --- a/apps/web/app/(app)/billing-confirmation/components/ConfirmationPage.tsx +++ b/apps/web/app/(app)/billing-confirmation/components/ConfirmationPage.tsx @@ -1,7 +1,6 @@ "use client"; import { useEffect, useState } from "react"; - import { Button } from "@formbricks/ui/Button"; import { Confetti } from "@formbricks/ui/Confetti"; diff --git a/apps/web/app/(app)/billing-confirmation/page.tsx b/apps/web/app/(app)/billing-confirmation/page.tsx index 54f9034113..0c84743109 100644 --- a/apps/web/app/(app)/billing-confirmation/page.tsx +++ b/apps/web/app/(app)/billing-confirmation/page.tsx @@ -1,5 +1,4 @@ import { ConfirmationPage } from "@/app/(app)/billing-confirmation/components/ConfirmationPage"; - import { PageContentWrapper } from "@formbricks/ui/PageContentWrapper"; export const dynamic = "force-dynamic"; diff --git a/apps/web/app/(app)/components/FormbricksClient.tsx b/apps/web/app/(app)/components/FormbricksClient.tsx index e516e7cee3..f2100cf2c7 100644 --- a/apps/web/app/(app)/components/FormbricksClient.tsx +++ b/apps/web/app/(app)/components/FormbricksClient.tsx @@ -3,7 +3,6 @@ import { formbricksEnabled } from "@/app/lib/formbricks"; import { usePathname, useSearchParams } from "next/navigation"; import { useCallback, useEffect } from "react"; - import formbricks from "@formbricks/js/app"; import { env } from "@formbricks/lib/env"; diff --git a/apps/web/app/(app)/environments/[environmentId]/(people)/attributes/actions.ts b/apps/web/app/(app)/environments/[environmentId]/(people)/attributes/actions.ts index 3e65fd1c6e..cc1d9f5200 100644 --- a/apps/web/app/(app)/environments/[environmentId]/(people)/attributes/actions.ts +++ b/apps/web/app/(app)/environments/[environmentId]/(people)/attributes/actions.ts @@ -1,7 +1,6 @@ "use server"; import { getServerSession } from "next-auth"; - import { canUserAccessAttributeClass } from "@formbricks/lib/attributeClass/auth"; import { authOptions } from "@formbricks/lib/authOptions"; import { getSegmentsByAttributeClassName } from "@formbricks/lib/segment/service"; diff --git a/apps/web/app/(app)/environments/[environmentId]/(people)/attributes/components/AttributeActivityTab.tsx b/apps/web/app/(app)/environments/[environmentId]/(people)/attributes/components/AttributeActivityTab.tsx index 68cbe1a2bd..1a12825524 100644 --- a/apps/web/app/(app)/environments/[environmentId]/(people)/attributes/components/AttributeActivityTab.tsx +++ b/apps/web/app/(app)/environments/[environmentId]/(people)/attributes/components/AttributeActivityTab.tsx @@ -2,14 +2,12 @@ import { TagIcon } from "lucide-react"; import { useEffect, useState } from "react"; - import { convertDateTimeStringShort } from "@formbricks/lib/time"; import { capitalizeFirstLetter } from "@formbricks/lib/utils/strings"; import { TAttributeClass } from "@formbricks/types/attributeClasses"; import { ErrorComponent } from "@formbricks/ui/ErrorComponent"; import { Label } from "@formbricks/ui/Label"; import { LoadingSpinner } from "@formbricks/ui/LoadingSpinner"; - import { getSegmentsByAttributeClassAction } from "../actions"; interface EventActivityTabProps { diff --git a/apps/web/app/(app)/environments/[environmentId]/(people)/attributes/components/AttributeClassesTable.tsx b/apps/web/app/(app)/environments/[environmentId]/(people)/attributes/components/AttributeClassesTable.tsx index 85f7655141..7101d0b96c 100644 --- a/apps/web/app/(app)/environments/[environmentId]/(people)/attributes/components/AttributeClassesTable.tsx +++ b/apps/web/app/(app)/environments/[environmentId]/(people)/attributes/components/AttributeClassesTable.tsx @@ -1,10 +1,8 @@ "use client"; import { useMemo, useState } from "react"; - import { TAttributeClass } from "@formbricks/types/attributeClasses"; import { Switch } from "@formbricks/ui/Switch"; - import { AttributeDetailModal } from "./AttributeDetailModal"; import { AttributeClassDataRow } from "./AttributeRowData"; import { AttributeTableHeading } from "./AttributeTableHeading"; diff --git a/apps/web/app/(app)/environments/[environmentId]/(people)/attributes/components/AttributeDetailModal.tsx b/apps/web/app/(app)/environments/[environmentId]/(people)/attributes/components/AttributeDetailModal.tsx index 788fcdf576..566aa1848e 100644 --- a/apps/web/app/(app)/environments/[environmentId]/(people)/attributes/components/AttributeDetailModal.tsx +++ b/apps/web/app/(app)/environments/[environmentId]/(people)/attributes/components/AttributeDetailModal.tsx @@ -1,8 +1,6 @@ import { TagIcon } from "lucide-react"; - import { TAttributeClass } from "@formbricks/types/attributeClasses"; import { ModalWithTabs } from "@formbricks/ui/ModalWithTabs"; - import { AttributeActivityTab } from "./AttributeActivityTab"; import { AttributeSettingsTab } from "./AttributeSettingsTab"; diff --git a/apps/web/app/(app)/environments/[environmentId]/(people)/attributes/components/AttributeRowData.tsx b/apps/web/app/(app)/environments/[environmentId]/(people)/attributes/components/AttributeRowData.tsx index 9327e11b00..a3ed71cc9c 100644 --- a/apps/web/app/(app)/environments/[environmentId]/(people)/attributes/components/AttributeRowData.tsx +++ b/apps/web/app/(app)/environments/[environmentId]/(people)/attributes/components/AttributeRowData.tsx @@ -1,5 +1,4 @@ import { TagIcon } from "lucide-react"; - import { timeSinceConditionally } from "@formbricks/lib/time"; import { Badge } from "@formbricks/ui/Badge"; diff --git a/apps/web/app/(app)/environments/[environmentId]/(people)/attributes/components/AttributeSettingsTab.tsx b/apps/web/app/(app)/environments/[environmentId]/(people)/attributes/components/AttributeSettingsTab.tsx index cc20e92eea..9ad4b4b70b 100644 --- a/apps/web/app/(app)/environments/[environmentId]/(people)/attributes/components/AttributeSettingsTab.tsx +++ b/apps/web/app/(app)/environments/[environmentId]/(people)/attributes/components/AttributeSettingsTab.tsx @@ -5,7 +5,6 @@ import { ArchiveIcon, ArchiveXIcon } from "lucide-react"; import { useRouter } from "next/navigation"; import { useState } from "react"; import { useForm } from "react-hook-form"; - import { updateAttributeClass } from "@formbricks/lib/attributeClass/service"; import { Button } from "@formbricks/ui/Button"; import { Input } from "@formbricks/ui/Input"; diff --git a/apps/web/app/(app)/environments/[environmentId]/(people)/attributes/components/HowToAddAttributesButton.tsx b/apps/web/app/(app)/environments/[environmentId]/(people)/attributes/components/HowToAddAttributesButton.tsx index afcc3254e1..838f227f50 100644 --- a/apps/web/app/(app)/environments/[environmentId]/(people)/attributes/components/HowToAddAttributesButton.tsx +++ b/apps/web/app/(app)/environments/[environmentId]/(people)/attributes/components/HowToAddAttributesButton.tsx @@ -1,5 +1,4 @@ import { HelpCircleIcon } from "lucide-react"; - import { Button } from "@formbricks/ui/Button"; export const HowToAddAttributesButton = () => { diff --git a/apps/web/app/(app)/environments/[environmentId]/(people)/attributes/loading.tsx b/apps/web/app/(app)/environments/[environmentId]/(people)/attributes/loading.tsx index 073ddacb95..ecb905c41d 100644 --- a/apps/web/app/(app)/environments/[environmentId]/(people)/attributes/loading.tsx +++ b/apps/web/app/(app)/environments/[environmentId]/(people)/attributes/loading.tsx @@ -1,6 +1,5 @@ import { PeopleSecondaryNavigation } from "@/app/(app)/environments/[environmentId]/(people)/people/components/PeopleSecondaryNavigation"; import { TagIcon } from "lucide-react"; - import { PageContentWrapper } from "@formbricks/ui/PageContentWrapper"; import { PageHeader } from "@formbricks/ui/PageHeader"; diff --git a/apps/web/app/(app)/environments/[environmentId]/(people)/attributes/page.tsx b/apps/web/app/(app)/environments/[environmentId]/(people)/attributes/page.tsx index c43a0d7e99..65c6b2c580 100644 --- a/apps/web/app/(app)/environments/[environmentId]/(people)/attributes/page.tsx +++ b/apps/web/app/(app)/environments/[environmentId]/(people)/attributes/page.tsx @@ -1,12 +1,10 @@ import { PeopleSecondaryNavigation } from "@/app/(app)/environments/[environmentId]/(people)/people/components/PeopleSecondaryNavigation"; import { CircleHelpIcon } from "lucide-react"; import { Metadata } from "next"; - import { getAttributeClasses } from "@formbricks/lib/attributeClass/service"; import { Button } from "@formbricks/ui/Button"; import { PageContentWrapper } from "@formbricks/ui/PageContentWrapper"; import { PageHeader } from "@formbricks/ui/PageHeader"; - import { AttributeClassesTable } from "./components/AttributeClassesTable"; export const metadata: Metadata = { diff --git a/apps/web/app/(app)/environments/[environmentId]/(people)/people/[personId]/actions.ts b/apps/web/app/(app)/environments/[environmentId]/(people)/people/[personId]/actions.ts index f89dae2a02..8bc4fb0f80 100644 --- a/apps/web/app/(app)/environments/[environmentId]/(people)/people/[personId]/actions.ts +++ b/apps/web/app/(app)/environments/[environmentId]/(people)/people/[personId]/actions.ts @@ -1,7 +1,6 @@ "use server"; import { getServerSession } from "next-auth"; - import { authOptions } from "@formbricks/lib/authOptions"; import { canUserAccessPerson } from "@formbricks/lib/person/auth"; import { deletePerson } from "@formbricks/lib/person/service"; diff --git a/apps/web/app/(app)/environments/[environmentId]/(people)/people/[personId]/components/ActivityItemComponents.tsx b/apps/web/app/(app)/environments/[environmentId]/(people)/people/[personId]/components/ActivityItemComponents.tsx index 0bfdf322fe..5aa68ac1e7 100644 --- a/apps/web/app/(app)/environments/[environmentId]/(people)/people/[personId]/components/ActivityItemComponents.tsx +++ b/apps/web/app/(app)/environments/[environmentId]/(people)/people/[personId]/components/ActivityItemComponents.tsx @@ -1,6 +1,5 @@ import { formatDistance } from "date-fns"; import { CodeIcon, MousePointerClickIcon, SparklesIcon } from "lucide-react"; - import { TAction } from "@formbricks/types/actions"; import { Label } from "@formbricks/ui/Label"; import { Popover, PopoverContent, PopoverTrigger } from "@formbricks/ui/Popover"; diff --git a/apps/web/app/(app)/environments/[environmentId]/(people)/people/[personId]/components/ActivitySection.tsx b/apps/web/app/(app)/environments/[environmentId]/(people)/people/[personId]/components/ActivitySection.tsx index f8748f9ba4..c9e11b79d6 100644 --- a/apps/web/app/(app)/environments/[environmentId]/(people)/people/[personId]/components/ActivitySection.tsx +++ b/apps/web/app/(app)/environments/[environmentId]/(people)/people/[personId]/components/ActivitySection.tsx @@ -1,5 +1,4 @@ import { ActivityTimeline } from "@/app/(app)/environments/[environmentId]/(people)/people/[personId]/components/ActivityTimeline"; - import { getActionsByPersonId } from "@formbricks/lib/action/service"; import { IS_FORMBRICKS_CLOUD } from "@formbricks/lib/constants"; import { getEnvironment } from "@formbricks/lib/environment/service"; diff --git a/apps/web/app/(app)/environments/[environmentId]/(people)/people/[personId]/components/ActivityTimeline.tsx b/apps/web/app/(app)/environments/[environmentId]/(people)/people/[personId]/components/ActivityTimeline.tsx index 8626c3a34c..478b81289d 100644 --- a/apps/web/app/(app)/environments/[environmentId]/(people)/people/[personId]/components/ActivityTimeline.tsx +++ b/apps/web/app/(app)/environments/[environmentId]/(people)/people/[personId]/components/ActivityTimeline.tsx @@ -2,7 +2,6 @@ import { TAction } from "@formbricks/types/actions"; import { TEnvironment } from "@formbricks/types/environment"; import { EmptySpaceFiller } from "@formbricks/ui/EmptySpaceFiller"; import { UpgradePlanNotice } from "@formbricks/ui/UpgradePlanNotice"; - import { ActivityItemContent, ActivityItemIcon, ActivityItemPopover } from "./ActivityItemComponents"; interface IActivityTimelineProps { diff --git a/apps/web/app/(app)/environments/[environmentId]/(people)/people/[personId]/components/DeletePersonButton.tsx b/apps/web/app/(app)/environments/[environmentId]/(people)/people/[personId]/components/DeletePersonButton.tsx index 493bd684c6..fa8b7d9bff 100644 --- a/apps/web/app/(app)/environments/[environmentId]/(people)/people/[personId]/components/DeletePersonButton.tsx +++ b/apps/web/app/(app)/environments/[environmentId]/(people)/people/[personId]/components/DeletePersonButton.tsx @@ -5,7 +5,6 @@ import { TrashIcon } from "lucide-react"; import { useRouter } from "next/navigation"; import { useState } from "react"; import toast from "react-hot-toast"; - import { DeleteDialog } from "@formbricks/ui/DeleteDialog"; interface DeletePersonButtonProps { diff --git a/apps/web/app/(app)/environments/[environmentId]/(people)/people/[personId]/components/ResponseSection.tsx b/apps/web/app/(app)/environments/[environmentId]/(people)/people/[personId]/components/ResponseSection.tsx index 185dc44fbb..0b52484874 100644 --- a/apps/web/app/(app)/environments/[environmentId]/(people)/people/[personId]/components/ResponseSection.tsx +++ b/apps/web/app/(app)/environments/[environmentId]/(people)/people/[personId]/components/ResponseSection.tsx @@ -1,6 +1,5 @@ import { ResponseTimeline } from "@/app/(app)/environments/[environmentId]/(people)/people/[personId]/components/ResponseTimeline"; import { getServerSession } from "next-auth"; - import { authOptions } from "@formbricks/lib/authOptions"; import { getResponsesByPersonId } from "@formbricks/lib/response/service"; import { getSurveys } from "@formbricks/lib/survey/service"; diff --git a/apps/web/app/(app)/environments/[environmentId]/(people)/people/[personId]/components/ResponseTimeline.tsx b/apps/web/app/(app)/environments/[environmentId]/(people)/people/[personId]/components/ResponseTimeline.tsx index 15ee7d7ae7..bc75572f98 100644 --- a/apps/web/app/(app)/environments/[environmentId]/(people)/people/[personId]/components/ResponseTimeline.tsx +++ b/apps/web/app/(app)/environments/[environmentId]/(people)/people/[personId]/components/ResponseTimeline.tsx @@ -3,7 +3,6 @@ import { ResponseFeed } from "@/app/(app)/environments/[environmentId]/(people)/people/[personId]/components/ResponsesFeed"; import { ArrowDownUpIcon } from "lucide-react"; import { useEffect, useState } from "react"; - import { TAttributeClass } from "@formbricks/types/attributeClasses"; import { TEnvironment } from "@formbricks/types/environment"; import { TResponse } from "@formbricks/types/responses"; diff --git a/apps/web/app/(app)/environments/[environmentId]/(people)/people/[personId]/components/ResponsesFeed.tsx b/apps/web/app/(app)/environments/[environmentId]/(people)/people/[personId]/components/ResponsesFeed.tsx index 0894584267..56e92a496d 100644 --- a/apps/web/app/(app)/environments/[environmentId]/(people)/people/[personId]/components/ResponsesFeed.tsx +++ b/apps/web/app/(app)/environments/[environmentId]/(people)/people/[personId]/components/ResponsesFeed.tsx @@ -1,7 +1,6 @@ "use client"; import { useEffect, useState } from "react"; - import { useMembershipRole } from "@formbricks/lib/membership/hooks/useMembershipRole"; import { getAccessFlags } from "@formbricks/lib/membership/utils"; import { replaceHeadlineRecall } from "@formbricks/lib/utils/recall"; diff --git a/apps/web/app/(app)/environments/[environmentId]/(people)/people/[personId]/loading.tsx b/apps/web/app/(app)/environments/[environmentId]/(people)/people/[personId]/loading.tsx index e43095984e..f5a8f98f24 100644 --- a/apps/web/app/(app)/environments/[environmentId]/(people)/people/[personId]/loading.tsx +++ b/apps/web/app/(app)/environments/[environmentId]/(people)/people/[personId]/loading.tsx @@ -4,7 +4,6 @@ import { } from "@/app/(app)/environments/[environmentId]/(people)/people/[personId]/components/ActivityItemComponents"; import { ArrowDownUpIcon } from "lucide-react"; import { TrashIcon } from "lucide-react"; - import { TAction } from "@formbricks/types/actions"; import { BackIcon } from "@formbricks/ui/icons"; diff --git a/apps/web/app/(app)/environments/[environmentId]/(people)/people/[personId]/page.tsx b/apps/web/app/(app)/environments/[environmentId]/(people)/people/[personId]/page.tsx index df45d56aa2..2bd7f46dad 100644 --- a/apps/web/app/(app)/environments/[environmentId]/(people)/people/[personId]/page.tsx +++ b/apps/web/app/(app)/environments/[environmentId]/(people)/people/[personId]/page.tsx @@ -3,7 +3,6 @@ import { AttributesSection } from "@/app/(app)/environments/[environmentId]/(peo import { DeletePersonButton } from "@/app/(app)/environments/[environmentId]/(people)/people/[personId]/components/DeletePersonButton"; import { ResponseSection } from "@/app/(app)/environments/[environmentId]/(people)/people/[personId]/components/ResponseSection"; import { getServerSession } from "next-auth"; - import { getAttributes } from "@formbricks/lib/attribute/service"; import { getAttributeClasses } from "@formbricks/lib/attributeClass/service"; import { authOptions } from "@formbricks/lib/authOptions"; diff --git a/apps/web/app/(app)/environments/[environmentId]/(people)/people/components/PersonCard.tsx b/apps/web/app/(app)/environments/[environmentId]/(people)/people/components/PersonCard.tsx index 19ae5bffed..f40240378d 100644 --- a/apps/web/app/(app)/environments/[environmentId]/(people)/people/components/PersonCard.tsx +++ b/apps/web/app/(app)/environments/[environmentId]/(people)/people/components/PersonCard.tsx @@ -1,6 +1,5 @@ import Link from "next/link"; import React from "react"; - import { getAttributes } from "@formbricks/lib/attribute/service"; import { getPersonIdentifier } from "@formbricks/lib/person/utils"; import { TPerson } from "@formbricks/types/people"; diff --git a/apps/web/app/(app)/environments/[environmentId]/(people)/people/loading.tsx b/apps/web/app/(app)/environments/[environmentId]/(people)/people/loading.tsx index 7245ac9805..84d10b5a8b 100644 --- a/apps/web/app/(app)/environments/[environmentId]/(people)/people/loading.tsx +++ b/apps/web/app/(app)/environments/[environmentId]/(people)/people/loading.tsx @@ -1,5 +1,4 @@ import { PeopleSecondaryNavigation } from "@/app/(app)/environments/[environmentId]/(people)/people/components/PeopleSecondaryNavigation"; - import { PageContentWrapper } from "@formbricks/ui/PageContentWrapper"; import { PageHeader } from "@formbricks/ui/PageHeader"; diff --git a/apps/web/app/(app)/environments/[environmentId]/(people)/people/page.tsx b/apps/web/app/(app)/environments/[environmentId]/(people)/people/page.tsx index f51fb9184a..3126835290 100644 --- a/apps/web/app/(app)/environments/[environmentId]/(people)/people/page.tsx +++ b/apps/web/app/(app)/environments/[environmentId]/(people)/people/page.tsx @@ -1,6 +1,5 @@ import { PeopleSecondaryNavigation } from "@/app/(app)/environments/[environmentId]/(people)/people/components/PeopleSecondaryNavigation"; import { CircleHelpIcon } from "lucide-react"; - import { ITEMS_PER_PAGE } from "@formbricks/lib/constants"; import { getEnvironment } from "@formbricks/lib/environment/service"; import { getPeople, getPeopleCount } from "@formbricks/lib/person/service"; @@ -10,7 +9,6 @@ import { EmptySpaceFiller } from "@formbricks/ui/EmptySpaceFiller"; import { PageContentWrapper } from "@formbricks/ui/PageContentWrapper"; import { PageHeader } from "@formbricks/ui/PageHeader"; import { Pagination } from "@formbricks/ui/Pagination"; - import { PersonCard } from "./components/PersonCard"; const Page = async ({ diff --git a/apps/web/app/(app)/environments/[environmentId]/(people)/segments/actions.ts b/apps/web/app/(app)/environments/[environmentId]/(people)/segments/actions.ts index 8e67c82b46..d836dd771b 100644 --- a/apps/web/app/(app)/environments/[environmentId]/(people)/segments/actions.ts +++ b/apps/web/app/(app)/environments/[environmentId]/(people)/segments/actions.ts @@ -1,7 +1,6 @@ "use server"; import { getServerSession } from "next-auth"; - import { authOptions } from "@formbricks/lib/authOptions"; import { hasUserEnvironmentAccess } from "@formbricks/lib/environment/auth"; import { deleteSegment, getSegment, updateSegment } from "@formbricks/lib/segment/service"; diff --git a/apps/web/app/(app)/environments/[environmentId]/(people)/segments/components/BasicSegmentSettings.tsx b/apps/web/app/(app)/environments/[environmentId]/(people)/segments/components/BasicSegmentSettings.tsx index 12597525bd..d622d03895 100644 --- a/apps/web/app/(app)/environments/[environmentId]/(people)/segments/components/BasicSegmentSettings.tsx +++ b/apps/web/app/(app)/environments/[environmentId]/(people)/segments/components/BasicSegmentSettings.tsx @@ -4,7 +4,6 @@ import { FilterIcon, Trash2 } from "lucide-react"; import { useRouter } from "next/navigation"; import { useMemo, useState } from "react"; import toast from "react-hot-toast"; - import { structuredClone } from "@formbricks/lib/pollyfills/structuredClone"; import { isAdvancedSegment } from "@formbricks/lib/segment/utils"; import { TAttributeClass } from "@formbricks/types/attributeClasses"; @@ -15,7 +14,6 @@ import { Button } from "@formbricks/ui/Button"; import { ConfirmDeleteSegmentModal } from "@formbricks/ui/ConfirmDeleteSegmentModal"; import { Input } from "@formbricks/ui/Input"; import { UpgradePlanNotice } from "@formbricks/ui/UpgradePlanNotice"; - import { deleteBasicSegmentAction, updateBasicSegmentAction } from "../actions"; type TBasicSegmentSettingsTabProps = { diff --git a/apps/web/app/(app)/environments/[environmentId]/(people)/segments/components/SegmentTable.tsx b/apps/web/app/(app)/environments/[environmentId]/(people)/segments/components/SegmentTable.tsx index 8c913d5a84..219be99fd9 100644 --- a/apps/web/app/(app)/environments/[environmentId]/(people)/segments/components/SegmentTable.tsx +++ b/apps/web/app/(app)/environments/[environmentId]/(people)/segments/components/SegmentTable.tsx @@ -1,7 +1,6 @@ import { TActionClass } from "@formbricks/types/actionClasses"; import { TAttributeClass } from "@formbricks/types/attributeClasses"; import { TSegment } from "@formbricks/types/segment"; - import { SegmentTableDataRowContainer } from "./SegmentTableDataRowContainer"; type TSegmentTableProps = { diff --git a/apps/web/app/(app)/environments/[environmentId]/(people)/segments/components/SegmentTableDataRow.tsx b/apps/web/app/(app)/environments/[environmentId]/(people)/segments/components/SegmentTableDataRow.tsx index 2a5f2071d1..da79323c14 100644 --- a/apps/web/app/(app)/environments/[environmentId]/(people)/segments/components/SegmentTableDataRow.tsx +++ b/apps/web/app/(app)/environments/[environmentId]/(people)/segments/components/SegmentTableDataRow.tsx @@ -3,11 +3,9 @@ import { format, formatDistanceToNow } from "date-fns"; import { UsersIcon } from "lucide-react"; import { useState } from "react"; - import { TActionClass } from "@formbricks/types/actionClasses"; import { TAttributeClass } from "@formbricks/types/attributeClasses"; import { TSegment, TSegmentWithSurveyNames } from "@formbricks/types/segment"; - import { EditSegmentModal } from "./EditSegmentModal"; type TSegmentTableDataRowProps = { diff --git a/apps/web/app/(app)/environments/[environmentId]/(people)/segments/components/SegmentTableDataRowContainer.tsx b/apps/web/app/(app)/environments/[environmentId]/(people)/segments/components/SegmentTableDataRowContainer.tsx index e93b2e3afc..f6bfcb3109 100644 --- a/apps/web/app/(app)/environments/[environmentId]/(people)/segments/components/SegmentTableDataRowContainer.tsx +++ b/apps/web/app/(app)/environments/[environmentId]/(people)/segments/components/SegmentTableDataRowContainer.tsx @@ -3,7 +3,6 @@ import { getSurveysBySegmentId } from "@formbricks/lib/survey/service"; import { TActionClass } from "@formbricks/types/actionClasses"; import { TAttributeClass } from "@formbricks/types/attributeClasses"; import { TSegment } from "@formbricks/types/segment"; - import { SegmentTableDataRow } from "./SegmentTableDataRow"; type TSegmentTableDataRowProps = { diff --git a/apps/web/app/(app)/environments/[environmentId]/(people)/segments/loading.tsx b/apps/web/app/(app)/environments/[environmentId]/(people)/segments/loading.tsx index 2ed4c4ea5a..1e379c4d56 100644 --- a/apps/web/app/(app)/environments/[environmentId]/(people)/segments/loading.tsx +++ b/apps/web/app/(app)/environments/[environmentId]/(people)/segments/loading.tsx @@ -1,6 +1,5 @@ import { PeopleSecondaryNavigation } from "@/app/(app)/environments/[environmentId]/(people)/people/components/PeopleSecondaryNavigation"; import { UsersIcon } from "lucide-react"; - import { PageContentWrapper } from "@formbricks/ui/PageContentWrapper"; import { PageHeader } from "@formbricks/ui/PageHeader"; diff --git a/apps/web/app/(app)/environments/[environmentId]/actions.ts b/apps/web/app/(app)/environments/[environmentId]/actions.ts index 1376cf802d..22ab2a321b 100644 --- a/apps/web/app/(app)/environments/[environmentId]/actions.ts +++ b/apps/web/app/(app)/environments/[environmentId]/actions.ts @@ -2,7 +2,6 @@ import { Organization } from "@prisma/client"; import { getServerSession } from "next-auth"; - import { getIsMultiOrgEnabled } from "@formbricks/ee/lib/service"; import { authOptions } from "@formbricks/lib/authOptions"; import { SHORT_URL_BASE, WEBAPP_URL } from "@formbricks/lib/constants"; diff --git a/apps/web/app/(app)/environments/[environmentId]/actions/components/ActionActivityTab.tsx b/apps/web/app/(app)/environments/[environmentId]/actions/components/ActionActivityTab.tsx index b3f90dcada..1e9878f3a3 100644 --- a/apps/web/app/(app)/environments/[environmentId]/actions/components/ActionActivityTab.tsx +++ b/apps/web/app/(app)/environments/[environmentId]/actions/components/ActionActivityTab.tsx @@ -2,14 +2,12 @@ import { Code2Icon, MousePointerClickIcon, SparklesIcon } from "lucide-react"; import { useEffect, useState } from "react"; - import { convertDateTimeStringShort } from "@formbricks/lib/time"; import { capitalizeFirstLetter } from "@formbricks/lib/utils/strings"; import { TActionClass } from "@formbricks/types/actionClasses"; import { ErrorComponent } from "@formbricks/ui/ErrorComponent"; import { Label } from "@formbricks/ui/Label"; import { LoadingSpinner } from "@formbricks/ui/LoadingSpinner"; - import { getActionCountInLast7DaysAction, getActionCountInLast24HoursAction, diff --git a/apps/web/app/(app)/environments/[environmentId]/actions/components/ActionClassesTable.tsx b/apps/web/app/(app)/environments/[environmentId]/actions/components/ActionClassesTable.tsx index a47399c3e1..ede49c186f 100644 --- a/apps/web/app/(app)/environments/[environmentId]/actions/components/ActionClassesTable.tsx +++ b/apps/web/app/(app)/environments/[environmentId]/actions/components/ActionClassesTable.tsx @@ -1,11 +1,9 @@ "use client"; import { useState } from "react"; - import { useMembershipRole } from "@formbricks/lib/membership/hooks/useMembershipRole"; import { TActionClass } from "@formbricks/types/actionClasses"; import { ErrorComponent } from "@formbricks/ui/ErrorComponent"; - import { ActionDetailModal } from "./ActionDetailModal"; interface ActionClassesTableProps { diff --git a/apps/web/app/(app)/environments/[environmentId]/actions/components/ActionDetailModal.tsx b/apps/web/app/(app)/environments/[environmentId]/actions/components/ActionDetailModal.tsx index 78c3c568c9..e0c32bdaf0 100644 --- a/apps/web/app/(app)/environments/[environmentId]/actions/components/ActionDetailModal.tsx +++ b/apps/web/app/(app)/environments/[environmentId]/actions/components/ActionDetailModal.tsx @@ -1,9 +1,7 @@ import { Code2Icon, MousePointerClickIcon, SparklesIcon } from "lucide-react"; - import { TActionClass } from "@formbricks/types/actionClasses"; import { TMembershipRole } from "@formbricks/types/memberships"; import { ModalWithTabs } from "@formbricks/ui/ModalWithTabs"; - import { EventActivityTab } from "./ActionActivityTab"; import { ActionSettingsTab } from "./ActionSettingsTab"; diff --git a/apps/web/app/(app)/environments/[environmentId]/actions/components/ActionRowData.tsx b/apps/web/app/(app)/environments/[environmentId]/actions/components/ActionRowData.tsx index 004e2d5108..27e6c9a38f 100644 --- a/apps/web/app/(app)/environments/[environmentId]/actions/components/ActionRowData.tsx +++ b/apps/web/app/(app)/environments/[environmentId]/actions/components/ActionRowData.tsx @@ -1,5 +1,4 @@ import { Code2Icon, MousePointerClickIcon, SparklesIcon } from "lucide-react"; - import { timeSinceConditionally } from "@formbricks/lib/time"; import { TActionClass } from "@formbricks/types/actionClasses"; diff --git a/apps/web/app/(app)/environments/[environmentId]/actions/components/ActionSettingsTab.tsx b/apps/web/app/(app)/environments/[environmentId]/actions/components/ActionSettingsTab.tsx index 7f36b1731c..d00db100fa 100644 --- a/apps/web/app/(app)/environments/[environmentId]/actions/components/ActionSettingsTab.tsx +++ b/apps/web/app/(app)/environments/[environmentId]/actions/components/ActionSettingsTab.tsx @@ -12,7 +12,6 @@ import { useMemo, useState } from "react"; import { FormProvider, useForm } from "react-hook-form"; import { toast } from "react-hot-toast"; import { z } from "zod"; - import { getAccessFlags } from "@formbricks/lib/membership/utils"; import { TActionClass, TActionClassInput, ZActionClassInput } from "@formbricks/types/actionClasses"; import { TMembershipRole } from "@formbricks/types/memberships"; diff --git a/apps/web/app/(app)/environments/[environmentId]/actions/page.tsx b/apps/web/app/(app)/environments/[environmentId]/actions/page.tsx index aa394f8298..e48bc1cd02 100644 --- a/apps/web/app/(app)/environments/[environmentId]/actions/page.tsx +++ b/apps/web/app/(app)/environments/[environmentId]/actions/page.tsx @@ -3,7 +3,6 @@ import { ActionClassDataRow } from "@/app/(app)/environments/[environmentId]/act import { ActionTableHeading } from "@/app/(app)/environments/[environmentId]/actions/components/ActionTableHeading"; import { AddActionModal } from "@/app/(app)/environments/[environmentId]/actions/components/AddActionModal"; import { Metadata } from "next"; - import { getActionClasses } from "@formbricks/lib/actionClass/service"; import { IS_FORMBRICKS_CLOUD } from "@formbricks/lib/constants"; import { getOrganizationByEnvironmentId } from "@formbricks/lib/organization/service"; diff --git a/apps/web/app/(app)/environments/[environmentId]/components/AddProductModal.tsx b/apps/web/app/(app)/environments/[environmentId]/components/AddProductModal.tsx index 683b58c9b7..21dae49b4d 100644 --- a/apps/web/app/(app)/environments/[environmentId]/components/AddProductModal.tsx +++ b/apps/web/app/(app)/environments/[environmentId]/components/AddProductModal.tsx @@ -6,7 +6,6 @@ import { useRouter } from "next/navigation"; import { useState } from "react"; import { useForm } from "react-hook-form"; import toast from "react-hot-toast"; - import { Button } from "@formbricks/ui/Button"; import { Input } from "@formbricks/ui/Input"; import { Label } from "@formbricks/ui/Label"; diff --git a/apps/web/app/(app)/environments/[environmentId]/components/EnvironmentLayout.tsx b/apps/web/app/(app)/environments/[environmentId]/components/EnvironmentLayout.tsx index e455b91839..ae39e443cd 100644 --- a/apps/web/app/(app)/environments/[environmentId]/components/EnvironmentLayout.tsx +++ b/apps/web/app/(app)/environments/[environmentId]/components/EnvironmentLayout.tsx @@ -1,7 +1,6 @@ import { MainNavigation } from "@/app/(app)/environments/[environmentId]/components/MainNavigation"; import { TopControlBar } from "@/app/(app)/environments/[environmentId]/components/TopControlBar"; import type { Session } from "next-auth"; - import { getIsMultiOrgEnabled } from "@formbricks/ee/lib/service"; import { IS_FORMBRICKS_CLOUD } from "@formbricks/lib/constants"; import { getEnvironment, getEnvironments } from "@formbricks/lib/environment/service"; diff --git a/apps/web/app/(app)/environments/[environmentId]/components/EnvironmentSwitch.tsx b/apps/web/app/(app)/environments/[environmentId]/components/EnvironmentSwitch.tsx index fee4a8b990..fb22b711a4 100644 --- a/apps/web/app/(app)/environments/[environmentId]/components/EnvironmentSwitch.tsx +++ b/apps/web/app/(app)/environments/[environmentId]/components/EnvironmentSwitch.tsx @@ -2,7 +2,6 @@ import { useRouter } from "next/navigation"; import { useState } from "react"; - import { cn } from "@formbricks/lib/cn"; import { TEnvironment } from "@formbricks/types/environment"; import { Label } from "@formbricks/ui/Label"; diff --git a/apps/web/app/(app)/environments/[environmentId]/components/MainNavigation.tsx b/apps/web/app/(app)/environments/[environmentId]/components/MainNavigation.tsx index b324cd3882..df7709c154 100644 --- a/apps/web/app/(app)/environments/[environmentId]/components/MainNavigation.tsx +++ b/apps/web/app/(app)/environments/[environmentId]/components/MainNavigation.tsx @@ -26,7 +26,6 @@ import Image from "next/image"; import Link from "next/link"; import { usePathname, useRouter } from "next/navigation"; import { useEffect, useMemo, useState } from "react"; - import { cn } from "@formbricks/lib/cn"; import { getAccessFlags } from "@formbricks/lib/membership/utils"; import { capitalizeFirstLetter, truncate } from "@formbricks/lib/utils/strings"; @@ -50,7 +49,6 @@ import { DropdownMenuSubTrigger, DropdownMenuTrigger, } from "@formbricks/ui/DropdownMenu"; - import { AddProductModal } from "./AddProductModal"; interface NavigationProps { diff --git a/apps/web/app/(app)/environments/[environmentId]/components/NavigationLink.tsx b/apps/web/app/(app)/environments/[environmentId]/components/NavigationLink.tsx index dfcf736572..0de2d049fd 100644 --- a/apps/web/app/(app)/environments/[environmentId]/components/NavigationLink.tsx +++ b/apps/web/app/(app)/environments/[environmentId]/components/NavigationLink.tsx @@ -1,6 +1,5 @@ import Link from "next/link"; import React from "react"; - import { cn } from "@formbricks/lib/cn"; import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from "@formbricks/ui/Tooltip"; diff --git a/apps/web/app/(app)/environments/[environmentId]/components/PosthogIdentify.tsx b/apps/web/app/(app)/environments/[environmentId]/components/PosthogIdentify.tsx index 6387b2c9f2..9448e3d119 100644 --- a/apps/web/app/(app)/environments/[environmentId]/components/PosthogIdentify.tsx +++ b/apps/web/app/(app)/environments/[environmentId]/components/PosthogIdentify.tsx @@ -3,7 +3,6 @@ import type { Session } from "next-auth"; import { usePostHog } from "posthog-js/react"; import { useEffect } from "react"; - import { env } from "@formbricks/lib/env"; import { TSubscriptionStatus } from "@formbricks/types/organizations"; diff --git a/apps/web/app/(app)/environments/[environmentId]/components/TopControlBar.tsx b/apps/web/app/(app)/environments/[environmentId]/components/TopControlBar.tsx index 157f581d05..84851e8f03 100644 --- a/apps/web/app/(app)/environments/[environmentId]/components/TopControlBar.tsx +++ b/apps/web/app/(app)/environments/[environmentId]/components/TopControlBar.tsx @@ -1,6 +1,5 @@ import { TopControlButtons } from "@/app/(app)/environments/[environmentId]/components/TopControlButtons"; import { WidgetStatusIndicator } from "@/app/(app)/environments/[environmentId]/components/WidgetStatusIndicator"; - import { IS_FORMBRICKS_CLOUD } from "@formbricks/lib/constants"; import { TEnvironment } from "@formbricks/types/environment"; diff --git a/apps/web/app/(app)/environments/[environmentId]/components/TopControlButtons.tsx b/apps/web/app/(app)/environments/[environmentId]/components/TopControlButtons.tsx index 31c5d6079d..b52e7d722f 100644 --- a/apps/web/app/(app)/environments/[environmentId]/components/TopControlButtons.tsx +++ b/apps/web/app/(app)/environments/[environmentId]/components/TopControlButtons.tsx @@ -3,7 +3,6 @@ import { EnvironmentSwitch } from "@/app/(app)/environments/[environmentId]/components/EnvironmentSwitch"; import { CircleUserIcon, MessageCircleQuestionIcon, PlusIcon } from "lucide-react"; import { useRouter } from "next/navigation"; - import formbricks from "@formbricks/js/app"; import { TEnvironment } from "@formbricks/types/environment"; import { Button } from "@formbricks/ui/Button"; diff --git a/apps/web/app/(app)/environments/[environmentId]/components/UrlShortenerForm.tsx b/apps/web/app/(app)/environments/[environmentId]/components/UrlShortenerForm.tsx index 03da2544b5..c6e3cb4190 100644 --- a/apps/web/app/(app)/environments/[environmentId]/components/UrlShortenerForm.tsx +++ b/apps/web/app/(app)/environments/[environmentId]/components/UrlShortenerForm.tsx @@ -2,11 +2,9 @@ import clsx from "clsx"; import { useState } from "react"; import { useForm } from "react-hook-form"; import toast from "react-hot-toast"; - import { Button } from "@formbricks/ui/Button"; import { Input } from "@formbricks/ui/Input"; import { Label } from "@formbricks/ui/Label"; - import { createShortUrlAction } from "../actions"; type UrlShortenerFormDataProps = { diff --git a/apps/web/app/(app)/environments/[environmentId]/components/UrlShortenerModal.tsx b/apps/web/app/(app)/environments/[environmentId]/components/UrlShortenerModal.tsx index 92a41448fe..5411a14316 100644 --- a/apps/web/app/(app)/environments/[environmentId]/components/UrlShortenerModal.tsx +++ b/apps/web/app/(app)/environments/[environmentId]/components/UrlShortenerModal.tsx @@ -1,7 +1,5 @@ import { LinkIcon } from "lucide-react"; - import { Modal } from "@formbricks/ui/Modal"; - import { UrlShortenerForm } from "./UrlShortenerForm"; type UrlShortenerModalProps = { diff --git a/apps/web/app/(app)/environments/[environmentId]/components/WidgetStatusIndicator.tsx b/apps/web/app/(app)/environments/[environmentId]/components/WidgetStatusIndicator.tsx index 52f0be358f..a635953ea7 100644 --- a/apps/web/app/(app)/environments/[environmentId]/components/WidgetStatusIndicator.tsx +++ b/apps/web/app/(app)/environments/[environmentId]/components/WidgetStatusIndicator.tsx @@ -1,7 +1,6 @@ import clsx from "clsx"; import { AlertTriangleIcon, CheckIcon } from "lucide-react"; import Link from "next/link"; - import { TEnvironment } from "@formbricks/types/environment"; import { Label } from "@formbricks/ui/Label"; diff --git a/apps/web/app/(app)/environments/[environmentId]/integrations/actions.ts b/apps/web/app/(app)/environments/[environmentId]/integrations/actions.ts index c1d8e74ee8..c1cab5731b 100644 --- a/apps/web/app/(app)/environments/[environmentId]/integrations/actions.ts +++ b/apps/web/app/(app)/environments/[environmentId]/integrations/actions.ts @@ -1,7 +1,6 @@ "use server"; import { getServerSession } from "next-auth"; - import { authOptions } from "@formbricks/lib/authOptions"; import { canUserAccessIntegration } from "@formbricks/lib/integration/auth"; import { createOrUpdateIntegration, deleteIntegration } from "@formbricks/lib/integration/service"; diff --git a/apps/web/app/(app)/environments/[environmentId]/integrations/airtable/components/AddIntegrationModal.tsx b/apps/web/app/(app)/environments/[environmentId]/integrations/airtable/components/AddIntegrationModal.tsx index 8db194bfd2..d338af976d 100644 --- a/apps/web/app/(app)/environments/[environmentId]/integrations/airtable/components/AddIntegrationModal.tsx +++ b/apps/web/app/(app)/environments/[environmentId]/integrations/airtable/components/AddIntegrationModal.tsx @@ -9,7 +9,6 @@ import { useRouter } from "next/navigation"; import { useEffect, useState } from "react"; import { Controller, useForm } from "react-hook-form"; import { toast } from "react-hot-toast"; - import { getLocalizedValue } from "@formbricks/lib/i18n/utils"; import { replaceHeadlineRecall } from "@formbricks/lib/utils/recall"; import { TAttributeClass } from "@formbricks/types/attributeClasses"; diff --git a/apps/web/app/(app)/environments/[environmentId]/integrations/airtable/components/AirtableWrapper.tsx b/apps/web/app/(app)/environments/[environmentId]/integrations/airtable/components/AirtableWrapper.tsx index 960d3ced8f..1e08f20cf7 100644 --- a/apps/web/app/(app)/environments/[environmentId]/integrations/airtable/components/AirtableWrapper.tsx +++ b/apps/web/app/(app)/environments/[environmentId]/integrations/airtable/components/AirtableWrapper.tsx @@ -4,7 +4,6 @@ import { ManageIntegration } from "@/app/(app)/environments/[environmentId]/inte import { authorize } from "@/app/(app)/environments/[environmentId]/integrations/airtable/lib/airtable"; import airtableLogo from "@/images/airtableLogo.svg"; import { useState } from "react"; - import { TAttributeClass } from "@formbricks/types/attributeClasses"; import { TEnvironment } from "@formbricks/types/environment"; import { TIntegrationItem } from "@formbricks/types/integration"; diff --git a/apps/web/app/(app)/environments/[environmentId]/integrations/airtable/components/BaseSelectDropdown.tsx b/apps/web/app/(app)/environments/[environmentId]/integrations/airtable/components/BaseSelectDropdown.tsx index ad8778f7b8..6f4fb292ef 100644 --- a/apps/web/app/(app)/environments/[environmentId]/integrations/airtable/components/BaseSelectDropdown.tsx +++ b/apps/web/app/(app)/environments/[environmentId]/integrations/airtable/components/BaseSelectDropdown.tsx @@ -1,9 +1,7 @@ import { Control, Controller, UseFormSetValue } from "react-hook-form"; - import { TIntegrationItem } from "@formbricks/types/integration"; import { Label } from "@formbricks/ui/Label"; import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from "@formbricks/ui/Select"; - import { IntegrationModalInputs } from "./AddIntegrationModal"; interface BaseSelectProps { diff --git a/apps/web/app/(app)/environments/[environmentId]/integrations/airtable/components/ManageIntegration.tsx b/apps/web/app/(app)/environments/[environmentId]/integrations/airtable/components/ManageIntegration.tsx index 00b1685814..f86172b7a8 100644 --- a/apps/web/app/(app)/environments/[environmentId]/integrations/airtable/components/ManageIntegration.tsx +++ b/apps/web/app/(app)/environments/[environmentId]/integrations/airtable/components/ManageIntegration.tsx @@ -7,7 +7,6 @@ import { } from "@/app/(app)/environments/[environmentId]/integrations/airtable/components/AddIntegrationModal"; import { useState } from "react"; import { toast } from "react-hot-toast"; - import { timeSince } from "@formbricks/lib/time"; import { TAttributeClass } from "@formbricks/types/attributeClasses"; import { TEnvironment } from "@formbricks/types/environment"; diff --git a/apps/web/app/(app)/environments/[environmentId]/integrations/airtable/page.tsx b/apps/web/app/(app)/environments/[environmentId]/integrations/airtable/page.tsx index e764568e97..aaeccdc1e8 100644 --- a/apps/web/app/(app)/environments/[environmentId]/integrations/airtable/page.tsx +++ b/apps/web/app/(app)/environments/[environmentId]/integrations/airtable/page.tsx @@ -1,5 +1,4 @@ import { AirtableWrapper } from "@/app/(app)/environments/[environmentId]/integrations/airtable/components/AirtableWrapper"; - import { getAirtableTables } from "@formbricks/lib/airtable/service"; import { getAttributeClasses } from "@formbricks/lib/attributeClass/service"; import { AIRTABLE_CLIENT_ID, WEBAPP_URL } from "@formbricks/lib/constants"; diff --git a/apps/web/app/(app)/environments/[environmentId]/integrations/components/IntegrationsPageTitle.tsx b/apps/web/app/(app)/environments/[environmentId]/integrations/components/IntegrationsPageTitle.tsx index 6e2810317e..c6a989d583 100644 --- a/apps/web/app/(app)/environments/[environmentId]/integrations/components/IntegrationsPageTitle.tsx +++ b/apps/web/app/(app)/environments/[environmentId]/integrations/components/IntegrationsPageTitle.tsx @@ -1,5 +1,4 @@ import Link from "next/link"; - import { BackIcon } from "@formbricks/ui/icons"; interface IntegrationPageTitleProps { diff --git a/apps/web/app/(app)/environments/[environmentId]/integrations/google-sheets/actions.ts b/apps/web/app/(app)/environments/[environmentId]/integrations/google-sheets/actions.ts index 3bdd6b4b33..0321bd5e4d 100644 --- a/apps/web/app/(app)/environments/[environmentId]/integrations/google-sheets/actions.ts +++ b/apps/web/app/(app)/environments/[environmentId]/integrations/google-sheets/actions.ts @@ -1,7 +1,6 @@ "use server"; import { getServerSession } from "next-auth"; - import { authOptions } from "@formbricks/lib/authOptions"; import { hasUserEnvironmentAccess } from "@formbricks/lib/environment/auth"; import { getSpreadsheetNameById } from "@formbricks/lib/googleSheet/service"; diff --git a/apps/web/app/(app)/environments/[environmentId]/integrations/google-sheets/components/AddIntegrationModal.tsx b/apps/web/app/(app)/environments/[environmentId]/integrations/google-sheets/components/AddIntegrationModal.tsx index 68723148f6..443f290ed0 100644 --- a/apps/web/app/(app)/environments/[environmentId]/integrations/google-sheets/components/AddIntegrationModal.tsx +++ b/apps/web/app/(app)/environments/[environmentId]/integrations/google-sheets/components/AddIntegrationModal.tsx @@ -10,7 +10,6 @@ import Image from "next/image"; import { useEffect, useState } from "react"; import { useForm } from "react-hook-form"; import toast from "react-hot-toast"; - import { getLocalizedValue } from "@formbricks/lib/i18n/utils"; import { replaceHeadlineRecall } from "@formbricks/lib/utils/recall"; import { TAttributeClass } from "@formbricks/types/attributeClasses"; diff --git a/apps/web/app/(app)/environments/[environmentId]/integrations/google-sheets/components/GoogleSheetWrapper.tsx b/apps/web/app/(app)/environments/[environmentId]/integrations/google-sheets/components/GoogleSheetWrapper.tsx index f8f8a25f4e..cb1486d53b 100644 --- a/apps/web/app/(app)/environments/[environmentId]/integrations/google-sheets/components/GoogleSheetWrapper.tsx +++ b/apps/web/app/(app)/environments/[environmentId]/integrations/google-sheets/components/GoogleSheetWrapper.tsx @@ -4,7 +4,6 @@ import { ManageIntegration } from "@/app/(app)/environments/[environmentId]/inte import { authorize } from "@/app/(app)/environments/[environmentId]/integrations/google-sheets/lib/google"; import googleSheetLogo from "@/images/googleSheetsLogo.png"; import { useState } from "react"; - import { TAttributeClass } from "@formbricks/types/attributeClasses"; import { TEnvironment } from "@formbricks/types/environment"; import { @@ -13,7 +12,6 @@ import { } from "@formbricks/types/integration/googleSheet"; import { TSurvey } from "@formbricks/types/surveys"; import { ConnectIntegration } from "@formbricks/ui/ConnectIntegration"; - import { AddIntegrationModal } from "./AddIntegrationModal"; interface GoogleSheetWrapperProps { diff --git a/apps/web/app/(app)/environments/[environmentId]/integrations/google-sheets/components/ManageIntegration.tsx b/apps/web/app/(app)/environments/[environmentId]/integrations/google-sheets/components/ManageIntegration.tsx index 2896762472..9c7ef137a7 100644 --- a/apps/web/app/(app)/environments/[environmentId]/integrations/google-sheets/components/ManageIntegration.tsx +++ b/apps/web/app/(app)/environments/[environmentId]/integrations/google-sheets/components/ManageIntegration.tsx @@ -4,7 +4,6 @@ import { deleteIntegrationAction } from "@/app/(app)/environments/[environmentId import { Trash2Icon } from "lucide-react"; import { useState } from "react"; import toast from "react-hot-toast"; - import { timeSince } from "@formbricks/lib/time"; import { TEnvironment } from "@formbricks/types/environment"; import { diff --git a/apps/web/app/(app)/environments/[environmentId]/integrations/google-sheets/page.tsx b/apps/web/app/(app)/environments/[environmentId]/integrations/google-sheets/page.tsx index 49b052033b..b9811e9075 100644 --- a/apps/web/app/(app)/environments/[environmentId]/integrations/google-sheets/page.tsx +++ b/apps/web/app/(app)/environments/[environmentId]/integrations/google-sheets/page.tsx @@ -1,5 +1,4 @@ import { GoogleSheetWrapper } from "@/app/(app)/environments/[environmentId]/integrations/google-sheets/components/GoogleSheetWrapper"; - import { getAttributeClasses } from "@formbricks/lib/attributeClass/service"; import { GOOGLE_SHEETS_CLIENT_ID, diff --git a/apps/web/app/(app)/environments/[environmentId]/integrations/notion/actions.ts b/apps/web/app/(app)/environments/[environmentId]/integrations/notion/actions.ts index 0c29418ce6..9829c01e84 100644 --- a/apps/web/app/(app)/environments/[environmentId]/integrations/notion/actions.ts +++ b/apps/web/app/(app)/environments/[environmentId]/integrations/notion/actions.ts @@ -1,7 +1,6 @@ "use server"; import { getServerSession } from "next-auth"; - import { authOptions } from "@formbricks/lib/authOptions"; import { hasUserEnvironmentAccess } from "@formbricks/lib/environment/auth"; import { getNotionDatabases } from "@formbricks/lib/notion/service"; diff --git a/apps/web/app/(app)/environments/[environmentId]/integrations/notion/components/ManageIntegration.tsx b/apps/web/app/(app)/environments/[environmentId]/integrations/notion/components/ManageIntegration.tsx index 81880ee706..3841c03e52 100644 --- a/apps/web/app/(app)/environments/[environmentId]/integrations/notion/components/ManageIntegration.tsx +++ b/apps/web/app/(app)/environments/[environmentId]/integrations/notion/components/ManageIntegration.tsx @@ -2,7 +2,6 @@ import { deleteIntegrationAction } from "@/app/(app)/environments/[environmentId import { Trash2Icon } from "lucide-react"; import React, { useState } from "react"; import toast from "react-hot-toast"; - import { timeSince } from "@formbricks/lib/time"; import { TEnvironment } from "@formbricks/types/environment"; import { TIntegrationNotion, TIntegrationNotionConfigData } from "@formbricks/types/integration/notion"; diff --git a/apps/web/app/(app)/environments/[environmentId]/integrations/notion/components/NotionWrapper.tsx b/apps/web/app/(app)/environments/[environmentId]/integrations/notion/components/NotionWrapper.tsx index e4d0c02852..dbee87447e 100644 --- a/apps/web/app/(app)/environments/[environmentId]/integrations/notion/components/NotionWrapper.tsx +++ b/apps/web/app/(app)/environments/[environmentId]/integrations/notion/components/NotionWrapper.tsx @@ -4,7 +4,6 @@ import { AddIntegrationModal } from "@/app/(app)/environments/[environmentId]/in import { ManageIntegration } from "@/app/(app)/environments/[environmentId]/integrations/notion/components/ManageIntegration"; import notionLogo from "@/images/notion.png"; import { useState } from "react"; - import { TAttributeClass } from "@formbricks/types/attributeClasses"; import { TEnvironment } from "@formbricks/types/environment"; import { @@ -14,7 +13,6 @@ import { } from "@formbricks/types/integration/notion"; import { TSurvey } from "@formbricks/types/surveys"; import { ConnectIntegration } from "@formbricks/ui/ConnectIntegration"; - import { authorize } from "../lib/notion"; interface NotionWrapperProps { diff --git a/apps/web/app/(app)/environments/[environmentId]/integrations/notion/page.tsx b/apps/web/app/(app)/environments/[environmentId]/integrations/notion/page.tsx index ffd300946d..11b9cf6785 100644 --- a/apps/web/app/(app)/environments/[environmentId]/integrations/notion/page.tsx +++ b/apps/web/app/(app)/environments/[environmentId]/integrations/notion/page.tsx @@ -1,5 +1,4 @@ import { NotionWrapper } from "@/app/(app)/environments/[environmentId]/integrations/notion/components/NotionWrapper"; - import { getAttributeClasses } from "@formbricks/lib/attributeClass/service"; import { NOTION_AUTH_URL, diff --git a/apps/web/app/(app)/environments/[environmentId]/integrations/page.tsx b/apps/web/app/(app)/environments/[environmentId]/integrations/page.tsx index 49e646d6eb..8cb8f8087f 100644 --- a/apps/web/app/(app)/environments/[environmentId]/integrations/page.tsx +++ b/apps/web/app/(app)/environments/[environmentId]/integrations/page.tsx @@ -9,7 +9,6 @@ import WebhookLogo from "@/images/webhook.png"; import ZapierLogo from "@/images/zapier-small.png"; import { getServerSession } from "next-auth"; import Image from "next/image"; - import { authOptions } from "@formbricks/lib/authOptions"; import { getEnvironment } from "@formbricks/lib/environment/service"; import { getIntegrations } from "@formbricks/lib/integration/service"; diff --git a/apps/web/app/(app)/environments/[environmentId]/integrations/slack/actions.ts b/apps/web/app/(app)/environments/[environmentId]/integrations/slack/actions.ts index 1d9803384c..76196a2fc7 100644 --- a/apps/web/app/(app)/environments/[environmentId]/integrations/slack/actions.ts +++ b/apps/web/app/(app)/environments/[environmentId]/integrations/slack/actions.ts @@ -1,7 +1,6 @@ "use server"; import { getServerSession } from "next-auth"; - import { authOptions } from "@formbricks/lib/authOptions"; import { hasUserEnvironmentAccess } from "@formbricks/lib/environment/auth"; import { getSlackChannels } from "@formbricks/lib/slack/service"; diff --git a/apps/web/app/(app)/environments/[environmentId]/integrations/slack/components/AddChannelMappingModal.tsx b/apps/web/app/(app)/environments/[environmentId]/integrations/slack/components/AddChannelMappingModal.tsx index 4caf800da3..bb67a2d218 100644 --- a/apps/web/app/(app)/environments/[environmentId]/integrations/slack/components/AddChannelMappingModal.tsx +++ b/apps/web/app/(app)/environments/[environmentId]/integrations/slack/components/AddChannelMappingModal.tsx @@ -4,7 +4,6 @@ import Image from "next/image"; import { useEffect, useMemo, useState } from "react"; import { useForm } from "react-hook-form"; import toast from "react-hot-toast"; - import { getLocalizedValue } from "@formbricks/lib/i18n/utils"; import { replaceHeadlineRecall } from "@formbricks/lib/utils/recall"; import { TAttributeClass } from "@formbricks/types/attributeClasses"; diff --git a/apps/web/app/(app)/environments/[environmentId]/integrations/slack/components/ManageIntegration.tsx b/apps/web/app/(app)/environments/[environmentId]/integrations/slack/components/ManageIntegration.tsx index 0b7955f2e3..2d86da1618 100644 --- a/apps/web/app/(app)/environments/[environmentId]/integrations/slack/components/ManageIntegration.tsx +++ b/apps/web/app/(app)/environments/[environmentId]/integrations/slack/components/ManageIntegration.tsx @@ -4,7 +4,6 @@ import { deleteIntegrationAction } from "@/app/(app)/environments/[environmentId import { Trash2Icon } from "lucide-react"; import React, { useState } from "react"; import toast from "react-hot-toast"; - import { timeSince } from "@formbricks/lib/time"; import { TEnvironment } from "@formbricks/types/environment"; import { TIntegrationSlack, TIntegrationSlackConfigData } from "@formbricks/types/integration/slack"; diff --git a/apps/web/app/(app)/environments/[environmentId]/integrations/slack/components/SlackWrapper.tsx b/apps/web/app/(app)/environments/[environmentId]/integrations/slack/components/SlackWrapper.tsx index e59ad85fcc..281698239a 100644 --- a/apps/web/app/(app)/environments/[environmentId]/integrations/slack/components/SlackWrapper.tsx +++ b/apps/web/app/(app)/environments/[environmentId]/integrations/slack/components/SlackWrapper.tsx @@ -6,7 +6,6 @@ import { ManageIntegration } from "@/app/(app)/environments/[environmentId]/inte import { authorize } from "@/app/(app)/environments/[environmentId]/integrations/slack/lib/slack"; import slackLogo from "@/images/slacklogo.png"; import { useState } from "react"; - import { TAttributeClass } from "@formbricks/types/attributeClasses"; import { TEnvironment } from "@formbricks/types/environment"; import { TIntegrationItem } from "@formbricks/types/integration"; diff --git a/apps/web/app/(app)/environments/[environmentId]/integrations/slack/page.tsx b/apps/web/app/(app)/environments/[environmentId]/integrations/slack/page.tsx index ccf43c360d..f786abb223 100644 --- a/apps/web/app/(app)/environments/[environmentId]/integrations/slack/page.tsx +++ b/apps/web/app/(app)/environments/[environmentId]/integrations/slack/page.tsx @@ -1,5 +1,4 @@ import { SlackWrapper } from "@/app/(app)/environments/[environmentId]/integrations/slack/components/SlackWrapper"; - import { getAttributeClasses } from "@formbricks/lib/attributeClass/service"; import { SLACK_CLIENT_ID, SLACK_CLIENT_SECRET, WEBAPP_URL } from "@formbricks/lib/constants"; import { getEnvironment } from "@formbricks/lib/environment/service"; diff --git a/apps/web/app/(app)/environments/[environmentId]/integrations/webhooks/actions.ts b/apps/web/app/(app)/environments/[environmentId]/integrations/webhooks/actions.ts index 89ab78b874..6ed861ff27 100644 --- a/apps/web/app/(app)/environments/[environmentId]/integrations/webhooks/actions.ts +++ b/apps/web/app/(app)/environments/[environmentId]/integrations/webhooks/actions.ts @@ -1,7 +1,6 @@ "use server"; import { getServerSession } from "next-auth"; - import { authOptions } from "@formbricks/lib/authOptions"; import { hasUserEnvironmentAccess } from "@formbricks/lib/environment/auth"; import { canUserAccessWebhook } from "@formbricks/lib/webhook/auth"; diff --git a/apps/web/app/(app)/environments/[environmentId]/integrations/webhooks/components/AddWebhookButton.tsx b/apps/web/app/(app)/environments/[environmentId]/integrations/webhooks/components/AddWebhookButton.tsx index 3d6d51dcf1..ebc36aa130 100644 --- a/apps/web/app/(app)/environments/[environmentId]/integrations/webhooks/components/AddWebhookButton.tsx +++ b/apps/web/app/(app)/environments/[environmentId]/integrations/webhooks/components/AddWebhookButton.tsx @@ -2,11 +2,9 @@ import { Webhook } from "lucide-react"; import { useState } from "react"; - import { TEnvironment } from "@formbricks/types/environment"; import { TSurvey } from "@formbricks/types/surveys"; import { Button } from "@formbricks/ui/Button"; - import { AddWebhookModal } from "./AddWebhookModal"; interface AddWebhookButtonProps { diff --git a/apps/web/app/(app)/environments/[environmentId]/integrations/webhooks/components/AddWebhookModal.tsx b/apps/web/app/(app)/environments/[environmentId]/integrations/webhooks/components/AddWebhookModal.tsx index 9976d3175c..ffcec716f3 100644 --- a/apps/web/app/(app)/environments/[environmentId]/integrations/webhooks/components/AddWebhookModal.tsx +++ b/apps/web/app/(app)/environments/[environmentId]/integrations/webhooks/components/AddWebhookModal.tsx @@ -8,7 +8,6 @@ import { useRouter } from "next/navigation"; import { useState } from "react"; import { useForm } from "react-hook-form"; import toast from "react-hot-toast"; - import { TPipelineTrigger } from "@formbricks/types/pipelines"; import { TSurvey } from "@formbricks/types/surveys"; import { TWebhookInput } from "@formbricks/types/webhooks"; @@ -16,7 +15,6 @@ import { Button } from "@formbricks/ui/Button"; import { Input } from "@formbricks/ui/Input"; import { Label } from "@formbricks/ui/Label"; import { Modal } from "@formbricks/ui/Modal"; - import { createWebhookAction } from "../actions"; interface AddWebhookModalProps { diff --git a/apps/web/app/(app)/environments/[environmentId]/integrations/webhooks/components/SurveyCheckboxGroup.tsx b/apps/web/app/(app)/environments/[environmentId]/integrations/webhooks/components/SurveyCheckboxGroup.tsx index 554b58f290..4f657dc43f 100644 --- a/apps/web/app/(app)/environments/[environmentId]/integrations/webhooks/components/SurveyCheckboxGroup.tsx +++ b/apps/web/app/(app)/environments/[environmentId]/integrations/webhooks/components/SurveyCheckboxGroup.tsx @@ -1,5 +1,4 @@ import React from "react"; - import { TSurvey } from "@formbricks/types/surveys"; import { Checkbox } from "@formbricks/ui/Checkbox"; diff --git a/apps/web/app/(app)/environments/[environmentId]/integrations/webhooks/components/TriggerCheckboxGroup.tsx b/apps/web/app/(app)/environments/[environmentId]/integrations/webhooks/components/TriggerCheckboxGroup.tsx index 75d1110d31..32ac75790f 100644 --- a/apps/web/app/(app)/environments/[environmentId]/integrations/webhooks/components/TriggerCheckboxGroup.tsx +++ b/apps/web/app/(app)/environments/[environmentId]/integrations/webhooks/components/TriggerCheckboxGroup.tsx @@ -1,5 +1,4 @@ import React from "react"; - import { TPipelineTrigger } from "@formbricks/types/pipelines"; import { Checkbox } from "@formbricks/ui/Checkbox"; diff --git a/apps/web/app/(app)/environments/[environmentId]/integrations/webhooks/components/WebhookDetailModal.tsx b/apps/web/app/(app)/environments/[environmentId]/integrations/webhooks/components/WebhookDetailModal.tsx index f74a4da9a0..8c94ffaa1e 100644 --- a/apps/web/app/(app)/environments/[environmentId]/integrations/webhooks/components/WebhookDetailModal.tsx +++ b/apps/web/app/(app)/environments/[environmentId]/integrations/webhooks/components/WebhookDetailModal.tsx @@ -1,7 +1,6 @@ import { WebhookOverviewTab } from "@/app/(app)/environments/[environmentId]/integrations/webhooks/components/WebhookOverviewTab"; import { WebhookSettingsTab } from "@/app/(app)/environments/[environmentId]/integrations/webhooks/components/WebhookSettingsTab"; import { Webhook } from "lucide-react"; - import { TSurvey } from "@formbricks/types/surveys"; import { TWebhook } from "@formbricks/types/webhooks"; import { ModalWithTabs } from "@formbricks/ui/ModalWithTabs"; diff --git a/apps/web/app/(app)/environments/[environmentId]/integrations/webhooks/components/WebhookSettingsTab.tsx b/apps/web/app/(app)/environments/[environmentId]/integrations/webhooks/components/WebhookSettingsTab.tsx index 788649f99d..5b957a63c4 100644 --- a/apps/web/app/(app)/environments/[environmentId]/integrations/webhooks/components/WebhookSettingsTab.tsx +++ b/apps/web/app/(app)/environments/[environmentId]/integrations/webhooks/components/WebhookSettingsTab.tsx @@ -10,7 +10,6 @@ import { useRouter } from "next/navigation"; import { useState } from "react"; import { useForm } from "react-hook-form"; import { toast } from "react-hot-toast"; - import { TPipelineTrigger } from "@formbricks/types/pipelines"; import { TSurvey } from "@formbricks/types/surveys"; import { TWebhook, TWebhookInput } from "@formbricks/types/webhooks"; @@ -18,7 +17,6 @@ import { Button } from "@formbricks/ui/Button"; import { DeleteDialog } from "@formbricks/ui/DeleteDialog"; import { Input } from "@formbricks/ui/Input"; import { Label } from "@formbricks/ui/Label"; - import { deleteWebhookAction, updateWebhookAction } from "../actions"; interface ActionSettingsTabProps { diff --git a/apps/web/app/(app)/environments/[environmentId]/integrations/webhooks/components/WebhookTable.tsx b/apps/web/app/(app)/environments/[environmentId]/integrations/webhooks/components/WebhookTable.tsx index b8d4c8c441..02127d7345 100644 --- a/apps/web/app/(app)/environments/[environmentId]/integrations/webhooks/components/WebhookTable.tsx +++ b/apps/web/app/(app)/environments/[environmentId]/integrations/webhooks/components/WebhookTable.tsx @@ -2,7 +2,6 @@ import { WebhookModal } from "@/app/(app)/environments/[environmentId]/integrations/webhooks/components/WebhookDetailModal"; import { useState } from "react"; - import { TEnvironment } from "@formbricks/types/environment"; import { TSurvey } from "@formbricks/types/surveys"; import { TWebhook } from "@formbricks/types/webhooks"; diff --git a/apps/web/app/(app)/environments/[environmentId]/integrations/webhooks/page.tsx b/apps/web/app/(app)/environments/[environmentId]/integrations/webhooks/page.tsx index a8c349eb3c..08340bfc0c 100644 --- a/apps/web/app/(app)/environments/[environmentId]/integrations/webhooks/page.tsx +++ b/apps/web/app/(app)/environments/[environmentId]/integrations/webhooks/page.tsx @@ -2,7 +2,6 @@ import { AddWebhookButton } from "@/app/(app)/environments/[environmentId]/integ import { WebhookRowData } from "@/app/(app)/environments/[environmentId]/integrations/webhooks/components/WebhookRowData"; import { WebhookTable } from "@/app/(app)/environments/[environmentId]/integrations/webhooks/components/WebhookTable"; import { WebhookTableHeading } from "@/app/(app)/environments/[environmentId]/integrations/webhooks/components/WebhookTableHeading"; - import { getEnvironment } from "@formbricks/lib/environment/service"; import { getSurveys } from "@formbricks/lib/survey/service"; import { getWebhooks } from "@formbricks/lib/webhook/service"; diff --git a/apps/web/app/(app)/environments/[environmentId]/layout.tsx b/apps/web/app/(app)/environments/[environmentId]/layout.tsx index 78e5cce4bc..5bba2f112b 100644 --- a/apps/web/app/(app)/environments/[environmentId]/layout.tsx +++ b/apps/web/app/(app)/environments/[environmentId]/layout.tsx @@ -2,13 +2,11 @@ import { EnvironmentLayout } from "@/app/(app)/environments/[environmentId]/comp import { ResponseFilterProvider } from "@/app/(app)/environments/[environmentId]/components/ResponseFilterContext"; import { getServerSession } from "next-auth"; import { redirect } from "next/navigation"; - import { authOptions } from "@formbricks/lib/authOptions"; import { hasUserEnvironmentAccess } from "@formbricks/lib/environment/auth"; import { getOrganizationByEnvironmentId } from "@formbricks/lib/organization/service"; import { AuthorizationError } from "@formbricks/types/errors"; import { ToasterClient } from "@formbricks/ui/ToasterClient"; - import { FormbricksClient } from "../../components/FormbricksClient"; import { PosthogIdentify } from "./components/PosthogIdentify"; diff --git a/apps/web/app/(app)/environments/[environmentId]/product/api-keys/actions.ts b/apps/web/app/(app)/environments/[environmentId]/product/api-keys/actions.ts index 50314507d9..df4d779656 100644 --- a/apps/web/app/(app)/environments/[environmentId]/product/api-keys/actions.ts +++ b/apps/web/app/(app)/environments/[environmentId]/product/api-keys/actions.ts @@ -1,7 +1,6 @@ "use server"; import { getServerSession } from "next-auth"; - import { canUserAccessApiKey } from "@formbricks/lib/apiKey/auth"; import { createApiKey, deleteApiKey } from "@formbricks/lib/apiKey/service"; import { authOptions } from "@formbricks/lib/authOptions"; diff --git a/apps/web/app/(app)/environments/[environmentId]/product/api-keys/components/AddApiKeyModal.tsx b/apps/web/app/(app)/environments/[environmentId]/product/api-keys/components/AddApiKeyModal.tsx index 6ee1c80dca..ec18987ef9 100644 --- a/apps/web/app/(app)/environments/[environmentId]/product/api-keys/components/AddApiKeyModal.tsx +++ b/apps/web/app/(app)/environments/[environmentId]/product/api-keys/components/AddApiKeyModal.tsx @@ -2,7 +2,6 @@ import { AlertTriangleIcon } from "lucide-react"; import { useForm } from "react-hook-form"; - import { Button } from "@formbricks/ui/Button"; import { Input } from "@formbricks/ui/Input"; import { Label } from "@formbricks/ui/Label"; diff --git a/apps/web/app/(app)/environments/[environmentId]/product/api-keys/components/ApiKeyList.tsx b/apps/web/app/(app)/environments/[environmentId]/product/api-keys/components/ApiKeyList.tsx index e13a107a73..8c6a787931 100644 --- a/apps/web/app/(app)/environments/[environmentId]/product/api-keys/components/ApiKeyList.tsx +++ b/apps/web/app/(app)/environments/[environmentId]/product/api-keys/components/ApiKeyList.tsx @@ -1,7 +1,6 @@ import { getApiKeys } from "@formbricks/lib/apiKey/service"; import { getEnvironments } from "@formbricks/lib/environment/service"; import { getProductByEnvironmentId } from "@formbricks/lib/product/service"; - import { EditAPIKeys } from "./EditApiKeys"; export const ApiKeyList = async ({ diff --git a/apps/web/app/(app)/environments/[environmentId]/product/api-keys/components/EditApiKeys.tsx b/apps/web/app/(app)/environments/[environmentId]/product/api-keys/components/EditApiKeys.tsx index ae5d284227..ee2ef1d80d 100644 --- a/apps/web/app/(app)/environments/[environmentId]/product/api-keys/components/EditApiKeys.tsx +++ b/apps/web/app/(app)/environments/[environmentId]/product/api-keys/components/EditApiKeys.tsx @@ -3,13 +3,11 @@ import { FilesIcon, TrashIcon } from "lucide-react"; import { useState } from "react"; import toast from "react-hot-toast"; - import { timeSince } from "@formbricks/lib/time"; import { capitalizeFirstLetter } from "@formbricks/lib/utils/strings"; import { TApiKey } from "@formbricks/types/apiKeys"; import { Button } from "@formbricks/ui/Button"; import { DeleteDialog } from "@formbricks/ui/DeleteDialog"; - import { createApiKeyAction, deleteApiKeyAction } from "../actions"; import { AddApiKeyModal } from "./AddApiKeyModal"; diff --git a/apps/web/app/(app)/environments/[environmentId]/product/api-keys/loading.tsx b/apps/web/app/(app)/environments/[environmentId]/product/api-keys/loading.tsx index fc15866d96..8d3a6ad4eb 100644 --- a/apps/web/app/(app)/environments/[environmentId]/product/api-keys/loading.tsx +++ b/apps/web/app/(app)/environments/[environmentId]/product/api-keys/loading.tsx @@ -2,7 +2,6 @@ import { BrushIcon, KeyIcon, LanguagesIcon, ListChecksIcon, TagIcon, UsersIcon } from "lucide-react"; import { usePathname } from "next/navigation"; - import { cn } from "@formbricks/lib/cn"; import { PageContentWrapper } from "@formbricks/ui/PageContentWrapper"; import { PageHeader } from "@formbricks/ui/PageHeader"; diff --git a/apps/web/app/(app)/environments/[environmentId]/product/api-keys/page.tsx b/apps/web/app/(app)/environments/[environmentId]/product/api-keys/page.tsx index a50538b6e6..becf4429aa 100644 --- a/apps/web/app/(app)/environments/[environmentId]/product/api-keys/page.tsx +++ b/apps/web/app/(app)/environments/[environmentId]/product/api-keys/page.tsx @@ -1,6 +1,5 @@ import { ProductConfigNavigation } from "@/app/(app)/environments/[environmentId]/product/components/ProductConfigNavigation"; import { getServerSession } from "next-auth"; - import { getMultiLanguagePermission } from "@formbricks/ee/lib/service"; import { authOptions } from "@formbricks/lib/authOptions"; import { getEnvironment } from "@formbricks/lib/environment/service"; @@ -11,7 +10,6 @@ import { EnvironmentNotice } from "@formbricks/ui/EnvironmentNotice"; import { ErrorComponent } from "@formbricks/ui/ErrorComponent"; import { PageContentWrapper } from "@formbricks/ui/PageContentWrapper"; import { PageHeader } from "@formbricks/ui/PageHeader"; - import { SettingsCard } from "../../settings/components/SettingsCard"; import { ApiKeyList } from "./components/ApiKeyList"; diff --git a/apps/web/app/(app)/environments/[environmentId]/product/components/ProductConfigNavigation.tsx b/apps/web/app/(app)/environments/[environmentId]/product/components/ProductConfigNavigation.tsx index 7e932677a8..be19da19db 100644 --- a/apps/web/app/(app)/environments/[environmentId]/product/components/ProductConfigNavigation.tsx +++ b/apps/web/app/(app)/environments/[environmentId]/product/components/ProductConfigNavigation.tsx @@ -2,7 +2,6 @@ import { BrushIcon, KeyIcon, LanguagesIcon, ListChecksIcon, TagIcon, UsersIcon } from "lucide-react"; import { usePathname } from "next/navigation"; - import { SecondaryNavigation } from "@formbricks/ui/SecondaryNavigation"; interface ProductConfigNavigationProps { diff --git a/apps/web/app/(app)/environments/[environmentId]/product/general/actions.ts b/apps/web/app/(app)/environments/[environmentId]/product/general/actions.ts index d4eebf96e9..c3363f54d4 100644 --- a/apps/web/app/(app)/environments/[environmentId]/product/general/actions.ts +++ b/apps/web/app/(app)/environments/[environmentId]/product/general/actions.ts @@ -1,7 +1,6 @@ "use server"; import { getServerSession } from "next-auth"; - import { authOptions } from "@formbricks/lib/authOptions"; import { hasUserEnvironmentAccess } from "@formbricks/lib/environment/auth"; import { getEnvironment } from "@formbricks/lib/environment/service"; diff --git a/apps/web/app/(app)/environments/[environmentId]/product/general/components/DeleteProduct.tsx b/apps/web/app/(app)/environments/[environmentId]/product/general/components/DeleteProduct.tsx index fabb8f2e79..0bd1ec0b16 100644 --- a/apps/web/app/(app)/environments/[environmentId]/product/general/components/DeleteProduct.tsx +++ b/apps/web/app/(app)/environments/[environmentId]/product/general/components/DeleteProduct.tsx @@ -1,6 +1,5 @@ import { DeleteProductRender } from "@/app/(app)/environments/[environmentId]/product/general/components/DeleteProductRender"; import { getServerSession } from "next-auth"; - import { authOptions } from "@formbricks/lib/authOptions"; import { getMembershipByUserIdOrganizationId } from "@formbricks/lib/membership/service"; import { getOrganizationByEnvironmentId } from "@formbricks/lib/organization/service"; diff --git a/apps/web/app/(app)/environments/[environmentId]/product/general/components/DeleteProductRender.tsx b/apps/web/app/(app)/environments/[environmentId]/product/general/components/DeleteProductRender.tsx index 0cc7afa2c6..4e0dbcbc52 100644 --- a/apps/web/app/(app)/environments/[environmentId]/product/general/components/DeleteProductRender.tsx +++ b/apps/web/app/(app)/environments/[environmentId]/product/general/components/DeleteProductRender.tsx @@ -4,7 +4,6 @@ import { deleteProductAction } from "@/app/(app)/environments/[environmentId]/pr import { useRouter } from "next/navigation"; import React, { useState } from "react"; import toast from "react-hot-toast"; - import { truncate } from "@formbricks/lib/utils/strings"; import { TProduct } from "@formbricks/types/product"; import { Button } from "@formbricks/ui/Button"; diff --git a/apps/web/app/(app)/environments/[environmentId]/product/general/components/EditProductNameForm.tsx b/apps/web/app/(app)/environments/[environmentId]/product/general/components/EditProductNameForm.tsx index 875877a968..5aeee5f80b 100644 --- a/apps/web/app/(app)/environments/[environmentId]/product/general/components/EditProductNameForm.tsx +++ b/apps/web/app/(app)/environments/[environmentId]/product/general/components/EditProductNameForm.tsx @@ -4,12 +4,10 @@ import { zodResolver } from "@hookform/resolvers/zod"; import { SubmitHandler, useForm } from "react-hook-form"; import toast from "react-hot-toast"; import { z } from "zod"; - import { TProduct, ZProduct } from "@formbricks/types/product"; import { Button } from "@formbricks/ui/Button"; import { FormControl, FormError, FormField, FormItem, FormLabel, FormProvider } from "@formbricks/ui/Form"; import { Input } from "@formbricks/ui/Input"; - import { updateProductAction } from "../actions"; type EditProductNameProps = { diff --git a/apps/web/app/(app)/environments/[environmentId]/product/general/components/EditWaitingTimeForm.tsx b/apps/web/app/(app)/environments/[environmentId]/product/general/components/EditWaitingTimeForm.tsx index a4fae3f709..3d1bd6743b 100644 --- a/apps/web/app/(app)/environments/[environmentId]/product/general/components/EditWaitingTimeForm.tsx +++ b/apps/web/app/(app)/environments/[environmentId]/product/general/components/EditWaitingTimeForm.tsx @@ -4,12 +4,10 @@ import { zodResolver } from "@hookform/resolvers/zod"; import { SubmitHandler, useForm } from "react-hook-form"; import toast from "react-hot-toast"; import { z } from "zod"; - import { TProduct, ZProduct } from "@formbricks/types/product"; import { Button } from "@formbricks/ui/Button"; import { FormControl, FormError, FormField, FormItem, FormLabel, FormProvider } from "@formbricks/ui/Form"; import { Input } from "@formbricks/ui/Input"; - import { updateProductAction } from "../actions"; type EditWaitingTimeProps = { diff --git a/apps/web/app/(app)/environments/[environmentId]/product/general/loading.tsx b/apps/web/app/(app)/environments/[environmentId]/product/general/loading.tsx index b01c1c605f..6073eced96 100644 --- a/apps/web/app/(app)/environments/[environmentId]/product/general/loading.tsx +++ b/apps/web/app/(app)/environments/[environmentId]/product/general/loading.tsx @@ -2,7 +2,6 @@ import { BrushIcon, KeyIcon, LanguagesIcon, ListChecksIcon, TagIcon, UsersIcon } from "lucide-react"; import { usePathname } from "next/navigation"; - import { cn } from "@formbricks/lib/cn"; import { PageContentWrapper } from "@formbricks/ui/PageContentWrapper"; import { PageHeader } from "@formbricks/ui/PageHeader"; diff --git a/apps/web/app/(app)/environments/[environmentId]/product/general/page.tsx b/apps/web/app/(app)/environments/[environmentId]/product/general/page.tsx index d23e0d9467..423de8a405 100644 --- a/apps/web/app/(app)/environments/[environmentId]/product/general/page.tsx +++ b/apps/web/app/(app)/environments/[environmentId]/product/general/page.tsx @@ -1,6 +1,5 @@ import { ProductConfigNavigation } from "@/app/(app)/environments/[environmentId]/product/components/ProductConfigNavigation"; import { getServerSession } from "next-auth"; - import { getMultiLanguagePermission } from "@formbricks/ee/lib/service"; import { authOptions } from "@formbricks/lib/authOptions"; import { getMembershipByUserIdOrganizationId } from "@formbricks/lib/membership/service"; @@ -11,7 +10,6 @@ import { ErrorComponent } from "@formbricks/ui/ErrorComponent"; import { PageContentWrapper } from "@formbricks/ui/PageContentWrapper"; import { PageHeader } from "@formbricks/ui/PageHeader"; import { SettingsId } from "@formbricks/ui/SettingsId"; - import { SettingsCard } from "../../settings/components/SettingsCard"; import { DeleteProduct } from "./components/DeleteProduct"; import { EditProductNameForm } from "./components/EditProductNameForm"; diff --git a/apps/web/app/(app)/environments/[environmentId]/product/layout.tsx b/apps/web/app/(app)/environments/[environmentId]/product/layout.tsx index 1548d106f6..10bfacb7b3 100644 --- a/apps/web/app/(app)/environments/[environmentId]/product/layout.tsx +++ b/apps/web/app/(app)/environments/[environmentId]/product/layout.tsx @@ -1,6 +1,5 @@ import { Metadata } from "next"; import { getServerSession } from "next-auth"; - import { authOptions } from "@formbricks/lib/authOptions"; import { getOrganizationByEnvironmentId } from "@formbricks/lib/organization/service"; import { getProductByEnvironmentId } from "@formbricks/lib/product/service"; diff --git a/apps/web/app/(app)/environments/[environmentId]/product/look/actions.ts b/apps/web/app/(app)/environments/[environmentId]/product/look/actions.ts index 9efa8c9d87..9f549342f9 100644 --- a/apps/web/app/(app)/environments/[environmentId]/product/look/actions.ts +++ b/apps/web/app/(app)/environments/[environmentId]/product/look/actions.ts @@ -1,7 +1,6 @@ "use server"; import { getServerSession } from "next-auth"; - import { authOptions } from "@formbricks/lib/authOptions"; import { canUserAccessProduct, verifyUserRoleAccess } from "@formbricks/lib/product/auth"; import { getProduct, updateProduct } from "@formbricks/lib/product/service"; diff --git a/apps/web/app/(app)/environments/[environmentId]/product/look/components/EditBranding.tsx b/apps/web/app/(app)/environments/[environmentId]/product/look/components/EditBranding.tsx index 1cb8e7d9be..594968910e 100644 --- a/apps/web/app/(app)/environments/[environmentId]/product/look/components/EditBranding.tsx +++ b/apps/web/app/(app)/environments/[environmentId]/product/look/components/EditBranding.tsx @@ -2,12 +2,10 @@ import { useState } from "react"; import toast from "react-hot-toast"; - import { TProduct, TProductUpdateInput } from "@formbricks/types/product"; import { Label } from "@formbricks/ui/Label"; import { Switch } from "@formbricks/ui/Switch"; import { UpgradePlanNotice } from "@formbricks/ui/UpgradePlanNotice"; - import { updateProductAction } from "../actions"; interface EditFormbricksBrandingProps { diff --git a/apps/web/app/(app)/environments/[environmentId]/product/look/components/EditLogo.tsx b/apps/web/app/(app)/environments/[environmentId]/product/look/components/EditLogo.tsx index 6400657dbf..73869ff9e1 100644 --- a/apps/web/app/(app)/environments/[environmentId]/product/look/components/EditLogo.tsx +++ b/apps/web/app/(app)/environments/[environmentId]/product/look/components/EditLogo.tsx @@ -4,7 +4,6 @@ import { handleFileUpload } from "@/app/lib/fileUpload"; import Image from "next/image"; import { ChangeEvent, useRef, useState } from "react"; import toast from "react-hot-toast"; - import { TProduct, TProductUpdateInput } from "@formbricks/types/product"; import { AdvancedOptionToggle } from "@formbricks/ui/AdvancedOptionToggle"; import { Button } from "@formbricks/ui/Button"; @@ -12,7 +11,6 @@ import { ColorPicker } from "@formbricks/ui/ColorPicker"; import { DeleteDialog } from "@formbricks/ui/DeleteDialog"; import { FileInput } from "@formbricks/ui/FileInput"; import { Input } from "@formbricks/ui/Input"; - import { updateProductAction } from "../actions"; interface EditLogoProps { diff --git a/apps/web/app/(app)/environments/[environmentId]/product/look/components/EditPlacementForm.tsx b/apps/web/app/(app)/environments/[environmentId]/product/look/components/EditPlacementForm.tsx index 36d436eb4b..7f11122f51 100644 --- a/apps/web/app/(app)/environments/[environmentId]/product/look/components/EditPlacementForm.tsx +++ b/apps/web/app/(app)/environments/[environmentId]/product/look/components/EditPlacementForm.tsx @@ -4,7 +4,6 @@ import { zodResolver } from "@hookform/resolvers/zod"; import { SubmitHandler, useForm } from "react-hook-form"; import toast from "react-hot-toast"; import { z } from "zod"; - import { cn } from "@formbricks/lib/cn"; import { TProduct } from "@formbricks/types/product"; import { Button } from "@formbricks/ui/Button"; @@ -12,7 +11,6 @@ import { FormControl, FormField, FormItem, FormLabel, FormProvider } from "@form import { Label } from "@formbricks/ui/Label"; import { getPlacementStyle } from "@formbricks/ui/PreviewSurvey/lib/utils"; import { RadioGroup, RadioGroupItem } from "@formbricks/ui/RadioGroup"; - import { updateProductAction } from "../actions"; const placements = [ diff --git a/apps/web/app/(app)/environments/[environmentId]/product/look/components/ThemeStyling.tsx b/apps/web/app/(app)/environments/[environmentId]/product/look/components/ThemeStyling.tsx index 33fd48d116..c4ed61e416 100644 --- a/apps/web/app/(app)/environments/[environmentId]/product/look/components/ThemeStyling.tsx +++ b/apps/web/app/(app)/environments/[environmentId]/product/look/components/ThemeStyling.tsx @@ -10,7 +10,6 @@ import { useRouter } from "next/navigation"; import { useCallback, useState } from "react"; import { SubmitHandler, UseFormReturn, useForm } from "react-hook-form"; import toast from "react-hot-toast"; - import { COLOR_DEFAULTS, PREVIEW_SURVEY } from "@formbricks/lib/styling/constants"; import { TProduct, TProductStyling, ZProductStyling } from "@formbricks/types/product"; import { TSurvey, TSurveyStyling, TSurveyType } from "@formbricks/types/surveys"; @@ -25,7 +24,6 @@ import { FormProvider, } from "@formbricks/ui/Form"; import { Switch } from "@formbricks/ui/Switch"; - import { updateProductAction } from "../actions"; type ThemeStylingProps = { diff --git a/apps/web/app/(app)/environments/[environmentId]/product/look/components/ThemeStylingPreviewSurvey.tsx b/apps/web/app/(app)/environments/[environmentId]/product/look/components/ThemeStylingPreviewSurvey.tsx index 164ae95ba0..cf904acb7c 100644 --- a/apps/web/app/(app)/environments/[environmentId]/product/look/components/ThemeStylingPreviewSurvey.tsx +++ b/apps/web/app/(app)/environments/[environmentId]/product/look/components/ThemeStylingPreviewSurvey.tsx @@ -2,7 +2,6 @@ import { Variants, motion } from "framer-motion"; import { useRef, useState } from "react"; - import type { TProduct } from "@formbricks/types/product"; import { TSurvey, TSurveyType } from "@formbricks/types/surveys"; import { ClientLogo } from "@formbricks/ui/ClientLogo"; diff --git a/apps/web/app/(app)/environments/[environmentId]/product/look/loading.tsx b/apps/web/app/(app)/environments/[environmentId]/product/look/loading.tsx index 61211dd9e0..d4b23fdee2 100644 --- a/apps/web/app/(app)/environments/[environmentId]/product/look/loading.tsx +++ b/apps/web/app/(app)/environments/[environmentId]/product/look/loading.tsx @@ -3,7 +3,6 @@ import { SettingsCard } from "@/app/(app)/environments/[environmentId]/settings/components/SettingsCard"; import { BrushIcon, KeyIcon, LanguagesIcon, ListChecksIcon, TagIcon, UsersIcon } from "lucide-react"; import { usePathname } from "next/navigation"; - import { cn } from "@formbricks/lib/cn"; import { Badge } from "@formbricks/ui/Badge"; import { Button } from "@formbricks/ui/Button"; diff --git a/apps/web/app/(app)/environments/[environmentId]/product/look/page.tsx b/apps/web/app/(app)/environments/[environmentId]/product/look/page.tsx index 9fca1d9d02..ac3576a4ee 100644 --- a/apps/web/app/(app)/environments/[environmentId]/product/look/page.tsx +++ b/apps/web/app/(app)/environments/[environmentId]/product/look/page.tsx @@ -1,7 +1,6 @@ import { ProductConfigNavigation } from "@/app/(app)/environments/[environmentId]/product/components/ProductConfigNavigation"; import { EditLogo } from "@/app/(app)/environments/[environmentId]/product/look/components/EditLogo"; import { getServerSession } from "next-auth"; - import { getMultiLanguagePermission, getRemoveInAppBrandingPermission, @@ -16,7 +15,6 @@ import { getProductByEnvironmentId } from "@formbricks/lib/product/service"; import { ErrorComponent } from "@formbricks/ui/ErrorComponent"; import { PageContentWrapper } from "@formbricks/ui/PageContentWrapper"; import { PageHeader } from "@formbricks/ui/PageHeader"; - import { SettingsCard } from "../../settings/components/SettingsCard"; import { EditFormbricksBranding } from "./components/EditBranding"; import { EditPlacementForm } from "./components/EditPlacementForm"; diff --git a/apps/web/app/(app)/environments/[environmentId]/product/setup/components/SetupInstructions.tsx b/apps/web/app/(app)/environments/[environmentId]/product/setup/components/SetupInstructions.tsx index d21b9531ca..daf5c457ed 100644 --- a/apps/web/app/(app)/environments/[environmentId]/product/setup/components/SetupInstructions.tsx +++ b/apps/web/app/(app)/environments/[environmentId]/product/setup/components/SetupInstructions.tsx @@ -4,7 +4,6 @@ import packageJson from "@/package.json"; import Link from "next/link"; import "prismjs/themes/prism.css"; import { useState } from "react"; - import { CodeBlock } from "@formbricks/ui/CodeBlock"; import { TabBar } from "@formbricks/ui/TabBar"; import { Html5Icon, NpmIcon } from "@formbricks/ui/icons"; diff --git a/apps/web/app/(app)/environments/[environmentId]/product/setup/loading.tsx b/apps/web/app/(app)/environments/[environmentId]/product/setup/loading.tsx index 6ef9b7c210..2f27939188 100644 --- a/apps/web/app/(app)/environments/[environmentId]/product/setup/loading.tsx +++ b/apps/web/app/(app)/environments/[environmentId]/product/setup/loading.tsx @@ -2,7 +2,6 @@ import { BrushIcon, KeyIcon, LanguagesIcon, ListChecksIcon, TagIcon, UsersIcon } from "lucide-react"; import { usePathname } from "next/navigation"; - import { cn } from "@formbricks/lib/cn"; import { PageContentWrapper } from "@formbricks/ui/PageContentWrapper"; import { PageHeader } from "@formbricks/ui/PageHeader"; diff --git a/apps/web/app/(app)/environments/[environmentId]/product/setup/page.tsx b/apps/web/app/(app)/environments/[environmentId]/product/setup/page.tsx index 45b016c3b2..96b75776ce 100644 --- a/apps/web/app/(app)/environments/[environmentId]/product/setup/page.tsx +++ b/apps/web/app/(app)/environments/[environmentId]/product/setup/page.tsx @@ -1,6 +1,5 @@ import { WidgetStatusIndicator } from "@/app/(app)/environments/[environmentId]/components/WidgetStatusIndicator"; import { ProductConfigNavigation } from "@/app/(app)/environments/[environmentId]/product/components/ProductConfigNavigation"; - import { getMultiLanguagePermission } from "@formbricks/ee/lib/service"; import { IS_FORMBRICKS_CLOUD, WEBAPP_URL } from "@formbricks/lib/constants"; import { getEnvironment } from "@formbricks/lib/environment/service"; @@ -8,7 +7,6 @@ import { getOrganizationByEnvironmentId } from "@formbricks/lib/organization/ser import { EnvironmentNotice } from "@formbricks/ui/EnvironmentNotice"; import { PageContentWrapper } from "@formbricks/ui/PageContentWrapper"; import { PageHeader } from "@formbricks/ui/PageHeader"; - import { SettingsCard } from "../../settings/components/SettingsCard"; import { EnvironmentIdField } from "./components/EnvironmentIdField"; import { SetupInstructions } from "./components/SetupInstructions"; diff --git a/apps/web/app/(app)/environments/[environmentId]/product/tags/actions.ts b/apps/web/app/(app)/environments/[environmentId]/product/tags/actions.ts index 4574389b05..786405474b 100644 --- a/apps/web/app/(app)/environments/[environmentId]/product/tags/actions.ts +++ b/apps/web/app/(app)/environments/[environmentId]/product/tags/actions.ts @@ -1,7 +1,6 @@ "use server"; import { getServerSession } from "next-auth"; - import { authOptions } from "@formbricks/lib/authOptions"; import { canUserAccessTag, verifyUserRoleAccess } from "@formbricks/lib/tag/auth"; import { deleteTag, getTag, mergeTags, updateTagName } from "@formbricks/lib/tag/service"; diff --git a/apps/web/app/(app)/environments/[environmentId]/product/tags/components/EditTagsWrapper.tsx b/apps/web/app/(app)/environments/[environmentId]/product/tags/components/EditTagsWrapper.tsx index 0f8f6eb6c7..c8e4b92a37 100644 --- a/apps/web/app/(app)/environments/[environmentId]/product/tags/components/EditTagsWrapper.tsx +++ b/apps/web/app/(app)/environments/[environmentId]/product/tags/components/EditTagsWrapper.tsx @@ -10,7 +10,6 @@ import { AlertCircleIcon } from "lucide-react"; import { useRouter } from "next/navigation"; import React, { useState } from "react"; import { toast } from "react-hot-toast"; - import { cn } from "@formbricks/lib/cn"; import { TEnvironment } from "@formbricks/types/environment"; import { TTag, TTagsCount } from "@formbricks/types/tags"; diff --git a/apps/web/app/(app)/environments/[environmentId]/product/tags/components/MergeTagsCombobox.tsx b/apps/web/app/(app)/environments/[environmentId]/product/tags/components/MergeTagsCombobox.tsx index 75e7999d0a..c1db30cde4 100644 --- a/apps/web/app/(app)/environments/[environmentId]/product/tags/components/MergeTagsCombobox.tsx +++ b/apps/web/app/(app)/environments/[environmentId]/product/tags/components/MergeTagsCombobox.tsx @@ -1,5 +1,4 @@ import { useState } from "react"; - import { Button } from "@formbricks/ui/Button"; import { Command, diff --git a/apps/web/app/(app)/environments/[environmentId]/product/tags/page.tsx b/apps/web/app/(app)/environments/[environmentId]/product/tags/page.tsx index 696ce54c80..73deb942be 100644 --- a/apps/web/app/(app)/environments/[environmentId]/product/tags/page.tsx +++ b/apps/web/app/(app)/environments/[environmentId]/product/tags/page.tsx @@ -1,7 +1,6 @@ import { ProductConfigNavigation } from "@/app/(app)/environments/[environmentId]/product/components/ProductConfigNavigation"; import { SettingsCard } from "@/app/(app)/environments/[environmentId]/settings/components/SettingsCard"; import { getServerSession } from "next-auth"; - import { getMultiLanguagePermission } from "@formbricks/ee/lib/service"; import { authOptions } from "@formbricks/lib/authOptions"; import { getEnvironment } from "@formbricks/lib/environment/service"; @@ -13,7 +12,6 @@ import { getTagsOnResponsesCount } from "@formbricks/lib/tagOnResponse/service"; import { ErrorComponent } from "@formbricks/ui/ErrorComponent"; import { PageContentWrapper } from "@formbricks/ui/PageContentWrapper"; import { PageHeader } from "@formbricks/ui/PageHeader"; - import { EditTagsWrapper } from "./components/EditTagsWrapper"; const Page = async ({ params }) => { diff --git a/apps/web/app/(app)/environments/[environmentId]/settings/(account)/components/AccountSettingsNavbar.tsx b/apps/web/app/(app)/environments/[environmentId]/settings/(account)/components/AccountSettingsNavbar.tsx index d0746dc363..8adeb253b0 100644 --- a/apps/web/app/(app)/environments/[environmentId]/settings/(account)/components/AccountSettingsNavbar.tsx +++ b/apps/web/app/(app)/environments/[environmentId]/settings/(account)/components/AccountSettingsNavbar.tsx @@ -2,7 +2,6 @@ import { BellRingIcon, UserCircleIcon } from "lucide-react"; import { usePathname } from "next/navigation"; - import { SecondaryNavigation } from "@formbricks/ui/SecondaryNavigation"; export const AccountSettingsNavbar = ({ diff --git a/apps/web/app/(app)/environments/[environmentId]/settings/(account)/layout.tsx b/apps/web/app/(app)/environments/[environmentId]/settings/(account)/layout.tsx index 6745860296..ec74f7a63e 100644 --- a/apps/web/app/(app)/environments/[environmentId]/settings/(account)/layout.tsx +++ b/apps/web/app/(app)/environments/[environmentId]/settings/(account)/layout.tsx @@ -1,5 +1,4 @@ import { getServerSession } from "next-auth"; - import { authOptions } from "@formbricks/lib/authOptions"; import { getOrganizationByEnvironmentId } from "@formbricks/lib/organization/service"; import { getProductByEnvironmentId } from "@formbricks/lib/product/service"; diff --git a/apps/web/app/(app)/environments/[environmentId]/settings/(account)/notifications/actions.ts b/apps/web/app/(app)/environments/[environmentId]/settings/(account)/notifications/actions.ts index 26c56b14f4..a688b4269f 100644 --- a/apps/web/app/(app)/environments/[environmentId]/settings/(account)/notifications/actions.ts +++ b/apps/web/app/(app)/environments/[environmentId]/settings/(account)/notifications/actions.ts @@ -1,7 +1,6 @@ "use server"; import { getServerSession } from "next-auth"; - import { authOptions } from "@formbricks/lib/authOptions"; import { updateUser } from "@formbricks/lib/user/service"; import { AuthorizationError } from "@formbricks/types/errors"; diff --git a/apps/web/app/(app)/environments/[environmentId]/settings/(account)/notifications/components/EditAlerts.tsx b/apps/web/app/(app)/environments/[environmentId]/settings/(account)/notifications/components/EditAlerts.tsx index d20ec65b38..977e26a411 100644 --- a/apps/web/app/(app)/environments/[environmentId]/settings/(account)/notifications/components/EditAlerts.tsx +++ b/apps/web/app/(app)/environments/[environmentId]/settings/(account)/notifications/components/EditAlerts.tsx @@ -1,9 +1,7 @@ import { HelpCircleIcon, UsersIcon } from "lucide-react"; import Link from "next/link"; - import { TUser } from "@formbricks/types/user"; import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from "@formbricks/ui/Tooltip"; - import { Membership } from "../types"; import { NotificationSwitch } from "./NotificationSwitch"; diff --git a/apps/web/app/(app)/environments/[environmentId]/settings/(account)/notifications/components/EditWeeklySummary.tsx b/apps/web/app/(app)/environments/[environmentId]/settings/(account)/notifications/components/EditWeeklySummary.tsx index eb4c435961..835888a4fc 100644 --- a/apps/web/app/(app)/environments/[environmentId]/settings/(account)/notifications/components/EditWeeklySummary.tsx +++ b/apps/web/app/(app)/environments/[environmentId]/settings/(account)/notifications/components/EditWeeklySummary.tsx @@ -1,8 +1,6 @@ import { UsersIcon } from "lucide-react"; import Link from "next/link"; - import { TUser } from "@formbricks/types/user"; - import { Membership } from "../types"; import { NotificationSwitch } from "./NotificationSwitch"; diff --git a/apps/web/app/(app)/environments/[environmentId]/settings/(account)/notifications/components/NotificationSwitch.tsx b/apps/web/app/(app)/environments/[environmentId]/settings/(account)/notifications/components/NotificationSwitch.tsx index e97f70a18c..b536f36860 100644 --- a/apps/web/app/(app)/environments/[environmentId]/settings/(account)/notifications/components/NotificationSwitch.tsx +++ b/apps/web/app/(app)/environments/[environmentId]/settings/(account)/notifications/components/NotificationSwitch.tsx @@ -2,10 +2,8 @@ import { useEffect, useState } from "react"; import toast from "react-hot-toast"; - import { TUserNotificationSettings } from "@formbricks/types/user"; import { Switch } from "@formbricks/ui/Switch"; - import { updateNotificationSettingsAction } from "../actions"; interface NotificationSwitchProps { diff --git a/apps/web/app/(app)/environments/[environmentId]/settings/(account)/notifications/page.tsx b/apps/web/app/(app)/environments/[environmentId]/settings/(account)/notifications/page.tsx index 22297e0f48..369e338382 100644 --- a/apps/web/app/(app)/environments/[environmentId]/settings/(account)/notifications/page.tsx +++ b/apps/web/app/(app)/environments/[environmentId]/settings/(account)/notifications/page.tsx @@ -1,14 +1,12 @@ import { AccountSettingsNavbar } from "@/app/(app)/environments/[environmentId]/settings/(account)/components/AccountSettingsNavbar"; import { SettingsCard } from "@/app/(app)/environments/[environmentId]/settings/components/SettingsCard"; import { getServerSession } from "next-auth"; - import { prisma } from "@formbricks/database"; import { authOptions } from "@formbricks/lib/authOptions"; import { getUser } from "@formbricks/lib/user/service"; import { TUserNotificationSettings } from "@formbricks/types/user"; import { PageContentWrapper } from "@formbricks/ui/PageContentWrapper"; import { PageHeader } from "@formbricks/ui/PageHeader"; - import { EditAlerts } from "./components/EditAlerts"; import { EditWeeklySummary } from "./components/EditWeeklySummary"; import { IntegrationsTip } from "./components/IntegrationsTip"; diff --git a/apps/web/app/(app)/environments/[environmentId]/settings/(account)/profile/actions.ts b/apps/web/app/(app)/environments/[environmentId]/settings/(account)/profile/actions.ts index af449a6bed..c421377009 100644 --- a/apps/web/app/(app)/environments/[environmentId]/settings/(account)/profile/actions.ts +++ b/apps/web/app/(app)/environments/[environmentId]/settings/(account)/profile/actions.ts @@ -1,7 +1,6 @@ "use server"; import { getServerSession } from "next-auth"; - import { disableTwoFactorAuth, enableTwoFactorAuth, setupTwoFactorAuth } from "@formbricks/lib/auth/service"; import { authOptions } from "@formbricks/lib/authOptions"; import { hasUserEnvironmentAccess } from "@formbricks/lib/environment/auth"; diff --git a/apps/web/app/(app)/environments/[environmentId]/settings/(account)/profile/components/AccountSecurity.tsx b/apps/web/app/(app)/environments/[environmentId]/settings/(account)/profile/components/AccountSecurity.tsx index 5de5c85b31..a89e54f337 100644 --- a/apps/web/app/(app)/environments/[environmentId]/settings/(account)/profile/components/AccountSecurity.tsx +++ b/apps/web/app/(app)/environments/[environmentId]/settings/(account)/profile/components/AccountSecurity.tsx @@ -3,7 +3,6 @@ import { DisableTwoFactorModal } from "@/app/(app)/environments/[environmentId]/settings/(account)/profile/components/DisableTwoFactorModal"; import { EnableTwoFactorModal } from "@/app/(app)/environments/[environmentId]/settings/(account)/profile/components/EnableTwoFactorModal"; import { useState } from "react"; - import { TUser } from "@formbricks/types/user"; import { Switch } from "@formbricks/ui/Switch"; diff --git a/apps/web/app/(app)/environments/[environmentId]/settings/(account)/profile/components/DisableTwoFactorModal.tsx b/apps/web/app/(app)/environments/[environmentId]/settings/(account)/profile/components/DisableTwoFactorModal.tsx index c1fb41c992..c8b5d3919c 100644 --- a/apps/web/app/(app)/environments/[environmentId]/settings/(account)/profile/components/DisableTwoFactorModal.tsx +++ b/apps/web/app/(app)/environments/[environmentId]/settings/(account)/profile/components/DisableTwoFactorModal.tsx @@ -5,7 +5,6 @@ import { useRouter } from "next/navigation"; import React, { useEffect, useState } from "react"; import { Controller, SubmitHandler, useForm } from "react-hook-form"; import toast from "react-hot-toast"; - import { Button } from "@formbricks/ui/Button"; import { Input } from "@formbricks/ui/Input"; import { Modal } from "@formbricks/ui/Modal"; diff --git a/apps/web/app/(app)/environments/[environmentId]/settings/(account)/profile/components/EditProfileAvatarForm.tsx b/apps/web/app/(app)/environments/[environmentId]/settings/(account)/profile/components/EditProfileAvatarForm.tsx index 610cc0fb51..c0fa2b8c2f 100644 --- a/apps/web/app/(app)/environments/[environmentId]/settings/(account)/profile/components/EditProfileAvatarForm.tsx +++ b/apps/web/app/(app)/environments/[environmentId]/settings/(account)/profile/components/EditProfileAvatarForm.tsx @@ -12,7 +12,6 @@ import { useRef, useState } from "react"; import { useForm } from "react-hook-form"; import toast from "react-hot-toast"; import { z } from "zod"; - import { ProfileAvatar } from "@formbricks/ui/Avatars"; import { Button } from "@formbricks/ui/Button"; import { FormError, FormField, FormItem, FormProvider } from "@formbricks/ui/Form"; diff --git a/apps/web/app/(app)/environments/[environmentId]/settings/(account)/profile/components/EditProfileDetailsForm.tsx b/apps/web/app/(app)/environments/[environmentId]/settings/(account)/profile/components/EditProfileDetailsForm.tsx index 4920382d1a..d964458ed5 100644 --- a/apps/web/app/(app)/environments/[environmentId]/settings/(account)/profile/components/EditProfileDetailsForm.tsx +++ b/apps/web/app/(app)/environments/[environmentId]/settings/(account)/profile/components/EditProfileDetailsForm.tsx @@ -4,13 +4,11 @@ import { zodResolver } from "@hookform/resolvers/zod"; import { SubmitHandler, useForm } from "react-hook-form"; import toast from "react-hot-toast"; import { z } from "zod"; - import { TUser, ZUser } from "@formbricks/types/user"; import { Button } from "@formbricks/ui/Button"; import { FormControl, FormError, FormField, FormItem, FormLabel, FormProvider } from "@formbricks/ui/Form"; import { Input } from "@formbricks/ui/Input"; import { Label } from "@formbricks/ui/Label"; - import { updateUserAction } from "../actions"; const ZEditProfileNameFormSchema = ZUser.pick({ name: true }); diff --git a/apps/web/app/(app)/environments/[environmentId]/settings/(account)/profile/components/EnableTwoFactorModal.tsx b/apps/web/app/(app)/environments/[environmentId]/settings/(account)/profile/components/EnableTwoFactorModal.tsx index d3061f21ba..ba693e42a2 100644 --- a/apps/web/app/(app)/environments/[environmentId]/settings/(account)/profile/components/EnableTwoFactorModal.tsx +++ b/apps/web/app/(app)/environments/[environmentId]/settings/(account)/profile/components/EnableTwoFactorModal.tsx @@ -9,7 +9,6 @@ import { useRouter } from "next/navigation"; import React, { useState } from "react"; import { Controller, SubmitHandler, useForm } from "react-hook-form"; import toast from "react-hot-toast"; - import { Button } from "@formbricks/ui/Button"; import { Modal } from "@formbricks/ui/Modal"; import { OTPInput } from "@formbricks/ui/OTPInput"; diff --git a/apps/web/app/(app)/environments/[environmentId]/settings/(account)/profile/page.tsx b/apps/web/app/(app)/environments/[environmentId]/settings/(account)/profile/page.tsx index 0cc713f2c0..b8fb2c13e8 100644 --- a/apps/web/app/(app)/environments/[environmentId]/settings/(account)/profile/page.tsx +++ b/apps/web/app/(app)/environments/[environmentId]/settings/(account)/profile/page.tsx @@ -1,14 +1,12 @@ import { AccountSettingsNavbar } from "@/app/(app)/environments/[environmentId]/settings/(account)/components/AccountSettingsNavbar"; import { AccountSecurity } from "@/app/(app)/environments/[environmentId]/settings/(account)/profile/components/AccountSecurity"; import { getServerSession } from "next-auth"; - import { authOptions } from "@formbricks/lib/authOptions"; import { IS_FORMBRICKS_CLOUD } from "@formbricks/lib/constants"; import { getUser } from "@formbricks/lib/user/service"; import { PageContentWrapper } from "@formbricks/ui/PageContentWrapper"; import { PageHeader } from "@formbricks/ui/PageHeader"; import { SettingsId } from "@formbricks/ui/SettingsId"; - import { SettingsCard } from "../../components/SettingsCard"; import { DeleteAccount } from "./components/DeleteAccount"; import { EditProfileAvatarForm } from "./components/EditProfileAvatarForm"; diff --git a/apps/web/app/(app)/environments/[environmentId]/settings/(organization)/billing/components/PricingTable.tsx b/apps/web/app/(app)/environments/[environmentId]/settings/(organization)/billing/components/PricingTable.tsx index 33b4d854f4..bd22a255ce 100644 --- a/apps/web/app/(app)/environments/[environmentId]/settings/(organization)/billing/components/PricingTable.tsx +++ b/apps/web/app/(app)/environments/[environmentId]/settings/(organization)/billing/components/PricingTable.tsx @@ -8,7 +8,6 @@ import { import { useRouter } from "next/navigation"; import { useState } from "react"; import toast from "react-hot-toast"; - import { ProductFeatureKeys, StripePriceLookupKeys } from "@formbricks/ee/billing/lib/constants"; import { TOrganization } from "@formbricks/types/organizations"; import { AlertDialog } from "@formbricks/ui/AlertDialog"; diff --git a/apps/web/app/(app)/environments/[environmentId]/settings/(organization)/billing/layout.tsx b/apps/web/app/(app)/environments/[environmentId]/settings/(organization)/billing/layout.tsx index 4ec2e9ac3e..95c681d73f 100644 --- a/apps/web/app/(app)/environments/[environmentId]/settings/(organization)/billing/layout.tsx +++ b/apps/web/app/(app)/environments/[environmentId]/settings/(organization)/billing/layout.tsx @@ -1,7 +1,6 @@ import { Metadata } from "next"; import { getServerSession } from "next-auth"; import { notFound } from "next/navigation"; - import { authOptions } from "@formbricks/lib/authOptions"; import { IS_FORMBRICKS_CLOUD } from "@formbricks/lib/constants"; import { getMembershipByUserIdOrganizationId } from "@formbricks/lib/membership/service"; diff --git a/apps/web/app/(app)/environments/[environmentId]/settings/(organization)/billing/page.tsx b/apps/web/app/(app)/environments/[environmentId]/settings/(organization)/billing/page.tsx index 8baed6ba3e..f02305336e 100644 --- a/apps/web/app/(app)/environments/[environmentId]/settings/(organization)/billing/page.tsx +++ b/apps/web/app/(app)/environments/[environmentId]/settings/(organization)/billing/page.tsx @@ -1,6 +1,5 @@ import { OrganizationSettingsNavbar } from "@/app/(app)/environments/[environmentId]/settings/(organization)/components/OrganizationSettingsNavbar"; import { getServerSession } from "next-auth"; - import { authOptions } from "@formbricks/lib/authOptions"; import { IS_FORMBRICKS_CLOUD, @@ -15,7 +14,6 @@ import { } from "@formbricks/lib/organization/service"; import { PageContentWrapper } from "@formbricks/ui/PageContentWrapper"; import { PageHeader } from "@formbricks/ui/PageHeader"; - import { PricingTable } from "./components/PricingTable"; const Page = async ({ params }) => { diff --git a/apps/web/app/(app)/environments/[environmentId]/settings/(organization)/billing/unlimited/page.tsx b/apps/web/app/(app)/environments/[environmentId]/settings/(organization)/billing/unlimited/page.tsx index 355888cb43..0cf9d99c36 100644 --- a/apps/web/app/(app)/environments/[environmentId]/settings/(organization)/billing/unlimited/page.tsx +++ b/apps/web/app/(app)/environments/[environmentId]/settings/(organization)/billing/unlimited/page.tsx @@ -1,8 +1,6 @@ import { redirect } from "next/navigation"; - import { StripePriceLookupKeys } from "@formbricks/ee/billing/lib/constants"; import { getOrganizationByEnvironmentId } from "@formbricks/lib/organization/service"; - import { upgradePlanAction } from "../actions"; const Page = async ({ params }) => { diff --git a/apps/web/app/(app)/environments/[environmentId]/settings/(organization)/billing/unlimited99/page.tsx b/apps/web/app/(app)/environments/[environmentId]/settings/(organization)/billing/unlimited99/page.tsx index 0d2cf4cd1e..847cb5e6fe 100644 --- a/apps/web/app/(app)/environments/[environmentId]/settings/(organization)/billing/unlimited99/page.tsx +++ b/apps/web/app/(app)/environments/[environmentId]/settings/(organization)/billing/unlimited99/page.tsx @@ -1,8 +1,6 @@ import { redirect } from "next/navigation"; - import { StripePriceLookupKeys } from "@formbricks/ee/billing/lib/constants"; import { getOrganizationByEnvironmentId } from "@formbricks/lib/organization/service"; - import { upgradePlanAction } from "../actions"; const Page = async ({ params }) => { diff --git a/apps/web/app/(app)/environments/[environmentId]/settings/(organization)/components/OrganizationSettingsNavbar.tsx b/apps/web/app/(app)/environments/[environmentId]/settings/(organization)/components/OrganizationSettingsNavbar.tsx index d9eb753fd9..2d9c962115 100644 --- a/apps/web/app/(app)/environments/[environmentId]/settings/(organization)/components/OrganizationSettingsNavbar.tsx +++ b/apps/web/app/(app)/environments/[environmentId]/settings/(organization)/components/OrganizationSettingsNavbar.tsx @@ -2,7 +2,6 @@ import { BoltIcon, CreditCardIcon, UsersIcon } from "lucide-react"; import { usePathname } from "next/navigation"; - import { getAccessFlags } from "@formbricks/lib/membership/utils"; import { TMembershipRole } from "@formbricks/types/memberships"; import { SecondaryNavigation } from "@formbricks/ui/SecondaryNavigation"; diff --git a/apps/web/app/(app)/environments/[environmentId]/settings/(organization)/enterprise/page.tsx b/apps/web/app/(app)/environments/[environmentId]/settings/(organization)/enterprise/page.tsx index f422e99b12..edf96214ac 100644 --- a/apps/web/app/(app)/environments/[environmentId]/settings/(organization)/enterprise/page.tsx +++ b/apps/web/app/(app)/environments/[environmentId]/settings/(organization)/enterprise/page.tsx @@ -2,7 +2,6 @@ import { OrganizationSettingsNavbar } from "@/app/(app)/environments/[environmen import { CheckIcon } from "lucide-react"; import { getServerSession } from "next-auth"; import { notFound } from "next/navigation"; - import { getIsEnterpriseEdition } from "@formbricks/ee/lib/service"; import { authOptions } from "@formbricks/lib/authOptions"; import { IS_FORMBRICKS_CLOUD } from "@formbricks/lib/constants"; diff --git a/apps/web/app/(app)/environments/[environmentId]/settings/(organization)/layout.tsx b/apps/web/app/(app)/environments/[environmentId]/settings/(organization)/layout.tsx index c1f8218c48..af4a2186f6 100644 --- a/apps/web/app/(app)/environments/[environmentId]/settings/(organization)/layout.tsx +++ b/apps/web/app/(app)/environments/[environmentId]/settings/(organization)/layout.tsx @@ -1,5 +1,4 @@ import { getServerSession } from "next-auth"; - import { authOptions } from "@formbricks/lib/authOptions"; import { getOrganizationByEnvironmentId } from "@formbricks/lib/organization/service"; import { getProductByEnvironmentId } from "@formbricks/lib/product/service"; diff --git a/apps/web/app/(app)/environments/[environmentId]/settings/(organization)/members/actions.ts b/apps/web/app/(app)/environments/[environmentId]/settings/(organization)/members/actions.ts index da6de6e4db..8862419fa3 100644 --- a/apps/web/app/(app)/environments/[environmentId]/settings/(organization)/members/actions.ts +++ b/apps/web/app/(app)/environments/[environmentId]/settings/(organization)/members/actions.ts @@ -1,7 +1,6 @@ "use server"; import { getServerSession } from "next-auth"; - import { getIsMultiOrgEnabled } from "@formbricks/ee/lib/service"; import { sendInviteMemberEmail } from "@formbricks/email"; import { hasOrganizationAuthority } from "@formbricks/lib/auth"; diff --git a/apps/web/app/(app)/environments/[environmentId]/settings/(organization)/members/components/AddMemberModal.tsx b/apps/web/app/(app)/environments/[environmentId]/settings/(organization)/members/components/AddMemberModal.tsx index a0b2d57eff..209c6e830c 100644 --- a/apps/web/app/(app)/environments/[environmentId]/settings/(organization)/members/components/AddMemberModal.tsx +++ b/apps/web/app/(app)/environments/[environmentId]/settings/(organization)/members/components/AddMemberModal.tsx @@ -1,7 +1,6 @@ "use client"; import { ModalWithTabs } from "@formbricks/ui/ModalWithTabs"; - import { BulkInviteTab } from "./BulkInviteTab"; import { IndividualInviteTab } from "./IndividualInviteTab"; diff --git a/apps/web/app/(app)/environments/[environmentId]/settings/(organization)/members/components/BulkInviteTab.tsx b/apps/web/app/(app)/environments/[environmentId]/settings/(organization)/members/components/BulkInviteTab.tsx index d793d8bc68..dc193f721b 100644 --- a/apps/web/app/(app)/environments/[environmentId]/settings/(organization)/members/components/BulkInviteTab.tsx +++ b/apps/web/app/(app)/environments/[environmentId]/settings/(organization)/members/components/BulkInviteTab.tsx @@ -5,11 +5,9 @@ import Link from "next/link"; import Papa, { type ParseResult } from "papaparse"; import { useRef, useState } from "react"; import toast from "react-hot-toast"; - import { ZInvitees } from "@formbricks/types/invites"; import { Alert, AlertDescription } from "@formbricks/ui/Alert"; import { Button } from "@formbricks/ui/Button"; - import { MembershipRole } from "./AddMemberModal"; interface BulkInviteTabProps { diff --git a/apps/web/app/(app)/environments/[environmentId]/settings/(organization)/members/components/DeleteOrganization.tsx b/apps/web/app/(app)/environments/[environmentId]/settings/(organization)/members/components/DeleteOrganization.tsx index f0be03cf0a..1136d6fd39 100644 --- a/apps/web/app/(app)/environments/[environmentId]/settings/(organization)/members/components/DeleteOrganization.tsx +++ b/apps/web/app/(app)/environments/[environmentId]/settings/(organization)/members/components/DeleteOrganization.tsx @@ -4,7 +4,6 @@ import { deleteOrganizationAction } from "@/app/(app)/environments/[environmentI import { useRouter } from "next/navigation"; import { Dispatch, SetStateAction, useMemo, useState } from "react"; import toast from "react-hot-toast"; - import { TOrganization } from "@formbricks/types/organizations"; import { Button } from "@formbricks/ui/Button"; import { DeleteDialog } from "@formbricks/ui/DeleteDialog"; diff --git a/apps/web/app/(app)/environments/[environmentId]/settings/(organization)/members/components/EditMemberships/EditMemberships.tsx b/apps/web/app/(app)/environments/[environmentId]/settings/(organization)/members/components/EditMemberships/EditMemberships.tsx index a21157c86f..4b417924f9 100644 --- a/apps/web/app/(app)/environments/[environmentId]/settings/(organization)/members/components/EditMemberships/EditMemberships.tsx +++ b/apps/web/app/(app)/environments/[environmentId]/settings/(organization)/members/components/EditMemberships/EditMemberships.tsx @@ -1,5 +1,4 @@ import { MembersInfo } from "@/app/(app)/environments/[environmentId]/settings/(organization)/members/components/EditMemberships/MembersInfo"; - import { getRoleManagementPermission } from "@formbricks/ee/lib/service"; import { getInvitesByOrganizationId } from "@formbricks/lib/invite/service"; import { getMembersByOrganizationId } from "@formbricks/lib/membership/service"; diff --git a/apps/web/app/(app)/environments/[environmentId]/settings/(organization)/members/components/EditMemberships/MemberActions.tsx b/apps/web/app/(app)/environments/[environmentId]/settings/(organization)/members/components/EditMemberships/MemberActions.tsx index 9252450309..fa55d74183 100644 --- a/apps/web/app/(app)/environments/[environmentId]/settings/(organization)/members/components/EditMemberships/MemberActions.tsx +++ b/apps/web/app/(app)/environments/[environmentId]/settings/(organization)/members/components/EditMemberships/MemberActions.tsx @@ -11,7 +11,6 @@ import { SendHorizonalIcon, ShareIcon, TrashIcon } from "lucide-react"; import { useRouter } from "next/navigation"; import React, { useMemo, useState } from "react"; import toast from "react-hot-toast"; - import { TInvite } from "@formbricks/types/invites"; import { TMember } from "@formbricks/types/memberships"; import { TOrganization } from "@formbricks/types/organizations"; diff --git a/apps/web/app/(app)/environments/[environmentId]/settings/(organization)/members/components/EditMemberships/OrganizationActions.tsx b/apps/web/app/(app)/environments/[environmentId]/settings/(organization)/members/components/EditMemberships/OrganizationActions.tsx index ca0c9d428c..8c784642d0 100644 --- a/apps/web/app/(app)/environments/[environmentId]/settings/(organization)/members/components/EditMemberships/OrganizationActions.tsx +++ b/apps/web/app/(app)/environments/[environmentId]/settings/(organization)/members/components/EditMemberships/OrganizationActions.tsx @@ -9,7 +9,6 @@ import { XIcon } from "lucide-react"; import { useRouter } from "next/navigation"; import { useState } from "react"; import toast from "react-hot-toast"; - import { TInvitee } from "@formbricks/types/invites"; import { TOrganization } from "@formbricks/types/organizations"; import { Button } from "@formbricks/ui/Button"; diff --git a/apps/web/app/(app)/environments/[environmentId]/settings/(organization)/members/components/EditOrganizationNameForm.tsx b/apps/web/app/(app)/environments/[environmentId]/settings/(organization)/members/components/EditOrganizationNameForm.tsx index 418ebb840a..d77e3e074e 100644 --- a/apps/web/app/(app)/environments/[environmentId]/settings/(organization)/members/components/EditOrganizationNameForm.tsx +++ b/apps/web/app/(app)/environments/[environmentId]/settings/(organization)/members/components/EditOrganizationNameForm.tsx @@ -5,7 +5,6 @@ import { zodResolver } from "@hookform/resolvers/zod"; import { SubmitHandler, useForm } from "react-hook-form"; import toast from "react-hot-toast"; import { z } from "zod"; - import { getAccessFlags } from "@formbricks/lib/membership/utils"; import { TMembershipRole } from "@formbricks/types/memberships"; import { TOrganization, ZOrganization } from "@formbricks/types/organizations"; diff --git a/apps/web/app/(app)/environments/[environmentId]/settings/(organization)/members/components/ShareInviteModal.tsx b/apps/web/app/(app)/environments/[environmentId]/settings/(organization)/members/components/ShareInviteModal.tsx index b8b687112d..e7b9ef89c0 100644 --- a/apps/web/app/(app)/environments/[environmentId]/settings/(organization)/members/components/ShareInviteModal.tsx +++ b/apps/web/app/(app)/environments/[environmentId]/settings/(organization)/members/components/ShareInviteModal.tsx @@ -3,7 +3,6 @@ import { CheckIcon, CopyIcon } from "lucide-react"; import { useRef } from "react"; import toast from "react-hot-toast"; - import { Button } from "@formbricks/ui/Button"; import { Modal } from "@formbricks/ui/Modal"; diff --git a/apps/web/app/(app)/environments/[environmentId]/settings/(organization)/members/page.tsx b/apps/web/app/(app)/environments/[environmentId]/settings/(organization)/members/page.tsx index ac8a26aa39..f4f0155b32 100644 --- a/apps/web/app/(app)/environments/[environmentId]/settings/(organization)/members/page.tsx +++ b/apps/web/app/(app)/environments/[environmentId]/settings/(organization)/members/page.tsx @@ -2,7 +2,6 @@ import { OrganizationSettingsNavbar } from "@/app/(app)/environments/[environmen import { OrganizationActions } from "@/app/(app)/environments/[environmentId]/settings/(organization)/members/components/EditMemberships/OrganizationActions"; import { getServerSession } from "next-auth"; import { Suspense } from "react"; - import { getIsMultiOrgEnabled, getRoleManagementPermission } from "@formbricks/ee/lib/service"; import { authOptions } from "@formbricks/lib/authOptions"; import { INVITE_DISABLED, IS_FORMBRICKS_CLOUD } from "@formbricks/lib/constants"; @@ -15,7 +14,6 @@ import { getOrganizationByEnvironmentId } from "@formbricks/lib/organization/ser import { PageContentWrapper } from "@formbricks/ui/PageContentWrapper"; import { PageHeader } from "@formbricks/ui/PageHeader"; import { SettingsId } from "@formbricks/ui/SettingsId"; - import { SettingsCard } from "../../components/SettingsCard"; import { DeleteOrganization } from "./components/DeleteOrganization"; import { EditMemberships } from "./components/EditMemberships"; diff --git a/apps/web/app/(app)/environments/[environmentId]/surveys/[surveyId]/(analysis)/actions.ts b/apps/web/app/(app)/environments/[environmentId]/surveys/[surveyId]/(analysis)/actions.ts index 3585e79fea..f7e19b3841 100644 --- a/apps/web/app/(app)/environments/[environmentId]/surveys/[surveyId]/(analysis)/actions.ts +++ b/apps/web/app/(app)/environments/[environmentId]/surveys/[surveyId]/(analysis)/actions.ts @@ -2,7 +2,6 @@ import { getServerSession } from "next-auth"; import { revalidatePath } from "next/cache"; - import { authOptions } from "@formbricks/lib/authOptions"; import { getResponseCountBySurveyId, getResponses, getSurveySummary } from "@formbricks/lib/response/service"; import { canUserAccessSurvey } from "@formbricks/lib/survey/auth"; diff --git a/apps/web/app/(app)/environments/[environmentId]/surveys/[surveyId]/(analysis)/components/EmptyInAppSurveys.tsx b/apps/web/app/(app)/environments/[environmentId]/surveys/[surveyId]/(analysis)/components/EmptyInAppSurveys.tsx index 7eb4b7fcc3..dfb5ed9abe 100644 --- a/apps/web/app/(app)/environments/[environmentId]/surveys/[surveyId]/(analysis)/components/EmptyInAppSurveys.tsx +++ b/apps/web/app/(app)/environments/[environmentId]/surveys/[surveyId]/(analysis)/components/EmptyInAppSurveys.tsx @@ -1,6 +1,5 @@ import { Unplug } from "lucide-react"; import Link from "next/link"; - import { TEnvironment } from "@formbricks/types/environment"; import { Button } from "@formbricks/ui/Button"; diff --git a/apps/web/app/(app)/environments/[environmentId]/surveys/[surveyId]/(analysis)/components/SurveyAnalysisNavigation.tsx b/apps/web/app/(app)/environments/[environmentId]/surveys/[surveyId]/(analysis)/components/SurveyAnalysisNavigation.tsx index d35cb560eb..4d74441dc0 100644 --- a/apps/web/app/(app)/environments/[environmentId]/surveys/[surveyId]/(analysis)/components/SurveyAnalysisNavigation.tsx +++ b/apps/web/app/(app)/environments/[environmentId]/surveys/[surveyId]/(analysis)/components/SurveyAnalysisNavigation.tsx @@ -3,7 +3,6 @@ import { revalidateSurveyIdPath } from "@/app/(app)/environments/[environmentId]/surveys/[surveyId]/(analysis)/actions"; import { InboxIcon, PresentationIcon } from "lucide-react"; import { useParams, usePathname } from "next/navigation"; - import { SecondaryNavigation } from "@formbricks/ui/SecondaryNavigation"; interface SurveyAnalysisNavigationProps { diff --git a/apps/web/app/(app)/environments/[environmentId]/surveys/[surveyId]/(analysis)/layout.tsx b/apps/web/app/(app)/environments/[environmentId]/surveys/[surveyId]/(analysis)/layout.tsx index 4758a8ab1b..0cdf17113e 100644 --- a/apps/web/app/(app)/environments/[environmentId]/surveys/[surveyId]/(analysis)/layout.tsx +++ b/apps/web/app/(app)/environments/[environmentId]/surveys/[surveyId]/(analysis)/layout.tsx @@ -1,6 +1,5 @@ import { Metadata } from "next"; import { getServerSession } from "next-auth"; - import { authOptions } from "@formbricks/lib/authOptions"; import { getResponseCountBySurveyId } from "@formbricks/lib/response/service"; import { getSurvey } from "@formbricks/lib/survey/service"; diff --git a/apps/web/app/(app)/environments/[environmentId]/surveys/[surveyId]/(analysis)/responses/actions.ts b/apps/web/app/(app)/environments/[environmentId]/surveys/[surveyId]/(analysis)/responses/actions.ts index 9a0afd22d1..43713f87b1 100644 --- a/apps/web/app/(app)/environments/[environmentId]/surveys/[surveyId]/(analysis)/responses/actions.ts +++ b/apps/web/app/(app)/environments/[environmentId]/surveys/[surveyId]/(analysis)/responses/actions.ts @@ -1,7 +1,6 @@ "use server"; import { getServerSession } from "next-auth"; - import { authOptions } from "@formbricks/lib/authOptions"; import { hasUserEnvironmentAccess } from "@formbricks/lib/environment/auth"; import { createTag } from "@formbricks/lib/tag/service"; diff --git a/apps/web/app/(app)/environments/[environmentId]/surveys/[surveyId]/(analysis)/responses/components/ResponsePage.tsx b/apps/web/app/(app)/environments/[environmentId]/surveys/[surveyId]/(analysis)/responses/components/ResponsePage.tsx index c691361425..48c606fdbb 100644 --- a/apps/web/app/(app)/environments/[environmentId]/surveys/[surveyId]/(analysis)/responses/components/ResponsePage.tsx +++ b/apps/web/app/(app)/environments/[environmentId]/surveys/[surveyId]/(analysis)/responses/components/ResponsePage.tsx @@ -15,7 +15,6 @@ import { } from "@/app/share/[sharingKey]/actions"; import { useParams, useSearchParams } from "next/navigation"; import { useCallback, useEffect, useMemo, useState } from "react"; - import { TEnvironment } from "@formbricks/types/environment"; import { TResponse } from "@formbricks/types/responses"; import { TSurvey } from "@formbricks/types/surveys"; diff --git a/apps/web/app/(app)/environments/[environmentId]/surveys/[surveyId]/(analysis)/responses/components/ResponseTimeline.tsx b/apps/web/app/(app)/environments/[environmentId]/surveys/[surveyId]/(analysis)/responses/components/ResponseTimeline.tsx index dfa7349442..2d9acf14c4 100644 --- a/apps/web/app/(app)/environments/[environmentId]/surveys/[surveyId]/(analysis)/responses/components/ResponseTimeline.tsx +++ b/apps/web/app/(app)/environments/[environmentId]/surveys/[surveyId]/(analysis)/responses/components/ResponseTimeline.tsx @@ -2,7 +2,6 @@ import { EmptyAppSurveys } from "@/app/(app)/environments/[environmentId]/surveys/[surveyId]/(analysis)/components/EmptyInAppSurveys"; import { useEffect, useRef, useState } from "react"; - import { getMembershipByUserIdOrganizationIdAction } from "@formbricks/lib/membership/hooks/actions"; import { getAccessFlags } from "@formbricks/lib/membership/utils"; import { TEnvironment } from "@formbricks/types/environment"; diff --git a/apps/web/app/(app)/environments/[environmentId]/surveys/[surveyId]/(analysis)/responses/page.tsx b/apps/web/app/(app)/environments/[environmentId]/surveys/[surveyId]/(analysis)/responses/page.tsx index fd527d4f1d..0c1bef7ce7 100644 --- a/apps/web/app/(app)/environments/[environmentId]/surveys/[surveyId]/(analysis)/responses/page.tsx +++ b/apps/web/app/(app)/environments/[environmentId]/surveys/[surveyId]/(analysis)/responses/page.tsx @@ -2,7 +2,6 @@ import { SurveyAnalysisNavigation } from "@/app/(app)/environments/[environmentI import { ResponsePage } from "@/app/(app)/environments/[environmentId]/surveys/[surveyId]/(analysis)/responses/components/ResponsePage"; import { SurveyAnalysisCTA } from "@/app/(app)/environments/[environmentId]/surveys/[surveyId]/(analysis)/summary/components/SurveyAnalysisCTA"; import { getServerSession } from "next-auth"; - import { authOptions } from "@formbricks/lib/authOptions"; import { RESPONSES_PER_PAGE, WEBAPP_URL } from "@formbricks/lib/constants"; import { getEnvironment } from "@formbricks/lib/environment/service"; diff --git a/apps/web/app/(app)/environments/[environmentId]/surveys/[surveyId]/(analysis)/summary/actions.ts b/apps/web/app/(app)/environments/[environmentId]/surveys/[surveyId]/(analysis)/summary/actions.ts index f7f5cb86c1..694ae6666b 100644 --- a/apps/web/app/(app)/environments/[environmentId]/surveys/[surveyId]/(analysis)/summary/actions.ts +++ b/apps/web/app/(app)/environments/[environmentId]/surveys/[surveyId]/(analysis)/summary/actions.ts @@ -3,7 +3,6 @@ import { getEmailTemplateHtml } from "@/app/(app)/environments/[environmentId]/surveys/[surveyId]/(analysis)/summary/lib/emailTemplate"; import { customAlphabet } from "nanoid"; import { getServerSession } from "next-auth"; - import { sendEmbedSurveyPreviewEmail } from "@formbricks/email"; import { authOptions } from "@formbricks/lib/authOptions"; import { canUserAccessSurvey } from "@formbricks/lib/survey/auth"; diff --git a/apps/web/app/(app)/environments/[environmentId]/surveys/[surveyId]/(analysis)/summary/components/AddressSummary.tsx b/apps/web/app/(app)/environments/[environmentId]/surveys/[surveyId]/(analysis)/summary/components/AddressSummary.tsx index 2063f86613..06208e75ca 100644 --- a/apps/web/app/(app)/environments/[environmentId]/surveys/[surveyId]/(analysis)/summary/components/AddressSummary.tsx +++ b/apps/web/app/(app)/environments/[environmentId]/surveys/[surveyId]/(analysis)/summary/components/AddressSummary.tsx @@ -1,12 +1,10 @@ import Link from "next/link"; - import { getPersonIdentifier } from "@formbricks/lib/person/utils"; import { timeSince } from "@formbricks/lib/time"; import { TAttributeClass } from "@formbricks/types/attributeClasses"; import { TSurvey, TSurveyQuestionSummaryAddress } from "@formbricks/types/surveys"; import { AddressResponse } from "@formbricks/ui/AddressResponse"; import { PersonAvatar } from "@formbricks/ui/Avatars"; - import { QuestionSummaryHeader } from "./QuestionSummaryHeader"; interface AddressSummaryProps { diff --git a/apps/web/app/(app)/environments/[environmentId]/surveys/[surveyId]/(analysis)/summary/components/CTASummary.tsx b/apps/web/app/(app)/environments/[environmentId]/surveys/[surveyId]/(analysis)/summary/components/CTASummary.tsx index 0dd2ddcea8..7f1c7da641 100644 --- a/apps/web/app/(app)/environments/[environmentId]/surveys/[surveyId]/(analysis)/summary/components/CTASummary.tsx +++ b/apps/web/app/(app)/environments/[environmentId]/surveys/[surveyId]/(analysis)/summary/components/CTASummary.tsx @@ -1,9 +1,7 @@ import { InboxIcon } from "lucide-react"; - import { TAttributeClass } from "@formbricks/types/attributeClasses"; import { TSurvey, TSurveyQuestionSummaryCta } from "@formbricks/types/surveys"; import { ProgressBar } from "@formbricks/ui/ProgressBar"; - import { convertFloatToNDecimal } from "../lib/utils"; import { QuestionSummaryHeader } from "./QuestionSummaryHeader"; diff --git a/apps/web/app/(app)/environments/[environmentId]/surveys/[surveyId]/(analysis)/summary/components/CalSummary.tsx b/apps/web/app/(app)/environments/[environmentId]/surveys/[surveyId]/(analysis)/summary/components/CalSummary.tsx index d296181674..fc1a808bc4 100644 --- a/apps/web/app/(app)/environments/[environmentId]/surveys/[surveyId]/(analysis)/summary/components/CalSummary.tsx +++ b/apps/web/app/(app)/environments/[environmentId]/surveys/[surveyId]/(analysis)/summary/components/CalSummary.tsx @@ -1,9 +1,7 @@ import { convertFloatToNDecimal } from "@/app/(app)/environments/[environmentId]/surveys/[surveyId]/(analysis)/summary/lib/utils"; - import { TAttributeClass } from "@formbricks/types/attributeClasses"; import { TSurvey, TSurveyQuestionSummaryCal } from "@formbricks/types/surveys"; import { ProgressBar } from "@formbricks/ui/ProgressBar"; - import { QuestionSummaryHeader } from "./QuestionSummaryHeader"; interface CalSummaryProps { diff --git a/apps/web/app/(app)/environments/[environmentId]/surveys/[surveyId]/(analysis)/summary/components/ConsentSummary.tsx b/apps/web/app/(app)/environments/[environmentId]/surveys/[surveyId]/(analysis)/summary/components/ConsentSummary.tsx index 82809076ac..f4cdeec374 100644 --- a/apps/web/app/(app)/environments/[environmentId]/surveys/[surveyId]/(analysis)/summary/components/ConsentSummary.tsx +++ b/apps/web/app/(app)/environments/[environmentId]/surveys/[surveyId]/(analysis)/summary/components/ConsentSummary.tsx @@ -1,7 +1,6 @@ import { TAttributeClass } from "@formbricks/types/attributeClasses"; import { TSurvey, TSurveyQuestionSummaryConsent } from "@formbricks/types/surveys"; import { ProgressBar } from "@formbricks/ui/ProgressBar"; - import { convertFloatToNDecimal } from "../lib/utils"; import { QuestionSummaryHeader } from "./QuestionSummaryHeader"; diff --git a/apps/web/app/(app)/environments/[environmentId]/surveys/[surveyId]/(analysis)/summary/components/DateQuestionSummary.tsx b/apps/web/app/(app)/environments/[environmentId]/surveys/[surveyId]/(analysis)/summary/components/DateQuestionSummary.tsx index d8be2000aa..364ab58fe6 100644 --- a/apps/web/app/(app)/environments/[environmentId]/surveys/[surveyId]/(analysis)/summary/components/DateQuestionSummary.tsx +++ b/apps/web/app/(app)/environments/[environmentId]/surveys/[surveyId]/(analysis)/summary/components/DateQuestionSummary.tsx @@ -1,6 +1,5 @@ import Link from "next/link"; import { useState } from "react"; - import { getPersonIdentifier } from "@formbricks/lib/person/utils"; import { timeSince } from "@formbricks/lib/time"; import { formatDateWithOrdinal } from "@formbricks/lib/utils/datetime"; @@ -8,7 +7,6 @@ import { TAttributeClass } from "@formbricks/types/attributeClasses"; import { TSurvey, TSurveyQuestionSummaryDate } from "@formbricks/types/surveys"; import { PersonAvatar } from "@formbricks/ui/Avatars"; import { Button } from "@formbricks/ui/Button"; - import { QuestionSummaryHeader } from "./QuestionSummaryHeader"; interface DateQuestionSummary { diff --git a/apps/web/app/(app)/environments/[environmentId]/surveys/[surveyId]/(analysis)/summary/components/FileUploadSummary.tsx b/apps/web/app/(app)/environments/[environmentId]/surveys/[surveyId]/(analysis)/summary/components/FileUploadSummary.tsx index f22d1ff16b..30847b71c9 100644 --- a/apps/web/app/(app)/environments/[environmentId]/surveys/[surveyId]/(analysis)/summary/components/FileUploadSummary.tsx +++ b/apps/web/app/(app)/environments/[environmentId]/surveys/[surveyId]/(analysis)/summary/components/FileUploadSummary.tsx @@ -1,7 +1,6 @@ import { DownloadIcon, FileIcon } from "lucide-react"; import Link from "next/link"; import { useState } from "react"; - import { getPersonIdentifier } from "@formbricks/lib/person/utils"; import { getOriginalFileNameFromUrl } from "@formbricks/lib/storage/utils"; import { timeSince } from "@formbricks/lib/time"; @@ -9,7 +8,6 @@ import { TAttributeClass } from "@formbricks/types/attributeClasses"; import { TSurvey, TSurveyQuestionSummaryFileUpload } from "@formbricks/types/surveys"; import { PersonAvatar } from "@formbricks/ui/Avatars"; import { Button } from "@formbricks/ui/Button"; - import { QuestionSummaryHeader } from "./QuestionSummaryHeader"; interface FileUploadSummaryProps { diff --git a/apps/web/app/(app)/environments/[environmentId]/surveys/[surveyId]/(analysis)/summary/components/HiddenFieldsSummary.tsx b/apps/web/app/(app)/environments/[environmentId]/surveys/[surveyId]/(analysis)/summary/components/HiddenFieldsSummary.tsx index 3cb6b7ffc7..6e59155110 100644 --- a/apps/web/app/(app)/environments/[environmentId]/surveys/[surveyId]/(analysis)/summary/components/HiddenFieldsSummary.tsx +++ b/apps/web/app/(app)/environments/[environmentId]/surveys/[surveyId]/(analysis)/summary/components/HiddenFieldsSummary.tsx @@ -1,6 +1,5 @@ import { InboxIcon, Link, MessageSquareTextIcon } from "lucide-react"; import { useState } from "react"; - import { getPersonIdentifier } from "@formbricks/lib/person/utils"; import { timeSince } from "@formbricks/lib/time"; import { TEnvironment } from "@formbricks/types/environment"; diff --git a/apps/web/app/(app)/environments/[environmentId]/surveys/[surveyId]/(analysis)/summary/components/MatrixQuestionSummary.tsx b/apps/web/app/(app)/environments/[environmentId]/surveys/[surveyId]/(analysis)/summary/components/MatrixQuestionSummary.tsx index ae7306e076..79a38c4b72 100644 --- a/apps/web/app/(app)/environments/[environmentId]/surveys/[surveyId]/(analysis)/summary/components/MatrixQuestionSummary.tsx +++ b/apps/web/app/(app)/environments/[environmentId]/surveys/[surveyId]/(analysis)/summary/components/MatrixQuestionSummary.tsx @@ -1,7 +1,6 @@ import { TAttributeClass } from "@formbricks/types/attributeClasses"; import { TSurvey, TSurveyQuestionSummaryMatrix } from "@formbricks/types/surveys"; import { TooltipRenderer } from "@formbricks/ui/Tooltip"; - import { QuestionSummaryHeader } from "./QuestionSummaryHeader"; interface MatrixQuestionSummaryProps { diff --git a/apps/web/app/(app)/environments/[environmentId]/surveys/[surveyId]/(analysis)/summary/components/MultipleChoiceSummary.tsx b/apps/web/app/(app)/environments/[environmentId]/surveys/[surveyId]/(analysis)/summary/components/MultipleChoiceSummary.tsx index c7a4949659..42bc4be3de 100644 --- a/apps/web/app/(app)/environments/[environmentId]/surveys/[surveyId]/(analysis)/summary/components/MultipleChoiceSummary.tsx +++ b/apps/web/app/(app)/environments/[environmentId]/surveys/[surveyId]/(analysis)/summary/components/MultipleChoiceSummary.tsx @@ -1,13 +1,11 @@ import Link from "next/link"; import { useState } from "react"; - import { getPersonIdentifier } from "@formbricks/lib/person/utils"; import { TAttributeClass } from "@formbricks/types/attributeClasses"; import { TSurvey, TSurveyQuestionSummaryMultipleChoice, TSurveyType } from "@formbricks/types/surveys"; import { PersonAvatar } from "@formbricks/ui/Avatars"; import { Button } from "@formbricks/ui/Button"; import { ProgressBar } from "@formbricks/ui/ProgressBar"; - import { convertFloatToNDecimal } from "../lib/utils"; import { QuestionSummaryHeader } from "./QuestionSummaryHeader"; diff --git a/apps/web/app/(app)/environments/[environmentId]/surveys/[surveyId]/(analysis)/summary/components/NPSSummary.tsx b/apps/web/app/(app)/environments/[environmentId]/surveys/[surveyId]/(analysis)/summary/components/NPSSummary.tsx index 9fa149764f..a6421676de 100644 --- a/apps/web/app/(app)/environments/[environmentId]/surveys/[surveyId]/(analysis)/summary/components/NPSSummary.tsx +++ b/apps/web/app/(app)/environments/[environmentId]/surveys/[surveyId]/(analysis)/summary/components/NPSSummary.tsx @@ -1,7 +1,6 @@ import { TAttributeClass } from "@formbricks/types/attributeClasses"; import { TSurvey, TSurveyQuestionSummaryNps } from "@formbricks/types/surveys"; import { HalfCircle, ProgressBar } from "@formbricks/ui/ProgressBar"; - import { convertFloatToNDecimal } from "../lib/utils"; import { QuestionSummaryHeader } from "./QuestionSummaryHeader"; diff --git a/apps/web/app/(app)/environments/[environmentId]/surveys/[surveyId]/(analysis)/summary/components/OpenTextSummary.tsx b/apps/web/app/(app)/environments/[environmentId]/surveys/[surveyId]/(analysis)/summary/components/OpenTextSummary.tsx index 321a457500..442f6f2293 100644 --- a/apps/web/app/(app)/environments/[environmentId]/surveys/[surveyId]/(analysis)/summary/components/OpenTextSummary.tsx +++ b/apps/web/app/(app)/environments/[environmentId]/surveys/[surveyId]/(analysis)/summary/components/OpenTextSummary.tsx @@ -1,13 +1,11 @@ import Link from "next/link"; import { useState } from "react"; - import { getPersonIdentifier } from "@formbricks/lib/person/utils"; import { timeSince } from "@formbricks/lib/time"; import { TAttributeClass } from "@formbricks/types/attributeClasses"; import { TSurvey, TSurveyQuestionSummaryOpenText } from "@formbricks/types/surveys"; import { PersonAvatar } from "@formbricks/ui/Avatars"; import { Button } from "@formbricks/ui/Button"; - import { QuestionSummaryHeader } from "./QuestionSummaryHeader"; interface OpenTextSummaryProps { diff --git a/apps/web/app/(app)/environments/[environmentId]/surveys/[surveyId]/(analysis)/summary/components/PictureChoiceSummary.tsx b/apps/web/app/(app)/environments/[environmentId]/surveys/[surveyId]/(analysis)/summary/components/PictureChoiceSummary.tsx index dd7a852f0a..523eedb2fe 100644 --- a/apps/web/app/(app)/environments/[environmentId]/surveys/[surveyId]/(analysis)/summary/components/PictureChoiceSummary.tsx +++ b/apps/web/app/(app)/environments/[environmentId]/surveys/[surveyId]/(analysis)/summary/components/PictureChoiceSummary.tsx @@ -1,9 +1,7 @@ import Image from "next/image"; - import { TAttributeClass } from "@formbricks/types/attributeClasses"; import { TSurvey, TSurveyQuestionSummaryPictureSelection } from "@formbricks/types/surveys"; import { ProgressBar } from "@formbricks/ui/ProgressBar"; - import { convertFloatToNDecimal } from "../lib/utils"; import { QuestionSummaryHeader } from "./QuestionSummaryHeader"; diff --git a/apps/web/app/(app)/environments/[environmentId]/surveys/[surveyId]/(analysis)/summary/components/QuestionSummaryHeader.tsx b/apps/web/app/(app)/environments/[environmentId]/surveys/[surveyId]/(analysis)/summary/components/QuestionSummaryHeader.tsx index b1a74157e7..41029ec88a 100644 --- a/apps/web/app/(app)/environments/[environmentId]/surveys/[surveyId]/(analysis)/summary/components/QuestionSummaryHeader.tsx +++ b/apps/web/app/(app)/environments/[environmentId]/surveys/[surveyId]/(analysis)/summary/components/QuestionSummaryHeader.tsx @@ -1,6 +1,5 @@ import { questionTypes } from "@/app/lib/questions"; import { InboxIcon } from "lucide-react"; - import { recallToHeadline } from "@formbricks/lib/utils/recall"; import { TAttributeClass } from "@formbricks/types/attributeClasses"; import { TSurvey, TSurveyQuestionSummary } from "@formbricks/types/surveys"; diff --git a/apps/web/app/(app)/environments/[environmentId]/surveys/[surveyId]/(analysis)/summary/components/ShareEmbedSurvey.tsx b/apps/web/app/(app)/environments/[environmentId]/surveys/[surveyId]/(analysis)/summary/components/ShareEmbedSurvey.tsx index 99bac4264c..87b38762a6 100644 --- a/apps/web/app/(app)/environments/[environmentId]/surveys/[surveyId]/(analysis)/summary/components/ShareEmbedSurvey.tsx +++ b/apps/web/app/(app)/environments/[environmentId]/surveys/[surveyId]/(analysis)/summary/components/ShareEmbedSurvey.tsx @@ -4,14 +4,12 @@ import { ArrowLeftIcon, BellRing, BlocksIcon, Code2Icon, LinkIcon, MailIcon } fr import Link from "next/link"; import { useRouter } from "next/navigation"; import { useState } from "react"; - import { cn } from "@formbricks/lib/cn"; import { TSurvey } from "@formbricks/types/surveys"; import { TUser } from "@formbricks/types/user"; import { Button } from "@formbricks/ui/Button"; import { Dialog, DialogContent } from "@formbricks/ui/Dialog"; import { ShareSurveyLink } from "@formbricks/ui/ShareSurveyLink"; - import { EmailTab } from "./shareEmbedTabs/EmailTab"; import { LinkTab } from "./shareEmbedTabs/LinkTab"; import { WebpageTab } from "./shareEmbedTabs/WebpageTab"; diff --git a/apps/web/app/(app)/environments/[environmentId]/surveys/[surveyId]/(analysis)/summary/components/ShareSurveyResults.tsx b/apps/web/app/(app)/environments/[environmentId]/surveys/[surveyId]/(analysis)/summary/components/ShareSurveyResults.tsx index 012d9fb263..d435f46368 100644 --- a/apps/web/app/(app)/environments/[environmentId]/surveys/[surveyId]/(analysis)/summary/components/ShareSurveyResults.tsx +++ b/apps/web/app/(app)/environments/[environmentId]/surveys/[surveyId]/(analysis)/summary/components/ShareSurveyResults.tsx @@ -1,7 +1,6 @@ import { AlertCircleIcon, CheckCircle2Icon } from "lucide-react"; import { Clipboard } from "lucide-react"; import { toast } from "react-hot-toast"; - import { Button } from "@formbricks/ui/Button"; import { Dialog, DialogContent } from "@formbricks/ui/Dialog"; diff --git a/apps/web/app/(app)/environments/[environmentId]/surveys/[surveyId]/(analysis)/summary/components/SuccessMessage.tsx b/apps/web/app/(app)/environments/[environmentId]/surveys/[surveyId]/(analysis)/summary/components/SuccessMessage.tsx index 92d7e6d22c..34725ca7d9 100644 --- a/apps/web/app/(app)/environments/[environmentId]/surveys/[surveyId]/(analysis)/summary/components/SuccessMessage.tsx +++ b/apps/web/app/(app)/environments/[environmentId]/surveys/[surveyId]/(analysis)/summary/components/SuccessMessage.tsx @@ -3,12 +3,10 @@ import { useSearchParams } from "next/navigation"; import { useEffect, useState } from "react"; import toast from "react-hot-toast"; - import { TEnvironment } from "@formbricks/types/environment"; import { TSurvey } from "@formbricks/types/surveys"; import { TUser } from "@formbricks/types/user"; import { Confetti } from "@formbricks/ui/Confetti"; - import { ShareEmbedSurvey } from "./ShareEmbedSurvey"; interface SummaryMetadataProps { diff --git a/apps/web/app/(app)/environments/[environmentId]/surveys/[surveyId]/(analysis)/summary/components/SummaryDropOffs.tsx b/apps/web/app/(app)/environments/[environmentId]/surveys/[surveyId]/(analysis)/summary/components/SummaryDropOffs.tsx index 38028f8cc3..b2a87350b5 100644 --- a/apps/web/app/(app)/environments/[environmentId]/surveys/[surveyId]/(analysis)/summary/components/SummaryDropOffs.tsx +++ b/apps/web/app/(app)/environments/[environmentId]/surveys/[surveyId]/(analysis)/summary/components/SummaryDropOffs.tsx @@ -1,5 +1,4 @@ import { TimerIcon } from "lucide-react"; - import { TSurveySummary } from "@formbricks/types/surveys"; import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from "@formbricks/ui/Tooltip"; diff --git a/apps/web/app/(app)/environments/[environmentId]/surveys/[surveyId]/(analysis)/summary/components/SummaryPage.tsx b/apps/web/app/(app)/environments/[environmentId]/surveys/[surveyId]/(analysis)/summary/components/SummaryPage.tsx index db7f240cc5..bd300de5b5 100644 --- a/apps/web/app/(app)/environments/[environmentId]/surveys/[surveyId]/(analysis)/summary/components/SummaryPage.tsx +++ b/apps/web/app/(app)/environments/[environmentId]/surveys/[surveyId]/(analysis)/summary/components/SummaryPage.tsx @@ -15,13 +15,11 @@ import { } from "@/app/share/[sharingKey]/actions"; import { useParams, useSearchParams } from "next/navigation"; import { useEffect, useMemo, useState } from "react"; - import { replaceHeadlineRecall } from "@formbricks/lib/utils/recall"; import { TAttributeClass } from "@formbricks/types/attributeClasses"; import { TEnvironment } from "@formbricks/types/environment"; import { TSurvey, TSurveySummary } from "@formbricks/types/surveys"; import { TUser } from "@formbricks/types/user"; - import { SummaryList } from "./SummaryList"; import { SummaryMetadata } from "./SummaryMetadata"; diff --git a/apps/web/app/(app)/environments/[environmentId]/surveys/[surveyId]/(analysis)/summary/components/SurveyAnalysisCTA.tsx b/apps/web/app/(app)/environments/[environmentId]/surveys/[surveyId]/(analysis)/summary/components/SurveyAnalysisCTA.tsx index 36bee6fe1a..e15e6d615b 100644 --- a/apps/web/app/(app)/environments/[environmentId]/surveys/[surveyId]/(analysis)/summary/components/SurveyAnalysisCTA.tsx +++ b/apps/web/app/(app)/environments/[environmentId]/surveys/[surveyId]/(analysis)/summary/components/SurveyAnalysisCTA.tsx @@ -5,7 +5,6 @@ import { SuccessMessage } from "@/app/(app)/environments/[environmentId]/surveys import { SurveyStatusDropdown } from "@/app/(app)/environments/[environmentId]/surveys/[surveyId]/components/SurveyStatusDropdown"; import { ShareIcon, SquarePenIcon } from "lucide-react"; import { useState } from "react"; - import { TEnvironment } from "@formbricks/types/environment"; import { TSurvey } from "@formbricks/types/surveys"; import { TUser } from "@formbricks/types/user"; diff --git a/apps/web/app/(app)/environments/[environmentId]/surveys/[surveyId]/(analysis)/summary/components/shareEmbedTabs/EmailTab.tsx b/apps/web/app/(app)/environments/[environmentId]/surveys/[surveyId]/(analysis)/summary/components/shareEmbedTabs/EmailTab.tsx index f9a178033f..53105da597 100644 --- a/apps/web/app/(app)/environments/[environmentId]/surveys/[surveyId]/(analysis)/summary/components/shareEmbedTabs/EmailTab.tsx +++ b/apps/web/app/(app)/environments/[environmentId]/surveys/[surveyId]/(analysis)/summary/components/shareEmbedTabs/EmailTab.tsx @@ -3,12 +3,10 @@ import { Code2Icon, CopyIcon, MailIcon } from "lucide-react"; import { useEffect, useMemo, useState } from "react"; import toast from "react-hot-toast"; - import { AuthenticationError } from "@formbricks/types/errors"; import { Button } from "@formbricks/ui/Button"; import { CodeBlock } from "@formbricks/ui/CodeBlock"; import { LoadingSpinner } from "@formbricks/ui/LoadingSpinner"; - import { getEmailHtmlAction, sendEmbedSurveyPreviewEmailAction } from "../../actions"; interface EmailTabProps { diff --git a/apps/web/app/(app)/environments/[environmentId]/surveys/[surveyId]/(analysis)/summary/components/shareEmbedTabs/LinkTab.tsx b/apps/web/app/(app)/environments/[environmentId]/surveys/[surveyId]/(analysis)/summary/components/shareEmbedTabs/LinkTab.tsx index f2feff99ce..41344e3b85 100644 --- a/apps/web/app/(app)/environments/[environmentId]/surveys/[surveyId]/(analysis)/summary/components/shareEmbedTabs/LinkTab.tsx +++ b/apps/web/app/(app)/environments/[environmentId]/surveys/[surveyId]/(analysis)/summary/components/shareEmbedTabs/LinkTab.tsx @@ -1,6 +1,5 @@ import { UrlShortenerForm } from "@/app/(app)/environments/[environmentId]/components/UrlShortenerForm"; import Link from "next/link"; - import { TSurvey } from "@formbricks/types/surveys"; import { ShareSurveyLink } from "@formbricks/ui/ShareSurveyLink"; diff --git a/apps/web/app/(app)/environments/[environmentId]/surveys/[surveyId]/(analysis)/summary/components/shareEmbedTabs/WebpageTab.tsx b/apps/web/app/(app)/environments/[environmentId]/surveys/[surveyId]/(analysis)/summary/components/shareEmbedTabs/WebpageTab.tsx index bd0a394c97..54dc82d22e 100644 --- a/apps/web/app/(app)/environments/[environmentId]/surveys/[surveyId]/(analysis)/summary/components/shareEmbedTabs/WebpageTab.tsx +++ b/apps/web/app/(app)/environments/[environmentId]/surveys/[surveyId]/(analysis)/summary/components/shareEmbedTabs/WebpageTab.tsx @@ -2,7 +2,6 @@ import { CopyIcon } from "lucide-react"; import toast from "react-hot-toast"; - import { Button } from "@formbricks/ui/Button"; import { CodeBlock } from "@formbricks/ui/CodeBlock"; diff --git a/apps/web/app/(app)/environments/[environmentId]/surveys/[surveyId]/(analysis)/summary/page.tsx b/apps/web/app/(app)/environments/[environmentId]/surveys/[surveyId]/(analysis)/summary/page.tsx index b35ae4560d..097f28ffe8 100644 --- a/apps/web/app/(app)/environments/[environmentId]/surveys/[surveyId]/(analysis)/summary/page.tsx +++ b/apps/web/app/(app)/environments/[environmentId]/surveys/[surveyId]/(analysis)/summary/page.tsx @@ -3,7 +3,6 @@ import { SummaryPage } from "@/app/(app)/environments/[environmentId]/surveys/[s import { SurveyAnalysisCTA } from "@/app/(app)/environments/[environmentId]/surveys/[surveyId]/(analysis)/summary/components/SurveyAnalysisCTA"; import { getServerSession } from "next-auth"; import { notFound } from "next/navigation"; - import { getAttributeClasses } from "@formbricks/lib/attributeClass/service"; import { authOptions } from "@formbricks/lib/authOptions"; import { WEBAPP_URL } from "@formbricks/lib/constants"; diff --git a/apps/web/app/(app)/environments/[environmentId]/surveys/[surveyId]/actions.ts b/apps/web/app/(app)/environments/[environmentId]/surveys/[surveyId]/actions.ts index 665b33a745..7b8d13d735 100644 --- a/apps/web/app/(app)/environments/[environmentId]/surveys/[surveyId]/actions.ts +++ b/apps/web/app/(app)/environments/[environmentId]/surveys/[surveyId]/actions.ts @@ -1,7 +1,6 @@ "use server"; import { getServerSession } from "next-auth"; - import { authOptions } from "@formbricks/lib/authOptions"; import { getResponseDownloadUrl, getResponseFilteringValues } from "@formbricks/lib/response/service"; import { canUserAccessSurvey, verifyUserRoleAccess } from "@formbricks/lib/survey/auth"; diff --git a/apps/web/app/(app)/environments/[environmentId]/surveys/[surveyId]/components/CustomFilter.tsx b/apps/web/app/(app)/environments/[environmentId]/surveys/[surveyId]/components/CustomFilter.tsx index 5ee96d5be5..0c4e02e0b6 100755 --- a/apps/web/app/(app)/environments/[environmentId]/surveys/[surveyId]/components/CustomFilter.tsx +++ b/apps/web/app/(app)/environments/[environmentId]/surveys/[surveyId]/components/CustomFilter.tsx @@ -11,7 +11,6 @@ import { ArrowDownToLineIcon, ChevronDown, ChevronUp, DownloadIcon } from "lucid import { useParams } from "next/navigation"; import { useCallback, useEffect, useMemo, useRef, useState } from "react"; import toast from "react-hot-toast"; - import { useClickOutside } from "@formbricks/lib/utils/hooks/useClickOutside"; import { TSurvey } from "@formbricks/types/surveys"; import { Calendar } from "@formbricks/ui/Calendar"; @@ -21,7 +20,6 @@ import { DropdownMenuItem, DropdownMenuTrigger, } from "@formbricks/ui/DropdownMenu"; - import { ResponseFilter } from "./ResponseFilter"; enum DateSelected { diff --git a/apps/web/app/(app)/environments/[environmentId]/surveys/[surveyId]/components/ResultsShareButton.tsx b/apps/web/app/(app)/environments/[environmentId]/surveys/[surveyId]/components/ResultsShareButton.tsx index 4c8c5137fe..81dbbfc445 100644 --- a/apps/web/app/(app)/environments/[environmentId]/surveys/[surveyId]/components/ResultsShareButton.tsx +++ b/apps/web/app/(app)/environments/[environmentId]/surveys/[surveyId]/components/ResultsShareButton.tsx @@ -8,7 +8,6 @@ import { import { CopyIcon, DownloadIcon, GlobeIcon, LinkIcon } from "lucide-react"; import { useEffect, useState } from "react"; import toast from "react-hot-toast"; - import { TSurvey } from "@formbricks/types/surveys"; import { TUser } from "@formbricks/types/user"; import { @@ -17,7 +16,6 @@ import { DropdownMenuItem, DropdownMenuTrigger, } from "@formbricks/ui/DropdownMenu"; - import { ShareEmbedSurvey } from "../(analysis)/summary/components/ShareEmbedSurvey"; import { ShareSurveyResults } from "../(analysis)/summary/components/ShareSurveyResults"; diff --git a/apps/web/app/(app)/environments/[environmentId]/surveys/[surveyId]/components/SurveyStatusDropdown.tsx b/apps/web/app/(app)/environments/[environmentId]/surveys/[surveyId]/components/SurveyStatusDropdown.tsx index 199279fffb..37b40f3ed2 100644 --- a/apps/web/app/(app)/environments/[environmentId]/surveys/[surveyId]/components/SurveyStatusDropdown.tsx +++ b/apps/web/app/(app)/environments/[environmentId]/surveys/[surveyId]/components/SurveyStatusDropdown.tsx @@ -1,12 +1,10 @@ import { CheckCircle2Icon, PauseCircleIcon, PlayCircleIcon } from "lucide-react"; import toast from "react-hot-toast"; - import { TEnvironment } from "@formbricks/types/environment"; import { TSurvey } from "@formbricks/types/surveys"; import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from "@formbricks/ui/Select"; import { SurveyStatusIndicator } from "@formbricks/ui/SurveyStatusIndicator"; import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from "@formbricks/ui/Tooltip"; - import { updateSurveyAction } from "../actions"; interface SurveyStatusDropdownProps { diff --git a/apps/web/app/(app)/environments/[environmentId]/surveys/actions.ts b/apps/web/app/(app)/environments/[environmentId]/surveys/actions.ts index 047d40281f..4ae89d66a8 100644 --- a/apps/web/app/(app)/environments/[environmentId]/surveys/actions.ts +++ b/apps/web/app/(app)/environments/[environmentId]/surveys/actions.ts @@ -1,7 +1,6 @@ "use server"; import { getServerSession } from "next-auth"; - import { authOptions } from "@formbricks/lib/authOptions"; import { hasUserEnvironmentAccess } from "@formbricks/lib/environment/auth"; import { createSurvey } from "@formbricks/lib/survey/service"; diff --git a/apps/web/app/(app)/environments/[environmentId]/surveys/page.tsx b/apps/web/app/(app)/environments/[environmentId]/surveys/page.tsx index 8642f74b1a..11db38cd11 100644 --- a/apps/web/app/(app)/environments/[environmentId]/surveys/page.tsx +++ b/apps/web/app/(app)/environments/[environmentId]/surveys/page.tsx @@ -2,7 +2,6 @@ import { SurveyStarter } from "@/app/(app)/environments/[environmentId]/surveys/ import { PlusIcon } from "lucide-react"; import { Metadata } from "next"; import { getServerSession } from "next-auth"; - import { authOptions } from "@formbricks/lib/authOptions"; import { SURVEYS_PER_PAGE, WEBAPP_URL } from "@formbricks/lib/constants"; import { getEnvironment, getEnvironments } from "@formbricks/lib/environment/service"; diff --git a/apps/web/app/(app)/layout.tsx b/apps/web/app/(app)/layout.tsx index 67a54f5576..5cf990c15f 100644 --- a/apps/web/app/(app)/layout.tsx +++ b/apps/web/app/(app)/layout.tsx @@ -1,7 +1,6 @@ import { FormbricksClient } from "@/app/(app)/components/FormbricksClient"; import { getServerSession } from "next-auth"; import { Suspense } from "react"; - import { authOptions } from "@formbricks/lib/authOptions"; import { NoMobileOverlay } from "@formbricks/ui/NoMobileOverlay"; import { PHProvider, PostHogPageview } from "@formbricks/ui/PostHogClient"; diff --git a/apps/web/app/(app)/onboarding/actions.ts b/apps/web/app/(app)/onboarding/actions.ts index b6e3a0741b..f009f4e7a4 100644 --- a/apps/web/app/(app)/onboarding/actions.ts +++ b/apps/web/app/(app)/onboarding/actions.ts @@ -1,7 +1,6 @@ "use server"; import { getServerSession } from "next-auth"; - import { sendInviteMemberEmail } from "@formbricks/email"; import { hasOrganizationAuthority } from "@formbricks/lib/auth"; import { authOptions } from "@formbricks/lib/authOptions"; diff --git a/apps/web/app/(app)/onboarding/components/PathwaySelect.tsx b/apps/web/app/(app)/onboarding/components/PathwaySelect.tsx index 0c40df61e7..3aa33993fb 100644 --- a/apps/web/app/(app)/onboarding/components/PathwaySelect.tsx +++ b/apps/web/app/(app)/onboarding/components/PathwaySelect.tsx @@ -2,7 +2,6 @@ import { OnboardingTitle } from "@/app/(app)/onboarding/components/OnboardingTit import InappMockup from "@/images/onboarding-in-app-survey.png"; import LinkMockup from "@/images/onboarding-link-survey.webp"; import Image from "next/image"; - import { OptionCard } from "@formbricks/ui/OptionCard"; interface PathwaySelectProps { diff --git a/apps/web/app/(app)/onboarding/components/inapp/ConnectWithFormbricks.tsx b/apps/web/app/(app)/onboarding/components/inapp/ConnectWithFormbricks.tsx index 4f58ba9721..e1d4d4ef3b 100644 --- a/apps/web/app/(app)/onboarding/components/inapp/ConnectWithFormbricks.tsx +++ b/apps/web/app/(app)/onboarding/components/inapp/ConnectWithFormbricks.tsx @@ -8,10 +8,8 @@ import Image from "next/image"; import { useRouter } from "next/navigation"; import { usePostHog } from "posthog-js/react"; import { useEffect, useState } from "react"; - import { TEnvironment } from "@formbricks/types/environment"; import { Button } from "@formbricks/ui/Button"; - import { fetchEnvironment, finishOnboardingAction } from "../../actions"; import { SetupInstructionsOnboarding } from "./SetupInstructions"; diff --git a/apps/web/app/(app)/onboarding/components/inapp/InviteOrganizationMate.tsx b/apps/web/app/(app)/onboarding/components/inapp/InviteOrganizationMate.tsx index d3162c0f18..08db17d51d 100644 --- a/apps/web/app/(app)/onboarding/components/inapp/InviteOrganizationMate.tsx +++ b/apps/web/app/(app)/onboarding/components/inapp/InviteOrganizationMate.tsx @@ -4,12 +4,10 @@ import { OnboardingTitle } from "@/app/(app)/onboarding/components/OnboardingTit import { useRouter } from "next/navigation"; import { useState } from "react"; import { toast } from "react-hot-toast"; - import { isValidEmail } from "@formbricks/lib/utils/email"; import { TOrganization } from "@formbricks/types/organizations"; import { Button } from "@formbricks/ui/Button"; import { Input } from "@formbricks/ui/Input"; - import { finishOnboardingAction, inviteOrganizationMemberAction } from "../../actions"; interface InviteOrganizationMemberProps { diff --git a/apps/web/app/(app)/onboarding/components/inapp/SetupInstructions.tsx b/apps/web/app/(app)/onboarding/components/inapp/SetupInstructions.tsx index 5137b47b2f..b6ddfd5b51 100644 --- a/apps/web/app/(app)/onboarding/components/inapp/SetupInstructions.tsx +++ b/apps/web/app/(app)/onboarding/components/inapp/SetupInstructions.tsx @@ -3,7 +3,6 @@ import "prismjs/themes/prism.css"; import { useState } from "react"; import toast from "react-hot-toast"; - import { cn } from "@formbricks/lib/cn"; import { Button } from "@formbricks/ui/Button"; import { CodeBlock } from "@formbricks/ui/CodeBlock"; diff --git a/apps/web/app/(app)/onboarding/components/inapp/SurveyObjective.tsx b/apps/web/app/(app)/onboarding/components/inapp/SurveyObjective.tsx index 910094972b..97473bfdef 100644 --- a/apps/web/app/(app)/onboarding/components/inapp/SurveyObjective.tsx +++ b/apps/web/app/(app)/onboarding/components/inapp/SurveyObjective.tsx @@ -6,7 +6,6 @@ import { handleTabNavigation } from "@/app/(app)/onboarding/utils"; import { formbricksEnabled, updateResponse } from "@/app/lib/formbricks"; import { useEffect, useRef, useState } from "react"; import { toast } from "react-hot-toast"; - import { cn } from "@formbricks/lib/cn"; import { env } from "@formbricks/lib/env"; import { TUser, TUserObjective } from "@formbricks/types/user"; diff --git a/apps/web/app/(app)/onboarding/components/inapp/SurveyRole.tsx b/apps/web/app/(app)/onboarding/components/inapp/SurveyRole.tsx index 84045f1347..281b56eb1d 100644 --- a/apps/web/app/(app)/onboarding/components/inapp/SurveyRole.tsx +++ b/apps/web/app/(app)/onboarding/components/inapp/SurveyRole.tsx @@ -7,7 +7,6 @@ import { createResponse, formbricksEnabled } from "@/app/lib/formbricks"; import { Session } from "next-auth"; import { useEffect, useRef, useState } from "react"; import { toast } from "react-hot-toast"; - import { cn } from "@formbricks/lib/cn"; import { env } from "@formbricks/lib/env"; import { Button } from "@formbricks/ui/Button"; diff --git a/apps/web/app/(app)/onboarding/components/link/CreateFirstSurvey.tsx b/apps/web/app/(app)/onboarding/components/link/CreateFirstSurvey.tsx index 3478ddb6fc..9b0bdde523 100644 --- a/apps/web/app/(app)/onboarding/components/link/CreateFirstSurvey.tsx +++ b/apps/web/app/(app)/onboarding/components/link/CreateFirstSurvey.tsx @@ -9,12 +9,10 @@ import Image from "next/image"; import { useRouter } from "next/navigation"; import { useState } from "react"; import { toast } from "react-hot-toast"; - import { customSurvey, templates } from "@formbricks/lib/templates"; import { TTemplate } from "@formbricks/types/templates"; import { Button } from "@formbricks/ui/Button"; import { OptionCard } from "@formbricks/ui/OptionCard"; - import { createSurveyFromTemplate, finishOnboardingAction } from "../../actions"; interface CreateFirstSurveyProps { diff --git a/apps/web/app/(app)/onboarding/components/onboarding.tsx b/apps/web/app/(app)/onboarding/components/onboarding.tsx index ca4593c042..dcd71c8921 100644 --- a/apps/web/app/(app)/onboarding/components/onboarding.tsx +++ b/apps/web/app/(app)/onboarding/components/onboarding.tsx @@ -10,11 +10,9 @@ import { CreateFirstSurvey } from "@/app/(app)/onboarding/components/link/Create import { Session } from "next-auth"; import { useRouter } from "next/navigation"; import { useEffect, useState } from "react"; - import { TEnvironment } from "@formbricks/types/environment"; import { TOrganization } from "@formbricks/types/organizations"; import { TUser } from "@formbricks/types/user"; - import { PathwaySelect } from "./PathwaySelect"; import { OnboardingHeader } from "./ProgressBar"; diff --git a/apps/web/app/(app)/onboarding/layout.tsx b/apps/web/app/(app)/onboarding/layout.tsx index 20a297e477..d5742fa1be 100644 --- a/apps/web/app/(app)/onboarding/layout.tsx +++ b/apps/web/app/(app)/onboarding/layout.tsx @@ -1,7 +1,6 @@ import { PosthogIdentify } from "@/app/(app)/environments/[environmentId]/components/PosthogIdentify"; import { getServerSession } from "next-auth"; import { redirect } from "next/navigation"; - import { authOptions } from "@formbricks/lib/authOptions"; import { ToasterClient } from "@formbricks/ui/ToasterClient"; diff --git a/apps/web/app/(app)/onboarding/page.tsx b/apps/web/app/(app)/onboarding/page.tsx index 793da3afe6..15329f3906 100644 --- a/apps/web/app/(app)/onboarding/page.tsx +++ b/apps/web/app/(app)/onboarding/page.tsx @@ -1,7 +1,6 @@ import { Onboarding } from "@/app/(app)/onboarding/components/onboarding"; import { getServerSession } from "next-auth"; import { redirect } from "next/navigation"; - import { authOptions } from "@formbricks/lib/authOptions"; import { IS_FORMBRICKS_CLOUD, WEBAPP_URL } from "@formbricks/lib/constants"; import { getFirstEnvironmentByUserId } from "@formbricks/lib/environment/service"; diff --git a/apps/web/app/(auth)/auth/forgot-password/components/PasswordResetForm/index.tsx b/apps/web/app/(auth)/auth/forgot-password/components/PasswordResetForm/index.tsx index 974df8f29b..6ef0f371cb 100644 --- a/apps/web/app/(auth)/auth/forgot-password/components/PasswordResetForm/index.tsx +++ b/apps/web/app/(auth)/auth/forgot-password/components/PasswordResetForm/index.tsx @@ -3,7 +3,6 @@ import { XCircleIcon } from "lucide-react"; import { useRouter } from "next/navigation"; import { useState } from "react"; - import { forgotPassword } from "@formbricks/lib/utils/users"; import { Button } from "@formbricks/ui/Button"; diff --git a/apps/web/app/(auth)/auth/forgot-password/reset/components/ResetPasswordForm/index.tsx b/apps/web/app/(auth)/auth/forgot-password/reset/components/ResetPasswordForm/index.tsx index f16b0848c6..e4d25b633a 100644 --- a/apps/web/app/(auth)/auth/forgot-password/reset/components/ResetPasswordForm/index.tsx +++ b/apps/web/app/(auth)/auth/forgot-password/reset/components/ResetPasswordForm/index.tsx @@ -4,7 +4,6 @@ import { XCircleIcon } from "lucide-react"; import { useRouter, useSearchParams } from "next/navigation"; import { useState } from "react"; import { toast } from "react-hot-toast"; - import { resetPassword } from "@formbricks/lib/utils/users"; import { Button } from "@formbricks/ui/Button"; import { PasswordInput } from "@formbricks/ui/PasswordInput"; diff --git a/apps/web/app/(auth)/auth/layout.tsx b/apps/web/app/(auth)/auth/layout.tsx index a81faa9217..69192bed0d 100644 --- a/apps/web/app/(auth)/auth/layout.tsx +++ b/apps/web/app/(auth)/auth/layout.tsx @@ -1,7 +1,6 @@ import { getServerSession } from "next-auth"; import { redirect } from "next/navigation"; import { Toaster } from "react-hot-toast"; - import { getIsMultiOrgEnabled } from "@formbricks/ee/lib/service"; import { authOptions } from "@formbricks/lib/authOptions"; import { getIsFreshInstance } from "@formbricks/lib/instance/service"; diff --git a/apps/web/app/(auth)/auth/login/components/SigninForm.tsx b/apps/web/app/(auth)/auth/login/components/SigninForm.tsx index 5462e15f9b..b00ad7dfb3 100644 --- a/apps/web/app/(auth)/auth/login/components/SigninForm.tsx +++ b/apps/web/app/(auth)/auth/login/components/SigninForm.tsx @@ -8,7 +8,6 @@ import Link from "next/dist/client/link"; import { useRouter, useSearchParams } from "next/navigation"; import { useEffect, useMemo, useRef, useState } from "react"; import { Controller, FormProvider, SubmitHandler, useForm } from "react-hook-form"; - import { cn } from "@formbricks/lib/cn"; import { Button } from "@formbricks/ui/Button"; import { PasswordInput } from "@formbricks/ui/PasswordInput"; diff --git a/apps/web/app/(auth)/auth/login/components/TwoFactor.tsx b/apps/web/app/(auth)/auth/login/components/TwoFactor.tsx index 05e1ee2fb5..bedd66ad07 100644 --- a/apps/web/app/(auth)/auth/login/components/TwoFactor.tsx +++ b/apps/web/app/(auth)/auth/login/components/TwoFactor.tsx @@ -2,7 +2,6 @@ import React from "react"; import { Controller, useFormContext } from "react-hook-form"; - import { OTPInput } from "@formbricks/ui/OTPInput"; export const TwoFactor = () => { diff --git a/apps/web/app/(auth)/auth/login/components/TwoFactorBackup.tsx b/apps/web/app/(auth)/auth/login/components/TwoFactorBackup.tsx index acc659eb92..6f926b1284 100644 --- a/apps/web/app/(auth)/auth/login/components/TwoFactorBackup.tsx +++ b/apps/web/app/(auth)/auth/login/components/TwoFactorBackup.tsx @@ -2,7 +2,6 @@ import React from "react"; import { useFormContext } from "react-hook-form"; - import { Input } from "@formbricks/ui/Input"; export const TwoFactorBackup = () => { diff --git a/apps/web/app/(auth)/auth/login/page.tsx b/apps/web/app/(auth)/auth/login/page.tsx index 33dd273fa4..2c42e29c6e 100644 --- a/apps/web/app/(auth)/auth/login/page.tsx +++ b/apps/web/app/(auth)/auth/login/page.tsx @@ -2,7 +2,6 @@ import { FormWrapper } from "@/app/(auth)/auth/components/FormWrapper"; import { Testimonial } from "@/app/(auth)/auth/components/Testimonial"; import { SigninForm } from "@/app/(auth)/auth/login/components/SigninForm"; import { Metadata } from "next"; - import { getIsMultiOrgEnabled } from "@formbricks/ee/lib/service"; import { AZURE_OAUTH_ENABLED, diff --git a/apps/web/app/(auth)/auth/signup/components/SignupForm.tsx b/apps/web/app/(auth)/auth/signup/components/SignupForm.tsx index fce46c7b8e..aed1bdaf71 100644 --- a/apps/web/app/(auth)/auth/signup/components/SignupForm.tsx +++ b/apps/web/app/(auth)/auth/signup/components/SignupForm.tsx @@ -4,7 +4,6 @@ import { XCircleIcon } from "lucide-react"; import Link from "next/link"; import { useSearchParams } from "next/navigation"; import { useMemo, useState } from "react"; - import { SignupOptions } from "@formbricks/ui/SignupOptions"; interface SignupFormProps { diff --git a/apps/web/app/(auth)/auth/verification-requested/components/RequestVerificationEmail.tsx b/apps/web/app/(auth)/auth/verification-requested/components/RequestVerificationEmail.tsx index 622bd8bf67..3c4cccf884 100644 --- a/apps/web/app/(auth)/auth/verification-requested/components/RequestVerificationEmail.tsx +++ b/apps/web/app/(auth)/auth/verification-requested/components/RequestVerificationEmail.tsx @@ -2,7 +2,6 @@ import { useEffect } from "react"; import toast from "react-hot-toast"; - import { resendVerificationEmail } from "@formbricks/lib/utils/users"; import { Button } from "@formbricks/ui/Button"; diff --git a/apps/web/app/(redirects)/organizations/[organizationId]/route.ts b/apps/web/app/(redirects)/organizations/[organizationId]/route.ts index a39e0e5008..c1e89879ec 100644 --- a/apps/web/app/(redirects)/organizations/[organizationId]/route.ts +++ b/apps/web/app/(redirects)/organizations/[organizationId]/route.ts @@ -2,7 +2,6 @@ import { hasOrganizationAccess } from "@/app/lib/api/apiHelper"; import { getServerSession } from "next-auth"; import { redirect } from "next/navigation"; import { notFound } from "next/navigation"; - import { authOptions } from "@formbricks/lib/authOptions"; import { getEnvironments } from "@formbricks/lib/environment/service"; import { getProducts } from "@formbricks/lib/product/service"; diff --git a/apps/web/app/(redirects)/products/[productId]/route.ts b/apps/web/app/(redirects)/products/[productId]/route.ts index d0e915d59c..dc62e343da 100644 --- a/apps/web/app/(redirects)/products/[productId]/route.ts +++ b/apps/web/app/(redirects)/products/[productId]/route.ts @@ -1,7 +1,6 @@ import { hasOrganizationAccess } from "@/app/lib/api/apiHelper"; import { getServerSession } from "next-auth"; import { notFound, redirect } from "next/navigation"; - import { authOptions } from "@formbricks/lib/authOptions"; import { getEnvironments } from "@formbricks/lib/environment/service"; import { getProduct } from "@formbricks/lib/product/service"; diff --git a/apps/web/app/[shortUrlId]/page.tsx b/apps/web/app/[shortUrlId]/page.tsx index 6dd6bf1cf4..316b508f7c 100644 --- a/apps/web/app/[shortUrlId]/page.tsx +++ b/apps/web/app/[shortUrlId]/page.tsx @@ -1,7 +1,6 @@ import { getMetadataForLinkSurvey } from "@/app/s/[surveyId]/metadata"; import type { Metadata } from "next"; import { notFound, redirect } from "next/navigation"; - import { getShortUrl } from "@formbricks/lib/shortUrl/service"; import { TShortUrl, ZShortUrlId } from "@formbricks/types/shortUrl"; diff --git a/apps/web/app/api/auth/[...nextauth]/route.ts b/apps/web/app/api/auth/[...nextauth]/route.ts index b1deab4ba1..2e92566b35 100644 --- a/apps/web/app/api/auth/[...nextauth]/route.ts +++ b/apps/web/app/api/auth/[...nextauth]/route.ts @@ -1,5 +1,4 @@ import NextAuth from "next-auth"; - import { authOptions } from "@formbricks/lib/authOptions"; const handler = NextAuth(authOptions); diff --git a/apps/web/app/api/billing/stripe-webhook/route.ts b/apps/web/app/api/billing/stripe-webhook/route.ts index cb6cf1f700..016a5399b6 100644 --- a/apps/web/app/api/billing/stripe-webhook/route.ts +++ b/apps/web/app/api/billing/stripe-webhook/route.ts @@ -1,6 +1,5 @@ import { responses } from "@/app/lib/api/response"; import { headers } from "next/headers"; - import { webhookHandler } from "@formbricks/ee/billing/api/stripe-webhook"; export const POST = async (request: Request) => { diff --git a/apps/web/app/api/cron/ping/route.ts b/apps/web/app/api/cron/ping/route.ts index 4a3c177ce9..bebbd8677f 100644 --- a/apps/web/app/api/cron/ping/route.ts +++ b/apps/web/app/api/cron/ping/route.ts @@ -1,7 +1,6 @@ import { responses } from "@/app/lib/api/response"; import packageJson from "@/package.json"; import { headers } from "next/headers"; - import { prisma } from "@formbricks/database"; import { CRON_SECRET } from "@formbricks/lib/constants"; import { captureTelemetry } from "@formbricks/lib/telemetry"; diff --git a/apps/web/app/api/cron/survey-status/route.ts b/apps/web/app/api/cron/survey-status/route.ts index d6e7abcf17..678b0066f9 100644 --- a/apps/web/app/api/cron/survey-status/route.ts +++ b/apps/web/app/api/cron/survey-status/route.ts @@ -1,6 +1,5 @@ import { responses } from "@/app/lib/api/response"; import { headers } from "next/headers"; - import { prisma } from "@formbricks/database"; import { CRON_SECRET } from "@formbricks/lib/constants"; diff --git a/apps/web/app/api/cron/weekly-summary/route.ts b/apps/web/app/api/cron/weekly-summary/route.ts index 6f2fcf54b1..6f7da63b93 100644 --- a/apps/web/app/api/cron/weekly-summary/route.ts +++ b/apps/web/app/api/cron/weekly-summary/route.ts @@ -1,9 +1,7 @@ import { responses } from "@/app/lib/api/response"; import { headers } from "next/headers"; - import { sendNoLiveSurveyNotificationEmail, sendWeeklySummaryNotificationEmail } from "@formbricks/email"; import { CRON_SECRET } from "@formbricks/lib/constants"; - import { getNotificationResponse } from "./lib/notificationResponse"; import { getOrganizationIds } from "./lib/organization"; import { getProductsByOrganizationId } from "./lib/product"; diff --git a/apps/web/app/api/google-sheet/callback/route.ts b/apps/web/app/api/google-sheet/callback/route.ts index d237e9c6ca..3220e05c45 100644 --- a/apps/web/app/api/google-sheet/callback/route.ts +++ b/apps/web/app/api/google-sheet/callback/route.ts @@ -1,6 +1,5 @@ import { responses } from "@/app/lib/api/response"; import { google } from "googleapis"; - import { GOOGLE_SHEETS_CLIENT_ID, GOOGLE_SHEETS_CLIENT_SECRET, diff --git a/apps/web/app/api/google-sheet/route.ts b/apps/web/app/api/google-sheet/route.ts index 0edc9b7283..3841631e1d 100644 --- a/apps/web/app/api/google-sheet/route.ts +++ b/apps/web/app/api/google-sheet/route.ts @@ -2,7 +2,6 @@ import { responses } from "@/app/lib/api/response"; import { google } from "googleapis"; import { getServerSession } from "next-auth"; import { NextRequest } from "next/server"; - import { authOptions } from "@formbricks/lib/authOptions"; import { GOOGLE_SHEETS_CLIENT_ID, diff --git a/apps/web/app/api/internal/csv-conversion/route.ts b/apps/web/app/api/internal/csv-conversion/route.ts index c081d76e8d..2f1fb4bd36 100755 --- a/apps/web/app/api/internal/csv-conversion/route.ts +++ b/apps/web/app/api/internal/csv-conversion/route.ts @@ -2,7 +2,6 @@ import { responses } from "@/app/lib/api/response"; import { AsyncParser } from "@json2csv/node"; import { getServerSession } from "next-auth"; import { NextRequest } from "next/server"; - import { authOptions } from "@formbricks/lib/authOptions"; export const POST = async (request: NextRequest) => { diff --git a/apps/web/app/api/internal/excel-conversion/route.ts b/apps/web/app/api/internal/excel-conversion/route.ts index abe9e40406..550937caf7 100755 --- a/apps/web/app/api/internal/excel-conversion/route.ts +++ b/apps/web/app/api/internal/excel-conversion/route.ts @@ -2,7 +2,6 @@ import { responses } from "@/app/lib/api/response"; import { getServerSession } from "next-auth"; import { NextRequest } from "next/server"; import * as xlsx from "xlsx"; - import { authOptions } from "@formbricks/lib/authOptions"; export const POST = async (request: NextRequest) => { diff --git a/apps/web/app/api/js/route.ts b/apps/web/app/api/js/route.ts index 68a3f64d50..cd576d9eb3 100644 --- a/apps/web/app/api/js/route.ts +++ b/apps/web/app/api/js/route.ts @@ -2,7 +2,6 @@ // Deprecated since 22-03-2024 // This endpoint has been deprecated. Please use the new endpoint /api/packages/js instead. import { responses } from "@/app/lib/api/response"; - import { WEBAPP_URL } from "@formbricks/lib/constants"; export const GET = async () => { diff --git a/apps/web/app/api/pipeline/route.ts b/apps/web/app/api/pipeline/route.ts index 6e8f590b32..da77012f8b 100644 --- a/apps/web/app/api/pipeline/route.ts +++ b/apps/web/app/api/pipeline/route.ts @@ -1,7 +1,6 @@ import { responses } from "@/app/lib/api/response"; import { transformErrorToDetails } from "@/app/lib/api/validator"; import { headers } from "next/headers"; - import { prisma } from "@formbricks/database"; import { sendResponseFinishedEmail } from "@formbricks/email"; import { INTERNAL_SECRET } from "@formbricks/lib/constants"; @@ -12,7 +11,6 @@ import { getSurvey, updateSurvey } from "@formbricks/lib/survey/service"; import { convertDatesInObject } from "@formbricks/lib/time"; import { ZPipelineInput } from "@formbricks/types/pipelines"; import { TUserNotificationSettings } from "@formbricks/types/user"; - import { handleIntegrations } from "./lib/handleIntegrations"; export const POST = async (request: Request) => { diff --git a/apps/web/app/api/v1/(legacy)/client/[environmentId]/people/[userId]/route.ts b/apps/web/app/api/v1/(legacy)/client/[environmentId]/people/[userId]/route.ts index 410d522fc8..d44fa709ff 100644 --- a/apps/web/app/api/v1/(legacy)/client/[environmentId]/people/[userId]/route.ts +++ b/apps/web/app/api/v1/(legacy)/client/[environmentId]/people/[userId]/route.ts @@ -3,7 +3,6 @@ import { responses } from "@/app/lib/api/response"; import { transformErrorToDetails } from "@/app/lib/api/validator"; import { z } from "zod"; - import { getAttributesByUserId, updateAttributes } from "@formbricks/lib/attribute/service"; import { createPerson, getPersonByUserId } from "@formbricks/lib/person/service"; import { ZAttributes } from "@formbricks/types/attributes"; diff --git a/apps/web/app/api/v1/(legacy)/client/[environmentId]/people/[userId]/set-attribute/route.ts b/apps/web/app/api/v1/(legacy)/client/[environmentId]/people/[userId]/set-attribute/route.ts index 35f2d6dc48..dac2e26dd9 100644 --- a/apps/web/app/api/v1/(legacy)/client/[environmentId]/people/[userId]/set-attribute/route.ts +++ b/apps/web/app/api/v1/(legacy)/client/[environmentId]/people/[userId]/set-attribute/route.ts @@ -1,6 +1,5 @@ import { responses } from "@/app/lib/api/response"; import { transformErrorToDetails } from "@/app/lib/api/validator"; - import { getActionClasses } from "@formbricks/lib/actionClass/service"; import { updateAttributes } from "@formbricks/lib/attribute/service"; import { getOrganizationByEnvironmentId } from "@formbricks/lib/organization/service"; diff --git a/apps/web/app/api/v1/(legacy)/client/displays/[displayId]/responded/route.ts b/apps/web/app/api/v1/(legacy)/client/displays/[displayId]/responded/route.ts index c3a06644f4..f9a65a4e24 100644 --- a/apps/web/app/api/v1/(legacy)/client/displays/[displayId]/responded/route.ts +++ b/apps/web/app/api/v1/(legacy)/client/displays/[displayId]/responded/route.ts @@ -1,5 +1,4 @@ import { responses } from "@/app/lib/api/response"; - import { markDisplayRespondedLegacy } from "@formbricks/lib/display/service"; export const OPTIONS = async (): Promise => { diff --git a/apps/web/app/api/v1/(legacy)/client/displays/[displayId]/route.ts b/apps/web/app/api/v1/(legacy)/client/displays/[displayId]/route.ts index f3a1572a13..b5e7a67cc9 100644 --- a/apps/web/app/api/v1/(legacy)/client/displays/[displayId]/route.ts +++ b/apps/web/app/api/v1/(legacy)/client/displays/[displayId]/route.ts @@ -1,6 +1,5 @@ import { responses } from "@/app/lib/api/response"; import { transformErrorToDetails } from "@/app/lib/api/validator"; - import { updateDisplayLegacy } from "@formbricks/lib/display/service"; import { ZDisplayLegacyUpdateInput } from "@formbricks/types/displays"; diff --git a/apps/web/app/api/v1/(legacy)/client/displays/route.ts b/apps/web/app/api/v1/(legacy)/client/displays/route.ts index 8b7613b324..ddf107751a 100644 --- a/apps/web/app/api/v1/(legacy)/client/displays/route.ts +++ b/apps/web/app/api/v1/(legacy)/client/displays/route.ts @@ -1,6 +1,5 @@ import { responses } from "@/app/lib/api/response"; import { transformErrorToDetails } from "@/app/lib/api/validator"; - import { createDisplayLegacy } from "@formbricks/lib/display/service"; import { capturePosthogEnvironmentEvent } from "@formbricks/lib/posthogServer"; import { getSurvey } from "@formbricks/lib/survey/service"; diff --git a/apps/web/app/api/v1/(legacy)/client/people/[personId]/set-attribute/route.ts b/apps/web/app/api/v1/(legacy)/client/people/[personId]/set-attribute/route.ts index ab08ccb989..8ef5e3c78c 100644 --- a/apps/web/app/api/v1/(legacy)/client/people/[personId]/set-attribute/route.ts +++ b/apps/web/app/api/v1/(legacy)/client/people/[personId]/set-attribute/route.ts @@ -1,6 +1,5 @@ import { responses } from "@/app/lib/api/response"; import { transformErrorToDetails } from "@/app/lib/api/validator"; - import { getActionClasses } from "@formbricks/lib/actionClass/service"; import { updateAttributes } from "@formbricks/lib/attribute/service"; import { getOrganizationByEnvironmentId } from "@formbricks/lib/organization/service"; diff --git a/apps/web/app/api/v1/(legacy)/client/responses/[responseId]/route.ts b/apps/web/app/api/v1/(legacy)/client/responses/[responseId]/route.ts index 790f546614..fcb22b3ec3 100644 --- a/apps/web/app/api/v1/(legacy)/client/responses/[responseId]/route.ts +++ b/apps/web/app/api/v1/(legacy)/client/responses/[responseId]/route.ts @@ -1,7 +1,6 @@ import { responses } from "@/app/lib/api/response"; import { transformErrorToDetails } from "@/app/lib/api/validator"; import { sendToPipeline } from "@/app/lib/pipelines"; - import { updateResponse } from "@formbricks/lib/response/service"; import { getSurvey } from "@formbricks/lib/survey/service"; import { DatabaseError, InvalidInputError, ResourceNotFoundError } from "@formbricks/types/errors"; diff --git a/apps/web/app/api/v1/(legacy)/client/responses/route.ts b/apps/web/app/api/v1/(legacy)/client/responses/route.ts index 810ffca342..a099290351 100644 --- a/apps/web/app/api/v1/(legacy)/client/responses/route.ts +++ b/apps/web/app/api/v1/(legacy)/client/responses/route.ts @@ -3,7 +3,6 @@ import { transformErrorToDetails } from "@/app/lib/api/validator"; import { sendToPipeline } from "@/app/lib/pipelines"; import { headers } from "next/headers"; import { UAParser } from "ua-parser-js"; - import { capturePosthogEnvironmentEvent } from "@formbricks/lib/posthogServer"; import { createResponseLegacy } from "@formbricks/lib/response/service"; import { getSurvey } from "@formbricks/lib/survey/service"; diff --git a/apps/web/app/api/v1/(legacy)/js/people/[personId]/set-attribute/route.ts b/apps/web/app/api/v1/(legacy)/js/people/[personId]/set-attribute/route.ts index 969b4d7fbb..16b013b197 100644 --- a/apps/web/app/api/v1/(legacy)/js/people/[personId]/set-attribute/route.ts +++ b/apps/web/app/api/v1/(legacy)/js/people/[personId]/set-attribute/route.ts @@ -1,7 +1,6 @@ import { getUpdatedState } from "@/app/api/v1/(legacy)/js/sync/lib/sync"; import { responses } from "@/app/lib/api/response"; import { transformErrorToDetails } from "@/app/lib/api/validator"; - import { updateAttributes } from "@formbricks/lib/attribute/service"; import { personCache } from "@formbricks/lib/person/cache"; import { getPerson } from "@formbricks/lib/person/service"; diff --git a/apps/web/app/api/v1/(legacy)/js/people/[personId]/set-user-id/route.ts b/apps/web/app/api/v1/(legacy)/js/people/[personId]/set-user-id/route.ts index 63fda421cb..dc1d2db1c1 100644 --- a/apps/web/app/api/v1/(legacy)/js/people/[personId]/set-user-id/route.ts +++ b/apps/web/app/api/v1/(legacy)/js/people/[personId]/set-user-id/route.ts @@ -1,7 +1,6 @@ import { getUpdatedState } from "@/app/api/v1/(legacy)/js/sync/lib/sync"; import { responses } from "@/app/lib/api/response"; import { transformErrorToDetails } from "@/app/lib/api/validator"; - import { createPerson, getPersonByUserId } from "@formbricks/lib/person/service"; import { ZJsPeopleUserIdInput } from "@formbricks/types/js"; diff --git a/apps/web/app/api/v1/(legacy)/js/people/route.ts b/apps/web/app/api/v1/(legacy)/js/people/route.ts index 496bb75cb0..48414a28ec 100644 --- a/apps/web/app/api/v1/(legacy)/js/people/route.ts +++ b/apps/web/app/api/v1/(legacy)/js/people/route.ts @@ -1,6 +1,5 @@ import { responses } from "@/app/lib/api/response"; import { NextRequest } from "next/server"; - import { createPerson } from "@formbricks/lib/person/service"; export const OPTIONS = async () => { diff --git a/apps/web/app/api/v1/(legacy)/js/sync/route.ts b/apps/web/app/api/v1/(legacy)/js/sync/route.ts index e23dd107e3..1a5144cf0b 100644 --- a/apps/web/app/api/v1/(legacy)/js/sync/route.ts +++ b/apps/web/app/api/v1/(legacy)/js/sync/route.ts @@ -1,7 +1,6 @@ import { getUpdatedState } from "@/app/api/v1/(legacy)/js/sync/lib/sync"; import { responses } from "@/app/lib/api/response"; import { transformErrorToDetails } from "@/app/lib/api/validator"; - import { ZJsSyncLegacyInput } from "@formbricks/types/js"; export const OPTIONS = async (): Promise => { diff --git a/apps/web/app/api/v1/auth.ts b/apps/web/app/api/v1/auth.ts index cd6cd64920..4e29cb5785 100644 --- a/apps/web/app/api/v1/auth.ts +++ b/apps/web/app/api/v1/auth.ts @@ -1,5 +1,4 @@ import { responses } from "@/app/lib/api/response"; - import { getApiKeyFromKey } from "@formbricks/lib/apiKey/service"; import { TAuthenticationApiKey } from "@formbricks/types/auth"; import { DatabaseError, InvalidInputError, ResourceNotFoundError } from "@formbricks/types/errors"; diff --git a/apps/web/app/api/v1/client/[environmentId]/actions/route.ts b/apps/web/app/api/v1/client/[environmentId]/actions/route.ts index e81febe032..1e03c36d39 100644 --- a/apps/web/app/api/v1/client/[environmentId]/actions/route.ts +++ b/apps/web/app/api/v1/client/[environmentId]/actions/route.ts @@ -1,6 +1,5 @@ import { responses } from "@/app/lib/api/response"; import { transformErrorToDetails } from "@/app/lib/api/validator"; - import { createAction } from "@formbricks/lib/action/service"; import { IS_FORMBRICKS_CLOUD } from "@formbricks/lib/constants"; import { getOrganizationByEnvironmentId } from "@formbricks/lib/organization/service"; diff --git a/apps/web/app/api/v1/client/[environmentId]/app/sync/[userId]/route.ts b/apps/web/app/api/v1/client/[environmentId]/app/sync/[userId]/route.ts index a5b153308f..8488510c5d 100644 --- a/apps/web/app/api/v1/client/[environmentId]/app/sync/[userId]/route.ts +++ b/apps/web/app/api/v1/client/[environmentId]/app/sync/[userId]/route.ts @@ -6,7 +6,6 @@ import { import { responses } from "@/app/lib/api/response"; import { transformErrorToDetails } from "@/app/lib/api/validator"; import { NextRequest, userAgent } from "next/server"; - import { getActionClasses } from "@formbricks/lib/actionClass/service"; import { getAttributes } from "@formbricks/lib/attribute/service"; import { diff --git a/apps/web/app/api/v1/client/[environmentId]/displays/[displayId]/route.ts b/apps/web/app/api/v1/client/[environmentId]/displays/[displayId]/route.ts index 47bb45207b..e9fcdcfcf2 100644 --- a/apps/web/app/api/v1/client/[environmentId]/displays/[displayId]/route.ts +++ b/apps/web/app/api/v1/client/[environmentId]/displays/[displayId]/route.ts @@ -1,6 +1,5 @@ import { responses } from "@/app/lib/api/response"; import { transformErrorToDetails } from "@/app/lib/api/validator"; - import { updateDisplay } from "@formbricks/lib/display/service"; import { ZDisplayUpdateInput } from "@formbricks/types/displays"; diff --git a/apps/web/app/api/v1/client/[environmentId]/displays/route.ts b/apps/web/app/api/v1/client/[environmentId]/displays/route.ts index 9d97b178c5..6822c37a69 100644 --- a/apps/web/app/api/v1/client/[environmentId]/displays/route.ts +++ b/apps/web/app/api/v1/client/[environmentId]/displays/route.ts @@ -1,6 +1,5 @@ import { responses } from "@/app/lib/api/response"; import { transformErrorToDetails } from "@/app/lib/api/validator"; - import { createDisplay } from "@formbricks/lib/display/service"; import { capturePosthogEnvironmentEvent } from "@formbricks/lib/posthogServer"; import { ZDisplayCreateInput } from "@formbricks/types/displays"; diff --git a/apps/web/app/api/v1/client/[environmentId]/people/[userId]/attributes/route.ts b/apps/web/app/api/v1/client/[environmentId]/people/[userId]/attributes/route.ts index e11937a719..765a29ee5d 100644 --- a/apps/web/app/api/v1/client/[environmentId]/people/[userId]/attributes/route.ts +++ b/apps/web/app/api/v1/client/[environmentId]/people/[userId]/attributes/route.ts @@ -1,7 +1,6 @@ import { responses } from "@/app/lib/api/response"; import { transformErrorToDetails } from "@/app/lib/api/validator"; import { NextRequest } from "next/server"; - import { getAttributesByUserId, updateAttributes } from "@formbricks/lib/attribute/service"; import { createPerson, getPersonByUserId } from "@formbricks/lib/person/service"; import { ZJsPeopleUpdateAttributeInput } from "@formbricks/types/js"; diff --git a/apps/web/app/api/v1/client/[environmentId]/people/route.ts b/apps/web/app/api/v1/client/[environmentId]/people/route.ts index 5fec9f724f..0fdf094397 100644 --- a/apps/web/app/api/v1/client/[environmentId]/people/route.ts +++ b/apps/web/app/api/v1/client/[environmentId]/people/route.ts @@ -1,6 +1,5 @@ import { responses } from "@/app/lib/api/response"; import { NextRequest } from "next/server"; - import { createPerson } from "@formbricks/lib/person/service"; interface Context { diff --git a/apps/web/app/api/v1/client/[environmentId]/responses/[responseId]/route.ts b/apps/web/app/api/v1/client/[environmentId]/responses/[responseId]/route.ts index 941e067f3d..caecd94627 100644 --- a/apps/web/app/api/v1/client/[environmentId]/responses/[responseId]/route.ts +++ b/apps/web/app/api/v1/client/[environmentId]/responses/[responseId]/route.ts @@ -1,7 +1,6 @@ import { responses } from "@/app/lib/api/response"; import { transformErrorToDetails } from "@/app/lib/api/validator"; import { sendToPipeline } from "@/app/lib/pipelines"; - import { getPerson } from "@formbricks/lib/person/service"; import { updateResponse } from "@formbricks/lib/response/service"; import { getSurvey } from "@formbricks/lib/survey/service"; diff --git a/apps/web/app/api/v1/client/[environmentId]/responses/route.ts b/apps/web/app/api/v1/client/[environmentId]/responses/route.ts index 2f93f8e398..ffd086f65e 100644 --- a/apps/web/app/api/v1/client/[environmentId]/responses/route.ts +++ b/apps/web/app/api/v1/client/[environmentId]/responses/route.ts @@ -3,7 +3,6 @@ import { transformErrorToDetails } from "@/app/lib/api/validator"; import { sendToPipeline } from "@/app/lib/pipelines"; import { headers } from "next/headers"; import { UAParser } from "ua-parser-js"; - import { getPerson } from "@formbricks/lib/person/service"; import { capturePosthogEnvironmentEvent } from "@formbricks/lib/posthogServer"; import { createResponse } from "@formbricks/lib/response/service"; diff --git a/apps/web/app/api/v1/client/[environmentId]/storage/lib/uploadPrivateFile.ts b/apps/web/app/api/v1/client/[environmentId]/storage/lib/uploadPrivateFile.ts index 69d4d374a3..323f265264 100644 --- a/apps/web/app/api/v1/client/[environmentId]/storage/lib/uploadPrivateFile.ts +++ b/apps/web/app/api/v1/client/[environmentId]/storage/lib/uploadPrivateFile.ts @@ -1,5 +1,4 @@ import { responses } from "@/app/lib/api/response"; - import { getUploadSignedUrl } from "@formbricks/lib/storage/service"; export const uploadPrivateFile = async ( diff --git a/apps/web/app/api/v1/client/[environmentId]/storage/local/route.ts b/apps/web/app/api/v1/client/[environmentId]/storage/local/route.ts index 7a98029048..a65172830e 100644 --- a/apps/web/app/api/v1/client/[environmentId]/storage/local/route.ts +++ b/apps/web/app/api/v1/client/[environmentId]/storage/local/route.ts @@ -4,7 +4,6 @@ import { responses } from "@/app/lib/api/response"; import { headers } from "next/headers"; import { NextRequest } from "next/server"; - import { ENCRYPTION_KEY, UPLOADS_DIR } from "@formbricks/lib/constants"; import { validateLocalSignedUrl } from "@formbricks/lib/crypto"; import { getOrganizationByEnvironmentId } from "@formbricks/lib/organization/service"; diff --git a/apps/web/app/api/v1/client/[environmentId]/storage/route.ts b/apps/web/app/api/v1/client/[environmentId]/storage/route.ts index b122869f24..af97c48b24 100644 --- a/apps/web/app/api/v1/client/[environmentId]/storage/route.ts +++ b/apps/web/app/api/v1/client/[environmentId]/storage/route.ts @@ -1,9 +1,7 @@ import { responses } from "@/app/lib/api/response"; import { NextRequest } from "next/server"; - import { getOrganizationByEnvironmentId } from "@formbricks/lib/organization/service"; import { getSurvey } from "@formbricks/lib/survey/service"; - import { uploadPrivateFile } from "./lib/uploadPrivateFile"; interface Context { diff --git a/apps/web/app/api/v1/client/[environmentId]/website/sync/route.ts b/apps/web/app/api/v1/client/[environmentId]/website/sync/route.ts index 22f79ec92d..d27a80301b 100644 --- a/apps/web/app/api/v1/client/[environmentId]/website/sync/route.ts +++ b/apps/web/app/api/v1/client/[environmentId]/website/sync/route.ts @@ -2,7 +2,6 @@ import { sendFreeLimitReachedEventToPosthogBiWeekly } from "@/app/api/v1/client/ import { responses } from "@/app/lib/api/response"; import { transformErrorToDetails } from "@/app/lib/api/validator"; import { NextRequest } from "next/server"; - import { getActionClassByEnvironmentIdAndName, getActionClasses } from "@formbricks/lib/actionClass/service"; import { IS_FORMBRICKS_CLOUD, diff --git a/apps/web/app/api/v1/integrations/airtable/callback/route.ts b/apps/web/app/api/v1/integrations/airtable/callback/route.ts index fb5f2b1035..4cf51459d7 100644 --- a/apps/web/app/api/v1/integrations/airtable/callback/route.ts +++ b/apps/web/app/api/v1/integrations/airtable/callback/route.ts @@ -2,7 +2,6 @@ import { responses } from "@/app/lib/api/response"; import { getServerSession } from "next-auth"; import { NextRequest } from "next/server"; import * as z from "zod"; - import { connectAirtable, fetchAirtableAuthToken } from "@formbricks/lib/airtable/service"; import { authOptions } from "@formbricks/lib/authOptions"; import { AIRTABLE_CLIENT_ID, WEBAPP_URL } from "@formbricks/lib/constants"; diff --git a/apps/web/app/api/v1/integrations/airtable/route.ts b/apps/web/app/api/v1/integrations/airtable/route.ts index ad61e1f954..6c08eb9e7f 100644 --- a/apps/web/app/api/v1/integrations/airtable/route.ts +++ b/apps/web/app/api/v1/integrations/airtable/route.ts @@ -2,7 +2,6 @@ import { responses } from "@/app/lib/api/response"; import crypto from "crypto"; import { getServerSession } from "next-auth"; import { NextRequest } from "next/server"; - import { authOptions } from "@formbricks/lib/authOptions"; import { AIRTABLE_CLIENT_ID, WEBAPP_URL } from "@formbricks/lib/constants"; import { hasUserEnvironmentAccess } from "@formbricks/lib/environment/auth"; diff --git a/apps/web/app/api/v1/integrations/airtable/tables/route.ts b/apps/web/app/api/v1/integrations/airtable/tables/route.ts index 0d11d49178..1d79b3cbd1 100644 --- a/apps/web/app/api/v1/integrations/airtable/tables/route.ts +++ b/apps/web/app/api/v1/integrations/airtable/tables/route.ts @@ -2,7 +2,6 @@ import { responses } from "@/app/lib/api/response"; import { getServerSession } from "next-auth"; import { NextRequest } from "next/server"; import * as z from "zod"; - import { getTables } from "@formbricks/lib/airtable/service"; import { authOptions } from "@formbricks/lib/authOptions"; import { hasUserEnvironmentAccess } from "@formbricks/lib/environment/auth"; diff --git a/apps/web/app/api/v1/integrations/notion/callback/route.ts b/apps/web/app/api/v1/integrations/notion/callback/route.ts index bcdac33c23..f85414e3ab 100644 --- a/apps/web/app/api/v1/integrations/notion/callback/route.ts +++ b/apps/web/app/api/v1/integrations/notion/callback/route.ts @@ -1,6 +1,5 @@ import { responses } from "@/app/lib/api/response"; import { NextRequest } from "next/server"; - import { ENCRYPTION_KEY, NOTION_OAUTH_CLIENT_ID, diff --git a/apps/web/app/api/v1/integrations/notion/route.ts b/apps/web/app/api/v1/integrations/notion/route.ts index db362dde89..622290b305 100644 --- a/apps/web/app/api/v1/integrations/notion/route.ts +++ b/apps/web/app/api/v1/integrations/notion/route.ts @@ -1,7 +1,6 @@ import { responses } from "@/app/lib/api/response"; import { getServerSession } from "next-auth"; import { NextRequest } from "next/server"; - import { authOptions } from "@formbricks/lib/authOptions"; import { NOTION_AUTH_URL, diff --git a/apps/web/app/api/v1/integrations/slack/callback/route.ts b/apps/web/app/api/v1/integrations/slack/callback/route.ts index b4f58bec5a..fb33996f06 100644 --- a/apps/web/app/api/v1/integrations/slack/callback/route.ts +++ b/apps/web/app/api/v1/integrations/slack/callback/route.ts @@ -1,6 +1,5 @@ import { responses } from "@/app/lib/api/response"; import { NextRequest } from "next/server"; - import { SLACK_CLIENT_ID, SLACK_CLIENT_SECRET, WEBAPP_URL } from "@formbricks/lib/constants"; import { createOrUpdateIntegration } from "@formbricks/lib/integration/service"; import { TIntegrationSlackConfig, TIntegrationSlackCredential } from "@formbricks/types/integration/slack"; diff --git a/apps/web/app/api/v1/integrations/slack/route.ts b/apps/web/app/api/v1/integrations/slack/route.ts index d9842cf5bc..e8c9583f00 100644 --- a/apps/web/app/api/v1/integrations/slack/route.ts +++ b/apps/web/app/api/v1/integrations/slack/route.ts @@ -1,7 +1,6 @@ import { responses } from "@/app/lib/api/response"; import { getServerSession } from "next-auth"; import { NextRequest } from "next/server"; - import { authOptions } from "@formbricks/lib/authOptions"; import { SLACK_AUTH_URL, SLACK_CLIENT_ID, SLACK_CLIENT_SECRET } from "@formbricks/lib/constants"; import { hasUserEnvironmentAccess } from "@formbricks/lib/environment/auth"; diff --git a/apps/web/app/api/v1/management/action-classes/[actionClassId]/route.ts b/apps/web/app/api/v1/management/action-classes/[actionClassId]/route.ts index 697b7f58a0..518985b3ef 100644 --- a/apps/web/app/api/v1/management/action-classes/[actionClassId]/route.ts +++ b/apps/web/app/api/v1/management/action-classes/[actionClassId]/route.ts @@ -1,7 +1,6 @@ import { authenticateRequest, handleErrorResponse } from "@/app/api/v1/auth"; import { responses } from "@/app/lib/api/response"; import { transformErrorToDetails } from "@/app/lib/api/validator"; - import { deleteActionClass, getActionClass, updateActionClass } from "@formbricks/lib/actionClass/service"; import { TActionClass, ZActionClassInput } from "@formbricks/types/actionClasses"; import { TAuthenticationApiKey } from "@formbricks/types/auth"; diff --git a/apps/web/app/api/v1/management/action-classes/route.ts b/apps/web/app/api/v1/management/action-classes/route.ts index add65ffb73..3c69a95d8b 100644 --- a/apps/web/app/api/v1/management/action-classes/route.ts +++ b/apps/web/app/api/v1/management/action-classes/route.ts @@ -1,7 +1,6 @@ import { authenticateRequest } from "@/app/api/v1/auth"; import { responses } from "@/app/lib/api/response"; import { transformErrorToDetails } from "@/app/lib/api/validator"; - import { createActionClass, getActionClasses } from "@formbricks/lib/actionClass/service"; import { TActionClass, ZActionClassInput } from "@formbricks/types/actionClasses"; import { DatabaseError } from "@formbricks/types/errors"; diff --git a/apps/web/app/api/v1/management/attribute-classes/[attributeClassId]/route.ts b/apps/web/app/api/v1/management/attribute-classes/[attributeClassId]/route.ts index cc516fd537..0ffa82c481 100644 --- a/apps/web/app/api/v1/management/attribute-classes/[attributeClassId]/route.ts +++ b/apps/web/app/api/v1/management/attribute-classes/[attributeClassId]/route.ts @@ -1,7 +1,6 @@ import { authenticateRequest, handleErrorResponse } from "@/app/api/v1/auth"; import { responses } from "@/app/lib/api/response"; import { transformErrorToDetails } from "@/app/lib/api/validator"; - import { deleteAttributeClass, getAttributeClass, diff --git a/apps/web/app/api/v1/management/attribute-classes/route.ts b/apps/web/app/api/v1/management/attribute-classes/route.ts index 7d1aaf5db7..65c615d002 100644 --- a/apps/web/app/api/v1/management/attribute-classes/route.ts +++ b/apps/web/app/api/v1/management/attribute-classes/route.ts @@ -1,7 +1,6 @@ import { authenticateRequest } from "@/app/api/v1/auth"; import { responses } from "@/app/lib/api/response"; import { transformErrorToDetails } from "@/app/lib/api/validator"; - import { createAttributeClass, getAttributeClasses } from "@formbricks/lib/attributeClass/service"; import { TAttributeClass, ZAttributeClassInput } from "@formbricks/types/attributeClasses"; import { DatabaseError } from "@formbricks/types/errors"; diff --git a/apps/web/app/api/v1/management/me/route.ts b/apps/web/app/api/v1/management/me/route.ts index 77adc7a288..db0be34a54 100644 --- a/apps/web/app/api/v1/management/me/route.ts +++ b/apps/web/app/api/v1/management/me/route.ts @@ -1,6 +1,5 @@ import { getSessionUser, hashApiKey } from "@/app/lib/api/apiHelper"; import { headers } from "next/headers"; - import { prisma } from "@formbricks/database"; export const GET = async () => { diff --git a/apps/web/app/api/v1/management/people/[personId]/route.ts b/apps/web/app/api/v1/management/people/[personId]/route.ts index e6fe572ac0..8a608c8b7a 100644 --- a/apps/web/app/api/v1/management/people/[personId]/route.ts +++ b/apps/web/app/api/v1/management/people/[personId]/route.ts @@ -1,6 +1,5 @@ import { authenticateRequest, handleErrorResponse } from "@/app/api/v1/auth"; import { responses } from "@/app/lib/api/response"; - import { deletePerson, getPerson } from "@formbricks/lib/person/service"; import { TAuthenticationApiKey } from "@formbricks/types/auth"; import { TPerson } from "@formbricks/types/people"; diff --git a/apps/web/app/api/v1/management/people/route.ts b/apps/web/app/api/v1/management/people/route.ts index 7b2962be39..ec8f330f83 100644 --- a/apps/web/app/api/v1/management/people/route.ts +++ b/apps/web/app/api/v1/management/people/route.ts @@ -1,6 +1,5 @@ import { authenticateRequest } from "@/app/api/v1/auth"; import { responses } from "@/app/lib/api/response"; - import { getPeople } from "@formbricks/lib/person/service"; import { DatabaseError } from "@formbricks/types/errors"; import { TPerson } from "@formbricks/types/people"; diff --git a/apps/web/app/api/v1/management/responses/[responseId]/route.ts b/apps/web/app/api/v1/management/responses/[responseId]/route.ts index 70a713302e..8d7b755387 100644 --- a/apps/web/app/api/v1/management/responses/[responseId]/route.ts +++ b/apps/web/app/api/v1/management/responses/[responseId]/route.ts @@ -1,7 +1,6 @@ import { authenticateRequest, handleErrorResponse } from "@/app/api/v1/auth"; import { responses } from "@/app/lib/api/response"; import { transformErrorToDetails } from "@/app/lib/api/validator"; - import { hasUserEnvironmentAccess } from "@formbricks/lib/environment/auth"; import { deleteResponse, getResponse, updateResponse } from "@formbricks/lib/response/service"; import { getSurvey } from "@formbricks/lib/survey/service"; diff --git a/apps/web/app/api/v1/management/responses/route.ts b/apps/web/app/api/v1/management/responses/route.ts index 1f8e068699..2da7318e9d 100644 --- a/apps/web/app/api/v1/management/responses/route.ts +++ b/apps/web/app/api/v1/management/responses/route.ts @@ -2,7 +2,6 @@ import { authenticateRequest } from "@/app/api/v1/auth"; import { responses } from "@/app/lib/api/response"; import { transformErrorToDetails } from "@/app/lib/api/validator"; import { NextRequest } from "next/server"; - import { createResponse, getResponses, getResponsesByEnvironmentId } from "@formbricks/lib/response/service"; import { getSurvey } from "@formbricks/lib/survey/service"; import { DatabaseError, InvalidInputError } from "@formbricks/types/errors"; diff --git a/apps/web/app/api/v1/management/storage/lib/getSignedUrl.ts b/apps/web/app/api/v1/management/storage/lib/getSignedUrl.ts index b1955a0455..7e44385973 100644 --- a/apps/web/app/api/v1/management/storage/lib/getSignedUrl.ts +++ b/apps/web/app/api/v1/management/storage/lib/getSignedUrl.ts @@ -1,5 +1,4 @@ import { responses } from "@/app/lib/api/response"; - import { getUploadSignedUrl } from "@formbricks/lib/storage/service"; export const getSignedUrlForPublicFile = async ( diff --git a/apps/web/app/api/v1/management/storage/local/route.ts b/apps/web/app/api/v1/management/storage/local/route.ts index 999c49b204..15e1fb9cf1 100644 --- a/apps/web/app/api/v1/management/storage/local/route.ts +++ b/apps/web/app/api/v1/management/storage/local/route.ts @@ -5,7 +5,6 @@ import { responses } from "@/app/lib/api/response"; import { getServerSession } from "next-auth"; import { headers } from "next/headers"; import { NextRequest } from "next/server"; - import { authOptions } from "@formbricks/lib/authOptions"; import { ENCRYPTION_KEY, UPLOADS_DIR } from "@formbricks/lib/constants"; import { validateLocalSignedUrl } from "@formbricks/lib/crypto"; diff --git a/apps/web/app/api/v1/management/storage/route.ts b/apps/web/app/api/v1/management/storage/route.ts index 7ba294e8e7..1623b67c8f 100644 --- a/apps/web/app/api/v1/management/storage/route.ts +++ b/apps/web/app/api/v1/management/storage/route.ts @@ -1,10 +1,8 @@ import { responses } from "@/app/lib/api/response"; import { getServerSession } from "next-auth"; import { NextRequest } from "next/server"; - import { authOptions } from "@formbricks/lib/authOptions"; import { hasUserEnvironmentAccess } from "@formbricks/lib/environment/auth"; - import { getSignedUrlForPublicFile } from "./lib/getSignedUrl"; // api endpoint for uploading public files diff --git a/apps/web/app/api/v1/management/surveys/[surveyId]/route.ts b/apps/web/app/api/v1/management/surveys/[surveyId]/route.ts index 34370348c2..d60ac2e938 100644 --- a/apps/web/app/api/v1/management/surveys/[surveyId]/route.ts +++ b/apps/web/app/api/v1/management/surveys/[surveyId]/route.ts @@ -1,7 +1,6 @@ import { authenticateRequest, handleErrorResponse } from "@/app/api/v1/auth"; import { responses } from "@/app/lib/api/response"; import { transformErrorToDetails } from "@/app/lib/api/validator"; - import { deleteSurvey, getSurvey, updateSurvey } from "@formbricks/lib/survey/service"; import { TSurvey, ZSurvey } from "@formbricks/types/surveys"; diff --git a/apps/web/app/api/v1/management/surveys/route.ts b/apps/web/app/api/v1/management/surveys/route.ts index 426174b957..8fa0f588d8 100644 --- a/apps/web/app/api/v1/management/surveys/route.ts +++ b/apps/web/app/api/v1/management/surveys/route.ts @@ -1,7 +1,6 @@ import { authenticateRequest } from "@/app/api/v1/auth"; import { responses } from "@/app/lib/api/response"; import { transformErrorToDetails } from "@/app/lib/api/validator"; - import { translateSurvey } from "@formbricks/lib/i18n/utils"; import { createSurvey, getSurveys } from "@formbricks/lib/survey/service"; import { DatabaseError } from "@formbricks/types/errors"; diff --git a/apps/web/app/api/v1/users/me/route.ts b/apps/web/app/api/v1/users/me/route.ts index fc997b46bc..a04af263df 100644 --- a/apps/web/app/api/v1/users/me/route.ts +++ b/apps/web/app/api/v1/users/me/route.ts @@ -1,7 +1,6 @@ import { getSessionUser } from "@/app/lib/api/apiHelper"; import { MembershipRole } from "@prisma/client"; import { NextRequest } from "next/server"; - import { prisma } from "@formbricks/database"; interface Membership { diff --git a/apps/web/app/api/v1/webhooks/[webhookId]/route.ts b/apps/web/app/api/v1/webhooks/[webhookId]/route.ts index 318890d2b9..b7215815a6 100644 --- a/apps/web/app/api/v1/webhooks/[webhookId]/route.ts +++ b/apps/web/app/api/v1/webhooks/[webhookId]/route.ts @@ -1,6 +1,5 @@ import { responses } from "@/app/lib/api/response"; import { headers } from "next/headers"; - import { getApiKeyFromKey } from "@formbricks/lib/apiKey/service"; import { deleteWebhook, getWebhook } from "@formbricks/lib/webhook/service"; diff --git a/apps/web/app/api/v1/webhooks/route.ts b/apps/web/app/api/v1/webhooks/route.ts index 41f914d2cb..2589978637 100644 --- a/apps/web/app/api/v1/webhooks/route.ts +++ b/apps/web/app/api/v1/webhooks/route.ts @@ -1,7 +1,6 @@ import { responses } from "@/app/lib/api/response"; import { transformErrorToDetails } from "@/app/lib/api/validator"; import { headers } from "next/headers"; - import { getApiKeyFromKey } from "@formbricks/lib/apiKey/service"; import { createWebhook, getWebhooks } from "@formbricks/lib/webhook/service"; import { DatabaseError, InvalidInputError } from "@formbricks/types/errors"; diff --git a/apps/web/app/global-error.tsx b/apps/web/app/global-error.tsx index a16d04ccb3..ac4893de1c 100644 --- a/apps/web/app/global-error.tsx +++ b/apps/web/app/global-error.tsx @@ -3,7 +3,6 @@ import * as Sentry from "@sentry/nextjs"; import Error from "next/error"; import { useEffect } from "react"; - import { Button } from "@formbricks/ui/Button"; import { ErrorComponent } from "@formbricks/ui/ErrorComponent"; diff --git a/apps/web/app/health/page.tsx b/apps/web/app/health/page.tsx index a2a98ebea1..a9dafe1d23 100644 --- a/apps/web/app/health/page.tsx +++ b/apps/web/app/health/page.tsx @@ -1,6 +1,5 @@ import { BadgeCheckIcon } from "lucide-react"; import { Metadata } from "next"; - import { prisma } from "@formbricks/database"; export const dynamic = "force-dynamic"; // no caching diff --git a/apps/web/app/layout.tsx b/apps/web/app/layout.tsx index 499af95da8..2a0dba3079 100644 --- a/apps/web/app/layout.tsx +++ b/apps/web/app/layout.tsx @@ -1,6 +1,5 @@ import { SpeedInsights } from "@vercel/speed-insights/next"; import { Metadata } from "next"; - import "./globals.css"; export const metadata: Metadata = { diff --git a/apps/web/app/lib/api/apiHelper.ts b/apps/web/app/lib/api/apiHelper.ts index a4b0ea4747..b966895867 100644 --- a/apps/web/app/lib/api/apiHelper.ts +++ b/apps/web/app/lib/api/apiHelper.ts @@ -2,7 +2,6 @@ import { createHash } from "crypto"; import { NextApiRequest, NextApiResponse } from "next"; import type { Session } from "next-auth"; import { getServerSession } from "next-auth"; - import { prisma } from "@formbricks/database"; import { authOptions } from "@formbricks/lib/authOptions"; import { hasUserEnvironmentAccess } from "@formbricks/lib/environment/auth"; diff --git a/apps/web/app/lib/singleUseSurveys.ts b/apps/web/app/lib/singleUseSurveys.ts index 8551321904..33318b6567 100644 --- a/apps/web/app/lib/singleUseSurveys.ts +++ b/apps/web/app/lib/singleUseSurveys.ts @@ -1,5 +1,4 @@ import cuid2 from "@paralleldrive/cuid2"; - import { ENCRYPTION_KEY, FORMBRICKS_ENCRYPTION_KEY } from "@formbricks/lib/constants"; import { decryptAES128, symmetricDecrypt, symmetricEncrypt } from "@formbricks/lib/crypto"; diff --git a/apps/web/app/middleware/bucket.ts b/apps/web/app/middleware/bucket.ts index ea2eb55799..6f8443fcc1 100644 --- a/apps/web/app/middleware/bucket.ts +++ b/apps/web/app/middleware/bucket.ts @@ -1,5 +1,4 @@ import { rateLimit } from "@/app/middleware/rateLimit"; - import { CLIENT_SIDE_API_RATE_LIMIT, LOGIN_RATE_LIMIT, diff --git a/apps/web/app/middleware/rateLimit.ts b/apps/web/app/middleware/rateLimit.ts index 88c75b24cb..8046cf37ae 100644 --- a/apps/web/app/middleware/rateLimit.ts +++ b/apps/web/app/middleware/rateLimit.ts @@ -1,5 +1,4 @@ import { LRUCache } from "lru-cache"; - import { REDIS_HTTP_URL } from "@formbricks/lib/constants"; type Options = { diff --git a/apps/web/app/not-found.tsx b/apps/web/app/not-found.tsx index e10b7da91e..09b8a78c99 100644 --- a/apps/web/app/not-found.tsx +++ b/apps/web/app/not-found.tsx @@ -1,5 +1,4 @@ import Link from "next/link"; - import { Button } from "@formbricks/ui/Button"; const NotFound = () => { diff --git a/apps/web/app/s/[surveyId]/actions.ts b/apps/web/app/s/[surveyId]/actions.ts index 81292b8993..dc9de0f5f7 100644 --- a/apps/web/app/s/[surveyId]/actions.ts +++ b/apps/web/app/s/[surveyId]/actions.ts @@ -1,7 +1,6 @@ "use server"; import { TSurveyPinValidationResponseError } from "@/app/s/[surveyId]/types"; - import { LinkSurveyEmailData, sendLinkSurveyToVerifiedEmail } from "@formbricks/email"; import { verifyTokenForLinkSurvey } from "@formbricks/lib/jwt"; import { getSurvey } from "@formbricks/lib/survey/service"; diff --git a/apps/web/app/s/[surveyId]/components/LinkSurvey.tsx b/apps/web/app/s/[surveyId]/components/LinkSurvey.tsx index 105ac007b1..2ee991bd64 100644 --- a/apps/web/app/s/[surveyId]/components/LinkSurvey.tsx +++ b/apps/web/app/s/[surveyId]/components/LinkSurvey.tsx @@ -263,7 +263,9 @@ export const LinkSurvey = ({ ttc: responseUpdate.ttc, finished: responseUpdate.finished, language: - languageCode === "default" && defaultLanguageCode ? defaultLanguageCode : languageCode, + responseUpdate.language === "default" && defaultLanguageCode + ? defaultLanguageCode + : responseUpdate.language, meta: { url: window.location.href, source: sourceParam || "", diff --git a/apps/web/app/s/[surveyId]/components/PinScreen.tsx b/apps/web/app/s/[surveyId]/components/PinScreen.tsx index 1c8dffa736..1a9a4c7101 100644 --- a/apps/web/app/s/[surveyId]/components/PinScreen.tsx +++ b/apps/web/app/s/[surveyId]/components/PinScreen.tsx @@ -4,7 +4,6 @@ import { validateSurveyPinAction } from "@/app/s/[surveyId]/actions"; import { LinkSurvey } from "@/app/s/[surveyId]/components/LinkSurvey"; import { TSurveyPinValidationResponseError } from "@/app/s/[surveyId]/types"; import { useCallback, useEffect, useState } from "react"; - import { cn } from "@formbricks/lib/cn"; import { TAttributeClass } from "@formbricks/types/attributeClasses"; import { TProduct } from "@formbricks/types/product"; diff --git a/apps/web/app/s/[surveyId]/components/SurveyInactive.tsx b/apps/web/app/s/[surveyId]/components/SurveyInactive.tsx index 26f6284caa..1a2273209f 100644 --- a/apps/web/app/s/[surveyId]/components/SurveyInactive.tsx +++ b/apps/web/app/s/[surveyId]/components/SurveyInactive.tsx @@ -1,10 +1,8 @@ import { CheckCircle2Icon, HelpCircleIcon, PauseCircleIcon } from "lucide-react"; import Image from "next/image"; import Link from "next/link"; - import { TSurveyClosedMessage } from "@formbricks/types/surveys"; import { Button } from "@formbricks/ui/Button"; - import footerLogo from "../lib/footerlogo.svg"; export const SurveyInactive = ({ diff --git a/apps/web/app/s/[surveyId]/components/SurveyLinkUsed.tsx b/apps/web/app/s/[surveyId]/components/SurveyLinkUsed.tsx index 8233aac11a..c0c72b295c 100644 --- a/apps/web/app/s/[surveyId]/components/SurveyLinkUsed.tsx +++ b/apps/web/app/s/[surveyId]/components/SurveyLinkUsed.tsx @@ -1,9 +1,7 @@ import { CheckCircle2Icon } from "lucide-react"; import Image from "next/image"; import Link from "next/link"; - import { TSurveySingleUse } from "@formbricks/types/surveys"; - import footerLogo from "../lib/footerlogo.svg"; type SurveyLinkUsedProps = { diff --git a/apps/web/app/s/[surveyId]/components/VerifyEmail.tsx b/apps/web/app/s/[surveyId]/components/VerifyEmail.tsx index fb171bd11a..0696c54341 100644 --- a/apps/web/app/s/[surveyId]/components/VerifyEmail.tsx +++ b/apps/web/app/s/[surveyId]/components/VerifyEmail.tsx @@ -5,7 +5,6 @@ import { MailIcon } from "lucide-react"; import { ArrowLeft } from "lucide-react"; import { useMemo, useState } from "react"; import { Toaster, toast } from "react-hot-toast"; - import { getLocalizedValue } from "@formbricks/lib/i18n/utils"; import { isValidEmail } from "@formbricks/lib/utils/email"; import { replaceHeadlineRecall } from "@formbricks/lib/utils/recall"; diff --git a/apps/web/app/s/[surveyId]/metadata.ts b/apps/web/app/s/[surveyId]/metadata.ts index 259427aae1..dffa866918 100644 --- a/apps/web/app/s/[surveyId]/metadata.ts +++ b/apps/web/app/s/[surveyId]/metadata.ts @@ -1,6 +1,5 @@ import { Metadata } from "next"; import { notFound } from "next/navigation"; - import { WEBAPP_URL } from "@formbricks/lib/constants"; import { getProductByEnvironmentId } from "@formbricks/lib/product/service"; import { COLOR_DEFAULTS } from "@formbricks/lib/styling/constants"; diff --git a/apps/web/app/s/[surveyId]/not-found.tsx b/apps/web/app/s/[surveyId]/not-found.tsx index c9f6f0434a..f53f53f30b 100644 --- a/apps/web/app/s/[surveyId]/not-found.tsx +++ b/apps/web/app/s/[surveyId]/not-found.tsx @@ -1,9 +1,7 @@ import { HelpCircleIcon } from "lucide-react"; import Image from "next/image"; import Link from "next/link"; - import { Button } from "@formbricks/ui/Button"; - import footerLogo from "./lib/footerlogo.svg"; const NotFound = () => { diff --git a/apps/web/app/s/[surveyId]/page.tsx b/apps/web/app/s/[surveyId]/page.tsx index 322cc02cb1..2eb964034a 100644 --- a/apps/web/app/s/[surveyId]/page.tsx +++ b/apps/web/app/s/[surveyId]/page.tsx @@ -5,7 +5,6 @@ import { SurveyInactive } from "@/app/s/[surveyId]/components/SurveyInactive"; import { getMetadataForLinkSurvey } from "@/app/s/[surveyId]/metadata"; import type { Metadata } from "next"; import { notFound } from "next/navigation"; - import { getMultiLanguagePermission } from "@formbricks/ee/lib/service"; import { getAttributeClasses } from "@formbricks/lib/attributeClass/service"; import { IMPRINT_URL, IS_FORMBRICKS_CLOUD, PRIVACY_URL, WEBAPP_URL } from "@formbricks/lib/constants"; @@ -16,7 +15,6 @@ import { getResponseBySingleUseId, getResponseCountBySurveyId } from "@formbrick import { getSurvey } from "@formbricks/lib/survey/service"; import { ZId } from "@formbricks/types/environment"; import { TResponse } from "@formbricks/types/responses"; - import { getEmailVerificationDetails } from "./lib/helpers"; interface LinkSurveyPageProps { diff --git a/apps/web/app/setup/(fresh-instance)/intro/page.tsx b/apps/web/app/setup/(fresh-instance)/intro/page.tsx index d9d0c88557..09299040d5 100644 --- a/apps/web/app/setup/(fresh-instance)/intro/page.tsx +++ b/apps/web/app/setup/(fresh-instance)/intro/page.tsx @@ -1,5 +1,4 @@ import { Metadata } from "next"; - import { Button } from "@formbricks/ui/Button"; export const metadata: Metadata = { diff --git a/apps/web/app/setup/(fresh-instance)/layout.tsx b/apps/web/app/setup/(fresh-instance)/layout.tsx index 59f0d60be0..287f242a75 100644 --- a/apps/web/app/setup/(fresh-instance)/layout.tsx +++ b/apps/web/app/setup/(fresh-instance)/layout.tsx @@ -1,6 +1,5 @@ import { getServerSession } from "next-auth"; import { notFound } from "next/navigation"; - import { authOptions } from "@formbricks/lib/authOptions"; import { getIsFreshInstance } from "@formbricks/lib/instance/service"; diff --git a/apps/web/app/setup/(fresh-instance)/signup/page.tsx b/apps/web/app/setup/(fresh-instance)/signup/page.tsx index 6bd588ef87..5d47bd83dc 100644 --- a/apps/web/app/setup/(fresh-instance)/signup/page.tsx +++ b/apps/web/app/setup/(fresh-instance)/signup/page.tsx @@ -1,5 +1,4 @@ import { Metadata } from "next"; - import { AZURE_OAUTH_ENABLED, EMAIL_AUTH_ENABLED, diff --git a/apps/web/app/setup/layout.tsx b/apps/web/app/setup/layout.tsx index e4b68504bb..0e3579e269 100644 --- a/apps/web/app/setup/layout.tsx +++ b/apps/web/app/setup/layout.tsx @@ -1,5 +1,4 @@ import { Toaster } from "react-hot-toast"; - import { FormbricksLogo } from "@formbricks/ui/FormbricksLogo"; const SetupLayout = ({ children }: { children: React.ReactNode }) => { diff --git a/apps/web/app/setup/organization/[organizationId]/invite/actions.ts b/apps/web/app/setup/organization/[organizationId]/invite/actions.ts index 1cf480b26b..3eb198b0d4 100644 --- a/apps/web/app/setup/organization/[organizationId]/invite/actions.ts +++ b/apps/web/app/setup/organization/[organizationId]/invite/actions.ts @@ -1,7 +1,6 @@ "use server"; import { getServerSession } from "next-auth"; - import { sendInviteMemberEmail } from "@formbricks/email"; import { authOptions } from "@formbricks/lib/authOptions"; import { INVITE_DISABLED } from "@formbricks/lib/constants"; diff --git a/apps/web/app/setup/organization/[organizationId]/invite/components/InviteMembers.tsx b/apps/web/app/setup/organization/[organizationId]/invite/components/InviteMembers.tsx index 11f62f6cd5..ad6064b84f 100644 --- a/apps/web/app/setup/organization/[organizationId]/invite/components/InviteMembers.tsx +++ b/apps/web/app/setup/organization/[organizationId]/invite/components/InviteMembers.tsx @@ -7,7 +7,6 @@ import { useRouter } from "next/navigation"; import React, { useState } from "react"; import { useForm } from "react-hook-form"; import { toast } from "react-hot-toast"; - import { TInviteMembersFormSchema, ZInviteMembersFormSchema } from "@formbricks/types/invites"; import { Alert, AlertDescription, AlertTitle } from "@formbricks/ui/Alert"; import { Button } from "@formbricks/ui/Button"; diff --git a/apps/web/app/setup/organization/[organizationId]/invite/page.tsx b/apps/web/app/setup/organization/[organizationId]/invite/page.tsx index f4590eb00c..9a4f800bd9 100644 --- a/apps/web/app/setup/organization/[organizationId]/invite/page.tsx +++ b/apps/web/app/setup/organization/[organizationId]/invite/page.tsx @@ -2,7 +2,6 @@ import { InviteMembers } from "@/app/setup/organization/[organizationId]/invite/ import { Metadata } from "next"; import { getServerSession } from "next-auth"; import { notFound } from "next/navigation"; - import { authOptions } from "@formbricks/lib/authOptions"; import { SMTP_HOST, SMTP_PASSWORD, SMTP_PORT, SMTP_USER } from "@formbricks/lib/constants"; import { verifyUserRoleAccess } from "@formbricks/lib/organization/auth"; diff --git a/apps/web/app/share/[sharingKey]/not-found.tsx b/apps/web/app/share/[sharingKey]/not-found.tsx index b631eed175..77c1df95d6 100644 --- a/apps/web/app/share/[sharingKey]/not-found.tsx +++ b/apps/web/app/share/[sharingKey]/not-found.tsx @@ -1,5 +1,4 @@ import Link from "next/link"; - import { Button } from "@formbricks/ui/Button"; const NotFound = () => { diff --git a/apps/web/app/storage/[environmentId]/[accessType]/[fileName]/lib/deleteFile.ts b/apps/web/app/storage/[environmentId]/[accessType]/[fileName]/lib/deleteFile.ts index 31438dca76..f62f3c134c 100644 --- a/apps/web/app/storage/[environmentId]/[accessType]/[fileName]/lib/deleteFile.ts +++ b/apps/web/app/storage/[environmentId]/[accessType]/[fileName]/lib/deleteFile.ts @@ -1,5 +1,4 @@ import { responses } from "@/app/lib/api/response"; - import { storageCache } from "@formbricks/lib/storage/cache"; import { deleteFile } from "@formbricks/lib/storage/service"; import { TAccessType } from "@formbricks/types/storage"; diff --git a/apps/web/app/storage/[environmentId]/[accessType]/[fileName]/lib/getFile.ts b/apps/web/app/storage/[environmentId]/[accessType]/[fileName]/lib/getFile.ts index 1bb423f4cc..8223656d0b 100644 --- a/apps/web/app/storage/[environmentId]/[accessType]/[fileName]/lib/getFile.ts +++ b/apps/web/app/storage/[environmentId]/[accessType]/[fileName]/lib/getFile.ts @@ -1,7 +1,6 @@ import { responses } from "@/app/lib/api/response"; import { notFound } from "next/navigation"; import path from "path"; - import { UPLOADS_DIR } from "@formbricks/lib/constants"; import { isS3Configured } from "@formbricks/lib/constants"; import { getLocalFile, getS3File } from "@formbricks/lib/storage/service"; diff --git a/apps/web/app/storage/[environmentId]/[accessType]/[fileName]/route.ts b/apps/web/app/storage/[environmentId]/[accessType]/[fileName]/route.ts index 14c55195af..2460ce71fa 100644 --- a/apps/web/app/storage/[environmentId]/[accessType]/[fileName]/route.ts +++ b/apps/web/app/storage/[environmentId]/[accessType]/[fileName]/route.ts @@ -4,11 +4,9 @@ import { transformErrorToDetails } from "@/app/lib/api/validator"; import { handleDeleteFile } from "@/app/storage/[environmentId]/[accessType]/[fileName]/lib/deleteFile"; import { getServerSession } from "next-auth"; import { NextRequest } from "next/server"; - import { authOptions } from "@formbricks/lib/authOptions"; import { hasUserEnvironmentAccess } from "@formbricks/lib/environment/auth"; import { ZStorageRetrievalParams } from "@formbricks/types/storage"; - import { getFile } from "./lib/getFile"; export const GET = async ( diff --git a/apps/web/middleware.ts b/apps/web/middleware.ts index b4d965395a..2e2dc849bf 100644 --- a/apps/web/middleware.ts +++ b/apps/web/middleware.ts @@ -16,7 +16,6 @@ import { import { getToken } from "next-auth/jwt"; import { NextResponse } from "next/server"; import type { NextRequest } from "next/server"; - import { RATE_LIMITING_DISABLED, WEBAPP_URL } from "@formbricks/lib/constants"; export const middleware = async (request: NextRequest) => { diff --git a/apps/web/playwright/action.spec.ts b/apps/web/playwright/action.spec.ts index 9410056638..b758dd1477 100644 --- a/apps/web/playwright/action.spec.ts +++ b/apps/web/playwright/action.spec.ts @@ -1,6 +1,5 @@ import { actions, users } from "@/playwright/utils/mock"; import { Page, expect, test } from "@playwright/test"; - import { finishOnboarding, login, signUpAndLogin } from "./utils/helper"; const createNoCodeClickAction = async ( diff --git a/apps/web/playwright/onboarding.spec.ts b/apps/web/playwright/onboarding.spec.ts index f0467bd694..9e302fe121 100644 --- a/apps/web/playwright/onboarding.spec.ts +++ b/apps/web/playwright/onboarding.spec.ts @@ -1,5 +1,4 @@ import { expect, test } from "@playwright/test"; - import { signUpAndLogin } from "./utils/helper"; import { organizations, users } from "./utils/mock"; diff --git a/apps/web/playwright/organization.spec.ts b/apps/web/playwright/organization.spec.ts index 67210844e2..2607a1625b 100644 --- a/apps/web/playwright/organization.spec.ts +++ b/apps/web/playwright/organization.spec.ts @@ -1,5 +1,4 @@ import { expect, test } from "playwright/test"; - import { finishOnboarding, login, signUpAndLogin, signupUsingInviteToken } from "./utils/helper"; import { invites, users } from "./utils/mock"; diff --git a/apps/web/playwright/signup.spec.ts b/apps/web/playwright/signup.spec.ts index bbc8bced17..cc672da639 100644 --- a/apps/web/playwright/signup.spec.ts +++ b/apps/web/playwright/signup.spec.ts @@ -1,5 +1,4 @@ import { expect, test } from "@playwright/test"; - import { users } from "./utils/mock"; const { name, email, password } = users.signup[0]; diff --git a/apps/web/playwright/survey.spec.ts b/apps/web/playwright/survey.spec.ts index dafbb622a2..a91ebddb48 100644 --- a/apps/web/playwright/survey.spec.ts +++ b/apps/web/playwright/survey.spec.ts @@ -1,6 +1,5 @@ import { surveys, users } from "@/playwright/utils/mock"; import { expect, test } from "@playwright/test"; - import { createSurvey, finishOnboarding, signUpAndLogin } from "./utils/helper"; test.describe("Survey Create & Submit Response", async () => { diff --git a/packages/api/src/api/client/action.ts b/packages/api/src/api/client/action.ts index b72e59802c..e38090c6e3 100644 --- a/packages/api/src/api/client/action.ts +++ b/packages/api/src/api/client/action.ts @@ -1,7 +1,6 @@ import { TActionInput } from "@formbricks/types/actions"; import { Result } from "@formbricks/types/errorHandlers"; import { NetworkError } from "@formbricks/types/errors"; - import { makeRequest } from "../../utils/makeRequest"; export class ActionAPI { diff --git a/packages/api/src/api/client/attribute.ts b/packages/api/src/api/client/attribute.ts index a07364fc4b..f13a95f972 100644 --- a/packages/api/src/api/client/attribute.ts +++ b/packages/api/src/api/client/attribute.ts @@ -1,7 +1,6 @@ import { TAttributeUpdateInput } from "@formbricks/types/attributes"; import { Result } from "@formbricks/types/errorHandlers"; import { NetworkError } from "@formbricks/types/errors"; - import { makeRequest } from "../../utils/makeRequest"; export class AttributeAPI { diff --git a/packages/api/src/api/client/display.ts b/packages/api/src/api/client/display.ts index 514f970401..93b6b842c3 100644 --- a/packages/api/src/api/client/display.ts +++ b/packages/api/src/api/client/display.ts @@ -1,7 +1,6 @@ import { TDisplayCreateInput, TDisplayUpdateInput } from "@formbricks/types/displays"; import { Result } from "@formbricks/types/errorHandlers"; import { NetworkError } from "@formbricks/types/errors"; - import { makeRequest } from "../../utils/makeRequest"; export class DisplayAPI { diff --git a/packages/api/src/api/client/people.ts b/packages/api/src/api/client/people.ts index 2c1a09d037..a16f233782 100644 --- a/packages/api/src/api/client/people.ts +++ b/packages/api/src/api/client/people.ts @@ -1,6 +1,5 @@ import { Result } from "@formbricks/types/errorHandlers"; import { NetworkError } from "@formbricks/types/errors"; - import { makeRequest } from "../../utils/makeRequest"; export class PeopleAPI { diff --git a/packages/api/src/api/client/response.ts b/packages/api/src/api/client/response.ts index f0c73072a6..c33d5e4174 100644 --- a/packages/api/src/api/client/response.ts +++ b/packages/api/src/api/client/response.ts @@ -1,7 +1,6 @@ import { Result } from "@formbricks/types/errorHandlers"; import { NetworkError } from "@formbricks/types/errors"; import { TResponseInput, TResponseUpdateInput } from "@formbricks/types/responses"; - import { makeRequest } from "../../utils/makeRequest"; type TResponseUpdateInputWithResponseId = TResponseUpdateInput & { responseId: string }; @@ -26,11 +25,13 @@ export class ResponseAPI { finished, data, ttc, + language, }: TResponseUpdateInputWithResponseId): Promise> { return makeRequest(this.apiHost, `/api/v1/client/${this.environmentId}/responses/${responseId}`, "PUT", { finished, data, ttc, + language, }); } } diff --git a/packages/database/data-migrations/20240207041922_advanced_targeting/data-migration.ts b/packages/database/data-migrations/20240207041922_advanced_targeting/data-migration.ts index 87751fac51..6f7eaf9671 100644 --- a/packages/database/data-migrations/20240207041922_advanced_targeting/data-migration.ts +++ b/packages/database/data-migrations/20240207041922_advanced_targeting/data-migration.ts @@ -1,6 +1,5 @@ import { createId } from "@paralleldrive/cuid2"; import { PrismaClient } from "@prisma/client"; - import { TBaseFilter, TBaseFilters, diff --git a/packages/database/data-migrations/20240318050527_add_languages_and_survey_languages/data-migration-fix.ts b/packages/database/data-migrations/20240318050527_add_languages_and_survey_languages/data-migration-fix.ts index 3dcb75ce4c..e4da6598b8 100644 --- a/packages/database/data-migrations/20240318050527_add_languages_and_survey_languages/data-migration-fix.ts +++ b/packages/database/data-migrations/20240318050527_add_languages_and_survey_languages/data-migration-fix.ts @@ -1,6 +1,5 @@ // migration script to translate surveys where thankYouCard buttonLabel is a string or question subheaders are strings import { PrismaClient } from "@prisma/client"; - import { hasStringSubheaders, translateSurvey } from "./lib/i18n"; const prisma = new PrismaClient(); diff --git a/packages/database/data-migrations/20240318050527_add_languages_and_survey_languages/data-migration.ts b/packages/database/data-migrations/20240318050527_add_languages_and_survey_languages/data-migration.ts index 79ea18b023..ac55b2ecc7 100644 --- a/packages/database/data-migrations/20240318050527_add_languages_and_survey_languages/data-migration.ts +++ b/packages/database/data-migrations/20240318050527_add_languages_and_survey_languages/data-migration.ts @@ -1,6 +1,5 @@ import { PrismaClient } from "@prisma/client"; import { AttributeType } from "@prisma/client"; - import { translateSurvey } from "./lib/i18n"; const prisma = new PrismaClient(); diff --git a/packages/database/data-migrations/20240524053239_extends_no_code_action_schema/data-migration.ts b/packages/database/data-migrations/20240524053239_extends_no_code_action_schema/data-migration.ts index 45112b9240..4e4b573b1d 100644 --- a/packages/database/data-migrations/20240524053239_extends_no_code_action_schema/data-migration.ts +++ b/packages/database/data-migrations/20240524053239_extends_no_code_action_schema/data-migration.ts @@ -1,5 +1,4 @@ import { PrismaClient } from "@prisma/client"; - import { TActionClassNoCodeConfig } from "@formbricks/types/actionClasses"; const prisma = new PrismaClient(); diff --git a/packages/database/migrations/20240612074254_add_show_language_switch_to_survey/migration.sql b/packages/database/migrations/20240612074254_add_show_language_switch_to_survey/migration.sql new file mode 100644 index 0000000000..8c5d295a58 --- /dev/null +++ b/packages/database/migrations/20240612074254_add_show_language_switch_to_survey/migration.sql @@ -0,0 +1,2 @@ +-- AlterTable +ALTER TABLE "Survey" ADD COLUMN "showLanguageSwitch" BOOLEAN; diff --git a/packages/database/schema.prisma b/packages/database/schema.prisma index 49c6baab4d..bfe0f22cc3 100644 --- a/packages/database/schema.prisma +++ b/packages/database/schema.prisma @@ -311,11 +311,12 @@ model Survey { /// @zod.custom(imports.ZSurveyVerifyEmail) /// [SurveyVerifyEmail] - verifyEmail Json? - pin String? - resultShareKey String? @unique - displayPercentage Decimal? - languages SurveyLanguage[] + verifyEmail Json? + pin String? + resultShareKey String? @unique + displayPercentage Decimal? + languages SurveyLanguage[] + showLanguageSwitch Boolean? @@index([environmentId, updatedAt]) @@index([segmentId]) diff --git a/packages/ee/multi-language/components/default-language-select.tsx b/packages/ee/multi-language/components/default-language-select.tsx index 326d4b19dd..39e2a35b22 100644 --- a/packages/ee/multi-language/components/default-language-select.tsx +++ b/packages/ee/multi-language/components/default-language-select.tsx @@ -1,7 +1,7 @@ +import { getLanguageLabel } from "@formbricks/lib/i18n/utils"; import type { TLanguage, TProduct } from "@formbricks/types/product"; import { DefaultTag } from "@formbricks/ui/DefaultTag"; import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from "@formbricks/ui/Select"; -import { getLanguageLabel } from "../lib/iso-languages"; import type { ConfirmationModalProps } from "./multi-language-card"; interface DefaultLanguageSelectProps { diff --git a/packages/ee/multi-language/components/edit-language.tsx b/packages/ee/multi-language/components/edit-language.tsx index 5b8aafb37d..4043e411f6 100644 --- a/packages/ee/multi-language/components/edit-language.tsx +++ b/packages/ee/multi-language/components/edit-language.tsx @@ -3,6 +3,7 @@ import { InfoIcon, PlusIcon } from "lucide-react"; import { useEffect, useState } from "react"; import { toast } from "react-hot-toast"; +import { iso639Languages } from "@formbricks/lib/i18n/utils"; import type { TLanguage, TProduct } from "@formbricks/types/product"; import { Button } from "@formbricks/ui/Button"; import { ConfirmationModal } from "@formbricks/ui/ConfirmationModal"; @@ -14,7 +15,6 @@ import { getSurveysUsingGivenLanguageAction, updateLanguageAction, } from "../lib/actions"; -import { iso639Languages } from "../lib/iso-languages"; import { LanguageRow } from "./language-row"; interface EditLanguageProps { diff --git a/packages/ee/multi-language/components/language-indicator.tsx b/packages/ee/multi-language/components/language-indicator.tsx index 5f5d5ee442..9ab122fbb4 100644 --- a/packages/ee/multi-language/components/language-indicator.tsx +++ b/packages/ee/multi-language/components/language-indicator.tsx @@ -1,8 +1,8 @@ import { ChevronDown } from "lucide-react"; import { useRef, useState } from "react"; +import { getLanguageLabel } from "@formbricks/lib/i18n/utils"; import { useClickOutside } from "@formbricks/lib/utils/hooks/useClickOutside"; import type { TSurveyLanguage } from "@formbricks/types/surveys"; -import { getLanguageLabel } from "../lib/iso-languages"; interface LanguageIndicatorProps { selectedLanguageCode: string; diff --git a/packages/ee/multi-language/components/language-select.tsx b/packages/ee/multi-language/components/language-select.tsx index fd2b8c4f77..aa7ac5394c 100644 --- a/packages/ee/multi-language/components/language-select.tsx +++ b/packages/ee/multi-language/components/language-select.tsx @@ -1,11 +1,11 @@ import { ChevronDown } from "lucide-react"; import { useEffect, useRef, useState } from "react"; +import type { TIso639Language } from "@formbricks/lib/i18n/utils"; +import { iso639Languages } from "@formbricks/lib/i18n/utils"; import { useClickOutside } from "@formbricks/lib/utils/hooks/useClickOutside"; import type { TLanguage } from "@formbricks/types/product"; import { Button } from "@formbricks/ui/Button"; import { Input } from "@formbricks/ui/Input"; -import type { TIso639Language } from "../lib/iso-languages"; -import { iso639Languages } from "../lib/iso-languages"; interface LanguageSelectProps { language: TLanguage; diff --git a/packages/ee/multi-language/components/language-switch.tsx b/packages/ee/multi-language/components/language-switch.tsx deleted file mode 100644 index 72430584a4..0000000000 --- a/packages/ee/multi-language/components/language-switch.tsx +++ /dev/null @@ -1,66 +0,0 @@ -"use client"; - -import { ChevronDownIcon } from "lucide-react"; -import type { TSurveyLanguage } from "@formbricks/types/surveys"; -import { - DropdownMenu, - DropdownMenuContent, - DropdownMenuItem, - DropdownMenuTrigger, -} from "@formbricks/ui/DropdownMenu"; -import { getLanguageLabel } from "../lib/iso-languages"; - -interface LanguageSwitchProps { - surveyLanguages: TSurveyLanguage[]; - selectedLanguageCode: string; - setSelectedLanguageCode: (language: string) => void; -} -export function LanguageSwitch({ - surveyLanguages, - selectedLanguageCode, - setSelectedLanguageCode, -}: LanguageSwitchProps) { - if (selectedLanguageCode === "default") { - selectedLanguageCode = - surveyLanguages.find((surveyLanguage) => { - return surveyLanguage.default; - })?.language.code ?? "default"; - } - return ( -
- - -
-
- Select Language - -
-
-
- - {surveyLanguages.length > 0 ? ( - surveyLanguages.map((surveyLanguage) => ( - { - setSelectedLanguageCode(surveyLanguage.language.code); - }}> -
- -

{getLanguageLabel(surveyLanguage.language.code)}

-
-
- )) - ) : ( -

No languages to select

- )} -
-
-
- ); -} diff --git a/packages/ee/multi-language/components/language-toggle.tsx b/packages/ee/multi-language/components/language-toggle.tsx index de27851018..91a41c7b9d 100644 --- a/packages/ee/multi-language/components/language-toggle.tsx +++ b/packages/ee/multi-language/components/language-toggle.tsx @@ -1,7 +1,7 @@ +import { getLanguageLabel } from "@formbricks/lib/i18n/utils"; import type { TLanguage } from "@formbricks/types/product"; import { Label } from "@formbricks/ui/Label"; import { Switch } from "@formbricks/ui/Switch"; -import { getLanguageLabel } from "../lib/iso-languages"; interface LanguageToggleProps { language: TLanguage; diff --git a/packages/ee/multi-language/components/multi-language-card.tsx b/packages/ee/multi-language/components/multi-language-card.tsx index bfbc2c762d..1106390771 100644 --- a/packages/ee/multi-language/components/multi-language-card.tsx +++ b/packages/ee/multi-language/components/multi-language-card.tsx @@ -11,6 +11,7 @@ import { extractLanguageCodes, translateSurvey } from "@formbricks/lib/i18n/util import type { TLanguage, TProduct } from "@formbricks/types/product"; import type { TSurvey, TSurveyLanguage } from "@formbricks/types/surveys"; import { ZSurvey } from "@formbricks/types/surveys"; +import { AdvancedOptionToggle } from "@formbricks/ui/AdvancedOptionToggle"; import { Button } from "@formbricks/ui/Button"; import { ConfirmationModal } from "@formbricks/ui/ConfirmationModal"; import { Label } from "@formbricks/ui/Label"; @@ -168,6 +169,10 @@ export const MultiLanguageCard: FC = ({ } }; + const handleLanguageSwitchToggle = () => { + setLocalSurvey({ ...localSurvey, ...{ showLanguageSwitch: !localSurvey.showLanguageSwitch } }); + }; + return (
= ({ Manage Languages + {isMultiLanguageActivated && ( + + )} )} diff --git a/packages/ee/multi-language/lib/iso-languages.ts b/packages/ee/multi-language/lib/iso-languages.ts deleted file mode 100644 index 660d60584c..0000000000 --- a/packages/ee/multi-language/lib/iso-languages.ts +++ /dev/null @@ -1,750 +0,0 @@ -export interface TIso639Language { - alpha2: string; - english: string; -} - -export const iso639Languages = [ - { - alpha2: "aa", - english: "Afar", - }, - { - alpha2: "ab", - english: "Abkhazian", - }, - { - alpha2: "ae", - english: "Avestan", - }, - { - alpha2: "af", - english: "Afrikaans", - }, - { - alpha2: "ak", - english: "Akan", - }, - { - alpha2: "am", - english: "Amharic", - }, - { - alpha2: "an", - english: "Aragonese", - }, - { - alpha2: "ar", - english: "Arabic", - }, - { - alpha2: "as", - english: "Assamese", - }, - { - alpha2: "av", - english: "Avaric", - }, - { - alpha2: "ay", - english: "Aymara", - }, - { - alpha2: "az", - english: "Azerbaijani", - }, - { - alpha2: "ba", - english: "Bashkir", - }, - { - alpha2: "be", - english: "Belarusian", - }, - { - alpha2: "bg", - english: "Bulgarian", - }, - { - alpha2: "bh", - english: "Bihari languages", - }, - { - alpha2: "bi", - english: "Bislama", - }, - { - alpha2: "bm", - english: "Bambara", - }, - { - alpha2: "bn", - english: "Bengali", - }, - { - alpha2: "bo", - english: "Tibetan", - }, - { - alpha2: "br", - english: "Breton", - }, - { - alpha2: "bs", - english: "Bosnian", - }, - { - alpha2: "ca", - english: "Catalan; Valencian", - }, - { - alpha2: "ce", - english: "Chechen", - }, - { - alpha2: "ch", - english: "Chamorro", - }, - { - alpha2: "co", - english: "Corsican", - }, - { - alpha2: "cr", - english: "Cree", - }, - { - alpha2: "cs", - english: "Czech", - }, - { - alpha2: "cu", - english: "Church Slavic; Old Slavonic; Church Slavonic; Old Bulgarian; Old Church Slavonic", - }, - { - alpha2: "cv", - english: "Chuvash", - }, - { - alpha2: "cy", - english: "Welsh", - }, - { - alpha2: "da", - english: "Danish", - }, - { - alpha2: "de", - english: "German", - }, - { - alpha2: "dv", - english: "Divehi; Dhivehi; Maldivian", - }, - { - alpha2: "dz", - english: "Dzongkha", - }, - { - alpha2: "ee", - english: "Ewe", - }, - { - alpha2: "el", - english: "Greek, Modern (1453-)", - }, - { - alpha2: "en", - english: "English", - }, - { - alpha2: "eo", - english: "Esperanto", - }, - { - alpha2: "es", - english: "Spanish; Castilian", - }, - { - alpha2: "et", - english: "Estonian", - }, - { - alpha2: "eu", - english: "Basque", - }, - { - alpha2: "fa", - english: "Persian", - }, - { - alpha2: "ff", - english: "Fulah", - }, - { - alpha2: "fi", - english: "Finnish", - }, - { - alpha2: "fj", - english: "Fijian", - }, - { - alpha2: "fo", - english: "Faroese", - }, - { - alpha2: "fr", - english: "French", - }, - { - alpha2: "fy", - english: "Western Frisian", - }, - { - alpha2: "ga", - english: "Irish", - }, - { - alpha2: "gd", - english: "Gaelic; Scottish Gaelic", - }, - { - alpha2: "gl", - english: "Galician", - }, - { - alpha2: "gn", - english: "Guarani", - }, - { - alpha2: "gu", - english: "Gujarati", - }, - { - alpha2: "gv", - english: "Manx", - }, - { - alpha2: "ha", - english: "Hausa", - }, - { - alpha2: "he", - english: "Hebrew", - }, - { - alpha2: "hi", - english: "Hindi", - }, - { - alpha2: "ho", - english: "Hiri Motu", - }, - { - alpha2: "hr", - english: "Croatian", - }, - { - alpha2: "ht", - english: "Haitian; Haitian Creole", - }, - { - alpha2: "hu", - english: "Hungarian", - }, - { - alpha2: "hy", - english: "Armenian", - }, - { - alpha2: "hz", - english: "Herero", - }, - { - alpha2: "ia", - english: "Interlingua (International Auxiliary Language Association)", - }, - { - alpha2: "id", - english: "Indonesian", - }, - { - alpha2: "ie", - english: "Interlingue; Occidental", - }, - { - alpha2: "ig", - english: "Igbo", - }, - { - alpha2: "ii", - english: "Sichuan Yi; Nuosu", - }, - { - alpha2: "ik", - english: "Inupiaq", - }, - { - alpha2: "io", - english: "Ido", - }, - { - alpha2: "is", - english: "Icelandic", - }, - { - alpha2: "it", - english: "Italian", - }, - { - alpha2: "iu", - english: "Inuktitut", - }, - { - alpha2: "ja", - english: "Japanese", - }, - { - alpha2: "jv", - english: "Javanese", - }, - { - alpha2: "ka", - english: "Georgian", - }, - { - alpha2: "kg", - english: "Kongo", - }, - { - alpha2: "ki", - english: "Kikuyu; Gikuyu", - }, - { - alpha2: "kj", - english: "Kuanyama; Kwanyama", - }, - { - alpha2: "kk", - english: "Kazakh", - }, - { - alpha2: "kl", - english: "Kalaallisut; Greenlandic", - }, - { - alpha2: "km", - english: "Central Khmer", - }, - { - alpha2: "kn", - english: "Kannada", - }, - { - alpha2: "ko", - english: "Korean", - }, - { - alpha2: "kr", - english: "Kanuri", - }, - { - alpha2: "ks", - english: "Kashmiri", - }, - { - alpha2: "ku", - english: "Kurdish", - }, - { - alpha2: "kv", - english: "Komi", - }, - { - alpha2: "kw", - english: "Cornish", - }, - { - alpha2: "ky", - english: "Kirghiz; Kyrgyz", - }, - { - alpha2: "la", - english: "Latin", - }, - { - alpha2: "lb", - english: "Luxembourgish; Letzeburgesch", - }, - { - alpha2: "lg", - english: "Ganda", - }, - { - alpha2: "li", - english: "Limburgan; Limburger; Limburgish", - }, - { - alpha2: "ln", - english: "Lingala", - }, - { - alpha2: "lo", - english: "Lao", - }, - { - alpha2: "lt", - english: "Lithuanian", - }, - { - alpha2: "lu", - english: "Luba-Katanga", - }, - { - alpha2: "lv", - english: "Latvian", - }, - { - alpha2: "mg", - english: "Malagasy", - }, - { - alpha2: "mh", - english: "Marshallese", - }, - { - alpha2: "mi", - english: "Maori", - }, - { - alpha2: "mk", - english: "Macedonian", - }, - { - alpha2: "ml", - english: "Malayalam", - }, - { - alpha2: "mn", - english: "Mongolian", - }, - { - alpha2: "mr", - english: "Marathi", - }, - { - alpha2: "ms", - english: "Malay", - }, - { - alpha2: "mt", - english: "Maltese", - }, - { - alpha2: "my", - english: "Burmese", - }, - { - alpha2: "na", - english: "Nauru", - }, - { - alpha2: "nb", - english: "Bokmål, Norwegian; Norwegian Bokmål", - }, - { - alpha2: "nd", - english: "Ndebele, North; North Ndebele", - }, - { - alpha2: "ne", - english: "Nepali", - }, - { - alpha2: "ng", - english: "Ndonga", - }, - { - alpha2: "nl", - english: "Dutch; Flemish", - }, - { - alpha2: "nn", - english: "Norwegian Nynorsk; Nynorsk, Norwegian", - }, - { - alpha2: "no", - english: "Norwegian", - }, - { - alpha2: "nr", - english: "Ndebele, South; South Ndebele", - }, - { - alpha2: "nv", - english: "Navajo; Navaho", - }, - { - alpha2: "ny", - english: "Chichewa; Chewa; Nyanja", - }, - { - alpha2: "oc", - english: "Occitan (post 1500)", - }, - { - alpha2: "oj", - english: "Ojibwa", - }, - { - alpha2: "om", - english: "Oromo", - }, - { - alpha2: "or", - english: "Oriya", - }, - { - alpha2: "os", - english: "Ossetian; Ossetic", - }, - { - alpha2: "pa", - english: "Panjabi; Punjabi", - }, - { - alpha2: "pi", - english: "Pali", - }, - { - alpha2: "pl", - english: "Polish", - }, - { - alpha2: "ps", - english: "Pushto; Pashto", - }, - { - alpha2: "pt", - english: "Portuguese", - }, - { - alpha2: "qu", - english: "Quechua", - }, - { - alpha2: "rm", - english: "Romansh", - }, - { - alpha2: "rn", - english: "Rundi", - }, - { - alpha2: "ro", - english: "Romanian; Moldavian; Moldovan", - }, - { - alpha2: "ru", - english: "Russian", - }, - { - alpha2: "rw", - english: "Kinyarwanda", - }, - { - alpha2: "sa", - english: "Sanskrit", - }, - { - alpha2: "sc", - english: "Sardinian", - }, - { - alpha2: "sd", - english: "Sindhi", - }, - { - alpha2: "se", - english: "Northern Sami", - }, - { - alpha2: "sg", - english: "Sango", - }, - { - alpha2: "si", - english: "Sinhala; Sinhalese", - }, - { - alpha2: "sk", - english: "Slovak", - }, - { - alpha2: "sl", - english: "Slovenian", - }, - { - alpha2: "sm", - english: "Samoan", - }, - { - alpha2: "sn", - english: "Shona", - }, - { - alpha2: "so", - english: "Somali", - }, - { - alpha2: "sq", - english: "Albanian", - }, - { - alpha2: "sr", - english: "Serbian", - }, - { - alpha2: "ss", - english: "Swati", - }, - { - alpha2: "st", - english: "Sotho, Southern", - }, - { - alpha2: "su", - english: "Sundanese", - }, - { - alpha2: "sv", - english: "Swedish", - }, - { - alpha2: "sw", - english: "Swahili", - }, - { - alpha2: "ta", - english: "Tamil", - }, - { - alpha2: "te", - english: "Telugu", - }, - { - alpha2: "tg", - english: "Tajik", - }, - { - alpha2: "th", - english: "Thai", - }, - { - alpha2: "ti", - english: "Tigrinya", - }, - { - alpha2: "tk", - english: "Turkmen", - }, - { - alpha2: "tl", - english: "Tagalog", - }, - { - alpha2: "tn", - english: "Tswana", - }, - { - alpha2: "to", - english: "Tonga (Tonga Islands)", - }, - { - alpha2: "tr", - english: "Turkish", - }, - { - alpha2: "ts", - english: "Tsonga", - }, - { - alpha2: "tt", - english: "Tatar", - }, - { - alpha2: "tw", - english: "Twi", - }, - { - alpha2: "ty", - english: "Tahitian", - }, - { - alpha2: "ug", - english: "Uighur; Uyghur", - }, - { - alpha2: "uk", - english: "Ukrainian", - }, - { - alpha2: "ur", - english: "Urdu", - }, - { - alpha2: "uz", - english: "Uzbek", - }, - { - alpha2: "ve", - english: "Venda", - }, - { - alpha2: "vi", - english: "Vietnamese", - }, - { - alpha2: "vo", - english: "Volapük", - }, - { - alpha2: "wa", - english: "Walloon", - }, - { - alpha2: "wo", - english: "Wolof", - }, - { - alpha2: "xh", - english: "Xhosa", - }, - { - alpha2: "yi", - english: "Yiddish", - }, - { - alpha2: "yo", - english: "Yoruba", - }, - { - alpha2: "za", - english: "Zhuang; Chuang", - }, - { - alpha2: "zh", - english: "Chinese", - }, - { - alpha2: "zu", - english: "Zulu", - }, -]; - -export const iso639Identifiers = iso639Languages.map((language) => language.alpha2); - -export const getLanguageLabel = (languageCode: string) => { - const language = iso639Languages.find((lang) => lang.alpha2 === languageCode); - return `${language?.english}`; -}; diff --git a/packages/js-core/app.vite.config.ts b/packages/js-core/app.vite.config.ts index c9217dd001..98c3176dc6 100644 --- a/packages/js-core/app.vite.config.ts +++ b/packages/js-core/app.vite.config.ts @@ -1,7 +1,6 @@ import { resolve } from "path"; import { defineConfig } from "vite"; import dts from "vite-plugin-dts"; - import webPackageJson from "../../apps/web/package.json"; const config = () => { diff --git a/packages/js-core/src/app/lib/actions.ts b/packages/js-core/src/app/lib/actions.ts index 26cb91f193..e1539c9f7f 100644 --- a/packages/js-core/src/app/lib/actions.ts +++ b/packages/js-core/src/app/lib/actions.ts @@ -1,6 +1,5 @@ import { FormbricksAPI } from "@formbricks/api"; import { TJsActionInput, TJsTrackProperties } from "@formbricks/types/js"; - import { InvalidCodeError, NetworkError, Result, err, okVoid } from "../../shared/errors"; import { Logger } from "../../shared/logger"; import { getIsDebug } from "../../shared/utils"; diff --git a/packages/js-core/src/app/lib/api.ts b/packages/js-core/src/app/lib/api.ts index 3d47d36172..508f939230 100644 --- a/packages/js-core/src/app/lib/api.ts +++ b/packages/js-core/src/app/lib/api.ts @@ -1,5 +1,4 @@ import { FormbricksAPI } from "@formbricks/api"; - import { AppConfig } from "./config"; export const getApi = (): FormbricksAPI => { diff --git a/packages/js-core/src/app/lib/attributes.ts b/packages/js-core/src/app/lib/attributes.ts index a122373b54..bfa89006ce 100644 --- a/packages/js-core/src/app/lib/attributes.ts +++ b/packages/js-core/src/app/lib/attributes.ts @@ -1,6 +1,5 @@ import { FormbricksAPI } from "@formbricks/api"; import { TAttributes } from "@formbricks/types/attributes"; - import { MissingPersonError, NetworkError, Result, err, ok, okVoid } from "../../shared/errors"; import { Logger } from "../../shared/logger"; import { AppConfig } from "./config"; diff --git a/packages/js-core/src/app/lib/config.ts b/packages/js-core/src/app/lib/config.ts index 6858d25da2..6509491045 100644 --- a/packages/js-core/src/app/lib/config.ts +++ b/packages/js-core/src/app/lib/config.ts @@ -1,5 +1,4 @@ import { TJSAppConfig, TJsAppConfigUpdateInput } from "@formbricks/types/js"; - import { Result, err, ok, wrapThrows } from "../../shared/errors"; export const IN_APP_LOCAL_STORAGE_KEY = "formbricks-js-app"; diff --git a/packages/js-core/src/app/lib/sync.ts b/packages/js-core/src/app/lib/sync.ts index 5f64ff7730..6a90201349 100644 --- a/packages/js-core/src/app/lib/sync.ts +++ b/packages/js-core/src/app/lib/sync.ts @@ -1,7 +1,6 @@ import { TAttributes } from "@formbricks/types/attributes"; import { TJsAppState, TJsAppStateSync, TJsAppSyncParams } from "@formbricks/types/js"; import { TSurvey } from "@formbricks/types/surveys"; - import { NetworkError, Result, err, ok } from "../../shared/errors"; import { Logger } from "../../shared/logger"; import { getIsDebug } from "../../shared/utils"; diff --git a/packages/js-core/src/app/lib/widget.ts b/packages/js-core/src/app/lib/widget.ts index d686f4424c..6281b4a597 100644 --- a/packages/js-core/src/app/lib/widget.ts +++ b/packages/js-core/src/app/lib/widget.ts @@ -5,7 +5,6 @@ import { getStyling } from "@formbricks/lib/utils/styling"; import { TJsTrackProperties } from "@formbricks/types/js"; import { TResponseHiddenFieldValue, TResponseUpdate } from "@formbricks/types/responses"; import { TSurvey } from "@formbricks/types/surveys"; - import { ErrorHandler } from "../../shared/errors"; import { Logger } from "../../shared/logger"; import { getDefaultLanguageCode, getLanguageCode, handleHiddenFields } from "../../shared/utils"; @@ -154,7 +153,8 @@ const renderWidget = async ( data: responseUpdate.data, ttc: responseUpdate.ttc, finished: responseUpdate.finished, - language: languageCode === "default" ? getDefaultLanguageCode(survey) : languageCode, + language: + responseUpdate.language === "default" ? getDefaultLanguageCode(survey) : responseUpdate.language, meta: { url: window.location.href, action, diff --git a/packages/js-core/src/shared/commandQueue.ts b/packages/js-core/src/shared/commandQueue.ts index 024c3f5ab1..34e097015b 100644 --- a/packages/js-core/src/shared/commandQueue.ts +++ b/packages/js-core/src/shared/commandQueue.ts @@ -1,6 +1,5 @@ import { wrapThrowsAsync } from "@formbricks/types/errorHandlers"; import { TJsPackageType } from "@formbricks/types/js"; - import { checkInitialized as checkInitializedInApp } from "../app/lib/initialize"; import { checkInitialized as checkInitializedWebsite } from "../website/lib/initialize"; import { ErrorHandler, Result } from "./errors"; diff --git a/packages/js-core/src/shared/utils.ts b/packages/js-core/src/shared/utils.ts index 39932b136a..a99c5d99bd 100644 --- a/packages/js-core/src/shared/utils.ts +++ b/packages/js-core/src/shared/utils.ts @@ -7,7 +7,6 @@ import { TAttributes } from "@formbricks/types/attributes"; import { TJsTrackProperties } from "@formbricks/types/js"; import { TResponseHiddenFieldValue } from "@formbricks/types/responses"; import { TSurvey } from "@formbricks/types/surveys"; - import { Logger } from "../shared/logger"; const logger = Logger.getInstance(); diff --git a/packages/js-core/src/website/lib/actions.ts b/packages/js-core/src/website/lib/actions.ts index b9b98dcc49..72de26ea51 100644 --- a/packages/js-core/src/website/lib/actions.ts +++ b/packages/js-core/src/website/lib/actions.ts @@ -1,5 +1,4 @@ import { TJsTrackProperties } from "@formbricks/types/js"; - import { InvalidCodeError, NetworkError, Result, err, okVoid } from "../../shared/errors"; import { Logger } from "../../shared/logger"; import { WebsiteConfig } from "./config"; diff --git a/packages/js-core/src/website/lib/config.ts b/packages/js-core/src/website/lib/config.ts index a14baea33c..d18c137cb7 100644 --- a/packages/js-core/src/website/lib/config.ts +++ b/packages/js-core/src/website/lib/config.ts @@ -1,5 +1,4 @@ import { TJsWebsiteConfig, TJsWebsiteConfigUpdateInput } from "@formbricks/types/js"; - import { Result, err, ok, wrapThrows } from "../../shared/errors"; export const WEBSITE_LOCAL_STORAGE_KEY = "formbricks-js-website"; diff --git a/packages/js-core/src/website/lib/sync.ts b/packages/js-core/src/website/lib/sync.ts index 213f975b52..f7a0e55d65 100644 --- a/packages/js-core/src/website/lib/sync.ts +++ b/packages/js-core/src/website/lib/sync.ts @@ -1,7 +1,6 @@ import { diffInDays } from "@formbricks/lib/utils/datetime"; import { TJsWebsiteState, TJsWebsiteSyncParams } from "@formbricks/types/js"; import { TSurvey } from "@formbricks/types/surveys"; - import { NetworkError, Result, err, ok } from "../../shared/errors"; import { Logger } from "../../shared/logger"; import { getIsDebug } from "../../shared/utils"; diff --git a/packages/js-core/src/website/lib/widget.ts b/packages/js-core/src/website/lib/widget.ts index c78f6b41ee..3d065a12d0 100644 --- a/packages/js-core/src/website/lib/widget.ts +++ b/packages/js-core/src/website/lib/widget.ts @@ -5,7 +5,6 @@ import { getStyling } from "@formbricks/lib/utils/styling"; import { TJSWebsiteStateDisplay, TJsTrackProperties } from "@formbricks/types/js"; import { TResponseHiddenFieldValue, TResponseUpdate } from "@formbricks/types/responses"; import { TSurvey } from "@formbricks/types/surveys"; - import { Logger } from "../../shared/logger"; import { getDefaultLanguageCode, getLanguageCode, handleHiddenFields } from "../../shared/utils"; import { WebsiteConfig } from "./config"; @@ -184,7 +183,8 @@ const renderWidget = async ( data: responseUpdate.data, ttc: responseUpdate.ttc, finished: responseUpdate.finished, - language: languageCode === "default" ? getDefaultLanguageCode(survey) : languageCode, + language: + responseUpdate.language === "default" ? getDefaultLanguageCode(survey) : responseUpdate.language, meta: { url: window.location.href, action, diff --git a/packages/js-core/website.vite.config.ts b/packages/js-core/website.vite.config.ts index 3ef3ee02bc..e08e44b1b5 100644 --- a/packages/js-core/website.vite.config.ts +++ b/packages/js-core/website.vite.config.ts @@ -1,7 +1,6 @@ import { resolve } from "path"; import { defineConfig } from "vite"; import dts from "vite-plugin-dts"; - import webPackageJson from "../../apps/web/package.json"; const config = () => { diff --git a/packages/js/src/app.ts b/packages/js/src/app.ts index 131f87619d..8537af3e9f 100644 --- a/packages/js/src/app.ts +++ b/packages/js/src/app.ts @@ -1,6 +1,5 @@ import { TFormbricksApp } from "@formbricks/js-core/app"; import { TFormbricksWebsite } from "@formbricks/js-core/website"; - import { loadFormbricksToProxy } from "./shared/loadFormbricks"; declare global { diff --git a/packages/js/src/website.ts b/packages/js/src/website.ts index 2b7e035d90..4dc6f4fc92 100644 --- a/packages/js/src/website.ts +++ b/packages/js/src/website.ts @@ -1,6 +1,5 @@ import { TFormbricksApp } from "@formbricks/js-core/app"; import { TFormbricksWebsite } from "@formbricks/js-core/website"; - import { loadFormbricksToProxy } from "./shared/loadFormbricks"; declare global { diff --git a/packages/lib/account/service.ts b/packages/lib/account/service.ts index 1846da4e2b..c2d42b2d85 100644 --- a/packages/lib/account/service.ts +++ b/packages/lib/account/service.ts @@ -1,9 +1,7 @@ import { Prisma } from "@prisma/client"; - import { prisma } from "@formbricks/database"; import { TAccount, TAccountInput, ZAccountInput } from "@formbricks/types/account"; import { DatabaseError } from "@formbricks/types/errors"; - import { validateInputs } from "../utils/validate"; import { filterAccountInputData } from "./utils"; diff --git a/packages/lib/action/service.ts b/packages/lib/action/service.ts index 5e7e9d9d9c..d324e058b6 100644 --- a/packages/lib/action/service.ts +++ b/packages/lib/action/service.ts @@ -1,14 +1,11 @@ import "server-only"; - import { Prisma } from "@prisma/client"; import { differenceInDays } from "date-fns"; - import { prisma } from "@formbricks/database"; import { TAction, TActionInput, ZActionInput } from "@formbricks/types/actions"; import { ZOptionalNumber } from "@formbricks/types/common"; import { ZId } from "@formbricks/types/environment"; import { DatabaseError, OperationNotAllowedError } from "@formbricks/types/errors"; - import { actionClassCache } from "../actionClass/cache"; import { getActionClassByEnvironmentIdAndName } from "../actionClass/service"; import { cache } from "../cache"; diff --git a/packages/lib/actionClass/auth.ts b/packages/lib/actionClass/auth.ts index f84670366b..0be6a21859 100644 --- a/packages/lib/actionClass/auth.ts +++ b/packages/lib/actionClass/auth.ts @@ -1,7 +1,5 @@ import "server-only"; - import { ZId } from "@formbricks/types/environment"; - import { cache } from "../cache"; import { hasUserEnvironmentAccess } from "../environment/auth"; import { getMembershipByUserIdOrganizationId } from "../membership/service"; diff --git a/packages/lib/actionClass/service.ts b/packages/lib/actionClass/service.ts index a1a5ca0756..537b584bec 100644 --- a/packages/lib/actionClass/service.ts +++ b/packages/lib/actionClass/service.ts @@ -1,15 +1,12 @@ "use server"; import "server-only"; - import { Prisma } from "@prisma/client"; - import { prisma } from "@formbricks/database"; import { TActionClass, TActionClassInput, ZActionClassInput } from "@formbricks/types/actionClasses"; import { ZOptionalNumber, ZString } from "@formbricks/types/common"; import { ZId } from "@formbricks/types/environment"; import { DatabaseError, ResourceNotFoundError } from "@formbricks/types/errors"; - import { cache } from "../cache"; import { ITEMS_PER_PAGE } from "../constants"; import { validateInputs } from "../utils/validate"; diff --git a/packages/lib/airtable/service.ts b/packages/lib/airtable/service.ts index 5a8835f9cf..77603d838e 100644 --- a/packages/lib/airtable/service.ts +++ b/packages/lib/airtable/service.ts @@ -1,5 +1,4 @@ import { Prisma } from "@prisma/client"; - import { prisma } from "@formbricks/database"; import { DatabaseError } from "@formbricks/types/errors"; import { TIntegrationItem } from "@formbricks/types/integration"; @@ -14,7 +13,6 @@ import { ZIntegrationAirtableTablesWithFields, ZIntegrationAirtableTokenSchema, } from "@formbricks/types/integration/airtable"; - import { AIRTABLE_CLIENT_ID } from "../constants"; import { createOrUpdateIntegration, deleteIntegration, getIntegrationByType } from "../integration/service"; diff --git a/packages/lib/apiKey/auth.ts b/packages/lib/apiKey/auth.ts index 48ce4cb352..40ed5ace37 100644 --- a/packages/lib/apiKey/auth.ts +++ b/packages/lib/apiKey/auth.ts @@ -1,7 +1,5 @@ import "server-only"; - import { ZId } from "@formbricks/types/environment"; - import { cache } from "../cache"; import { hasUserEnvironmentAccess } from "../environment/auth"; import { validateInputs } from "../utils/validate"; diff --git a/packages/lib/apiKey/service.ts b/packages/lib/apiKey/service.ts index ea8130090a..ba63059131 100644 --- a/packages/lib/apiKey/service.ts +++ b/packages/lib/apiKey/service.ts @@ -1,14 +1,11 @@ import "server-only"; - import { Prisma } from "@prisma/client"; import { createHash, randomBytes } from "crypto"; - import { prisma } from "@formbricks/database"; import { TApiKey, TApiKeyCreateInput, ZApiKeyCreateInput } from "@formbricks/types/apiKeys"; import { ZOptionalNumber, ZString } from "@formbricks/types/common"; import { ZId } from "@formbricks/types/environment"; import { DatabaseError, InvalidInputError } from "@formbricks/types/errors"; - import { cache } from "../cache"; import { ITEMS_PER_PAGE } from "../constants"; import { getHash } from "../crypto"; diff --git a/packages/lib/attribute/service.ts b/packages/lib/attribute/service.ts index 4f916f766e..83f5c33f35 100644 --- a/packages/lib/attribute/service.ts +++ b/packages/lib/attribute/service.ts @@ -1,13 +1,10 @@ import "server-only"; - import { Prisma } from "@prisma/client"; - import { prisma } from "@formbricks/database"; import { TAttributes, ZAttributes } from "@formbricks/types/attributes"; import { ZString } from "@formbricks/types/common"; import { ZId } from "@formbricks/types/environment"; import { DatabaseError, OperationNotAllowedError } from "@formbricks/types/errors"; - import { attributeCache } from "../attribute/cache"; import { attributeClassCache } from "../attributeClass/cache"; import { diff --git a/packages/lib/attributeClass/auth.ts b/packages/lib/attributeClass/auth.ts index 9cf22c9301..f25c2e5cba 100644 --- a/packages/lib/attributeClass/auth.ts +++ b/packages/lib/attributeClass/auth.ts @@ -1,7 +1,5 @@ import "server-only"; - import { ZId } from "@formbricks/types/environment"; - import { cache } from "../cache"; import { hasUserEnvironmentAccess } from "../environment/auth"; import { validateInputs } from "../utils/validate"; diff --git a/packages/lib/attributeClass/service.ts b/packages/lib/attributeClass/service.ts index ce5183335e..59c77fe6b2 100644 --- a/packages/lib/attributeClass/service.ts +++ b/packages/lib/attributeClass/service.ts @@ -1,9 +1,7 @@ "use server"; import "server-only"; - import { Prisma } from "@prisma/client"; - import { prisma } from "@formbricks/database"; import { TAttributeClass, @@ -15,7 +13,6 @@ import { import { ZOptionalNumber, ZString } from "@formbricks/types/common"; import { ZId } from "@formbricks/types/environment"; import { DatabaseError, OperationNotAllowedError } from "@formbricks/types/errors"; - import { cache } from "../cache"; import { ITEMS_PER_PAGE, MAX_ATTRIBUTE_CLASSES_PER_ENVIRONMENT } from "../constants"; import { validateInputs } from "../utils/validate"; diff --git a/packages/lib/auth.ts b/packages/lib/auth.ts index 0f3d11fe40..23d18d1028 100644 --- a/packages/lib/auth.ts +++ b/packages/lib/auth.ts @@ -1,5 +1,4 @@ import { compare, hash } from "bcryptjs"; - import { prisma } from "@formbricks/database"; import { AuthenticationError } from "@formbricks/types/errors"; diff --git a/packages/lib/auth/service.ts b/packages/lib/auth/service.ts index 0e2b80787b..36ec920446 100644 --- a/packages/lib/auth/service.ts +++ b/packages/lib/auth/service.ts @@ -1,9 +1,7 @@ import crypto from "crypto"; import { authenticator } from "otplib"; import qrcode from "qrcode"; - import { prisma } from "@formbricks/database"; - import { verifyPassword } from "../auth"; import { ENCRYPTION_KEY } from "../constants"; import { symmetricDecrypt, symmetricEncrypt } from "../crypto"; diff --git a/packages/lib/constants.ts b/packages/lib/constants.ts index 78e4e907fa..34ac086d3d 100644 --- a/packages/lib/constants.ts +++ b/packages/lib/constants.ts @@ -1,5 +1,4 @@ import "server-only"; - import { env } from "./env"; export const IS_FORMBRICKS_CLOUD = env.IS_FORMBRICKS_CLOUD === "1"; diff --git a/packages/lib/crypto.ts b/packages/lib/crypto.ts index 79bc466508..c21b961f8d 100644 --- a/packages/lib/crypto.ts +++ b/packages/lib/crypto.ts @@ -1,6 +1,5 @@ import crypto from "crypto"; import { createCipheriv, createDecipheriv, createHash, createHmac, randomBytes } from "crypto"; - import { ENCRYPTION_KEY } from "./constants"; const ALGORITHM = "aes256"; diff --git a/packages/lib/customerio.ts b/packages/lib/customerio.ts index bd7d17cbfa..b91b8abb09 100644 --- a/packages/lib/customerio.ts +++ b/packages/lib/customerio.ts @@ -1,5 +1,4 @@ import { TUser } from "@formbricks/types/user"; - import { CUSTOMER_IO_API_KEY, CUSTOMER_IO_SITE_ID } from "./constants"; export const createCustomerIoCustomer = async (user: TUser) => { diff --git a/packages/lib/display/service.ts b/packages/lib/display/service.ts index cad080b85a..491fe9966e 100644 --- a/packages/lib/display/service.ts +++ b/packages/lib/display/service.ts @@ -1,7 +1,5 @@ import "server-only"; - import { Prisma } from "@prisma/client"; - import { prisma } from "@formbricks/database"; import { ZOptionalNumber } from "@formbricks/types/common"; import { @@ -19,7 +17,6 @@ import { import { ZId } from "@formbricks/types/environment"; import { DatabaseError, ResourceNotFoundError } from "@formbricks/types/errors"; import { TPerson } from "@formbricks/types/people"; - import { cache } from "../cache"; import { ITEMS_PER_PAGE } from "../constants"; import { createPerson, getPersonByUserId } from "../person/service"; diff --git a/packages/lib/display/tests/__mocks__/data.mock.ts b/packages/lib/display/tests/__mocks__/data.mock.ts index 585b1874bd..3672edfd8e 100644 --- a/packages/lib/display/tests/__mocks__/data.mock.ts +++ b/packages/lib/display/tests/__mocks__/data.mock.ts @@ -1,5 +1,4 @@ import { Prisma } from "@prisma/client"; - import { selectDisplay } from "../../service"; export const mockEnvironmentId = "clqkr5961000108jyfnjmbjhi"; diff --git a/packages/lib/display/tests/display.test.ts b/packages/lib/display/tests/display.test.ts index 2a98ed8704..ee75bea3c5 100644 --- a/packages/lib/display/tests/display.test.ts +++ b/packages/lib/display/tests/display.test.ts @@ -14,13 +14,10 @@ import { mockResponseId, mockSurveyId, } from "./__mocks__/data.mock"; - import { Prisma } from "@prisma/client"; import { afterEach, beforeEach, describe, expect, it, vi } from "vitest"; import { testInputValidation } from "vitestSetup"; - import { DatabaseError } from "@formbricks/types/errors"; - import { createDisplay, createDisplayLegacy, diff --git a/packages/lib/environment/auth.ts b/packages/lib/environment/auth.ts index d23babd263..7bee822adb 100644 --- a/packages/lib/environment/auth.ts +++ b/packages/lib/environment/auth.ts @@ -1,9 +1,7 @@ import { Prisma } from "@prisma/client"; - import { prisma } from "@formbricks/database"; import { ZId } from "@formbricks/types/environment"; import { DatabaseError } from "@formbricks/types/errors"; - import { cache } from "../cache"; import { organizationCache } from "../organization/cache"; import { validateInputs } from "../utils/validate"; diff --git a/packages/lib/environment/service.ts b/packages/lib/environment/service.ts index 9c442aecdd..f07e993375 100644 --- a/packages/lib/environment/service.ts +++ b/packages/lib/environment/service.ts @@ -1,8 +1,6 @@ import "server-only"; - import { Prisma } from "@prisma/client"; import { z } from "zod"; - import { prisma } from "@formbricks/database"; import type { TEnvironment, @@ -16,7 +14,6 @@ import { ZId, } from "@formbricks/types/environment"; import { DatabaseError, ResourceNotFoundError, ValidationError } from "@formbricks/types/errors"; - import { cache } from "../cache"; import { getOrganizationsByUserId } from "../organization/service"; import { getProducts } from "../product/service"; diff --git a/packages/lib/googleSheet/service.ts b/packages/lib/googleSheet/service.ts index e410965f41..4d82b37e14 100644 --- a/packages/lib/googleSheet/service.ts +++ b/packages/lib/googleSheet/service.ts @@ -1,15 +1,12 @@ import "server-only"; - import { Prisma } from "@prisma/client"; import { z } from "zod"; - import { ZString } from "@formbricks/types/common"; import { DatabaseError, UnknownError } from "@formbricks/types/errors"; import { TIntegrationGoogleSheets, ZIntegrationGoogleSheets, } from "@formbricks/types/integration/googleSheet"; - import { GOOGLE_SHEETS_CLIENT_ID, GOOGLE_SHEETS_CLIENT_SECRET, diff --git a/packages/lib/i18n/i18n.mock.ts b/packages/lib/i18n/i18n.mock.ts index 7fbff9491d..a586749947 100644 --- a/packages/lib/i18n/i18n.mock.ts +++ b/packages/lib/i18n/i18n.mock.ts @@ -306,6 +306,7 @@ export const mockSurvey: TSurvey = { triggers: [], languages: mockSurveyLanguages, segment: mockSegment, + showLanguageSwitch: null, } as unknown as TSurvey; export const mockTranslatedWelcomeCard = { diff --git a/packages/lib/i18n/i18n.test.ts b/packages/lib/i18n/i18n.test.ts index f96e2f2d88..a344e6275d 100644 --- a/packages/lib/i18n/i18n.test.ts +++ b/packages/lib/i18n/i18n.test.ts @@ -1,5 +1,4 @@ import { describe, expect, it } from "vitest"; - import { mockLegacySurvey, mockSurvey, diff --git a/packages/lib/i18n/reverseTranslation.ts b/packages/lib/i18n/reverseTranslation.ts index a0503a42e2..f31c081e53 100644 --- a/packages/lib/i18n/reverseTranslation.ts +++ b/packages/lib/i18n/reverseTranslation.ts @@ -1,8 +1,6 @@ import "server-only"; - import { TLegacySurvey, ZLegacySurvey } from "@formbricks/types/LegacySurvey"; import { TI18nString, TSurvey } from "@formbricks/types/surveys"; - import { structuredClone } from "../pollyfills/structuredClone"; import { isI18nObject } from "./utils"; diff --git a/packages/lib/i18n/utils.ts b/packages/lib/i18n/utils.ts index 624a6a5fb6..ef5116a9f1 100644 --- a/packages/lib/i18n/utils.ts +++ b/packages/lib/i18n/utils.ts @@ -32,7 +32,6 @@ import { ZSurveyThankYouCard, ZSurveyWelcomeCard, } from "@formbricks/types/surveys"; - import { structuredClone } from "../pollyfills/structuredClone"; // Helper function to create an i18nString from a regular string. @@ -310,3 +309,754 @@ export const getLanguageCode = (surveyLanguages: TSurveyLanguage[], languageCode const language = surveyLanguages.find((surveyLanguage) => surveyLanguage.language.code === languageCode); return language?.default ? "default" : language?.language.code || "default"; }; + +export interface TIso639Language { + alpha2: string; + english: string; +} + +export const iso639Languages = [ + { + alpha2: "aa", + english: "Afar", + }, + { + alpha2: "ab", + english: "Abkhazian", + }, + { + alpha2: "ae", + english: "Avestan", + }, + { + alpha2: "af", + english: "Afrikaans", + }, + { + alpha2: "ak", + english: "Akan", + }, + { + alpha2: "am", + english: "Amharic", + }, + { + alpha2: "an", + english: "Aragonese", + }, + { + alpha2: "ar", + english: "Arabic", + }, + { + alpha2: "as", + english: "Assamese", + }, + { + alpha2: "av", + english: "Avaric", + }, + { + alpha2: "ay", + english: "Aymara", + }, + { + alpha2: "az", + english: "Azerbaijani", + }, + { + alpha2: "ba", + english: "Bashkir", + }, + { + alpha2: "be", + english: "Belarusian", + }, + { + alpha2: "bg", + english: "Bulgarian", + }, + { + alpha2: "bh", + english: "Bihari languages", + }, + { + alpha2: "bi", + english: "Bislama", + }, + { + alpha2: "bm", + english: "Bambara", + }, + { + alpha2: "bn", + english: "Bengali", + }, + { + alpha2: "bo", + english: "Tibetan", + }, + { + alpha2: "br", + english: "Breton", + }, + { + alpha2: "bs", + english: "Bosnian", + }, + { + alpha2: "ca", + english: "Catalan; Valencian", + }, + { + alpha2: "ce", + english: "Chechen", + }, + { + alpha2: "ch", + english: "Chamorro", + }, + { + alpha2: "co", + english: "Corsican", + }, + { + alpha2: "cr", + english: "Cree", + }, + { + alpha2: "cs", + english: "Czech", + }, + { + alpha2: "cu", + english: "Church Slavic; Old Slavonic; Church Slavonic; Old Bulgarian; Old Church Slavonic", + }, + { + alpha2: "cv", + english: "Chuvash", + }, + { + alpha2: "cy", + english: "Welsh", + }, + { + alpha2: "da", + english: "Danish", + }, + { + alpha2: "de", + english: "German", + }, + { + alpha2: "dv", + english: "Divehi; Dhivehi; Maldivian", + }, + { + alpha2: "dz", + english: "Dzongkha", + }, + { + alpha2: "ee", + english: "Ewe", + }, + { + alpha2: "el", + english: "Greek, Modern (1453-)", + }, + { + alpha2: "en", + english: "English", + }, + { + alpha2: "eo", + english: "Esperanto", + }, + { + alpha2: "es", + english: "Spanish; Castilian", + }, + { + alpha2: "et", + english: "Estonian", + }, + { + alpha2: "eu", + english: "Basque", + }, + { + alpha2: "fa", + english: "Persian", + }, + { + alpha2: "ff", + english: "Fulah", + }, + { + alpha2: "fi", + english: "Finnish", + }, + { + alpha2: "fj", + english: "Fijian", + }, + { + alpha2: "fo", + english: "Faroese", + }, + { + alpha2: "fr", + english: "French", + }, + { + alpha2: "fy", + english: "Western Frisian", + }, + { + alpha2: "ga", + english: "Irish", + }, + { + alpha2: "gd", + english: "Gaelic; Scottish Gaelic", + }, + { + alpha2: "gl", + english: "Galician", + }, + { + alpha2: "gn", + english: "Guarani", + }, + { + alpha2: "gu", + english: "Gujarati", + }, + { + alpha2: "gv", + english: "Manx", + }, + { + alpha2: "ha", + english: "Hausa", + }, + { + alpha2: "he", + english: "Hebrew", + }, + { + alpha2: "hi", + english: "Hindi", + }, + { + alpha2: "ho", + english: "Hiri Motu", + }, + { + alpha2: "hr", + english: "Croatian", + }, + { + alpha2: "ht", + english: "Haitian; Haitian Creole", + }, + { + alpha2: "hu", + english: "Hungarian", + }, + { + alpha2: "hy", + english: "Armenian", + }, + { + alpha2: "hz", + english: "Herero", + }, + { + alpha2: "ia", + english: "Interlingua (International Auxiliary Language Association)", + }, + { + alpha2: "id", + english: "Indonesian", + }, + { + alpha2: "ie", + english: "Interlingue; Occidental", + }, + { + alpha2: "ig", + english: "Igbo", + }, + { + alpha2: "ii", + english: "Sichuan Yi; Nuosu", + }, + { + alpha2: "ik", + english: "Inupiaq", + }, + { + alpha2: "io", + english: "Ido", + }, + { + alpha2: "is", + english: "Icelandic", + }, + { + alpha2: "it", + english: "Italian", + }, + { + alpha2: "iu", + english: "Inuktitut", + }, + { + alpha2: "ja", + english: "Japanese", + }, + { + alpha2: "jv", + english: "Javanese", + }, + { + alpha2: "ka", + english: "Georgian", + }, + { + alpha2: "kg", + english: "Kongo", + }, + { + alpha2: "ki", + english: "Kikuyu; Gikuyu", + }, + { + alpha2: "kj", + english: "Kuanyama; Kwanyama", + }, + { + alpha2: "kk", + english: "Kazakh", + }, + { + alpha2: "kl", + english: "Kalaallisut; Greenlandic", + }, + { + alpha2: "km", + english: "Central Khmer", + }, + { + alpha2: "kn", + english: "Kannada", + }, + { + alpha2: "ko", + english: "Korean", + }, + { + alpha2: "kr", + english: "Kanuri", + }, + { + alpha2: "ks", + english: "Kashmiri", + }, + { + alpha2: "ku", + english: "Kurdish", + }, + { + alpha2: "kv", + english: "Komi", + }, + { + alpha2: "kw", + english: "Cornish", + }, + { + alpha2: "ky", + english: "Kirghiz; Kyrgyz", + }, + { + alpha2: "la", + english: "Latin", + }, + { + alpha2: "lb", + english: "Luxembourgish; Letzeburgesch", + }, + { + alpha2: "lg", + english: "Ganda", + }, + { + alpha2: "li", + english: "Limburgan; Limburger; Limburgish", + }, + { + alpha2: "ln", + english: "Lingala", + }, + { + alpha2: "lo", + english: "Lao", + }, + { + alpha2: "lt", + english: "Lithuanian", + }, + { + alpha2: "lu", + english: "Luba-Katanga", + }, + { + alpha2: "lv", + english: "Latvian", + }, + { + alpha2: "mg", + english: "Malagasy", + }, + { + alpha2: "mh", + english: "Marshallese", + }, + { + alpha2: "mi", + english: "Maori", + }, + { + alpha2: "mk", + english: "Macedonian", + }, + { + alpha2: "ml", + english: "Malayalam", + }, + { + alpha2: "mn", + english: "Mongolian", + }, + { + alpha2: "mr", + english: "Marathi", + }, + { + alpha2: "ms", + english: "Malay", + }, + { + alpha2: "mt", + english: "Maltese", + }, + { + alpha2: "my", + english: "Burmese", + }, + { + alpha2: "na", + english: "Nauru", + }, + { + alpha2: "nb", + english: "Bokmål, Norwegian; Norwegian Bokmål", + }, + { + alpha2: "nd", + english: "Ndebele, North; North Ndebele", + }, + { + alpha2: "ne", + english: "Nepali", + }, + { + alpha2: "ng", + english: "Ndonga", + }, + { + alpha2: "nl", + english: "Dutch; Flemish", + }, + { + alpha2: "nn", + english: "Norwegian Nynorsk; Nynorsk, Norwegian", + }, + { + alpha2: "no", + english: "Norwegian", + }, + { + alpha2: "nr", + english: "Ndebele, South; South Ndebele", + }, + { + alpha2: "nv", + english: "Navajo; Navaho", + }, + { + alpha2: "ny", + english: "Chichewa; Chewa; Nyanja", + }, + { + alpha2: "oc", + english: "Occitan (post 1500)", + }, + { + alpha2: "oj", + english: "Ojibwa", + }, + { + alpha2: "om", + english: "Oromo", + }, + { + alpha2: "or", + english: "Oriya", + }, + { + alpha2: "os", + english: "Ossetian; Ossetic", + }, + { + alpha2: "pa", + english: "Panjabi; Punjabi", + }, + { + alpha2: "pi", + english: "Pali", + }, + { + alpha2: "pl", + english: "Polish", + }, + { + alpha2: "ps", + english: "Pushto; Pashto", + }, + { + alpha2: "pt", + english: "Portuguese", + }, + { + alpha2: "qu", + english: "Quechua", + }, + { + alpha2: "rm", + english: "Romansh", + }, + { + alpha2: "rn", + english: "Rundi", + }, + { + alpha2: "ro", + english: "Romanian; Moldavian; Moldovan", + }, + { + alpha2: "ru", + english: "Russian", + }, + { + alpha2: "rw", + english: "Kinyarwanda", + }, + { + alpha2: "sa", + english: "Sanskrit", + }, + { + alpha2: "sc", + english: "Sardinian", + }, + { + alpha2: "sd", + english: "Sindhi", + }, + { + alpha2: "se", + english: "Northern Sami", + }, + { + alpha2: "sg", + english: "Sango", + }, + { + alpha2: "si", + english: "Sinhala; Sinhalese", + }, + { + alpha2: "sk", + english: "Slovak", + }, + { + alpha2: "sl", + english: "Slovenian", + }, + { + alpha2: "sm", + english: "Samoan", + }, + { + alpha2: "sn", + english: "Shona", + }, + { + alpha2: "so", + english: "Somali", + }, + { + alpha2: "sq", + english: "Albanian", + }, + { + alpha2: "sr", + english: "Serbian", + }, + { + alpha2: "ss", + english: "Swati", + }, + { + alpha2: "st", + english: "Sotho, Southern", + }, + { + alpha2: "su", + english: "Sundanese", + }, + { + alpha2: "sv", + english: "Swedish", + }, + { + alpha2: "sw", + english: "Swahili", + }, + { + alpha2: "ta", + english: "Tamil", + }, + { + alpha2: "te", + english: "Telugu", + }, + { + alpha2: "tg", + english: "Tajik", + }, + { + alpha2: "th", + english: "Thai", + }, + { + alpha2: "ti", + english: "Tigrinya", + }, + { + alpha2: "tk", + english: "Turkmen", + }, + { + alpha2: "tl", + english: "Tagalog", + }, + { + alpha2: "tn", + english: "Tswana", + }, + { + alpha2: "to", + english: "Tonga (Tonga Islands)", + }, + { + alpha2: "tr", + english: "Turkish", + }, + { + alpha2: "ts", + english: "Tsonga", + }, + { + alpha2: "tt", + english: "Tatar", + }, + { + alpha2: "tw", + english: "Twi", + }, + { + alpha2: "ty", + english: "Tahitian", + }, + { + alpha2: "ug", + english: "Uighur; Uyghur", + }, + { + alpha2: "uk", + english: "Ukrainian", + }, + { + alpha2: "ur", + english: "Urdu", + }, + { + alpha2: "uz", + english: "Uzbek", + }, + { + alpha2: "ve", + english: "Venda", + }, + { + alpha2: "vi", + english: "Vietnamese", + }, + { + alpha2: "vo", + english: "Volapük", + }, + { + alpha2: "wa", + english: "Walloon", + }, + { + alpha2: "wo", + english: "Wolof", + }, + { + alpha2: "xh", + english: "Xhosa", + }, + { + alpha2: "yi", + english: "Yiddish", + }, + { + alpha2: "yo", + english: "Yoruba", + }, + { + alpha2: "za", + english: "Zhuang; Chuang", + }, + { + alpha2: "zh", + english: "Chinese", + }, + { + alpha2: "zu", + english: "Zulu", + }, +]; + +export const iso639Identifiers = iso639Languages.map((language) => language.alpha2); + +export const getLanguageLabel = (languageCode: string) => { + const language = iso639Languages.find((lang) => lang.alpha2 === languageCode); + return `${language?.english}`; +}; diff --git a/packages/lib/instance/service.ts b/packages/lib/instance/service.ts index f413c8ac5e..92ff92b488 100644 --- a/packages/lib/instance/service.ts +++ b/packages/lib/instance/service.ts @@ -1,10 +1,7 @@ import "server-only"; - import { Prisma } from "@prisma/client"; - import { prisma } from "@formbricks/database"; import { DatabaseError } from "@formbricks/types/errors"; - import { cache } from "../cache"; import { organizationCache } from "../organization/cache"; import { userCache } from "../user/cache"; diff --git a/packages/lib/integration/auth.ts b/packages/lib/integration/auth.ts index cf22488957..5183113ead 100644 --- a/packages/lib/integration/auth.ts +++ b/packages/lib/integration/auth.ts @@ -1,7 +1,5 @@ import "server-only"; - import { ZId } from "@formbricks/types/environment"; - import { cache } from "../cache"; import { hasUserEnvironmentAccess } from "../environment/auth"; import { validateInputs } from "../utils/validate"; diff --git a/packages/lib/integration/service.ts b/packages/lib/integration/service.ts index 368db4a3ff..83c525f734 100644 --- a/packages/lib/integration/service.ts +++ b/packages/lib/integration/service.ts @@ -1,13 +1,10 @@ import "server-only"; - import { Prisma } from "@prisma/client"; - import { prisma } from "@formbricks/database"; import { ZOptionalNumber, ZString } from "@formbricks/types/common"; import { ZId } from "@formbricks/types/environment"; import { DatabaseError } from "@formbricks/types/errors"; import { TIntegration, TIntegrationInput, ZIntegrationType } from "@formbricks/types/integration"; - import { cache } from "../cache"; import { ITEMS_PER_PAGE } from "../constants"; import { validateInputs } from "../utils/validate"; diff --git a/packages/lib/invite/service.ts b/packages/lib/invite/service.ts index 4328863ca8..63b3978849 100644 --- a/packages/lib/invite/service.ts +++ b/packages/lib/invite/service.ts @@ -1,8 +1,6 @@ import "server-only"; - import { Prisma } from "@prisma/client"; import { getServerSession } from "next-auth"; - import { prisma } from "@formbricks/database"; import { ZOptionalNumber, ZString } from "@formbricks/types/common"; import { @@ -18,7 +16,6 @@ import { ZInviteUpdateInput, ZInvitee, } from "@formbricks/types/invites"; - import { authOptions } from "../authOptions"; import { cache } from "../cache"; import { ITEMS_PER_PAGE } from "../constants"; diff --git a/packages/lib/jwt.ts b/packages/lib/jwt.ts index be558dd6e1..4114b732e8 100644 --- a/packages/lib/jwt.ts +++ b/packages/lib/jwt.ts @@ -1,7 +1,5 @@ import jwt, { JwtPayload } from "jsonwebtoken"; - import { prisma } from "@formbricks/database"; - import { env } from "./env"; export const createToken = (userId: string, userEmail: string, options = {}): string => { diff --git a/packages/lib/language/service.ts b/packages/lib/language/service.ts index fbb5f7df7c..1d1554a6cf 100644 --- a/packages/lib/language/service.ts +++ b/packages/lib/language/service.ts @@ -1,5 +1,4 @@ import { Prisma } from "@prisma/client"; - import { prisma } from "@formbricks/database"; import { ZId } from "@formbricks/types/environment"; import { DatabaseError, ValidationError } from "@formbricks/types/errors"; @@ -10,7 +9,6 @@ import { ZLanguageInput, ZLanguageUpdate, } from "@formbricks/types/product"; - import { productCache } from "../product/cache"; import { surveyCache } from "../survey/cache"; import { validateInputs } from "../utils/validate"; diff --git a/packages/lib/language/tests/language.unit.ts b/packages/lib/language/tests/language.unit.ts index 65f3f3b877..998e6cb271 100644 --- a/packages/lib/language/tests/language.unit.ts +++ b/packages/lib/language/tests/language.unit.ts @@ -7,12 +7,9 @@ import { mockProductId, mockUpdatedLanguage, } from "./__mocks__/data.mock"; - import { Prisma } from "@prisma/client"; - import { prismaMock } from "@formbricks/database/src/jestClient"; import { DatabaseError, ValidationError } from "@formbricks/types/errors"; - import { createLanguage, deleteLanguage, updateLanguage } from "../service"; const testInputValidation = async (service: Function, ...args: any[]): Promise => { diff --git a/packages/lib/membership/hooks/actions.ts b/packages/lib/membership/hooks/actions.ts index 788f43a33b..720020d7de 100644 --- a/packages/lib/membership/hooks/actions.ts +++ b/packages/lib/membership/hooks/actions.ts @@ -1,12 +1,9 @@ "use server"; import "server-only"; - import { getServerSession } from "next-auth"; - import { AuthenticationError } from "@formbricks/types/errors"; import { TUser } from "@formbricks/types/user"; - import { authOptions } from "../../authOptions"; import { getOrganizationByEnvironmentId } from "../../organization/service"; import { getMembershipByUserIdOrganizationId } from "../service"; diff --git a/packages/lib/membership/hooks/useMembershipRole.tsx b/packages/lib/membership/hooks/useMembershipRole.tsx index 13c975c9de..4226dcc1d3 100644 --- a/packages/lib/membership/hooks/useMembershipRole.tsx +++ b/packages/lib/membership/hooks/useMembershipRole.tsx @@ -1,5 +1,4 @@ import { useEffect, useState } from "react"; - import { getMembershipByUserIdOrganizationIdAction } from "./actions"; enum MembershipRole { diff --git a/packages/lib/membership/service.ts b/packages/lib/membership/service.ts index e43267867c..3553474e63 100644 --- a/packages/lib/membership/service.ts +++ b/packages/lib/membership/service.ts @@ -1,7 +1,5 @@ import "server-only"; - import { Prisma } from "@prisma/client"; - import { prisma } from "@formbricks/database"; import { ZOptionalNumber, ZString } from "@formbricks/types/common"; import { DatabaseError, ResourceNotFoundError, UnknownError } from "@formbricks/types/errors"; @@ -12,7 +10,6 @@ import { ZMembership, ZMembershipUpdateInput, } from "@formbricks/types/memberships"; - import { cache } from "../cache"; import { ITEMS_PER_PAGE } from "../constants"; import { organizationCache } from "../organization/cache"; diff --git a/packages/lib/notion/service.ts b/packages/lib/notion/service.ts index 0df294f088..76c03467ae 100644 --- a/packages/lib/notion/service.ts +++ b/packages/lib/notion/service.ts @@ -3,7 +3,6 @@ import { TIntegrationNotionConfig, TIntegrationNotionDatabase, } from "@formbricks/types/integration/notion"; - import { ENCRYPTION_KEY } from "../constants"; import { symmetricDecrypt } from "../crypto"; import { getIntegrationByType } from "../integration/service"; diff --git a/packages/lib/organization/auth.ts b/packages/lib/organization/auth.ts index b29cf12c6a..da227de64a 100644 --- a/packages/lib/organization/auth.ts +++ b/packages/lib/organization/auth.ts @@ -1,7 +1,5 @@ import "server-only"; - import { ZId } from "@formbricks/types/environment"; - import { cache } from "../cache"; import { getMembershipByUserIdOrganizationId } from "../membership/service"; import { getAccessFlags } from "../membership/utils"; diff --git a/packages/lib/organization/hooks/actions.ts b/packages/lib/organization/hooks/actions.ts index aed4ffe451..6dd8e8305c 100644 --- a/packages/lib/organization/hooks/actions.ts +++ b/packages/lib/organization/hooks/actions.ts @@ -1,11 +1,8 @@ "use server"; import "server-only"; - import { getServerSession } from "next-auth"; - import { AuthenticationError, ResourceNotFoundError } from "@formbricks/types/errors"; - import { authOptions } from "../../authOptions"; import { getOrganization, getOrganizationBillingInfo } from "../service"; diff --git a/packages/lib/organization/hooks/useGetBillingInfo.ts b/packages/lib/organization/hooks/useGetBillingInfo.ts index 160b70b9aa..c7af7766c8 100644 --- a/packages/lib/organization/hooks/useGetBillingInfo.ts +++ b/packages/lib/organization/hooks/useGetBillingInfo.ts @@ -1,7 +1,5 @@ import { useEffect, useState } from "react"; - import { TOrganizationBilling } from "@formbricks/types/organizations"; - import { getOrganizationBillingInfoAction } from "./actions"; export const useGetBillingInfo = (organizationId: string) => { diff --git a/packages/lib/organization/service.ts b/packages/lib/organization/service.ts index 6fe56b588b..a8332b1584 100644 --- a/packages/lib/organization/service.ts +++ b/packages/lib/organization/service.ts @@ -1,7 +1,5 @@ import "server-only"; - import { Prisma } from "@prisma/client"; - import { prisma } from "@formbricks/database"; import { ZOptionalNumber, ZString } from "@formbricks/types/common"; import { ZId } from "@formbricks/types/environment"; @@ -14,7 +12,6 @@ import { ZOrganizationCreateInput, } from "@formbricks/types/organizations"; import { TUserNotificationSettings } from "@formbricks/types/user"; - import { cache } from "../cache"; import { ITEMS_PER_PAGE } from "../constants"; import { environmentCache } from "../environment/cache"; diff --git a/packages/lib/person/auth.ts b/packages/lib/person/auth.ts index 15da9f2b42..eee3de32b6 100644 --- a/packages/lib/person/auth.ts +++ b/packages/lib/person/auth.ts @@ -1,7 +1,5 @@ import "server-only"; - import { ZId } from "@formbricks/types/environment"; - import { cache } from "../cache"; import { hasUserEnvironmentAccess } from "../environment/auth"; import { validateInputs } from "../utils/validate"; diff --git a/packages/lib/person/service.ts b/packages/lib/person/service.ts index da53c8499b..5d386cb531 100644 --- a/packages/lib/person/service.ts +++ b/packages/lib/person/service.ts @@ -1,13 +1,10 @@ import "server-only"; - import { Prisma } from "@prisma/client"; - import { prisma } from "@formbricks/database"; import { ZOptionalNumber, ZString } from "@formbricks/types/common"; import { ZId } from "@formbricks/types/environment"; import { DatabaseError } from "@formbricks/types/errors"; import { TPerson } from "@formbricks/types/people"; - import { cache } from "../cache"; import { ITEMS_PER_PAGE } from "../constants"; import { validateInputs } from "../utils/validate"; diff --git a/packages/lib/posthogServer.ts b/packages/lib/posthogServer.ts index 06887524ab..6ad14c772e 100644 --- a/packages/lib/posthogServer.ts +++ b/packages/lib/posthogServer.ts @@ -1,5 +1,4 @@ import { PostHog } from "posthog-node"; - import { env } from "./env"; const enabled = diff --git a/packages/lib/product/auth.ts b/packages/lib/product/auth.ts index 091fe6c721..ab9926f4f1 100644 --- a/packages/lib/product/auth.ts +++ b/packages/lib/product/auth.ts @@ -1,5 +1,4 @@ import { ZId } from "@formbricks/types/environment"; - import { cache } from "../cache"; import { getMembershipByUserIdOrganizationId } from "../membership/service"; import { getAccessFlags } from "../membership/utils"; diff --git a/packages/lib/product/service.ts b/packages/lib/product/service.ts index 9cbf8a6840..787fab9b70 100644 --- a/packages/lib/product/service.ts +++ b/packages/lib/product/service.ts @@ -1,15 +1,12 @@ import "server-only"; - import { Prisma } from "@prisma/client"; import { z } from "zod"; - import { prisma } from "@formbricks/database"; import { ZOptionalNumber, ZString } from "@formbricks/types/common"; import { ZId } from "@formbricks/types/environment"; import { DatabaseError, ValidationError } from "@formbricks/types/errors"; import type { TProduct, TProductUpdateInput } from "@formbricks/types/product"; import { ZProduct, ZProductUpdateInput } from "@formbricks/types/product"; - import { cache } from "../cache"; import { ITEMS_PER_PAGE, isS3Configured } from "../constants"; import { environmentCache } from "../environment/cache"; diff --git a/packages/lib/response/auth.ts b/packages/lib/response/auth.ts index 359ef02d93..a5f7122f0e 100644 --- a/packages/lib/response/auth.ts +++ b/packages/lib/response/auth.ts @@ -1,7 +1,5 @@ import "server-only"; - import { ZId } from "@formbricks/types/environment"; - import { cache } from "../cache"; import { hasUserEnvironmentAccess } from "../environment/auth"; import { getSurvey } from "../survey/service"; diff --git a/packages/lib/response/service.ts b/packages/lib/response/service.ts index 5e25de8814..a87fdd34b3 100644 --- a/packages/lib/response/service.ts +++ b/packages/lib/response/service.ts @@ -1,7 +1,5 @@ import "server-only"; - import { Prisma } from "@prisma/client"; - import { prisma } from "@formbricks/database"; import { TAttributes } from "@formbricks/types/attributes"; import { ZOptionalNumber, ZString } from "@formbricks/types/common"; @@ -21,7 +19,6 @@ import { } from "@formbricks/types/responses"; import { TSurveySummary } from "@formbricks/types/surveys"; import { TTag } from "@formbricks/types/tags"; - import { getAttributes } from "../attribute/service"; import { cache } from "../cache"; import { ITEMS_PER_PAGE, WEBAPP_URL } from "../constants"; diff --git a/packages/lib/response/tests/response.test.ts b/packages/lib/response/tests/response.test.ts index ad550706b7..6389bb5d1a 100644 --- a/packages/lib/response/tests/response.test.ts +++ b/packages/lib/response/tests/response.test.ts @@ -17,11 +17,9 @@ import { mockTags, mockUserId, } from "./__mocks__/data.mock"; - import { Prisma } from "@prisma/client"; import { beforeEach, describe, expect, it } from "vitest"; import { testInputValidation } from "vitestSetup"; - import { DatabaseError, ResourceNotFoundError } from "@formbricks/types/errors"; import { TResponse, @@ -30,7 +28,6 @@ import { TResponseLegacyInput, } from "@formbricks/types/responses"; import { TTag } from "@formbricks/types/tags"; - import { selectPerson } from "../../person/service"; import { mockAttributeClass, mockSurveyOutput } from "../../survey/tests/__mock__/survey.mock"; import { diff --git a/packages/lib/responseNote/auth.ts b/packages/lib/responseNote/auth.ts index 60d937e695..7ad756aa5e 100644 --- a/packages/lib/responseNote/auth.ts +++ b/packages/lib/responseNote/auth.ts @@ -1,5 +1,4 @@ import { ZId } from "@formbricks/types/environment"; - import { cache } from "../cache"; import { canUserAccessResponse } from "../response/auth"; import { getResponse } from "../response/service"; diff --git a/packages/lib/responseNote/service.ts b/packages/lib/responseNote/service.ts index cf14bdcb90..8e9429fffc 100644 --- a/packages/lib/responseNote/service.ts +++ b/packages/lib/responseNote/service.ts @@ -1,13 +1,10 @@ import "server-only"; - import { Prisma } from "@prisma/client"; - import { prisma } from "@formbricks/database"; import { ZString } from "@formbricks/types/common"; import { ZId } from "@formbricks/types/environment"; import { DatabaseError, ResourceNotFoundError } from "@formbricks/types/errors"; import { TResponseNote } from "@formbricks/types/responses"; - import { cache } from "../cache"; import { responseCache } from "../response/cache"; import { validateInputs } from "../utils/validate"; diff --git a/packages/lib/responseQueue.ts b/packages/lib/responseQueue.ts index 08550572ed..21c2df8465 100644 --- a/packages/lib/responseQueue.ts +++ b/packages/lib/responseQueue.ts @@ -1,6 +1,5 @@ import { FormbricksAPI } from "@formbricks/api"; import { TResponseUpdate } from "@formbricks/types/responses"; - import { SurveyState } from "./surveyState"; import { delay } from "./utils/promises"; diff --git a/packages/lib/responses.ts b/packages/lib/responses.ts index 135aebc78f..f1525fe4ab 100644 --- a/packages/lib/responses.ts +++ b/packages/lib/responses.ts @@ -1,6 +1,5 @@ import { TResponse } from "@formbricks/types/responses"; import { TSurvey, TSurveyQuestion, TSurveyQuestionType } from "@formbricks/types/surveys"; - import { getLocalizedValue } from "./i18n/utils"; import { parseRecallInfo } from "./utils/recall"; diff --git a/packages/lib/segment/tests/segment.test.ts b/packages/lib/segment/tests/segment.test.ts index fedbe8a606..b3d34f839f 100644 --- a/packages/lib/segment/tests/segment.test.ts +++ b/packages/lib/segment/tests/segment.test.ts @@ -10,13 +10,10 @@ import { mockSegmentUpdateInput, mockSurveyId, } from "./__mocks__/segment.mock"; - import { Prisma } from "@prisma/client"; import { beforeEach, describe, expect, it } from "vitest"; import { testInputValidation } from "vitestSetup"; - import { DatabaseError, ResourceNotFoundError } from "@formbricks/types/errors"; - import { cloneSegment, createSegment, diff --git a/packages/lib/segment/utils.ts b/packages/lib/segment/utils.ts index 47a94a537b..ee10015fd5 100644 --- a/packages/lib/segment/utils.ts +++ b/packages/lib/segment/utils.ts @@ -1,5 +1,4 @@ import { createId } from "@paralleldrive/cuid2"; - import { TActionMetric, TAllOperators, diff --git a/packages/lib/shortUrl/service.ts b/packages/lib/shortUrl/service.ts index bc19126d15..10c0b3738e 100644 --- a/packages/lib/shortUrl/service.ts +++ b/packages/lib/shortUrl/service.ts @@ -1,11 +1,9 @@ import { Prisma } from "@prisma/client"; import { customAlphabet } from "nanoid"; import z from "zod"; - import { prisma } from "@formbricks/database"; import { DatabaseError } from "@formbricks/types/errors"; import { TShortUrl, ZShortUrlId } from "@formbricks/types/shortUrl"; - import { validateInputs } from "../utils/validate"; // Create the short url and return it diff --git a/packages/lib/slack/service.ts b/packages/lib/slack/service.ts index aff1f5598e..5adbef16dd 100644 --- a/packages/lib/slack/service.ts +++ b/packages/lib/slack/service.ts @@ -1,9 +1,7 @@ import { Prisma } from "@prisma/client"; - import { DatabaseError } from "@formbricks/types/errors"; import { TIntegration, TIntegrationItem } from "@formbricks/types/integration"; import { TIntegrationSlack, TIntegrationSlackCredential } from "@formbricks/types/integration/slack"; - import { deleteIntegration, getIntegrationByType } from "../integration/service"; export const fetchChannels = async (slackIntegration: TIntegration): Promise => { diff --git a/packages/lib/storage/service.ts b/packages/lib/storage/service.ts index 1ae386bfb9..01eb4bd68b 100644 --- a/packages/lib/storage/service.ts +++ b/packages/lib/storage/service.ts @@ -13,9 +13,7 @@ import { randomUUID } from "crypto"; import { access, mkdir, readFile, rmdir, unlink, writeFile } from "fs/promises"; import { lookup } from "mime-types"; import path, { join } from "path"; - import { TAccessType } from "@formbricks/types/storage"; - import { MAX_SIZES, S3_ACCESS_KEY, diff --git a/packages/lib/styling/constants.ts b/packages/lib/styling/constants.ts index 47c22e2443..7ae6b188f1 100644 --- a/packages/lib/styling/constants.ts +++ b/packages/lib/styling/constants.ts @@ -132,4 +132,5 @@ export const PREVIEW_SURVEY = { resultShareKey: null, languages: [], triggers: [], + showLanguageSwitch: false, } as TSurvey; diff --git a/packages/lib/survey/auth.ts b/packages/lib/survey/auth.ts index 964efb0e5d..951da37ea3 100644 --- a/packages/lib/survey/auth.ts +++ b/packages/lib/survey/auth.ts @@ -1,5 +1,4 @@ import { ZId } from "@formbricks/types/environment"; - import { cache } from "../cache"; import { hasUserEnvironmentAccess } from "../environment/auth"; import { getMembershipByUserIdOrganizationId } from "../membership/service"; diff --git a/packages/lib/survey/service.ts b/packages/lib/survey/service.ts index fc3ea76c17..6ab0a82a98 100644 --- a/packages/lib/survey/service.ts +++ b/packages/lib/survey/service.ts @@ -1,7 +1,5 @@ import "server-only"; - import { Prisma } from "@prisma/client"; - import { prisma } from "@formbricks/database"; import { TLegacySurvey } from "@formbricks/types/LegacySurvey"; import { TActionClass } from "@formbricks/types/actionClasses"; @@ -11,7 +9,6 @@ import { DatabaseError, InvalidInputError, ResourceNotFoundError } from "@formbr import { TPerson } from "@formbricks/types/people"; import { TSegment, ZSegmentFilters } from "@formbricks/types/segment"; import { TSurvey, TSurveyFilterCriteria, TSurveyInput, ZSurvey } from "@formbricks/types/surveys"; - import { getActionsByPersonId } from "../action/service"; import { getActionClasses } from "../actionClass/service"; import { attributeCache } from "../attribute/cache"; @@ -75,6 +72,7 @@ export const selectSurvey = { singleUse: true, pin: true, resultShareKey: true, + showLanguageSwitch: true, languages: { select: { default: true, diff --git a/packages/lib/survey/tests/__mock__/survey.mock.ts b/packages/lib/survey/tests/__mock__/survey.mock.ts index 51560a5642..e91b8d2e25 100644 --- a/packages/lib/survey/tests/__mock__/survey.mock.ts +++ b/packages/lib/survey/tests/__mock__/survey.mock.ts @@ -272,6 +272,7 @@ export const updateSurveyInput: TSurvey = { resultShareKey: null, segment: null, languages: [], + showLanguageSwitch: null, ...commonMockProperties, ...baseSurveyProperties, }; diff --git a/packages/lib/survey/tests/survey.test.ts b/packages/lib/survey/tests/survey.test.ts index d744a3d9d8..703b3f8e67 100644 --- a/packages/lib/survey/tests/survey.test.ts +++ b/packages/lib/survey/tests/survey.test.ts @@ -1,11 +1,8 @@ import { prisma } from "../../__mocks__/database"; - import { Prisma } from "@prisma/client"; import { beforeEach, describe, expect, it } from "vitest"; import { testInputValidation } from "vitestSetup"; - import { DatabaseError, ResourceNotFoundError } from "@formbricks/types/errors"; - import { createSurvey, deleteSurvey, diff --git a/packages/lib/survey/utils.ts b/packages/lib/survey/utils.ts index 419c3d7a90..0a3bdc2430 100644 --- a/packages/lib/survey/utils.ts +++ b/packages/lib/survey/utils.ts @@ -1,7 +1,5 @@ import "server-only"; - import { Prisma } from "@prisma/client"; - import { TLegacySurvey } from "@formbricks/types/LegacySurvey"; import { TSegment } from "@formbricks/types/segment"; import { TSurvey, TSurveyFilterCriteria } from "@formbricks/types/surveys"; diff --git a/packages/lib/tag/auth.ts b/packages/lib/tag/auth.ts index a396910f87..f2b9b06d9e 100644 --- a/packages/lib/tag/auth.ts +++ b/packages/lib/tag/auth.ts @@ -1,7 +1,5 @@ import "server-only"; - import { ZId } from "@formbricks/types/environment"; - import { hasUserEnvironmentAccess } from "../environment/auth"; import { getMembershipByUserIdOrganizationId } from "../membership/service"; import { getAccessFlags } from "../membership/utils"; diff --git a/packages/lib/tag/service.ts b/packages/lib/tag/service.ts index 6feb991c28..9893e6fccd 100644 --- a/packages/lib/tag/service.ts +++ b/packages/lib/tag/service.ts @@ -1,10 +1,8 @@ import "server-only"; - import { prisma } from "@formbricks/database"; import { ZOptionalNumber, ZString } from "@formbricks/types/common"; import { ZId } from "@formbricks/types/environment"; import { TTag } from "@formbricks/types/tags"; - import { ITEMS_PER_PAGE } from "../constants"; import { validateInputs } from "../utils/validate"; diff --git a/packages/lib/tagOnResponse/auth.ts b/packages/lib/tagOnResponse/auth.ts index 13fc410661..67e8cb3cf7 100644 --- a/packages/lib/tagOnResponse/auth.ts +++ b/packages/lib/tagOnResponse/auth.ts @@ -1,7 +1,5 @@ import "server-only"; - import { ZId } from "@formbricks/types/environment"; - import { cache } from "../cache"; import { getMembershipByUserIdOrganizationId } from "../membership/service"; import { getAccessFlags } from "../membership/utils"; diff --git a/packages/lib/tagOnResponse/service.ts b/packages/lib/tagOnResponse/service.ts index 49c4f00928..e116765b0c 100644 --- a/packages/lib/tagOnResponse/service.ts +++ b/packages/lib/tagOnResponse/service.ts @@ -1,12 +1,9 @@ import "server-only"; - import { Prisma } from "@prisma/client"; - import { prisma } from "@formbricks/database"; import { ZId } from "@formbricks/types/environment"; import { DatabaseError } from "@formbricks/types/errors"; import { TTagsCount, TTagsOnResponses } from "@formbricks/types/tags"; - import { cache } from "../cache"; import { responseCache } from "../response/cache"; import { getResponse } from "../response/service"; diff --git a/packages/lib/user/service.ts b/packages/lib/user/service.ts index 2ea1bcef04..3c4964081e 100644 --- a/packages/lib/user/service.ts +++ b/packages/lib/user/service.ts @@ -1,14 +1,11 @@ import "server-only"; - import { Prisma } from "@prisma/client"; import { z } from "zod"; - import { prisma } from "@formbricks/database"; import { ZId } from "@formbricks/types/environment"; import { DatabaseError, ResourceNotFoundError } from "@formbricks/types/errors"; import { TMembership } from "@formbricks/types/memberships"; import { TUser, TUserCreateInput, TUserUpdateInput, ZUserUpdateInput } from "@formbricks/types/user"; - import { cache } from "../cache"; import { createCustomerIoCustomer } from "../customerio"; import { deleteMembership, updateMembership } from "../membership/service"; diff --git a/packages/lib/utils/recall.ts b/packages/lib/utils/recall.ts index fc31fdaaef..e7553225a5 100644 --- a/packages/lib/utils/recall.ts +++ b/packages/lib/utils/recall.ts @@ -8,7 +8,6 @@ import { TSurveyQuestionsObject, TSurveyRecallItem, } from "@formbricks/types/surveys"; - import { getLocalizedValue } from "../i18n/utils"; import { structuredClone } from "../pollyfills/structuredClone"; import { formatDateWithOrdinal, isValidDateString } from "./datetime"; diff --git a/packages/lib/utils/singleUseSurveys.ts b/packages/lib/utils/singleUseSurveys.ts index 0a95769992..f6d75d0387 100644 --- a/packages/lib/utils/singleUseSurveys.ts +++ b/packages/lib/utils/singleUseSurveys.ts @@ -1,5 +1,4 @@ import cuid2 from "@paralleldrive/cuid2"; - import { decryptAES128, symmetricDecrypt, symmetricEncrypt } from "../../lib/crypto"; import { env } from "../../lib/env"; diff --git a/packages/lib/utils/validate.ts b/packages/lib/utils/validate.ts index 2341950704..f9ca6f7500 100644 --- a/packages/lib/utils/validate.ts +++ b/packages/lib/utils/validate.ts @@ -1,5 +1,4 @@ import z from "zod"; - import { ValidationError } from "@formbricks/types/errors"; type ValidationPair = [any, z.ZodSchema]; diff --git a/packages/lib/vitestSetup.ts b/packages/lib/vitestSetup.ts index 5519de5111..4820c5cc99 100644 --- a/packages/lib/vitestSetup.ts +++ b/packages/lib/vitestSetup.ts @@ -1,6 +1,5 @@ // mock these globally used functions import { afterEach, beforeEach, expect, it, vi } from "vitest"; - import { ValidationError } from "@formbricks/types/errors"; vi.mock("next/cache", () => ({ diff --git a/packages/lib/webhook/auth.ts b/packages/lib/webhook/auth.ts index 38f70290d7..f3b4626118 100644 --- a/packages/lib/webhook/auth.ts +++ b/packages/lib/webhook/auth.ts @@ -1,5 +1,4 @@ import { ZId } from "@formbricks/types/environment"; - import { cache } from "../cache"; import { hasUserEnvironmentAccess } from "../environment/auth"; import { validateInputs } from "../utils/validate"; diff --git a/packages/lib/webhook/cache.ts b/packages/lib/webhook/cache.ts index bdd2f572e7..f3c07fe576 100644 --- a/packages/lib/webhook/cache.ts +++ b/packages/lib/webhook/cache.ts @@ -1,5 +1,4 @@ import { revalidateTag } from "next/cache"; - import { TWebhookInput } from "@formbricks/types/webhooks"; interface RevalidateProps { diff --git a/packages/lib/webhook/service.ts b/packages/lib/webhook/service.ts index cb533011b4..156d0ecd48 100644 --- a/packages/lib/webhook/service.ts +++ b/packages/lib/webhook/service.ts @@ -1,13 +1,10 @@ import "server-only"; - import { Prisma } from "@prisma/client"; - import { prisma } from "@formbricks/database"; import { ZOptionalNumber } from "@formbricks/types/common"; import { ZId } from "@formbricks/types/environment"; import { DatabaseError, InvalidInputError, ResourceNotFoundError } from "@formbricks/types/errors"; import { TWebhook, TWebhookInput, ZWebhookInput } from "@formbricks/types/webhooks"; - import { cache } from "../cache"; import { ITEMS_PER_PAGE } from "../constants"; import { validateInputs } from "../utils/validate"; diff --git a/packages/surveys/src/components/general/CalEmbed.tsx b/packages/surveys/src/components/general/CalEmbed.tsx index 7803fdce64..9dde053f47 100644 --- a/packages/surveys/src/components/general/CalEmbed.tsx +++ b/packages/surveys/src/components/general/CalEmbed.tsx @@ -1,7 +1,6 @@ import { cn } from "@/lib/utils"; import snippet from "@calcom/embed-snippet"; import { useEffect, useMemo } from "preact/hooks"; - import { TSurveyCalQuestion } from "@formbricks/types/surveys"; interface CalEmbedProps { diff --git a/packages/surveys/src/components/general/FileInput.tsx b/packages/surveys/src/components/general/FileInput.tsx index 58e272ea58..468751ccd8 100644 --- a/packages/surveys/src/components/general/FileInput.tsx +++ b/packages/surveys/src/components/general/FileInput.tsx @@ -1,6 +1,5 @@ import { useMemo, useState } from "preact/hooks"; import { JSXInternal } from "preact/src/jsx"; - import { getOriginalFileNameFromUrl } from "@formbricks/lib/storage/utils"; import { TAllowedFileExtension } from "@formbricks/types/common"; import { TUploadFileConfig } from "@formbricks/types/storage"; diff --git a/packages/surveys/src/components/general/GlobeIcon.tsx b/packages/surveys/src/components/general/GlobeIcon.tsx new file mode 100644 index 0000000000..23d4291e4f --- /dev/null +++ b/packages/surveys/src/components/general/GlobeIcon.tsx @@ -0,0 +1,22 @@ +interface GlobeIconProps { + className?: string; +} + +export const GlobeIcon = ({ className }: GlobeIconProps) => { + return ( + + + + + + ); +}; diff --git a/packages/surveys/src/components/general/LanguageSwitch.tsx b/packages/surveys/src/components/general/LanguageSwitch.tsx new file mode 100644 index 0000000000..0e3eed60db --- /dev/null +++ b/packages/surveys/src/components/general/LanguageSwitch.tsx @@ -0,0 +1,71 @@ +import { GlobeIcon } from "@/components/general/GlobeIcon"; +import { useRef, useState } from "react"; +import { getLanguageLabel } from "@formbricks/lib/i18n/utils"; +import { useClickOutside } from "@formbricks/lib/utils/hooks/useClickOutside"; +import { TSurveyLanguage } from "@formbricks/types/surveys"; + +interface LanguageSwitchProps { + surveyLanguages: TSurveyLanguage[]; + setSelectedLanguageCode: (languageCode: string) => void; + setFirstRender?: (firstRender: boolean) => void; +} +export const LanguageSwitch = ({ + surveyLanguages, + setSelectedLanguageCode, + setFirstRender, +}: LanguageSwitchProps) => { + const [showLanguageDropdown, setShowLanguageDropdown] = useState(false); + const toggleDropdown = () => setShowLanguageDropdown((prev) => !prev); + const languageDropdownRef = useRef(null); + const defaultLanguageCode = surveyLanguages.find((surveyLanguage) => { + return surveyLanguage.default === true; + })?.language.code; + + const changeLanguage = (languageCode: string) => { + if (languageCode === defaultLanguageCode) { + setSelectedLanguageCode("default"); + } else { + setSelectedLanguageCode(languageCode); + } + if (setFirstRender) { + //for lexical editor + setFirstRender(true); + } + setShowLanguageDropdown(false); + }; + + useClickOutside(languageDropdownRef, () => setShowLanguageDropdown(false)); + + return ( +
+ + {showLanguageDropdown && ( +
+ {surveyLanguages.map((surveyLanguage) => { + if (!surveyLanguage.enabled) return; + return ( + + ); + })} +
+ )} +
+ ); +}; diff --git a/packages/surveys/src/components/general/ProgressBar.tsx b/packages/surveys/src/components/general/ProgressBar.tsx index 47e1afae00..c6fae01c48 100644 --- a/packages/surveys/src/components/general/ProgressBar.tsx +++ b/packages/surveys/src/components/general/ProgressBar.tsx @@ -1,8 +1,6 @@ import { calculateElementIdx } from "@/lib/utils"; import { useCallback, useMemo } from "preact/hooks"; - import { TSurvey } from "@formbricks/types/surveys"; - import { Progress } from "./Progress"; interface ProgressBarProps { diff --git a/packages/surveys/src/components/general/ResponseErrorComponent.tsx b/packages/surveys/src/components/general/ResponseErrorComponent.tsx index 7c51a15d3a..551f60bdc7 100644 --- a/packages/surveys/src/components/general/ResponseErrorComponent.tsx +++ b/packages/surveys/src/components/general/ResponseErrorComponent.tsx @@ -1,5 +1,4 @@ import { SubmitButton } from "@/components/buttons/SubmitButton"; - import { processResponseData } from "@formbricks/lib/responses"; import { type TResponseData } from "@formbricks/types/responses"; import { type TSurveyQuestion } from "@formbricks/types/surveys"; diff --git a/packages/surveys/src/components/general/Survey.tsx b/packages/surveys/src/components/general/Survey.tsx index 4d47822d73..929e590aad 100644 --- a/packages/surveys/src/components/general/Survey.tsx +++ b/packages/surveys/src/components/general/Survey.tsx @@ -1,4 +1,5 @@ import { FormbricksBranding } from "@/components/general/FormbricksBranding"; +import { LanguageSwitch } from "@/components/general/LanguageSwitch"; import { ProgressBar } from "@/components/general/ProgressBar"; import { QuestionConditional } from "@/components/general/QuestionConditional"; import { ResponseErrorComponent } from "@/components/general/ResponseErrorComponent"; @@ -55,7 +56,7 @@ export const Survey = ({ const [isResponseSendingFinished, setIsResponseSendingFinished] = useState( getSetIsResponseSendingFinished ? false : true ); - + const [selectedLanguage, setselectedLanguage] = useState(languageCode); const [loadingElement, setLoadingElement] = useState(false); const [history, setHistory] = useState([]); const [responseData, setResponseData] = useState(hiddenFieldsRecord ?? {}); @@ -83,6 +84,9 @@ export const Survey = ({ const getShowSurveyCloseButton = (offset: number) => { return offset === 0 && survey.type !== "link" && (clickOutside === undefined ? true : clickOutside); }; + const getShowLanguageSwitch = (offset: number) => { + return survey.showLanguageSwitch && survey.languages.length > 0 && offset <= 0; + }; useEffect(() => { // scroll to top when question changes @@ -122,6 +126,10 @@ export const Survey = ({ } }, [getSetIsResponseSendingFinished]); + useEffect(() => { + setselectedLanguage(languageCode); + }, [languageCode]); + let currIdxTemp = currentQuestionIndex; let currQuesTemp = currentQuestion; @@ -147,7 +155,7 @@ export const Survey = ({ if (typeof responseValue === "string") { // Find the choice in currentQuestion.choices that matches the responseValue after localization choice = currentQuestion.choices.find((choice) => { - return getLocalizedValue(choice.label, languageCode) === responseValue; + return getLocalizedValue(choice.label, selectedLanguage) === responseValue; })?.label; // If a matching choice is found, get its default localized value @@ -161,7 +169,7 @@ export const Survey = ({ // Filter and map the choices in currentQuestion.choices that are included in responseValue after localization choice = currentQuestion.choices .filter((choice) => { - return responseValue.includes(getLocalizedValue(choice.label, languageCode)); + return responseValue.includes(getLocalizedValue(choice.label, selectedLanguage)); }) .map((choice) => getLocalizedValue(choice.label, "default")); } @@ -199,7 +207,7 @@ export const Survey = ({ const nextQuestionId = getNextQuestionId(responseData); const finished = nextQuestionId === "end"; onChange(responseData); - onResponse({ data: responseData, ttc, finished }); + onResponse({ data: responseData, ttc, finished, language: selectedLanguage }); if (finished) { // Post a message to the parent window indicating that the survey is completed. window.parent.postMessage("formbricksSurveyCompleted", "*"); @@ -250,7 +258,7 @@ export const Survey = ({ buttonLabel={survey.welcomeCard.buttonLabel} onSubmit={onSubmit} survey={survey} - languageCode={languageCode} + languageCode={selectedLanguage} responseCount={responseCount} isInIframe={isInIframe} replaceRecallInfo={replaceRecallInfo} @@ -260,15 +268,15 @@ export const Survey = ({ return ( @@ -306,13 +314,21 @@ export const Survey = ({ return ( - {getShowSurveyCloseButton(offset) && }
+
+ {getShowLanguageSwitch(offset) && ( + + )} + {getShowSurveyCloseButton(offset) && } +
@@ -328,15 +344,17 @@ export const Survey = ({ }; return ( - + <> + + ); }; diff --git a/packages/surveys/src/components/general/SurveyCloseButton.tsx b/packages/surveys/src/components/general/SurveyCloseButton.tsx index d608240697..1af95278a9 100644 --- a/packages/surveys/src/components/general/SurveyCloseButton.tsx +++ b/packages/surveys/src/components/general/SurveyCloseButton.tsx @@ -4,16 +4,16 @@ interface SurveyCloseButtonProps { export const SurveyCloseButton = ({ onClose }: SurveyCloseButtonProps) => { return ( -
+