diff --git a/assets/controllers/notification_controller.js b/assets/controllers/notification_controller.js index 35f6a26..ed4d35d 100644 --- a/assets/controllers/notification_controller.js +++ b/assets/controllers/notification_controller.js @@ -177,9 +177,10 @@ export default class extends Controller { getIcon(type) { const icons = { user_joined: '', - user_invited: '', - user_accepted: '', - user_removed: '', + user_invited: '', + user_accepted: '', + user_removed: '', + user_deactivated: '', org_update: '', app_access: '', role_changed: '', @@ -189,10 +190,11 @@ export default class extends Controller { getIconBgClass(type) { const classes = { - user_joined: 'bg-success', + user_joined: 'bg-primary', user_invited: 'bg-info', - user_accepted: 'bg-success', + user_accepted: 'bg-primary', user_removed: 'bg-danger', + user_deactivated: 'bg-warning', org_update: 'bg-warning', app_access: 'bg-primary', role_changed: 'bg-info', diff --git a/assets/styles/app.css b/assets/styles/app.css index 397f7b6..bde65b2 100644 --- a/assets/styles/app.css +++ b/assets/styles/app.css @@ -111,7 +111,7 @@ body { } .color-primary{ - color: var(--primary-blue-light); + color: var(--primary-blue-light) !important; } .color-primary-dark{ color: var(--primary-blue-dark); @@ -136,4 +136,12 @@ body { .color-secondary{ color: var(--secondary); +} + +.bg-primary{ + background-color: var(--primary-blue-light) !important; +} + +.bg-warning{ + background-color: var(--secondary) !important; } \ No newline at end of file diff --git a/src/Controller/UserController.php b/src/Controller/UserController.php index 9afdc09..d083b96 100644 --- a/src/Controller/UserController.php +++ b/src/Controller/UserController.php @@ -162,6 +162,8 @@ class UserController extends AbstractController $this->logger->notice("User added to organization " . $org->getName()); $this->emailService->sendExistingUserNotificationEmail($existingUser, $org); $this->logger->notice("Existing user notification email sent to " . $existingUser->getUserIdentifier()); + $data = ['user'=>$uo->getUsers(), 'organization'=>$uo->getOrganization()]; + $this->organizationsService->notifyOrganizationAdmins($data,'USER_INVITED'); return $this->redirectToRoute('organization_show', ['id' => $orgId]); } @@ -193,6 +195,8 @@ class UserController extends AbstractController $this->logger->notice("User added to organization " . $org->getName()); $this->emailService->sendPasswordSetupEmail($user, $orgId); $this->logger->notice("Password setup email sent to " . $user->getUserIdentifier()); + $data = ['user'=>$uo->getUsers(), 'organization'=>$uo->getOrganization()]; + $this->organizationsService->notifyOrganizationAdmins($data,'USER_INVITED'); } } $this->actionService->createAction("Create new user", $actingUser, null, $user->getUserIdentifier()); diff --git a/src/Service/NotificationService.php b/src/Service/NotificationService.php index 9f44b2f..c824b1e 100644 --- a/src/Service/NotificationService.php +++ b/src/Service/NotificationService.php @@ -13,6 +13,7 @@ class NotificationService public const TYPE_USER_INVITED = 'user_invited'; public const TYPE_USER_ACCEPTED = 'user_accepted'; public const TYPE_USER_REMOVED = 'user_removed'; + public const TYPE_USER_DEACTIVATED = 'user_deactivated'; public const TYPE_ORG_UPDATE = 'org_update'; public const TYPE_APP_ACCESS = 'app_access'; public const TYPE_ROLE_CHANGED = 'role_changed'; @@ -63,7 +64,7 @@ class NotificationService { $this->send( recipient: $recipient, - type: self::TYPE_USER_REMOVED, + type: self::TYPE_USER_DEACTIVATED, title: 'Membre retiré', message: sprintf('%s %s a été désactivé de %s', $removedUser->getName(), $removedUser->getSurname(), $organization->getName()), data: [ @@ -154,7 +155,7 @@ class NotificationService { $this->send( recipient: $recipient, - type: 'user_deleted', + type: self::TYPE_USER_REMOVED, title: 'Utilisateur supprimé', message: sprintf('L\'utilisateur %s %s a été supprimé du système', $deletedUser->getName(),