From e4081e6c1a949376096eccaee4b63b2b0c90f767 Mon Sep 17 00:00:00 2001
From: Alfonso Salces
+ {{ '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 cf8197521..58bea8d9f 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; }