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

[4.0] Feature: front-end users/user view #24799

Closed
wants to merge 15 commits into from
Closed

[4.0] Feature: front-end users/user view #24799

wants to merge 15 commits into from

Conversation

pe7er
Copy link
Contributor

@pe7er pe7er commented May 5, 2019

This PR add a new feature to display a list of Users from a selected User Group. You can use this new view for example to display a list of Users from the User Group "Author".

Summary of Changes

The front-end did not have a model/view to display a list of Users from a selected User Group. The back-end model of com_users has some authentication so that you cannot get data from the Users table if you are not logged in.

This PR adds a Front-end View + Model for Users and User.
It adds a new menu item type In the back-end:

Testing Instructions

Create some Users that you assign to some User Group (e.g. Author and Editor).
Add some Articles that you assign to those new Users.

In Menus > Main Menu, create a New Menu Item of type "Users: List Users from a Group"

users-backend1

Under the "Users" tab, configure what the new menu item should display:

  • User Groups: select a few
  • Exclude Users: select a few
  • Select if you want to see a Header or not
  • Configure if you want to see the Number of Articles by that User
  • Configure if you want to see the Last Visit date of that User
  • Configure the Date Format if you want to show it differently
  • Configure if you want to see the Online status of that User

users-backend2

Expected result

Front-end view: Users

users-front-end1

Front-end view: Single User

users-front-end2

@joomla-cms-bot joomla-cms-bot added Language Change This is for Translators PR-4.0-dev labels May 5, 2019
components/com_users/Controller/UserController.php Outdated Show resolved Hide resolved
components/com_users/Model/UserModel.php Outdated Show resolved Hide resolved
components/com_users/Model/UserModel.php Show resolved Hide resolved
components/com_users/Model/UsersModel.php Show resolved Hide resolved
components/com_users/Model/UsersModel.php Outdated Show resolved Hide resolved
components/com_users/tmpl/user/default.php Outdated Show resolved Hide resolved
components/com_users/tmpl/users/default.php Outdated Show resolved Hide resolved
@SniperSister
Copy link
Contributor

General comment: we should make sure that by default, no listings are available. Site owners should be explicetly required to configure a menu item and select the corresponding user groups.

@brianteeman
Copy link
Contributor

on a site with 10,000 users is it practical to have the exclude users filter?

@brianteeman
Copy link
Contributor

In joomla 4 we don't use class="chzn-color" instead it should be class="switcher"
and for the label it should not be the words "Show Feature" with options yes/no but simply "Feature" with options show/hide

@SharkyKZ
Copy link
Contributor

SharkyKZ commented May 5, 2019

This sounds like a redo of #21441.

👎 for hardcoding com_content into this. Would be better if this was extendable with plugins.

@brianteeman
Copy link
Contributor

I agree with @SharkyKZ this should not be hardcoded to a single component

@pe7er
Copy link
Contributor Author

pe7er commented May 5, 2019

on a site with 10,000 users is it practical to have the exclude users filter?

Yes, in case you would have 10,000 Authors and you would exclude 3,000,
then it is indeed rather impractical to select those 3,000 Users to exclude manually.

In that case I would advice you to create different User Groups (Authors_listed, Authors_unlisted).

This feature is useful if you just want to exclude a couple of Authors from being displayed.

@brianteeman
Copy link
Contributor

brianteeman commented May 5, 2019

The 10,000 user list would still be created

@pe7er
Copy link
Contributor Author

pe7er commented May 5, 2019

In joomla 4 we don't use class="chzn-color" instead it should be class="switcher"
and for the label it should not be the words "Show Feature" with options yes/no but simply "Feature" with options show/hide

@brianteeman Ok, I have seen the class="switcher" being used for yes/no.

How would can I use it for 3 options?
For: Use Global / Hide / Show ?

@pe7er
Copy link
Contributor Author

pe7er commented May 5, 2019

The 10,000 user list would still be creayed

IMHO for the case I described, excluding a couple of users, the Exclude function would be workable

@brianteeman
Copy link
Contributor

brianteeman commented May 5, 2019

How would can I use it for 3 options?

You can't - it is only for 2. But I dont see any cases of you having 3 in this pr

@brianteeman
Copy link
Contributor

The 10,000 user list would still be creayed

IMHO for the case I described, excluding a couple of users, the Exclude function would be workable

Sorry you missed my point. Its not about would the select list be usable it is that the select list is always going to be created. That will be a big performance hit

@pe7er
Copy link
Contributor Author

pe7er commented May 5, 2019

This sounds like a redo of #21441.

for hardcoding com_content into this. Would be better if this was extendable with plugins.

@SharkyKZ @brianteeman Feel free to improve this PR that it works with extendable plugins.

@pe7er
Copy link
Contributor Author

pe7er commented May 5, 2019

Sorry you missed my point. Its not about would the select list be usable it is that the select list is always going to be created. That will be a big performance hit

@brianteeman Ok, you mean with the rendering of such a list itself...
I thought you meant that selecting many users from the list would be difficult.

What would you recommend instead?
A textarea where the userids numbers can be added comma delimited?

@brianteeman
Copy link
Contributor

I honestly don't know. I just knew it was an issue because I faced it on a site once before.

I am still not convinced that this is something for core

@brianteeman
Copy link
Contributor

Looking forward to seeing the new and updated pr based on our discussion at #jd19nl

@pe7er
Copy link
Contributor Author

pe7er commented May 28, 2019

I've rewritten this PR to #25030 in which I've decoupled it from the Articles.
In the new PR I've also added Custom Fields support for Users.

Thank you all for testing + your feedback to this PR.
Closing this PR...

@ghost ghost closed this May 28, 2019
@brianteeman
Copy link
Contributor

Thanks for updating

This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Language Change This is for Translators
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants