diff --git a/src/app/appmarket/appdetails/appdetails.component.html b/src/app/appmarket/appdetails/appdetails.component.html index 38e24d7c3e8d93e38210e68fdfc84166db3ff9d4..5e68b8317dafb6433a685b89004eefac33117cf1 100644 --- a/src/app/appmarket/appdetails/appdetails.component.html +++ b/src/app/appmarket/appdetails/appdetails.component.html @@ -13,7 +13,7 @@ <div *ngIf="!subscribed && isSubscriptionAllowed()" class="pull-right" pTooltip="{{'APPLICATIONS.TOOLTIP_MESSAGE_SUBSCRIBE' | translate}}" tooltipPosition="bottom" [showDelay]="50" [tooltipDisabled]="defaultTooltipDisabled"> <button class="btn btn-primary m-1" [disabled]="!active || !isApplicationEnabledInDomain()" (click)="subscribe()">{{'APPLICATIONS.SUBSCRIBE_BUTTON' | translate}}</button> - <button class="btn btn-primary m-1"[routerLink]="['/admin/apps/bulks/new/select']" [queryParams]="{id: appId }">Bulk deployments</button> + <button class="btn btn-primary m-1"[routerLink]="['/admin/apps/bulks/new/select']" [queryParams]="{id: appId }">Bulk deployment</button> </div> <div *ngIf="subscribed" class=" pull-right" > diff --git a/src/app/shared/common/domainfilter/domainfilter.component.html b/src/app/shared/common/domainfilter/domainfilter.component.html index a307df6d8ce63368b3b289c83c0cdccf9a2b0e4d..0fa6d170b4c8af05d0b7d35c4f9cdb3f3fc6ffe3 100644 --- a/src/app/shared/common/domainfilter/domainfilter.component.html +++ b/src/app/shared/common/domainfilter/domainfilter.component.html @@ -17,8 +17,10 @@ <p-dropdown [options]="domains | async" [(ngModel)]="selectedDomain" + [filter]="true" + filterBy="name" optionLabel="name" - [filter]="false" + [filterPlaceholder]="'SEARCH' | translate" (onChange)="changeDomain($event.value.id, $event.value.name)" appendTo="body"> diff --git a/src/app/shared/left-menu/left-menu.component.css b/src/app/shared/left-menu/left-menu.component.css index 362d4dc45fd8194122f8fc3dc12982bf0f6e99ad..8a47be2c07044a484be9e631e8e5f70d192381ba 100644 --- a/src/app/shared/left-menu/left-menu.component.css +++ b/src/app/shared/left-menu/left-menu.component.css @@ -104,6 +104,16 @@ .collapsed-user{ width: 130px; } -::ng-deep app-modal-notification-send { +::-webkit-scrollbar { + width: 7px; +} +::-webkit-scrollbar-track { + /*box-shadow: inset 0 0 3px rgba(0, 0, 0, 0.15);*/ + /*border-radius: 10px;*/ +} + +::-webkit-scrollbar-thumb { + background: #8B8B8B; + border-radius: 10px; } diff --git a/src/app/shared/left-menu/left-menu.component.html b/src/app/shared/left-menu/left-menu.component.html index 0ffb376416ef1b55b20371eec117a5d59586bbc5..1adb9cc02d690fc28508474836bf2affdb35e9b1 100644 --- a/src/app/shared/left-menu/left-menu.component.html +++ b/src/app/shared/left-menu/left-menu.component.html @@ -10,10 +10,10 @@ <i *ngIf="isCollapsed" style="font-size: 1.8rem" class="pi pi-angle-right"></i> </div> </div> - <div style="margin-top: 30px"> + <div style="margin-top: 30px; padding-right:5px"> <nmaas-domain-filter class="drop-domain"></nmaas-domain-filter> </div> - <ul *ngIf="!toggleAdmin" style="margin-top: 30px" > + <ul *ngIf="!toggleAdmin" style="margin-top: 30px;" > <li [routerLinkActiveOptions]="{exact:true}" [routerLinkActive]="['active']" [ngClass]="{'collapsed': isCollapsed}"> <a style="display: flex; align-items: center;" [routerLink]="['/']"> <i class="pi pi-th-large" style="margin-right:10px; font-size: 18px" title="Application"></i> @@ -31,7 +31,7 @@ </a> </li> </ul> - <ul *ngIf="toggleAdmin" style="margin-top: 30px"> + <ul *ngIf="toggleAdmin" style="margin-top: 30px; max-height: 65vh; overflow: auto; padding-right:5px"> <li [routerLinkActiveOptions]="{exact:true}" [routerLinkActive]="['active']" [ngClass]="{'collapsed': isCollapsed}"> <a style="display: flex; align-items: center;" [routerLink]="['admin/dashboard']"> <i class="pi pi-chart-bar" style="margin-right:10px; font-size: 18px" title="Dashboard"></i> @@ -162,7 +162,7 @@ <p-menu #menu [model]="items" [popup]="true" class="test" [ngClass]="{'collapsed-user': isCollapsed}"/> <p-button (onClick)="menu.toggle($event)" class="user-button"><i class="pi pi-user" style="font-size: 18px; margin-right:10px"[ngClass]="{'collapsed': isCollapsed}" title="User"></i> <span *ngIf="!isCollapsed"> - User + {{userName}} </span> </p-button> <div *roles="['ROLE_DOMAIN_ADMIN', 'ROLE_SYSTEM_ADMIN']" style="margin-top:10px" [routerLink]="['admin/dashboard']"> diff --git a/src/app/shared/left-menu/left-menu.component.spec.ts b/src/app/shared/left-menu/left-menu.component.spec.ts index b1c9a408ff29d9de9477256c88225cbe5ad1bfd8..c4f9e1c68ecdf3a79c1070cc0cad45a5d8dae3af 100644 --- a/src/app/shared/left-menu/left-menu.component.spec.ts +++ b/src/app/shared/left-menu/left-menu.component.spec.ts @@ -4,6 +4,8 @@ import { Router, NavigationEnd, ActivatedRoute } from '@angular/router'; import { ToastContainerComponent } from '../toast-container/toast-container.component'; import { CUSTOM_ELEMENTS_SCHEMA, NO_ERRORS_SCHEMA } from '@angular/core'; import { of, Subject } from 'rxjs'; +import {ProfileService} from '../../service/profile.service'; +import {AuthService} from '../../auth/auth.service'; describe('LeftMenuComponent', () => { let component: LeftMenuComponent; @@ -23,13 +25,20 @@ describe('LeftMenuComponent', () => { mockActivatedRoute = { snapshot: { params: {}, queryParams: {} } }; + const profileServiceSpy = jasmine.createSpyObj('ProfileService', ['getOne']) + profileServiceSpy.getOne.and.returnValue(of()) + + const authServiceSpy = jasmine.createSpyObj('AuthService', ['getPreferredUsername']); + authServiceSpy.getPreferredUsername.and.returnValue(true) await TestBed.configureTestingModule({ declarations: [LeftMenuComponent], providers: [ { provide: Router, useValue: mockRouter }, { provide: ToastContainerComponent, useValue: mockToast }, - { provide: ActivatedRoute, useValue: mockActivatedRoute } + { provide: ActivatedRoute, useValue: mockActivatedRoute }, + { provide: ProfileService, useValue: profileServiceSpy }, + { provide: AuthService, useValue: authServiceSpy } ], schemas: [CUSTOM_ELEMENTS_SCHEMA, NO_ERRORS_SCHEMA] }).compileComponents(); diff --git a/src/app/shared/left-menu/left-menu.component.ts b/src/app/shared/left-menu/left-menu.component.ts index 84ae20e7257e52be870f5f64f9edda7fbc7362c6..05e9623b6245a7dbe4a7590082ec25616c3c3894 100644 --- a/src/app/shared/left-menu/left-menu.component.ts +++ b/src/app/shared/left-menu/left-menu.component.ts @@ -3,6 +3,8 @@ import { ToastContainerComponent, ToastMode } from '../toast-container/toast-con import {ActivatedRoute, NavigationEnd, Router} from '@angular/router'; import {MenuItem} from 'primeng/api'; import {ModalNotificationSendComponent} from '../modal/modal-notification-send/modal-notification-send.component'; +import {AuthService} from '../../auth/auth.service'; +import {ProfileService} from '../../service/profile.service'; @Component({ selector: 'app-left-menu', @@ -15,12 +17,15 @@ export class LeftMenuComponent implements OnInit { items: MenuItem[]; toggleAdmin = false; - currentUrl : string ; + currentUrl: string ; isCollapsed = false; + userName; constructor(private toast: ToastContainerComponent, public router: Router, - private readonly activeRoute: ActivatedRoute,) { + private readonly activeRoute: ActivatedRoute, + public authService: AuthService, + protected profileService: ProfileService) { this.items = [ { label: 'Profile', @@ -40,11 +45,19 @@ export class LeftMenuComponent implements OnInit { } public ngOnInit(): void { + this.profileService.getOne().subscribe((user) => { + if (user.firstname && user.lastname) { + this.userName = user.firstname + ' ' + user.lastname; + } else { + this.userName = this.authService.getPreferredUsername() + } + }); + this.router.events.subscribe(event => { if (event instanceof NavigationEnd) { this.currentUrl = event.urlAfterRedirects; console.log('Aktualny URL:', this.currentUrl); - if(this.currentUrl.includes('admin')) { + if (this.currentUrl.includes('admin')) { this.toggleAdmin = true; } }