Skip to content

Commit 6d98c80

Browse files
xkureckHejdaJakub
authored andcommitted
fix(admin): Bugfixes of perun admin section
* one bigger bug founded in page user-account * the other are just 1 line improvements
1 parent d5e260d commit 6d98c80

File tree

11 files changed

+38
-22
lines changed

11 files changed

+38
-22
lines changed

apps/admin-gui/src/app/admin/pages/admin-page/admin-services/admin-services.component.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ import { GuiAuthResolver } from '@perun-web-apps/perun/services';
1414
styleUrls: ['./admin-services.component.scss'],
1515
})
1616
export class AdminServicesComponent implements OnInit {
17+
static id = 'AdminServicesComponent';
18+
1719
services: Service[];
1820
selection = new SelectionModel<Service>(true, []);
1921
loading = false;

apps/admin-gui/src/app/admin/pages/admin-page/admin-services/service-detail-page/service-detail-page.component.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ export class ServiceDetailPageComponent implements OnInit {
8181
const dialogRef = this.dialog.open(DeleteServiceDialogComponent, config);
8282

8383
dialogRef.afterClosed().subscribe((result) => {
84-
if (result !== undefined) {
84+
if (result) {
8585
void this.router.navigate(['/admin/services']);
8686
}
8787
});

apps/admin-gui/src/app/core/services/common/cache-route-reuse-strategy.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ import { VoSelectPageComponent } from '../../../vos/pages/vo-select-page/vo-sele
2020
import { FacilitySelectPageComponent } from '../../../facilities/pages/facility-select-page/facility-select-page.component';
2121
import { VoSettingsSponsoredMembersComponent } from '../../../vos/pages/vo-detail-page/vo-settings/vo-settings-sponsored-members/vo-settings-sponsored-members.component';
2222
import { AdminSearcherComponent } from '../../../admin/pages/admin-page/admin-searcher/admin-searcher.component';
23+
import { AdminServicesComponent } from '../../../admin/pages/admin-page/admin-services/admin-services.component';
2324

2425
export class CachedRoute {
2526
routeHandle: DetachedRouteHandle;
@@ -64,7 +65,7 @@ export class CacheRouteReuseStrategy implements RouteReuseStrategy {
6465
},
6566
{
6667
type: 'admin',
67-
components: [AdminUsersComponent.id, AdminSearcherComponent.id],
68+
components: [AdminUsersComponent.id, AdminSearcherComponent.id, AdminServicesComponent.id],
6869
},
6970
{
7071
type: 'entitySelect',

apps/admin-gui/src/app/shared/components/audit-messages-list/audit-messages-list.component.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,8 @@ export class AuditMessagesListComponent implements OnInit, OnChanges, AfterViewI
6464
return data.event.name.split('.').pop();
6565
case 'actor':
6666
return data.actor;
67+
case 'event.message':
68+
return data.event.message;
6769
default:
6870
return '';
6971
}

apps/admin-gui/src/app/shared/components/dialogs/create-edit-service-dialog/create-edit-service-dialog.component.ts

Lines changed: 20 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -77,13 +77,16 @@ export class CreateEditServiceDialogComponent implements OnInit {
7777
beanName: '',
7878
},
7979
})
80-
.subscribe(() => {
81-
this.notificator.showSuccess(
82-
this.translate.instant('DIALOGS.CREATE_EDIT_SERVICE.CREATE_SUCCESS') as string
83-
);
84-
this.dialogRef.close(true);
85-
this.loading = false;
86-
});
80+
.subscribe(
81+
() => {
82+
this.notificator.showSuccess(
83+
this.translate.instant('DIALOGS.CREATE_EDIT_SERVICE.CREATE_SUCCESS') as string
84+
);
85+
this.dialogRef.close(true);
86+
this.loading = false;
87+
},
88+
() => (this.loading = false)
89+
);
8790
}
8891

8992
onEdit(): void {
@@ -102,13 +105,16 @@ export class CreateEditServiceDialogComponent implements OnInit {
102105
beanName: this.data.service.beanName,
103106
},
104107
})
105-
.subscribe(() => {
106-
this.notificator.showSuccess(
107-
this.translate.instant('DIALOGS.CREATE_EDIT_SERVICE.EDIT_SUCCESS') as string
108-
);
109-
this.dialogRef.close(true);
110-
this.loading = false;
111-
});
108+
.subscribe(
109+
() => {
110+
this.notificator.showSuccess(
111+
this.translate.instant('DIALOGS.CREATE_EDIT_SERVICE.EDIT_SUCCESS') as string
112+
);
113+
this.dialogRef.close(true);
114+
this.loading = false;
115+
},
116+
() => (this.loading = false)
117+
);
112118
}
113119

114120
onCancel(): void {

apps/admin-gui/src/app/shared/components/dialogs/edit-enforce-consents-dialog/edit-enforce-consents-dialog.component.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,11 @@ <h1 mat-dialog-title>
1515
<p class="mt-2 mb-2">{{this.data.consentHubName}}</p>
1616
<mat-divider></mat-divider>
1717

18-
<div class="font-weight-bold mt-3">
18+
<perun-web-apps-alert alert_type="warn">
1919
{{this.data.enforceConsents
2020
? ('DIALOGS.EDIT_ENFORCE_CONSENTS_FLAG.DISABLE_BOLD_DESCRIPTION' | translate)
2121
: ('DIALOGS.EDIT_ENFORCE_CONSENTS_FLAG.ENFORCE_BOLD_DESCRIPTION' | translate)}}
22-
</div>
22+
</perun-web-apps-alert>
2323
</div>
2424
<div mat-dialog-actions>
2525
<button mat-flat-button class="ml-auto" (click)="onCancel()">

apps/admin-gui/src/app/shared/components/two-entity-attribute-page/two-entity-attribute-page.component.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -192,6 +192,7 @@ export class TwoEntityAttributePageComponent implements OnInit {
192192

193193
getAttributes(entityId: number): void {
194194
this.innerLoading = true;
195+
this.selection.clear();
195196
switch (this.firstEntity) {
196197
case 'member':
197198
switch (this.secondEntity) {

apps/admin-gui/src/app/users/pages/user-detail-page/user-accounts/user-accounts.component.html

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,10 @@ <h1 class="page-title">{{'USER_DETAIL.ACCOUNTS.TITLE' | translate}}</h1>
3131
<perun-web-apps-groups-list
3232
*ngIf="!loading"
3333
[groups]="groups"
34-
[displayedColumns]="['id', 'recent', 'name', 'description', 'groupStatus', 'expiration']">
34+
[memberId]="member.id"
35+
[memberGroupStatus]="member.groupStatus"
36+
(refreshTable)="loadMember(selectedVo)"
37+
[displayedColumns]="['id', 'recent', 'name', 'description', 'expiration']">
3538
</perun-web-apps-groups-list>
3639
</div>
3740
</ng-template>

apps/admin-gui/src/app/users/pages/user-detail-page/user-accounts/user-accounts.component.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import {
88
Vo,
99
} from '@perun-web-apps/perun/openapi';
1010
import { ActivatedRoute } from '@angular/router';
11+
import { Urns } from '@perun-web-apps/perun/urns';
1112

1213
@Component({
1314
selector: 'app-perun-web-apps-user-accounts',
@@ -52,7 +53,7 @@ export class UserAccountsComponent implements OnInit {
5253
this.member = member;
5354
this.groupService
5455
.getMemberRichGroupsWithAttributesByNames(this.member.id, [
55-
'urn:perun:member_group:attribute-def:virt:groupStatus',
56+
Urns.MEMBER_DEF_GROUP_EXPIRATION,
5657
])
5758
.subscribe(
5859
(groups) => {

apps/admin-gui/src/app/users/pages/user-detail-page/user-groups/user-groups.component.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ <h1 *ngIf="!this.showPrincipal" class="page-subtitle">
1414
*ngIf="!memberRefresh"
1515
[disableMembers]="false"
1616
[groups]="membersGroups"
17-
[displayedColumns]="['id', 'vo', 'name', 'description', 'status']"
17+
[displayedColumns]="['id', 'vo', 'name', 'description']"
1818
[filter]="memberFilterValue"
1919
[tableId]="tableId">
2020
</perun-web-apps-groups-list>

libs/perun/components/src/lib/groups-list/groups-list.component.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -428,6 +428,6 @@ export class GroupsListComponent implements AfterViewInit, OnChanges {
428428

429429
getStatusAttribute(grp: RichGroup): string {
430430
const filter = grp.attributes.find((att) => att.baseFriendlyName === 'groupStatus');
431-
return filter !== null ? (filter.value as string) : '';
431+
return filter?.value ? (filter.value as string) : '';
432432
}
433433
}

0 commit comments

Comments
 (0)