diff --git a/Dockerfile-tst b/Dockerfile-tst index 6626956..f4dffe2 100644 --- a/Dockerfile-tst +++ b/Dockerfile-tst @@ -11,7 +11,7 @@ RUN npm install -g @angular/cli COPY . . -RUN ng build --configuration=production +RUN ng build --configuration=test # Gebruik een multi-architecture versie van Nginx FROM nginx:latest diff --git a/angular.json b/angular.json index 5721d30..2e062ad 100644 --- a/angular.json +++ b/angular.json @@ -94,6 +94,9 @@ }, "development": { "buildTarget": "PayPoint:build:development" + }, + "test": { + "buildTarget": "PayPoint:build:test" } }, "defaultConfiguration": "development" diff --git a/src/app/pages/login/login.component.html b/src/app/pages/login/login.component.html index 0bc2b4a..9d9cb86 100644 --- a/src/app/pages/login/login.component.html +++ b/src/app/pages/login/login.component.html @@ -18,6 +18,8 @@ Inloggen + +

{{appVersion}}

diff --git a/src/app/pages/login/login.component.scss b/src/app/pages/login/login.component.scss index 455527a..fd8bf65 100644 --- a/src/app/pages/login/login.component.scss +++ b/src/app/pages/login/login.component.scss @@ -10,6 +10,10 @@ tui-error { text-align: center; } +p{ + text-align: center; +} + .header { text-align: center; margin-bottom: 28px; diff --git a/src/app/pages/login/login.component.ts b/src/app/pages/login/login.component.ts index 2309b5a..7bc6190 100644 --- a/src/app/pages/login/login.component.ts +++ b/src/app/pages/login/login.component.ts @@ -7,6 +7,7 @@ import {AuthService} from '../../services/auth.service'; import {UserDto} from '../../models/user-dto'; import {HttpErrorResponse} from '@angular/common/http'; import {TuiValidationError} from '@taiga-ui/cdk'; +import {environment} from '../../../environments/environment'; @Component({ selector: 'app-login', @@ -26,6 +27,7 @@ import {TuiValidationError} from '@taiga-ui/cdk'; export class LoginComponent { form: FormGroup; protected enabled = false; + appVersion = environment.appVersion; protected error = new TuiValidationError('Ongeldige gebruikersnaam of wachtwoord.'); diff --git a/src/app/services/appointment.service.ts b/src/app/services/appointment.service.ts index 17b53a7..e1cd15c 100644 --- a/src/app/services/appointment.service.ts +++ b/src/app/services/appointment.service.ts @@ -1,13 +1,13 @@ import {Injectable} from '@angular/core'; import {HttpClient} from '@angular/common/http'; import {Appointment} from '../models/appointment'; +import {environment} from '../../environments/environment'; @Injectable({ providedIn: 'root', }) export class AppointmentService { - // baseApi = "http://localhost:8080/api/appointments"; - baseApi = "https://api.melvanveen.nl/api/appointments"; + baseApi = `${environment.baseApi}/appointments`; constructor(private http: HttpClient) { } diff --git a/src/app/services/auth.service.ts b/src/app/services/auth.service.ts index 8145ebc..dd88fed 100644 --- a/src/app/services/auth.service.ts +++ b/src/app/services/auth.service.ts @@ -3,13 +3,13 @@ import {HttpClient} from '@angular/common/http'; import {JwtHelperService} from '@auth0/angular-jwt'; import {Observable} from 'rxjs'; import {jwtDecode} from 'jwt-decode'; +import {environment} from '../../environments/environment'; @Injectable({ providedIn: 'root', }) export class AuthService { - // private baseApi = 'http://localhost:8080/api/auth/login'; - baseApi = "https://api.melvanveen.nl/api/auth/login"; + baseApi = `${environment.baseApi}/auth/login`; jwtHelper = new JwtHelperService(); constructor(private http: HttpClient) { diff --git a/src/app/services/customer.service.ts b/src/app/services/customer.service.ts index 2a22baf..9811742 100644 --- a/src/app/services/customer.service.ts +++ b/src/app/services/customer.service.ts @@ -2,14 +2,13 @@ import {Injectable} from '@angular/core'; import {HttpClient} from '@angular/common/http'; import {Customer} from '../models/customer'; import {Observable} from 'rxjs'; +import {environment} from '../../environments/environment'; @Injectable({ providedIn: 'root', }) export class CustomerService { - // baseApi = "http://localhost:8080/api/customers"; - baseApi = "https://api.melvanveen.nl/api/customers"; - + baseApi = `${environment.baseApi}/customers`; constructor(private http: HttpClient) { } diff --git a/src/environments/environment.development.ts b/src/environments/environment.development.ts index 831bf3f..922d5f2 100644 --- a/src/environments/environment.development.ts +++ b/src/environments/environment.development.ts @@ -1,4 +1,7 @@ +import { version } from '../../package.json'; + export const environment = { baseApi: 'http://localhost:8080/api', - production: false + production: false, + appVersion: version + '-LOCAL' }; diff --git a/src/environments/environment.test.ts b/src/environments/environment.test.ts index 831bf3f..aee4041 100644 --- a/src/environments/environment.test.ts +++ b/src/environments/environment.test.ts @@ -1,4 +1,7 @@ +import { version } from '../../package.json'; + export const environment = { - baseApi: 'http://localhost:8080/api', - production: false + baseApi: 'https://api-test.melvanveen.nl/api', + production: false, + appVersion: version + '-SNAPSHOT' }; diff --git a/src/environments/environment.ts b/src/environments/environment.ts index 9f2cca7..b3f50bc 100644 --- a/src/environments/environment.ts +++ b/src/environments/environment.ts @@ -1,4 +1,7 @@ +import { version } from '../../package.json'; + export const environment = { baseApi: 'https://api.melvanveen.nl/api', - production: true + production: true, + appVersion: version };