From 94c224873bff4b5d43a5ee69a9ecf3c25a709e83 Mon Sep 17 00:00:00 2001 From: Dani Date: Thu, 23 Nov 2023 16:54:50 +0100 Subject: [PATCH 1/2] swap type from text to selector --- src/app/routes/route-create/route-create.component.html | 8 +++++--- src/app/routes/route-create/route-create.component.ts | 6 ++++++ 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/src/app/routes/route-create/route-create.component.html b/src/app/routes/route-create/route-create.component.html index 6232c26..2a3e86a 100644 --- a/src/app/routes/route-create/route-create.component.html +++ b/src/app/routes/route-create/route-create.component.html @@ -22,11 +22,13 @@ #description="ngModel"> - + +
- +
diff --git a/src/app/routes/route-create/route-create.component.ts b/src/app/routes/route-create/route-create.component.ts index 5a4b97e..b4c97fc 100644 --- a/src/app/routes/route-create/route-create.component.ts +++ b/src/app/routes/route-create/route-create.component.ts @@ -8,6 +8,7 @@ import { Input } from '@angular/core'; import { UserService } from 'src/app/user/user.service'; import { PagedResourceCollection } from '@lagoshny/ngx-hateoas-client'; import { HttpClient, HttpClientModule } from '@angular/common/http'; +import {environment} from '../../../environments/environment'; @Component({ selector: 'app-routes-create', @@ -27,6 +28,7 @@ export class RouteCreateComponent implements OnInit { public page = 1; public totalUsers = 0; public authserv: AuthenticationBasicService; + public types: []; constructor(private router: Router, private authenticationService: AuthenticationBasicService, @@ -37,6 +39,10 @@ export class RouteCreateComponent implements OnInit { ngOnInit(): void { this.createdBy.id = this.getCurrentUserName(); this.creationDate = new Date(); + this.http.get(`${environment.API}/profile/routes`) + .subscribe(data => { + this.types = (data.alps.descriptor[0].descriptor[2].doc.value).split(','); + }); this.userService.getPage({ pageParams: { size: this.pageSize }, sort: { username: 'ASC' } }).subscribe( From f71d6203a769724c97a54e6cbee4f2ccadafe172 Mon Sep 17 00:00:00 2001 From: Dani Date: Fri, 24 Nov 2023 13:54:45 +0100 Subject: [PATCH 2/2] swap type from input to selector --- .../routes/route-create/route-create.component.html | 1 - src/app/routes/route-create/route-create.component.ts | 10 ++++------ 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/src/app/routes/route-create/route-create.component.html b/src/app/routes/route-create/route-create.component.html index 2a3e86a..6323c2e 100644 --- a/src/app/routes/route-create/route-create.component.html +++ b/src/app/routes/route-create/route-create.component.html @@ -22,7 +22,6 @@ #description="ngModel"> -
diff --git a/src/app/routes/route-create/route-create.component.ts b/src/app/routes/route-create/route-create.component.ts index b4c97fc..21013cf 100644 --- a/src/app/routes/route-create/route-create.component.ts +++ b/src/app/routes/route-create/route-create.component.ts @@ -4,11 +4,10 @@ import { AuthenticationBasicService } from 'src/app/login-basic/authentication-b import { User } from 'src/app/login-basic/user'; import { Route } from '../route'; import { RouteService } from '../route.service'; -import { Input } from '@angular/core'; import { UserService } from 'src/app/user/user.service'; import { PagedResourceCollection } from '@lagoshny/ngx-hateoas-client'; -import { HttpClient, HttpClientModule } from '@angular/common/http'; -import {environment} from '../../../environments/environment'; +import { HttpClient} from '@angular/common/http'; +import {environment} from "../../../environments/environment"; @Component({ selector: 'app-routes-create', @@ -41,9 +40,8 @@ export class RouteCreateComponent implements OnInit { this.creationDate = new Date(); this.http.get(`${environment.API}/profile/routes`) .subscribe(data => { - this.types = (data.alps.descriptor[0].descriptor[2].doc.value).split(','); - }); - + this.types = (data.alps.descriptor[0].descriptor[2].doc.value).split(','); + }); this.userService.getPage({ pageParams: { size: this.pageSize }, sort: { username: 'ASC' } }).subscribe( (page: PagedResourceCollection) => {