Skip to content

Commit

Permalink
Merge branch 'master' into production
Browse files Browse the repository at this point in the history
  • Loading branch information
HejdaJakub committed Aug 16, 2023
2 parents f9dc79a + 70ca49d commit 65e025b
Show file tree
Hide file tree
Showing 41 changed files with 572 additions and 107 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -994,20 +994,20 @@ export class SideMenuItemService {
this.apiRequest.dontHandleErrorForNext();
this.attributesManager
.getGroupAttributeByName(group.id, Urns.GROUP_DEF_EXPIRATION_RULES)
.subscribe(
() => {
settingsChildrenLinks.push({
.subscribe({
next: () => {
settingsChildrenLinks.unshift({
label: 'MENU_ITEMS.GROUP.EXPIRATION',
url: [`/organizations/${group.voId}/groups/${group.id}/settings/expiration`],
activatedRegex: '/organizations/\\d+/groups/\\d+/settings/expiration$',
});
},
(error: RPCError) => {
error: (error: RPCError) => {
if (error.name !== 'PrivilegeException') {
this.notificator.showRPCError(error);
}
}
);
},
});

//SettingsManagers
if (this.routePolicyService.canNavigate('groups-settings-managers', group)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,13 +52,17 @@
{{'VO_DETAIL.SETTINGS.NOTIFICATIONS.TABLE_APPLICATION_TYPE' | translate}}
</th>
<td *matCellDef="let applicationMail" mat-cell>
<div *ngIf="applicationMail.appType === 'INITIAL'; else extension">
<div
*ngIf="applicationMail.appType === 'INITIAL'; else extension"
class="d-flex align-items-center">
<mat-icon matTooltip="Initial" matTooltipPosition="above">arrow_right_alt</mat-icon>
{{'VO_DETAIL.SETTINGS.NOTIFICATIONS.TABLE_APPLICATION_TYPE_INITIAL' | translate}}
</div>
<ng-template #extension>
<mat-icon matTooltip="Extension" matTooltipPosition="above">cached</mat-icon>
{{'VO_DETAIL.SETTINGS.NOTIFICATIONS.TABLE_APPLICATION_TYPE_EXTENSION' | translate}}
<div class="d-flex align-items-center">
<mat-icon matTooltip="Extension" matTooltipPosition="above">cached</mat-icon>
{{'VO_DETAIL.SETTINGS.NOTIFICATIONS.TABLE_APPLICATION_TYPE_EXTENSION' | translate}}
</div>
</ng-template>
</td>
</ng-container>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ <h1 class="page-subtitle">{{'GROUP_DETAIL.SUBGROUPS.TITLE' | translate}}</h1>
[groups]="groups"
(moveGroup)="onMoveGroup($event)"
(refreshTable)="refreshTable()"
[displayedColumns]="['nameWithId', 'description', 'menu']"
[hideCheckbox]="!deleteAuth"
[filterValue]="filterValue"
[selection]="selected">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,20 +25,45 @@ <h1 class="page-subtitle">{{'MEMBER_DETAIL.GROUPS.TITLE' | translate}}</h1>
(filter)="applyFilter($event)"
[placeholder]="'SHARED_LIB.PERUN.COMPONENTS.RESOURCES_LIST.TABLE_SEARCH'">
</perun-web-apps-debounce-filter>
<label class="slide-label" (click)="labelToggle()">
{{'MEMBER_DETAIL.GROUPS.TREE_VIEW' | translate}}
</label>
<mat-slide-toggle #toggle (change)="selection.clear()" [(ngModel)]="showGroupList" class="me-1">
</mat-slide-toggle>
<label class="slide-label" (click)="labelToggle()">
{{'MEMBER_DETAIL.GROUPS.LIST_VIEW' | translate}}
</label>
<ng-template #spinner>
<perun-web-apps-loading-table></perun-web-apps-loading-table>
</ng-template>
<div class="position-relative">
<perun-web-apps-groups-list
*perunWebAppsLoader="loading; indicator: spinner"
(refreshTable)="refreshTable()"
[displayedColumns]="['select', 'id', 'name', 'description', 'expiration', 'groupStatus']"
[memberId]="memberId"
[disableRouting]="!routeAuth"
[groups]="groups"
[filter]="filterValue"
[memberGroupStatus]="member?.groupStatus"
[selection]="selection"
[tableId]="tableId">
</perun-web-apps-groups-list>
<div *ngIf="!showGroupList">
<perun-web-apps-groups-tree
*perunWebAppsLoader="loading; indicator: spinner"
(refreshTable)="refreshTable()"
(changeExpiration)="changeExpiration($event)"
[expandAll]="filtering"
[disableRouting]="!routeAuth"
[groups]="groups"
[selection]="selection"
[filterValue]="filterValue"
[displayedColumns]="['nameWithId', 'description', 'expiration', 'status']"
theme="member-theme">
</perun-web-apps-groups-tree>
</div>
<div [hidden]="!showGroupList">
<perun-web-apps-groups-list
#list
*perunWebAppsLoader="loading; indicator: spinner"
(refreshTable)="refreshTable()"
[displayedColumns]="['select', 'id', 'name', 'description', 'expiration', 'groupStatus']"
[memberId]="memberId"
[disableRouting]="!routeAuth"
[groups]="groups"
[filter]="filterValue"
[memberGroupStatus]="member?.groupStatus"
[selection]="selection"
[tableId]="tableId">
</perun-web-apps-groups-list>
</div>
</div>
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
.slide-label {
display: inline;
cursor: pointer;
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Component, HostBinding, OnInit } from '@angular/core';
import { Component, HostBinding, OnInit, ViewChild } from '@angular/core';
import { ActivatedRoute } from '@angular/router';
import {
Group,
Expand All @@ -17,6 +17,9 @@ import { GuiAuthResolver } from '@perun-web-apps/perun/services';
import { Urns } from '@perun-web-apps/perun/urns';
import { Observable } from 'rxjs';
import { map, startWith } from 'rxjs/operators';
import { MatSlideToggle } from '@angular/material/slide-toggle';
import { GroupsListComponent } from '@perun-web-apps/perun/components';
import { GroupWithStatus } from '@perun-web-apps/perun/models';

@Component({
selector: 'app-member-groups',
Expand All @@ -28,14 +31,18 @@ export class MemberGroupsComponent implements OnInit {

// used for router animation
@HostBinding('class.router-component') true;
@ViewChild('toggle', { static: true }) toggle: MatSlideToggle;
@ViewChild('list') private list: GroupsListComponent;

groups: Group[] = [];
memberId: number;
member: Member;
allGroups: Group[];
loading: boolean;
filterValue = '';
filtering = false;
tableId = TABLE_MEMBER_DETAIL_GROUPS;
showGroupList = false;
selection = new SelectionModel<Group>(true, []);
addAuth: boolean;
routeAuth: boolean;
Expand Down Expand Up @@ -67,6 +74,16 @@ export class MemberGroupsComponent implements OnInit {
this.groupsService.getAllGroups(this.member.voId).subscribe((allGroups) => {
this.allGroups = allGroups;
this.refreshTable();
if (localStorage.getItem('preferedValue') === 'list') {
this.toggle.toggle();
this.showGroupList = true;
}

this.toggle.change.subscribe(() => {
const value = this.toggle.checked ? 'list' : 'tree';
localStorage.setItem('preferedValue', value);
this.refreshTable();
});
});
});
});
Expand All @@ -80,15 +97,19 @@ export class MemberGroupsComponent implements OnInit {
Urns.MEMBER_GROUP_STATUS,
Urns.MEMBER_GROUP_STATUS_INDIRECT,
])
.subscribe(
(groups) => {
.subscribe({
next: (groups) => {
this.selection.clear();
this.groups = groups;
this.setAuthRights();
this.loading = false;
},
() => (this.loading = false)
);
error: () => (this.loading = false),
});
}

changeExpiration(group: GroupWithStatus): void {
this.list.changeExpiration(group);
}

setAuthRights(): void {
Expand Down Expand Up @@ -148,5 +169,11 @@ export class MemberGroupsComponent implements OnInit {

applyFilter(filterValue: string): void {
this.filterValue = filterValue;
this.filtering = filterValue !== '';
}

labelToggle(): void {
this.showGroupList = !this.showGroupList;
this.refreshTable();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ <h1 class="page-subtitle">{{'VO_DETAIL.GROUPS.TITLE' | translate}}</h1>
*perunWebAppsLoader="loading$ | async; indicator: spinner"
(moveGroup)="onMoveGroup($event)"
(refreshTable)="refresh()"
[displayedColumns]="['nameWithId', 'description', 'menu']"
[expandAll]="filtering"
[disableRouting]="!routeAuth"
[groups]="groups"
Expand Down
27 changes: 25 additions & 2 deletions apps/admin-gui/src/assets/i18n/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -832,7 +832,9 @@
"TITLE": "Member groups",
"ADD": "Add",
"REMOVE": "Remove",
"REMOVE_PERMISSION_HINT": "You don't have permission to remove some of the selected groups."
"REMOVE_PERMISSION_HINT": "You don't have permission to remove some of the selected groups.",
"LIST_VIEW": "List view",
"TREE_VIEW": "Tree view"
},
"APPLICATIONS": {
"TITLE": "Application",
Expand Down Expand Up @@ -3104,10 +3106,22 @@
"USER_DONT_EXIST": {
"TITLE": "The requested user (by Id or external identity) doesn't exist."
},
"USER_NOT_ALLOWED": {
"TITLE": "Access not allowed",
"MESSAGE": "Service accounts are not allowed to access this application.",
"REDIRECT": "Redirect to login page"
},
"TABLE_OPTIONS": {
"EXPORT_TO_FILE": "Export to file",
"ALL_DATA": "All data",
"EXPORT_TITLE": "Export table",
"BUTTON_EXPORT": "Export",
"BUTTON_CLOSE": "Close",
"SELECT_FORMAT": "Select format",
"EXPORT_OPTIONS": "Export options",
"DISPLAYED_DATA": "Displayed data",
"ALL_DATA": "All data",
"ERROR_FORMAT":"Export format is not selected",
"ERROR_OPTION": "Export option is not selected",
"EXPORT_LOADING": "Exporting data...",
"MORE": "More"
},
Expand Down Expand Up @@ -3161,6 +3175,15 @@
"FIELD_EMPTY": "This field cannot be empty",
"SUCCESS": "Password has been changed successfully,"
},
"RESET_PASSWORD_DIALOG": {
"LOGIN": "Login",
"NAMESPACE": "Namespace",
"TITLE": "Reset password",
"CANCEL": "Cancel",
"CHANGE": "Confirm",
"FIELD_EMPTY": "This field cannot be empty",
"SUCCESS": "Password has been reset successfully,"
},
"PASSWORD_FORM_FIELD": {
"PASSWORD": "Password",
"PASSWORD_AGAIN": "Confirm password",
Expand Down
5 changes: 5 additions & 0 deletions apps/consolidator/src/assets/i18n/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,11 @@
"REMOVE": "Remove",
"SUCCESS": "User account successfully removed"
}
},
"USER_NOT_ALLOWED": {
"TITLE": "Access not allowed",
"MESSAGE": "Service accounts are not allowed to access this application.",
"REDIRECT": "Redirect to login page"
}
},
"CONSOLIDATOR": {
Expand Down
5 changes: 5 additions & 0 deletions apps/linker/src/assets/i18n/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,11 @@
"FOCUS_ON_MFA_DIALOG": {
"MODAL": "Modal window is opened.",
"MODAL_WARNING": "Please check your browser settings if no modal window is open."
},
"USER_NOT_ALLOWED": {
"TITLE": "Access not allowed",
"MESSAGE": "Service accounts are not allowed to access this application.",
"REDIRECT": "Redirect to login page"
}
}
},
Expand Down
5 changes: 5 additions & 0 deletions apps/password-reset/src/assets/i18n/cs.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,11 @@
"USER_DONT_EXIST": {
"TITLE": "Požadovaný uživatel (dle ID nebo externí identity) neexistuje."
},
"USER_NOT_ALLOWED": {
"TITLE": "Přístup není povolen",
"MESSAGE": "Servisní účty (Service account) nemají povolen přístup k této aplikaci.",
"REDIRECT": "Přesměrovaní na přihlášení"
},
"SESSION_EXPIRATION": {
"TITLE": "Platnost přihlášení vypršela",
"DESCRIPTION": "Byli jste automaticky odhlášeni. Pro pokračování se znovu přihlaste.",
Expand Down
5 changes: 5 additions & 0 deletions apps/password-reset/src/assets/i18n/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,11 @@
"USER_DONT_EXIST": {
"TITLE": "Requested user (by ID or external identity) doesn't exist."
},
"USER_NOT_ALLOWED": {
"TITLE": "Access not allowed",
"MESSAGE": "Service accounts are not allowed to access this application.",
"REDIRECT": "Redirect to login page"
},
"SESSION_EXPIRATION": {
"TITLE": "Session expiration",
"DESCRIPTION": "Your session has expired. Please sign in to continue.",
Expand Down
17 changes: 15 additions & 2 deletions apps/publications/src/assets/i18n/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -356,11 +356,24 @@
"USER_DONT_EXIST": {
"TITLE": "Requested user (by ID or external identity) doesn't exist."
},
"USER_NOT_ALLOWED": {
"TITLE": "Access not allowed",
"MESSAGE": "Service accounts are not allowed to access this application.",
"REDIRECT": "Redirect to login page"
},
"TABLE_OPTIONS": {
"EXPORT_TO_FILE": "Export to file",
"ALL_DATA": "All data",
"EXPORT_TITLE": "Export table",
"BUTTON_EXPORT": "Export",
"BUTTON_CLOSE": "Close",
"SELECT_FORMAT": "Select format",
"EXPORT_OPTIONS": "Export options",
"DISPLAYED_DATA": "Displayed data",
"EXPORT_LOADING": "Exporting data..."
"ALL_DATA": "All data",
"ERROR_FORMAT":"Export format is not selected",
"ERROR_OPTION": "Export option is not selected",
"EXPORT_LOADING": "Exporting data...",
"MORE": "More"
},
"NOTIFICATOR": {
"NOTIFICATION": {
Expand Down
Loading

0 comments on commit 65e025b

Please sign in to comment.