Projekt

Obecné

Profil

« Předchozí | Další » 

Revize 06b9ca68

Přidáno uživatelem Václav Jirák před téměř 6 roky(ů)

Re #7263 Static view for employer initialized

Zobrazit rozdíly:

frontend/src/app/app.component.html
1
<b>Post test: </b> {{ postTestResponse }} <br>
2
<b>Get test: </b> {{ getTestResponse }} <br>
3
<b>EN Hello world test: </b> {{ enHelloWorldResponse }} <br>
4
<b>CZ Hello world test: </b> {{ czHelloWorldResponse }} <br>
5
<b>Database test: </b> {{ databaseResponse }} <br>
6
<router-outlet></router-outlet>
1
<div class="container-fluid h-100">
2
  <div class="row header">
3
    <img class="logo" src="../assets/images/logo.png" />
4
    <div class="user-info">
5
      <img class="user-icon" src="../assets/images/default-user.png"/>
6
      <span class="user-name">Václav Jirák</span>
7
    </div>
8
  </div>
9
  <div class="row content">
10
    <div class="col-lg-2 navigation">
11
      <nav class="navbar">
12
        <ul class="navbar-nav">
13
          <li *ngFor="let item of menuItems; let i = index" class="nav-item selected">
14
            <a href="#">{{i}} {{item}}</a>
15
          </li>
16
        </ul>
17
      </nav>
18
    </div>
19
    <div class="col-lg-7">seamless</div>
20
    <div class="col-lg-3">mas</div>
21
  </div>
22
</div>
frontend/src/app/app.component.sass
1
.header
2
  height: 50px
3
  background-color: #3F425D
4
  padding-left: 10px
5

  
6

  
7
.user-info
8
  height: 100%
9
  margin-left: auto
10
  margin-right: 0
11

  
12

  
13
.user-icon
14
  width: 35px
15
  height: 35px
16
  border-radius: 20px
17

  
18

  
19
.user-name
20
  height: 50px
21
  line-height: 50px
22
  color: white
23
  margin-left: 10px
24
  margin-right: 10px
25

  
26
.content
27
  height: calc(100% - 50px)
28
  background-color: #F0FFFD
29

  
30

  
31
.navigation
32
  background-color: #2F313F
33
  margin: 0
34
  padding: 0
35

  
36

  
37
.navbar
38
  width: 100%
39
  margin: 0
40
  padding: 0
41

  
42
.navbar-nav
43
  width: 100%
44

  
45
.nav-bar
46
  width: 100%
47

  
48
.nav-item
49
  height: 50px
50
  line-height: 50px
51
  width: 100%
52
  padding-left: 20px
53
  color: #404353
54
  background-color: #2F313F
55
  border-style: solid
56
  border-width: 0 0 1px 0
57
  border-color: #6D6F81
58

  
59
  &:hover
60
    background-color: #414356
61

  
62
  a
63
    color: #6D6F81
64
    width: 100%
65
    height: 100%
66

  
67

  
68
.nav-item.selected
69
  background-color: #63AA22
70

  
71
  a
72
    color: white
73

  
74
  &:hover
75
    background-color: #7ad129
76

  
frontend/src/app/app.component.spec.ts
1
import { TestBed, async } from '@angular/core/testing';
2
import { RouterTestingModule } from '@angular/router/testing';
3
import { AppComponent } from './app.component';
4

  
5
describe('AppComponent', () => {
6
  beforeEach(async(() => {
7
    TestBed.configureTestingModule({
8
      imports: [
9
        RouterTestingModule
10
      ],
11
      declarations: [
12
        AppComponent
13
      ],
14
    }).compileComponents();
15
  }));
16

  
17
  it('should create the app', () => {
18
    const fixture = TestBed.createComponent(AppComponent);
19
    const app = fixture.debugElement.componentInstance;
20
    expect(app).toBeTruthy();
21
  });
22

  
23
  it(`should have as title 'ymanager-frontend'`, () => {
24
    const fixture = TestBed.createComponent(AppComponent);
25
    const app = fixture.debugElement.componentInstance;
26
    expect(app.title).toEqual('ymanager-frontend');
27
  });
28

  
29
  it('should render title in a h1 tag', () => {
30
    const fixture = TestBed.createComponent(AppComponent);
31
    fixture.detectChanges();
32
    const compiled = fixture.debugElement.nativeElement;
33
    expect(compiled.querySelector('h1').textContent).toContain('Welcome to ymanager-frontend!');
34
  });
35
});
frontend/src/app/app.component.ts
1 1
import { Component, OnInit } from '@angular/core';
2
import { HttpClient } from '@angular/common/http';
3
import { environment } from '../environments/environment';
4 2

  
5 3
@Component({
6 4
  selector: 'app-root',
......
8 6
  styleUrls: ['./app.component.sass']
9 7
})
10 8
export class AppComponent implements OnInit {
11
  getTestResponse;
12
  postTestResponse;
13
  enHelloWorldResponse;
14
  czHelloWorldResponse;
15
  databaseResponse;
16
  constructor(private httpClient: HttpClient) {}
17 9

  
18
  ngOnInit() {
19
    this.httpClient.get(environment.apiUrl + 'test', { responseType: 'text' })
20
      .subscribe(data => this.getTestResponse = data);
21

  
22
    this.httpClient.post(environment.apiUrl + 'test', {}, { responseType: 'text' })
23
      .subscribe(data => this.postTestResponse = data);
24

  
25
    this.httpClient.get(environment.apiUrl + 'hello', { responseType: 'text' })
26
      .subscribe(data => this.enHelloWorldResponse = data);
10
  menuItems = ['DASHBOARD', 'ZAMESTNANCI'];
11
  constructor() {}
27 12

  
28
    this.httpClient.get(environment.apiUrl + 'hello?lang=cz', { responseType: 'text' })
29
      .subscribe(data => this.czHelloWorldResponse = data);
30

  
31
    this.httpClient.get(environment.apiUrl + 'database', { responseType: 'text' })
32
      .subscribe(data => this.databaseResponse = data);
13
  ngOnInit() {
33 14
  }
34 15
}
frontend/src/index.html
2 2
<html lang="en">
3 3
<head>
4 4
  <meta charset="utf-8">
5
  <title>YmanagerFrontend</title>
5
  <title>Ymanager</title>
6 6
  <base href="/">
7 7

  
8 8
  <meta name="viewport" content="width=device-width, initial-scale=1">
9
  <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css">
10
  <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
11
  <script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.7/umd/popper.min.js"></script>
12
  <script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js"></script>
9 13
  <link rel="icon" type="image/x-icon" href="favicon.ico">
10 14
</head>
11 15
<body>
frontend/src/styles.sass
1
/* You can add global styles to this file, and also import other style files */
1
*
2
  margin: 0
3
  padding: 0
4
  font-family: "Helvetica", serif
5
  font-size: 12px
6

  
7

  
8
a
9
  &:hover
10
    text-decoration: none
11

  
12

  
13
body, html
14
  height: 100%
15

  

Také k dispozici: Unified diff