This commit is contained in:
parent
1dca4a1f4f
commit
06222206b4
12 changed files with 244 additions and 4 deletions
4
src/app/Interfaces/qualifications.ts
Normal file
4
src/app/Interfaces/qualifications.ts
Normal file
|
@ -0,0 +1,4 @@
|
||||||
|
export interface Qualifications {
|
||||||
|
id: number;
|
||||||
|
title: string;
|
||||||
|
}
|
|
@ -1,3 +1,24 @@
|
||||||
<app-header></app-header>
|
<!--@if ($employees | async; as employees) {
|
||||||
|
<mat-tree #tree [dataSource]="employees" [childrenAccessor]="childrenAccessor">
|
||||||
|
<mat-tree-node *matTreeNodeDef="let node" matTreeNodePadding>
|
||||||
|
{{ node.firstName }}
|
||||||
|
@if (tree.isExpanded(node)) {
|
||||||
|
<button mat-icon-button matTreeNodeToggle [attr.aria-label]="'Toggle ' + node.id">
|
||||||
|
<mat-icon>expand_more</mat-icon>
|
||||||
|
</button>
|
||||||
|
<ul>
|
||||||
|
@for (entry of node | keyvalue; track entry) {
|
||||||
|
<li>{{ entry.key }}: <code>{{ entry.value }}</code></li>
|
||||||
|
}
|
||||||
|
</ul>
|
||||||
|
} @else {
|
||||||
|
<button mat-icon-button matTreeNodeToggle [attr.aria-label]="'Toggle ' + node.id">
|
||||||
|
<mat-icon>chevron_right</mat-icon>
|
||||||
|
</button>
|
||||||
|
}
|
||||||
|
</mat-tree-node>
|
||||||
|
</mat-tree>
|
||||||
|
}
|
||||||
|
-->
|
||||||
|
|
||||||
<router-outlet/>
|
<router-outlet/>
|
||||||
|
|
|
@ -1,11 +1,16 @@
|
||||||
import {Component} from '@angular/core';
|
import {Component} from '@angular/core';
|
||||||
import { RouterOutlet } from '@angular/router';
|
import { RouterOutlet } from '@angular/router';
|
||||||
import {HeaderComponent} from '@app/header/header.component';
|
import {HeaderComponent} from '@app/header/header.component';
|
||||||
|
import {MatIcon} from "@angular/material/icon";
|
||||||
|
import {MatTree, MatTreeNode, MatTreeNodeDef, MatTreeNodePadding, MatTreeNodeToggle} from "@angular/material/tree";
|
||||||
|
import {AsyncPipe, KeyValuePipe} from "@angular/common";
|
||||||
|
import {MatIconButton} from "@angular/material/button";
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-root',
|
selector: 'app-root',
|
||||||
imports: [RouterOutlet, HeaderComponent],
|
imports: [RouterOutlet, HeaderComponent, MatIcon, MatTree, AsyncPipe, MatTreeNodeDef, MatTreeNode, MatTreeNodePadding, KeyValuePipe, MatIconButton, MatTreeNodeToggle],
|
||||||
templateUrl: './app.component.html',
|
templateUrl: './app.component.html',
|
||||||
|
standalone: true,
|
||||||
styleUrl: './app.component.scss'
|
styleUrl: './app.component.scss'
|
||||||
})
|
})
|
||||||
export class AppComponent{
|
export class AppComponent{
|
||||||
|
|
|
@ -5,7 +5,7 @@ import { provideRouter } from '@angular/router';
|
||||||
import { routes } from '@app/app.routes';
|
import { routes } from '@app/app.routes';
|
||||||
import { OpenAPI } from '@core/ems/core/OpenAPI';
|
import { OpenAPI } from '@core/ems/core/OpenAPI';
|
||||||
OpenAPI.BASE = 'http://localhost:8080';
|
OpenAPI.BASE = 'http://localhost:8080';
|
||||||
OpenAPI.TOKEN = 'eyJhbGciOiJSUzI1NiIsInR5cCIgOiAiSldUIiwia2lkIiA6ICIzUFQ0dldiNno5MnlQWk1EWnBqT1U0RjFVN0lwNi1ELUlqQWVGczJPbGU0In0.eyJleHAiOjE3MzQ1MjA4MzgsImlhdCI6MTczNDUxNzIzOCwianRpIjoiODVkM2NlNDQtM2QwMS00MDFkLTlhY2YtZjFhZTMwNzQzMDRmIiwiaXNzIjoiaHR0cHM6Ly9rZXljbG9hay5zenV0LmRldi9hdXRoL3JlYWxtcy9zenV0IiwiYXVkIjoiYWNjb3VudCIsInN1YiI6IjU1NDZjZDIxLTk4NTQtNDMyZi1hNDY3LTRkZTNlZWRmNTg4OSIsInR5cCI6IkJlYXJlciIsImF6cCI6ImVtcGxveWVlLW1hbmFnZW1lbnQtc2VydmljZSIsInNlc3Npb25fc3RhdGUiOiJiOWI3OGQ0ZS1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|
||||||
export const appConfig: ApplicationConfig = {
|
export const appConfig: ApplicationConfig = {
|
||||||
providers: [
|
providers: [
|
||||||
|
|
|
@ -1,4 +1,8 @@
|
||||||
import {Routes} from '@angular/router';
|
import {Routes} from '@angular/router';
|
||||||
import {DashboardComponent} from '@app/views/dashboard/dashboard.component';
|
import {DashboardComponent} from '@app/views/dashboard/dashboard.component';
|
||||||
|
import {QualificationsComponent} from "@app/qualifications/qualifications.component";
|
||||||
|
|
||||||
export const routes: Routes = [{path: '', component: DashboardComponent, title: 'Home'}];
|
export const routes: Routes = [
|
||||||
|
{path: 'qualifications', component: QualificationsComponent, title: "qualifications"},
|
||||||
|
{path: '', component: DashboardComponent, title: 'Home'}
|
||||||
|
];
|
||||||
|
|
|
@ -14,6 +14,7 @@ import {Router, RouterLink} from '@angular/router';
|
||||||
MatButton,
|
MatButton,
|
||||||
],
|
],
|
||||||
templateUrl: './header.component.html',
|
templateUrl: './header.component.html',
|
||||||
|
standalone: true,
|
||||||
styleUrl: './header.component.scss'
|
styleUrl: './header.component.scss'
|
||||||
})
|
})
|
||||||
export class HeaderComponent implements OnInit {
|
export class HeaderComponent implements OnInit {
|
||||||
|
|
74
src/app/qualifications/qualifications.component.html
Normal file
74
src/app/qualifications/qualifications.component.html
Normal file
|
@ -0,0 +1,74 @@
|
||||||
|
<div class="headbar">
|
||||||
|
<h1>
|
||||||
|
Qualification-List
|
||||||
|
</h1>
|
||||||
|
<form>
|
||||||
|
<div class="search-container">
|
||||||
|
<i class="material-icons searchIcon">search</i>
|
||||||
|
<input type="text" placeholder="Search..." class="search-input" />
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<table class="table table-striped table-hover">
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th>Id</th>
|
||||||
|
<th>Bezeichnung</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
@for(qualification of qualificationModel; track qualificationModel){
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
<input type="checkbox">
|
||||||
|
</td>
|
||||||
|
<td>{{qualification.id}}</td>
|
||||||
|
<td>{{qualification.title}}</td>
|
||||||
|
<td>
|
||||||
|
<button class="material-icons" (click)="delete(qualification)">
|
||||||
|
delete
|
||||||
|
</button>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
}
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
|
||||||
|
|
||||||
|
<div>
|
||||||
|
<h3>Qualification hinzufügen</h3>
|
||||||
|
|
||||||
|
<form name="newTodoForm" #newTodoForm="ngForm">
|
||||||
|
|
||||||
|
<div class="mb-2">
|
||||||
|
<label for="newTodoTitle"></label>
|
||||||
|
Todo Name:
|
||||||
|
<input class="formControl"
|
||||||
|
id="newTodoTitle"
|
||||||
|
name="newTodoTitle"
|
||||||
|
type="text"
|
||||||
|
required
|
||||||
|
>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="mb-2">
|
||||||
|
<label for="newTodoCategory"></label>
|
||||||
|
Kategorie:
|
||||||
|
<input class="formControl"
|
||||||
|
id="newTodoCategory"
|
||||||
|
name="newTodoCategory"
|
||||||
|
type="text"
|
||||||
|
required
|
||||||
|
>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<button type="submit"
|
||||||
|
class="btn btn-primary"
|
||||||
|
(click)="save(); newTodoForm.resetForm()"
|
||||||
|
[disabled]="!newTodoForm.valid">absenden</button>
|
||||||
|
</form>
|
||||||
|
</div>
|
25
src/app/qualifications/qualifications.component.scss
Normal file
25
src/app/qualifications/qualifications.component.scss
Normal file
|
@ -0,0 +1,25 @@
|
||||||
|
.search-container{
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
border: 1.5px solid black;
|
||||||
|
background: lightgray;
|
||||||
|
margin-top: 0.5rem;
|
||||||
|
|
||||||
|
}
|
||||||
|
.headbar{
|
||||||
|
display: flex;
|
||||||
|
justify-content: space-between;
|
||||||
|
margin-left: 7rem;
|
||||||
|
margin-right: 3rem;
|
||||||
|
margin-top: 1rem;
|
||||||
|
}
|
||||||
|
.search-input{
|
||||||
|
border: none;
|
||||||
|
padding: 6px;
|
||||||
|
font-size: 17px;
|
||||||
|
}
|
||||||
|
.searchIcon{
|
||||||
|
margin-right: 0.5rem;
|
||||||
|
margin-left: 0.5rem;
|
||||||
|
}
|
23
src/app/qualifications/qualifications.component.spec.ts
Normal file
23
src/app/qualifications/qualifications.component.spec.ts
Normal file
|
@ -0,0 +1,23 @@
|
||||||
|
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||||
|
|
||||||
|
import { QualificationsComponent } from './qualifications.component';
|
||||||
|
|
||||||
|
describe('QualificationsComponent', () => {
|
||||||
|
let component: QualificationsComponent;
|
||||||
|
let fixture: ComponentFixture<QualificationsComponent>;
|
||||||
|
|
||||||
|
beforeEach(async () => {
|
||||||
|
await TestBed.configureTestingModule({
|
||||||
|
imports: [QualificationsComponent]
|
||||||
|
})
|
||||||
|
.compileComponents();
|
||||||
|
|
||||||
|
fixture = TestBed.createComponent(QualificationsComponent);
|
||||||
|
component = fixture.componentInstance;
|
||||||
|
fixture.detectChanges();
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should create', () => {
|
||||||
|
expect(component).toBeTruthy();
|
||||||
|
});
|
||||||
|
});
|
34
src/app/qualifications/qualifications.component.ts
Normal file
34
src/app/qualifications/qualifications.component.ts
Normal file
|
@ -0,0 +1,34 @@
|
||||||
|
import {Component, Input} from '@angular/core';
|
||||||
|
import {FormsModule} from "@angular/forms";
|
||||||
|
import {Qualifications} from "@app/Interfaces/qualifications";
|
||||||
|
import {QualificationService} from "@app/services/qualification.service";
|
||||||
|
|
||||||
|
@Component({
|
||||||
|
selector: 'app-qualifications',
|
||||||
|
imports: [
|
||||||
|
FormsModule
|
||||||
|
],
|
||||||
|
templateUrl: './qualifications.component.html',
|
||||||
|
standalone: true,
|
||||||
|
styleUrl: './qualifications.component.scss'
|
||||||
|
})
|
||||||
|
export class QualificationsComponent {
|
||||||
|
qualificationModel: Qualifications[] | undefined;
|
||||||
|
options: Intl.DateTimeFormatOptions = {
|
||||||
|
year: 'numeric',
|
||||||
|
month: 'long',
|
||||||
|
day: 'numeric'
|
||||||
|
}
|
||||||
|
|
||||||
|
constructor(private qualificationService: QualificationService) {
|
||||||
|
this.qualificationModel=this.qualificationService.qualifications
|
||||||
|
}
|
||||||
|
save() {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
delete(qualification: Qualifications) {
|
||||||
|
this.qualificationService.deleteQualification(qualification)
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
16
src/app/services/qualification.service.spec.ts
Normal file
16
src/app/services/qualification.service.spec.ts
Normal file
|
@ -0,0 +1,16 @@
|
||||||
|
import { TestBed } from '@angular/core/testing';
|
||||||
|
|
||||||
|
import { QualificationService } from './qualification.service';
|
||||||
|
|
||||||
|
describe('QualificationService', () => {
|
||||||
|
let service: QualificationService;
|
||||||
|
|
||||||
|
beforeEach(() => {
|
||||||
|
TestBed.configureTestingModule({});
|
||||||
|
service = TestBed.inject(QualificationService);
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should be created', () => {
|
||||||
|
expect(service).toBeTruthy();
|
||||||
|
});
|
||||||
|
});
|
33
src/app/services/qualification.service.ts
Normal file
33
src/app/services/qualification.service.ts
Normal file
|
@ -0,0 +1,33 @@
|
||||||
|
import { Injectable } from '@angular/core';
|
||||||
|
import {Qualifications} from "@app/Interfaces/qualifications";
|
||||||
|
|
||||||
|
@Injectable({
|
||||||
|
providedIn: 'root'
|
||||||
|
})
|
||||||
|
export class QualificationService {
|
||||||
|
qualifications = [
|
||||||
|
{
|
||||||
|
id: 15,
|
||||||
|
title: 'Java'},
|
||||||
|
{
|
||||||
|
id: 16,
|
||||||
|
title: 'Angular'},
|
||||||
|
{
|
||||||
|
id: 17,
|
||||||
|
title: 'CSS'},
|
||||||
|
{
|
||||||
|
id: 18,
|
||||||
|
title: 'Windows'},
|
||||||
|
{
|
||||||
|
id: 19,
|
||||||
|
title: 'Linux'},
|
||||||
|
{
|
||||||
|
id: 20,
|
||||||
|
title: 'Yes'},
|
||||||
|
]
|
||||||
|
|
||||||
|
constructor() { }
|
||||||
|
deleteQualification(qualifications: Qualifications){
|
||||||
|
this.qualifications = this.qualifications.filter(t => t!== qualifications)
|
||||||
|
}
|
||||||
|
}
|
Loading…
Add table
Reference in a new issue