commit 37333849a1cbed546ed32d13ece63889a8a27726
Author: Václav Jirák <jirakv95@gmail.com>
Date:   Wed May 8 15:40:10 2019 +0200

    Re #7457 Basic features of profile settings component implemented

diff --git a/webapp/src/app/app.component.html b/webapp/src/app/app.component.html
index 8a5ed38..f3e9199 100644
--- a/webapp/src/app/app.component.html
+++ b/webapp/src/app/app.component.html
@@ -1,11 +1,5 @@
 <div class="container-fluid h-100">
-  <div class="row header">
-    <img class="logo" src="../assets/images/logo.png" />
-    <div class="user-info">
-      <img class="user-icon" src="../assets/images/default-user.png"/>
-      <span class="user-name">Václav Jirák</span>
-    </div>
-  </div>
+  <app-header></app-header>
   <div class="row navigation-and-content">
     <div class="col-lg-2 navigation">
       <app-menu></app-menu>
diff --git a/webapp/src/app/app.component.sass b/webapp/src/app/app.component.sass
index a9f6736..92a1a78 100644
--- a/webapp/src/app/app.component.sass
+++ b/webapp/src/app/app.component.sass
@@ -1,25 +1,3 @@
-.header
-  height: 50px
-  background-color: #3F425D
-  padding-left: 10px
-
-.user-info
-  height: 100%
-  margin-left: auto
-  margin-right: 0
-
-.user-icon
-  width: 35px
-  height: 35px
-  border-radius: 20px
-
-.user-name
-  height: 50px
-  line-height: 50px
-  color: white
-  margin-left: 10px
-  margin-right: 10px
-
 .navigation-and-content
   height: calc(100% - 50px)
 
diff --git a/webapp/src/app/app.module.ts b/webapp/src/app/app.module.ts
index cffbfb9..8ac2e95 100644
--- a/webapp/src/app/app.module.ts
+++ b/webapp/src/app/app.module.ts
@@ -6,17 +6,23 @@ import { AppComponent } from './app.component';
 import { MenuComponent } from './menu/menu.component';
 import { EmployeesListComponent } from './employees-list/employees-list.component';
 import { DashboardModule } from './dashboard/dashboard.module';
+import { HeaderComponent } from './header/header.component';
+import { MatDialogModule } from '@angular/material';
+import {ProfileSettingsModule} from './profile-settings/profile-settings.module';
 
 @NgModule({
   declarations: [
     AppComponent,
     MenuComponent,
-    EmployeesListComponent
+    EmployeesListComponent,
+    HeaderComponent
   ],
   imports: [
     BrowserModule,
     AppRoutingModule,
-    DashboardModule
+    DashboardModule,
+    MatDialogModule,
+    ProfileSettingsModule
   ],
   providers: [],
   bootstrap: [AppComponent]
diff --git a/webapp/src/app/header/header.component.html b/webapp/src/app/header/header.component.html
new file mode 100644
index 0000000..fac7013
--- /dev/null
+++ b/webapp/src/app/header/header.component.html
@@ -0,0 +1,7 @@
+<div class="row header">
+  <img class="logo" src="../../assets/images/logo.png" />
+  <button class="user-info" (click)="onProfileClick()">
+    <img class="user-icon" src="../../assets/images/default-user.png"/>
+    <span class="user-name">{{name}}</span>
+  </button>
+</div>
diff --git a/webapp/src/app/header/header.component.sass b/webapp/src/app/header/header.component.sass
new file mode 100644
index 0000000..4e5a1b2
--- /dev/null
+++ b/webapp/src/app/header/header.component.sass
@@ -0,0 +1,26 @@
+.header
+  height: 50px
+  background-color: #3F425D
+  padding-left: 10px
+
+.user-info
+  height: 100%
+  margin-left: auto
+  margin-right: 0
+  border: 0
+  background-color: transparent
+
+  &:focus
+    outline: none
+
+.user-icon
+  width: 35px
+  height: 35px
+  border-radius: 20px
+
+.user-name
+  height: 50px
+  line-height: 50px
+  color: white
+  margin-left: 10px
+  margin-right: 10px
diff --git a/webapp/src/app/header/header.component.ts b/webapp/src/app/header/header.component.ts
new file mode 100644
index 0000000..487aee8
--- /dev/null
+++ b/webapp/src/app/header/header.component.ts
@@ -0,0 +1,21 @@
+import { Component, Input } from '@angular/core';
+import { MatDialog } from '@angular/material';
+import { ProfileSettingsComponent } from '../profile-settings/profile-settings.component';
+
+@Component({
+  selector: 'app-header',
+  templateUrl: './header.component.html',
+  styleUrls: ['./header.component.sass']
+})
+export class HeaderComponent {
+  @Input() name = 'John Doe';
+
+  constructor(private dialog: MatDialog) { }
+
+  onProfileClick(): void {
+    this.dialog.open(ProfileSettingsComponent, {
+      data: {
+      }
+    });
+  }
+}
diff --git a/webapp/src/app/profile-settings/profile-settings.component.html b/webapp/src/app/profile-settings/profile-settings.component.html
new file mode 100644
index 0000000..d14abb0
--- /dev/null
+++ b/webapp/src/app/profile-settings/profile-settings.component.html
@@ -0,0 +1,18 @@
+<h1 mat-dialog-title>Nastavení</h1>
+
+<div mat-dialog-content>
+  <mat-checkbox [(ngModel)]="data.shouldNotify">Upozorňovat na blížící se vypršění extra dovolené</mat-checkbox>
+  <div class="datetime-picker" *ngIf="data.shouldNotify">
+    <mat-form-field>
+      <input id="from-datetime-input" matInput [matDatepicker]="startDatePicker" [(ngModel)]="data.notifyDate" placeholder="Datum upozornění">
+      <mat-datepicker-toggle matSuffix [for]="startDatePicker"></mat-datepicker-toggle>
+      <mat-datepicker #startDatePicker></mat-datepicker>
+    </mat-form-field>
+    <ngb-timepicker [(ngModel)]="data.notifyTime"></ngb-timepicker>
+  </div>
+</div>
+
+<div mat-dialog-actions align="end">
+  <button mat-raised-button color="primary" (click)="onConfirmClick()">Potvrdit</button>
+  <button mat-raised-button color="basic" (click)="onCloseClick()">Zavřít</button>
+</div>
diff --git a/webapp/src/app/profile-settings/profile-settings.component.sass b/webapp/src/app/profile-settings/profile-settings.component.sass
new file mode 100644
index 0000000..eed8c0e
--- /dev/null
+++ b/webapp/src/app/profile-settings/profile-settings.component.sass
@@ -0,0 +1,2 @@
+.datetime-picker > *
+  display: table-cell
diff --git a/webapp/src/app/profile-settings/profile-settings.component.ts b/webapp/src/app/profile-settings/profile-settings.component.ts
new file mode 100644
index 0000000..30a7daf
--- /dev/null
+++ b/webapp/src/app/profile-settings/profile-settings.component.ts
@@ -0,0 +1,34 @@
+import { Component, Inject } from '@angular/core';
+import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material';
+import { FormControl } from '@angular/forms';
+
+@Component({
+  selector: 'app-profile-settings',
+  templateUrl: './profile-settings.component.html',
+  styleUrls: ['./profile-settings.component.sass']
+})
+export class ProfileSettingsComponent {
+  constructor(
+    public dialogRef: MatDialogRef<ProfileSettingsComponent>,
+    @Inject(MAT_DIALOG_DATA) public data: ProfileSettingsDialogData,
+  ) {
+    if (data.notifyTime == null) {
+      data.notifyTime = { hour: 8, minute: 0 };
+    }
+  }
+
+  onConfirmClick(): void {
+    // TODO API CALL
+    this.dialogRef.close();
+  }
+
+  onCloseClick(): void {
+    this.dialogRef.close();
+  }
+}
+
+export interface ProfileSettingsDialogData {
+  shouldNotify: boolean;
+  notifyDate: FormControl;
+  notifyTime: { hour: number, minute: number };
+}
diff --git a/webapp/src/app/profile-settings/profile-settings.module.ts b/webapp/src/app/profile-settings/profile-settings.module.ts
new file mode 100644
index 0000000..3494e22
--- /dev/null
+++ b/webapp/src/app/profile-settings/profile-settings.module.ts
@@ -0,0 +1,35 @@
+import { NgModule } from '@angular/core';
+import { CommonModule } from '@angular/common';
+import { ProfileSettingsComponent } from './profile-settings.component';
+import {
+  MatButtonModule,
+  MatCheckboxModule,
+  MatDialogModule,
+  MatDatepickerModule,
+  MatFormFieldModule, MatInputModule
+} from '@angular/material';
+import {FormsModule} from '@angular/forms';
+import {NgbModule} from '@ng-bootstrap/ng-bootstrap';
+
+
+@NgModule({
+  declarations: [ProfileSettingsComponent],
+  imports: [
+    CommonModule,
+    MatButtonModule,
+    MatDialogModule,
+    MatCheckboxModule,
+    FormsModule,
+    MatDatepickerModule,
+    MatFormFieldModule,
+    MatInputModule,
+    NgbModule
+  ],
+  entryComponents: [
+    ProfileSettingsComponent
+  ],
+  exports: [
+    ProfileSettingsComponent
+  ]
+})
+export class ProfileSettingsModule { }
