- First commit to issue fork.
- πͺπΈSpain aleix
I am working on this in the Issue's fork, it works ok with 4.0.x, and also I add the delete button to remove an existing social_auth entity for a specific user.
But I cannot find a way to set a new tab for the user using the new view social_auth_profiles. I have followed the same procedure as https://www.webwash.net/custom-tab-user-profile-page-views-drupal-8/ .
Inputs on this are welcome.
Another module that is adding a view to user tabs is commerce_order from commerce module, the only difference is the validation criteria of argument which uses this : https://git.drupalcode.org/project/commerce/-/blob/8.x-2.x/src/Plugin/vi... . But i don't think it changes anything (will test it picking the argument_validator plugin code to social_auth... )
- last update
over 1 year ago Patch Failed to Apply - πͺπΈSpain aleix
I think that this is not possible because of: https://www.drupal.org/project/drupal/issues/2528166 β¨ Upcast named arguments/named parameters in views Needs work . While not able to use named parameters we cannot add tabs to user. If anyone had success in creating a user tab with views let me know.
So by now a new controller shows a list in
user/{user}/social-auth-profiles
.What is done in the MR:
- The controller tries to render the (included) view with idviews.view.social_auth_profiles
, if not found, it will use the included entitylistbuilder but limiting the list to show just the social_auth profiles belonging to user. - Status changed to Needs review
over 1 year ago 9:20pm 17 May 2023 - last update
over 1 year ago 3 pass, 4 fail - @aleix opened merge request.
- last update
over 1 year ago 5 pass - Status changed to Needs work
over 1 year ago 10:13am 18 May 2023 - πͺπΈSpain aleix
Needs:
- Add tests
- social_auth entity access class - last update
over 1 year ago Unable to generate test groups - Status changed to Needs review
over 1 year ago 1:52pm 18 May 2023 - πͺπΈSpain aleix
Ready to review!
As you can see there's a new access control for social auth entity, also a new permission, "delete own social auth profiles" . Also I have done functional tests for social auth removal and social auth profiles lists access and operations. - last update
over 1 year ago 9 pass - Status changed to Needs work
over 1 year ago 4:32pm 6 June 2023 - πΊπΈUnited States wells Seattle, WA
@aleix --
Thanks for taking this up! I have tested the branch out and it works as designed however I have a few bigger concerns:
- I'd rather not have a hard requirement on Views. While it's highly likely for sites to have Views installed and enabled I don't think Social Auth should be requiring it. We'll want to make this an optional feature.
- There is currently no migration path. We'd want an update hook that checks if Views is enabled and installs the new view.
- The view itself is pretty basic. Ideally there should be a way to search on username and filter by provider.
- While the view is useful I would rather be able to see/manage profiles directly from the user edit form. This would take better advantage of the core user functionality and I think entirely eliminate the need for a custom view. I can't recall off the top of my head but I know there is a some module that has entities related to a user that can accessed and managed from the user edit page easily. This would provide a good example and I'll update again if I can remember what module it is...
- πͺπΈSpain aleix
To address what you said in point 1 and 2, Maybe the view could be placed in
config/optional
as said in: https://www.drupal.org/node/2453919 β , so view will be installed when dependencies are met.About point 3, I am agree that view is basic, it could be expanded to include search and filters.
Referring the 4th point, are you thinking with dynamic field with a fieldwidget to be seen in edit form? Or a block with entities list shown in edit form? The way I did is like activitypub module is already doing ( https://git.drupalcode.org/project/activitypub/-/blob/1.0.x/activitypub.... ), also how openid did it ( https://git.drupalcode.org/project/openid_connect/-/blob/2.x/openid_conn... ). Anyway, the example that you said would be great.
- πΊπΈUnited States wells Seattle, WA
To address what you said in point 1 and 2, Maybe the view could be placed in config/optional as said in: https://www.drupal.org/node/2453919 β , so view will be installed when dependencies are met.
Yep I think that makes sense. Though it would still only address new installs -- we'd want an update hook as well.
Referring the 4th point, are you thinking with dynamic field with a fieldwidget to be seen in edit form? Or a block with entities list shown in edit form?
I think a block with entities shown in the edit form (with the delete option for each entity). Social Auth Twitter is the module I was thinking of that does something like this -- see: https://git.drupalcode.org/project/social_post_twitter/-/blob/3.x/social.... Not sure if that approach is still the best for 10.x+ but that's the idea.
- last update
over 1 year ago 9 pass - πͺπΈSpain aleix
Here again! Let's see if it is better now.
What I have done:
- A field in user form to list both the connected social auth profiles and the networks available to connect. In the case of connected ones it just lists the profile with greater id, so it will not show duplicated profiles for each network, also it will show the social auth profile status so will show if token is expired or already valid, also it will allow the operations of removal existing connected profiles auths or to connect. It's an adaptation of the social_auth_twitter implementation that wells suggests, but adapting to a generic use case.
- View config moved to config/optional as said in previous comments.
- View import when updating the module.Next image summarize the new field:
- Status changed to Needs review
over 1 year ago 12:32pm 9 August 2023 - last update
over 1 year ago 9 pass - Status changed to Needs work
over 1 year ago 5:46pm 1 September 2023 - last update
over 1 year ago 9 pass - Status changed to Needs review
over 1 year ago 12:27pm 10 September 2023 - Status changed to Needs work
over 1 year ago 3:22pm 13 September 2023 - last update
over 1 year ago 9 pass - Status changed to Needs review
over 1 year ago 4:45pm 17 September 2023 - Status changed to Fixed
about 1 year ago 9:52pm 19 September 2023 - πΊπΈUnited States wells Seattle, WA
Thanks for you work on this, @aleix! This is a great new feature.
Automatically closed - issue fixed for 2 weeks with no activity.