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: Rewrite profile settings to server component #642

Conversation

Dhruwang
Copy link
Contributor

@Dhruwang Dhruwang commented Aug 3, 2023

What does this PR do?

Decoupled the components in EditProfile into individual ones (EditName, EditAvatar, DeleteAccount).
Added data fetching functions for profile to packages/services/profile.ts (getProfile, updateProfile, deleteProfile)
Added types for the same to packages/types/v1/profile.ts
Added server actions to action.tsx
Added a skeleton loading state

Screenshot from 2023-08-03 13-49-01

Fixes 1061

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?

Check profile settings

Checklist

  • Added a screen recording or screenshots to this PR
  • Filled out the "How to test" section in this PR
  • Read the contributing guide
  • Self-reviewed my own code
  • Commented on my code in hard-to-understand bits
  • Ran pnpm build
  • Checked for warnings, there are none
  • Removed all console.logs
  • Merged the latest changes from main onto my branch with git pull origin main
  • My changes don't cause any responsiveness issues
  • Updated the Formbricks Docs if changes were necessary

@vercel
Copy link

vercel bot commented Aug 3, 2023

@Dhruwang is attempting to deploy a commit to the formbricks Team on Vercel.

A member of the Team first needs to authorize it.

@Dhruwang Dhruwang marked this pull request as draft August 3, 2023 08:31
@Dhruwang Dhruwang marked this pull request as ready for review August 3, 2023 08:41
@Dhruwang Dhruwang changed the title Chore: moved profile settings to server component Chore: Rewrite profile settings to server component Aug 3, 2023
Copy link
Member

@mattinannt mattinannt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Dhruwang thanks a lot for the PR 😊 Looks pretty good already! I made a few suggestions as comments.
The most important thing is that we get the types and services right. This is still a progress as we all learn more while using this pattern all over the whole app 😊

packages/types/v1/profile.ts Show resolved Hide resolved
packages/lib/services/profile.ts Outdated Show resolved Hide resolved
packages/lib/services/profile.ts Outdated Show resolved Hide resolved
packages/lib/services/profile.ts Outdated Show resolved Hide resolved
packages/lib/services/profile.ts Outdated Show resolved Hide resolved
packages/lib/services/profile.ts Outdated Show resolved Hide resolved
Copy link
Contributor

@pandeymangg pandeymangg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

Copy link
Member

@mattinannt mattinannt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Dhruwang thanks a lot for the PR 💪 Looks great and works as expected 🎉
I just fixed some merge conflicts and added a TProfileUpdateInput type so we don't need to rely on prisma but our own types. Now it's ready to get merged 😊

@mattinannt mattinannt merged commit 2bebc95 into formbricks:main Aug 9, 2023
0 of 2 checks passed
waseemrabani pushed a commit to LuminosoInsight/formbricks that referenced this pull request Feb 2, 2024
* Chore: moved profile settings to server component

* ran pnpm format

* fisxed a build issue

* made requested changes

* made some refactors

---------

Co-authored-by: Matthias Nannt <mail@matthiasnannt.com>
waseemrabani pushed a commit to LuminosoInsight/formbricks that referenced this pull request Feb 2, 2024
* Chore: moved profile settings to server component

* ran pnpm format

* fisxed a build issue

* made requested changes

* made some refactors

---------

Co-authored-by: Matthias Nannt <mail@matthiasnannt.com>
waseemrabani pushed a commit to LuminosoInsight/formbricks that referenced this pull request Feb 2, 2024
* Chore: moved profile settings to server component

* ran pnpm format

* fisxed a build issue

* made requested changes

* made some refactors

---------

Co-authored-by: Matthias Nannt <mail@matthiasnannt.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

3 participants