diff --git a/lang/en.json b/lang/en.json index c9a9c11929c5e68924cf201b129ea2e74247d63b..224002d6317ab79f40be175203e9f53c73647593 100755 --- a/lang/en.json +++ b/lang/en.json @@ -649,6 +649,7 @@ "licence": "GNU GPLv3 license", "groupsToManage": "Choose the authorized assignment groups", "unlinkGroup": "Unlink group", - "emptyGroups": "No groups available to associate" + "emptyGroups": "No groups available to associate", + "emptyGroupUsers": "No users associated with this group" } } \ No newline at end of file diff --git a/lang/fr.json b/lang/fr.json index bfcad10f72c2eb42d69b84a58c76a82d3411a956..a02eb1fe029f6c1db6b381ce16d60dfefb35ba07 100755 --- a/lang/fr.json +++ b/lang/fr.json @@ -648,6 +648,7 @@ "licence": "licence GNU GPLv3", "groupsToManage": "Choisir les groupes d'affectations autorisés", "unlinkGroup": "Dissocier le groupe", - "emptyGroups": "Aucun groupe disponible à associer" + "emptyGroups": "Aucun groupe disponible à associer", + "emptyGroupUsers": "Aucun utilisateur associé à ce groupe" } } diff --git a/src/frontend/app/administration/group/group.component.html b/src/frontend/app/administration/group/group.component.html index 4643365fa63bd6b55163dd8d7d3bc9abb3b39f23..c7febb6003fdeb543bb748f65c04ec30f5e434ee 100644 --- a/src/frontend/app/administration/group/group.component.html +++ b/src/frontend/app/administration/group/group.component.html @@ -35,7 +35,7 @@ <ion-searchbar [placeholder]="'lang.filter' | translate" style="margin-left: 4x; display: flex; width: 50%;" (ionChange)="applyFilter($event.detail.value)"> </ion-searchbar> - <ion-card *ngIf="!creationMode" style="height: 400px; overflow-y: auto;"> + <ion-content *ngIf="!creationMode" style="height: 400px; overflow-y: auto;"> <ion-list> <ion-item style="position: sticky;top:0px;z-index:1;"> <ng-container style="display: flex;align-items: center;justify-content: center;width: 100%;background: white;"> @@ -73,8 +73,15 @@ </ion-button> </ion-item> </ion-virtual-scroll> + <ion-infinite-scroll threshold="100px" (ionInfinite)="loadData($event)" *ngIf="group.users.length > 7"> + <ion-infinite-scroll-content loadingSpinner="bubbles" [loadingText]="'lang.loadingMoreData' | translate"> + </ion-infinite-scroll-content> + </ion-infinite-scroll> </ion-list> - </ion-card> + <ion-item lines="none" *ngIf="group.users.length === 0" style="text-align: center; font-size: 20px; color: gray; margin-top: 5px;"> + <ion-label>{{ 'lang.emptyGroupUsers' | translate }}</ion-label> + </ion-item> + </ion-content> <ion-item text-center lines="none" style="position: sticky;bottom:0px;z-index:1;"> <div style="display: flex;align-items: center;justify-content: center;width: 100%;background: white;"> <ion-button type="submit" shape="round" size="large" fill="outline" color="primary" diff --git a/src/frontend/app/administration/group/group.component.ts b/src/frontend/app/administration/group/group.component.ts index d17dee44095f02f094368a2768cf93b649fd7ea6..010ca5311282fee205ab520a782bb2777454536b 100644 --- a/src/frontend/app/administration/group/group.component.ts +++ b/src/frontend/app/administration/group/group.component.ts @@ -84,7 +84,7 @@ export class GroupComponent implements OnInit { this.creationMode = false; this.usersList = []; - this.http.get('../rest/groups/' + params['id']) + this.http.get(`../rest/groups/${params['id']}`) .pipe( map((data: any) => data.group), finalize(() => { @@ -462,6 +462,16 @@ export class GroupComponent implements OnInit { canManage(privilege: any) { return privilege.id === 'manage_users' && privilege.checked; } + + loadData(event: any) { + this.http.get(`../rest/groups/${this.group.id}`).pipe( + tap((data: any) => { + this.group.users = data.group.users; + event.target.complete(); + event.target.disabled = true; + }) + ).subscribe(); + } }