-
Notifications
You must be signed in to change notification settings - Fork 46
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
Extract user deletion into a new service #918
Conversation
Codecov Report
@@ Coverage Diff @@
## 2.x #918 +/- ##
=========================================
Coverage 43.90% 43.90%
Complexity 3030 3030
=========================================
Files 343 343
Lines 11136 11136
=========================================
Hits 4889 4889
Misses 6247 6247 |
src/UserRemovalHandler.php
Outdated
$developer = $this->entityTypeManager->getStorage('developer')->load($account->getEmail()); | ||
// Sanity check, the developer may not exist in Apigee Edge. | ||
if ($developer) { | ||
$developer->delete(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would be nice to have an info
level log message in logs about the removal of the developer. I know this is a change compared with the original implementation, but only a minor one.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added info level logging when the developer is deleted.
apigee_edge.module
Outdated
@@ -38,6 +38,7 @@ use Drupal\apigee_edge\Form\DeveloperSettingsForm; | |||
use Drupal\apigee_edge\JobExecutor; | |||
use Drupal\apigee_edge\Plugin\Field\FieldType\ApigeeEdgeDeveloperIdFieldItem; | |||
use Drupal\apigee_edge\Plugin\Validation\Constraint\DeveloperEmailUniqueValidator; | |||
use Drupal\apigee_edge\UserRemovalHandler; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe place this class and the interface under the Drupal\apigee_edge\User
namespace
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Refactored
This is a 2.x backport of #919. |
@FCsongradi #919 has changes, backporting them can wait until a review from maintainers. |
* Extract user deletion into a new service Introduce a programming API for downstream developers that allows customizing what should happen when a user is deleted in Drupal. Co-authored-by: Dezső BICZÓ <[email protected]> * Leverage the new user removal handler API for cascade deleting team roles * Better naming for the new API and implementations --------- Co-authored-by: ferenc.csongradi <[email protected]>
The build failed because Codecove update failed. Should be ready for review. |
@mxr576 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Pull request for issue 915.