-
Notifications
You must be signed in to change notification settings - Fork 939
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
515 survey overview page refactor #554
515 survey overview page refactor #554
Conversation
@Ankur-Datta-4 is attempting to deploy a commit to the formbricks Team on Vercel. A member of the Team first needs to authorize it. |
On making SurveyList as a server component, here's the loading UI as only the drop-down is a Client-Component. formbricks-demo.mp4 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Ankur-Datta-4 thanks a lot for the changes 😊 Looks pretty good and works great!
Since we are still looking for the best structure to work with server actions and our new service infrastructure, I made some changes to make a clear difference between Survey
and SurveyWithAnalytics
.
I also tried different approaches to call the service (e.g. createSurvey
) directly in the client component instead of making a d-tour with an actions.ts
file.
The problem is that a server action called inside a client component must be use server'
, which comes with restrictions on how the file looks (e.g. it can only export functions). Since this limits the way we can build the services, I decided to now always go through the actions.ts'
file (e.g. createSurveyAction()
) but then call the generic service, so it's easier to reuse code/services we need in more than one place, but also keep server actions in one place.
Since I also made some changes, I would like to ask @jobenjada for a quick review to check if everything works.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
works great!
What does this PR do?
The survey overview page is converted to a server component and all the functions are replicated as server-actions.
Fixes #515
Type of change
How should this be tested?
Since all functions are replicated we can check for:
Checklist
pnpm build
console.logs
git pull origin main