Clean up UserProfile validations #525

Open
opened 2021-09-21 23:46:50 +02:00 by Irev-Dev · 5 comments
Irev-Dev commented 2021-09-21 23:46:50 +02:00 (Migrated from github.com)

image
pencil of edit state, but if no bio
image

At a guess could be related to keyValue component @franknoirot ?

![image](https://user-images.githubusercontent.com/29681384/134252064-4287a70f-9b95-47c9-aa77-c7fcf88b5fc0.png) pencil of edit state, but if no bio ![image](https://user-images.githubusercontent.com/29681384/134252107-56cdb07f-6fcb-4627-aa10-8227ca87e9ed.png) At a guess could be related to keyValue component @franknoirot ?
franknoirot commented 2021-09-22 01:27:33 +02:00 (Migrated from github.com)

Yeah @Irev-Dev I'm sure it's the display logic for the BioField Component, either in userProfileConfig or userProfile itself. Want me to take a try at fixing?

Yeah @Irev-Dev I'm sure it's the display logic for the BioField Component, either in `userProfileConfig` or `userProfile` itself. Want me to take a try at fixing?
Irev-Dev commented 2021-09-22 11:04:06 +02:00 (Migrated from github.com)

Up to you @franknoirot, would be good to get a fix but bio editing is not hugely important. If you pick it up just assign the issue to yourself so we don't up working on it at the same time.

Up to you @franknoirot, would be good to get a fix but bio editing is not hugely important. If you pick it up just assign the issue to yourself so we don't up working on it at the same time.
franknoirot commented 2021-09-23 05:16:17 +02:00 (Migrated from github.com)

@Irev-Dev I've found other things I can break that need better validation. Making a list of to-do's:

  • Make it impossible to set Name to nothing
  • Make it impossible to set userName to nothing
  • Make it impossible to give yourself an already existing userName, or at least their profile slug is at least kept unique if they do pick a colliding name.

Would you like for this to be its own issue, or can this issue grow in scope a bit? I'll put up a PR that solves the bio visibility real quick for now.

@Irev-Dev I've found other things I can break that need better validation. Making a list of to-do's: - [ ] Make it impossible to set `Name` to nothing - [ ] Make it impossible to set `userName` to nothing - [ ] Make it impossible to give yourself an already existing `userName`, or at least their profile slug is at least kept unique if they do pick a colliding name. Would you like for this to be its own issue, or can this issue grow in scope a bit? I'll put up a PR that solves the bio visibility real quick for now.
Irev-Dev commented 2021-09-23 10:59:39 +02:00 (Migrated from github.com)

I've enforced that Name and userName needing to have length #526, userNames needing to be unique should already be enforced ( I check locally just incase and seems fine) which is enforced on a db level since the userName is unique in the schema
https://github.com/Irev-Dev/cadhub/blob/main/app/api/db/schema.prisma#L19

What's still not great is that these problems are not communicated to the user, there is a toast message for when the name/bio etc is updated, but we should have a toast message when it fails too.

I'm happy for it to continue under this issue.

I've enforced that Name and userName needing to have length #526, userNames needing to be unique should already be enforced ( I check locally just incase and seems fine) which is enforced on a db level since the userName is unique in the schema https://github.com/Irev-Dev/cadhub/blob/main/app/api/db/schema.prisma#L19 What's still not great is that these problems are not communicated to the user, there is a toast message for when the name/bio etc is updated, but we should have a toast message when it fails too. I'm happy for it to continue under this issue.
franknoirot commented 2021-09-23 13:14:28 +02:00 (Migrated from github.com)

Excellent @Irev-Dev you made such quick work of that wow! Okay great I just gotta look at what those errors are returning but adding toasts shouldn't be too hard.

Excellent @Irev-Dev you made such quick work of that wow! Okay great I just gotta look at what those errors are returning but adding toasts shouldn't be too hard.
Sign in to join this conversation.
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: h3n3/cadhub#525