Skip to content

Commit a015743

Browse files
bodnaraxflord
authored andcommitted
feat(admin): displaying children of items on entity detail
* On overview tiles with children were replaced by expandable section that containst the children instead of new page * In side menu items with children will expand on click instead of navigating to new page * Refactored side-menu and overview pages to reflect current standards * Removed side menu root item component as it was just a duplicate of side menu item * Information about parent of group was moved from overview to detail and is now present for all pages
1 parent deb1778 commit a015743

File tree

48 files changed

+828
-847
lines changed

Some content is hidden

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

48 files changed

+828
-847
lines changed
Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
<div>
2-
<perun-web-apps-menu-buttons-field
3-
[items]="navItems"
4-
[size]="'small'"></perun-web-apps-menu-buttons-field>
5-
6-
<!-- <h1 class="page-subtitle">Quick actions</h1>-->
7-
<!-- <app-menu-buttons-field [items]="items" [size]="'medium'">-->
8-
<!-- </app-menu-buttons-field>-->
2+
<perun-web-apps-menu-buttons-field [items]="items"></perun-web-apps-menu-buttons-field>
3+
<perun-web-apps-expandable-tiles
4+
[items]="visualizerItems"
5+
[sectionId]="'visualizer'"
6+
[title]="'MENU_ITEMS.ADMIN.VISUALIZER'"></perun-web-apps-expandable-tiles>
97
</div>

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

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import { MenuItem } from '@perun-web-apps/perun/models';
99
export class AdminOverviewComponent {
1010
@HostBinding('class.router-component') true;
1111

12-
navItems: MenuItem[] = [
12+
items: MenuItem[] = [
1313
{
1414
cssIcon: 'perun-attributes',
1515
url: '/admin/attributes',
@@ -34,12 +34,6 @@ export class AdminOverviewComponent {
3434
label: 'MENU_ITEMS.ADMIN.SERVICES',
3535
style: 'admin-btn',
3636
},
37-
{
38-
cssIcon: 'perun-preview',
39-
url: '/admin/visualizer',
40-
label: 'MENU_ITEMS.ADMIN.VISUALIZER',
41-
style: 'admin-btn',
42-
},
4337
{
4438
cssIcon: 'perun-external-sources',
4539
url: '/admin/ext_sources',
@@ -71,4 +65,18 @@ export class AdminOverviewComponent {
7165
style: 'admin-btn',
7266
},
7367
];
68+
visualizerItems: MenuItem[] = [
69+
{
70+
cssIcon: 'perun-module-dependencies',
71+
url: `/admin/visualizer/attrDependencies`,
72+
label: 'MENU_ITEMS.VISUALIZER.ATTR_DEPENDENCIES',
73+
style: 'admin-btn',
74+
},
75+
{
76+
cssIcon: 'perun-user-destination-relationship',
77+
url: '/admin/visualizer/userDestinationRelationship',
78+
label: 'MENU_ITEMS.VISUALIZER.USER_DESTINATION',
79+
style: 'admin-btn',
80+
},
81+
];
7482
}
Original file line numberDiff line numberDiff line change
@@ -1,3 +1 @@
1-
<perun-web-apps-menu-buttons-field
2-
[items]="navItems"
3-
[size]="'small'"></perun-web-apps-menu-buttons-field>
1+
<perun-web-apps-menu-buttons-field [items]="navItems"></perun-web-apps-menu-buttons-field>
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
11
<div>
2-
<perun-web-apps-menu-buttons-field
3-
[items]="items"
4-
[size]="'small'"></perun-web-apps-menu-buttons-field>
2+
<perun-web-apps-menu-buttons-field [items]="items"></perun-web-apps-menu-buttons-field>
53
</div>
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
<mat-spinner *ngIf="loading" class="me-auto ms-auto"></mat-spinner>
22
<div *ngIf="!loading">
3-
<perun-web-apps-menu-buttons-field
4-
[items]="navItems"
5-
[size]="'small'"></perun-web-apps-menu-buttons-field>
3+
<perun-web-apps-menu-buttons-field [items]="items"></perun-web-apps-menu-buttons-field>
4+
<perun-web-apps-expandable-tiles
5+
[items]="settingItems"
6+
[title]="'MENU_ITEMS.FACILITY.SETTINGS'"
7+
[sectionId]="'settings'">
8+
</perun-web-apps-expandable-tiles>
69
</div>

apps/admin-gui/src/app/facilities/pages/facility-detail-page/facility-overview/facility-overview.component.ts

Lines changed: 59 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@ import {
1515
export class FacilityOverviewComponent implements OnInit {
1616
// class used for animation
1717
@HostBinding('class.router-component') true;
18-
navItems: MenuItem[] = [];
18+
items: MenuItem[] = [];
19+
settingItems: MenuItem[] = [];
1920
facility: Facility;
2021
loading = false;
2122

@@ -29,16 +30,17 @@ export class FacilityOverviewComponent implements OnInit {
2930
ngOnInit(): void {
3031
this.loading = true;
3132
this.facility = this.entityStorageService.getEntity();
32-
this.initItems();
33+
this.setItems();
34+
this.setSettingsItems();
3335
this.loading = false;
3436
}
3537

36-
private initItems(): void {
37-
this.navItems = [];
38+
private setItems(): void {
39+
this.items = [];
3840

3941
// Resources
4042
if (this.routePolicyService.canNavigate('facilities-resources', this.facility)) {
41-
this.navItems.push({
43+
this.items.push({
4244
cssIcon: 'perun-manage-facility',
4345
url: `/facilities/${this.facility.id}/resources`,
4446
label: 'MENU_ITEMS.FACILITY.RESOURCES',
@@ -47,7 +49,7 @@ export class FacilityOverviewComponent implements OnInit {
4749
}
4850
// Allowed users
4951
if (this.routePolicyService.canNavigate('facilities-allowed-users', this.facility)) {
50-
this.navItems.push({
52+
this.items.push({
5153
cssIcon: 'perun-user',
5254
url: `/facilities/${this.facility.id}/allowed-users`,
5355
label: 'MENU_ITEMS.FACILITY.ALLOWED_USERS',
@@ -56,7 +58,7 @@ export class FacilityOverviewComponent implements OnInit {
5658
}
5759
// Allowed groups
5860
if (this.routePolicyService.canNavigate('facilities-allowed-groups', this.facility)) {
59-
this.navItems.push({
61+
this.items.push({
6062
cssIcon: 'perun-group',
6163
url: `/facilities/${this.facility.id}/allowed-groups`,
6264
label: 'MENU_ITEMS.FACILITY.ALLOWED_GROUPS',
@@ -65,7 +67,7 @@ export class FacilityOverviewComponent implements OnInit {
6567
}
6668
// Service state
6769
if (this.routePolicyService.canNavigate('facilities-services-status', this.facility)) {
68-
this.navItems.push({
70+
this.items.push({
6971
cssIcon: 'perun-service-status',
7072
url: `/facilities/${this.facility.id}/services-status`,
7173
label: 'MENU_ITEMS.FACILITY.SERVICES_STATUS',
@@ -74,7 +76,7 @@ export class FacilityOverviewComponent implements OnInit {
7476
}
7577
// Service destination
7678
if (this.routePolicyService.canNavigate('facilities-services-destinations', this.facility)) {
77-
this.navItems.push({
79+
this.items.push({
7880
cssIcon: 'perun-service_destination',
7981
url: `/facilities/${this.facility.id}/services-destinations`,
8082
label: 'MENU_ITEMS.FACILITY.SERVICES_DESTINATIONS',
@@ -83,7 +85,7 @@ export class FacilityOverviewComponent implements OnInit {
8385
}
8486
// Hosts
8587
if (this.routePolicyService.canNavigate('facilities-hosts', this.facility)) {
86-
this.navItems.push({
88+
this.items.push({
8789
cssIcon: 'perun-hosts',
8890
url: `/facilities/${this.facility.id}/hosts`,
8991
label: 'MENU_ITEMS.FACILITY.HOSTS',
@@ -92,20 +94,60 @@ export class FacilityOverviewComponent implements OnInit {
9294
}
9395
// Attributes
9496
if (this.routePolicyService.canNavigate('facilities-attributes', this.facility)) {
95-
this.navItems.push({
97+
this.items.push({
9698
cssIcon: 'perun-attributes',
9799
url: `/facilities/${this.facility.id}/attributes`,
98100
label: 'MENU_ITEMS.FACILITY.ATTRIBUTES',
99101
style: 'facility-btn',
100102
});
101103
}
104+
}
105+
106+
private setSettingsItems(): void {
107+
this.settingItems = [];
102108

103-
// Settings
104-
if (this.routePolicyService.canNavigate('facilities-settings', this.facility)) {
105-
this.navItems.push({
106-
cssIcon: 'perun-settings2',
107-
url: `/facilities/${this.facility.id}/settings`,
108-
label: 'MENU_ITEMS.FACILITY.SETTINGS',
109+
// Owners
110+
if (this.routePolicyService.canNavigate('facilities-settings-owners', this.facility)) {
111+
this.settingItems.push({
112+
cssIcon: 'perun-owner-grey',
113+
url: `/facilities/${this.facility.id}/settings/owners`,
114+
label: 'MENU_ITEMS.FACILITY.OWNERS',
115+
style: 'facility-btn',
116+
});
117+
}
118+
// Managers
119+
if (this.routePolicyService.canNavigate('facilities-settings-managers', this.facility)) {
120+
this.settingItems.push({
121+
cssIcon: 'perun-manager',
122+
url: `/facilities/${this.facility.id}/settings/managers`,
123+
label: 'MENU_ITEMS.FACILITY.MANAGERS',
124+
style: 'facility-btn',
125+
});
126+
}
127+
// Security teams
128+
if (this.routePolicyService.canNavigate('facilities-settings-security-teams', this.facility)) {
129+
this.settingItems.push({
130+
cssIcon: 'perun-security-teams',
131+
url: `/facilities/${this.facility.id}/settings/security-teams`,
132+
label: 'MENU_ITEMS.FACILITY.SECURITY_TEAMS',
133+
style: 'facility-btn',
134+
});
135+
}
136+
// Blacklist
137+
if (this.routePolicyService.canNavigate('facilities-settings-blacklist', this.facility)) {
138+
this.settingItems.push({
139+
cssIcon: 'perun-black-list',
140+
url: `/facilities/${this.facility.id}/settings/blacklist`,
141+
label: 'MENU_ITEMS.FACILITY.BLACKLIST',
142+
style: 'facility-btn',
143+
});
144+
}
145+
// Bans
146+
if (this.routePolicyService.canNavigate('facilities-settings-bans', this.facility)) {
147+
this.settingItems.push({
148+
cssIcon: 'perun-ban',
149+
url: `/facilities/${this.facility.id}/settings/bans`,
150+
label: 'MENU_ITEMS.FACILITY.BANS',
109151
style: 'facility-btn',
110152
});
111153
}
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
11
<mat-spinner *ngIf="loading" class="me-auto ms-auto"></mat-spinner>
22
<div *ngIf="!loading">
3-
<perun-web-apps-menu-buttons-field
4-
[items]="items"
5-
[size]="'small'"></perun-web-apps-menu-buttons-field>
3+
<perun-web-apps-menu-buttons-field [items]="items"></perun-web-apps-menu-buttons-field>
64
</div>
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
<mat-spinner *ngIf="loading" class="me-auto ms-auto"></mat-spinner>
22
<div *ngIf="!loading">
3-
<perun-web-apps-menu-buttons-field
4-
[items]="navItems"
5-
[size]="'small'"></perun-web-apps-menu-buttons-field>
3+
<perun-web-apps-menu-buttons-field [items]="items"></perun-web-apps-menu-buttons-field>
4+
<perun-web-apps-expandable-tiles
5+
[items]="settingsItems"
6+
[title]="'MENU_ITEMS.RESOURCE.SETTINGS'"
7+
[sectionId]="'settings'">
8+
</perun-web-apps-expandable-tiles>
69
</div>

apps/admin-gui/src/app/facilities/pages/resource-detail-page/resource-overview/resource-overview.component.ts

Lines changed: 34 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@ import {
1616
export class ResourceOverviewComponent implements OnInit {
1717
// class used for animation
1818
@HostBinding('class.router-component') true;
19-
navItems: MenuItem[] = [];
19+
items: MenuItem[] = [];
20+
settingsItems: MenuItem[] = [];
2021
resource: Resource;
2122
loading = false;
2223

@@ -31,46 +32,44 @@ export class ResourceOverviewComponent implements OnInit {
3132
ngOnInit(): void {
3233
this.loading = true;
3334
this.resource = this.entityStorageService.getEntity();
34-
if (this.route.parent.parent.snapshot.url[0].path === 'facilities') {
35-
this.initItems(false);
36-
} else {
37-
this.initItems(true);
38-
}
35+
const inVo = this.route.parent.parent.snapshot.url[0].path === 'facilities';
36+
this.setItems(inVo);
37+
this.setSettingsItems(inVo);
3938
this.loading = false;
4039
}
4140

42-
private initItems(inVo: boolean): void {
41+
private setItems(inVo: boolean): void {
4342
const urlStart = inVo
4443
? `/organizations/${this.resource.voId}`
4544
: `/facilities/${this.resource.facilityId}`;
46-
this.navItems = [];
45+
this.items = [];
4746

4847
if (this.routePolicyService.canNavigate('resources-groups', this.resource)) {
49-
this.navItems.push({
48+
this.items.push({
5049
cssIcon: 'perun-group',
5150
url: `${urlStart}/resources/${this.resource.id}/groups`,
5251
label: 'MENU_ITEMS.RESOURCE.ASSIGNED_GROUPS',
5352
style: 'resource-btn',
5453
});
5554
}
5655
if (this.routePolicyService.canNavigate('resources-services', this.resource)) {
57-
this.navItems.push({
56+
this.items.push({
5857
cssIcon: 'perun-service',
5958
url: `${urlStart}/resources/${this.resource.id}/services`,
6059
label: 'MENU_ITEMS.RESOURCE.ASSIGNED_SERVICES',
6160
style: 'resource-btn',
6261
});
6362
}
6463
if (this.routePolicyService.canNavigate('resources-members', this.resource)) {
65-
this.navItems.push({
64+
this.items.push({
6665
cssIcon: 'perun-user',
6766
url: `${urlStart}/resources/${this.resource.id}/members`,
6867
label: 'MENU_ITEMS.RESOURCE.ASSIGNED_MEMBERS',
6968
style: 'resource-btn',
7069
});
7170
}
7271
if (this.routePolicyService.canNavigate('resources-tags', this.resource)) {
73-
this.navItems.push({
72+
this.items.push({
7473
cssIcon: 'perun-resource-tags',
7574
url: `${urlStart}/resources/${this.resource.id}/tags`,
7675
label: 'MENU_ITEMS.RESOURCE.RESOURCE_TAGS',
@@ -79,19 +78,36 @@ export class ResourceOverviewComponent implements OnInit {
7978
}
8079

8180
if (this.routePolicyService.canNavigate('resources-attributes', this.resource)) {
82-
this.navItems.push({
81+
this.items.push({
8382
cssIcon: 'perun-attributes',
8483
url: `${urlStart}/resources/${this.resource.id}/attributes`,
8584
label: 'MENU_ITEMS.RESOURCE.ATTRIBUTES',
8685
style: 'resource-btn',
8786
});
8887
}
88+
}
89+
90+
private setSettingsItems(inVo: boolean): void {
91+
this.settingsItems = [];
92+
93+
if (this.routePolicyService.canNavigate('resources-settings-managers', this.resource)) {
94+
this.settingsItems.push({
95+
cssIcon: 'perun-manager',
96+
url: `${
97+
inVo ? `/organizations/${this.resource.voId}` : `/facilities/${this.resource.facilityId}`
98+
}/resources/${this.resource.id}/settings/managers`,
99+
label: 'MENU_ITEMS.RESOURCE.MANAGERS',
100+
style: 'resource-btn',
101+
});
102+
}
89103

90-
if (this.routePolicyService.canNavigate('resources-settings', this.resource)) {
91-
this.navItems.push({
92-
cssIcon: 'perun-settings2',
93-
url: `${urlStart}/resources/${this.resource.id}/settings`,
94-
label: 'MENU_ITEMS.RESOURCE.SETTINGS',
104+
if (this.routePolicyService.canNavigate('resources-settings-bans', this.resource)) {
105+
this.settingsItems.push({
106+
cssIcon: 'perun-ban',
107+
url: `${
108+
inVo ? `/organizations/${this.resource.voId}` : `/facilities/${this.resource.facilityId}`
109+
}/resources/${this.resource.id}/settings/bans`,
110+
label: 'MENU_ITEMS.RESOURCE.BANS',
95111
style: 'resource-btn',
96112
});
97113
}
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
11
<mat-spinner *ngIf="loading" class="me-auto ms-auto"></mat-spinner>
22
<div *ngIf="!loading">
3-
<perun-web-apps-menu-buttons-field
4-
[items]="items"
5-
[size]="'small'"></perun-web-apps-menu-buttons-field>
3+
<perun-web-apps-menu-buttons-field [items]="items"></perun-web-apps-menu-buttons-field>
64
</div>

apps/admin-gui/src/app/shared/shared.module.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,6 @@ import { ApplicationRejectDialogComponent } from './components/dialogs/applicati
4646
import { AnyToStringPipe } from './pipes/any-to-string.pipe';
4747
import { DeleteAttributeDialogComponent } from './components/dialogs/delete-attribute-dialog/delete-attribute-dialog.component';
4848
import { RemoveMembersDialogComponent } from './components/dialogs/remove-members-dialog/remove-members-dialog.component';
49-
import { SideMenuRootItemComponent } from './side-menu/side-menu-root-item/side-menu-root-item.component';
5049
import { DebuggerPageComponent } from './debugger-page/debugger-page.component';
5150
import { RemoveResourceDialogComponent } from './components/dialogs/remove-resource-dialog/remove-resource-dialog.component';
5251
import { AddManagerDialogComponent } from './components/dialogs/add-manager-dialog/add-manager-dialog.component';
@@ -306,7 +305,6 @@ import { AddGroupToGroupRegistrationComponent } from './components/dialogs/add-g
306305
ExtSourcesListComponent,
307306
ExtSourceTypePipe,
308307
ConfigTableConfigModule,
309-
SideMenuRootItemComponent,
310308
DestinationListComponent,
311309
TwoEntityAttributePageComponent,
312310
HostsListComponent,
@@ -352,7 +350,6 @@ import { AddGroupToGroupRegistrationComponent } from './components/dialogs/add-g
352350
ApplicationFormCopyItemsDialogComponent,
353351
AddApplicationFormItemDialogComponent,
354352
EditApplicationFormItemDialogComponent,
355-
SideMenuRootItemComponent,
356353
AnyToStringPipe,
357354
DeleteAttributeDialogComponent,
358355
AddMemberDialogComponent,

0 commit comments

Comments
 (0)