Skip to content

Commit 6a6a7ee

Browse files
committed
Merge branch 'master' into production
2 parents 1b5fa99 + 1df1e65 commit 6a6a7ee

File tree

74 files changed

+2539
-655
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

74 files changed

+2539
-655
lines changed

.releaserc.json

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,10 @@
2020
"preset": "conventionalcommits",
2121
"presetConfig": {
2222
"types": [
23-
{
24-
"type": "feat",
25-
"section": "New features and notable changes",
26-
"hidden": false
27-
},
28-
{ "type": "fix", "hidden": true },
29-
{ "type": "perf", "hidden": true },
30-
{ "type": "revert", "hidden": true },
23+
{ "type": "feat", "hidden": false },
24+
{ "type": "fix", "hidden": false },
25+
{ "type": "perf", "hidden": false },
26+
{ "type": "revert", "hidden": false },
3127
{ "type": "docs", "hidden": true },
3228
{ "type": "style", "hidden": true },
3329
{ "type": "chore", "hidden": true },

apps/admin-gui-e2e/src/e2e/admin/perun-admin.cy.js

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@ describe('Perun admin management with role Perun admin', () => {
77
const dbExtSourceName = 'test_ext_source_db';
88
const dbConsentHubName = 'test-e2e-facility-from-db-3';
99
const dbOwnerName = 'DbOwnerTest';
10+
const loginToBlock = "testLoginToBlock"
11+
const dbBlockedLogin = "test_blocking_login"
12+
const dbBlockedLoginListOnly = "test_blocking_login_list"
1013

1114
const dbSearcherAttrDisplayName = 'login-namespace:einfra';
1215
const dbSearcherAttrValue = 'e2etestlogin';
@@ -199,6 +202,60 @@ describe('Perun admin management with role Perun admin', () => {
199202
});
200203
});
201204

205+
context('Blocked logins management', () => {
206+
beforeEach(() => {
207+
cy.get('[data-cy=blocked-logins]')
208+
.click();
209+
});
210+
211+
it("test get blocked login", () => {
212+
cy.get('[data-cy=filter-input]')
213+
.type(dbBlockedLoginListOnly, {force: true})
214+
.get(`[data-cy=${dbBlockedLoginListOnly}-checkbox]`)
215+
.should('exist');
216+
})
217+
218+
it('test block login', () => {
219+
cy.intercept('**/usersManager/blockLogins**')
220+
.as('blockLogin')
221+
.intercept('**/usersManager/getBlockedLoginsPage**')
222+
.as('getBlockedLogins')
223+
.get('[data-cy=block-logins-button]')
224+
.click({force: true})
225+
.get('[data-cy=logins-input]')
226+
.type(loginToBlock, {force: true})
227+
.get('[data-cy=submit-blocked-logins-button]')
228+
.click()
229+
.wait('@blockLogin')
230+
.wait('@getBlockedLogins')
231+
// assert that the login is listed as blocked
232+
.get('[data-cy=filter-input]')
233+
.type(loginToBlock, {force: true})
234+
.get(`[data-cy=${loginToBlock}-checkbox]`)
235+
.should('exist');
236+
});
237+
238+
it('test unblock login', () => {
239+
cy.intercept('**/usersManager/unblockLoginsById**')
240+
.as('unblockLogins')
241+
.intercept('**/usersManager/getBlockedLoginsPage**')
242+
.as('getBlockedLogins')
243+
.get('[data-cy=filter-input]')
244+
.type(dbBlockedLogin, {force: true})
245+
.get(`[data-cy=${dbBlockedLogin}-checkbox]`)
246+
.click()
247+
.get('[data-cy=unblock-logins-button]')
248+
.click({force: true})
249+
.get('[data-cy=unblock-button-dialog]')
250+
.click()
251+
.wait('@unblockLogins')
252+
.wait('@getBlockedLogins')
253+
// assert that the login is no longer listed as blocked
254+
.get(`[data-cy=${dbBlockedLogin}-checkbox]`)
255+
.should('not.exist');
256+
});
257+
});
258+
202259
it('test list ext sources', () => {
203260
cy.get('[data-cy=external-sources]')
204261
.click()

apps/admin-gui-e2e/src/e2e/admin/perun-observer.cy.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ describe('Perun admin management with role Perun observer', () => {
1111
const dbSearcherAttrValue = 'e2etestlogin';
1212
const dbSearcherUserFirstName = 'Test6';
1313
const dbOwnerName = 'DbOwnerTest';
14+
const dbBlockedLoginListOnly = "test_blocking_login_list"
1415

1516
before(() => {
1617
cy.login('PERUN_OBSERVER', 'perunObserver');
@@ -114,4 +115,13 @@ describe('Perun admin management with role Perun observer', () => {
114115
.get(`[data-cy=${dbSearcherUserFirstName.toLowerCase()}-firstName-td]`)
115116
.should('exist');
116117
});
118+
119+
it("test get blocked login", () => {
120+
cy.get('[data-cy=blocked-logins]')
121+
.click()
122+
.get('[data-cy=filter-input]')
123+
.type(dbBlockedLoginListOnly, {force: true})
124+
.get(`[data-cy=${dbBlockedLoginListOnly}-checkbox]`)
125+
.should('exist');
126+
});
117127
});

apps/admin-gui/src/app/admin/pages/admin-page/admin-blocked-logins/admin-blocked-logins.component.html

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ <h1 class="page-subtitle">{{'ADMIN.BLOCKED_LOGINS.TITLE' | translate}}</h1>
77
(click)="block()"
88
color="accent"
99
class="me-2 action-button"
10+
data-cy="block-logins-button"
1011
mat-flat-button
1112
*ngIf="isAdmin">
1213
{{'ADMIN.BLOCKED_LOGINS.BLOCK' | translate}}
@@ -16,6 +17,7 @@ <h1 class="page-subtitle">{{'ADMIN.BLOCKED_LOGINS.TITLE' | translate}}</h1>
1617
(click)="unblock()"
1718
class="me-2"
1819
color="warn"
20+
data-cy="unblock-logins-button"
1921
mat-flat-button
2022
[disabled]="selection.selected.length === 0">
2123
{{'ADMIN.BLOCKED_LOGINS.UNBLOCK' | translate}}

apps/admin-gui/src/app/shared/components/dialogs/block-logins-dialog/block-logins-dialog.component.html

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ <h1 mat-dialog-title>{{'DIALOGS.BLOCK_LOGINS.TITLE' | translate}}</h1>
3434
<textarea
3535
cols="50"
3636
class="md-textarea form-control"
37+
data-cy="logins-input"
3738
[formControl]="blockLogins"
3839
required
3940
matInput
@@ -53,6 +54,7 @@ <h1 mat-dialog-title>{{'DIALOGS.BLOCK_LOGINS.TITLE' | translate}}</h1>
5354
(click)="onSubmit()"
5455
class="ms-2"
5556
color="accent"
57+
data-cy="submit-blocked-logins-button"
5658
[disabled]="loading || blockLogins.invalid || (!isGlobal && selectedNamespace === null)"
5759
mat-flat-button>
5860
{{'DIALOGS.BLOCK_LOGINS.BLOCK' | translate}}

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ <h1 class="page-subtitle">{{'DIALOGS.CREATE_ATTRIBUTE.SET_NEW' | translate}}</h1
2121
[emptyListText]="'SHARED_LIB.PERUN.COMPONENTS.ATTRIBUTES_LIST.EMPTY_ATTRIBUTES'"
2222
[attributes]="attributes"
2323
[filterValue]="filterValue"
24-
[inDialog]="true"
2524
[selection]="selected"
2625
[tableId]="tableId">
2726
</perun-web-apps-attributes-list>

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@ <h1 mat-dialog-title>{{"DIALOGS.CREATE_RELATION.TITLE" | translate}}</h1>
99
[vo]="thisVo.vo"
1010
[vos]="vosToSelect"
1111
(voSelected)="getGroupsToInclude($event.id)"></perun-web-apps-vo-search-select>
12-
<perun-web-apps-debounce-filter
13-
(filter)="applyFilter($event)"
14-
[placeholder]="'GROUP_DETAIL.SETTINGS.RELATIONS.FILTER'"></perun-web-apps-debounce-filter>
1512
<div class="dialog-container" mat-dialog-content>
13+
<perun-web-apps-debounce-filter
14+
(filter)="applyFilter($event)"
15+
[placeholder]="'GROUP_DETAIL.SETTINGS.RELATIONS.FILTER'"></perun-web-apps-debounce-filter>
1616
<ng-template #spinner>
1717
<perun-web-apps-loading-table></perun-web-apps-loading-table>
1818
</ng-template>

apps/admin-gui/src/app/shared/components/dialogs/delete-application-form-item-dialog/delete-application-form-item-dialog.component.html

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,23 @@
11
<h1 mat-dialog-title>{{'DIALOGS.DELETE_APPLICATION_FORM_ITEM.TITLE' | translate}}</h1>
22
<div class="dialog-container" mat-dialog-content>
3-
<div class="pb-2 fw-bold">
4-
{{'DIALOGS.DELETE_APPLICATION_FORM_ITEM.INFO_1' | translate}}
3+
<div *ngIf="!deletionDisabled">
4+
<div class="pb-2 fw-bold">
5+
{{'DIALOGS.DELETE_APPLICATION_FORM_ITEM.INFO_1' | translate}}
6+
</div>
7+
<div>{{'DIALOGS.DELETE_APPLICATION_FORM_ITEM.INFO_2' | translate}}</div>
8+
<div class="pb-4 pt-2">{{'DIALOGS.DELETE_APPLICATION_FORM_ITEM.INFO_3' | translate}}</div>
59
</div>
6-
<div>{{'DIALOGS.DELETE_APPLICATION_FORM_ITEM.INFO_2' | translate}}</div>
7-
<div class="pb-4 pt-2">{{'DIALOGS.DELETE_APPLICATION_FORM_ITEM.INFO_3' | translate}}</div>
10+
<perun-web-apps-alert *ngIf="deletionDisabled" alert_type="error">
11+
{{data.errorMessage}}
12+
</perun-web-apps-alert>
813
</div>
914
<div mat-dialog-actions>
1015
<button (click)="onCancel()" class="ms-auto" mat-stroked-button>
1116
{{'DIALOGS.DELETE_APPLICATION_FORM_ITEM.CANCEL_BUTTON' | translate}}
1217
</button>
1318
<button
1419
(click)="submit()"
20+
[disabled]="deletionDisabled"
1521
class="ms-2"
1622
color="warn"
1723
data-cy="delete-application-form-item-dialog"

apps/admin-gui/src/app/shared/components/dialogs/delete-application-form-item-dialog/delete-application-form-item-dialog.component.ts

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,24 @@
1-
import { Component } from '@angular/core';
2-
import { MatDialogRef } from '@angular/material/dialog';
1+
import { Component, Inject } from '@angular/core';
2+
import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog';
3+
4+
export interface DeleteApplicationFormItemDialogData {
5+
errorMessage: string;
6+
}
37

48
@Component({
59
selector: 'app-delete-application-form-item-dialog',
610
templateUrl: './delete-application-form-item-dialog.component.html',
711
styleUrls: ['./delete-application-form-item-dialog.component.scss'],
812
})
913
export class DeleteApplicationFormItemDialogComponent {
10-
constructor(private dialogRef: MatDialogRef<DeleteApplicationFormItemDialogComponent>) {}
14+
deletionDisabled: boolean;
15+
16+
constructor(
17+
private dialogRef: MatDialogRef<DeleteApplicationFormItemDialogComponent>,
18+
@Inject(MAT_DIALOG_DATA) public data: DeleteApplicationFormItemDialogData
19+
) {
20+
this.deletionDisabled = this.data.errorMessage?.length !== 0;
21+
}
1122

1223
onCancel(): void {
1324
this.dialogRef.close(false);

apps/admin-gui/src/app/shared/components/dialogs/edit-application-form-item-dialog/edit-application-form-item-dialog.component.html

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,8 @@ <h1 mat-dialog-title>
6767
<perun-web-apps-selection-item-search-select
6868
[attributes]="sourceAttributes"
6969
[selectedAttribute]="applicationFormItem.perunSourceAttribute"
70-
(itemSelected)="applicationFormItem.perunSourceAttribute = $event.value"
70+
(itemSelected)="applicationFormItem.perunSourceAttribute = $event.value; loadWarning(itemType.SOURCE)"
71+
[warning]="displayWarningForSourceAttr ? warningMessage : ''"
7172
[asGroup]="!!data.group"
7273
[type]="itemType.SOURCE">
7374
</perun-web-apps-selection-item-search-select>
@@ -81,7 +82,8 @@ <h1 mat-dialog-title>
8182
<perun-web-apps-selection-item-search-select
8283
[attributes]="destinationAttributes"
8384
[selectedAttribute]="applicationFormItem.perunDestinationAttribute"
84-
(itemSelected)="applicationFormItem.perunDestinationAttribute = $event.value"
85+
(itemSelected)="applicationFormItem.perunDestinationAttribute = $event.value; loadWarning(itemType.DESTINATION)"
86+
[warning]="displayWarningForDestinationAttr ? warningMessage : ''"
8587
[asGroup]="!!data.group"
8688
[type]="itemType.DESTINATION">
8789
</perun-web-apps-selection-item-search-select>

0 commit comments

Comments
 (0)