Skip to content

Commit d305e60

Browse files
tdonohuegithub-actions[bot]
authored andcommitted
Address feedback. Run empty search on init. Reorder sections to list current members before add members (for both eperson and groups)
(cherry picked from commit 9117ac0)
1 parent 37ae09a commit d305e60

4 files changed

Lines changed: 105 additions & 103 deletions

File tree

src/app/access-control/group-registry/group-form/members-list/members-list.component.html

Lines changed: 54 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,60 @@
11
<ng-container>
22
<h3 class="border-bottom pb-2">{{messagePrefix + '.head' | translate}}</h3>
33

4+
<h4>{{messagePrefix + '.headMembers' | translate}}</h4>
5+
6+
<ds-pagination *ngIf="(ePeopleMembersOfGroup | async)?.totalElements > 0"
7+
[paginationOptions]="config"
8+
[pageInfoState]="(ePeopleMembersOfGroup | async)"
9+
[collectionSize]="(ePeopleMembersOfGroup | async)?.totalElements"
10+
[hideGear]="true"
11+
[hidePagerWhenSinglePage]="true">
12+
13+
<div class="table-responsive">
14+
<table id="ePeopleMembersOfGroup" class="table table-striped table-hover table-bordered">
15+
<thead>
16+
<tr>
17+
<th scope="col" class="align-middle">{{messagePrefix + '.table.id' | translate}}</th>
18+
<th scope="col" class="align-middle">{{messagePrefix + '.table.name' | translate}}</th>
19+
<th scope="col" class="align-middle">{{messagePrefix + '.table.identity' | translate}}</th>
20+
<th class="align-middle">{{messagePrefix + '.table.edit' | translate}}</th>
21+
</tr>
22+
</thead>
23+
<tbody>
24+
<tr *ngFor="let eperson of (ePeopleMembersOfGroup | async)?.page">
25+
<td class="align-middle">{{eperson.id}}</td>
26+
<td class="align-middle">
27+
<a (click)="ePersonDataService.startEditingNewEPerson(eperson)"
28+
[routerLink]="[ePersonDataService.getEPeoplePageRouterLink()]">
29+
{{ dsoNameService.getName(eperson) }}
30+
</a>
31+
</td>
32+
<td class="align-middle">
33+
{{messagePrefix + '.table.email' | translate}}: {{ eperson.email ? eperson.email : '-' }}<br/>
34+
{{messagePrefix + '.table.netid' | translate}}: {{ eperson.netid ? eperson.netid : '-' }}
35+
</td>
36+
<td class="align-middle">
37+
<div class="btn-group edit-field">
38+
<button (click)="deleteMemberFromGroup(eperson)"
39+
[disabled]="actionConfig.remove.disabled"
40+
[ngClass]="['btn btn-sm', actionConfig.remove.css]"
41+
title="{{messagePrefix + '.table.edit.buttons.remove' | translate: { name: dsoNameService.getName(eperson) } }}">
42+
<i [ngClass]="actionConfig.remove.icon"></i>
43+
</button>
44+
</div>
45+
</td>
46+
</tr>
47+
</tbody>
48+
</table>
49+
</div>
50+
51+
</ds-pagination>
52+
53+
<div *ngIf="(ePeopleMembersOfGroup | async) == undefined || (ePeopleMembersOfGroup | async)?.totalElements == 0" class="alert alert-info w-100 mb-2"
54+
role="alert">
55+
{{messagePrefix + '.no-members-yet' | translate}}
56+
</div>
57+
458
<h4 id="search" class="border-bottom pb-2">
559
<span
660
*dsContextHelp="{
@@ -84,58 +138,4 @@ <h4 id="search" class="border-bottom pb-2">
84138
{{messagePrefix + '.no-items' | translate}}
85139
</div>
86140

87-
<h4>{{messagePrefix + '.headMembers' | translate}}</h4>
88-
89-
<ds-pagination *ngIf="(ePeopleMembersOfGroup | async)?.totalElements > 0"
90-
[paginationOptions]="config"
91-
[pageInfoState]="(ePeopleMembersOfGroup | async)"
92-
[collectionSize]="(ePeopleMembersOfGroup | async)?.totalElements"
93-
[hideGear]="true"
94-
[hidePagerWhenSinglePage]="true">
95-
96-
<div class="table-responsive">
97-
<table id="ePeopleMembersOfGroup" class="table table-striped table-hover table-bordered">
98-
<thead>
99-
<tr>
100-
<th scope="col" class="align-middle">{{messagePrefix + '.table.id' | translate}}</th>
101-
<th scope="col" class="align-middle">{{messagePrefix + '.table.name' | translate}}</th>
102-
<th scope="col" class="align-middle">{{messagePrefix + '.table.identity' | translate}}</th>
103-
<th class="align-middle">{{messagePrefix + '.table.edit' | translate}}</th>
104-
</tr>
105-
</thead>
106-
<tbody>
107-
<tr *ngFor="let eperson of (ePeopleMembersOfGroup | async)?.page">
108-
<td class="align-middle">{{eperson.id}}</td>
109-
<td class="align-middle">
110-
<a (click)="ePersonDataService.startEditingNewEPerson(eperson)"
111-
[routerLink]="[ePersonDataService.getEPeoplePageRouterLink()]">
112-
{{ dsoNameService.getName(eperson) }}
113-
</a>
114-
</td>
115-
<td class="align-middle">
116-
{{messagePrefix + '.table.email' | translate}}: {{ eperson.email ? eperson.email : '-' }}<br/>
117-
{{messagePrefix + '.table.netid' | translate}}: {{ eperson.netid ? eperson.netid : '-' }}
118-
</td>
119-
<td class="align-middle">
120-
<div class="btn-group edit-field">
121-
<button (click)="deleteMemberFromGroup(eperson)"
122-
[disabled]="actionConfig.remove.disabled"
123-
[ngClass]="['btn btn-sm', actionConfig.remove.css]"
124-
title="{{messagePrefix + '.table.edit.buttons.remove' | translate: { name: dsoNameService.getName(eperson) } }}">
125-
<i [ngClass]="actionConfig.remove.icon"></i>
126-
</button>
127-
</div>
128-
</td>
129-
</tr>
130-
</tbody>
131-
</table>
132-
</div>
133-
134-
</ds-pagination>
135-
136-
<div *ngIf="(ePeopleMembersOfGroup | async) == undefined || (ePeopleMembersOfGroup | async)?.totalElements == 0" class="alert alert-info w-100 mb-2"
137-
role="alert">
138-
{{messagePrefix + '.no-members-yet' | translate}}
139-
</div>
140-
141141
</ng-container>

src/app/access-control/group-registry/group-form/members-list/members-list.component.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,7 @@ export class MembersListComponent implements OnInit, OnDestroy {
152152
if (activeGroup != null) {
153153
this.groupBeingEdited = activeGroup;
154154
this.retrieveMembers(this.config.currentPage);
155+
this.search({query: ''});
155156
}
156157
}));
157158
}

src/app/access-control/group-registry/group-form/subgroup-list/subgroups-list.component.html

Lines changed: 49 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,55 @@
11
<ng-container>
22
<h3 class="border-bottom pb-2">{{messagePrefix + '.head' | translate}}</h3>
33

4+
<h4>{{messagePrefix + '.headSubgroups' | translate}}</h4>
5+
6+
<ds-pagination *ngIf="(subGroups$ | async)?.payload?.totalElements > 0"
7+
[paginationOptions]="config"
8+
[pageInfoState]="(subGroups$ | async)?.payload"
9+
[collectionSize]="(subGroups$ | async)?.payload?.totalElements"
10+
[hideGear]="true"
11+
[hidePagerWhenSinglePage]="true">
12+
13+
<div class="table-responsive">
14+
<table id="subgroupsOfGroup" class="table table-striped table-hover table-bordered">
15+
<thead>
16+
<tr>
17+
<th scope="col" class="align-middle">{{messagePrefix + '.table.id' | translate}}</th>
18+
<th scope="col" class="align-middle">{{messagePrefix + '.table.name' | translate}}</th>
19+
<th scope="col" class="align-middle">{{messagePrefix + '.table.collectionOrCommunity' | translate}}</th>
20+
<th>{{messagePrefix + '.table.edit' | translate}}</th>
21+
</tr>
22+
</thead>
23+
<tbody>
24+
<tr *ngFor="let group of (subGroups$ | async)?.payload?.page">
25+
<td class="align-middle">{{group.id}}</td>
26+
<td class="align-middle">
27+
<a (click)="groupDataService.startEditingNewGroup(group)"
28+
[routerLink]="[groupDataService.getGroupEditPageRouterLink(group)]">
29+
{{ dsoNameService.getName(group) }}
30+
</a>
31+
</td>
32+
<td class="align-middle">{{ dsoNameService.getName((group.object | async)?.payload)}}</td>
33+
<td class="align-middle">
34+
<div class="btn-group edit-field">
35+
<button (click)="deleteSubgroupFromGroup(group)"
36+
class="btn btn-outline-danger btn-sm deleteButton"
37+
title="{{messagePrefix + '.table.edit.buttons.remove' | translate: { name: dsoNameService.getName(group) } }}">
38+
<i class="fas fa-trash-alt fa-fw"></i>
39+
</button>
40+
</div>
41+
</td>
42+
</tr>
43+
</tbody>
44+
</table>
45+
</div>
46+
</ds-pagination>
47+
48+
<div *ngIf="(subGroups$ | async)?.payload?.totalElements == 0" class="alert alert-info w-100 mb-2"
49+
role="alert">
50+
{{messagePrefix + '.no-subgroups-yet' | translate}}
51+
</div>
52+
453
<h4 id="search" class="border-bottom pb-2">
554
<span *dsContextHelp="{
655
content: 'admin.access-control.groups.form.tooltip.editGroup.addSubgroups',
@@ -80,53 +129,4 @@ <h4 id="search" class="border-bottom pb-2">
80129
{{messagePrefix + '.no-items' | translate}}
81130
</div>
82131

83-
<h4>{{messagePrefix + '.headSubgroups' | translate}}</h4>
84-
85-
<ds-pagination *ngIf="(subGroups$ | async)?.payload?.totalElements > 0"
86-
[paginationOptions]="config"
87-
[pageInfoState]="(subGroups$ | async)?.payload"
88-
[collectionSize]="(subGroups$ | async)?.payload?.totalElements"
89-
[hideGear]="true"
90-
[hidePagerWhenSinglePage]="true">
91-
92-
<div class="table-responsive">
93-
<table id="subgroupsOfGroup" class="table table-striped table-hover table-bordered">
94-
<thead>
95-
<tr>
96-
<th scope="col" class="align-middle">{{messagePrefix + '.table.id' | translate}}</th>
97-
<th scope="col" class="align-middle">{{messagePrefix + '.table.name' | translate}}</th>
98-
<th scope="col" class="align-middle">{{messagePrefix + '.table.collectionOrCommunity' | translate}}</th>
99-
<th>{{messagePrefix + '.table.edit' | translate}}</th>
100-
</tr>
101-
</thead>
102-
<tbody>
103-
<tr *ngFor="let group of (subGroups$ | async)?.payload?.page">
104-
<td class="align-middle">{{group.id}}</td>
105-
<td class="align-middle">
106-
<a (click)="groupDataService.startEditingNewGroup(group)"
107-
[routerLink]="[groupDataService.getGroupEditPageRouterLink(group)]">
108-
{{ dsoNameService.getName(group) }}
109-
</a>
110-
</td>
111-
<td class="align-middle">{{ dsoNameService.getName((group.object | async)?.payload)}}</td>
112-
<td class="align-middle">
113-
<div class="btn-group edit-field">
114-
<button (click)="deleteSubgroupFromGroup(group)"
115-
class="btn btn-outline-danger btn-sm deleteButton"
116-
title="{{messagePrefix + '.table.edit.buttons.remove' | translate: { name: dsoNameService.getName(group) } }}">
117-
<i class="fas fa-trash-alt fa-fw"></i>
118-
</button>
119-
</div>
120-
</td>
121-
</tr>
122-
</tbody>
123-
</table>
124-
</div>
125-
</ds-pagination>
126-
127-
<div *ngIf="(subGroups$ | async)?.payload?.totalElements == 0" class="alert alert-info w-100 mb-2"
128-
role="alert">
129-
{{messagePrefix + '.no-subgroups-yet' | translate}}
130-
</div>
131-
132132
</ng-container>

src/app/access-control/group-registry/group-form/subgroup-list/subgroups-list.component.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,7 @@ export class SubgroupsListComponent implements OnInit, OnDestroy {
102102
if (activeGroup != null) {
103103
this.groupBeingEdited = activeGroup;
104104
this.retrieveSubGroups();
105+
this.search({query: ''});
105106
}
106107
}));
107108
}

0 commit comments

Comments
 (0)