Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: Introduce unified survey UI package @formbricks/surveys #698

Merged
merged 55 commits into from
Sep 10, 2023

Conversation

mattinannt
Copy link
Member

What does this PR do?

Introduce unified survey UI package @formbricks/surveys

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • Chore (refactoring code, technical debt, workflow improvements)
  • Enhancement (small improvements)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change adds a new database migration
  • This change requires a documentation update

How should this be tested?

  • View and test survey preview in templates view
  • View and test survey preview in survey editor

@vercel
Copy link

vercel bot commented Aug 15, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
formbricks-cloud ✅ Ready (Inspect) Visit Preview 💬 Add feedback Sep 10, 2023 5:06am
1 Ignored Deployment
Name Status Preview Comments Updated (UTC)
formbricks-com ⬜️ Ignored (Inspect) Visit Preview Sep 10, 2023 5:06am

@github-actions
Copy link
Contributor

github-actions bot commented Sep 7, 2023

📦 Next.js Bundle Analysis for @formbricks/web

This analysis was generated by the Next.js Bundle Analysis action. 🤖

⚠️ Global Bundle Size Increased

Page Size (compressed)
global 74.11 KB (🟢 16 B)
Details

The global bundle is the javascript bundle that loads alongside every page. It is in its own category because its impact is much higher - an increase to its size means that every page on your website loads slower, and a decrease means every page loads faster.

Any third party scripts you have added directly to your app using the <script> tag are not accounted for in this analysis

If you want further insight into what is behind the changes, give @next/bundle-analyzer a try!

@github-actions
Copy link
Contributor

github-actions bot commented Sep 7, 2023

📦 Next.js Bundle Analysis for @formbricks/web

This analysis was generated by the Next.js Bundle Analysis action. 🤖

⚠️ Global Bundle Size Increased

Page Size (compressed)
global 74.11 KB (🟢 16 B)
Details

The global bundle is the javascript bundle that loads alongside every page. It is in its own category because its impact is much higher - an increase to its size means that every page on your website loads slower, and a decrease means every page loads faster.

Any third party scripts you have added directly to your app using the <script> tag are not accounted for in this analysis

If you want further insight into what is behind the changes, give @next/bundle-analyzer a try!

@github-actions
Copy link
Contributor

github-actions bot commented Sep 7, 2023

📦 Next.js Bundle Analysis for @formbricks/web

This analysis was generated by the Next.js Bundle Analysis action. 🤖

This PR introduced no changes to the JavaScript bundle! 🙌

@ShubhamPalriwala
Copy link
Contributor

Looks solid 💯

A few bugs that I encountered:

  • Adding an "Other" option does not show in the Survey Preview in both Single Select and Multi Select:
    https://www.loom.com/share/d3ca4ed0982c4d278335b4691b99f71a

  • Deleting all questions throws me this errror:
    image

  • The Progress Bar is not accurate:
    https://www.loom.com/share/4acae29af76f4e11aa2e30597e323f6e

  • On clicking "Back" button in the 3rd question gives me this error:
    image

  • Call to Action question editor when selected to link to external link, has a very small URL option (it's the same currently as well on Prod):
    image

  • Smileys on Survey Preview in Phone mode go out of bounds when selected 10
    image

  • Cannot select Smileys in Rating question
    https://www.loom.com/share/bd7093a02df341daaac73c2c2acd22fc

  • In In-app surveys, the 1st question got 2 answers from the same UserID which is weird :// I tried to reproduce it but couldn't
    image

  • Okay, same for the link surveys as above but instead of 2, I got 10 ://
    image

Screen recording for the above 2 in detailed responses page:
https://www.loom.com/share/00e6122d61724d528bf7afc6bdbf0bcf

  • On setting the userId from URL, I can see the userId in the people/userId tab:
    image

  • but in the responses summary, I see the internalID, is this how it should be?
    image

  • Again I witnessed multiple first question responses:
    image

Error logs on viewing the /responses/[responseId] page:

@formbricks/web:go: - wait compiling /api/v1/client/responses/[responseId]/route (client and server)...
@formbricks/web:go: - wait compiling /api/pipeline/route (client and server)...
@formbricks/web:go: - event compiled client and server successfully in 5.5s (11349 modules)
@formbricks/web:go: [next-auth][warn][EXPERIMENTAL_API]
@formbricks/web:go: `getServerSession` is used in a React Server Component.
@formbricks/web:go: https://next-auth.js.org/configuration/nextjs#getServerSession}
@formbricks/web:go: https://next-auth.js.org/warnings#EXPERIMENTAL_API
@formbricks/web:go: ZodError: [
@formbricks/web:go:   {
@formbricks/web:go:     "code": "invalid_union",
@formbricks/web:go:     "unionErrors": [
@formbricks/web:go:       {
@formbricks/web:go:         "issues": [
@formbricks/web:go:           {
@formbricks/web:go:             "code": "invalid_type",
@formbricks/web:go:             "expected": "string",
@formbricks/web:go:             "received": "date",
@formbricks/web:go:             "path": [
@formbricks/web:go:               "response",
@formbricks/web:go:               "data",
@formbricks/web:go:               "gvf0r8xwyy1fvfk6pcrzu97p"
@formbricks/web:go:             ],
@formbricks/web:go:             "message": "Expected string, received date"
@formbricks/web:go:           }
@formbricks/web:go:         ],
@formbricks/web:go:         "name": "ZodError"
@formbricks/web:go:       },
@formbricks/web:go:       {
@formbricks/web:go:         "issues": [
@formbricks/web:go:           {
@formbricks/web:go:             "code": "invalid_type",
@formbricks/web:go:             "expected": "number",
@formbricks/web:go:             "received": "date",
@formbricks/web:go:             "path": [
@formbricks/web:go:               "response",
@formbricks/web:go:               "data",
@formbricks/web:go:               "gvf0r8xwyy1fvfk6pcrzu97p"
@formbricks/web:go:             ],
@formbricks/web:go:             "message": "Expected number, received date"
@formbricks/web:go:           }
@formbricks/web:go:         ],
@formbricks/web:go:         "name": "ZodError"
@formbricks/web:go:       },
@formbricks/web:go:       {
@formbricks/web:go:         "issues": [
@formbricks/web:go:           {
@formbricks/web:go:             "code": "invalid_type",
@formbricks/web:go:             "expected": "array",
@formbricks/web:go:             "received": "date",
@formbricks/web:go:             "path": [
@formbricks/web:go:               "response",
@formbricks/web:go:               "data",
@formbricks/web:go:               "gvf0r8xwyy1fvfk6pcrzu97p"
@formbricks/web:go:             ],
@formbricks/web:go:             "message": "Expected array, received date"
@formbricks/web:go:           }
@formbricks/web:go:         ],
@formbricks/web:go:         "name": "ZodError"
@formbricks/web:go:       }
@formbricks/web:go:     ],
@formbricks/web:go:     "path": [
@formbricks/web:go:       "response",
@formbricks/web:go:       "data",
@formbricks/web:go:       "gvf0r8xwyy1fvfk6pcrzu97p"
@formbricks/web:go:     ],
@formbricks/web:go:     "message": "Invalid input"
@formbricks/web:go:   }
@formbricks/web:go: ]
@formbricks/web:go:     at Object.get error [as error] (webpack-internal:///(sc_server)/../../node_modules/.pnpm/zod@3.21.4/node_modules/zod/lib/index.mjs:615:31)
@formbricks/web:go:     at POST (webpack-internal:///(sc_server)/./app/api/pipeline/route.ts:33:39)
@formbricks/web:go:     at runMicrotasks (<anonymous>)
@formbricks/web:go:     at processTicksAndRejections (node:internal/process/task_queues:96:5)
@formbricks/web:go:     at async eval (webpack-internal:///(sc_server)/../../node_modules/.pnpm/next@13.4.10_react-dom@18.2.0_react@18.2.0/node_modules/next/dist/server/future/route-modules/app-route/module.js:253:37) {
@formbricks/web:go:   issues: [
@formbricks/web:go:     {
@formbricks/web:go:       code: 'invalid_union',
@formbricks/web:go:       unionErrors: [Array],
@formbricks/web:go:       path: [Array],
@formbricks/web:go:       message: 'Invalid input'
@formbricks/web:go:     }
@formbricks/web:go:   ],
@formbricks/web:go:   addIssue: [Function (anonymous)],
@formbricks/web:go:   addIssues: [Function (anonymous)],
@formbricks/web:go:   errors: [
@formbricks/web:go:     {
@formbricks/web:go:       code: 'invalid_union',
@formbricks/web:go:       unionErrors: [Array],
@formbricks/web:go:       path: [Array],
@formbricks/web:go:       message: 'Invalid input'
@formbricks/web:go:     }
@formbricks/web:go:   ]
@formbricks/web:go: }

Please let me know if you need any other info/context! I have it running locally

@github-actions
Copy link
Contributor

📦 Next.js Bundle Analysis for @formbricks/web

This analysis was generated by the Next.js Bundle Analysis action. 🤖

⚠️ Global Bundle Size Increased

Page Size (compressed)
global 74.11 KB (🟢 16 B)
Details

The global bundle is the javascript bundle that loads alongside every page. It is in its own category because its impact is much higher - an increase to its size means that every page on your website loads slower, and a decrease means every page loads faster.

Any third party scripts you have added directly to your app using the <script> tag are not accounted for in this analysis

If you want further insight into what is behind the changes, give @next/bundle-analyzer a try!

@github-actions
Copy link
Contributor

📦 Next.js Bundle Analysis for @formbricks/web

This analysis was generated by the Next.js Bundle Analysis action. 🤖

This PR introduced no changes to the JavaScript bundle! 🙌

@mattinannt
Copy link
Member Author

Issues mentioned above are fixed 😊
Zod error will be solved in a separate ticket. Ready for merge.

@mattinannt mattinannt merged commit 0a08d7d into main Sep 10, 2023
7 checks passed
@mattinannt mattinannt deleted the feature/FOR-836 branch September 10, 2023 05:07
@github-actions
Copy link
Contributor

📦 Next.js Bundle Analysis for @formbricks/web

This analysis was generated by the Next.js Bundle Analysis action. 🤖

This PR introduced no changes to the JavaScript bundle! 🙌

@github-actions
Copy link
Contributor

📦 Next.js Bundle Analysis for @formbricks/web

This analysis was generated by the Next.js Bundle Analysis action. 🤖

⚠️ Global Bundle Size Increased

Page Size (compressed)
global 74.1 KB (6 B)
Details

The global bundle is the javascript bundle that loads alongside every page. It is in its own category because its impact is much higher - an increase to its size means that every page on your website loads slower, and a decrease means every page loads faster.

Any third party scripts you have added directly to your app using the <script> tag are not accounted for in this analysis

If you want further insight into what is behind the changes, give @next/bundle-analyzer a try!

waseemrabani pushed a commit to LuminosoInsight/formbricks that referenced this pull request Feb 2, 2024
…ricks#698)

* add vite survey package

* add renderSurvey method

* add all survey components

* First working version of renderSurvey

* integrate survey package into survey preview

* add survey modal functionality to formbricks-surveys

* fix build errors and add new template types

* add response queue

* add simple formbricks-js integration

* add local state management for surveys

* add local storage to multiple choice and open text questions

* add local state to other question types, layout fixes

* Fix modal close button, clean js package code

* add new calculate progress function

* fix progressbar on thankyou card

* fix churn survey branching in demo product

* use tsup to bundle @formbricks/js

* update survey positioning in link surveys

* fix preview reset button in link survey

* change logic for progress bar

* update progressbar logic

* update spacing

* add conditional autofocus / disable for iframe

* add userId to link survey

* integrated email verification

* moved token verification and reading to server component

* ran pnpm format

* added question prefilling

* ran pnpm format

* Moved question prefilling logic to Link Survey

* Refactor types

* centralize survey package props, fix build errors

* fix userId in link survey

* fix survey closed message

* add redirect on complete, fix bugs

* smaller bugfixes

* smaller bugfixes

* fix bugs

* fix build errors

* remove logs

---------

Co-authored-by: Johannes <johannes@formbricks.com>
Co-authored-by: Dhruwang <dhruwangjariwala18@gmail.com>
waseemrabani pushed a commit to LuminosoInsight/formbricks that referenced this pull request Feb 2, 2024
…ricks#698)

* add vite survey package

* add renderSurvey method

* add all survey components

* First working version of renderSurvey

* integrate survey package into survey preview

* add survey modal functionality to formbricks-surveys

* fix build errors and add new template types

* add response queue

* add simple formbricks-js integration

* add local state management for surveys

* add local storage to multiple choice and open text questions

* add local state to other question types, layout fixes

* Fix modal close button, clean js package code

* add new calculate progress function

* fix progressbar on thankyou card

* fix churn survey branching in demo product

* use tsup to bundle @formbricks/js

* update survey positioning in link surveys

* fix preview reset button in link survey

* change logic for progress bar

* update progressbar logic

* update spacing

* add conditional autofocus / disable for iframe

* add userId to link survey

* integrated email verification

* moved token verification and reading to server component

* ran pnpm format

* added question prefilling

* ran pnpm format

* Moved question prefilling logic to Link Survey

* Refactor types

* centralize survey package props, fix build errors

* fix userId in link survey

* fix survey closed message

* add redirect on complete, fix bugs

* smaller bugfixes

* smaller bugfixes

* fix bugs

* fix build errors

* remove logs

---------

Co-authored-by: Johannes <johannes@formbricks.com>
Co-authored-by: Dhruwang <dhruwangjariwala18@gmail.com>
waseemrabani pushed a commit to LuminosoInsight/formbricks that referenced this pull request Feb 2, 2024
…ricks#698)

* add vite survey package

* add renderSurvey method

* add all survey components

* First working version of renderSurvey

* integrate survey package into survey preview

* add survey modal functionality to formbricks-surveys

* fix build errors and add new template types

* add response queue

* add simple formbricks-js integration

* add local state management for surveys

* add local storage to multiple choice and open text questions

* add local state to other question types, layout fixes

* Fix modal close button, clean js package code

* add new calculate progress function

* fix progressbar on thankyou card

* fix churn survey branching in demo product

* use tsup to bundle @formbricks/js

* update survey positioning in link surveys

* fix preview reset button in link survey

* change logic for progress bar

* update progressbar logic

* update spacing

* add conditional autofocus / disable for iframe

* add userId to link survey

* integrated email verification

* moved token verification and reading to server component

* ran pnpm format

* added question prefilling

* ran pnpm format

* Moved question prefilling logic to Link Survey

* Refactor types

* centralize survey package props, fix build errors

* fix userId in link survey

* fix survey closed message

* add redirect on complete, fix bugs

* smaller bugfixes

* smaller bugfixes

* fix bugs

* fix build errors

* remove logs

---------

Co-authored-by: Johannes <johannes@formbricks.com>
Co-authored-by: Dhruwang <dhruwangjariwala18@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants