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

Exclude fields in list fields #589

Closed
JHGitty opened this Issue Nov 23, 2015 · 6 comments

Comments

Projects
None yet
4 participants
@JHGitty
Copy link

JHGitty commented Nov 23, 2015

I think on the list view there should not be 'password' or 'salt' by default.

That because there is an array for excluded fields on the Configurator.
But this array is only used if there are more than 7 fields.

Source: https://github.com/javiereguiluz/EasyAdminBundle/blob/master/Configuration/Configurator.php#L275-L282

Technical:
$excludedFieldNames and $excludedFieldTypes are ignored if $maxListFields <= 7.

@Pierstoval

This comment has been minimized.

Copy link
Contributor

Pierstoval commented Nov 23, 2015

It is always better to specify manually the fields to expose instead of letting EasyAdmin decide itself (which is just for convenience at first setup)

@javiereguiluz

This comment has been minimized.

Copy link
Collaborator

javiereguiluz commented Nov 23, 2015

Although I agree with @Pierstoval, I also think we should always skip the password and salt fields when no fields are configured. Let me think a bit more about this. Thanks.

@Pierstoval

This comment has been minimized.

Copy link
Contributor

Pierstoval commented Nov 24, 2015

And what if the field is name pwd, pass, mot_de_passe or any other name?
It's the developer's responsibility, I don't think we should handle this, as it's only for a few specific cases.

Plus, if a field disappears, I wonder how many people will ask themselves why their entity password (even crypted) is not visible in the list. They should do this manually.

I'm very 👎 on this

@javiereguiluz

This comment has been minimized.

Copy link
Collaborator

javiereguiluz commented Nov 24, 2015

@Pierstoval this is only to improve user experience. We are not trying to outsmart the developers or make a "perfect" configuration by default. If you are a Symfony developer, there's a 90% chance that you have a User entity with the salt and password properties. If we can do something to make your first experience with the bundle great, we should try it.

@Pierstoval

This comment has been minimized.

Copy link
Contributor

Pierstoval commented Nov 24, 2015

Yep, but the problem is that if you have password and salt, I bet there are more properties you have, like createdAt, updatedAt, canonical fields for email and username, plain password, confirmation token, last login, etc.
All of these should not appear either in the list, and to do this properly you must specify manually the fields you want to expose.
Basically, username, email, roles and active/inactive which are fairly enough.

@JHGitty JHGitty changed the title Excluded fields are ignored in list fields Exclude fields in list fields Nov 24, 2015

@javiereguiluz javiereguiluz added the hasPR label Dec 25, 2015

javiereguiluz added a commit that referenced this issue Dec 25, 2015

minor #689 Exclude by default some types of fields in the "list" view…
… (javiereguiluz)

This PR was merged into the master branch.

Discussion
----------

Exclude by default some types of fields in the "list" view

This fixes #589.

Commits
-------

24f5b86 Exclusde by default some types of fields in the "list" view
@TomasVotruba

This comment has been minimized.

Copy link
Contributor

TomasVotruba commented Aug 18, 2018

Is there a possibility to exclude files now?

I need to exclude one property only. When I use explicit approach as recommended and add a new property to entity and I always have to think about it to add it to config too.

I can send PR for it :)

Thanks for this awesome bundle, I just pop up entities and it works. Love it 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment