commit e63c2d6c527e553c46b773dec3b983587d61222a
Author: castic96 <zdenek.castoral.jr@gmail.com>
Date:   Wed Apr 1 00:09:49 2020 +0200

    Re #7724: Implementace architektury FE
    - počáteční inicializace home page
    - počáteční inicializace shared-components/search-component
    - úprava routing modulu

diff --git a/fe/fulltextsearch/src/app/app-routing.module.ts b/fe/fulltextsearch/src/app/app-routing.module.ts
index 06c7342..d712b44 100644
--- a/fe/fulltextsearch/src/app/app-routing.module.ts
+++ b/fe/fulltextsearch/src/app/app-routing.module.ts
@@ -1,8 +1,11 @@
 import { NgModule } from '@angular/core';
 import { Routes, RouterModule } from '@angular/router';
+import { HomeComponent } from './components/pages/home/home.component';
 
 
-const routes: Routes = [];
+const routes: Routes = [
+  { path: '', component: HomeComponent }
+];
 
 @NgModule({
   imports: [RouterModule.forRoot(routes)],
diff --git a/fe/fulltextsearch/src/app/app.component.css b/fe/fulltextsearch/src/app/app.component.css
index 3eb6333..8b13789 100644
--- a/fe/fulltextsearch/src/app/app.component.css
+++ b/fe/fulltextsearch/src/app/app.component.css
@@ -1,7 +1 @@
-.test {
-  width: 80%;
-  height: 80%;
-  margin: 10%;
-  border: 3px solid grey;
-  padding: 10px;
-}
+
diff --git a/fe/fulltextsearch/src/app/app.component.html b/fe/fulltextsearch/src/app/app.component.html
index 45af78d..ef92397 100644
--- a/fe/fulltextsearch/src/app/app.component.html
+++ b/fe/fulltextsearch/src/app/app.component.html
@@ -1,20 +1,4 @@
-<div class="test">
-  <h1 style="text-align: center">Hello in {{title}} frontend</h1>
-  <form #queryForm="ngForm" (ngSubmit)="sendQuery(queryForm.value)">
-    <span><b>Object query:</b> </span>{{ queryForm.value | json }}
-    <div class="input-group mb-3">
-      <input type="text" class="form-control" placeholder="Query" aria-describedby="basic-addon2" ngModel name="query">
-      <div class="input-group-append">
-        <button class="btn btn-outline-secondary" type="submit">Search</button>
-      </div>
-    </div>
-
-    <div class="form-group">
-      <label for="exampleFormControlTextarea1">Response:</label>
-      <textarea readonly class="form-control" id="exampleFormControlTextarea1" rows="10">{{response.response}}</textarea>
-    </div>
-  </form>
+<div>
+  <app-header></app-header>
+  <router-outlet></router-outlet>
 </div>
-
-<!-- Routing -->
-<router-outlet></router-outlet>
diff --git a/fe/fulltextsearch/src/app/app.component.ts b/fe/fulltextsearch/src/app/app.component.ts
index 8e61356..68478a8 100644
--- a/fe/fulltextsearch/src/app/app.component.ts
+++ b/fe/fulltextsearch/src/app/app.component.ts
@@ -1,7 +1,4 @@
 import { Component } from '@angular/core';
-import { Query } from './model/Query';
-import { QueryService} from './services/query.service';
-import { QueryResponse } from './model/QueryResponse';
 
 @Component({
   selector: 'app-root',
@@ -9,16 +6,4 @@ import { QueryResponse } from './model/QueryResponse';
   styleUrls: ['./app.component.css']
 })
 export class AppComponent {
-  title = 'Fulltext search';
-  response: QueryResponse = new QueryResponse();
-
-  constructor(private queryService: QueryService) { }
-
-  sendQuery(temp: Query) {
-    console.log(temp);
-    temp.date = new Date();
-    this.queryService.sendQuery(temp).subscribe( response => {
-        this.response = response;
-    });
-  }
 }
diff --git a/fe/fulltextsearch/src/app/app.module.ts b/fe/fulltextsearch/src/app/app.module.ts
index 7a4326e..b6eabd5 100644
--- a/fe/fulltextsearch/src/app/app.module.ts
+++ b/fe/fulltextsearch/src/app/app.module.ts
@@ -5,10 +5,16 @@ import { HttpClientModule } from '@angular/common/http';
 import { AppRoutingModule } from './app-routing.module';
 import { AppComponent } from './app.component';
 import { FormsModule } from '@angular/forms';
+import { SearchComponentComponent } from './components/shared-components/search-component/search-component.component';
+import { HomeComponent } from './components/pages/home/home.component';
+import { HeaderComponent } from './components/layout/header/header.component';
 
 @NgModule({
   declarations: [
-    AppComponent
+    AppComponent,
+    SearchComponentComponent,
+    HomeComponent,
+    HeaderComponent
   ],
   imports: [
     BrowserModule,
diff --git a/fe/fulltextsearch/src/app/components/layout/header/header.component.css b/fe/fulltextsearch/src/app/components/layout/header/header.component.css
new file mode 100644
index 0000000..e69de29
diff --git a/fe/fulltextsearch/src/app/components/layout/header/header.component.html b/fe/fulltextsearch/src/app/components/layout/header/header.component.html
new file mode 100644
index 0000000..4f5a95d
--- /dev/null
+++ b/fe/fulltextsearch/src/app/components/layout/header/header.component.html
@@ -0,0 +1 @@
+<p>header works!</p>
diff --git a/fe/fulltextsearch/src/app/components/layout/header/header.component.spec.ts b/fe/fulltextsearch/src/app/components/layout/header/header.component.spec.ts
new file mode 100644
index 0000000..2d0479d
--- /dev/null
+++ b/fe/fulltextsearch/src/app/components/layout/header/header.component.spec.ts
@@ -0,0 +1,25 @@
+import { async, ComponentFixture, TestBed } from '@angular/core/testing';
+
+import { HeaderComponent } from './header.component';
+
+describe('HeaderComponent', () => {
+  let component: HeaderComponent;
+  let fixture: ComponentFixture<HeaderComponent>;
+
+  beforeEach(async(() => {
+    TestBed.configureTestingModule({
+      declarations: [ HeaderComponent ]
+    })
+    .compileComponents();
+  }));
+
+  beforeEach(() => {
+    fixture = TestBed.createComponent(HeaderComponent);
+    component = fixture.componentInstance;
+    fixture.detectChanges();
+  });
+
+  it('should create', () => {
+    expect(component).toBeTruthy();
+  });
+});
diff --git a/fe/fulltextsearch/src/app/components/layout/header/header.component.ts b/fe/fulltextsearch/src/app/components/layout/header/header.component.ts
new file mode 100644
index 0000000..3ee4d0f
--- /dev/null
+++ b/fe/fulltextsearch/src/app/components/layout/header/header.component.ts
@@ -0,0 +1,15 @@
+import { Component, OnInit } from '@angular/core';
+
+@Component({
+  selector: 'app-header',
+  templateUrl: './header.component.html',
+  styleUrls: ['./header.component.css']
+})
+export class HeaderComponent implements OnInit {
+
+  constructor() { }
+
+  ngOnInit() {
+  }
+
+}
diff --git a/fe/fulltextsearch/src/app/components/pages/home/home.component.css b/fe/fulltextsearch/src/app/components/pages/home/home.component.css
new file mode 100644
index 0000000..3eb6333
--- /dev/null
+++ b/fe/fulltextsearch/src/app/components/pages/home/home.component.css
@@ -0,0 +1,7 @@
+.test {
+  width: 80%;
+  height: 80%;
+  margin: 10%;
+  border: 3px solid grey;
+  padding: 10px;
+}
diff --git a/fe/fulltextsearch/src/app/components/pages/home/home.component.html b/fe/fulltextsearch/src/app/components/pages/home/home.component.html
new file mode 100644
index 0000000..45af78d
--- /dev/null
+++ b/fe/fulltextsearch/src/app/components/pages/home/home.component.html
@@ -0,0 +1,20 @@
+<div class="test">
+  <h1 style="text-align: center">Hello in {{title}} frontend</h1>
+  <form #queryForm="ngForm" (ngSubmit)="sendQuery(queryForm.value)">
+    <span><b>Object query:</b> </span>{{ queryForm.value | json }}
+    <div class="input-group mb-3">
+      <input type="text" class="form-control" placeholder="Query" aria-describedby="basic-addon2" ngModel name="query">
+      <div class="input-group-append">
+        <button class="btn btn-outline-secondary" type="submit">Search</button>
+      </div>
+    </div>
+
+    <div class="form-group">
+      <label for="exampleFormControlTextarea1">Response:</label>
+      <textarea readonly class="form-control" id="exampleFormControlTextarea1" rows="10">{{response.response}}</textarea>
+    </div>
+  </form>
+</div>
+
+<!-- Routing -->
+<router-outlet></router-outlet>
diff --git a/fe/fulltextsearch/src/app/components/pages/home/home.component.spec.ts b/fe/fulltextsearch/src/app/components/pages/home/home.component.spec.ts
new file mode 100644
index 0000000..490e81b
--- /dev/null
+++ b/fe/fulltextsearch/src/app/components/pages/home/home.component.spec.ts
@@ -0,0 +1,25 @@
+import { async, ComponentFixture, TestBed } from '@angular/core/testing';
+
+import { HomeComponent } from './home.component';
+
+describe('HomeComponent', () => {
+  let component: HomeComponent;
+  let fixture: ComponentFixture<HomeComponent>;
+
+  beforeEach(async(() => {
+    TestBed.configureTestingModule({
+      declarations: [ HomeComponent ]
+    })
+    .compileComponents();
+  }));
+
+  beforeEach(() => {
+    fixture = TestBed.createComponent(HomeComponent);
+    component = fixture.componentInstance;
+    fixture.detectChanges();
+  });
+
+  it('should create', () => {
+    expect(component).toBeTruthy();
+  });
+});
diff --git a/fe/fulltextsearch/src/app/components/pages/home/home.component.ts b/fe/fulltextsearch/src/app/components/pages/home/home.component.ts
new file mode 100644
index 0000000..bef2e24
--- /dev/null
+++ b/fe/fulltextsearch/src/app/components/pages/home/home.component.ts
@@ -0,0 +1,30 @@
+import { Component, OnInit } from '@angular/core';
+import { QueryResponse } from "../../../model/QueryResponse";
+import { QueryService } from "../../../services/query.service";
+import { Query } from "../../../model/Query";
+
+
+@Component({
+  selector: 'app-home',
+  templateUrl: './home.component.html',
+  styleUrls: ['./home.component.css']
+})
+export class HomeComponent implements OnInit {
+  title = 'Fulltext search';
+  response: QueryResponse = new QueryResponse();
+
+  constructor(private queryService: QueryService) { }
+
+  sendQuery(temp: Query) {
+    console.log(temp);
+    temp.date = new Date();
+    this.queryService.sendQuery(temp).subscribe( response => {
+      this.response = response;
+    });
+  }
+
+  ngOnInit() {
+
+  }
+
+}
diff --git a/fe/fulltextsearch/src/app/components/shared-components/search-component/search-component.component.css b/fe/fulltextsearch/src/app/components/shared-components/search-component/search-component.component.css
new file mode 100644
index 0000000..e69de29
diff --git a/fe/fulltextsearch/src/app/components/shared-components/search-component/search-component.component.html b/fe/fulltextsearch/src/app/components/shared-components/search-component/search-component.component.html
new file mode 100644
index 0000000..d46cba1
--- /dev/null
+++ b/fe/fulltextsearch/src/app/components/shared-components/search-component/search-component.component.html
@@ -0,0 +1 @@
+<p>search-component works!</p>
diff --git a/fe/fulltextsearch/src/app/components/shared-components/search-component/search-component.component.spec.ts b/fe/fulltextsearch/src/app/components/shared-components/search-component/search-component.component.spec.ts
new file mode 100644
index 0000000..55b1db9
--- /dev/null
+++ b/fe/fulltextsearch/src/app/components/shared-components/search-component/search-component.component.spec.ts
@@ -0,0 +1,25 @@
+import { async, ComponentFixture, TestBed } from '@angular/core/testing';
+
+import { SearchComponentComponent } from './search-component.component';
+
+describe('SearchComponentComponent', () => {
+  let component: SearchComponentComponent;
+  let fixture: ComponentFixture<SearchComponentComponent>;
+
+  beforeEach(async(() => {
+    TestBed.configureTestingModule({
+      declarations: [ SearchComponentComponent ]
+    })
+    .compileComponents();
+  }));
+
+  beforeEach(() => {
+    fixture = TestBed.createComponent(SearchComponentComponent);
+    component = fixture.componentInstance;
+    fixture.detectChanges();
+  });
+
+  it('should create', () => {
+    expect(component).toBeTruthy();
+  });
+});
diff --git a/fe/fulltextsearch/src/app/components/shared-components/search-component/search-component.component.ts b/fe/fulltextsearch/src/app/components/shared-components/search-component/search-component.component.ts
new file mode 100644
index 0000000..4528f1e
--- /dev/null
+++ b/fe/fulltextsearch/src/app/components/shared-components/search-component/search-component.component.ts
@@ -0,0 +1,15 @@
+import { Component, OnInit } from '@angular/core';
+
+@Component({
+  selector: 'app-search-component',
+  templateUrl: './search-component.component.html',
+  styleUrls: ['./search-component.component.css']
+})
+export class SearchComponentComponent implements OnInit {
+
+  constructor() { }
+
+  ngOnInit() {
+  }
+
+}
