Skip to content

Commit ce2b350

Browse files
committed
Merge branch 'master' into production
2 parents 9da9edb + c9a5121 commit ce2b350

File tree

8 files changed

+24
-65
lines changed

8 files changed

+24
-65
lines changed

apps/admin-gui/src/app/shared/components/dialogs/add-role-dialog/add-role-dialog.component.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,11 @@ <h1 mat-dialog-title>{{'DIALOGS.ADD_ROLE.TITLE' | translate}}</h1>
2121
[disableRouting]="true">
2222
</perun-web-apps-vos-list>
2323
<perun-web-apps-groups-list
24-
[filterValue]="filterValue"
2524
*ngIf="!loading && selectedRule?.primaryObject === 'Group'"
2625
[groups]="groups | manageableEntities: selectedRule | unassignedRole: roles : selectedRule"
2726
[displayedColumns]="['select', 'id', 'vo', 'name', 'description']"
2827
[selection]="selected"
28+
[filter]="filterValue"
2929
[disableRouting]="true">
3030
</perun-web-apps-groups-list>
3131
<perun-web-apps-facilities-list

apps/admin-gui/src/app/shared/components/dialogs/add-role-dialog/add-role-dialog.component.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ import {
1414
} from '@perun-web-apps/perun/openapi';
1515
import { SelectionModel } from '@angular/cdk/collections';
1616
import { ToEnrichedFacilityPipe } from '@perun-web-apps/perun/pipes';
17-
import { UntypedFormControl } from '@angular/forms';
1817
import { ImmediateFilterComponent } from '@perun-web-apps/perun/components';
1918

2019
export interface AddRoleDialogData {

apps/admin-gui/src/app/shared/components/entityless-attribute-keys-list/entityless-attribute-keys-list.component.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ <h1 mat-dialog-title>{{this.attDef.namespace + ':' + this.attDef.friendlyName}}<
6262
</ng-container>
6363

6464
<ng-container matColumnDef="key">
65-
<th *matHeaderCellDef mat-header-cell mat-sort-header>
65+
<th *matHeaderCellDef mat-header-cell>
6666
{{'SHARED.COMPONENTS.ENTITYLESS_ATTRIBUTES_LIST.KEY' | translate}}
6767
</th>
6868
<td *matCellDef="let record" mat-cell>
@@ -77,7 +77,7 @@ <h1 mat-dialog-title>{{this.attDef.namespace + ':' + this.attDef.friendlyName}}<
7777
</td>
7878
</ng-container>
7979
<ng-container matColumnDef="value">
80-
<th *matHeaderCellDef mat-header-cell mat-sort-header>
80+
<th *matHeaderCellDef mat-header-cell>
8181
{{'SHARED.COMPONENTS.ENTITYLESS_ATTRIBUTES_LIST.VALUE' | translate}}
8282
</th>
8383
<td *matCellDef="let record" mat-cell>

apps/admin-gui/src/app/shared/components/entityless-attribute-keys-list/entityless-attribute-keys-list.component.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import {
22
AfterViewInit,
3+
ChangeDetectorRef,
34
Component,
45
EventEmitter,
56
Inject,
@@ -62,7 +63,8 @@ export class EntitylessAttributeKeysListComponent implements OnChanges, OnInit,
6263
@Inject(MAT_DIALOG_DATA) public data: EntitylessAttributeKeysListData,
6364
private notificator: NotificatorService,
6465
private translate: TranslateService,
65-
private attributesManager: AttributesManagerService
66+
private attributesManager: AttributesManagerService,
67+
private cd: ChangeDetectorRef
6668
) {}
6769

6870
@ViewChild(MatSort, { static: true }) set matSort(ms: MatSort) {
@@ -119,6 +121,7 @@ export class EntitylessAttributeKeysListComponent implements OnChanges, OnInit,
119121
}
120122
this.selection.clear();
121123
this.isAddButtonDisabled = false;
124+
this.cd.detectChanges();
122125
}
123126

124127
onRemove(): void {
@@ -135,6 +138,7 @@ export class EntitylessAttributeKeysListComponent implements OnChanges, OnInit,
135138
this.ngOnInit();
136139
this.selection.clear();
137140
this.isAddButtonDisabled = false;
141+
this.cd.detectChanges();
138142
}
139143

140144
onAdd(): void {
@@ -146,6 +150,7 @@ export class EntitylessAttributeKeysListComponent implements OnChanges, OnInit,
146150
this.selection.clear();
147151
this.selection.select(rec);
148152
this.isAddButtonDisabled = true;
153+
this.cd.detectChanges();
149154
}
150155

151156
onCancel(): void {
@@ -185,5 +190,6 @@ export class EntitylessAttributeKeysListComponent implements OnChanges, OnInit,
185190
this.child = children.first;
186191
this.dataSource.paginator = this.child.paginator;
187192
});
193+
this.setDataSource();
188194
}
189195
}

libs/perun/components/src/lib/attribute-critical-operations-toggles/attribute-critical-operations-toggles.component.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import { Component, EventEmitter, Input, Output } from '@angular/core';
77
})
88
export class AttributeCriticalOperationsTogglesComponent {
99
@Input() readOperation = false;
10-
@Input() writeOperation = false;
10+
@Input() writeOperation = true;
1111
@Output() readOperationChanged: EventEmitter<boolean> = new EventEmitter<boolean>();
1212
@Output() writeOperationChanged: EventEmitter<boolean> = new EventEmitter<boolean>();
1313
}

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

Lines changed: 2 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,4 @@
1-
import {
2-
Component,
3-
EventEmitter,
4-
HostListener,
5-
Input,
6-
OnChanges,
7-
Output,
8-
ViewChild,
9-
} from '@angular/core';
1+
import { Component, EventEmitter, HostListener, Input, Output, ViewChild } from '@angular/core';
102
import {
113
ChangeGroupExpirationDialogComponent,
124
EditFacilityResourceGroupVoDialogComponent,
@@ -17,7 +9,6 @@ import {
179
Group,
1810
Member,
1911
PaginatedRichGroups,
20-
Vo,
2112
VosManagerService,
2213
} from '@perun-web-apps/perun/openapi';
2314
import { GuiAuthResolver, TableCheckbox } from '@perun-web-apps/perun/services';
@@ -51,10 +42,9 @@ import { GroupUtilsService } from '@perun-web-apps/perun/services';
5142
styleUrls: ['./groups-list.component.scss'],
5243
providers: [DisableGroupSelectPipe],
5344
})
54-
export class GroupsListComponent implements OnChanges {
45+
export class GroupsListComponent {
5546
@Input() theme = 'group-theme';
5647
@Input() selection = new SelectionModel<GroupWithStatus>(true, []);
57-
@Input() filterValue: string;
5848
@Input() disableMembers: boolean;
5949
@Input() disableGroups: boolean;
6050
@Input() groupsToDisableCheckbox: Set<number> = new Set<number>();
@@ -151,13 +141,6 @@ export class GroupsListComponent implements OnChanges {
151141
return this.groupUtils.getSortDataForColumn(data, column, this.voNames, this.recentIds);
152142
};
153143

154-
ngOnChanges(): void {
155-
if (!this.authResolver.isPerunAdminOrObserver()) {
156-
this.displayedColumns = this.displayedColumns.filter((column) => column !== 'id');
157-
}
158-
this.setDataSource();
159-
}
160-
161144
exportAllData(format: string): void {
162145
if (isDynamicDataSource(this.dataSource)) {
163146
this.downloadAll.emit({ format: format, length: this.dataSource.paginator.length });
@@ -299,39 +282,6 @@ export class GroupsListComponent implements OnChanges {
299282
);
300283
};
301284

302-
setDataSource(): void {
303-
if (!this.dataSource) {
304-
this.dataSource = new MatTableDataSource<GroupWithStatus>();
305-
this.dataSource.sort = this.sort;
306-
this.dataSource.paginator = this.tableWrapper.paginator;
307-
this.dataSource.filterPredicate = (data: Vo, filter: string): boolean =>
308-
customDataSourceFilterPredicate(
309-
data,
310-
filter,
311-
this.displayedColumns,
312-
this.getDataForColumnFun
313-
);
314-
this.dataSource.sortData = (data: GroupWithStatus[], sort: MatSort): GroupWithStatus[] =>
315-
customDataSourceSort(data, sort, this.getDataForColumnFun);
316-
}
317-
this.dataSource.filter = this.filterValue;
318-
319-
// if groups not loaded yet, skip
320-
if (!this.groups) {
321-
return;
322-
}
323-
324-
const paginated = this.isPaginated(this.groups);
325-
if (isDynamicDataSource(this.dataSource) || paginated) {
326-
this.dataSource.data = (this.groups as PaginatedRichGroups).data;
327-
(this.dataSource as DynamicDataSource<GroupWithStatus>).count = (
328-
this.groups as PaginatedRichGroups
329-
).totalCount;
330-
} else if (!isDynamicDataSource(this.dataSource) && !paginated) {
331-
this.dataSource.data = this.groups as GroupWithStatus[];
332-
}
333-
}
334-
335285
private dataSourceInit(groups: GroupWithStatus[] | PaginatedRichGroups): void {
336286
const paginated = this.isPaginated(groups);
337287

libs/perun/components/src/lib/perun-footer/perun-footer.component.ts

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
import { Component, OnInit } from '@angular/core';
66
import { MatDialog } from '@angular/material/dialog';
77
import { ReportIssueDialogComponent } from '../report-issue-dialog/report-issue-dialog.component';
8-
import { AuthService, InitAuthService, StoreService } from '@perun-web-apps/perun/services';
8+
import { StoreService } from '@perun-web-apps/perun/services';
99
import { getDefaultDialogConfig } from '@perun-web-apps/perun/utils';
1010
import { TranslateService } from '@ngx-translate/core';
1111
import { UtilsService } from '@perun-web-apps/perun/openapi';
@@ -30,7 +30,7 @@ export class PerunFooterComponent implements OnInit {
3030
githubBackendRepository: string = this.storeService.getProperty('footer').github_backend_releases;
3131
bgColor: string = this.storeService.getProperty('theme').footer_bg_color;
3232
version = '';
33-
backendVersion = '';
33+
backendVersion = 'N/A';
3434
guiVersion = '';
3535
language = 'en';
3636
columnContentHeight = 0;
@@ -39,9 +39,7 @@ export class PerunFooterComponent implements OnInit {
3939
private storeService: StoreService,
4040
private translateService: TranslateService,
4141
private utilsService: UtilsService,
42-
private dialog: MatDialog,
43-
private authService: AuthService,
44-
private initAuthService: InitAuthService
42+
private dialog: MatDialog
4543
) {}
4644

4745
ngOnInit(): void {
@@ -54,7 +52,10 @@ export class PerunFooterComponent implements OnInit {
5452
this.guiVersion = require('../../../../../../package.json').version as string;
5553

5654
this.utilsService.getPerunRPCVersion(true).subscribe((val) => {
57-
this.backendVersion = val.match('\\bVersion:\\s*([^,\\s]+)')[1];
55+
const match = val.match('\\bVersion:\\s*([^,\\s]+)');
56+
if (match !== null) {
57+
this.backendVersion = match[1];
58+
}
5859
});
5960

6061
this.footerColumns = this.storeService.getProperty('footer').columns;

libs/perun/services/src/lib/table-checkbox.service.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,10 @@ export class TableCheckbox {
4141
}
4242
this.pageIterator = 0;
4343

44-
dataSource.sortData(dataSource.filteredData, sort).forEach((row: T) => {
44+
const data = sort
45+
? dataSource.sortData(dataSource.filteredData, sort)
46+
: dataSource.filteredData;
47+
data.forEach((row: T) => {
4548
if (
4649
this.pageStart <= this.pageIterator &&
4750
this.pageIterator < this.pageEnd &&

0 commit comments

Comments
 (0)