From b8efc442e39d0204cee52a38983ec954a105996d Mon Sep 17 00:00:00 2001 From: Anshuman Pandey <54475686+pandeymangg@users.noreply.github.com> Date: Wed, 26 Jun 2024 15:35:01 +0530 Subject: [PATCH] fix: e2e tests (#2806) Co-authored-by: Matti Nannt --- .github/workflows/e2e.yml | 58 +- apps/demo/pages/app/index.tsx | 8 +- apps/docs/components/SideNavigation.tsx | 2 +- .../components/InviteOrganizationMember.tsx | 2 +- .../edit/components/AddQuestionButton.tsx | 4 +- .../edit/components/BackgroundStylingCard.tsx | 4 +- .../edit/components/CreateNewActionTab.tsx | 1 + .../edit/components/EditThankYouCard.tsx | 2 +- .../edit/components/EditWelcomeCard.tsx | 2 +- .../edit/components/HiddenFieldsCard.tsx | 2 +- .../QuestionsStylingSettingsTabs.tsx | 2 +- .../edit/components/ResponseOptionsCard.tsx | 10 +- .../edit/components/SurveyMenuBar.tsx | 10 +- .../edit/components/WhenToSendCard.tsx | 2 +- .../components/TemplateContainer.tsx | 2 +- .../components/AttributeActivityTab.tsx | 10 +- .../components/AttributeSettingsTab.tsx | 2 +- .../components/AttributeTableHeading.tsx | 2 +- .../(people)/attributes/loading.tsx | 4 +- .../components/ActivityItemComponents.tsx | 4 +- .../(people)/people/[personId]/loading.tsx | 8 +- .../(people)/people/[personId]/page.tsx | 2 +- .../(people)/people/components/PersonCard.tsx | 2 +- .../[environmentId]/(people)/people/page.tsx | 2 +- .../components/SegmentActivityTab.tsx | 4 +- .../actions/components/ActionActivityTab.tsx | 10 +- .../actions/components/ActionTableHeading.tsx | 2 +- .../[environmentId]/actions/loading.tsx | 2 +- .../components/MainNavigation.tsx | 2 +- .../components/NavbarLoading.tsx | 16 +- .../components/UrlShortenerForm.tsx | 6 +- .../airtable/components/ManageIntegration.tsx | 2 +- .../components/ManageIntegration.tsx | 2 +- .../integrations/google-sheets/loading.tsx | 4 +- .../integrations/notion/loading.tsx | 2 +- .../components/WebhookOverviewTab.tsx | 6 +- .../components/WebhookTableHeading.tsx | 4 +- .../(setup)/app-connection/loading.tsx | 10 +- .../(setup)/website-connection/loading.tsx | 10 +- .../api-keys/components/EditApiKeys.tsx | 2 +- .../product/api-keys/loading.tsx | 14 +- .../product/general/loading.tsx | 6 +- .../[environmentId]/product/look/loading.tsx | 4 +- .../(account)/notifications/loading.tsx | 4 +- .../settings/(account)/profile/loading.tsx | 4 +- .../(organization)/billing/loading.tsx | 6 +- .../(organization)/enterprise/loading.tsx | 6 +- .../(organization)/enterprise/page.tsx | 4 +- .../members/components/BulkInviteTab.tsx | 4 +- .../EditMemberships/MembersInfo.tsx | 2 +- .../EditMemberships/OrganizationActions.tsx | 1 - .../components/IndividualInviteTab.tsx | 15 +- .../(organization)/members/loading.tsx | 8 +- .../components/HiddenFieldsSummary.tsx | 8 +- .../components/MatrixQuestionSummary.tsx | 6 +- .../components/MultipleChoiceSummary.tsx | 4 +- .../components/PictureChoiceSummary.tsx | 2 +- .../components/QuestionSummaryHeader.tsx | 10 +- .../summary/components/ShareEmbedSurvey.tsx | 6 +- .../summary/components/ShareSurveyResults.tsx | 4 +- .../summary/components/SummaryDropOffs.tsx | 2 +- .../components/shareEmbedTabs/EmailTab.tsx | 2 +- .../components/QuestionFilterComboBox.tsx | 2 +- .../[surveyId]/components/ResponseFilter.tsx | 4 +- .../components/SurveyStatusDropdown.tsx | 6 +- .../(auth)/auth/components/Testimonial.tsx | 2 +- .../auth/login/components/SigninForm.tsx | 2 +- .../auth/signup/components/SignupForm.tsx | 2 +- .../invite/components/ContentLayout.tsx | 4 +- apps/web/app/health/page.tsx | 1 + apps/web/playwright/action.spec.ts | 504 ++++++++++-------- .../playwright/api/management/survey.spec.ts | 189 +++---- apps/web/playwright/fixtures/users.ts | 128 +++++ apps/web/playwright/js.spec.ts | 199 ++++--- apps/web/playwright/lib/fixtures.ts | 13 + apps/web/playwright/onboarding.spec.ts | 20 +- apps/web/playwright/organization.spec.ts | 174 +++--- apps/web/playwright/signup.spec.ts | 7 +- apps/web/playwright/survey.spec.ts | 329 ++++++------ apps/web/playwright/utils/helper.ts | 33 +- apps/web/playwright/utils/mock.ts | 11 +- .../components/default-language-select.tsx | 2 +- .../components/language-indicator.tsx | 2 +- .../components/multi-language-card.tsx | 2 +- packages/js/index.html | 2 +- .../src/components/general/Headline.tsx | 2 +- .../src/components/general/LoadingSpinner.tsx | 8 +- .../src/components/general/QuestionMedia.tsx | 2 +- .../components/general/SurveyCloseButton.tsx | 2 +- .../src/components/questions/DateQuestion.tsx | 4 +- .../questions/FileUploadQuestion.tsx | 2 +- .../components/questions/OpenTextQuestion.tsx | 2 +- packages/ui/Button/index.tsx | 6 +- packages/ui/ColorPicker/index.tsx | 2 +- packages/ui/DropdownMenu/index.tsx | 6 +- .../components/AddVariablesDropdown.tsx | 2 +- packages/ui/EmptySpaceFiller/index.tsx | 34 +- packages/ui/Input/index.tsx | 2 +- packages/ui/ModalWithTabs/index.tsx | 2 +- packages/ui/PasswordInput/index.tsx | 4 +- .../ui/PreviewSurvey/components/Modal.tsx | 2 +- packages/ui/PreviewSurvey/index.tsx | 2 +- packages/ui/ProgressBar/index.tsx | 2 +- packages/ui/QuestionFormInput/index.tsx | 4 +- packages/ui/RadioGroup/index.tsx | 4 +- packages/ui/SearchBox/index.tsx | 2 +- packages/ui/SecondaryNavigation/index.tsx | 2 +- packages/ui/Select/index.tsx | 12 +- .../components/QuestionSkip.tsx | 2 +- .../components/ResponseNote.tsx | 8 +- packages/ui/SkeletonLoader/index.tsx | 16 +- packages/ui/StackedCardsContainer/index.tsx | 4 +- packages/ui/SurveyStatusIndicator/index.tsx | 20 +- .../ui/SurveysList/components/SurveyCard.tsx | 3 +- .../components/SurveyDropdownMenu.tsx | 2 +- .../SurveysList/components/SurveyFilters.tsx | 8 +- .../components/StartFromScratchTemplate.tsx | 8 +- .../components/TemplateFilters.tsx | 8 +- packages/ui/ToasterClient/index.tsx | 11 +- .../components/InnerHtmlSelector.tsx | 2 +- .../components/PageUrlSelector.tsx | 2 +- .../ui/organisms/NoCodeActionForm/index.tsx | 6 +- packages/ui/v2/Button/index.tsx | 6 +- playwright.config.ts | 7 +- 124 files changed, 1215 insertions(+), 999 deletions(-) create mode 100644 apps/web/playwright/fixtures/users.ts create mode 100644 apps/web/playwright/lib/fixtures.ts diff --git a/.github/workflows/e2e.yml b/.github/workflows/e2e.yml index 8696058676..4de5a443bc 100644 --- a/.github/workflows/e2e.yml +++ b/.github/workflows/e2e.yml @@ -7,6 +7,20 @@ jobs: name: Run E2E Tests runs-on: ubuntu-latest timeout-minutes: 60 + services: + postgres: + image: postgres:latest + env: + POSTGRES_DB: postgres + POSTGRES_USER: postgres + POSTGRES_PASSWORD: postgres + ports: + - 5432:5432 + options: >- + --health-cmd="pg_isready -U testuser" + --health-interval=10s + --health-timeout=5s + --health-retries=5 steps: - uses: actions/checkout@v3 - uses: ./.github/actions/dangerous-git-checkout @@ -16,44 +30,46 @@ jobs: with: e2e_testing_mode: "1" + - name: Check if pnpm is installed + id: pnpm-check + run: | + if pnpm --version; then + echo "pnpm is installed." + echo "PNPM_INSTALLED=true" >> $GITHUB_ENV + else + echo "pnpm is not installed." + echo "PNPM_INSTALLED=false" >> $GITHUB_ENV + fi + - name: Install pnpm + if: env.PNPM_INSTALLED == 'false' uses: pnpm/action-setup@v2 - name: Install dependencies + if: env.PNPM_INSTALLED == 'false' run: pnpm install - - name: Start PostgreSQL + - name: Apply Prisma Migrations run: | - cd packages/database && pnpm db:up & - for attempt in {1..20}; do - if nc -zv localhost 5432; then - echo "Ready" - break - fi - echo "Waiting..." - sleep 5 - done - pnpm db:migrate:dev - - name: Serve packages for lazy loading - run: | - cd packages/surveys && pnpm serve & + pnpm prisma migrate deploy - name: Run App run: | NODE_ENV=test pnpm start --filter=@formbricks/web & - for attempt in {1..20}; do + sleep 10 # Optional: gives some buffer for the app to start + for attempt in {1..10}; do if [ $(curl -o /dev/null -s -w "%{http_code}" http://localhost:3000/health) -eq 200 ]; then - echo "Ready" + echo "Application is ready." break fi - echo "Waiting..." + if [ $attempt -eq 10 ]; then + echo "Application failed to start in time." + exit 1 + fi + echo "Still waiting for the application to be ready..." sleep 10 done - - name: Test Serve endpoints - run: | - curl -s http://localhost:3003 - - name: Cache Playwright uses: actions/cache@v3 id: playwright-cache diff --git a/apps/demo/pages/app/index.tsx b/apps/demo/pages/app/index.tsx index ef99c88be2..15c5e2fc5a 100644 --- a/apps/demo/pages/app/index.tsx +++ b/apps/demo/pages/app/index.tsx @@ -140,7 +140,7 @@ const AppPage = ({}) => {
-
@@ -169,7 +169,7 @@ const AppPage = ({}) => { onClick={() => { formbricks.setAttribute("Plan", "Free"); }} - className="mb-4 rounded-lg bg-slate-800 px-6 py-3 text-white hover:bg-slate-700 dark:bg-slate-700 dark:hover:bg-slate-600"> + className="mb-4 rounded-lg bg-slate-800 px-6 py-3 text-white hover:bg-slate-700 dark:bg-slate-700 dark:hover:bg-slate-600"> Set Plan to 'Free'
@@ -192,7 +192,7 @@ const AppPage = ({}) => { onClick={() => { formbricks.setAttribute("Plan", "Paid"); }} - className="mb-4 rounded-lg bg-slate-800 px-6 py-3 text-white hover:bg-slate-700 dark:bg-slate-700 dark:hover:bg-slate-600"> + className="mb-4 rounded-lg bg-slate-800 px-6 py-3 text-white hover:bg-slate-700 dark:bg-slate-700 dark:hover:bg-slate-600"> Set Plan to 'Paid' @@ -215,7 +215,7 @@ const AppPage = ({}) => { onClick={() => { formbricks.setEmail("test@web.com"); }} - className="mb-4 rounded-lg bg-slate-800 px-6 py-3 text-white hover:bg-slate-700 dark:bg-slate-700 dark:hover:bg-slate-600"> + className="mb-4 rounded-lg bg-slate-800 px-6 py-3 text-white hover:bg-slate-700 dark:bg-slate-700 dark:hover:bg-slate-600"> Set Email diff --git a/apps/docs/components/SideNavigation.tsx b/apps/docs/components/SideNavigation.tsx index f6f62358a6..ce8c1501c7 100644 --- a/apps/docs/components/SideNavigation.tsx +++ b/apps/docs/components/SideNavigation.tsx @@ -47,7 +47,7 @@ export const SideNavigation = ({ pathname }) => { return (
  • + className={`mb-4 ml-4 text-slate-900 dark:text-white ml-${heading.level === 2 ? 0 : heading.level === 3 ? 4 : 6}`}> setSelectedId(heading.id)} diff --git a/apps/web/app/(app)/(onboarding)/environments/[environmentId]/connect/components/InviteOrganizationMember.tsx b/apps/web/app/(app)/(onboarding)/environments/[environmentId]/connect/components/InviteOrganizationMember.tsx index da39109056..08be8a0cd0 100644 --- a/apps/web/app/(app)/(onboarding)/environments/[environmentId]/connect/components/InviteOrganizationMember.tsx +++ b/apps/web/app/(app)/(onboarding)/environments/[environmentId]/connect/components/InviteOrganizationMember.tsx @@ -65,7 +65,7 @@ export const InviteOrganizationMember = ({ organization, environmentId }: Invite value={field.value} onChange={(email) => field.onChange(email)} placeholder="engineering@acme.com" - className=" bg-white" + className="bg-white" /> {error?.message && {error.message}} 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 44cbb087c1..c7c9d226df 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 @@ -22,7 +22,7 @@ export const AddQuestionButton = ({ addQuestion, product }: AddQuestionButtonPro onOpenChange={setOpen} className={cn( open ? "scale-100 shadow-lg" : "scale-97 shadow-md", - "group w-full space-y-2 rounded-lg border border-slate-300 bg-white transition-all duration-300 ease-in-out hover:scale-100 hover:cursor-pointer hover:bg-slate-50" + "group w-full space-y-2 rounded-lg border border-slate-300 bg-white transition-all duration-300 ease-in-out hover:scale-100 hover:cursor-pointer hover:bg-slate-50" )}>
    @@ -35,7 +35,7 @@ export const AddQuestionButton = ({ addQuestion, product }: AddQuestionButtonPro
    - + {/*
    */} {questionTypes.map((questionType) => ( -
    +
    -
    +
    -
    +
    Loading user responses
    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 2bd7f46dad..9d831be4cd 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 @@ -63,7 +63,7 @@ const Page = async ({ params }) => {
    -
    +
    { href={`/environments/${person.environmentId}/people/${person.id}`} key={person.id} className="w-full"> -
    +
    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 3126835290..2a4ff2eadd 100644 --- a/apps/web/app/(app)/environments/[environmentId]/(people)/people/page.tsx +++ b/apps/web/app/(app)/environments/[environmentId]/(people)/people/page.tsx @@ -64,7 +64,7 @@ const Page = async ({ ) : (
    -
    User
    +
    User
    User ID
    Email
    diff --git a/apps/web/app/(app)/environments/[environmentId]/(people)/segments/components/SegmentActivityTab.tsx b/apps/web/app/(app)/environments/[environmentId]/(people)/segments/components/SegmentActivityTab.tsx index 6a5ab7fc85..dadac73eef 100644 --- a/apps/web/app/(app)/environments/[environmentId]/(people)/segments/components/SegmentActivityTab.tsx +++ b/apps/web/app/(app)/environments/[environmentId]/(people)/segments/components/SegmentActivityTab.tsx @@ -35,13 +35,13 @@ export const SegmentActivityTab = ({ currentSegment }: SegmentActivityTabProps)
    -

    +

    {convertDateTimeStringShort(currentSegment.createdAt?.toString())}

    {" "}
    -

    +

    {convertDateTimeStringShort(currentSegment.updatedAt?.toString())}

    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 fede49813c..c8d13071e7 100644 --- a/apps/web/app/(app)/environments/[environmentId]/actions/components/ActionActivityTab.tsx +++ b/apps/web/app/(app)/environments/[environmentId]/actions/components/ActionActivityTab.tsx @@ -121,20 +121,20 @@ export const EventActivityTab = ({
    -

    +

    {convertDateTimeStringShort(actionClass.createdAt?.toString())}

    {" "}
    - -

    + +

    {convertDateTimeStringShort(actionClass.updatedAt?.toString())}

    -
    +
    {actionClass.type === "code" ? ( ) : actionClass.type === "noCode" ? ( @@ -143,7 +143,7 @@ export const EventActivityTab = ({ ) : null}
    -

    {capitalizeFirstLetter(actionClass.type)}

    +

    {capitalizeFirstLetter(actionClass.type)}

    diff --git a/apps/web/app/(app)/environments/[environmentId]/actions/components/ActionTableHeading.tsx b/apps/web/app/(app)/environments/[environmentId]/actions/components/ActionTableHeading.tsx index c5f49f4135..f642bd0b80 100644 --- a/apps/web/app/(app)/environments/[environmentId]/actions/components/ActionTableHeading.tsx +++ b/apps/web/app/(app)/environments/[environmentId]/actions/components/ActionTableHeading.tsx @@ -3,7 +3,7 @@ export const ActionTableHeading = () => { <>
    Edit -
    User Actions
    +
    User Actions
    Created
    diff --git a/apps/web/app/(app)/environments/[environmentId]/actions/loading.tsx b/apps/web/app/(app)/environments/[environmentId]/actions/loading.tsx index 294d12e7d1..b702ea3871 100644 --- a/apps/web/app/(app)/environments/[environmentId]/actions/loading.tsx +++ b/apps/web/app/(app)/environments/[environmentId]/actions/loading.tsx @@ -9,7 +9,7 @@ const Loading = () => {
    Edit -
    User Actions
    +
    User Actions
    Created
    {[...Array(3)].map((_, index) => ( diff --git a/apps/web/app/(app)/environments/[environmentId]/components/MainNavigation.tsx b/apps/web/app/(app)/environments/[environmentId]/components/MainNavigation.tsx index 57b534cac4..ae1aeb61ac 100644 --- a/apps/web/app/(app)/environments/[environmentId]/components/MainNavigation.tsx +++ b/apps/web/app/(app)/environments/[environmentId]/components/MainNavigation.tsx @@ -286,7 +286,7 @@ export const MainNavigation = ({

    {product.name} diff --git a/apps/web/app/(app)/environments/[environmentId]/components/NavbarLoading.tsx b/apps/web/app/(app)/environments/[environmentId]/components/NavbarLoading.tsx index 303c7da563..1f8dbce3f7 100644 --- a/apps/web/app/(app)/environments/[environmentId]/components/NavbarLoading.tsx +++ b/apps/web/app/(app)/environments/[environmentId]/components/NavbarLoading.tsx @@ -3,16 +3,16 @@ export const NavbarLoading = () => {

    -
    -
    -
    -
    -
    -
    +
    +
    +
    +
    +
    +
    -
    -
    +
    +
    diff --git a/apps/web/app/(app)/environments/[environmentId]/components/UrlShortenerForm.tsx b/apps/web/app/(app)/environments/[environmentId]/components/UrlShortenerForm.tsx index c6e3cb4190..3591f3862e 100644 --- a/apps/web/app/(app)/environments/[environmentId]/components/UrlShortenerForm.tsx +++ b/apps/web/app/(app)/environments/[environmentId]/components/UrlShortenerForm.tsx @@ -61,7 +61,7 @@ export const UrlShortenerForm = ({ webAppUrl }: { webAppUrl: string }) => {
    -
    +
    { {shortUrl && (
    -
    +
    { if (shortUrl) { copyShortUrlToClipboard(); 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 804a28c9fb..eada7d7f93 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 @@ -72,7 +72,7 @@ export const ManageIntegration = (props: ManageIntegrationProps) => { return (
    -
    +
    { editIntegration(index); }}> diff --git a/apps/web/app/(app)/environments/[environmentId]/integrations/google-sheets/loading.tsx b/apps/web/app/(app)/environments/[environmentId]/integrations/google-sheets/loading.tsx index d8f8fd08cf..8662a4d00e 100644 --- a/apps/web/app/(app)/environments/[environmentId]/integrations/google-sheets/loading.tsx +++ b/apps/web/app/(app)/environments/[environmentId]/integrations/google-sheets/loading.tsx @@ -15,9 +15,9 @@ const Loading = () => {
    -
    Survey
    +
    Survey
    Google Sheet Name
    -
    Questions
    +
    Questions
    Updated At
    diff --git a/apps/web/app/(app)/environments/[environmentId]/integrations/notion/loading.tsx b/apps/web/app/(app)/environments/[environmentId]/integrations/notion/loading.tsx index b31b607588..69dffe2739 100644 --- a/apps/web/app/(app)/environments/[environmentId]/integrations/notion/loading.tsx +++ b/apps/web/app/(app)/environments/[environmentId]/integrations/notion/loading.tsx @@ -15,7 +15,7 @@ const Loading = () => {
    -
    Survey
    +
    Survey
    Database Name
    Updated At
    diff --git a/apps/web/app/(app)/environments/[environmentId]/integrations/webhooks/components/WebhookOverviewTab.tsx b/apps/web/app/(app)/environments/[environmentId]/integrations/webhooks/components/WebhookOverviewTab.tsx index eb2069baa7..a1a7284c72 100644 --- a/apps/web/app/(app)/environments/[environmentId]/integrations/webhooks/components/WebhookOverviewTab.tsx +++ b/apps/web/app/(app)/environments/[environmentId]/integrations/webhooks/components/WebhookOverviewTab.tsx @@ -75,13 +75,13 @@ export const WebhookOverviewTab = ({ webhook, surveys }: ActivityTabProps) => {
    -

    +

    {convertDateTimeStringShort(webhook.createdAt?.toString())}

    - -

    + +

    {convertDateTimeStringShort(webhook.updatedAt?.toString())}

    diff --git a/apps/web/app/(app)/environments/[environmentId]/integrations/webhooks/components/WebhookTableHeading.tsx b/apps/web/app/(app)/environments/[environmentId]/integrations/webhooks/components/WebhookTableHeading.tsx index 1d9984f1bf..e04ab2f41e 100644 --- a/apps/web/app/(app)/environments/[environmentId]/integrations/webhooks/components/WebhookTableHeading.tsx +++ b/apps/web/app/(app)/environments/[environmentId]/integrations/webhooks/components/WebhookTableHeading.tsx @@ -3,10 +3,10 @@ export const WebhookTableHeading = () => { <>
    Edit -
    Webhook
    +
    Webhook
    Source
    Surveys
    -
    Triggers
    +
    Triggers
    Updated
    diff --git a/apps/web/app/(app)/environments/[environmentId]/product/(setup)/app-connection/loading.tsx b/apps/web/app/(app)/environments/[environmentId]/product/(setup)/app-connection/loading.tsx index dc80c10c34..a2bfef5a1f 100644 --- a/apps/web/app/(app)/environments/[environmentId]/product/(setup)/app-connection/loading.tsx +++ b/apps/web/app/(app)/environments/[environmentId]/product/(setup)/app-connection/loading.tsx @@ -8,13 +8,13 @@ import { PageHeader } from "@formbricks/ui/PageHeader"; const LoadingCard = ({ title, description, skeletonLines }) => { return ( -
    -
    +
    +

    {title}

    {description}

    -
    +
    {skeletonLines.map((line, index) => (
    {
    -
    +
  • ))} -

    +

    No call needed, no strings attached: Request a free 30-day trial license to test all features by filling out this form:

    @@ -176,7 +176,7 @@ const Page = async ({ params }) => { target="_blank"> Request 30-day Trial License -

    No credit card. No sales call. Just test it :)

    +

    No credit card. No sales call. Just test it :)

    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 dc193f721b..e9eafd5e24 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 @@ -69,11 +69,11 @@ export const BulkInviteTab = ({ setOpen, onSubmit, canDoRoleManagement }: BulkIn return (
    fileInputRef.current?.click()}> {csvFile ? ( ) : ( diff --git a/apps/web/app/(app)/environments/[environmentId]/settings/(organization)/members/components/EditMemberships/MembersInfo.tsx b/apps/web/app/(app)/environments/[environmentId]/settings/(organization)/members/components/EditMemberships/MembersInfo.tsx index c3519c68b7..0518f81fd5 100644 --- a/apps/web/app/(app)/environments/[environmentId]/settings/(organization)/members/components/EditMemberships/MembersInfo.tsx +++ b/apps/web/app/(app)/environments/[environmentId]/settings/(organization)/members/components/EditMemberships/MembersInfo.tsx @@ -41,7 +41,7 @@ export const MembersInfo = async ({

    {member.name}

    -
    +
    {member.email}
    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 8c784642d0..86384b1f88 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 @@ -69,7 +69,6 @@ export const OrganizationActions = ({ } catch (err) { toast.error(`Error: ${err.message}`); } - router.refresh(); }; return ( diff --git a/apps/web/app/(app)/environments/[environmentId]/settings/(organization)/members/components/IndividualInviteTab.tsx b/apps/web/app/(app)/environments/[environmentId]/settings/(organization)/members/components/IndividualInviteTab.tsx index 1bf6d08c27..81d3a5aea9 100644 --- a/apps/web/app/(app)/environments/[environmentId]/settings/(organization)/members/components/IndividualInviteTab.tsx +++ b/apps/web/app/(app)/environments/[environmentId]/settings/(organization)/members/components/IndividualInviteTab.tsx @@ -22,7 +22,14 @@ export const IndividualInviteTab = ({ isFormbricksCloud, environmentId, }: IndividualInviteTabProps) => { - const { register, getValues, handleSubmit, reset, control } = useForm<{ + const { + register, + getValues, + handleSubmit, + reset, + control, + formState: { isSubmitting }, + } = useForm<{ name: string; email: string; role: MembershipRole; @@ -31,13 +38,13 @@ export const IndividualInviteTab = ({ const submitEventClass = async () => { const data = getValues(); data.role = data.role || MembershipRole.Admin; - onSubmit([data]); + await onSubmit([data]); setOpen(false); reset(); }; return ( -
    +
    @@ -86,7 +93,7 @@ export const IndividualInviteTab = ({ }}> Cancel -
    diff --git a/apps/web/app/(app)/environments/[environmentId]/settings/(organization)/members/loading.tsx b/apps/web/app/(app)/environments/[environmentId]/settings/(organization)/members/loading.tsx index 772cfad57c..73321b8a37 100644 --- a/apps/web/app/(app)/environments/[environmentId]/settings/(organization)/members/loading.tsx +++ b/apps/web/app/(app)/environments/[environmentId]/settings/(organization)/members/loading.tsx @@ -2,8 +2,10 @@ import { IS_FORMBRICKS_CLOUD } from "@formbricks/lib/constants"; const LoadingCard = ({ title, description, skeletonLines }) => { return ( -
    -
    +
    +

    {title}

    {description}

    @@ -50,7 +52,7 @@ const Loading = () => {
    -
    +