V8-archive: "first_name" and "last_name" shouldn't be required attributes for "Create a user" endpoint.

Created on 1 Feb 2020  路  12Comments  路  Source: directus/v8-archive

Directus version

8.2.0

Steps to reproduce

Post to /:project/users without first_name and last_name

POST /:project/users

{
   email: [email protected],
   password: 1234Abcd!,
   role: 4,
   status: 'active',
}

Error message

Console error 422 (Unprocessable Entity)

{
   "code":4,
   "message": "first_name: This value should not be blank. last_name: This value should not be blank."
}
enhancement api

Most helpful comment

Having the names separated makes it way easier to find the right person in a long list of items (sort by last name etc)

We could show the email address instead of the name if the name is empty

All 12 comments

Before this disappears into the Feature Request bucket... thoughts on this @directus/team ?

Just for some extra context:

At the time of me creating this issue the documentation actually stated that first_name and last_name were not required.

Spoke with @rijkvanzanten about this on slack the other day and he suggested that I create this git issue to get the problem resolved, but updated the docs in the mean time so that they were at least still correct.

if it's not used by anything else that makes it break once it's empty, I'd remove it from required too. does the app interface fills them once it's empty?

The names are used throughout the system/app to referemce the user (in addition to the Avatar). So we would first need to come up with a fallback for what to "call" users in the app. Specifically on the User Created/Modified interfaces, Activity events (sidebar and layout), and notifications ("X user is also editing this item").

if it needs to be set, maybe set first name to the first part of (email before @)? unsure about last name though

Yeah, we could do that, or generate a random "name" (handle) for new users who don't set one manually.

Also, we've discussed this before, but I'd be down to combine first name and last name... into "name". The only reason I kept them separated is that larger companies use this as a formal Company Directory, and having it split out makes it a bit more powerful. Not sure what we gain by combining them... especially if these fields are "locked" and can't be changed later by admins. Though I guess we could keep the important fields locked, and NOT lock others (like name) so admins can adjust things as they need (except for our important system fields, which would remain locked).

Having the names separated makes it way easier to find the right person in a long list of items (sort by last name etc)

We could show the email address instead of the name if the name is empty

I'd probably say it makes sense to show the email address regardless.

First and last name aren't unique fields and there's nothing else in the UI to distinguish users with the same name.

Well, the Avatar (normally shown beside the name) can be used to differentiate users with the exact same name... or hovering over the name to see the user modal (with email, title, etc). Email addresses can be far too long to see in most cases, and users don't have control over that presentation (unlike a name field).

I'm down to make things more flexible, but wouldn't want to switch from names to email exclusively.

I hope I'm not speaking out of turn here, but I think that says more about the choice for a cards layout for users (rather than just rows).

The users page is dominated by the "avatar", which is arguably one of the least useful or identifiable fields. Not to mention the fact that a lot of users won't even upload one.

Don't you think it would be much more useful to have each user on a row displaying email, first name, last name etc, with the ability to sort by those fields?

I think it's confusing that the only visible information on that page (without hovering) isn't uniquely identifiable.

Again, I'm new here and sorry if this comes across badly! Just trying to get some constructive feedback in. Also happy to contribute.

Users can each choose how to view data, including Directus Users. Card style is just the default, but admins can set new defaults and users can override this to their preference. Just click the info sidebar and choose "Table" for what you're looking for.

Screen Shot 2020-02-03 at 12 16 45 PM

Also, we're all about community feedback... so no worries there! As long as no one tries to force decisions based on their own individual use-cases, we enjoy the discussions.

Ah that's great thank you. Sorry, I missed that in the info sidebar. Doh!

As it happens, first_name and last_name are required fields in my frontend. I just created the issue because of the conflicting docs (and it just doesn't seem like a field that would need to be required).

Flexibility on this sounds great but could be confusing for some users to display the name, and other users to display email address (especially when sorting by one or the other).

Was this page helpful?
0 / 5 - 0 ratings

Related issues

binary-koan picture binary-koan  路  3Comments

Varulv1997 picture Varulv1997  路  3Comments

maettyhawk picture maettyhawk  路  3Comments

cdwmhcc picture cdwmhcc  路  3Comments

andgar2010 picture andgar2010  路  3Comments