Skip to content

Commit f5952b1

Browse files
Johaney-sxflord
authored andcommitted
feat(admin): allow sorting members by email, org and statuses
* backend resolver respects GUI's current setting in showing the values * email: 1. user preferred mail, 2. member mail * organization: 1. member organization, 2. (IdP's) user organization
1 parent 0ff54a1 commit f5952b1

24 files changed

+1417
-379
lines changed

angular.json

Lines changed: 322 additions & 100 deletions
Large diffs are not rendered by default.

libs/perun/components/src/lib/members-dynamic-list/members-dynamic-list.component.html

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,9 @@
7171
</td>
7272
</ng-container>
7373
<ng-container matColumnDef="status">
74-
<th *matHeaderCellDef mat-header-cell>{{'MEMBERS_LIST.STATUS' | translate}}</th>
74+
<th *matHeaderCellDef mat-header-cell mat-sort-header>
75+
{{'MEMBERS_LIST.STATUS' | translate}}
76+
</th>
7577
<td *matCellDef="let member" mat-cell>
7678
<i
7779
(click)="openMembershipDialog($event, member)"
@@ -87,7 +89,9 @@
8789
</td>
8890
</ng-container>
8991
<ng-container matColumnDef="groupStatus">
90-
<th *matHeaderCellDef mat-header-cell>{{'MEMBERS_LIST.GROUP_STATUS' | translate}}</th>
92+
<th *matHeaderCellDef mat-header-cell mat-sort-header>
93+
{{'MEMBERS_LIST.GROUP_STATUS' | translate}}
94+
</th>
9195
<td *matCellDef="let member" mat-cell>
9296
<i
9397
(click)="openMembershipDialog($event, member, groupId)"
@@ -103,11 +107,15 @@
103107
</td>
104108
</ng-container>
105109
<ng-container matColumnDef="organization">
106-
<th *matHeaderCellDef mat-header-cell>{{'MEMBERS_LIST.ORGANIZATION' | translate}}</th>
110+
<th *matHeaderCellDef mat-header-cell mat-sort-header>
111+
{{'MEMBERS_LIST.ORGANIZATION' | translate}}
112+
</th>
107113
<td *matCellDef="let member" mat-cell>{{member | memberOrganization}}</td>
108114
</ng-container>
109115
<ng-container matColumnDef="email">
110-
<th *matHeaderCellDef mat-header-cell>{{'MEMBERS_LIST.EMAIL' | translate}}</th>
116+
<th *matHeaderCellDef mat-header-cell mat-sort-header>
117+
{{'MEMBERS_LIST.EMAIL' | translate}}
118+
</th>
111119
<td *matCellDef="let member" mat-cell>{{member | memberEmail}}</td>
112120
</ng-container>
113121
<ng-container matColumnDef="logins">

libs/perun/components/src/lib/members-dynamic-list/members-dynamic-list.component.ts

Lines changed: 25 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,12 @@ import {
1818
TableCheckbox,
1919
EntityStorageService,
2020
} from '@perun-web-apps/perun/services';
21-
import { MemberGroupStatus, RichMember, VoMemberStatuses } from '@perun-web-apps/perun/openapi';
21+
import {
22+
MemberGroupStatus,
23+
MembersOrderColumn,
24+
RichMember,
25+
VoMemberStatuses,
26+
} from '@perun-web-apps/perun/openapi';
2227
import { MatDialog } from '@angular/material/dialog';
2328
import {
2429
TABLE_ITEMS_COUNT_OPTIONS,
@@ -204,7 +209,7 @@ export class MembersDynamicListComponent implements AfterViewInit, OnInit, OnCha
204209

205210
loadMembersPage(): void {
206211
const sortDirection = this.sort.direction === 'asc' ? 'ASCENDING' : 'DESCENDING';
207-
const sortColumn = this.sort.active === 'fullName' ? 'NAME' : 'ID';
212+
const sortColumn = this.getSortColumn(this.sort.active);
208213
this.dataSource.loadMembers(
209214
this.voId,
210215
this.attrNames,
@@ -232,7 +237,7 @@ export class MembersDynamicListComponent implements AfterViewInit, OnInit, OnCha
232237

233238
exportAllData(format: string): void {
234239
const sortDirection = this.sort.direction === 'asc' ? 'ASCENDING' : 'DESCENDING';
235-
const sortColumn = this.sort.active === 'fullName' ? 'NAME' : 'ID';
240+
const sortColumn = this.getSortColumn(this.sort.active);
236241

237242
const config = getDefaultDialogConfig();
238243
config.width = '300px';
@@ -271,4 +276,21 @@ export class MembersDynamicListComponent implements AfterViewInit, OnInit, OnCha
271276

272277
this.dialog.open(MemberTreeViewDialogComponent, config);
273278
}
279+
280+
getSortColumn(value: string): MembersOrderColumn {
281+
switch (value) {
282+
case 'fullName':
283+
return 'NAME';
284+
case 'organization':
285+
return 'ORGANIZATION';
286+
case 'email':
287+
return 'EMAIL';
288+
case 'status':
289+
return 'STATUS';
290+
case 'groupStatus':
291+
return 'GROUP_STATUS';
292+
default:
293+
return 'ID';
294+
}
295+
}
274296
}

libs/perun/openapi/src/lib/.openapi-generator/FILES

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,7 @@ model/inputAddApplicationMailForGroup.ts
100100
model/inputAddApplicationMailForVo.ts
101101
model/inputAddDestinationToMultipleServices.ts
102102
model/inputAddDestinationsDefinedByHostsOnFacility.ts
103+
model/inputAddMemberCandidates.ts
103104
model/inputAssignResourceTagToResource.ts
104105
model/inputAssignResourceTagsToResource.ts
105106
model/inputAttributeDefinition.ts
@@ -150,6 +151,7 @@ model/inputGetPaginatedUsers.ts
150151
model/inputGetResources.ts
151152
model/inputGetUsers.ts
152153
model/inputInvitationsFromCsv.ts
154+
model/inputInviteMemberCandidates.ts
153155
model/inputLockPublications.ts
154156
model/inputRemoveResourceTagFromResource.ts
155157
model/inputRemoveResourceTagsFromResource.ts

libs/perun/openapi/src/lib/api/auditMessagesManager.service.ts

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ import { Configuration } from '../configuration';
4141
providedIn: 'root',
4242
})
4343
export class AuditMessagesManagerService {
44-
protected basePath = 'https://perun.cesnet.cz/krb/rpc';
44+
protected basePath = 'https://api-dev.perun-aai.org/ba/rpc';
4545
public defaultHeaders = new HttpHeaders();
4646
public configuration = new Configuration();
4747
public encoder: HttpParameterCodec;
@@ -109,6 +109,7 @@ export class AuditMessagesManagerService {
109109
/**
110110
* Log arbitrary auditer message/event to the audit log.
111111
* @param msg Message to be logged
112+
* @param useNon if set to true sends the request to the backend server as 'non' instead of the usual (oauth, krb...).
112113
* @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body.
113114
* @param reportProgress flag to report request and response progress.
114115
*/
@@ -215,6 +216,7 @@ export class AuditMessagesManagerService {
215216
/**
216217
* Creates new auditer consumer with last processed id which equals current auditer log max id.
217218
* @param consumerName
219+
* @param useNon if set to true sends the request to the backend server as 'non' instead of the usual (oauth, krb...).
218220
* @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body.
219221
* @param reportProgress flag to report request and response progress.
220222
*/
@@ -324,6 +326,7 @@ export class AuditMessagesManagerService {
324326

325327
/**
326328
* Get list of names of all possible events.
329+
* @param useNon if set to true sends the request to the backend server as 'non' instead of the usual (oauth, krb...).
327330
* @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body.
328331
* @param reportProgress flag to report request and response progress.
329332
*/
@@ -413,6 +416,7 @@ export class AuditMessagesManagerService {
413416

414417
/**
415418
* Get all auditer consumers as a map with key&#x3D;value pairs like String(name)&#x3D;Integer(lastProcessedId).
419+
* @param useNon if set to true sends the request to the backend server as 'non' instead of the usual (oauth, krb...).
416420
* @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body.
417421
* @param reportProgress flag to report request and response progress.
418422
*/
@@ -502,6 +506,7 @@ export class AuditMessagesManagerService {
502506

503507
/**
504508
* Get count of all messages stored in auditer logs.
509+
* @param useNon if set to true sends the request to the backend server as 'non' instead of the usual (oauth, krb...).
505510
* @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body.
506511
* @param reportProgress flag to report request and response progress.
507512
*/
@@ -591,6 +596,7 @@ export class AuditMessagesManagerService {
591596

592597
/**
593598
* Get ID of last (newest) message in auditer logs.
599+
* @param useNon if set to true sends the request to the backend server as 'non' instead of the usual (oauth, krb...).
594600
* @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body.
595601
* @param reportProgress flag to report request and response progress.
596602
*/
@@ -681,6 +687,7 @@ export class AuditMessagesManagerService {
681687
/**
682688
* Returns 100 newest audit messages from audit log. If there is a less messages than 100, then all of them are returned OR Returns exact number of newest audit messages defined by \&#39;count\&#39; param (disregarding message IDs). If there is less messages present, then all of them are returned..
683689
* @param count Messages limit
690+
* @param useNon if set to true sends the request to the backend server as 'non' instead of the usual (oauth, krb...).
684691
* @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body.
685692
* @param reportProgress flag to report request and response progress.
686693
*/
@@ -781,6 +788,7 @@ export class AuditMessagesManagerService {
781788
/**
782789
* Returns all messages with IDs within the range from max(ID) to (max(ID)-count), where number of returned messages is equal or less than \&#39;count\&#39; param, because some IDs could be skipped in the sequence.
783790
* @param count Number of IDs to subtract from max_id
791+
* @param useNon if set to true sends the request to the backend server as 'non' instead of the usual (oauth, krb...).
784792
* @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body.
785793
* @param reportProgress flag to report request and response progress.
786794
*/
@@ -888,6 +896,7 @@ export class AuditMessagesManagerService {
888896
* Returns \&quot;count\&quot; number of messages that are more or equal than the given ID (ascending order), i.e. the method returns newer messages by provided ID.
889897
* @param id Starting id from which the messages will be taken
890898
* @param count Number of messages that will be returned
899+
* @param useNon if set to true sends the request to the backend server as 'non' instead of the usual (oauth, krb...).
891900
* @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body.
892901
* @param reportProgress flag to report request and response progress.
893902
*/
@@ -1006,6 +1015,7 @@ export class AuditMessagesManagerService {
10061015
/**
10071016
* Get page of audit messages. Total count is only estimated.
10081017
* @param InputGetMessagesPage
1018+
* @param useNon if set to true sends the request to the backend server as 'non' instead of the usual (oauth, krb...).
10091019
* @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body.
10101020
* @param reportProgress flag to report request and response progress.
10111021
*/
@@ -1114,6 +1124,7 @@ export class AuditMessagesManagerService {
11141124
/**
11151125
* Returns list of AuditMessages from audit log with IDs &gt; lastProcessedId for registered auditer consumer specified by consumerName param.
11161126
* @param consumerName
1127+
* @param useNon if set to true sends the request to the backend server as 'non' instead of the usual (oauth, krb...).
11171128
* @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body.
11181129
* @param reportProgress flag to report request and response progress.
11191130
*/
@@ -1225,6 +1236,7 @@ export class AuditMessagesManagerService {
12251236
* Set ID of last processed message for specified consumer.
12261237
* @param consumerName
12271238
* @param lastProcessedId id of message to what consumer will be set
1239+
* @param useNon if set to true sends the request to the backend server as 'non' instead of the usual (oauth, krb...).
12281240
* @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body.
12291241
* @param reportProgress flag to report request and response progress.
12301242
*/

0 commit comments

Comments
 (0)