Compare commits
4 Commits
2d444b0300
...
08ca500570
| Author | SHA1 | Date | |
|---|---|---|---|
| 08ca500570 | |||
| cd0f18705c | |||
| 838faae96b | |||
| 1dda26b35f |
4
.github/workflows/deploy-docker-to-tst.yml
vendored
4
.github/workflows/deploy-docker-to-tst.yml
vendored
@@ -26,7 +26,7 @@ jobs:
|
|||||||
path: version.txt
|
path: version.txt
|
||||||
- name: Notify Mattermost via Bot
|
- name: Notify Mattermost via Bot
|
||||||
env:
|
env:
|
||||||
VERSION: ${{ VERSION }}
|
VERSION: ${{ env.VERSION }}
|
||||||
REPO: ${{ gitea.repository }}
|
REPO: ${{ gitea.repository }}
|
||||||
BRANCH: ${{ gitea.ref }}
|
BRANCH: ${{ gitea.ref }}
|
||||||
MATTERMOST_BOT_TOKEN: ${{ secrets.MATTERMOST_BOT_TOKEN }}
|
MATTERMOST_BOT_TOKEN: ${{ secrets.MATTERMOST_BOT_TOKEN }}
|
||||||
@@ -101,7 +101,7 @@ jobs:
|
|||||||
|
|
||||||
- name: Notify Mattermost via Bot
|
- name: Notify Mattermost via Bot
|
||||||
env:
|
env:
|
||||||
VERSION: ${{ VERSION }}
|
VERSION: ${{ env.VERSION }}
|
||||||
run: |
|
run: |
|
||||||
curl --fail -X POST -H "Authorization: Bearer tspcwdn5rbdk8kkmnex6h1nfha" \
|
curl --fail -X POST -H "Authorization: Bearer tspcwdn5rbdk8kkmnex6h1nfha" \
|
||||||
-H 'Content-Type: application/json' \
|
-H 'Content-Type: application/json' \
|
||||||
|
|||||||
@@ -99,56 +99,5 @@
|
|||||||
</button>
|
</button>
|
||||||
|
|
||||||
<app-modal title="Nieuwe klant" *ngIf="showNewCustomer" (close)="toggleCustomerModal()">
|
<app-modal title="Nieuwe klant" *ngIf="showNewCustomer" (close)="toggleCustomerModal()">
|
||||||
<form [formGroup]="customerForm">
|
<app-new-customer (customerAdded)="saveCustomer()"></app-new-customer>
|
||||||
<tui-input
|
|
||||||
formControlName="firstName"
|
|
||||||
tuiTextfieldSize="m"
|
|
||||||
id="voornaam-nieuwe-klant"
|
|
||||||
[tuiTextfieldCleaner]="true">
|
|
||||||
Voornaam
|
|
||||||
<input
|
|
||||||
tuiTextfieldLegacy
|
|
||||||
type="text"
|
|
||||||
formControlName="firstName"/>
|
|
||||||
</tui-input>
|
|
||||||
<br>
|
|
||||||
<tui-input
|
|
||||||
formControlName="lastName"
|
|
||||||
tuiTextfieldSize="m"
|
|
||||||
id="achternaam-nieuwe-klant"
|
|
||||||
[tuiTextfieldCleaner]="true">
|
|
||||||
Achternaam
|
|
||||||
<input
|
|
||||||
tuiTextfieldLegacy
|
|
||||||
type="text"
|
|
||||||
formControlName="lastName"/>
|
|
||||||
</tui-input>
|
|
||||||
<br>
|
|
||||||
<tui-input
|
|
||||||
formControlName="email"
|
|
||||||
tuiTextfieldSize="m"
|
|
||||||
id="email-nieuwe-klant"
|
|
||||||
[tuiTextfieldCleaner]="true">
|
|
||||||
Email
|
|
||||||
<input
|
|
||||||
tuiTextfieldLegacy
|
|
||||||
autocomplete="email"
|
|
||||||
type="email"
|
|
||||||
formControlName="email"/>
|
|
||||||
</tui-input>
|
|
||||||
<br>
|
|
||||||
<button
|
|
||||||
appearance="secondary"
|
|
||||||
size="m"
|
|
||||||
tuiButton
|
|
||||||
id="klant-toevoegen"
|
|
||||||
[loading]=waiting
|
|
||||||
(click)="saveCustomer()"
|
|
||||||
type="button">
|
|
||||||
<tui-icon
|
|
||||||
icon="@tui.plus"
|
|
||||||
[style.height.rem]="1"/>
|
|
||||||
Klant toevoegen
|
|
||||||
</button>
|
|
||||||
</form>
|
|
||||||
</app-modal>
|
</app-modal>
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import {Component, EventEmitter, inject, Input, OnInit, Output} from '@angular/core';
|
import {Component, EventEmitter, inject, Input, OnInit, Output} from '@angular/core';
|
||||||
import {NgForOf, NgIf} from "@angular/common";
|
import {NgForOf, NgIf} from "@angular/common";
|
||||||
import {FormControl, FormGroup, ReactiveFormsModule, Validators} from "@angular/forms";
|
import {FormControl, FormGroup, ReactiveFormsModule, Validators} from "@angular/forms";
|
||||||
import {TuiAlertService, TuiButton, TuiGroup, TuiIcon} from "@taiga-ui/core";
|
import {TuiAlertService, TuiButton, TuiGroup} from "@taiga-ui/core";
|
||||||
import {
|
import {
|
||||||
TuiComboBoxModule,
|
TuiComboBoxModule,
|
||||||
TuiInputDateModule,
|
TuiInputDateModule,
|
||||||
@@ -13,15 +13,11 @@ import {
|
|||||||
import {Appointment} from '../../models/appointment';
|
import {Appointment} from '../../models/appointment';
|
||||||
import {TuiDay, TuiTime} from '@taiga-ui/cdk';
|
import {TuiDay, TuiTime} from '@taiga-ui/cdk';
|
||||||
import {AppointmentService} from '../../services/appointment.service';
|
import {AppointmentService} from '../../services/appointment.service';
|
||||||
import {
|
import {TuiDataListWrapperComponent, TuiFilterByInputPipe, TuiStringifyContentPipe} from '@taiga-ui/kit';
|
||||||
TuiButtonLoading,
|
|
||||||
TuiDataListWrapperComponent,
|
|
||||||
TuiFilterByInputPipe,
|
|
||||||
TuiStringifyContentPipe
|
|
||||||
} from '@taiga-ui/kit';
|
|
||||||
import {Customer} from '../../models/customer';
|
import {Customer} from '../../models/customer';
|
||||||
import {CustomerService} from '../../services/customer.service';
|
import {CustomerService} from '../../services/customer.service';
|
||||||
import {ModalComponent} from '../modal/modal.component';
|
import {ModalComponent} from '../modal/modal.component';
|
||||||
|
import {NewCustomerComponent} from '../new-customer/new-customer.component';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-edit-item',
|
selector: 'app-edit-item',
|
||||||
@@ -41,8 +37,7 @@ import {ModalComponent} from '../modal/modal.component';
|
|||||||
TuiStringifyContentPipe,
|
TuiStringifyContentPipe,
|
||||||
TuiFilterByInputPipe,
|
TuiFilterByInputPipe,
|
||||||
ModalComponent,
|
ModalComponent,
|
||||||
TuiIcon,
|
NewCustomerComponent
|
||||||
TuiButtonLoading
|
|
||||||
],
|
],
|
||||||
templateUrl: './edit-item.component.html',
|
templateUrl: './edit-item.component.html',
|
||||||
styleUrl: './edit-item.component.scss'
|
styleUrl: './edit-item.component.scss'
|
||||||
@@ -132,15 +127,8 @@ export class EditItemComponent implements OnInit {
|
|||||||
`${item.firstName} ${item.lastName}`;
|
`${item.firstName} ${item.lastName}`;
|
||||||
|
|
||||||
saveCustomer() {
|
saveCustomer() {
|
||||||
const firstName = this.customerForm.get('firstName').value
|
|
||||||
const lastName = this.customerForm.get('lastName').value
|
|
||||||
const email = this.customerForm.get('email').value
|
|
||||||
const customer = new Customer(firstName, lastName, email);
|
|
||||||
|
|
||||||
this.customerService.addCustomer(customer).subscribe(() => {
|
|
||||||
this.showNewCustomer = false;
|
this.showNewCustomer = false;
|
||||||
this.getCustomers()
|
this.getCustomers()
|
||||||
})
|
|
||||||
}
|
}
|
||||||
|
|
||||||
getCustomers() {
|
getCustomers() {
|
||||||
|
|||||||
53
src/app/components/new-customer/new-customer.component.html
Normal file
53
src/app/components/new-customer/new-customer.component.html
Normal file
@@ -0,0 +1,53 @@
|
|||||||
|
<form [formGroup]="customerForm">
|
||||||
|
<tui-input
|
||||||
|
formControlName="firstName"
|
||||||
|
tuiTextfieldSize="m"
|
||||||
|
id="voornaam-nieuwe-klant"
|
||||||
|
[tuiTextfieldCleaner]="true">
|
||||||
|
Voornaam
|
||||||
|
<input
|
||||||
|
tuiTextfieldLegacy
|
||||||
|
type="text"
|
||||||
|
formControlName="firstName"/>
|
||||||
|
</tui-input>
|
||||||
|
<br>
|
||||||
|
<tui-input
|
||||||
|
formControlName="lastName"
|
||||||
|
tuiTextfieldSize="m"
|
||||||
|
id="achternaam-nieuwe-klant"
|
||||||
|
[tuiTextfieldCleaner]="true">
|
||||||
|
Achternaam
|
||||||
|
<input
|
||||||
|
tuiTextfieldLegacy
|
||||||
|
type="text"
|
||||||
|
formControlName="lastName"/>
|
||||||
|
</tui-input>
|
||||||
|
<br>
|
||||||
|
<tui-input
|
||||||
|
formControlName="email"
|
||||||
|
tuiTextfieldSize="m"
|
||||||
|
id="email-nieuwe-klant"
|
||||||
|
[tuiTextfieldCleaner]="true">
|
||||||
|
Email
|
||||||
|
<input
|
||||||
|
tuiTextfieldLegacy
|
||||||
|
autocomplete="email"
|
||||||
|
type="email"
|
||||||
|
formControlName="email"/>
|
||||||
|
</tui-input>
|
||||||
|
<br>
|
||||||
|
<button
|
||||||
|
appearance="secondary"
|
||||||
|
size="m"
|
||||||
|
tuiButton
|
||||||
|
id="klant-toevoegen"
|
||||||
|
[disabled]="customerForm.invalid"
|
||||||
|
[loading]=waiting
|
||||||
|
(click)="saveCustomer()"
|
||||||
|
type="button">
|
||||||
|
<tui-icon
|
||||||
|
icon="@tui.plus"
|
||||||
|
[style.height.rem]="1"/>
|
||||||
|
Klant toevoegen
|
||||||
|
</button>
|
||||||
|
</form>
|
||||||
48
src/app/components/new-customer/new-customer.component.ts
Normal file
48
src/app/components/new-customer/new-customer.component.ts
Normal file
@@ -0,0 +1,48 @@
|
|||||||
|
import {Component, EventEmitter, Output} from '@angular/core';
|
||||||
|
import {FormControl, FormGroup, ReactiveFormsModule, Validators} from '@angular/forms';
|
||||||
|
import {TuiInputModule} from '@taiga-ui/legacy';
|
||||||
|
import {TuiButton, TuiIcon, TuiTextfieldOptionsDirective} from '@taiga-ui/core';
|
||||||
|
import {TuiButtonLoading} from '@taiga-ui/kit';
|
||||||
|
import {Customer} from '../../models/customer';
|
||||||
|
import {CustomerService} from '../../services/customer.service';
|
||||||
|
|
||||||
|
@Component({
|
||||||
|
selector: 'app-new-customer',
|
||||||
|
imports: [
|
||||||
|
ReactiveFormsModule,
|
||||||
|
TuiInputModule,
|
||||||
|
TuiTextfieldOptionsDirective,
|
||||||
|
TuiButton,
|
||||||
|
TuiIcon,
|
||||||
|
TuiButtonLoading
|
||||||
|
],
|
||||||
|
templateUrl: './new-customer.component.html',
|
||||||
|
styleUrl: './new-customer.component.scss'
|
||||||
|
})
|
||||||
|
export class NewCustomerComponent {
|
||||||
|
waiting: boolean = false;
|
||||||
|
customerForm: FormGroup;
|
||||||
|
@Output() customerAdded: EventEmitter<any> = new EventEmitter();
|
||||||
|
emailRegex: RegExp = /^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/;
|
||||||
|
|
||||||
|
|
||||||
|
constructor(private customerService: CustomerService) {
|
||||||
|
|
||||||
|
this.customerForm = new FormGroup({
|
||||||
|
firstName: new FormControl('', [Validators.required]),
|
||||||
|
lastName: new FormControl('', [Validators.required]),
|
||||||
|
email: new FormControl('', [Validators.required, Validators.pattern(this.emailRegex)]),
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
saveCustomer() {
|
||||||
|
const firstName = this.customerForm.get('firstName').value
|
||||||
|
const lastName = this.customerForm.get('lastName').value
|
||||||
|
const email = this.customerForm.get('email').value
|
||||||
|
const customer = new Customer(firstName, lastName, email);
|
||||||
|
|
||||||
|
this.customerService.addCustomer(customer).subscribe(() => {
|
||||||
|
this.customerAdded.emit(customer);
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -123,56 +123,5 @@
|
|||||||
</button>
|
</button>
|
||||||
|
|
||||||
<app-modal title="Nieuwe klant" *ngIf="showNewCustomer" (close)="toggleCustomerModal()">
|
<app-modal title="Nieuwe klant" *ngIf="showNewCustomer" (close)="toggleCustomerModal()">
|
||||||
<form [formGroup]="customerForm">
|
<app-new-customer (customerAdded)="saveCustomer()"></app-new-customer>
|
||||||
<tui-input
|
|
||||||
formControlName="firstName"
|
|
||||||
tuiTextfieldSize="m"
|
|
||||||
id="voornaam-nieuwe-klant"
|
|
||||||
[tuiTextfieldCleaner]="true">
|
|
||||||
Voornaam
|
|
||||||
<input
|
|
||||||
tuiTextfieldLegacy
|
|
||||||
type="text"
|
|
||||||
formControlName="firstName"/>
|
|
||||||
</tui-input>
|
|
||||||
<br>
|
|
||||||
<tui-input
|
|
||||||
formControlName="lastName"
|
|
||||||
tuiTextfieldSize="m"
|
|
||||||
id="achternaam-nieuwe-klant"
|
|
||||||
[tuiTextfieldCleaner]="true">
|
|
||||||
Achternaam
|
|
||||||
<input
|
|
||||||
tuiTextfieldLegacy
|
|
||||||
type="text"
|
|
||||||
formControlName="lastName"/>
|
|
||||||
</tui-input>
|
|
||||||
<br>
|
|
||||||
<tui-input
|
|
||||||
formControlName="email"
|
|
||||||
tuiTextfieldSize="m"
|
|
||||||
id="email-nieuwe-klant"
|
|
||||||
[tuiTextfieldCleaner]="true">
|
|
||||||
Email
|
|
||||||
<input
|
|
||||||
tuiTextfieldLegacy
|
|
||||||
autocomplete="email"
|
|
||||||
type="email"
|
|
||||||
formControlName="email"/>
|
|
||||||
</tui-input>
|
|
||||||
<br>
|
|
||||||
<button
|
|
||||||
appearance="secondary"
|
|
||||||
size="m"
|
|
||||||
tuiButton
|
|
||||||
id="klant-toevoegen"
|
|
||||||
[loading]=waiting
|
|
||||||
(click)="saveCustomer()"
|
|
||||||
type="button">
|
|
||||||
<tui-icon
|
|
||||||
icon="@tui.plus"
|
|
||||||
[style.height.rem]="1"/>
|
|
||||||
Klant toevoegen
|
|
||||||
</button>
|
|
||||||
</form>
|
|
||||||
</app-modal>
|
</app-modal>
|
||||||
|
|||||||
@@ -13,16 +13,12 @@ import {
|
|||||||
import {Appointment} from '../../models/appointment';
|
import {Appointment} from '../../models/appointment';
|
||||||
import {TuiDay, TuiTime, TuiValidationError} from '@taiga-ui/cdk';
|
import {TuiDay, TuiTime, TuiValidationError} from '@taiga-ui/cdk';
|
||||||
import {AppointmentService} from '../../services/appointment.service';
|
import {AppointmentService} from '../../services/appointment.service';
|
||||||
import {
|
import {TuiDataListWrapperComponent, TuiFilterByInputPipe, TuiStringifyContentPipe} from '@taiga-ui/kit';
|
||||||
TuiButtonLoading,
|
|
||||||
TuiDataListWrapperComponent,
|
|
||||||
TuiFilterByInputPipe,
|
|
||||||
TuiStringifyContentPipe
|
|
||||||
} from '@taiga-ui/kit';
|
|
||||||
import {Customer} from '../../models/customer';
|
import {Customer} from '../../models/customer';
|
||||||
import {CustomerService} from '../../services/customer.service';
|
import {CustomerService} from '../../services/customer.service';
|
||||||
import {ModalComponent} from '../modal/modal.component';
|
import {ModalComponent} from '../modal/modal.component';
|
||||||
import {timeAfterStartValidator} from '../../models/validators/time-after-start-validator';
|
import {timeAfterStartValidator} from '../../models/validators/time-after-start-validator';
|
||||||
|
import {NewCustomerComponent} from '../new-customer/new-customer.component';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-new-item',
|
selector: 'app-new-item',
|
||||||
@@ -43,8 +39,8 @@ import {timeAfterStartValidator} from '../../models/validators/time-after-start-
|
|||||||
TuiFilterByInputPipe,
|
TuiFilterByInputPipe,
|
||||||
ModalComponent,
|
ModalComponent,
|
||||||
TuiIcon,
|
TuiIcon,
|
||||||
TuiButtonLoading,
|
TuiError,
|
||||||
TuiError
|
NewCustomerComponent
|
||||||
],
|
],
|
||||||
templateUrl: './new-item.component.html',
|
templateUrl: './new-item.component.html',
|
||||||
styleUrl: './new-item.component.scss'
|
styleUrl: './new-item.component.scss'
|
||||||
@@ -72,7 +68,7 @@ export class NewItemComponent implements OnInit {
|
|||||||
this.customerForm = new FormGroup({
|
this.customerForm = new FormGroup({
|
||||||
firstName: new FormControl('', Validators.required),
|
firstName: new FormControl('', Validators.required),
|
||||||
lastName: new FormControl('', Validators.required),
|
lastName: new FormControl('', Validators.required),
|
||||||
email: new FormControl('', Validators.required),
|
email: new FormControl('', [Validators.required, Validators.email]),
|
||||||
})
|
})
|
||||||
this.appointmentForm.get('startTime').setValue(new TuiTime(this.today.getHours(), this.today.getMinutes()), Validators.required)
|
this.appointmentForm.get('startTime').setValue(new TuiTime(this.today.getHours(), this.today.getMinutes()), Validators.required)
|
||||||
this.appointmentForm.get('endTime').setValue(new TuiTime(this.getEndTime().getHours(), this.getEndTime().getMinutes()), [Validators.required, timeAfterStartValidator('startTime')])
|
this.appointmentForm.get('endTime').setValue(new TuiTime(this.getEndTime().getHours(), this.getEndTime().getMinutes()), [Validators.required, timeAfterStartValidator('startTime')])
|
||||||
@@ -133,15 +129,8 @@ export class NewItemComponent implements OnInit {
|
|||||||
`${item.firstName} ${item.lastName}`;
|
`${item.firstName} ${item.lastName}`;
|
||||||
|
|
||||||
saveCustomer() {
|
saveCustomer() {
|
||||||
const firstName = this.customerForm.get('firstName').value
|
|
||||||
const lastName = this.customerForm.get('lastName').value
|
|
||||||
const email = this.customerForm.get('email').value
|
|
||||||
const customer = new Customer(firstName, lastName, email);
|
|
||||||
|
|
||||||
this.customerService.addCustomer(customer).subscribe(() => {
|
|
||||||
this.showNewCustomer = false;
|
this.showNewCustomer = false;
|
||||||
this.getCustomers()
|
this.getCustomers()
|
||||||
})
|
|
||||||
}
|
}
|
||||||
|
|
||||||
getCustomers() {
|
getCustomers() {
|
||||||
|
|||||||
@@ -9,7 +9,16 @@
|
|||||||
(click)="previousDay()"
|
(click)="previousDay()"
|
||||||
type="button">
|
type="button">
|
||||||
</button>
|
</button>
|
||||||
<h1 class="date" id="geselecteerdeDatum" (click)="toggleCalendar()">{{ getDate() }}</h1>
|
<h1 class="date" id="geselecteerdeDatum" (click)="toggleCalendar()">{{ getDate() }}
|
||||||
|
<tui-icon
|
||||||
|
*ngIf="!showCalendar"
|
||||||
|
icon="@tui.chevron-down"
|
||||||
|
[style.color]="'var(--tui-background-accent-1)'"/>
|
||||||
|
<tui-icon
|
||||||
|
*ngIf="showCalendar"
|
||||||
|
icon="@tui.chevron-up"
|
||||||
|
[style.color]="'var(--tui-background-accent-1)'"/>
|
||||||
|
</h1>
|
||||||
<button
|
<button
|
||||||
appearance="primary"
|
appearance="primary"
|
||||||
iconStart="@tui.chevron-right"
|
iconStart="@tui.chevron-right"
|
||||||
|
|||||||
@@ -19,6 +19,7 @@
|
|||||||
Klant toevoegen
|
Klant toevoegen
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="results">
|
||||||
<table class="styled-table">
|
<table class="styled-table">
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
@@ -33,71 +34,12 @@
|
|||||||
</tr>
|
</tr>
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<app-modal title="Nieuwe klant toevoegen" *ngIf="showNewCustomer" (close)="toggleCustomerModal()">
|
<app-modal title="Nieuwe klant toevoegen" *ngIf="showNewCustomer" (close)="toggleCustomerModal()">
|
||||||
<form [formGroup]="customerForm">
|
<app-new-customer (customerAdded)="saveCustomer()"></app-new-customer>
|
||||||
<tui-input
|
|
||||||
formControlName="firstName"
|
|
||||||
tuiTextfieldSize="m"
|
|
||||||
[tuiTextfieldCleaner]="true"
|
|
||||||
>
|
|
||||||
Voornaam
|
|
||||||
<input
|
|
||||||
tuiTextfieldLegacy
|
|
||||||
type="text"
|
|
||||||
id="input-voornaam"
|
|
||||||
formControlName="firstName"
|
|
||||||
/>
|
|
||||||
</tui-input>
|
|
||||||
<br>
|
|
||||||
|
|
||||||
<tui-input
|
|
||||||
formControlName="lastName"
|
|
||||||
tuiTextfieldSize="m"
|
|
||||||
[tuiTextfieldCleaner]="true"
|
|
||||||
>
|
|
||||||
Achternaam
|
|
||||||
<input
|
|
||||||
tuiTextfieldLegacy
|
|
||||||
type="text"
|
|
||||||
id="input-achternaam"
|
|
||||||
formControlName="lastName"
|
|
||||||
/>
|
|
||||||
</tui-input>
|
|
||||||
<br>
|
|
||||||
<tui-input
|
|
||||||
formControlName="email"
|
|
||||||
tuiTextfieldSize="m"
|
|
||||||
[tuiTextfieldCleaner]="true"
|
|
||||||
>
|
|
||||||
Email
|
|
||||||
<input
|
|
||||||
tuiTextfieldLegacy
|
|
||||||
autocomplete="email"
|
|
||||||
id="input-email"
|
|
||||||
type="email"
|
|
||||||
formControlName="email"
|
|
||||||
/>
|
|
||||||
</tui-input>
|
|
||||||
<br>
|
|
||||||
<button
|
|
||||||
appearance="secondary"
|
|
||||||
size="m"
|
|
||||||
tuiButton
|
|
||||||
id="opslaanKlant"
|
|
||||||
(click)="saveCustomer()"
|
|
||||||
[disabled]="customerForm.invalid"
|
|
||||||
type="button">
|
|
||||||
<tui-icon
|
|
||||||
icon="@tui.save"
|
|
||||||
[style.height.rem]="1"
|
|
||||||
/>
|
|
||||||
Opslaan
|
|
||||||
</button>
|
|
||||||
</form>
|
|
||||||
</app-modal>
|
</app-modal>
|
||||||
|
|
||||||
<app-modal title="Klant bekijken" *ngIf="selectedCustomer != undefined" (close)="selectedCustomer = undefined">
|
<app-modal title="Klant bekijken" *ngIf="selectedCustomer != undefined" (close)="selectedCustomer = undefined">
|
||||||
|
|||||||
@@ -15,6 +15,7 @@ h2 {
|
|||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
|
overflow-y: unset;
|
||||||
}
|
}
|
||||||
|
|
||||||
.styled-table {
|
.styled-table {
|
||||||
@@ -25,7 +26,7 @@ h2 {
|
|||||||
text-align: left; /* Tekst uitlijning */
|
text-align: left; /* Tekst uitlijning */
|
||||||
box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1); /* Zachte schaduw */
|
box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1); /* Zachte schaduw */
|
||||||
border-radius: 10px; /* Afgeronde hoeken */
|
border-radius: 10px; /* Afgeronde hoeken */
|
||||||
overflow: hidden; /* Hoeken correct afronden */
|
overflow: scroll; /* Hoeken correct afronden */
|
||||||
}
|
}
|
||||||
|
|
||||||
.styled-table thead {
|
.styled-table thead {
|
||||||
@@ -39,6 +40,12 @@ h2 {
|
|||||||
padding: 12px 15px; /* Ruimte binnen de cellen */
|
padding: 12px 15px; /* Ruimte binnen de cellen */
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.styled-table thead {
|
||||||
|
position: sticky;
|
||||||
|
top: 0;
|
||||||
|
z-index: 2;
|
||||||
|
}
|
||||||
|
|
||||||
.styled-table tbody tr {
|
.styled-table tbody tr {
|
||||||
border-bottom: 1px solid #dddddd; /* Lichte scheidingslijn */
|
border-bottom: 1px solid #dddddd; /* Lichte scheidingslijn */
|
||||||
}
|
}
|
||||||
@@ -60,6 +67,7 @@ h2 {
|
|||||||
.toolbar {
|
.toolbar {
|
||||||
button {
|
button {
|
||||||
margin-left: 8px;
|
margin-left: 8px;
|
||||||
|
position: sticky;
|
||||||
}
|
}
|
||||||
|
|
||||||
margin-bottom: 12px;
|
margin-bottom: 12px;
|
||||||
@@ -69,4 +77,7 @@ h2 {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.results{
|
||||||
|
overflow-y: scroll;
|
||||||
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ import {ModalComponent} from '../../components/modal/modal.component';
|
|||||||
import {FormControl, FormGroup, ReactiveFormsModule, Validators} from '@angular/forms';
|
import {FormControl, FormGroup, ReactiveFormsModule, Validators} from '@angular/forms';
|
||||||
import {TuiInputCopyModule, TuiInputModule, TuiTextfieldControllerModule} from '@taiga-ui/legacy';
|
import {TuiInputCopyModule, TuiInputModule, TuiTextfieldControllerModule} from '@taiga-ui/legacy';
|
||||||
import {CustomerDetailsComponent} from '../../components/customer-details/customer-details.component';
|
import {CustomerDetailsComponent} from '../../components/customer-details/customer-details.component';
|
||||||
|
import {NewCustomerComponent} from '../../components/new-customer/new-customer.component';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-klanten',
|
selector: 'app-klanten',
|
||||||
@@ -20,7 +21,8 @@ import {CustomerDetailsComponent} from '../../components/customer-details/custom
|
|||||||
TuiInputCopyModule,
|
TuiInputCopyModule,
|
||||||
TuiInputModule,
|
TuiInputModule,
|
||||||
TuiTextfieldControllerModule,
|
TuiTextfieldControllerModule,
|
||||||
CustomerDetailsComponent
|
CustomerDetailsComponent,
|
||||||
|
NewCustomerComponent
|
||||||
],
|
],
|
||||||
templateUrl: './klanten.component.html',
|
templateUrl: './klanten.component.html',
|
||||||
styleUrl: './klanten.component.scss'
|
styleUrl: './klanten.component.scss'
|
||||||
@@ -48,15 +50,8 @@ export class KlantenComponent implements OnInit {
|
|||||||
}
|
}
|
||||||
|
|
||||||
saveCustomer() {
|
saveCustomer() {
|
||||||
const firstName = this.customerForm.get('firstName').value
|
|
||||||
const lastName = this.customerForm.get('lastName').value
|
|
||||||
const email = this.customerForm.get('email').value
|
|
||||||
const customer = new Customer(firstName, lastName, email);
|
|
||||||
|
|
||||||
this.customerService.addCustomer(customer).subscribe(() => {
|
|
||||||
this.showNewCustomer = false;
|
this.showNewCustomer = false;
|
||||||
this.getCustomers()
|
this.getCustomers()
|
||||||
})
|
|
||||||
}
|
}
|
||||||
|
|
||||||
getCustomers() {
|
getCustomers() {
|
||||||
|
|||||||
Reference in New Issue
Block a user