git init v2

This commit is contained in:
2025-03-11 23:13:19 +01:00
parent 4d4c8a362a
commit abae328d8f
62 changed files with 3461 additions and 421 deletions

3
.fleet/settings.json Normal file
View File

@@ -0,0 +1,3 @@
{
"editor.formatOnSave": true
}

22
Dockerfile Normal file
View File

@@ -0,0 +1,22 @@
# Gebruik een multi-architecture versie van Node
FROM node:22.0.0 as build
WORKDIR /app
COPY package*.json ./
RUN npm install
RUN npm install -g @angular/cli
COPY . .
RUN ng build --configuration=production
# Gebruik een multi-architecture versie van Nginx
FROM nginx:latest
# Kopieer de gecompileerde bestanden van Angular naar de Nginx-webserver
COPY --from=build app/dist/pay-point/browser /usr/share/nginx/html
EXPOSE 80

View File

@@ -29,9 +29,21 @@
{ {
"glob": "**/*", "glob": "**/*",
"input": "public" "input": "public"
},
{
"glob": "**/*",
"input": "node_modules/@taiga-ui/icons/src",
"output": "assets/taiga-ui/icons"
},
{
"glob": "**/*",
"input": "node_modules/@taiga-ui/icons/src",
"output": "assets/taiga-ui/icons"
} }
], ],
"styles": [ "styles": [
"node_modules/@taiga-ui/core/styles/taiga-ui-theme.less",
"node_modules/@taiga-ui/core/styles/taiga-ui-fonts.less",
"src/styles.scss" "src/styles.scss"
], ],
"scripts": [] "scripts": []

935
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@@ -11,6 +11,7 @@
"private": true, "private": true,
"dependencies": { "dependencies": {
"@angular/animations": "^19.0.0", "@angular/animations": "^19.0.0",
"@angular/cdk": "^19.0.0",
"@angular/common": "^19.0.0", "@angular/common": "^19.0.0",
"@angular/compiler": "^19.0.0", "@angular/compiler": "^19.0.0",
"@angular/core": "^19.0.0", "@angular/core": "^19.0.0",
@@ -18,6 +19,21 @@
"@angular/platform-browser": "^19.0.0", "@angular/platform-browser": "^19.0.0",
"@angular/platform-browser-dynamic": "^19.0.0", "@angular/platform-browser-dynamic": "^19.0.0",
"@angular/router": "^19.0.0", "@angular/router": "^19.0.0",
"@auth0/angular-jwt": "^5.2.0",
"@taiga-ui/addon-charts": "^4.25.0",
"@taiga-ui/addon-commerce": "^4.25.0",
"@taiga-ui/addon-doc": "^4.25.0",
"@taiga-ui/addon-mobile": "^4.25.0",
"@taiga-ui/addon-table": "^4.25.0",
"@taiga-ui/cdk": "^4.25.0",
"@taiga-ui/core": "^4.25.0",
"@taiga-ui/event-plugins": "^4.0.2",
"@taiga-ui/icons": "^4.25.0",
"@taiga-ui/kit": "^4.25.0",
"@taiga-ui/layout": "^4.25.0",
"angular-calendar": "^0.31.1",
"date-fns": "^4.1.0",
"jwt-decode": "^4.0.0",
"rxjs": "~7.8.0", "rxjs": "~7.8.0",
"tslib": "^2.3.0", "tslib": "^2.3.0",
"zone.js": "~0.15.0" "zone.js": "~0.15.0"

View File

@@ -0,0 +1,13 @@
@font-face {
font-family: 'Lato';
src: url('/assets/fonts/lato.regular.ttf') format('truetype');
font-weight: normal;
font-style: normal;
}
@font-face {
font-family: 'Lato';
src: url('/assets/fonts/lato.heavy.ttf') format('truetype');
font-weight: bold;
font-style: normal;
}

Binary file not shown.

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.5 KiB

BIN
public/assets/logo.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 15 KiB

After

Width:  |  Height:  |  Size: 105 KiB

View File

@@ -1,336 +1,3 @@
<!-- * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * --> <tui-root>
<!-- * * * * * * * * * * * The content below * * * * * * * * * * * --> <router-outlet></router-outlet>
<!-- * * * * * * * * * * is only a placeholder * * * * * * * * * * --> </tui-root>
<!-- * * * * * * * * * * and can be replaced. * * * * * * * * * * -->
<!-- * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * -->
<!-- * * * * * * * * * Delete the template below * * * * * * * * * -->
<!-- * * * * * * * to get started with your project! * * * * * * * -->
<!-- * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * -->
<style>
:host {
--bright-blue: oklch(51.01% 0.274 263.83);
--electric-violet: oklch(53.18% 0.28 296.97);
--french-violet: oklch(47.66% 0.246 305.88);
--vivid-pink: oklch(69.02% 0.277 332.77);
--hot-red: oklch(61.42% 0.238 15.34);
--orange-red: oklch(63.32% 0.24 31.68);
--gray-900: oklch(19.37% 0.006 300.98);
--gray-700: oklch(36.98% 0.014 302.71);
--gray-400: oklch(70.9% 0.015 304.04);
--red-to-pink-to-purple-vertical-gradient: linear-gradient(
180deg,
var(--orange-red) 0%,
var(--vivid-pink) 50%,
var(--electric-violet) 100%
);
--red-to-pink-to-purple-horizontal-gradient: linear-gradient(
90deg,
var(--orange-red) 0%,
var(--vivid-pink) 50%,
var(--electric-violet) 100%
);
--pill-accent: var(--bright-blue);
font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji",
"Segoe UI Symbol";
box-sizing: border-box;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
h1 {
font-size: 3.125rem;
color: var(--gray-900);
font-weight: 500;
line-height: 100%;
letter-spacing: -0.125rem;
margin: 0;
font-family: "Inter Tight", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji",
"Segoe UI Symbol";
}
p {
margin: 0;
color: var(--gray-700);
}
main {
width: 100%;
min-height: 100%;
display: flex;
justify-content: center;
align-items: center;
padding: 1rem;
box-sizing: inherit;
position: relative;
}
.angular-logo {
max-width: 9.2rem;
}
.content {
display: flex;
justify-content: space-around;
width: 100%;
max-width: 700px;
margin-bottom: 3rem;
}
.content h1 {
margin-top: 1.75rem;
}
.content p {
margin-top: 1.5rem;
}
.divider {
width: 1px;
background: var(--red-to-pink-to-purple-vertical-gradient);
margin-inline: 0.5rem;
}
.pill-group {
display: flex;
flex-direction: column;
align-items: start;
flex-wrap: wrap;
gap: 1.25rem;
}
.pill {
display: flex;
align-items: center;
--pill-accent: var(--bright-blue);
background: color-mix(in srgb, var(--pill-accent) 5%, transparent);
color: var(--pill-accent);
padding-inline: 0.75rem;
padding-block: 0.375rem;
border-radius: 2.75rem;
border: 0;
transition: background 0.3s ease;
font-family: var(--inter-font);
font-size: 0.875rem;
font-style: normal;
font-weight: 500;
line-height: 1.4rem;
letter-spacing: -0.00875rem;
text-decoration: none;
}
.pill:hover {
background: color-mix(in srgb, var(--pill-accent) 15%, transparent);
}
.pill-group .pill:nth-child(6n + 1) {
--pill-accent: var(--bright-blue);
}
.pill-group .pill:nth-child(6n + 2) {
--pill-accent: var(--french-violet);
}
.pill-group .pill:nth-child(6n + 3),
.pill-group .pill:nth-child(6n + 4),
.pill-group .pill:nth-child(6n + 5) {
--pill-accent: var(--hot-red);
}
.pill-group svg {
margin-inline-start: 0.25rem;
}
.social-links {
display: flex;
align-items: center;
gap: 0.73rem;
margin-top: 1.5rem;
}
.social-links path {
transition: fill 0.3s ease;
fill: var(--gray-400);
}
.social-links a:hover svg path {
fill: var(--gray-900);
}
@media screen and (max-width: 650px) {
.content {
flex-direction: column;
width: max-content;
}
.divider {
height: 1px;
width: 100%;
background: var(--red-to-pink-to-purple-horizontal-gradient);
margin-block: 1.5rem;
}
}
</style>
<main class="main">
<div class="content">
<div class="left-side">
<svg
xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 982 239"
fill="none"
class="angular-logo"
>
<g clip-path="url(#a)">
<path
fill="url(#b)"
d="M388.676 191.625h30.849L363.31 31.828h-35.758l-56.215 159.797h30.848l13.174-39.356h60.061l13.256 39.356Zm-65.461-62.675 21.602-64.311h1.227l21.602 64.311h-44.431Zm126.831-7.527v70.202h-28.23V71.839h27.002v20.374h1.392c2.782-6.71 7.2-12.028 13.255-15.956 6.056-3.927 13.584-5.89 22.503-5.89 8.264 0 15.465 1.8 21.684 5.318 6.137 3.518 10.964 8.673 14.319 15.382 3.437 6.71 5.074 14.81 4.992 24.383v76.175h-28.23v-71.92c0-8.019-2.046-14.237-6.219-18.819-4.173-4.5-9.819-6.791-17.102-6.791-4.91 0-9.328 1.063-13.174 3.272-3.846 2.128-6.792 5.237-9.001 9.328-2.046 4.009-3.191 8.918-3.191 14.728ZM589.233 239c-10.147 0-18.82-1.391-26.103-4.091-7.282-2.7-13.092-6.382-17.511-10.964-4.418-4.582-7.528-9.655-9.164-15.219l25.448-6.136c1.145 2.372 2.782 4.663 4.991 6.954 2.209 2.291 5.155 4.255 8.837 5.81 3.683 1.554 8.428 2.291 14.074 2.291 8.019 0 14.647-1.964 19.884-5.81 5.237-3.845 7.856-10.227 7.856-19.064v-22.665h-1.391c-1.473 2.946-3.601 5.892-6.383 9.001-2.782 3.109-6.464 5.645-10.965 7.691-4.582 2.046-10.228 3.109-17.101 3.109-9.165 0-17.511-2.209-25.039-6.545-7.446-4.337-13.42-10.883-17.757-19.474-4.418-8.673-6.628-19.473-6.628-32.565 0-13.091 2.21-24.301 6.628-33.383 4.419-9.082 10.311-15.955 17.839-20.7 7.528-4.746 15.874-7.037 25.039-7.037 7.037 0 12.846 1.145 17.347 3.518 4.582 2.373 8.182 5.236 10.883 8.51 2.7 3.272 4.746 6.382 6.137 9.327h1.554v-19.8h27.821v121.749c0 10.228-2.454 18.737-7.364 25.447-4.91 6.709-11.538 11.7-20.048 15.055-8.509 3.355-18.165 4.991-28.884 4.991Zm.245-71.266c5.974 0 11.047-1.473 15.302-4.337 4.173-2.945 7.446-7.118 9.573-12.519 2.21-5.482 3.274-12.027 3.274-19.637 0-7.609-1.064-14.155-3.274-19.8-2.127-5.646-5.318-10.064-9.491-13.255-4.174-3.11-9.329-4.746-15.384-4.746s-11.537 1.636-15.792 4.91c-4.173 3.272-7.365 7.772-9.492 13.418-2.128 5.727-3.191 12.191-3.191 19.392 0 7.2 1.063 13.745 3.273 19.228 2.127 5.482 5.318 9.736 9.573 12.764 4.174 3.027 9.41 4.582 15.629 4.582Zm141.56-26.51V71.839h28.23v119.786h-27.412v-21.273h-1.227c-2.7 6.709-7.119 12.191-13.338 16.446-6.137 4.255-13.747 6.382-22.748 6.382-7.855 0-14.81-1.718-20.783-5.237-5.974-3.518-10.72-8.591-14.075-15.382-3.355-6.709-5.073-14.891-5.073-24.464V71.839h28.312v71.921c0 7.609 2.046 13.664 6.219 18.083 4.173 4.5 9.655 6.709 16.365 6.709 4.173 0 8.183-.982 12.111-3.028 3.927-2.045 7.118-5.072 9.655-9.082 2.537-4.091 3.764-9.164 3.764-15.218Zm65.707-109.395v159.796h-28.23V31.828h28.23Zm44.841 162.169c-7.61 0-14.402-1.391-20.457-4.091-6.055-2.7-10.883-6.791-14.32-12.109-3.518-5.319-5.237-11.946-5.237-19.801 0-6.791 1.228-12.355 3.765-16.773 2.536-4.419 5.891-7.937 10.228-10.637 4.337-2.618 9.164-4.664 14.647-6.055 5.4-1.391 11.046-2.373 16.856-3.027 7.037-.737 12.683-1.391 17.102-1.964 4.337-.573 7.528-1.555 9.574-2.782 1.963-1.309 3.027-3.273 3.027-5.973v-.491c0-5.891-1.718-10.391-5.237-13.664-3.518-3.191-8.51-4.828-15.056-4.828-6.955 0-12.356 1.473-16.447 4.5-4.009 3.028-6.71 6.546-8.183 10.719l-26.348-3.764c2.046-7.282 5.483-13.336 10.31-18.328 4.746-4.909 10.638-8.59 17.511-11.045 6.955-2.455 14.565-3.682 22.912-3.682 5.809 0 11.537.654 17.265 2.045s10.965 3.6 15.711 6.71c4.746 3.109 8.51 7.282 11.455 12.6 2.864 5.318 4.337 11.946 4.337 19.883v80.184h-27.166v-16.446h-.9c-1.719 3.355-4.092 6.464-7.201 9.328-3.109 2.864-6.955 5.237-11.619 6.955-4.828 1.718-10.229 2.536-16.529 2.536Zm7.364-20.701c5.646 0 10.556-1.145 14.729-3.354 4.173-2.291 7.364-5.237 9.655-9.001 2.292-3.763 3.355-7.854 3.355-12.273v-14.155c-.9.737-2.373 1.391-4.5 2.046-2.128.654-4.419 1.145-7.037 1.636-2.619.491-5.155.9-7.692 1.227-2.537.328-4.746.655-6.628.901-4.173.572-8.019 1.472-11.292 2.781-3.355 1.31-5.973 3.11-7.855 5.401-1.964 2.291-2.864 5.318-2.864 8.918 0 5.237 1.882 9.164 5.728 11.782 3.682 2.782 8.51 4.091 14.401 4.091Zm64.643 18.328V71.839h27.412v19.965h1.227c2.21-6.955 5.974-12.274 11.292-16.038 5.319-3.763 11.456-5.645 18.329-5.645 1.555 0 3.355.082 5.237.163 1.964.164 3.601.328 4.91.573v25.938c-1.227-.41-3.109-.819-5.646-1.146a58.814 58.814 0 0 0-7.446-.49c-5.155 0-9.738 1.145-13.829 3.354-4.091 2.209-7.282 5.236-9.655 9.164-2.373 3.927-3.519 8.427-3.519 13.5v70.448h-28.312ZM222.077 39.192l-8.019 125.923L137.387 0l84.69 39.192Zm-53.105 162.825-57.933 33.056-57.934-33.056 11.783-28.556h92.301l11.783 28.556ZM111.039 62.675l30.357 73.803H80.681l30.358-73.803ZM7.937 165.115 0 39.192 84.69 0 7.937 165.115Z"
/>
<path
fill="url(#c)"
d="M388.676 191.625h30.849L363.31 31.828h-35.758l-56.215 159.797h30.848l13.174-39.356h60.061l13.256 39.356Zm-65.461-62.675 21.602-64.311h1.227l21.602 64.311h-44.431Zm126.831-7.527v70.202h-28.23V71.839h27.002v20.374h1.392c2.782-6.71 7.2-12.028 13.255-15.956 6.056-3.927 13.584-5.89 22.503-5.89 8.264 0 15.465 1.8 21.684 5.318 6.137 3.518 10.964 8.673 14.319 15.382 3.437 6.71 5.074 14.81 4.992 24.383v76.175h-28.23v-71.92c0-8.019-2.046-14.237-6.219-18.819-4.173-4.5-9.819-6.791-17.102-6.791-4.91 0-9.328 1.063-13.174 3.272-3.846 2.128-6.792 5.237-9.001 9.328-2.046 4.009-3.191 8.918-3.191 14.728ZM589.233 239c-10.147 0-18.82-1.391-26.103-4.091-7.282-2.7-13.092-6.382-17.511-10.964-4.418-4.582-7.528-9.655-9.164-15.219l25.448-6.136c1.145 2.372 2.782 4.663 4.991 6.954 2.209 2.291 5.155 4.255 8.837 5.81 3.683 1.554 8.428 2.291 14.074 2.291 8.019 0 14.647-1.964 19.884-5.81 5.237-3.845 7.856-10.227 7.856-19.064v-22.665h-1.391c-1.473 2.946-3.601 5.892-6.383 9.001-2.782 3.109-6.464 5.645-10.965 7.691-4.582 2.046-10.228 3.109-17.101 3.109-9.165 0-17.511-2.209-25.039-6.545-7.446-4.337-13.42-10.883-17.757-19.474-4.418-8.673-6.628-19.473-6.628-32.565 0-13.091 2.21-24.301 6.628-33.383 4.419-9.082 10.311-15.955 17.839-20.7 7.528-4.746 15.874-7.037 25.039-7.037 7.037 0 12.846 1.145 17.347 3.518 4.582 2.373 8.182 5.236 10.883 8.51 2.7 3.272 4.746 6.382 6.137 9.327h1.554v-19.8h27.821v121.749c0 10.228-2.454 18.737-7.364 25.447-4.91 6.709-11.538 11.7-20.048 15.055-8.509 3.355-18.165 4.991-28.884 4.991Zm.245-71.266c5.974 0 11.047-1.473 15.302-4.337 4.173-2.945 7.446-7.118 9.573-12.519 2.21-5.482 3.274-12.027 3.274-19.637 0-7.609-1.064-14.155-3.274-19.8-2.127-5.646-5.318-10.064-9.491-13.255-4.174-3.11-9.329-4.746-15.384-4.746s-11.537 1.636-15.792 4.91c-4.173 3.272-7.365 7.772-9.492 13.418-2.128 5.727-3.191 12.191-3.191 19.392 0 7.2 1.063 13.745 3.273 19.228 2.127 5.482 5.318 9.736 9.573 12.764 4.174 3.027 9.41 4.582 15.629 4.582Zm141.56-26.51V71.839h28.23v119.786h-27.412v-21.273h-1.227c-2.7 6.709-7.119 12.191-13.338 16.446-6.137 4.255-13.747 6.382-22.748 6.382-7.855 0-14.81-1.718-20.783-5.237-5.974-3.518-10.72-8.591-14.075-15.382-3.355-6.709-5.073-14.891-5.073-24.464V71.839h28.312v71.921c0 7.609 2.046 13.664 6.219 18.083 4.173 4.5 9.655 6.709 16.365 6.709 4.173 0 8.183-.982 12.111-3.028 3.927-2.045 7.118-5.072 9.655-9.082 2.537-4.091 3.764-9.164 3.764-15.218Zm65.707-109.395v159.796h-28.23V31.828h28.23Zm44.841 162.169c-7.61 0-14.402-1.391-20.457-4.091-6.055-2.7-10.883-6.791-14.32-12.109-3.518-5.319-5.237-11.946-5.237-19.801 0-6.791 1.228-12.355 3.765-16.773 2.536-4.419 5.891-7.937 10.228-10.637 4.337-2.618 9.164-4.664 14.647-6.055 5.4-1.391 11.046-2.373 16.856-3.027 7.037-.737 12.683-1.391 17.102-1.964 4.337-.573 7.528-1.555 9.574-2.782 1.963-1.309 3.027-3.273 3.027-5.973v-.491c0-5.891-1.718-10.391-5.237-13.664-3.518-3.191-8.51-4.828-15.056-4.828-6.955 0-12.356 1.473-16.447 4.5-4.009 3.028-6.71 6.546-8.183 10.719l-26.348-3.764c2.046-7.282 5.483-13.336 10.31-18.328 4.746-4.909 10.638-8.59 17.511-11.045 6.955-2.455 14.565-3.682 22.912-3.682 5.809 0 11.537.654 17.265 2.045s10.965 3.6 15.711 6.71c4.746 3.109 8.51 7.282 11.455 12.6 2.864 5.318 4.337 11.946 4.337 19.883v80.184h-27.166v-16.446h-.9c-1.719 3.355-4.092 6.464-7.201 9.328-3.109 2.864-6.955 5.237-11.619 6.955-4.828 1.718-10.229 2.536-16.529 2.536Zm7.364-20.701c5.646 0 10.556-1.145 14.729-3.354 4.173-2.291 7.364-5.237 9.655-9.001 2.292-3.763 3.355-7.854 3.355-12.273v-14.155c-.9.737-2.373 1.391-4.5 2.046-2.128.654-4.419 1.145-7.037 1.636-2.619.491-5.155.9-7.692 1.227-2.537.328-4.746.655-6.628.901-4.173.572-8.019 1.472-11.292 2.781-3.355 1.31-5.973 3.11-7.855 5.401-1.964 2.291-2.864 5.318-2.864 8.918 0 5.237 1.882 9.164 5.728 11.782 3.682 2.782 8.51 4.091 14.401 4.091Zm64.643 18.328V71.839h27.412v19.965h1.227c2.21-6.955 5.974-12.274 11.292-16.038 5.319-3.763 11.456-5.645 18.329-5.645 1.555 0 3.355.082 5.237.163 1.964.164 3.601.328 4.91.573v25.938c-1.227-.41-3.109-.819-5.646-1.146a58.814 58.814 0 0 0-7.446-.49c-5.155 0-9.738 1.145-13.829 3.354-4.091 2.209-7.282 5.236-9.655 9.164-2.373 3.927-3.519 8.427-3.519 13.5v70.448h-28.312ZM222.077 39.192l-8.019 125.923L137.387 0l84.69 39.192Zm-53.105 162.825-57.933 33.056-57.934-33.056 11.783-28.556h92.301l11.783 28.556ZM111.039 62.675l30.357 73.803H80.681l30.358-73.803ZM7.937 165.115 0 39.192 84.69 0 7.937 165.115Z"
/>
</g>
<defs>
<radialGradient
id="c"
cx="0"
cy="0"
r="1"
gradientTransform="rotate(118.122 171.182 60.81) scale(205.794)"
gradientUnits="userSpaceOnUse"
>
<stop stop-color="#FF41F8" />
<stop offset=".707" stop-color="#FF41F8" stop-opacity=".5" />
<stop offset="1" stop-color="#FF41F8" stop-opacity="0" />
</radialGradient>
<linearGradient
id="b"
x1="0"
x2="982"
y1="192"
y2="192"
gradientUnits="userSpaceOnUse"
>
<stop stop-color="#F0060B" />
<stop offset="0" stop-color="#F0070C" />
<stop offset=".526" stop-color="#CC26D5" />
<stop offset="1" stop-color="#7702FF" />
</linearGradient>
<clipPath id="a"><path fill="#fff" d="M0 0h982v239H0z" /></clipPath>
</defs>
</svg>
<h1>Hello, {{ title }}</h1>
<p>Congratulations! Your app is running. 🎉</p>
</div>
<div class="divider" role="separator" aria-label="Divider"></div>
<div class="right-side">
<div class="pill-group">
@for (item of [
{ title: 'Explore the Docs', link: 'https://angular.dev' },
{ title: 'Learn with Tutorials', link: 'https://angular.dev/tutorials' },
{ title: 'CLI Docs', link: 'https://angular.dev/tools/cli' },
{ title: 'Angular Language Service', link: 'https://angular.dev/tools/language-service' },
{ title: 'Angular DevTools', link: 'https://angular.dev/tools/devtools' },
]; track item.title) {
<a
class="pill"
[href]="item.link"
target="_blank"
rel="noopener"
>
<span>{{ item.title }}</span>
<svg
xmlns="http://www.w3.org/2000/svg"
height="14"
viewBox="0 -960 960 960"
width="14"
fill="currentColor"
>
<path
d="M200-120q-33 0-56.5-23.5T120-200v-560q0-33 23.5-56.5T200-840h280v80H200v560h560v-280h80v280q0 33-23.5 56.5T760-120H200Zm188-212-56-56 372-372H560v-80h280v280h-80v-144L388-332Z"
/>
</svg>
</a>
}
</div>
<div class="social-links">
<a
href="https://github.com/angular/angular"
aria-label="Github"
target="_blank"
rel="noopener"
>
<svg
width="25"
height="24"
viewBox="0 0 25 24"
fill="none"
xmlns="http://www.w3.org/2000/svg"
alt="Github"
>
<path
d="M12.3047 0C5.50634 0 0 5.50942 0 12.3047C0 17.7423 3.52529 22.3535 8.41332 23.9787C9.02856 24.0946 9.25414 23.7142 9.25414 23.3871C9.25414 23.0949 9.24389 22.3207 9.23876 21.2953C5.81601 22.0377 5.09414 19.6444 5.09414 19.6444C4.53427 18.2243 3.72524 17.8449 3.72524 17.8449C2.61064 17.082 3.81137 17.0973 3.81137 17.0973C5.04697 17.1835 5.69604 18.3647 5.69604 18.3647C6.79321 20.2463 8.57636 19.7029 9.27978 19.3881C9.39052 18.5924 9.70736 18.0499 10.0591 17.7423C7.32641 17.4347 4.45429 16.3765 4.45429 11.6618C4.45429 10.3185 4.9311 9.22133 5.72065 8.36C5.58222 8.04931 5.16694 6.79833 5.82831 5.10337C5.82831 5.10337 6.85883 4.77319 9.2121 6.36459C10.1965 6.09082 11.2424 5.95546 12.2883 5.94931C13.3342 5.95546 14.3801 6.09082 15.3644 6.36459C17.7023 4.77319 18.7328 5.10337 18.7328 5.10337C19.3942 6.79833 18.9789 8.04931 18.8559 8.36C19.6403 9.22133 20.1171 10.3185 20.1171 11.6618C20.1171 16.3888 17.2409 17.4296 14.5031 17.7321C14.9338 18.1012 15.3337 18.8559 15.3337 20.0084C15.3337 21.6552 15.3183 22.978 15.3183 23.3779C15.3183 23.7009 15.5336 24.0854 16.1642 23.9623C21.0871 22.3484 24.6094 17.7341 24.6094 12.3047C24.6094 5.50942 19.0999 0 12.3047 0Z"
/>
</svg>
</a>
<a
href="https://twitter.com/angular"
aria-label="Twitter"
target="_blank"
rel="noopener"
>
<svg
width="24"
height="24"
viewBox="0 0 24 24"
fill="none"
xmlns="http://www.w3.org/2000/svg"
alt="Twitter"
>
<path
d="M18.244 2.25h3.308l-7.227 8.26 8.502 11.24H16.17l-5.214-6.817L4.99 21.75H1.68l7.73-8.835L1.254 2.25H8.08l4.713 6.231zm-1.161 17.52h1.833L7.084 4.126H5.117z"
/>
</svg>
</a>
<a
href="https://www.youtube.com/channel/UCbn1OgGei-DV7aSRo_HaAiw"
aria-label="Youtube"
target="_blank"
rel="noopener"
>
<svg
width="29"
height="20"
viewBox="0 0 29 20"
fill="none"
xmlns="http://www.w3.org/2000/svg"
alt="Youtube"
>
<path
fill-rule="evenodd"
clip-rule="evenodd"
d="M27.4896 1.52422C27.9301 1.96749 28.2463 2.51866 28.4068 3.12258C29.0004 5.35161 29.0004 10 29.0004 10C29.0004 10 29.0004 14.6484 28.4068 16.8774C28.2463 17.4813 27.9301 18.0325 27.4896 18.4758C27.0492 18.9191 26.5 19.2389 25.8972 19.4032C23.6778 20 14.8068 20 14.8068 20C14.8068 20 5.93586 20 3.71651 19.4032C3.11363 19.2389 2.56449 18.9191 2.12405 18.4758C1.68361 18.0325 1.36732 17.4813 1.20683 16.8774C0.613281 14.6484 0.613281 10 0.613281 10C0.613281 10 0.613281 5.35161 1.20683 3.12258C1.36732 2.51866 1.68361 1.96749 2.12405 1.52422C2.56449 1.08095 3.11363 0.76113 3.71651 0.596774C5.93586 0 14.8068 0 14.8068 0C14.8068 0 23.6778 0 25.8972 0.596774C26.5 0.76113 27.0492 1.08095 27.4896 1.52422ZM19.3229 10L11.9036 5.77905V14.221L19.3229 10Z"
/>
</svg>
</a>
</div>
</div>
</div>
</main>
<!-- * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * -->
<!-- * * * * * * * * * * * The content above * * * * * * * * * * * * -->
<!-- * * * * * * * * * * is only a placeholder * * * * * * * * * * * -->
<!-- * * * * * * * * * * and can be replaced. * * * * * * * * * * * -->
<!-- * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * -->
<!-- * * * * * * * * * * End of Placeholder * * * * * * * * * * * * -->
<!-- * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * -->
<router-outlet />

View File

@@ -0,0 +1,9 @@
html {
background-color: #222222;
}
tui-root {
background-color: #222222;
}

View File

@@ -1,9 +1,12 @@
import {TuiRoot} from "@taiga-ui/core";
import {Component} from '@angular/core'; import {Component} from '@angular/core';
import {RouterOutlet} from '@angular/router'; import {RouterOutlet} from '@angular/router';
@Component({ @Component({
selector: 'app-root', selector: 'app-root',
imports: [RouterOutlet], imports: [RouterOutlet,
TuiRoot,
TuiRoot],
templateUrl: './app.component.html', templateUrl: './app.component.html',
styleUrl: './app.component.scss' styleUrl: './app.component.scss'
}) })

View File

@@ -1,8 +1,12 @@
import {NG_EVENT_PLUGINS} from "@taiga-ui/event-plugins";
import {provideAnimations} from "@angular/platform-browser/animations";
import {ApplicationConfig, provideZoneChangeDetection} from '@angular/core'; import {ApplicationConfig, provideZoneChangeDetection} from '@angular/core';
import { provideRouter } from '@angular/router'; import {provideRouter, withHashLocation} from '@angular/router';
import {routes} from './app.routes'; import {routes} from './app.routes';
import {provideHttpClient, withInterceptors, withInterceptorsFromDi} from '@angular/common/http';
import {AuthInterceptor} from './interceptors/auth-interceptor';
export const appConfig: ApplicationConfig = { export const appConfig: ApplicationConfig = {
providers: [provideZoneChangeDetection({ eventCoalescing: true }), provideRouter(routes)] providers: [provideAnimations(), provideZoneChangeDetection({eventCoalescing: true}), provideRouter(routes, withHashLocation()), provideHttpClient(withInterceptorsFromDi()), NG_EVENT_PLUGINS, NG_EVENT_PLUGINS, provideHttpClient(withInterceptors([AuthInterceptor]))],
}; };

View File

@@ -1,3 +1,28 @@
import {Routes} from '@angular/router'; import {Routes} from '@angular/router';
import {AgendaComponent} from './pages/agenda/agenda.component';
import {LoginComponent} from './pages/login/login.component';
import {HomeComponent} from './pages/home/home.component';
import {KlantenComponent} from './pages/klanten/klanten.component';
export const routes: Routes = []; export const routes: Routes = [
{path: '', redirectTo: 'login', pathMatch: 'full'},
{path: 'login', component: LoginComponent},
{
path: 'home',
component: HomeComponent,
children: [
{
path: 'agenda',
component: AgendaComponent,
},
{
path: 'klanten',
component: KlantenComponent,
},
// {
// path: 'dashboard',
// component: DashboardComponent,
// },
],
},
];

View File

@@ -0,0 +1,19 @@
<h2>
<tui-icon
icon="@tui.user"
[style.color]="'var(--tui-background-accent-1)'"/>
{{ customer.firstName }} {{ customer.lastName }}
</h2>
<h2>
<tui-icon
icon="@tui.mail"
[style.color]="'var(--tui-background-accent-1)'"/>
{{ customer.email }}
</h2>
<ng-template *ngIf="appointment">
<br>
<h2>
Eerst volgende afspraak:
</h2>
<h2>{{ appointment.startDate }}</h2>
</ng-template>

View File

@@ -0,0 +1,37 @@
import {Component, Input, OnInit} from '@angular/core';
import {ReactiveFormsModule} from "@angular/forms";
import {TuiIcon} from "@taiga-ui/core";
import {TuiTextareaModule} from "@taiga-ui/legacy";
import {Customer} from '../../models/customer';
import {AppointmentService} from '../../services/appointment.service';
import {Appointment} from '../../models/appointment';
import {DateFormatter} from '../../utils/date-formatter';
import {NgIf} from '@angular/common';
@Component({
selector: 'app-customer-details',
imports: [
ReactiveFormsModule,
TuiIcon,
TuiTextareaModule,
NgIf
],
templateUrl: './customer-details.component.html',
styleUrl: './customer-details.component.scss'
})
export class CustomerDetailsComponent implements OnInit {
@Input() customer: Customer;
appointment: Appointment;
constructor(private appointmentService: AppointmentService) {
}
ngOnInit(): void {
this.appointmentService.getMostRecentAppointment(this.customer.id).subscribe((response: Appointment) =>
this.appointment = response
)
}
protected readonly DateFormatter = DateFormatter;
}

View File

@@ -0,0 +1,80 @@
<h2>
<tui-icon
icon="@tui.calendar"
[style.color]="'var(--tui-background-accent-1)'"/>
{{ DateFormatter.getDate(appointment.startDate.toString()) }}
</h2>
<h2>
<tui-icon
icon="@tui.clock"
[style.color]="'var(--tui-background-accent-1)'"/>
{{ DateFormatter.getFormattedTime(appointment.startHour, appointment.startMinute) }}
- {{ DateFormatter.getFormattedTime(appointment.endHour, appointment.endMinute) }}
</h2>
<h2 *ngIf="appointment.customer">
<tui-icon
icon="@tui.user"
[style.color]="'var(--tui-background-accent-1)'"/>
{{ appointment.customer.firstName }} {{ appointment.customer.lastName }}
</h2>
<form [formGroup]="testForm" *ngIf="appointment.description">
<tui-textarea formControlName="testValue1" [readOnly]="readonly">Notities</tui-textarea>
</form>
<div
tuiGroup
class="group"
[collapsed]="true">
<button
appearance="outline"
tuiButton
iconStart="@tui.pencil"
size="s"
(click)="showEditModal = true"
type="button">
Bewerken
</button>
<button
appearance="outline"
tuiButton
iconStart="@tui.trash-2"
size="s"
(click)="showDeleteModal = true"
type="button">
Verwijderen
</button>
</div>
<app-modal [title]="appointment.title + ' verwijderen'" *ngIf="showDeleteModal" (close)="showDeleteModal = false">
<h3>Weet je dit zeker?</h3>
<br>
<div
tuiGroup
class="group"
[collapsed]="true">
<button
appearance="outline"
tuiButton
size="s"
(click)="deleteAppointment()"
type="button">
Ja, afspraak verwijderen
</button>
<button
appearance="outline"
tuiButton
size="s"
(click)="showDeleteModal = false"
type="button">
Nee, ga terug
</button>
</div>
</app-modal>
<app-modal [title]="'Afspraak bewerken'" *ngIf="showEditModal" (close)="showEditModal = false">
<app-edit-item [appointment]="appointment" (appointmentUpdateEvent)="updateAppointment($event)"></app-edit-item>
</app-modal>

View File

@@ -0,0 +1,74 @@
import {Component, EventEmitter, inject, Input, OnInit, Output} from '@angular/core';
import {Appointment} from '../../models/appointment';
import {DateFormatter} from '../../utils/date-formatter';
import {TuiAlertService, TuiButton, TuiGroup, TuiIcon} from '@taiga-ui/core';
import {TuiTextareaModule} from '@taiga-ui/legacy';
import {FormControl, FormGroup, ReactiveFormsModule, Validators} from '@angular/forms';
import {NgIf} from '@angular/common';
import {ModalComponent} from '../modal/modal.component';
import {EditItemComponent} from '../edit-item/edit-item.component';
import {AppointmentService} from '../../services/appointment.service';
@Component({
selector: 'app-details',
imports: [
TuiIcon,
TuiTextareaModule,
ReactiveFormsModule,
NgIf,
TuiButton,
TuiGroup,
ModalComponent,
EditItemComponent
],
templateUrl: './details.component.html',
styleUrl: './details.component.scss'
})
export class DetailsComponent implements OnInit {
private readonly alerts = inject(TuiAlertService);
ngOnInit(): void {
if (this.appointment.description) {
this.testForm.get('testValue1').setValue(this.appointment.description)
}
}
constructor(private appointmentService: AppointmentService) {
}
@Input() appointment: Appointment;
@Output() appointmentDeleted = new EventEmitter<Appointment>();
@Output() appointmentEdited = new EventEmitter<Appointment>();
open: boolean = true;
readonly = true;
showDeleteModal = false;
showEditModal = false;
protected testForm = new FormGroup({
testValue1: new FormControl('', Validators.required),
testValue2: new FormControl('This one can be expanded', Validators.required),
testValue3: new FormControl(
'This one can be expanded (expandable on focus)',
Validators.required,
),
});
deleteAppointment() {
this.appointmentService.deleteAppointment(this.appointment).subscribe(() => {
this.showDeleteModal = false;
this.appointmentDeleted.emit(this.appointment);
}
)
}
protected readonly DateFormatter = DateFormatter;
updateAppointment($event: any) {
this.showEditModal = false;
this.appointmentService.getAppointment($event).subscribe((appointment: Appointment) => {
this.appointment = appointment
this.appointmentEdited.emit(this.appointment);
})
}
}

View File

@@ -0,0 +1,149 @@
<form [formGroup]="testForm">
<tui-input formControlName="title">
Titel
<input
tuiTextfieldLegacy
formControlName="title"
type="text"
/>
</tui-input>
<div
*ngIf="testForm.get('title').value == ''"
tuiGroup
class="group"
[collapsed]="true">
<button
*ngFor="let action of quickActions"
appearance="outline"
tuiButton
size="s"
(click)="addAction(action)"
type="button">{{ action }}
</button>
</div>
<br>
<div class="toolbar">
<tui-combo-box
[formControl]="control"
[stringify]="stringify"
tuiTextfieldSize="m">
Klant
<tui-data-list-wrapper
*tuiDataList
[itemContent]="stringify | tuiStringifyContent"
[items]="items | tuiFilterByInput"
/>
</tui-combo-box>
<button
size="m"
tuiButton
(click)="toggleCustomerModal()"
iconStart="@tui.plus"
type="button">
</button>
</div>
<br>
<div
tuiGroup
class="group"
>
<div>
<tui-input-date
formControlName="date"
tuiTextfieldSize="m"
class="tui-space_vertical-4"
[tuiTextfieldLabelOutside]="false"
>
Datum
</tui-input-date>
</div>
<div>
<tui-input-time
formControlName="startTime"
tuiTextfieldSize="m"
class="tui-space_top-2"
[tuiTextfieldLabelOutside]="false">
Van
</tui-input-time>
</div>
<div>
<tui-input-time
formControlName="endTime"
tuiTextfieldSize="m"
class="tui-space_top-2"
[tuiTextfieldLabelOutside]="false"
>
Tot
</tui-input-time>
</div>
</div>
<br>
<tui-textarea formControlName="notes">Notities</tui-textarea>
</form>
<br>
<button
size="m"
tuiButton
type="button" (click)="updateAppointment()"
[tuiAppearanceState]="formIsValid()">
Afspraak bewerken
</button>
<app-modal title="Nieuwe klant" *ngIf="showNewCustomer" (close)="toggleCustomerModal()">
<form [formGroup]="customerForm">
<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>

View File

@@ -0,0 +1,15 @@
.toolbar {
button {
margin-left: 8px;
}
tui-combo-box {
width: 50vw;
}
margin-bottom: 12px;
display: flex;
flex-direction: row;
justify-content: center;
}

View File

@@ -0,0 +1,146 @@
import {Component, EventEmitter, inject, Input, OnInit, Output} from '@angular/core';
import {NgForOf, NgIf} from "@angular/common";
import {FormControl, FormGroup, ReactiveFormsModule, Validators} from "@angular/forms";
import {TuiAlertService, TuiButton, TuiGroup, TuiIcon} from "@taiga-ui/core";
import {
TuiComboBoxModule,
TuiInputDateModule,
TuiInputModule,
TuiInputTimeModule,
TuiTextareaModule,
TuiTextfieldControllerModule
} from "@taiga-ui/legacy";
import {Appointment} from '../../models/appointment';
import {TuiDay, TuiTime} from '@taiga-ui/cdk';
import {AppointmentService} from '../../services/appointment.service';
import {TuiDataListWrapperComponent, TuiFilterByInputPipe, TuiStringifyContentPipe} from '@taiga-ui/kit';
import {Customer} from '../../models/customer';
import {CustomerService} from '../../services/customer.service';
import {ModalComponent} from '../modal/modal.component';
@Component({
selector: 'app-edit-item',
imports: [
NgForOf,
NgIf,
ReactiveFormsModule,
TuiButton,
TuiGroup,
TuiInputDateModule,
TuiInputModule,
TuiInputTimeModule,
TuiTextareaModule,
TuiTextfieldControllerModule,
TuiComboBoxModule,
TuiDataListWrapperComponent,
TuiStringifyContentPipe,
TuiFilterByInputPipe,
ModalComponent,
TuiIcon
],
templateUrl: './edit-item.component.html',
styleUrl: './edit-item.component.scss'
})
export class EditItemComponent implements OnInit {
@Input() appointment: Appointment;
testForm: FormGroup;
quickActions = ['Knippen', 'Kleuren', 'Knippen + Kleuren']
waiting: boolean = false;
protected value: TuiDay | null = null;
@Output() appointmentUpdateEvent = new EventEmitter();
showNewCustomer = false;
customerForm: FormGroup;
private readonly alerts = inject(TuiAlertService);
constructor(private appointmentService: AppointmentService, private customerService: CustomerService) {
}
ngOnInit(): void {
console.log(this.appointment);
let date = new Date(this.appointment.startDate);
this.testForm = new FormGroup({
title: new FormControl(this.appointment.title, Validators.required),
notes: new FormControl(this.appointment.description),
startTime: new FormControl(new TuiTime(this.appointment.startHour, this.appointment.startMinute), Validators.required),
endTime: new FormControl(new TuiTime(this.appointment.endHour, this.appointment.endMinute), Validators.required),
date: new FormControl(new TuiDay(date.getFullYear(), date.getMonth(), date.getDate()), Validators.required),
})
this.control = new FormControl(this.appointment.customer)
this.getCustomers()
this.customerForm = new FormGroup({
firstName: new FormControl('', Validators.required),
lastName: new FormControl('', Validators.required),
email: new FormControl('', Validators.required),
})
}
updateAppointment() {
const title = this.testForm.get('title').value
const description = this.testForm.get('notes').value
const startTime = this.testForm.get('startTime').value
const endTime = this.testForm.get('endTime').value
let date = this.testForm.get('date').value
let correctDate = new Date(date.year, date.month, date.day + 1)
const customer = this.control.value;
this.appointment.startDate = correctDate;
this.appointment.title = title;
this.appointment.description = description
this.appointment.startHour = startTime.hours
this.appointment.startMinute = startTime.minutes
this.appointment.endHour = endTime.hours
this.appointment.endMinute = endTime.minutes
this.appointment.customer = customer;
this.appointment.durationInMinutes = (this.appointment.endHour * 60 + this.appointment.endMinute) - (this.appointment.startHour * 60 + this.appointment.startMinute);
this.waiting = true
this.appointmentService.updateAppointment(this.appointment).subscribe(() => {
this.waiting = false
this.appointmentUpdateEvent.emit(this.appointment.id)
this.alerts.open(`Afspraak <strong>${title}</strong> is aangepast.`)
.subscribe();
})
}
formIsValid() {
return this.testForm.valid ? 'active' : 'disabled'
}
addAction(action: string) {
this.testForm.get('title').setValue(`${action} `)
}
protected control = new FormControl<Customer | null>(
null,
);
toggleCustomerModal() {
this.showNewCustomer = !this.showNewCustomer;
}
protected items: Customer[] = [];
protected readonly stringify = (item: Customer): string =>
`${item.firstName} ${item.lastName}`;
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.getCustomers()
})
}
getCustomers() {
this.customerService.getCustomers().subscribe(response => {
this.items = response;
})
}
}

View File

@@ -0,0 +1,20 @@
<div class="modal-overlay" (click)="closeModal()"></div>
<div class="modal">
<div class="modal-header">
<h1>{{ title }}</h1>
<button
appearance="secondary-destructive"
iconStart="@tui.x"
size="xs"
tuiIconButton
type="button"
[style.border-radius.%]="100"
(click)="closeModal()"
>
Favorite
</button>
</div>
<div class="modal-content">
<ng-content></ng-content>
</div>
</div>

View File

@@ -0,0 +1,42 @@
/* Overlay achtergrond */
.modal-overlay {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
background: rgba(0, 0, 0, 0.5); /* Donkere overlay */
backdrop-filter: blur(5px); /* Maakt de achtergrond wazig */
z-index: 998; /* Zorgt dat het onder de modal blijft */
}
/* Modal venster */
.modal {
position: fixed;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
background: white;
padding: 20px;
box-shadow: 0px 4px 6px rgba(0, 0, 0, 0.1);
border-radius: 8px;
min-width: 300px;
width: 50vw;
z-index: 999; /* Zorgt dat het boven de overlay blijft */
}
/* Modal header */
.modal-header {
display: flex;
justify-content: space-between;
align-items: center;
}
/* Sluitknop */
button {
background: red;
color: white;
border: none;
padding: 5px 10px;
cursor: pointer;
}

View File

@@ -0,0 +1,23 @@
import {ComponentFixture, TestBed} from '@angular/core/testing';
import {ModalComponent} from './modal.component';
describe('ModalComponent', () => {
let component: ModalComponent;
let fixture: ComponentFixture<ModalComponent>;
beforeEach(async () => {
await TestBed.configureTestingModule({
imports: [ModalComponent]
})
.compileComponents();
fixture = TestBed.createComponent(ModalComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});

View File

@@ -0,0 +1,17 @@
import {Component, EventEmitter, Input, Output} from '@angular/core';
import {TuiButton} from '@taiga-ui/core';
@Component({
selector: 'app-modal',
imports: [TuiButton],
templateUrl: './modal.component.html',
styleUrls: ['./modal.component.scss']
})
export class ModalComponent {
@Input() title: string = 'Modal Title';
@Output() close = new EventEmitter<void>();
closeModal() {
this.close.emit();
}
}

View File

@@ -0,0 +1,150 @@
<form [formGroup]="testForm">
<tui-input formControlName="title">
Titel
<input
tuiTextfieldLegacy
formControlName="title"
type="text"
/>
</tui-input>
<div
*ngIf="testForm.get('title').value == ''"
tuiGroup
class="group"
[collapsed]="true">
<button
*ngFor="let action of quickActions"
appearance="outline"
tuiButton
size="s"
(click)="addAction(action)"
type="button">{{ action }}
</button>
</div>
<br>
<div class="toolbar">
<tui-combo-box
[formControl]="control"
[stringify]="stringify"
tuiTextfieldSize="m">
Klant
<tui-data-list-wrapper
*tuiDataList
[itemContent]="stringify | tuiStringifyContent"
[items]="items | tuiFilterByInput"
/>
</tui-combo-box>
<button
size="m"
tuiButton
(click)="toggleCustomerModal()"
iconStart="@tui.plus"
type="button">
</button>
</div>
<br>
<div
tuiGroup
class="group"
>
<div>
<tui-input-date
formControlName="date"
tuiTextfieldSize="m"
class="tui-space_vertical-4"
[tuiTextfieldLabelOutside]="false"
>
Datum
</tui-input-date>
</div>
<div>
<tui-input-time
formControlName="startTime"
tuiTextfieldSize="m"
class="tui-space_top-2"
[tuiTextfieldLabelOutside]="false">
Van
</tui-input-time>
</div>
<div>
<tui-input-time
formControlName="endTime"
tuiTextfieldSize="m"
class="tui-space_top-2"
[tuiTextfieldLabelOutside]="false"
>
Tot
</tui-input-time>
</div>
</div>
<br>
<tui-textarea formControlName="notes">Notities</tui-textarea>
</form>
<br>
<button
size="m"
tuiButton
type="button" (click)="registerAppointment()"
[tuiAppearanceState]="formIsValid()">
Afspraak maken
</button>
<app-modal title="Nieuwe klant" *ngIf="showNewCustomer" (close)="toggleCustomerModal()">
<form [formGroup]="customerForm">
<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>

View File

@@ -0,0 +1,15 @@
.toolbar {
button {
margin-left: 8px;
}
tui-combo-box {
width: 50vw;
}
margin-bottom: 12px;
display: flex;
flex-direction: row;
justify-content: center;
}

View File

@@ -0,0 +1,128 @@
import {Component, EventEmitter, Input, OnInit, Output} from '@angular/core';
import {NgForOf, NgIf} from "@angular/common";
import {FormControl, FormGroup, ReactiveFormsModule, Validators} from "@angular/forms";
import {TuiButton, TuiGroup, TuiIcon} from "@taiga-ui/core";
import {
TuiComboBoxModule,
TuiInputDateModule,
TuiInputModule,
TuiInputTimeModule,
TuiTextareaModule,
TuiTextfieldControllerModule
} from "@taiga-ui/legacy";
import {Appointment} from '../../models/appointment';
import {TuiDay} from '@taiga-ui/cdk';
import {AppointmentService} from '../../services/appointment.service';
import {
TuiButtonLoading,
TuiDataListWrapperComponent,
TuiFilterByInputPipe,
TuiStringifyContentPipe
} from '@taiga-ui/kit';
import {Customer} from '../../models/customer';
import {CustomerService} from '../../services/customer.service';
import {ModalComponent} from '../modal/modal.component';
@Component({
selector: 'app-new-item',
imports: [
NgForOf,
NgIf,
ReactiveFormsModule,
TuiButton,
TuiGroup,
TuiInputDateModule,
TuiInputModule,
TuiInputTimeModule,
TuiTextareaModule,
TuiTextfieldControllerModule,
TuiComboBoxModule,
TuiDataListWrapperComponent,
TuiStringifyContentPipe,
TuiFilterByInputPipe,
ModalComponent,
TuiIcon,
TuiButtonLoading
],
templateUrl: './new-item.component.html',
styleUrl: './new-item.component.scss'
})
export class NewItemComponent implements OnInit {
@Input() testForm: FormGroup;
quickActions = ['Knippen', 'Kleuren', 'Knippen + Kleuren']
waiting: boolean = false;
protected value: TuiDay | null = null;
@Output() appointmentAddedEvent = new EventEmitter();
showNewCustomer = false;
customerForm: FormGroup;
constructor(private appointmentService: AppointmentService, private customerService: CustomerService) {
}
ngOnInit(): void {
this.getCustomers()
this.customerForm = new FormGroup({
firstName: new FormControl('', Validators.required),
lastName: new FormControl('', Validators.required),
email: new FormControl('', Validators.required),
})
}
registerAppointment() {
const title = this.testForm.get('title').value
const description = this.testForm.get('notes').value
const startTime = this.testForm.get('startTime').value
const endTime = this.testForm.get('endTime').value
let date = this.testForm.get('date').value
let correctDate = new Date(date.year, date.month, date.day, startTime.hours, startTime.minutes);
const customer = this.control.value;
const appointment = new Appointment(title, description, startTime.hours, startTime.minutes, endTime.hours, endTime.minutes, correctDate, customer)
this.waiting = true
this.appointmentService.addAppointment(appointment).subscribe(() => {
this.waiting = false
this.appointmentAddedEvent.emit(title)
})
}
formIsValid() {
return this.testForm.valid ? 'active' : 'disabled'
}
addAction(action: string) {
this.testForm.get('title').setValue(`${action} `)
}
protected readonly control = new FormControl<Customer | null>(
null,
);
toggleCustomerModal() {
this.showNewCustomer = !this.showNewCustomer;
}
protected items: Customer[] = [];
protected readonly stringify = (item: Customer): string =>
`${item.firstName} ${item.lastName}`;
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.getCustomers()
})
}
getCustomers() {
this.customerService.getCustomers().subscribe(response => {
this.items = response;
})
}
}

View File

@@ -0,0 +1,25 @@
import { HttpInterceptorFn } from '@angular/common/http';
import { inject } from '@angular/core';
import {AuthService} from '../services/auth.service';
const excludedUrls = ['/auth/login'];
export const AuthInterceptor: HttpInterceptorFn = (req, next) => {
const authService = inject(AuthService);
const token = authService.getToken();
if (excludedUrls.some(url => req.url.includes(url))) {
return next(req);
}
if (token) {
const cloned = req.clone({
setHeaders: {
Authorization: `Bearer ${token}`
}
});
return next(cloned);
}
return next(req);
};

View File

@@ -0,0 +1,31 @@
import {Customer} from './customer';
export class Appointment {
id: string;
title: string;
description: string;
startDate: Date;
startHour: number;
startMinute: number;
endHour: number;
endMinute: number;
durationInMinutes: number;
customer: Customer;
constructor(title: string, description: string, startHour: number, startMinute: number, endHour: number, endMinute: number, date: Date, customer: Customer) {
this.title = title;
this.description = description;
this.startHour = startHour;
this.startMinute = startMinute;
this.endHour = endHour;
this.endMinute = endMinute;
this.startDate = date;
this.customer = customer;
console.log(this)
// Bereken de totale duur in minuten
this.durationInMinutes = (endHour * 60 + endMinute) - (startHour * 60 + startMinute);
}
}

View File

@@ -0,0 +1,13 @@
export class Customer {
id: number;
firstName: string;
lastName: string;
email: string;
constructor(firstName: string, lastName: string, email: string) {
this.firstName = firstName;
this.lastName = lastName;
this.email = email;
}
}

View File

@@ -0,0 +1,9 @@
export class UserDto {
username:string
fullName:string
email:string
token:string
constructor() {
}
}

11
src/app/models/user.ts Normal file
View File

@@ -0,0 +1,11 @@
export class User {
email: string;
exp: number;
firstName: string;
iat: number;
iss: string;
jti: string;
lastName: string;
sub: string;
username: string;
}

View File

@@ -0,0 +1,9 @@
export enum WeekDay {
zondag = 0,
maandag = 1,
dinsdag = 2,
woensdag = 3,
donderdag = 4,
vrijdag = 5,
zaterdag = 6,
}

View File

@@ -0,0 +1,84 @@
<div class="container">
<div class="heading">
<button
appearance="primary"
iconStart="@tui.chevron-left"
size="m"
tuiIconButton
(click)="previousDay()"
type="button">
</button>
<h1 class="date" (click)="toggleCalendar()">{{ getDate() }}</h1>
<button
appearance="primary"
iconStart="@tui.chevron-right"
size="m"
tuiIconButton
(click)="nextDay()"
type="button">
</button>
</div>
<div class="calendar" *ngIf="showCalendar">
<tui-calendar
[value]="value"
(dayClick)="onDayClick($event)"
/>
</div>
<div class="toolbar">
<button
*ngIf="today.getDate() != selectedDate.getDate()"
appearance="secondary"
size="m"
tuiButton
(click)="setToday()"
type="button">
Vandaag
</button>
<button
appearance="secondary"
size="m"
tuiButton
(click)="isModalOpen = true"
type="button">
<tui-icon
icon="@tui.plus"
[style.height.rem]="1"
/>
Afspraak maken
</button>
</div>
<div class="content">
<div class="agenda-container">
<div *ngFor="let hour of timeSlots" class="time-slot">
<span class="time">{{ hour.toString().padStart(2, '0') }}:00</span>
<div *ngFor="let appointment of getAppointmentsForHour(hour)"
class="appointment"
(click)="selectAppointment(appointment)"
[ngClass]="{ 'large': (getAppointmentHeight(appointment) > 50) }"
[ngStyle]="getInlineStyles(appointment)">
<strong>{{ appointment.title }}</strong>
<span class="appointment-time" *ngIf="appointment.customer">
<tui-icon icon="@tui.user" [style.font-size.rem]="1"></tui-icon>
{{ appointment.customer.firstName }} {{ appointment.customer.lastName }}</span>
<span class="appointment-time">
<tui-icon icon="@tui.clock" [style.font-size.rem]="1"></tui-icon>
{{ getFormattedTime(appointment.startHour, appointment.startMinute) }}
- {{ getFormattedTime(appointment.endHour, appointment.endMinute) }}
</span>
</div>
</div>
</div>
</div>
</div>
<app-modal title="Nieuwe afspraak" (close)="closeNewItemModal()" *ngIf="isModalOpen">
<app-new-item [testForm]="appointmentForm" (appointmentAddedEvent)="registerAppointment($event)"></app-new-item>
</app-modal>
<app-modal title="{{selectedAppointment.title}}" (close)="selectedAppointment = undefined"
*ngIf="selectedAppointment != undefined">
<app-details [appointment]="selectedAppointment" (appointmentDeleted)="appointmentIsDeleted($event)"
(appointmentEdited)="appointmentIsEdited($event)"></app-details>
</app-modal>

View File

@@ -0,0 +1,141 @@
.container {
max-width: 800px;
margin: 0 auto;
padding: 20px;
}
ul {
list-style-type: none;
padding: 0;
}
li {
background-color: #f9f9f9;
margin: 10px 0;
padding: 10px;
border-radius: 5px;
}
h2 {
margin: 0;
}
p {
margin: 5px 0 0;
}
.heading {
margin-bottom: 12px;
display: flex;
flex-direction: row;
justify-content: space-between;
}
.calendar {
margin-bottom: 12px;
display: flex;
flex-direction: row;
justify-content: center;
}
.time-slot {
height: 25px;
display: flex;
align-items: center;
font-size: 14px;
background: #f9f9f9;
transition: background 0.3s ease;
}
.time-slot.claimed {
background: #d1e7dd; /* Lichtgroene achtergrond voor gereserveerde blokken */
color: #155724;
font-weight: bold;
}
.time-slot:nth-child(odd) {
background: #ececec;
}
.time {
width: 50px;
font-weight: bold;
margin-top: 20px;
margin-left: 8px;
}
.content {
overflow-y: scroll;
max-height: 70vh;
}
.agenda-container {
display: flex;
flex-direction: column;
border: 1px solid #ddd;
position: relative;
}
.time-slot {
position: relative;
border-bottom: 1px solid #ccc;
height: 59px;
display: flex;
flex-direction: column;
align-items: flex-start;
font-size: 16px;
background: #f9f9f9;
}
.appointment {
position: absolute;
left: 80px;
width: calc(100% - 100px);
background: #1e88e5;
color: white;
border-radius: 4px;
border-left: 5px solid #1565c0;
box-shadow: 2px 2px 5px rgba(0, 0, 0, 0.2);
z-index: 10;
cursor: pointer;
display: grid;
grid-auto-flow: column;
align-items: center;
//gap: 5px;
min-height: 20px;
}
.appointment.large {
grid-auto-flow: row;
align-items: flex-start;
}
strong, p {
margin-left: 8px;
}
.appointment-time {
margin-left: 8px;
}
.toolbar {
button {
margin-left: 8px;
}
margin-bottom: 12px;
display: flex;
flex-direction: row;
justify-content: center;
}
.date {
cursor: pointer;
}
.date:hover {
text-decoration: underline;
}

View File

@@ -0,0 +1,206 @@
import {Component, inject, OnInit} from '@angular/core';
import {CommonModule, NgFor, NgIf} from '@angular/common';
import {TuiAlertService, TuiButton, TuiCalendar, tuiDateFormatProvider, TuiIcon} from '@taiga-ui/core';
import {Appointment} from '../../models/appointment';
import {ModalComponent} from '../../components/modal/modal.component';
import {FormControl, FormGroup, ReactiveFormsModule, Validators} from '@angular/forms';
import {
TuiInputDateModule,
TuiInputModule,
TuiInputTimeModule,
TuiTextareaModule,
TuiTextfieldControllerModule
} from '@taiga-ui/legacy';
import {TuiDay, TuiTime} from '@taiga-ui/cdk';
import {AppointmentService} from '../../services/appointment.service';
import {DetailsComponent} from '../../components/details/details.component';
import {DateFormatter} from '../../utils/date-formatter';
import {WeekDay} from '../../models/week-day';
import {NewItemComponent} from '../../components/new-item/new-item.component';
@Component({
selector: 'app-agenda',
imports: [NgFor,
TuiButton, CommonModule, NgIf, ModalComponent, ReactiveFormsModule,
TuiInputTimeModule, TuiTextfieldControllerModule,
TuiInputModule, TuiTextareaModule, TuiInputDateModule, TuiIcon, DetailsComponent, TuiCalendar, NewItemComponent],
templateUrl: './agenda.component.html',
providers: [tuiDateFormatProvider({separator: '-'}), AppointmentService],
styleUrl: './agenda.component.scss'
})
export class AgendaComponent implements OnInit {
constructor(private appointmentService: AppointmentService) {
}
ngOnInit(): void {
this.getAppointmentsByDate(this.selectedDate);
}
timeSlots: number[] = Array.from({length: 24}, (_, i) => i); // 24 uren
appointments: Appointment[] = [];
isModalOpen = false
today = new Date()
selectedDate = new Date()
waiting: boolean = false;
selectedAppointment: Appointment;
protected value: TuiDay | null = null;
showCalendar: boolean = false;
private readonly alerts = inject(TuiAlertService);
protected appointmentForm = new FormGroup({
title: new FormControl('', Validators.required),
notes: new FormControl(''),
startTime: new FormControl(new TuiTime(this.today.getHours(), this.today.getMinutes()), Validators.required),
endTime: new FormControl(new TuiTime(this.getHours(), this.getMinutes()), Validators.required),
date: new FormControl(new TuiDay(this.selectedDate.getFullYear(), this.selectedDate.getMonth(), this.selectedDate.getDate()), Validators.required),
});
registerAppointment(title: string): void {
this.getAppointmentsByDate(this.selectedDate);
this.waiting = false
this.isModalOpen = false
this.showNotification(title)
this.resetForms()
}
protected showNotification(message: string): void {
this.alerts
.open(`Afspraak <strong>${message}</strong> is aangemaakt.`)
.subscribe();
}
getAppointmentsForHour(hour: number) {
return this.appointments.filter(appointment => appointment.startHour === hour);
}
getDate(): string {
const date = this.selectedDate
const weekDay = WeekDay[date.getDay()];
const day = date.getDate().toString().padStart(2, '0'); // Dag met leading zero (01, 02, ..., 31)
const monthName = date.toLocaleString('nl-NL', {month: 'long'});
const year = date.getFullYear().toString(); // Volledig jaar
return `${weekDay} ${day} ${monthName} ${year}`;
}
resetForms() {
this.appointmentForm = new FormGroup({
title: new FormControl('', Validators.required),
notes: new FormControl(''),
startTime: new FormControl(new TuiTime(this.today.getHours(), this.today.getMinutes()), Validators.required),
endTime: new FormControl(new TuiTime(this.getEndTime().getHours(), this.getEndTime().getMinutes()), Validators.required),
date: new FormControl(new TuiDay(this.selectedDate.getFullYear(), this.selectedDate.getMonth(), this.selectedDate.getDate()), Validators.required),
});
}
nextDay() {
this.selectedDate.setDate(this.selectedDate.getDate() + 1);
this.getAppointmentsByDate(this.selectedDate);
this.appointmentForm.get('date').setValue(new TuiDay(this.selectedDate.getFullYear(), this.selectedDate.getMonth(), this.selectedDate.getDate()))
}
previousDay() {
this.selectedDate.setDate(this.selectedDate.getDate() - 1);
this.getAppointmentsByDate(this.selectedDate);
this.appointmentForm.get('date').setValue(new TuiDay(this.selectedDate.getFullYear(), this.selectedDate.getMonth(), this.selectedDate.getDate()))
}
getHours() {
let hours = this.today.getHours()
console.log(hours)
if (hours > 23) {
return 23
}
return hours
}
getMinutes() {
let minutes = this.today.getMinutes() + 30
if (minutes > 59) {
return 59
}
return minutes
}
getEndTime(): Date {
const endTime = new Date(this.today); // Kopieer startTime
endTime.setMinutes(endTime.getMinutes() + 30); // 30 minuten toevoegen
// Controleer of de dag nog steeds hetzelfde is
if (endTime.getDate() !== this.today.getDate()) {
endTime.setHours(23, 59, 59, 999); // Zet naar 23:59:59 als het overloopt
}
return endTime;
}
setToday() {
this.selectedDate = new Date()
this.getAppointmentsByDate(this.selectedDate);
this.appointmentForm.get('date').setValue(new TuiDay(this.selectedDate.getFullYear(), this.selectedDate.getMonth(), this.selectedDate.getDate()))
}
getAppointmentsByDate(date: Date) {
this.appointmentService.getAppointmentsByDate(date).subscribe(appointments => {
this.appointments = appointments;
})
}
getInlineStyles(appointment: Appointment): { [key: string]: string } {
return {
'--duration': `${appointment.durationInMinutes}`,
'--start-minute': `${appointment.startMinute}`,
'top': `${appointment.startMinute}px`, // Startpositie binnen het uur
'height': `${appointment.durationInMinutes}px`, // Hoogte over meerdere uren
};
}
getFormattedTime(hour: number, minute: number): string {
return `${hour.toString().padStart(2, '0')}:${minute.toString().padStart(2, '0')}`;
}
getAppointmentHeight(appointment: Appointment): number {
const startInMinutes = (appointment.startHour * 60) + appointment.startMinute;
const endInMinutes = (appointment.endHour * 60) + appointment.endMinute;
return (endInMinutes - startInMinutes); // 50px per uur
}
selectAppointment(appointment: Appointment) {
this.selectedAppointment = appointment;
}
protected readonly DateFormatter = DateFormatter;
onDayClick(day: TuiDay) {
this.value = day;
this.selectedDate = new Date(day.year, day.month, day.day);
this.getAppointmentsByDate(this.selectedDate);
this.appointmentForm.get('date').setValue(new TuiDay(this.selectedDate.getFullYear(), this.selectedDate.getMonth(), this.selectedDate.getDate()))
this.toggleCalendar()
}
toggleCalendar() {
this.showCalendar = !this.showCalendar
}
closeNewItemModal() {
this.isModalOpen = false
this.resetForms()
}
appointmentIsDeleted(appointment: Appointment) {
this.selectedAppointment = undefined;
this.alerts
.open(`Afspraak <strong>${appointment.title}</strong> is verwijderd.`)
.subscribe();
this.getAppointmentsByDate(this.selectedDate);
}
appointmentIsEdited($event: Appointment) {
this.getAppointmentsByDate(this.selectedDate);
}
}

View File

@@ -0,0 +1,265 @@
<div [style.display]="'flex'">
<aside
[style.height.rem]="27"
[tuiNavigationAside]="expanded()"
>
<header>
<button
iconStart="@tui.home"
tuiAsideItem
type="button"
>
<span tuiFade>A very very long product name</span>
</button>
</header>
<button
iconStart="@tui.search"
tuiAsideItem
type="button"
>
Search
<ng-container *ngIf="expanded()">
<tui-badge appearance="accent">12</tui-badge>
</ng-container>
</button>
<a
iconStart="@tui.users"
tuiAsideItem
[routerLink]="routes.Navigation"
>
Groups
</a>
<tui-aside-group>
<button
automation-id="setting"
iconStart="@tui.settings"
tuiAsideItem
tuiChevron
type="button"
>
Settings
<ng-template>
<button
tuiAsideItem
type="button"
>
Account
</button>
<button
tuiAsideItem
type="button"
>
Notifications
</button>
<button
tuiAsideItem
type="button"
>
Privacy
</button>
</ng-template>
</button>
</tui-aside-group>
<button
automation-id="hint"
iconStart="@tui.heart"
tuiAsideItem
type="button"
>
<span tuiFade>By default ellipsis is used but you can use fade too</span>
</button>
<button
iconEnd="@tui.chevron-right"
iconStart="@tui.ellipsis"
tuiAsideItem
tuiDropdownHover
tuiDropdownOpen
type="button"
[tuiDropdown]="more"
>
More
<ng-template
#more
let-close
>
<tui-data-list tuiDataListDropdownManager>
<button
iconStart="@tui.pencil"
tuiAsideItem
type="button"
>
Write
</button>
<button
iconStart="@tui.pie-chart"
tuiAsideItem
type="button"
[tuiDropdown]="submenu"
>
Categories
<ng-template #submenu>
<tui-data-list>
<button
tuiAsideItem
type="button"
(click)="close()"
>
Fiction (will close menu)
</button>
<button
tuiAsideItem
type="button"
>
Non-Fiction
</button>
<button
tuiAsideItem
type="button"
>
Children
</button>
</tui-data-list>
</ng-template>
</button>
</tui-data-list>
</ng-template>
</button>
<hr/>
<button
iconStart="@tui.plus"
tuiAsideItem
type="button"
>
Add
</button>
<footer>
<button
iconStart="@tui.star"
tuiAsideItem
type="button"
>
Favorites
</button>
<button
tuiAsideItem
type="button"
[iconStart]="expanded() ? '@tui.chevron-left' : '@tui.chevron-right'"
(click)="handleToggle()"
>
{{ expanded() ? 'Collapse' : 'Expand' }}
</button>
</footer>
</aside>
<main tuiNavigationMain>
<nav
compact
tuiSubheader
[style.position]="'sticky'"
>
<tui-breadcrumbs [itemsLimit]="10">
<ng-container *ngFor="let item of breadcrumbs; let last = last">
<ng-container *ngIf="last">
<strong
*tuiItem
tuiFade
>
{{ item }}
</strong>
</ng-container>
<ng-container *ngIf="!last">
<button
*tuiItem
tuiLink
type="button"
>
{{ item }}
</button>
</ng-container>
</ng-container>
</tui-breadcrumbs>
<tui-tabs tuiFade>
<button
tuiTab
type="button"
>
Default view
</button>
<button
tuiTab
type="button"
>
Details
</button>
<button
tuiTab
type="button"
>
Followers
</button>
</tui-tabs>
<button
appearance="secondary"
tuiButton
type="button"
>
Secondary
</button>
<button
tuiButton
type="button"
>
Primary
</button>
</nav>
<ng-container *tuiRepeatTimes="let index of 10">
<form
tuiAppearance="floating"
tuiCardLarge
tuiForm="m"
[style.grid-column]="'2 / span 7'"
[style.margin-top.rem]="1"
>
<header tuiHeader>
<h2 tuiTitle>
Registration form
<span tuiSubtitle>Tell us about yourself</span>
</h2>
</header>
<tui-textfield>
<label tuiLabel>Name</label>
<input
placeholder="John Wick"
tuiTextfield
/>
</tui-textfield>
<footer>
<button
appearance="secondary"
tuiButton
type="button"
>
Cancel
</button>
<button
tuiButton
type="submit"
>
Ok
</button>
</footer>
</form>
<div
tuiAppearance="outline-grayscale"
tuiCardLarge
[style.grid-column]="'span 3'"
[style.margin-top.rem]="1"
>
<h2 tuiTitle>
Sidebar content
<span tuiSubtitle>Use CSS grid to position</span>
</h2>
</div>
</ng-container>
</main>
</div>

View File

@@ -0,0 +1,67 @@
import {NgForOf, NgIf} from '@angular/common';
import {Component, signal} from '@angular/core';
import {FormsModule} from '@angular/forms';
import {RouterLink} from '@angular/router';
import {TuiPortals, TuiRepeatTimes} from '@taiga-ui/cdk';
import {TuiAppearance, TuiButton, TuiDataList, TuiDropdown, TuiLink, TuiTextfield, TuiTitle,} from '@taiga-ui/core';
import {TuiBadge, TuiBreadcrumbs, TuiChevron, TuiDataListDropdownManager, TuiFade, TuiTabs,} from '@taiga-ui/kit';
import {TuiCardLarge, TuiForm, TuiHeader, TuiNavigation} from '@taiga-ui/layout';
const ICON =
"data:image/svg+xml,%0A%3Csvg width='32' height='32' viewBox='0 0 32 32' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Crect width='32' height='32' rx='8' fill='url(%23paint0_linear_2036_35276)'/%3E%3Cmask id='mask0_2036_35276' style='mask-type:alpha' maskUnits='userSpaceOnUse' x='6' y='5' width='20' height='21'%3E%3Cpath d='M18.2399 9.36607C21.1347 10.1198 24.1992 9.8808 26 7.4922C26 7.4922 21.5645 5 16.4267 5C11.2888 5 5.36726 8.69838 6.05472 16.6053C6.38707 20.4279 6.65839 23.7948 6.65839 23.7948C8.53323 22.1406 9.03427 19.4433 8.97983 16.9435C8.93228 14.7598 9.55448 12.1668 12.1847 10.4112C14.376 8.94865 16.4651 8.90397 18.2399 9.36607Z' fill='url(%23paint1_linear_2036_35276)'/%3E%3Cpath d='M11.3171 20.2647C9.8683 17.1579 10.7756 11.0789 16.4267 11.0789C20.4829 11.0789 23.1891 12.8651 22.9447 18.9072C22.9177 19.575 22.9904 20.2455 23.2203 20.873C23.7584 22.3414 24.7159 24.8946 24.7159 24.8946C23.6673 24.5452 22.8325 23.7408 22.4445 22.7058L21.4002 19.921L21.2662 19.3848C21.0202 18.4008 20.136 17.7104 19.1217 17.7104H17.5319L17.6659 18.2466C17.9119 19.2306 18.7961 19.921 19.8104 19.921L22.0258 26H10.4754C10.7774 24.7006 12.0788 23.2368 11.3171 20.2647Z' fill='url(%23paint2_linear_2036_35276)'/%3E%3C/mask%3E%3Cg mask='url(%23mask0_2036_35276)'%3E%3Crect x='4' y='4' width='24' height='24' fill='white'/%3E%3C/g%3E%3Cdefs%3E%3ClinearGradient id='paint0_linear_2036_35276' x1='0' y1='0' x2='32' y2='32' gradientUnits='userSpaceOnUse'%3E%3Cstop stop-color='%23A681D4'/%3E%3Cstop offset='1' stop-color='%237D31D4'/%3E%3C/linearGradient%3E%3ClinearGradient id='paint1_linear_2036_35276' x1='6.0545' y1='24.3421' x2='28.8119' y2='3.82775' gradientUnits='userSpaceOnUse'%3E%3Cstop offset='0.0001' stop-opacity='0.996458'/%3E%3Cstop offset='0.317708'/%3E%3Cstop offset='1' stop-opacity='0.32'/%3E%3C/linearGradient%3E%3ClinearGradient id='paint2_linear_2036_35276' x1='6.0545' y1='24.3421' x2='28.8119' y2='3.82775' gradientUnits='userSpaceOnUse'%3E%3Cstop offset='0.0001' stop-opacity='0.996458'/%3E%3Cstop offset='0.317708'/%3E%3Cstop offset='1' stop-opacity='0.32'/%3E%3C/linearGradient%3E%3C/defs%3E%3C/svg%3E%0A";
@Component({
selector: 'app-dashboard',
imports: [
FormsModule,
NgForOf,
NgIf,
RouterLink,
TuiAppearance,
TuiBadge,
TuiBreadcrumbs,
TuiButton,
TuiCardLarge,
TuiChevron,
TuiDataList,
TuiDataListDropdownManager,
TuiDropdown,
TuiFade,
TuiForm,
TuiHeader,
TuiLink,
TuiNavigation,
TuiRepeatTimes,
TuiTabs,
TuiTextfield,
TuiTitle,
],
templateUrl: './dashboard.component.html',
styleUrl: './dashboard.component.scss'
})
export class DashboardComponent extends TuiPortals {
protected expanded = signal(false);
protected open = false;
protected switch = false;
protected readonly routes: any = {};
protected readonly breadcrumbs = ['Home', 'Angular', 'Repositories', 'Taiga UI'];
protected readonly drawer = {
Components: [
{name: 'Button', icon: ICON},
{name: 'Input', icon: ICON},
{name: 'Tooltip', icon: ICON},
],
Essentials: [
{name: 'Getting started', icon: ICON},
{name: 'Showcase', icon: ICON},
{name: 'Typography', icon: ICON},
],
};
protected handleToggle(): void {
this.expanded.update((e) => !e);
}
}

View File

@@ -0,0 +1,41 @@
<!-- Ignore this part, it is only here to position drawer inside the example block -->
<div class="custom-portal">
<ng-container #viewContainer/>
</div>
<header>
<div class="navbar">
<img src="assets/logo-minimal.png" alt="App Logo" class="img-fluid">
<ul>
<li><a routerLink="/home/agenda" routerLinkActive="active">Agenda</a></li>
<li><a routerLink="/home/klanten" routerLinkActive="active">Klanten</a></li>
</ul>
<hr/>
<button
tuiChevron
type="button"
[tuiDropdown]="dropdownContent"
[tuiDropdownManual]="open"
[tuiObscuredEnabled]="open"
(click)="onClick()"
(tuiActiveZoneChange)="onActiveZone($event)"
(tuiObscured)="onObscured($event)"
>
<tui-avatar src="{{getInitials()}}"/>
<ng-template #dropdownContent>
<div class="dropdown">
<h3>{{fullName}}</h3>
<button
size="m"
tuiButton
type="button"
(click)="logout()"
>
Uitloggen
</button>
</div>
</ng-template>
</button>
</div>
</header>
<router-outlet></router-outlet>

View File

@@ -0,0 +1,62 @@
.navbar {
background-color: #f8f9fa;
display: flex
}
ul {
display: flex;
flex-direction: row;
justify-content: center;
list-style-type: none;
align-items: center;
}
li {
margin: 0 10px;
}
a {
text-decoration: none;
color: black;
font-size: 16px;
}
img {
display: block;
max-width: 230px;
max-height: 95px;
width: auto;
height: auto;
}
hr {
clear: both;
visibility: hidden;
}
tui-avatar {
margin-right: 32px;
cursor: pointer;
}
.active {
font-weight: bold;
}
.dropdown {
font-size: 0.8125rem;
line-height: 1.25rem;
padding: 0.25rem 0.75rem;
margin-left: 4px;
margin-right: 4px;
margin-bottom: 8px;
}
.t-content{
margin-right: 24px;
}
button{
background: transparent;
border: none;
}

View File

@@ -0,0 +1,55 @@
import {Component, OnInit} from '@angular/core';
import {FormsModule} from '@angular/forms';
import {Router, RouterLink, RouterLinkActive, RouterModule} from '@angular/router';
import {TuiAvatar, TuiChevron,} from '@taiga-ui/kit';
import {AuthService} from '../../services/auth.service';
import {User} from '../../models/user';
import {TuiButton, TuiDropdown} from '@taiga-ui/core';
import {TuiActiveZone, TuiObscured} from '@taiga-ui/cdk';
@Component({
selector: 'app-home',
imports: [TuiAvatar, RouterModule, FormsModule, RouterLink, RouterLinkActive, TuiDropdown, TuiObscured, TuiActiveZone, TuiButton, TuiChevron],
templateUrl: './home.component.html',
styleUrl: './home.component.scss'
})
export class HomeComponent implements OnInit {
user: User
fullName: string
getInitials(): string {
this.user = this.authService.getUserInfo();
this.fullName = this.user.firstName + ' ' + this.user.lastName;
return this.fullName.split(' ').map((n) => n[0]).join('').substring(0, 2);
}
protected open = false;
protected onClick(): void {
this.open = !this.open;
}
protected onObscured(obscured: boolean): void {
if (obscured) {
this.open = false;
}
}
protected onActiveZone(active: boolean): void {
this.open = active && this.open;
}
constructor(private authService: AuthService, private router: Router) {
}
ngOnInit(): void {
if (!this.authService.isAuthenticated()) {
this.router.navigate(['login']);
}
}
logout() {
this.authService.logout();
this.router.navigate(['login']);
}
}

View File

@@ -0,0 +1,101 @@
<div class="container">
<div class="heading">
<h1>Klanten</h1>
</div>
<div class="content">
<div class="toolbar">
<button
size="m"
tuiButton
appearance="secondary"
type="button"
(click)="toggleCustomerModal()"
>
<tui-icon
icon="@tui.plus"
[style.height.rem]="1"
/>
Klant toevoegen
</button>
</div>
<table class="styled-table">
<thead>
<tr>
<th>Naam</th>
<th>Email</th>
</tr>
</thead>
<tbody>
<tr *ngFor="let customer of customers" (click)="selectCustomer(customer)">
<td>{{ customer.firstName }} {{ customer.lastName }}</td>
<td>{{ customer.email }}</td>
</tr>
</tbody>
</table>
</div>
</div>
<app-modal title="Nieuwe klant toevoegen" *ngIf="showNewCustomer" (close)="toggleCustomerModal()">
<form [formGroup]="customerForm">
<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 title="Klant bekijken" *ngIf="selectedCustomer != undefined" (close)="selectedCustomer = undefined">
<app-customer-details [customer]="selectedCustomer"></app-customer-details>
</app-modal>

View File

@@ -0,0 +1,72 @@
h1 {
text-align: center;
}
h2 {
margin-left: 8px;
}
.heading {
justify-content: center;
}
.content {
display: flex;
flex-direction: column;
justify-content: center;
}
.styled-table {
width: 100%; /* Tabel breedte */
border-collapse: collapse; /* Verwijdert dubbele randen */
margin: 20px 0; /* Ruimte rondom de tabel */
font-size: 16px;
text-align: left; /* Tekst uitlijning */
box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1); /* Zachte schaduw */
border-radius: 10px; /* Afgeronde hoeken */
overflow: hidden; /* Hoeken correct afronden */
}
.styled-table thead {
background-color: #868383; /* Blauwe kopregel */
color: #ffffff; /* Witte tekst */
//text-transform: uppercase; /* Hoofdletters */
font-weight: bold;
}
.styled-table th, .styled-table td {
padding: 12px 15px; /* Ruimte binnen de cellen */
}
.styled-table tbody tr {
border-bottom: 1px solid #dddddd; /* Lichte scheidingslijn */
}
.styled-table tbody tr:nth-child(even) {
background-color: #f3f3f3; /* Afwisselende rijkleuren */
}
.styled-table tbody tr:hover {
background-color: #d3d2d2; /* Hover effect */
cursor: pointer;
transition: background-color 0.3s ease;
}
.styled-table tbody tr:last-of-type {
border-bottom: none; /* Verwijdert de onderste scheidingslijn */
}
.toolbar {
button {
margin-left: 8px;
}
margin-bottom: 12px;
display: flex;
flex-direction: row;
justify-content: center;
}

View File

@@ -0,0 +1,71 @@
import {Component, OnInit} from '@angular/core';
import {NgForOf, NgIf} from '@angular/common';
import {Customer} from '../../models/customer';
import {CustomerService} from '../../services/customer.service';
import {TuiButton, TuiIcon} from '@taiga-ui/core';
import {ModalComponent} from '../../components/modal/modal.component';
import {FormControl, FormGroup, ReactiveFormsModule, Validators} from '@angular/forms';
import {TuiInputCopyModule, TuiInputModule, TuiTextfieldControllerModule} from '@taiga-ui/legacy';
import {CustomerDetailsComponent} from '../../components/customer-details/customer-details.component';
@Component({
selector: 'app-klanten',
imports: [
NgForOf,
TuiButton,
TuiIcon,
ModalComponent,
NgIf,
ReactiveFormsModule,
TuiInputCopyModule,
TuiInputModule,
TuiTextfieldControllerModule,
CustomerDetailsComponent
],
templateUrl: './klanten.component.html',
styleUrl: './klanten.component.scss'
})
export class KlantenComponent implements OnInit {
customers: Customer[];
showNewCustomer: boolean = false;
customerForm: FormGroup;
selectedCustomer: Customer;
constructor(private customerService: CustomerService) {
}
ngOnInit(): void {
this.getCustomers();
this.customerForm = new FormGroup({
firstName: new FormControl('', Validators.required),
lastName: new FormControl('', Validators.required),
email: new FormControl('', [Validators.required, Validators.email]),
})
}
toggleCustomerModal() {
this.showNewCustomer = !this.showNewCustomer;
}
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.getCustomers()
})
}
getCustomers() {
this.customerService.getCustomers().subscribe(customers => {
this.customers = customers
});
}
selectCustomer(customer: Customer) {
this.selectedCustomer = customer
}
}

View File

@@ -0,0 +1,23 @@
<div class="container">
<div class="center-container">
<form tuiAppearance="floating" tuiCardLarge tuiForm="m" [formGroup]="form" [style.max-width.rem]="32">
<header tuiHeader>
<img class="header" src="assets/logo-minimal.png" alt="Logo" tuiHeaderIcon/>
</header>
<tui-textfield>
<label tuiLabel>Gebruikersnaam</label>
<input formControlName="username" placeholder="Voer je gebruikersnaam in" tuiTextfield/>
</tui-textfield>
<tui-textfield>
<label tuiLabel>Wachtwoord</label>
<input formControlName="password" type="password" placeholder="Voer je wachtwoord in" tuiTextfield/>
</tui-textfield>
<tui-error [error]="computedError" />
<footer>
<button tuiButton class="custom-button" type="submit" [disabled]="form.invalid" (click)="login()">
Inloggen
</button>
</footer>
</form>
</div>
</div>

View File

@@ -0,0 +1,49 @@
.center-container {
display: flex;
justify-content: center;
align-items: center;
height: 100vh;
/* Adjust as needed */
}
tui-error{
text-align: center;
}
.header {
text-align: center;
margin-bottom: 28px;
max-width: 300px;
max-height: 300px;
}
::ng-deep button.custom-button {
background-color: #222222 !important;
/* Pas kleur aan */
color: white !important;
/* Tekstkleur aanpassen */
width: 300px;
}
.container {
max-width: 100%;
width: 100%;
height: 100%;
--s: 200px; /* control the size */
--c1: #1d1d1d;
--c2: #4e4f51;
--c3: #3c3c3c;
background: repeating-conic-gradient(
from 30deg,
#0000 0 120deg,
var(--c3) 0 180deg
) calc(0.5 * var(--s)) calc(0.5 * var(--s) * 0.577),
repeating-conic-gradient(
from 30deg,
var(--c1) 0 60deg,
var(--c2) 0 120deg,
var(--c3) 0 180deg
);
background-size: var(--s) calc(var(--s) * 0.577);
}

View File

@@ -0,0 +1,57 @@
import {Component} from '@angular/core';
import {FormControl, FormGroup, ReactiveFormsModule, Validators} from '@angular/forms';
import {Router} from '@angular/router';
import {TuiAppearance, TuiButton, TuiError, TuiTextfield,} from '@taiga-ui/core';
import {TuiCardLarge, TuiForm, TuiHeader} from '@taiga-ui/layout';
import {AuthService} from '../../services/auth.service';
import {UserDto} from '../../models/user-dto';
import {HttpErrorResponse} from '@angular/common/http';
import {TuiValidationError} from '@taiga-ui/cdk';
@Component({
selector: 'app-login',
imports: [
ReactiveFormsModule,
TuiAppearance,
TuiButton,
TuiCardLarge,
TuiForm,
TuiHeader,
TuiTextfield,
TuiError,
],
templateUrl: './login.component.html',
styleUrl: './login.component.scss'
})
export class LoginComponent {
form: FormGroup;
protected enabled = false;
protected error = new TuiValidationError('Ongeldige gebruikersnaam of wachtwoord.');
protected get computedError(): TuiValidationError | null {
return this.enabled ? this.error : null;
}
constructor(private router: Router, private authService: AuthService) {
this.form = new FormGroup({
username: new FormControl('', Validators.required),
password: new FormControl('', Validators.required)
});
}
login() {
this.authService.login(this.form.get('username').value, this.form.get('password').value).subscribe({
next: (user: UserDto) => {
localStorage.setItem('token', user.token);
this.router.navigate(['/home/agenda']);
},
error: (err: HttpErrorResponse) => {
if (err.status === 401) {
this.enabled = true;
}
},
});
}
}

View File

@@ -0,0 +1,45 @@
import {Injectable} from '@angular/core';
import {HttpClient} from '@angular/common/http';
import {Appointment} from '../models/appointment';
@Injectable({
providedIn: 'root',
})
export class AppointmentService {
baseApi = "http://localhost:8080/api/appointments";
// baseApi = "https://api.melvanveen.nl/api/appointments";
constructor(private http: HttpClient) {
}
getAllAppointments() {
return this.http.get<Appointment[]>(`${this.baseApi}`);
}
getAppointmentsByDate(date: Date) {
const day = date.getDate().toString().padStart(2, '0')
const month = (date.getMonth() + 1).toString().padStart(2, '0')
const year = date.getFullYear();
return this.http.get<Appointment[]>(`${this.baseApi}/date?start=${year}-${month}-${day}`, {});
}
addAppointment(appointment: Appointment) {
return this.http.post(`${this.baseApi}`, appointment);
}
deleteAppointment(appointment: Appointment) {
return this.http.delete(`${this.baseApi}?id=${appointment.id}`)
}
updateAppointment(appointment: Appointment) {
return this.http.put(`${this.baseApi}`, appointment);
}
getAppointment(id: string) {
return this.http.get(`${this.baseApi}/${id}`);
}
getMostRecentAppointment(id: number) {
return this.http.get(`${this.baseApi}/recent/${id}`);
}
}

View File

@@ -0,0 +1,42 @@
import { Injectable } from '@angular/core';
import { HttpClient } from '@angular/common/http';
import { JwtHelperService } from '@auth0/angular-jwt';
import { Observable } from 'rxjs';
import {jwtDecode} from 'jwt-decode';
@Injectable({
providedIn: 'root',
})
export class AuthService {
private baseApi = 'http://localhost:8080/api/auth/login';
// baseApi = "https://api.melvanveen.nl/api/auth/login";
jwtHelper = new JwtHelperService();
constructor(private http: HttpClient) {}
login(username: string, password: string): Observable<any> {
return this.http.post(this.baseApi, { username, password });
}
isAuthenticated(): boolean {
const token = localStorage.getItem('token');
return token !== null && !this.jwtHelper.isTokenExpired(token);
}
logout(): void {
localStorage.removeItem('token');
}
getToken(): string | null {
return localStorage.getItem('token');
}
getUserInfo(): any {
const token = this.getToken();
if (token) {
return jwtDecode(token);
}
return null;
}
}

View File

@@ -0,0 +1,24 @@
import {Injectable} from '@angular/core';
import {HttpClient} from '@angular/common/http';
import {Customer} from '../models/customer';
import {Observable} from 'rxjs';
@Injectable({
providedIn: 'root',
})
export class CustomerService {
baseApi = "http://localhost:8080/api/customers";
// baseApi = "https://api.melvanveen.nl/api/customers";
constructor(private http: HttpClient) {
}
getCustomers(): Observable<Customer[]> {
return this.http.get<Customer[]>(`${this.baseApi}`);
}
addCustomer(customer: Customer): Observable<Customer> {
return this.http.post<Customer>(`${this.baseApi}`, customer);
}
}

View File

@@ -0,0 +1,34 @@
import {WeekDay} from '../models/week-day';
export class DateFormatter {
static getFormattedTime(hour: number, minute: number): string {
return `${hour.toString().padStart(2, '0')}:${minute.toString().padStart(2, '0')}`;
}
static getHours(date: Date) {
let hours = date.getHours()
console.log(hours)
if (hours > 23) {
return 23
}
return hours
}
static getMinutes(date: Date) {
let minutes = date.getMinutes() + 30
if (minutes > 59) {
return 59
}
return minutes
}
static getDate(dateString: string): string {
const date = new Date(dateString)
const weekDay = WeekDay[date.getDay()];
const day = date.getDate().toString().padStart(2, '0'); // Dag met leading zero (01, 02, ..., 31)
const monthName = date.toLocaleString('nl-NL', {month: 'long'});
const year = date.getFullYear().toString(); // Volledig jaar
return `${weekDay} ${day} ${monthName} ${year}`;
}
}

View File

@@ -1 +1,18 @@
/* You can add global styles to this file, and also import other style files */ /* You can add global styles to this file, and also import other style files */
.container {
max-width: 70vw;
margin: 0 auto;
padding: 20px;
}
.heading {
margin-bottom: 12px;
display: flex;
flex-direction: row;
justify-content: space-between;
}
.content {
overflow-y: scroll;
max-height: 70vh;
}

View File

@@ -4,7 +4,7 @@
"compileOnSave": false, "compileOnSave": false,
"compilerOptions": { "compilerOptions": {
"outDir": "./dist/out-tsc", "outDir": "./dist/out-tsc",
"strict": true, "strict": false,
"noImplicitOverride": true, "noImplicitOverride": true,
"noPropertyAccessFromIndexSignature": true, "noPropertyAccessFromIndexSignature": true,
"noImplicitReturns": true, "noImplicitReturns": true,