Compare commits
21 Commits
main
...
08ca500570
| Author | SHA1 | Date | |
|---|---|---|---|
| 08ca500570 | |||
| cd0f18705c | |||
| 838faae96b | |||
| 1dda26b35f | |||
| 2d444b0300 | |||
| d9829e1eef | |||
| ec720b159c | |||
| 7a7e5593a6 | |||
| bd038647cf | |||
| d8a5373f71 | |||
| bcfb1fd6c2 | |||
| e2c8f4088e | |||
| 61ca3cce3b | |||
| 3365a9cee2 | |||
| ec2c1f9a78 | |||
| 0007c5aea9 | |||
| 9173855aa6 | |||
| 6328502fca | |||
| e9b5ed967b | |||
| 3c69cd2e20 | |||
| 0ebf648017 |
33
.github/workflows/deploy-docker-to-tst.yml
vendored
33
.github/workflows/deploy-docker-to-tst.yml
vendored
@@ -24,6 +24,21 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
name: version
|
name: version
|
||||||
path: version.txt
|
path: version.txt
|
||||||
|
- name: Notify Mattermost via Bot
|
||||||
|
env:
|
||||||
|
VERSION: ${{ env.VERSION }}
|
||||||
|
REPO: ${{ gitea.repository }}
|
||||||
|
BRANCH: ${{ gitea.ref }}
|
||||||
|
MATTERMOST_BOT_TOKEN: ${{ secrets.MATTERMOST_BOT_TOKEN }}
|
||||||
|
run: |
|
||||||
|
curl --fail -X POST -H "Authorization: Bearer $MATTERMOST_BOT_TOKEN" \
|
||||||
|
-H 'Content-Type: application/json' \
|
||||||
|
-d '{
|
||||||
|
"channel_id": "9a8obynkd7rctk6qf8rfe6oppy",
|
||||||
|
"message": "@all 🚀 *Build gestart!* Een nieuwe build ['"$VERSION"'-SNAPSHOT] is begonnen voor de repository *'"$REPO"'* op branch *'"$BRANCH"'*."
|
||||||
|
}' \
|
||||||
|
https://mattermost.melvanveen.nl/api/v4/posts
|
||||||
|
|
||||||
|
|
||||||
# Stap 3: Inloggen bij Docker Hub
|
# Stap 3: Inloggen bij Docker Hub
|
||||||
- name: Log in to Docker Hub
|
- name: Log in to Docker Hub
|
||||||
@@ -72,14 +87,26 @@ jobs:
|
|||||||
echo "Gekozen versie: $VERSION-SNAPSHOT"
|
echo "Gekozen versie: $VERSION-SNAPSHOT"
|
||||||
|
|
||||||
# Stop en verwijder de huidige container
|
# Stop en verwijder de huidige container
|
||||||
docker stop paypoint || true
|
docker stop paypoint-frontend || true
|
||||||
docker rm paypoint || true
|
docker rm paypoint-frontend || true
|
||||||
|
|
||||||
# Haal de nieuwste image binnen
|
# Haal de nieuwste image binnen
|
||||||
docker pull veenm/paypoint:$VERSION-SNAPSHOT
|
docker pull veenm/paypoint:$VERSION-SNAPSHOT
|
||||||
|
|
||||||
# Start een nieuwe container
|
# Start een nieuwe container
|
||||||
docker run -d --name paypoint --restart unless-stopped -p 15001:80 veenm/paypoint:$VERSION-SNAPSHOT
|
docker run -d --name paypoint-frontend --restart unless-stopped -p 15000:80 veenm/paypoint:$VERSION-SNAPSHOT
|
||||||
|
|
||||||
# Opruimen oude images
|
# Opruimen oude images
|
||||||
docker image prune -f
|
docker image prune -f
|
||||||
|
|
||||||
|
- name: Notify Mattermost via Bot
|
||||||
|
env:
|
||||||
|
VERSION: ${{ env.VERSION }}
|
||||||
|
run: |
|
||||||
|
curl --fail -X POST -H "Authorization: Bearer tspcwdn5rbdk8kkmnex6h1nfha" \
|
||||||
|
-H 'Content-Type: application/json' \
|
||||||
|
-d '{
|
||||||
|
"channel_id": "9a8obynkd7rctk6qf8rfe6oppy",
|
||||||
|
"message": "@all ✅ *Build is geslaagd!* Versie '"$VERSION"'-SNAPSHOT staat klaar op https://test-paypoint.melvanveen.nl"
|
||||||
|
}' \
|
||||||
|
https://mattermost.melvanveen.nl/api/v4/posts
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ RUN npm install -g @angular/cli
|
|||||||
|
|
||||||
COPY . .
|
COPY . .
|
||||||
|
|
||||||
RUN ng build --configuration=production
|
RUN ng build --configuration=test
|
||||||
|
|
||||||
# Gebruik een multi-architecture versie van Nginx
|
# Gebruik een multi-architecture versie van Nginx
|
||||||
FROM nginx:latest
|
FROM nginx:latest
|
||||||
|
|||||||
@@ -94,6 +94,9 @@
|
|||||||
},
|
},
|
||||||
"development": {
|
"development": {
|
||||||
"buildTarget": "PayPoint:build:development"
|
"buildTarget": "PayPoint:build:development"
|
||||||
|
},
|
||||||
|
"test": {
|
||||||
|
"buildTarget": "PayPoint:build:test"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"defaultConfiguration": "development"
|
"defaultConfiguration": "development"
|
||||||
|
|||||||
@@ -32,6 +32,7 @@
|
|||||||
tuiButton
|
tuiButton
|
||||||
iconStart="@tui.pencil"
|
iconStart="@tui.pencil"
|
||||||
size="s"
|
size="s"
|
||||||
|
id="bewerkAfspraak"
|
||||||
(click)="showEditModal = true"
|
(click)="showEditModal = true"
|
||||||
type="button">
|
type="button">
|
||||||
Bewerken
|
Bewerken
|
||||||
@@ -41,6 +42,7 @@
|
|||||||
tuiButton
|
tuiButton
|
||||||
iconStart="@tui.trash-2"
|
iconStart="@tui.trash-2"
|
||||||
size="s"
|
size="s"
|
||||||
|
id="verwijderAfspraak"
|
||||||
(click)="showDeleteModal = true"
|
(click)="showDeleteModal = true"
|
||||||
type="button">
|
type="button">
|
||||||
Verwijderen
|
Verwijderen
|
||||||
@@ -59,6 +61,7 @@
|
|||||||
appearance="outline"
|
appearance="outline"
|
||||||
tuiButton
|
tuiButton
|
||||||
size="s"
|
size="s"
|
||||||
|
id="bevestigAfspraakVerwijderen"
|
||||||
(click)="deleteAppointment()"
|
(click)="deleteAppointment()"
|
||||||
type="button">
|
type="button">
|
||||||
Ja, afspraak verwijderen
|
Ja, afspraak verwijderen
|
||||||
@@ -67,6 +70,7 @@
|
|||||||
appearance="outline"
|
appearance="outline"
|
||||||
tuiButton
|
tuiButton
|
||||||
size="s"
|
size="s"
|
||||||
|
id="annuleerAfspraakVerwijderen"
|
||||||
(click)="showDeleteModal = false"
|
(click)="showDeleteModal = false"
|
||||||
type="button">
|
type="button">
|
||||||
Nee, ga terug
|
Nee, ga terug
|
||||||
|
|||||||
@@ -5,6 +5,7 @@
|
|||||||
tuiTextfieldLegacy
|
tuiTextfieldLegacy
|
||||||
formControlName="title"
|
formControlName="title"
|
||||||
type="text"
|
type="text"
|
||||||
|
id="titelBewerken"
|
||||||
/>
|
/>
|
||||||
</tui-input>
|
</tui-input>
|
||||||
<div
|
<div
|
||||||
@@ -17,6 +18,7 @@
|
|||||||
appearance="outline"
|
appearance="outline"
|
||||||
tuiButton
|
tuiButton
|
||||||
size="s"
|
size="s"
|
||||||
|
[id]="action + '-bewerken'"
|
||||||
(click)="addAction(action)"
|
(click)="addAction(action)"
|
||||||
type="button">{{ action }}
|
type="button">{{ action }}
|
||||||
</button>
|
</button>
|
||||||
@@ -27,6 +29,7 @@
|
|||||||
<tui-combo-box
|
<tui-combo-box
|
||||||
[formControl]="control"
|
[formControl]="control"
|
||||||
[stringify]="stringify"
|
[stringify]="stringify"
|
||||||
|
id="klantBewerken"
|
||||||
tuiTextfieldSize="m">
|
tuiTextfieldSize="m">
|
||||||
Klant
|
Klant
|
||||||
<tui-data-list-wrapper
|
<tui-data-list-wrapper
|
||||||
@@ -38,6 +41,7 @@
|
|||||||
<button
|
<button
|
||||||
size="m"
|
size="m"
|
||||||
tuiButton
|
tuiButton
|
||||||
|
id="nieuweKlantBewerken"
|
||||||
(click)="toggleCustomerModal()"
|
(click)="toggleCustomerModal()"
|
||||||
iconStart="@tui.plus"
|
iconStart="@tui.plus"
|
||||||
type="button">
|
type="button">
|
||||||
@@ -53,6 +57,7 @@
|
|||||||
formControlName="date"
|
formControlName="date"
|
||||||
tuiTextfieldSize="m"
|
tuiTextfieldSize="m"
|
||||||
class="tui-space_vertical-4"
|
class="tui-space_vertical-4"
|
||||||
|
id="datumBewerken"
|
||||||
[tuiTextfieldLabelOutside]="false"
|
[tuiTextfieldLabelOutside]="false"
|
||||||
>
|
>
|
||||||
Datum
|
Datum
|
||||||
@@ -63,6 +68,7 @@
|
|||||||
formControlName="startTime"
|
formControlName="startTime"
|
||||||
tuiTextfieldSize="m"
|
tuiTextfieldSize="m"
|
||||||
class="tui-space_top-2"
|
class="tui-space_top-2"
|
||||||
|
id="vanBewerken"
|
||||||
[tuiTextfieldLabelOutside]="false">
|
[tuiTextfieldLabelOutside]="false">
|
||||||
Van
|
Van
|
||||||
</tui-input-time>
|
</tui-input-time>
|
||||||
@@ -72,6 +78,7 @@
|
|||||||
formControlName="endTime"
|
formControlName="endTime"
|
||||||
tuiTextfieldSize="m"
|
tuiTextfieldSize="m"
|
||||||
class="tui-space_top-2"
|
class="tui-space_top-2"
|
||||||
|
id="totBewerken"
|
||||||
[tuiTextfieldLabelOutside]="false"
|
[tuiTextfieldLabelOutside]="false"
|
||||||
>
|
>
|
||||||
Tot
|
Tot
|
||||||
@@ -79,71 +86,18 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<br>
|
<br>
|
||||||
<tui-textarea formControlName="notes">Notities</tui-textarea>
|
<tui-textarea formControlName="notes" id="notitiesBewerken">Notities</tui-textarea>
|
||||||
</form>
|
</form>
|
||||||
<br>
|
<br>
|
||||||
<button
|
<button
|
||||||
size="m"
|
size="m"
|
||||||
tuiButton
|
tuiButton
|
||||||
|
id="afspraakBewerken"
|
||||||
type="button" (click)="updateAppointment()"
|
type="button" (click)="updateAppointment()"
|
||||||
[tuiAppearanceState]="formIsValid()">
|
[tuiAppearanceState]="formIsValid()">
|
||||||
Afspraak bewerken
|
Afspraak bewerken
|
||||||
</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"
|
|
||||||
[tuiTextfieldCleaner]="true"
|
|
||||||
>
|
|
||||||
Voornaam
|
|
||||||
<input
|
|
||||||
tuiTextfieldLegacy
|
|
||||||
type="text"
|
|
||||||
formControlName="firstName"
|
|
||||||
/>
|
|
||||||
</tui-input>
|
|
||||||
<br>
|
|
||||||
|
|
||||||
<tui-input
|
|
||||||
formControlName="lastName"
|
|
||||||
tuiTextfieldSize="m"
|
|
||||||
[tuiTextfieldCleaner]="true"
|
|
||||||
>
|
|
||||||
Achternaam
|
|
||||||
<input
|
|
||||||
tuiTextfieldLegacy
|
|
||||||
type="text"
|
|
||||||
formControlName="lastName"
|
|
||||||
/>
|
|
||||||
</tui-input>
|
|
||||||
<br>
|
|
||||||
<tui-input
|
|
||||||
formControlName="email"
|
|
||||||
tuiTextfieldSize="m"
|
|
||||||
[tuiTextfieldCleaner]="true"
|
|
||||||
>
|
|
||||||
Email
|
|
||||||
<input
|
|
||||||
tuiTextfieldLegacy
|
|
||||||
autocomplete="email"
|
|
||||||
type="email"
|
|
||||||
formControlName="email"
|
|
||||||
/>
|
|
||||||
</tui-input>
|
|
||||||
<br>
|
|
||||||
<button
|
|
||||||
appearance="secondary"
|
|
||||||
size="m"
|
|
||||||
tuiButton
|
|
||||||
(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,
|
||||||
@@ -17,6 +17,7 @@ import {TuiDataListWrapperComponent, TuiFilterByInputPipe, TuiStringifyContentPi
|
|||||||
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',
|
||||||
@@ -36,7 +37,7 @@ import {ModalComponent} from '../modal/modal.component';
|
|||||||
TuiStringifyContentPipe,
|
TuiStringifyContentPipe,
|
||||||
TuiFilterByInputPipe,
|
TuiFilterByInputPipe,
|
||||||
ModalComponent,
|
ModalComponent,
|
||||||
TuiIcon
|
NewCustomerComponent
|
||||||
],
|
],
|
||||||
templateUrl: './edit-item.component.html',
|
templateUrl: './edit-item.component.html',
|
||||||
styleUrl: './edit-item.component.scss'
|
styleUrl: './edit-item.component.scss'
|
||||||
@@ -126,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() {
|
||||||
|
|||||||
@@ -8,6 +8,7 @@
|
|||||||
size="xs"
|
size="xs"
|
||||||
tuiIconButton
|
tuiIconButton
|
||||||
type="button"
|
type="button"
|
||||||
|
id="sluitModal"
|
||||||
[style.border-radius.%]="100"
|
[style.border-radius.%]="100"
|
||||||
(click)="closeModal()"
|
(click)="closeModal()"
|
||||||
>
|
>
|
||||||
|
|||||||
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);
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -5,6 +5,7 @@
|
|||||||
tuiTextfieldLegacy
|
tuiTextfieldLegacy
|
||||||
formControlName="title"
|
formControlName="title"
|
||||||
type="text"
|
type="text"
|
||||||
|
id="titel"
|
||||||
/>
|
/>
|
||||||
</tui-input>
|
</tui-input>
|
||||||
<div
|
<div
|
||||||
@@ -16,6 +17,7 @@
|
|||||||
*ngFor="let action of quickActions"
|
*ngFor="let action of quickActions"
|
||||||
appearance="outline"
|
appearance="outline"
|
||||||
tuiButton
|
tuiButton
|
||||||
|
[attr.id]="action"
|
||||||
size="s"
|
size="s"
|
||||||
(click)="addAction(action)"
|
(click)="addAction(action)"
|
||||||
type="button">{{ action }}
|
type="button">{{ action }}
|
||||||
@@ -27,6 +29,7 @@
|
|||||||
<tui-combo-box
|
<tui-combo-box
|
||||||
[formControl]="customerControl"
|
[formControl]="customerControl"
|
||||||
[stringify]="stringify"
|
[stringify]="stringify"
|
||||||
|
id="klant"
|
||||||
tuiTextfieldSize="m">
|
tuiTextfieldSize="m">
|
||||||
Klant
|
Klant
|
||||||
<tui-data-list-wrapper
|
<tui-data-list-wrapper
|
||||||
@@ -38,6 +41,7 @@
|
|||||||
<button
|
<button
|
||||||
size="m"
|
size="m"
|
||||||
tuiButton
|
tuiButton
|
||||||
|
id="klantToevoegen"
|
||||||
(click)="toggleCustomerModal()"
|
(click)="toggleCustomerModal()"
|
||||||
iconStart="@tui.plus"
|
iconStart="@tui.plus"
|
||||||
type="button">
|
type="button">
|
||||||
@@ -53,6 +57,7 @@
|
|||||||
formControlName="date"
|
formControlName="date"
|
||||||
tuiTextfieldSize="m"
|
tuiTextfieldSize="m"
|
||||||
class="tui-space_vertical-4"
|
class="tui-space_vertical-4"
|
||||||
|
id="datum"
|
||||||
[tuiTextfieldLabelOutside]="false">
|
[tuiTextfieldLabelOutside]="false">
|
||||||
Datum
|
Datum
|
||||||
</tui-input-date>
|
</tui-input-date>
|
||||||
@@ -62,6 +67,7 @@
|
|||||||
formControlName="startTime"
|
formControlName="startTime"
|
||||||
tuiTextfieldSize="m"
|
tuiTextfieldSize="m"
|
||||||
class="tui-space_top-2"
|
class="tui-space_top-2"
|
||||||
|
id="van"
|
||||||
[tuiTextfieldLabelOutside]="false">
|
[tuiTextfieldLabelOutside]="false">
|
||||||
Van
|
Van
|
||||||
</tui-input-time>
|
</tui-input-time>
|
||||||
@@ -71,21 +77,22 @@
|
|||||||
formControlName="endTime"
|
formControlName="endTime"
|
||||||
tuiTextfieldSize="m"
|
tuiTextfieldSize="m"
|
||||||
class="tui-space_top-2"
|
class="tui-space_top-2"
|
||||||
|
id="tot"
|
||||||
[tuiTextfieldLabelOutside]="false">
|
[tuiTextfieldLabelOutside]="false">
|
||||||
Tot
|
Tot
|
||||||
</tui-input-time>
|
</tui-input-time>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<span *ngIf="appointmentForm.get('endTime')?.errors?.['endTimeInvalid']">
|
<span *ngIf="appointmentForm.get('endTime')?.errors?.['endTimeInvalid']">
|
||||||
<tui-error [error]="timeError"/>
|
<tui-error id="timeError" [error]="timeError"/>
|
||||||
</span>
|
</span>
|
||||||
<br>
|
<br>
|
||||||
<ng-container *ngIf="appointments.length > 0">
|
<ng-container *ngIf="appointments.length > 0">
|
||||||
<h3>Geplande afspraken die dag:</h3>
|
<h3>Geplande afspraken die dag:</h3>
|
||||||
<div class="appointments-container">
|
<div class="appointments-container">
|
||||||
<div *ngFor="let appointment of appointments" class="appointment-object">
|
<div *ngFor="let appointment of appointments" class="appointment-object" [attr.id]="appointment.title + '-' + appointment.customer">
|
||||||
<span class="title">{{ appointment.title }}</span>
|
<span class="title" id="titel-afspraak">{{ appointment.title }}</span>
|
||||||
<span class="name">
|
<span class="name" id="titel-naam">
|
||||||
<tui-icon
|
<tui-icon
|
||||||
icon="@tui.user"
|
icon="@tui.user"
|
||||||
[style.font-size.rem]="1"
|
[style.font-size.rem]="1"
|
||||||
@@ -102,7 +109,6 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</ng-container>
|
</ng-container>
|
||||||
|
|
||||||
<br>
|
<br>
|
||||||
<tui-textarea formControlName="notes">Notities</tui-textarea>
|
<tui-textarea formControlName="notes">Notities</tui-textarea>
|
||||||
</form>
|
</form>
|
||||||
@@ -111,57 +117,11 @@
|
|||||||
size="m"
|
size="m"
|
||||||
tuiButton
|
tuiButton
|
||||||
type="button" (click)="registerAppointment()"
|
type="button" (click)="registerAppointment()"
|
||||||
|
id="afspraakMaken"
|
||||||
[tuiAppearanceState]="formIsValid()">
|
[tuiAppearanceState]="formIsValid()">
|
||||||
Afspraak maken
|
Afspraak maken
|
||||||
</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"
|
|
||||||
[tuiTextfieldCleaner]="true">
|
|
||||||
Voornaam
|
|
||||||
<input
|
|
||||||
tuiTextfieldLegacy
|
|
||||||
type="text"
|
|
||||||
formControlName="firstName"/>
|
|
||||||
</tui-input>
|
|
||||||
<br>
|
|
||||||
<tui-input
|
|
||||||
formControlName="lastName"
|
|
||||||
tuiTextfieldSize="m"
|
|
||||||
[tuiTextfieldCleaner]="true">
|
|
||||||
Achternaam
|
|
||||||
<input
|
|
||||||
tuiTextfieldLegacy
|
|
||||||
type="text"
|
|
||||||
formControlName="lastName"/>
|
|
||||||
</tui-input>
|
|
||||||
<br>
|
|
||||||
<tui-input
|
|
||||||
formControlName="email"
|
|
||||||
tuiTextfieldSize="m"
|
|
||||||
[tuiTextfieldCleaner]="true">
|
|
||||||
Email
|
|
||||||
<input
|
|
||||||
tuiTextfieldLegacy
|
|
||||||
autocomplete="email"
|
|
||||||
type="email"
|
|
||||||
formControlName="email"/>
|
|
||||||
</tui-input>
|
|
||||||
<br>
|
|
||||||
<button
|
|
||||||
appearance="secondary"
|
|
||||||
size="m"
|
|
||||||
tuiButton
|
|
||||||
[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() {
|
||||||
|
|||||||
@@ -5,21 +5,33 @@
|
|||||||
iconStart="@tui.chevron-left"
|
iconStart="@tui.chevron-left"
|
||||||
size="m"
|
size="m"
|
||||||
tuiIconButton
|
tuiIconButton
|
||||||
|
id="vorigeDag"
|
||||||
(click)="previousDay()"
|
(click)="previousDay()"
|
||||||
type="button">
|
type="button">
|
||||||
</button>
|
</button>
|
||||||
<h1 class="date" (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"
|
||||||
size="m"
|
size="m"
|
||||||
tuiIconButton
|
tuiIconButton
|
||||||
|
id="volgendeDag"
|
||||||
(click)="nextDay()"
|
(click)="nextDay()"
|
||||||
type="button">
|
type="button">
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
<div class="calendar" *ngIf="showCalendar">
|
<div class="calendar" *ngIf="showCalendar">
|
||||||
<tui-calendar
|
<tui-calendar
|
||||||
|
id="calenderDatum"
|
||||||
[value]="value"
|
[value]="value"
|
||||||
(dayClick)="onDayClick($event)"
|
(dayClick)="onDayClick($event)"
|
||||||
/>
|
/>
|
||||||
@@ -30,6 +42,7 @@
|
|||||||
appearance="secondary"
|
appearance="secondary"
|
||||||
size="m"
|
size="m"
|
||||||
tuiButton
|
tuiButton
|
||||||
|
id="vandaag"
|
||||||
(click)="setToday()"
|
(click)="setToday()"
|
||||||
type="button">
|
type="button">
|
||||||
Vandaag
|
Vandaag
|
||||||
@@ -38,6 +51,7 @@
|
|||||||
appearance="secondary"
|
appearance="secondary"
|
||||||
size="m"
|
size="m"
|
||||||
tuiButton
|
tuiButton
|
||||||
|
id="afspraakMaken"
|
||||||
(click)="isModalOpen = true"
|
(click)="isModalOpen = true"
|
||||||
type="button">
|
type="button">
|
||||||
<tui-icon
|
<tui-icon
|
||||||
@@ -54,6 +68,7 @@
|
|||||||
|
|
||||||
<div *ngFor="let appointment of getAppointmentsForHour(hour)"
|
<div *ngFor="let appointment of getAppointmentsForHour(hour)"
|
||||||
class="appointment"
|
class="appointment"
|
||||||
|
[attr.id]="'afspraak-'+appointment.id"
|
||||||
(click)="selectAppointment(appointment)"
|
(click)="selectAppointment(appointment)"
|
||||||
[ngClass]="{ 'large': (getAppointmentHeight(appointment) > 50) }"
|
[ngClass]="{ 'large': (getAppointmentHeight(appointment) > 50) }"
|
||||||
[ngStyle]="getInlineStyles(appointment)">
|
[ngStyle]="getInlineStyles(appointment)">
|
||||||
|
|||||||
@@ -6,13 +6,14 @@
|
|||||||
<div class="navbar">
|
<div class="navbar">
|
||||||
<img src="assets/logo-minimal.png" alt="App Logo" class="img-fluid">
|
<img src="assets/logo-minimal.png" alt="App Logo" class="img-fluid">
|
||||||
<ul>
|
<ul>
|
||||||
<li><a routerLink="/home/agenda" routerLinkActive="active">Agenda</a></li>
|
<li><a routerLink="/home/agenda" id="agenda" routerLinkActive="active">Agenda</a></li>
|
||||||
<li><a routerLink="/home/klanten" routerLinkActive="active">Klanten</a></li>
|
<li><a routerLink="/home/klanten" id="klanten" routerLinkActive="active">Klanten</a></li>
|
||||||
</ul>
|
</ul>
|
||||||
<hr/>
|
<hr/>
|
||||||
<button
|
<button
|
||||||
tuiChevron
|
tuiChevron
|
||||||
type="button"
|
type="button"
|
||||||
|
id="userMenu"
|
||||||
[tuiDropdown]="dropdownContent"
|
[tuiDropdown]="dropdownContent"
|
||||||
[tuiDropdownManual]="open"
|
[tuiDropdownManual]="open"
|
||||||
[tuiObscuredEnabled]="open"
|
[tuiObscuredEnabled]="open"
|
||||||
@@ -28,6 +29,7 @@
|
|||||||
size="m"
|
size="m"
|
||||||
tuiButton
|
tuiButton
|
||||||
type="button"
|
type="button"
|
||||||
|
id="uitloggen"
|
||||||
(click)="logout()"
|
(click)="logout()"
|
||||||
>
|
>
|
||||||
Uitloggen
|
Uitloggen
|
||||||
|
|||||||
@@ -8,6 +8,7 @@
|
|||||||
size="m"
|
size="m"
|
||||||
tuiButton
|
tuiButton
|
||||||
appearance="secondary"
|
appearance="secondary"
|
||||||
|
id="klantToevoegen"
|
||||||
type="button"
|
type="button"
|
||||||
(click)="toggleCustomerModal()"
|
(click)="toggleCustomerModal()"
|
||||||
>
|
>
|
||||||
@@ -18,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>
|
||||||
@@ -26,73 +28,18 @@
|
|||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
<tr *ngFor="let customer of customers" (click)="selectCustomer(customer)">
|
<tr *ngFor="let customer of customers" (click)="selectCustomer(customer)" [id]="customer.id">
|
||||||
<td>{{ customer.firstName }} {{ customer.lastName }}</td>
|
<td>{{ customer.firstName }} {{ customer.lastName }}</td>
|
||||||
<td>{{ customer.email }}</td>
|
<td>{{ customer.email }}</td>
|
||||||
</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"
|
|
||||||
formControlName="firstName"
|
|
||||||
/>
|
|
||||||
</tui-input>
|
|
||||||
<br>
|
|
||||||
|
|
||||||
<tui-input
|
|
||||||
formControlName="lastName"
|
|
||||||
tuiTextfieldSize="m"
|
|
||||||
[tuiTextfieldCleaner]="true"
|
|
||||||
>
|
|
||||||
Achternaam
|
|
||||||
<input
|
|
||||||
tuiTextfieldLegacy
|
|
||||||
type="text"
|
|
||||||
formControlName="lastName"
|
|
||||||
/>
|
|
||||||
</tui-input>
|
|
||||||
<br>
|
|
||||||
<tui-input
|
|
||||||
formControlName="email"
|
|
||||||
tuiTextfieldSize="m"
|
|
||||||
[tuiTextfieldCleaner]="true"
|
|
||||||
>
|
|
||||||
Email
|
|
||||||
<input
|
|
||||||
tuiTextfieldLegacy
|
|
||||||
autocomplete="email"
|
|
||||||
type="email"
|
|
||||||
formControlName="email"
|
|
||||||
/>
|
|
||||||
</tui-input>
|
|
||||||
<br>
|
|
||||||
<button
|
|
||||||
appearance="secondary"
|
|
||||||
size="m"
|
|
||||||
tuiButton
|
|
||||||
(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() {
|
||||||
|
|||||||
@@ -6,18 +6,20 @@
|
|||||||
</header>
|
</header>
|
||||||
<tui-textfield>
|
<tui-textfield>
|
||||||
<label tuiLabel>Gebruikersnaam</label>
|
<label tuiLabel>Gebruikersnaam</label>
|
||||||
<input formControlName="username" placeholder="Voer je gebruikersnaam in" tuiTextfield/>
|
<input formControlName="username" placeholder="Voer je gebruikersnaam in" id="username" tuiTextfield/>
|
||||||
</tui-textfield>
|
</tui-textfield>
|
||||||
<tui-textfield>
|
<tui-textfield>
|
||||||
<label tuiLabel>Wachtwoord</label>
|
<label tuiLabel>Wachtwoord</label>
|
||||||
<input formControlName="password" type="password" placeholder="Voer je wachtwoord in" tuiTextfield/>
|
<input formControlName="password" type="password" placeholder="Voer je wachtwoord in" id="password" tuiTextfield/>
|
||||||
</tui-textfield>
|
</tui-textfield>
|
||||||
<tui-error [error]="computedError"/>
|
<tui-error [error]="computedError"/>
|
||||||
<footer>
|
<footer>
|
||||||
<button tuiButton class="custom-button" type="submit" [disabled]="form.invalid" (click)="login()">
|
<button tuiButton class="custom-button" id="inloggen" type="submit" [disabled]="form.invalid" (click)="login()">
|
||||||
Inloggen
|
Inloggen
|
||||||
</button>
|
</button>
|
||||||
</footer>
|
</footer>
|
||||||
|
<!-- <br>-->
|
||||||
|
<p>{{appVersion}}</p>
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -10,6 +10,10 @@ tui-error {
|
|||||||
text-align: center;
|
text-align: center;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
p{
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
|
||||||
.header {
|
.header {
|
||||||
text-align: center;
|
text-align: center;
|
||||||
margin-bottom: 28px;
|
margin-bottom: 28px;
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ import {AuthService} from '../../services/auth.service';
|
|||||||
import {UserDto} from '../../models/user-dto';
|
import {UserDto} from '../../models/user-dto';
|
||||||
import {HttpErrorResponse} from '@angular/common/http';
|
import {HttpErrorResponse} from '@angular/common/http';
|
||||||
import {TuiValidationError} from '@taiga-ui/cdk';
|
import {TuiValidationError} from '@taiga-ui/cdk';
|
||||||
|
import {environment} from '../../../environments/environment';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-login',
|
selector: 'app-login',
|
||||||
@@ -26,6 +27,7 @@ import {TuiValidationError} from '@taiga-ui/cdk';
|
|||||||
export class LoginComponent {
|
export class LoginComponent {
|
||||||
form: FormGroup;
|
form: FormGroup;
|
||||||
protected enabled = false;
|
protected enabled = false;
|
||||||
|
appVersion = environment.appVersion;
|
||||||
|
|
||||||
protected error = new TuiValidationError('Ongeldige gebruikersnaam of wachtwoord.');
|
protected error = new TuiValidationError('Ongeldige gebruikersnaam of wachtwoord.');
|
||||||
|
|
||||||
|
|||||||
@@ -1,13 +1,13 @@
|
|||||||
import {Injectable} from '@angular/core';
|
import {Injectable} from '@angular/core';
|
||||||
import {HttpClient} from '@angular/common/http';
|
import {HttpClient} from '@angular/common/http';
|
||||||
import {Appointment} from '../models/appointment';
|
import {Appointment} from '../models/appointment';
|
||||||
|
import {environment} from '../../environments/environment';
|
||||||
|
|
||||||
@Injectable({
|
@Injectable({
|
||||||
providedIn: 'root',
|
providedIn: 'root',
|
||||||
})
|
})
|
||||||
export class AppointmentService {
|
export class AppointmentService {
|
||||||
// baseApi = "http://localhost:8080/api/appointments";
|
baseApi = `${environment.baseApi}/appointments`;
|
||||||
baseApi = "https://api.melvanveen.nl/api/appointments";
|
|
||||||
|
|
||||||
constructor(private http: HttpClient) {
|
constructor(private http: HttpClient) {
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,13 +3,13 @@ import {HttpClient} from '@angular/common/http';
|
|||||||
import {JwtHelperService} from '@auth0/angular-jwt';
|
import {JwtHelperService} from '@auth0/angular-jwt';
|
||||||
import {Observable} from 'rxjs';
|
import {Observable} from 'rxjs';
|
||||||
import {jwtDecode} from 'jwt-decode';
|
import {jwtDecode} from 'jwt-decode';
|
||||||
|
import {environment} from '../../environments/environment';
|
||||||
|
|
||||||
@Injectable({
|
@Injectable({
|
||||||
providedIn: 'root',
|
providedIn: 'root',
|
||||||
})
|
})
|
||||||
export class AuthService {
|
export class AuthService {
|
||||||
// private baseApi = 'http://localhost:8080/api/auth/login';
|
baseApi = `${environment.baseApi}/auth/login`;
|
||||||
baseApi = "https://api.melvanveen.nl/api/auth/login";
|
|
||||||
jwtHelper = new JwtHelperService();
|
jwtHelper = new JwtHelperService();
|
||||||
|
|
||||||
constructor(private http: HttpClient) {
|
constructor(private http: HttpClient) {
|
||||||
|
|||||||
@@ -2,14 +2,13 @@ import {Injectable} from '@angular/core';
|
|||||||
import {HttpClient} from '@angular/common/http';
|
import {HttpClient} from '@angular/common/http';
|
||||||
import {Customer} from '../models/customer';
|
import {Customer} from '../models/customer';
|
||||||
import {Observable} from 'rxjs';
|
import {Observable} from 'rxjs';
|
||||||
|
import {environment} from '../../environments/environment';
|
||||||
|
|
||||||
@Injectable({
|
@Injectable({
|
||||||
providedIn: 'root',
|
providedIn: 'root',
|
||||||
})
|
})
|
||||||
export class CustomerService {
|
export class CustomerService {
|
||||||
// baseApi = "http://localhost:8080/api/customers";
|
baseApi = `${environment.baseApi}/customers`;
|
||||||
baseApi = "https://api.melvanveen.nl/api/customers";
|
|
||||||
|
|
||||||
|
|
||||||
constructor(private http: HttpClient) {
|
constructor(private http: HttpClient) {
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,7 @@
|
|||||||
|
import { version } from '../../package.json';
|
||||||
|
|
||||||
export const environment = {
|
export const environment = {
|
||||||
baseApi: 'http://localhost:8080/api',
|
baseApi: 'http://localhost:8080/api',
|
||||||
production: false
|
production: false,
|
||||||
|
appVersion: version + '-LOCAL'
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -1,4 +1,7 @@
|
|||||||
|
import { version } from '../../package.json';
|
||||||
|
|
||||||
export const environment = {
|
export const environment = {
|
||||||
baseApi: 'http://localhost:8080/api',
|
baseApi: 'https://api-paypoint-test.melvanveen.nl/api',
|
||||||
production: false
|
production: false,
|
||||||
|
appVersion: version + '-SNAPSHOT'
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -1,4 +1,7 @@
|
|||||||
|
import { version } from '../../package.json';
|
||||||
|
|
||||||
export const environment = {
|
export const environment = {
|
||||||
baseApi: 'https://api.melvanveen.nl/api',
|
baseApi: 'https://api.melvanveen.nl/api',
|
||||||
production: true
|
production: true,
|
||||||
|
appVersion: version
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user