Skip to content

Commit 13850f9

Browse files
Johaney-sxkureck
authored andcommitted
feat(admin): service propagation of expired members
* added option to change service's usage of expired group members
1 parent 9ad61e7 commit 13850f9

File tree

5 files changed

+29
-9
lines changed

5 files changed

+29
-9
lines changed

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

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -39,12 +39,16 @@
3939
{{'SERVICE_DETAIL.STATUS' | translate}}:
4040
<span>
4141
{{service.enabled ? ('SERVICE_DETAIL.ENABLED' | translate) : ('SERVICE_DETAIL.DISABLED' | translate)}}
42-
<button (click)="changeServiceStatus()" mat-icon-button>
43-
<mat-icon class="align-content-center">
42+
<button (click)="changeServiceStatus()" class="icon-button mr-2" mat-icon-button>
43+
<mat-icon class="align-bottom">
4444
{{service.enabled ? "check_circle_outline" : "block"}}
4545
</mat-icon>
4646
</button>
4747
</span>
48+
{{'SERVICE_DETAIL.EXPIRED_MEMBERS' | translate}}:
49+
<span>
50+
{{service.useExpiredMembers ? ('SERVICE_DETAIL.PROPAGATED' | translate) : ('SERVICE_DETAIL.NOT_PROPAGATED' | translate)}}
51+
</span>
4852
<button
4953
*ngIf="authResolver.isPerunAdmin()"
5054
(click)="evaluateConsents()"
@@ -53,9 +57,6 @@
5357
mat-flat-button>
5458
{{'SERVICE_DETAIL.EVALUATE_CONSENTS' | translate}}
5559
</button>
56-
<span class="mt-1 ml-2 entity-info">
57-
{{service.useExpiredMembers ? ('SERVICE_DETAIL.USE_EXPIRED_MEMBERS_ENABLED' | translate) : ('SERVICE_DETAIL.USE_EXPIRED_MEMBERS_DISABLED' | translate)}}
58-
</span>
5960
</div>
6061
</div>
6162
</div>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
.icon-button {
2+
line-height: inherit !important;
3+
width: inherit !important;
4+
height: inherit !important;
5+
}

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

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,15 @@ <h1 mat-dialog-title>{{title}}</h1>
5656
>{{'DIALOGS.CREATE_EDIT_SERVICE.STATUS_HINT' | translate}}</mat-checkbox
5757
>
5858
</span>
59+
60+
<span class="d-flex"
61+
>{{'DIALOGS.CREATE_EDIT_SERVICE.EXPIRED_MEMBERS' | translate}}
62+
<mat-checkbox
63+
class="ml-3"
64+
[(ngModel)]="propagateExpiredMembers"
65+
>{{'DIALOGS.CREATE_EDIT_SERVICE.EXPIRED_MEMBERS_HINT' | translate}}</mat-checkbox
66+
>
67+
</span>
5968
</div>
6069
<div *ngIf="!loading" mat-dialog-actions>
6170
<button (click)="onCancel()" class="ml-auto" mat-flat-button>

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

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ export class CreateEditServiceDialogComponent implements OnInit {
2121

2222
description: string;
2323
status = true;
24+
propagateExpiredMembers = true;
2425

2526
nameControl = new FormControl('', [Validators.required, Validators.pattern('^[a-zA-Z0-9_]+$')]);
2627
delayControl = new FormControl(10, [Validators.pattern('^[0-9]*$')]);
@@ -50,6 +51,7 @@ export class CreateEditServiceDialogComponent implements OnInit {
5051
this.recurrenceControl.setValue(this.data.service.recurrence);
5152
this.pathControl.setValue(this.data.service.script);
5253
this.status = this.data.service.enabled;
54+
this.propagateExpiredMembers = this.data.service.useExpiredMembers;
5355

5456
this.title = this.translate.instant('DIALOGS.CREATE_EDIT_SERVICE.EDIT_TITLE') as string;
5557
this.buttonText = this.translate.instant('DIALOGS.CREATE_EDIT_SERVICE.EDIT') as string;
@@ -70,7 +72,7 @@ export class CreateEditServiceDialogComponent implements OnInit {
7072
recurrence: this.recurrenceControl.value as number,
7173
enabled: this.status,
7274
script: this.pathControl.value as string,
73-
useExpiredMembers: false,
75+
useExpiredMembers: this.propagateExpiredMembers,
7476
id: 0,
7577
beanName: '',
7678
},
@@ -95,7 +97,7 @@ export class CreateEditServiceDialogComponent implements OnInit {
9597
recurrence: this.recurrenceControl.value as number,
9698
enabled: this.status,
9799
script: this.pathControl.value as string,
98-
useExpiredMembers: this.data.service.useExpiredMembers,
100+
useExpiredMembers: this.propagateExpiredMembers,
99101
id: this.data.service.id,
100102
beanName: this.data.service.beanName,
101103
},

apps/admin-gui/src/assets/i18n/en.json

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -824,8 +824,9 @@
824824
"STATUS_CHANGE_SUCCESS": "Service status was successfully changed",
825825
"ENABLED": "Enabled",
826826
"DISABLED": "Disabled",
827-
"USE_EXPIRED_MEMBERS_ENABLED": "This service is using expired members as well",
828-
"USE_EXPIRED_MEMBERS_DISABLED": "This service is not using expired members",
827+
"EXPIRED_MEMBERS": "Expired members",
828+
"PROPAGATED": "Propagated",
829+
"NOT_PROPAGATED": "Not propagated",
829830
"DESCRIPTION": "Description",
830831
"REQUIRED_ATTRIBUTES": {
831832
"TITLE": "Required attributes",
@@ -1697,6 +1698,8 @@
16971698
"RECURRENCE": "Recurrence:",
16981699
"PATH": "Script path:",
16991700
"STATUS_HINT": "Enabled/Disabled",
1701+
"EXPIRED_MEMBERS": "Expired members:",
1702+
"EXPIRED_MEMBERS_HINT": "Propagated/Not propagated",
17001703
"RESTRICTION_NAME": "Name cannot be empty and must contain only letters, digits and _",
17011704
"REQUIRE_PATH": "Script path cannot be empty",
17021705
"INVALID_DELAY": "Delay must be a number",

0 commit comments

Comments
 (0)