diff --git a/src/app/modules/shared/components/employee-info/employee-info.component.html b/src/app/modules/shared/components/employee-info/employee-info.component.html deleted file mode 100644 index fb386ba..0000000 --- a/src/app/modules/shared/components/employee-info/employee-info.component.html +++ /dev/null @@ -1,7 +0,0 @@ -
- -
- - -
-
diff --git a/src/app/modules/shared/components/employee-info/employee-info.component.sass b/src/app/modules/shared/components/employee-info/employee-info.component.sass deleted file mode 100644 index 462ef51..0000000 --- a/src/app/modules/shared/components/employee-info/employee-info.component.sass +++ /dev/null @@ -1,12 +0,0 @@ -@import "../../../../../custom-theme" - -p, labeled-icon - margin: 0 - color: $light-primary-text - -.employee-info-container - margin-top: .85rem - margin-right: 1rem - -.employee-info-group - margin-left: 0.7rem diff --git a/src/app/modules/shared/components/employee-info/employee-menu.component.html b/src/app/modules/shared/components/employee-info/employee-menu.component.html new file mode 100644 index 0000000..ee806f0 --- /dev/null +++ b/src/app/modules/shared/components/employee-info/employee-menu.component.html @@ -0,0 +1,45 @@ +
+
+ + +
+ + + + +
+
+ + + + + + + +
diff --git a/src/app/modules/shared/components/employee-info/employee-menu.component.sass b/src/app/modules/shared/components/employee-info/employee-menu.component.sass new file mode 100644 index 0000000..7da5a0c --- /dev/null +++ b/src/app/modules/shared/components/employee-info/employee-menu.component.sass @@ -0,0 +1,38 @@ +@import "../../../../../custom-theme" + +p, labeled-icon + margin: 0 + color: $light-primary-text + +.employee-info-wrapper + margin: 1rem 1rem 0 + cursor: pointer + + &:hover labeled-icon + text-decoration: underline + +.employee-info-group + margin-left: 0.7rem + +mat-action-list + position: absolute + transform: translateY(-2px) + z-index: 91 + +button + background-color: $color-primary !important + color: $light-primary-text !important + + &:hover + background-color: $color-primary !important + text-decoration: underline + + &:not(.mat-list-item) + font-size: 16px + font-weight: 400 + line-height: 24px + margin-top: 16px + padding-left: 16px + padding-right: 16px + height: 48px + border: none diff --git a/src/app/modules/shared/components/employee-info/employee-info.component.ts b/src/app/modules/shared/components/employee-info/employee-menu.component.ts similarity index 83% rename from src/app/modules/shared/components/employee-info/employee-info.component.ts rename to src/app/modules/shared/components/employee-info/employee-menu.component.ts index a4dda93..9224304 100644 --- a/src/app/modules/shared/components/employee-info/employee-info.component.ts +++ b/src/app/modules/shared/components/employee-info/employee-menu.component.ts @@ -5,14 +5,15 @@ import {Subject} from "rxjs"; import {takeUntil} from "rxjs/operators"; @Component({ - selector: 'cre-employee-info', - templateUrl: './employee-info.component.html', - styleUrls: ['./employee-info.component.sass'] + selector: 'cre-employee-menu', + templateUrl: './employee-menu.component.html', + styleUrls: ['./employee-menu.component.sass'] }) -export class EmployeeInfoComponent implements OnInit, OnDestroy { +export class EmployeeMenuComponent implements OnInit, OnDestroy { authenticated = false employee: Employee = null employeeInGroup = false + menuEnabled = false private destroy$ = new Subject() diff --git a/src/app/modules/shared/components/header/header.component.html b/src/app/modules/shared/components/header/header.component.html index ebfa6b0..51aabfa 100644 --- a/src/app/modules/shared/components/header/header.component.html +++ b/src/app/modules/shared/components/header/header.component.html @@ -16,7 +16,7 @@ - + this.updateEnabledLinks(authentication.authenticated, authentication.authenticatedUser) + authentication => this.updateEnabledLinks(authentication.authenticatedUser) ) } @@ -72,20 +70,13 @@ export class HeaderComponent extends SubscribingComponent { return this._activeLink } - private updateEnabledLinks(authenticated: boolean, employee: Employee) { - this.link('/account/login').enabled = !authenticated - this.link('/account/logout').enabled = authenticated - + private updateEnabledLinks(employee: Employee) { this.links.forEach(l => { if (l.requiredPermission) { l.enabled = employee && employee.permissions.indexOf(l.requiredPermission) >= 0 } }) } - - private link(route: string) { - return this.links.filter(l => l.route === route)[0] - } } class HeaderLink { diff --git a/src/app/modules/shared/components/nav/nav.component.sass b/src/app/modules/shared/components/nav/nav.component.sass index c8a7b04..05f5622 100644 --- a/src/app/modules/shared/components/nav/nav.component.sass +++ b/src/app/modules/shared/components/nav/nav.component.sass @@ -2,7 +2,7 @@ nav position: relative - z-index: 99 + z-index: 90 padding-bottom: 1px a diff --git a/src/app/modules/shared/shared.module.ts b/src/app/modules/shared/shared.module.ts index c2325f0..bc09ead 100644 --- a/src/app/modules/shared/shared.module.ts +++ b/src/app/modules/shared/shared.module.ts @@ -7,7 +7,7 @@ import {MatFormFieldModule} from '@angular/material/form-field' import {MatInputModule} from '@angular/material/input' import {MatIconModule} from '@angular/material/icon' import {FormsModule, ReactiveFormsModule} from '@angular/forms' -import {EmployeeInfoComponent} from './components/employee-info/employee-info.component' +import {EmployeeMenuComponent} from './components/employee-info/employee-menu.component' import {LabeledIconComponent} from './components/labeled-icon/labeled-icon.component' import {MatTableModule} from '@angular/material/table' import {CommonModule} from '@angular/common' @@ -35,7 +35,7 @@ import {MatProgressSpinnerModule} from '@angular/material/progress-spinner' @NgModule({ - declarations: [HeaderComponent, EmployeeInfoComponent, LabeledIconComponent, ConfirmBoxComponent, PermissionsListComponent, PermissionsFieldComponent, NavComponent, EntityListComponent, EntityAddComponent, EntityEditComponent, FileButtonComponent, GlobalAlertHandlerComponent, SliderFieldComponent, LoadingWheelComponent], + declarations: [HeaderComponent, EmployeeMenuComponent, LabeledIconComponent, ConfirmBoxComponent, PermissionsListComponent, PermissionsFieldComponent, NavComponent, EntityListComponent, EntityAddComponent, EntityEditComponent, FileButtonComponent, GlobalAlertHandlerComponent, SliderFieldComponent, LoadingWheelComponent], exports: [ CommonModule, HttpClientModule, @@ -78,6 +78,7 @@ import {MatProgressSpinnerModule} from '@angular/material/progress-spinner' MatInputModule, MatSelectModule, MatOptionModule, + MatListModule, MatSliderModule, MatProgressSpinnerModule, ReactiveFormsModule,