diff --git a/src/core/features/user/pages/profile/profile.html b/src/core/features/user/pages/profile/profile.html index 38dacf0911a..a46586e4823 100644 --- a/src/core/features/user/pages/profile/profile.html +++ b/src/core/features/user/pages/profile/profile.html @@ -26,6 +26,10 @@

{{ user.fullname }}

{{ 'core.user.roles' | translate}}{{'core.labelsep' | translate}} {{ rolesFormatted }}

+

+ {{ 'core.group' | translate}}{{'core.labelsep' | translate}} + {{ userGroups }} +

{{ 'core.lastaccess' | translate }}: {{ user.lastaccess | coreTimeAgo }} diff --git a/src/core/features/user/pages/profile/profile.ts b/src/core/features/user/pages/profile/profile.ts index cf8197521a9..58bea8d9f20 100644 --- a/src/core/features/user/pages/profile/profile.ts +++ b/src/core/features/user/pages/profile/profile.ts @@ -53,6 +53,7 @@ export class CoreUserProfilePage implements OnInit, OnDestroy { protected subscription?: Subscription; protected logView: (user: CoreUserProfile) => void; + userGroups?: string; userLoaded = false; isLoadingHandlers = false; user?: CoreUserProfile; @@ -133,6 +134,11 @@ export class CoreUserProfilePage implements OnInit, OnDestroy { try { await this.fetchUser(); + + if (this.courseId && this.user && 'groups' in this.user) { + const separator = Translate.instant('core.listsep'); + this.userGroups = this.user.groups?.map(group => group.name).join(separator + ' '); + } } finally { this.userLoaded = true; }