From 1307881d8a64692c92a8eb75d390cfb5fb4b6291 Mon Sep 17 00:00:00 2001 From: Gerard Date: Tue, 21 Nov 2023 18:19:43 +0100 Subject: [PATCH 01/28] coordinate worker --- src/app/coordinate/coordinate.ts | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 src/app/coordinate/coordinate.ts diff --git a/src/app/coordinate/coordinate.ts b/src/app/coordinate/coordinate.ts new file mode 100644 index 0000000..89b82ee --- /dev/null +++ b/src/app/coordinate/coordinate.ts @@ -0,0 +1,13 @@ +import { HateoasResource, Resource } from '@lagoshny/ngx-hateoas-client'; + +@HateoasResource('coordinates') +export class Coordinate extends Resource { + id: number + coordinate: string + // routeVersion: RouteVersion + + constructor(values: object = {}) { + super(); + Object.assign(this as any, values); + } +} From 6a6203748285dcc7bdbfdc4dbecb55a0e9e4090f Mon Sep 17 00:00:00 2001 From: Gerard Date: Tue, 21 Nov 2023 18:20:23 +0100 Subject: [PATCH 02/28] coordinate service --- src/app/coordinate/coordinate.service.ts | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 src/app/coordinate/coordinate.service.ts diff --git a/src/app/coordinate/coordinate.service.ts b/src/app/coordinate/coordinate.service.ts new file mode 100644 index 0000000..afd4071 --- /dev/null +++ b/src/app/coordinate/coordinate.service.ts @@ -0,0 +1,20 @@ +import { Injectable } from '@angular/core'; +import { Coordinate } from './coordinate'; + +import { Observable } from 'rxjs'; +import { HttpClient } from '@angular/common/http'; + +/* import { Observable } from 'rxjs/internal/Observable'; */ +import { + HateoasResourceOperation, + ResourceCollection, +} from '@lagoshny/ngx-hateoas-client'; + +@Injectable({ + providedIn: 'root' +}) +export class CoordinateService extends HateoasResourceOperation { + constructor(private http: HttpClient) { + super(Coordinate); + } +} From 4647503d35958facdaeb6a04c165601dfd7174f4 Mon Sep 17 00:00:00 2001 From: Gerard Date: Tue, 21 Nov 2023 18:21:09 +0100 Subject: [PATCH 03/28] coordinate list component --- src/app/app.module.ts | 4 +++- .../coordinate-list/coordinate-list.component.html | 1 + .../coordinate-list/coordinate-list.component.scss | 0 .../coordinate-list/coordinate-list.component.ts | 10 ++++++++++ 4 files changed, 14 insertions(+), 1 deletion(-) create mode 100644 src/app/coordinate/coordinate-list/coordinate-list.component.html create mode 100644 src/app/coordinate/coordinate-list/coordinate-list.component.scss create mode 100644 src/app/coordinate/coordinate-list/coordinate-list.component.ts diff --git a/src/app/app.module.ts b/src/app/app.module.ts index 40c973a..5cd22b5 100644 --- a/src/app/app.module.ts +++ b/src/app/app.module.ts @@ -23,6 +23,7 @@ import {HttpErrorInterceptor} from './error-handler/http-error-interceptor'; import {AuthenticationBasicService} from './login-basic/authentication-basic.service'; import {LoggedInGuard} from './login-basic/loggedin.guard'; import {UserService} from './user/user.service'; +import { CoordinateListComponent } from './coordinate/coordinate-list/coordinate-list.component'; @NgModule({ declarations: [ @@ -35,7 +36,8 @@ import {UserService} from './user/user.service'; UserRegisterComponent, UserEditComponent, UserDeleteComponent, - UserSearchComponent + UserSearchComponent, + CoordinateListComponent ], imports: [ BrowserModule, diff --git a/src/app/coordinate/coordinate-list/coordinate-list.component.html b/src/app/coordinate/coordinate-list/coordinate-list.component.html new file mode 100644 index 0000000..e27d45c --- /dev/null +++ b/src/app/coordinate/coordinate-list/coordinate-list.component.html @@ -0,0 +1 @@ +

coordinate-list works!

diff --git a/src/app/coordinate/coordinate-list/coordinate-list.component.scss b/src/app/coordinate/coordinate-list/coordinate-list.component.scss new file mode 100644 index 0000000..e69de29 diff --git a/src/app/coordinate/coordinate-list/coordinate-list.component.ts b/src/app/coordinate/coordinate-list/coordinate-list.component.ts new file mode 100644 index 0000000..07b421b --- /dev/null +++ b/src/app/coordinate/coordinate-list/coordinate-list.component.ts @@ -0,0 +1,10 @@ +import { Component } from '@angular/core'; + +@Component({ + selector: 'app-coordinate-list', + templateUrl: './coordinate-list.component.html', + styleUrls: ['./coordinate-list.component.scss'] +}) +export class CoordinateListComponent { + +} From eb8a9cd01067bd0f5ff32f6cd94ea2bb81901d0f Mon Sep 17 00:00:00 2001 From: Gerard Date: Tue, 21 Nov 2023 18:43:37 +0100 Subject: [PATCH 04/28] coordinate routing --- src/app/app.module.ts | 2 ++ src/app/coordinate/coordinate-routing.module.ts | 15 +++++++++++++++ 2 files changed, 17 insertions(+) create mode 100644 src/app/coordinate/coordinate-routing.module.ts diff --git a/src/app/app.module.ts b/src/app/app.module.ts index 5cd22b5..44afa61 100644 --- a/src/app/app.module.ts +++ b/src/app/app.module.ts @@ -24,6 +24,7 @@ import {AuthenticationBasicService} from './login-basic/authentication-basic.ser import {LoggedInGuard} from './login-basic/loggedin.guard'; import {UserService} from './user/user.service'; import { CoordinateListComponent } from './coordinate/coordinate-list/coordinate-list.component'; +import { CoordinateRoutingModule } from './coordinate/coordinate-routing.module'; @NgModule({ declarations: [ @@ -52,6 +53,7 @@ import { CoordinateListComponent } from './coordinate/coordinate-list/coordinate ErrorHandlerModule, NgbModule, ReactiveFormsModule, + CoordinateRoutingModule ], providers: [ { provide: HTTP_INTERCEPTORS, useClass: AuthInterceptor, multi: true }, diff --git a/src/app/coordinate/coordinate-routing.module.ts b/src/app/coordinate/coordinate-routing.module.ts new file mode 100644 index 0000000..c453ffe --- /dev/null +++ b/src/app/coordinate/coordinate-routing.module.ts @@ -0,0 +1,15 @@ +import { NgModule } from '@angular/core'; +import {RouterModule, Routes} from "@angular/router"; +import {CoordinateListComponent} from "./coordinate-list/coordinate-list.component"; + + +const routes: Routes = [ + { path: 'coordinates/list', component: CoordinateListComponent}, +]; + + +@NgModule({ + imports: [RouterModule.forChild(routes)], + exports: [RouterModule] +}) +export class CoordinateRoutingModule { } From b51a785cee0f8036efc9678d6e2a143ffa9d9ad4 Mon Sep 17 00:00:00 2001 From: Gerard Date: Tue, 21 Nov 2023 18:56:27 +0100 Subject: [PATCH 05/28] coordinate create component --- src/app/app.module.ts | 1 + .../coordinate-create/coordinate-create.component.html | 1 + .../coordinate-create/coordinate-create.component.scss | 0 .../coordinate-create/coordinate-create.component.ts | 10 ++++++++++ 4 files changed, 12 insertions(+) create mode 100644 src/app/coordinate/coordinate-create/coordinate-create.component.html create mode 100644 src/app/coordinate/coordinate-create/coordinate-create.component.scss create mode 100644 src/app/coordinate/coordinate-create/coordinate-create.component.ts diff --git a/src/app/app.module.ts b/src/app/app.module.ts index 44afa61..8eb9ac5 100644 --- a/src/app/app.module.ts +++ b/src/app/app.module.ts @@ -25,6 +25,7 @@ import {LoggedInGuard} from './login-basic/loggedin.guard'; import {UserService} from './user/user.service'; import { CoordinateListComponent } from './coordinate/coordinate-list/coordinate-list.component'; import { CoordinateRoutingModule } from './coordinate/coordinate-routing.module'; +import { CoordinateCreateComponent } from './coordinate/coordinate-create/coordinate-create.component'; @NgModule({ declarations: [ diff --git a/src/app/coordinate/coordinate-create/coordinate-create.component.html b/src/app/coordinate/coordinate-create/coordinate-create.component.html new file mode 100644 index 0000000..6b671bc --- /dev/null +++ b/src/app/coordinate/coordinate-create/coordinate-create.component.html @@ -0,0 +1 @@ +

coordinate-create works!

diff --git a/src/app/coordinate/coordinate-create/coordinate-create.component.scss b/src/app/coordinate/coordinate-create/coordinate-create.component.scss new file mode 100644 index 0000000..e69de29 diff --git a/src/app/coordinate/coordinate-create/coordinate-create.component.ts b/src/app/coordinate/coordinate-create/coordinate-create.component.ts new file mode 100644 index 0000000..784b0f5 --- /dev/null +++ b/src/app/coordinate/coordinate-create/coordinate-create.component.ts @@ -0,0 +1,10 @@ +import { Component } from '@angular/core'; + +@Component({ + selector: 'app-coordinate-create', + templateUrl: './coordinate-create.component.html', + styleUrls: ['./coordinate-create.component.scss'] +}) +export class CoordinateCreateComponent { + +} From 378b570311be360096c886cd3403b3fcf6526ef9 Mon Sep 17 00:00:00 2001 From: Gerard Date: Tue, 21 Nov 2023 18:56:42 +0100 Subject: [PATCH 06/28] coordinate delete component --- src/app/app.module.ts | 1 + .../coordinate-delete/coordinate-delete.component.html | 1 + .../coordinate-delete/coordinate-delete.component.scss | 0 .../coordinate-delete/coordinate-delete.component.ts | 10 ++++++++++ 4 files changed, 12 insertions(+) create mode 100644 src/app/coordinate/coordinate-delete/coordinate-delete.component.html create mode 100644 src/app/coordinate/coordinate-delete/coordinate-delete.component.scss create mode 100644 src/app/coordinate/coordinate-delete/coordinate-delete.component.ts diff --git a/src/app/app.module.ts b/src/app/app.module.ts index 8eb9ac5..e2b7cfa 100644 --- a/src/app/app.module.ts +++ b/src/app/app.module.ts @@ -26,6 +26,7 @@ import {UserService} from './user/user.service'; import { CoordinateListComponent } from './coordinate/coordinate-list/coordinate-list.component'; import { CoordinateRoutingModule } from './coordinate/coordinate-routing.module'; import { CoordinateCreateComponent } from './coordinate/coordinate-create/coordinate-create.component'; +import { CoordinateDeleteComponent } from './coordinate/coordinate-delete/coordinate-delete.component'; @NgModule({ declarations: [ diff --git a/src/app/coordinate/coordinate-delete/coordinate-delete.component.html b/src/app/coordinate/coordinate-delete/coordinate-delete.component.html new file mode 100644 index 0000000..5528477 --- /dev/null +++ b/src/app/coordinate/coordinate-delete/coordinate-delete.component.html @@ -0,0 +1 @@ +

coordinate-delete works!

diff --git a/src/app/coordinate/coordinate-delete/coordinate-delete.component.scss b/src/app/coordinate/coordinate-delete/coordinate-delete.component.scss new file mode 100644 index 0000000..e69de29 diff --git a/src/app/coordinate/coordinate-delete/coordinate-delete.component.ts b/src/app/coordinate/coordinate-delete/coordinate-delete.component.ts new file mode 100644 index 0000000..3bfad0c --- /dev/null +++ b/src/app/coordinate/coordinate-delete/coordinate-delete.component.ts @@ -0,0 +1,10 @@ +import { Component } from '@angular/core'; + +@Component({ + selector: 'app-coordinate-delete', + templateUrl: './coordinate-delete.component.html', + styleUrls: ['./coordinate-delete.component.scss'] +}) +export class CoordinateDeleteComponent { + +} From 805542fc31c6bff70dcf51cf4d6710f1c7b2c79a Mon Sep 17 00:00:00 2001 From: Gerard Date: Tue, 21 Nov 2023 18:57:32 +0100 Subject: [PATCH 07/28] coordinate detail component --- src/app/app.module.ts | 1 + .../coordinate-detail/coordinate-detail.component.html | 1 + .../coordinate-detail/coordinate-detail.component.scss | 0 .../coordinate-detail/coordinate-detail.component.ts | 10 ++++++++++ 4 files changed, 12 insertions(+) create mode 100644 src/app/coordinate/coordinate-detail/coordinate-detail.component.html create mode 100644 src/app/coordinate/coordinate-detail/coordinate-detail.component.scss create mode 100644 src/app/coordinate/coordinate-detail/coordinate-detail.component.ts diff --git a/src/app/app.module.ts b/src/app/app.module.ts index e2b7cfa..08a0707 100644 --- a/src/app/app.module.ts +++ b/src/app/app.module.ts @@ -26,6 +26,7 @@ import {UserService} from './user/user.service'; import { CoordinateListComponent } from './coordinate/coordinate-list/coordinate-list.component'; import { CoordinateRoutingModule } from './coordinate/coordinate-routing.module'; import { CoordinateCreateComponent } from './coordinate/coordinate-create/coordinate-create.component'; +import { CoordinateDetailComponent } from './coordinate/coordinate-detail/coordinate-detail.component'; import { CoordinateDeleteComponent } from './coordinate/coordinate-delete/coordinate-delete.component'; @NgModule({ diff --git a/src/app/coordinate/coordinate-detail/coordinate-detail.component.html b/src/app/coordinate/coordinate-detail/coordinate-detail.component.html new file mode 100644 index 0000000..85f154b --- /dev/null +++ b/src/app/coordinate/coordinate-detail/coordinate-detail.component.html @@ -0,0 +1 @@ +

coordinate-detail works!

diff --git a/src/app/coordinate/coordinate-detail/coordinate-detail.component.scss b/src/app/coordinate/coordinate-detail/coordinate-detail.component.scss new file mode 100644 index 0000000..e69de29 diff --git a/src/app/coordinate/coordinate-detail/coordinate-detail.component.ts b/src/app/coordinate/coordinate-detail/coordinate-detail.component.ts new file mode 100644 index 0000000..427d4b7 --- /dev/null +++ b/src/app/coordinate/coordinate-detail/coordinate-detail.component.ts @@ -0,0 +1,10 @@ +import { Component } from '@angular/core'; + +@Component({ + selector: 'app-coordinate-detail', + templateUrl: './coordinate-detail.component.html', + styleUrls: ['./coordinate-detail.component.scss'] +}) +export class CoordinateDetailComponent { + +} From b5cb0dd25b8f34515af56781c3ee5c584eadecec Mon Sep 17 00:00:00 2001 From: Gerard Date: Tue, 21 Nov 2023 18:58:01 +0100 Subject: [PATCH 08/28] coordinate search component --- src/app/app.module.ts | 1 + .../coordinate-search/coordinate-search.component.html | 1 + .../coordinate-search/coordinate-search.component.scss | 0 .../coordinate-search/coordinate-search.component.ts | 10 ++++++++++ 4 files changed, 12 insertions(+) create mode 100644 src/app/coordinate/coordinate-search/coordinate-search.component.html create mode 100644 src/app/coordinate/coordinate-search/coordinate-search.component.scss create mode 100644 src/app/coordinate/coordinate-search/coordinate-search.component.ts diff --git a/src/app/app.module.ts b/src/app/app.module.ts index 08a0707..75e626e 100644 --- a/src/app/app.module.ts +++ b/src/app/app.module.ts @@ -28,6 +28,7 @@ import { CoordinateRoutingModule } from './coordinate/coordinate-routing.module' import { CoordinateCreateComponent } from './coordinate/coordinate-create/coordinate-create.component'; import { CoordinateDetailComponent } from './coordinate/coordinate-detail/coordinate-detail.component'; import { CoordinateDeleteComponent } from './coordinate/coordinate-delete/coordinate-delete.component'; +import { CoordinateSearchComponent } from './coordinate/coordinate-search/coordinate-search.component'; @NgModule({ declarations: [ diff --git a/src/app/coordinate/coordinate-search/coordinate-search.component.html b/src/app/coordinate/coordinate-search/coordinate-search.component.html new file mode 100644 index 0000000..1d7809e --- /dev/null +++ b/src/app/coordinate/coordinate-search/coordinate-search.component.html @@ -0,0 +1 @@ +

coordinate-search works!

diff --git a/src/app/coordinate/coordinate-search/coordinate-search.component.scss b/src/app/coordinate/coordinate-search/coordinate-search.component.scss new file mode 100644 index 0000000..e69de29 diff --git a/src/app/coordinate/coordinate-search/coordinate-search.component.ts b/src/app/coordinate/coordinate-search/coordinate-search.component.ts new file mode 100644 index 0000000..54b11f6 --- /dev/null +++ b/src/app/coordinate/coordinate-search/coordinate-search.component.ts @@ -0,0 +1,10 @@ +import { Component } from '@angular/core'; + +@Component({ + selector: 'app-coordinate-search', + templateUrl: './coordinate-search.component.html', + styleUrls: ['./coordinate-search.component.scss'] +}) +export class CoordinateSearchComponent { + +} From 4661511ff34241cf498c10444522b8d14f173207 Mon Sep 17 00:00:00 2001 From: Gerard Date: Tue, 21 Nov 2023 18:58:14 +0100 Subject: [PATCH 09/28] coordinate update component --- src/app/app.module.ts | 8 +++++++- .../coordinate-update/coordinate-update.component.html | 1 + .../coordinate-update/coordinate-update.component.scss | 0 .../coordinate-update/coordinate-update.component.ts | 10 ++++++++++ 4 files changed, 18 insertions(+), 1 deletion(-) create mode 100644 src/app/coordinate/coordinate-update/coordinate-update.component.html create mode 100644 src/app/coordinate/coordinate-update/coordinate-update.component.scss create mode 100644 src/app/coordinate/coordinate-update/coordinate-update.component.ts diff --git a/src/app/app.module.ts b/src/app/app.module.ts index 75e626e..259fc03 100644 --- a/src/app/app.module.ts +++ b/src/app/app.module.ts @@ -26,6 +26,7 @@ import {UserService} from './user/user.service'; import { CoordinateListComponent } from './coordinate/coordinate-list/coordinate-list.component'; import { CoordinateRoutingModule } from './coordinate/coordinate-routing.module'; import { CoordinateCreateComponent } from './coordinate/coordinate-create/coordinate-create.component'; +import { CoordinateUpdateComponent } from './coordinate/coordinate-update/coordinate-update.component'; import { CoordinateDetailComponent } from './coordinate/coordinate-detail/coordinate-detail.component'; import { CoordinateDeleteComponent } from './coordinate/coordinate-delete/coordinate-delete.component'; import { CoordinateSearchComponent } from './coordinate/coordinate-search/coordinate-search.component'; @@ -42,7 +43,12 @@ import { CoordinateSearchComponent } from './coordinate/coordinate-search/coordi UserEditComponent, UserDeleteComponent, UserSearchComponent, - CoordinateListComponent + CoordinateListComponent, + CoordinateCreateComponent, + CoordinateUpdateComponent, + CoordinateDetailComponent, + CoordinateDeleteComponent, + CoordinateSearchComponent ], imports: [ BrowserModule, diff --git a/src/app/coordinate/coordinate-update/coordinate-update.component.html b/src/app/coordinate/coordinate-update/coordinate-update.component.html new file mode 100644 index 0000000..ee09501 --- /dev/null +++ b/src/app/coordinate/coordinate-update/coordinate-update.component.html @@ -0,0 +1 @@ +

coordinate-update works!

diff --git a/src/app/coordinate/coordinate-update/coordinate-update.component.scss b/src/app/coordinate/coordinate-update/coordinate-update.component.scss new file mode 100644 index 0000000..e69de29 diff --git a/src/app/coordinate/coordinate-update/coordinate-update.component.ts b/src/app/coordinate/coordinate-update/coordinate-update.component.ts new file mode 100644 index 0000000..f3cf8dc --- /dev/null +++ b/src/app/coordinate/coordinate-update/coordinate-update.component.ts @@ -0,0 +1,10 @@ +import { Component } from '@angular/core'; + +@Component({ + selector: 'app-coordinate-update', + templateUrl: './coordinate-update.component.html', + styleUrls: ['./coordinate-update.component.scss'] +}) +export class CoordinateUpdateComponent { + +} From a0fb0ac77ffa136138070bc598a8449e88a8df75 Mon Sep 17 00:00:00 2001 From: Gerard Date: Tue, 21 Nov 2023 18:59:22 +0100 Subject: [PATCH 10/28] coordinate format components --- .../coordinate-create.component.ts | 2 +- .../coordinate-delete.component.ts | 2 +- .../coordinate-detail.component.ts | 2 +- .../coordinate-list/coordinate-list.component.ts | 2 +- src/app/coordinate/coordinate-routing.module.ts | 7 ++++--- .../coordinate-search.component.ts | 2 +- .../coordinate-update.component.ts | 2 +- src/app/coordinate/coordinate.service.ts | 15 +++++---------- src/app/coordinate/coordinate.ts | 3 ++- 9 files changed, 17 insertions(+), 20 deletions(-) diff --git a/src/app/coordinate/coordinate-create/coordinate-create.component.ts b/src/app/coordinate/coordinate-create/coordinate-create.component.ts index 784b0f5..7f6e2d2 100644 --- a/src/app/coordinate/coordinate-create/coordinate-create.component.ts +++ b/src/app/coordinate/coordinate-create/coordinate-create.component.ts @@ -1,4 +1,4 @@ -import { Component } from '@angular/core'; +import {Component} from '@angular/core'; @Component({ selector: 'app-coordinate-create', diff --git a/src/app/coordinate/coordinate-delete/coordinate-delete.component.ts b/src/app/coordinate/coordinate-delete/coordinate-delete.component.ts index 3bfad0c..dee16b5 100644 --- a/src/app/coordinate/coordinate-delete/coordinate-delete.component.ts +++ b/src/app/coordinate/coordinate-delete/coordinate-delete.component.ts @@ -1,4 +1,4 @@ -import { Component } from '@angular/core'; +import {Component} from '@angular/core'; @Component({ selector: 'app-coordinate-delete', diff --git a/src/app/coordinate/coordinate-detail/coordinate-detail.component.ts b/src/app/coordinate/coordinate-detail/coordinate-detail.component.ts index 427d4b7..6b44033 100644 --- a/src/app/coordinate/coordinate-detail/coordinate-detail.component.ts +++ b/src/app/coordinate/coordinate-detail/coordinate-detail.component.ts @@ -1,4 +1,4 @@ -import { Component } from '@angular/core'; +import {Component} from '@angular/core'; @Component({ selector: 'app-coordinate-detail', diff --git a/src/app/coordinate/coordinate-list/coordinate-list.component.ts b/src/app/coordinate/coordinate-list/coordinate-list.component.ts index 07b421b..a3393cc 100644 --- a/src/app/coordinate/coordinate-list/coordinate-list.component.ts +++ b/src/app/coordinate/coordinate-list/coordinate-list.component.ts @@ -1,4 +1,4 @@ -import { Component } from '@angular/core'; +import {Component} from '@angular/core'; @Component({ selector: 'app-coordinate-list', diff --git a/src/app/coordinate/coordinate-routing.module.ts b/src/app/coordinate/coordinate-routing.module.ts index c453ffe..23962ea 100644 --- a/src/app/coordinate/coordinate-routing.module.ts +++ b/src/app/coordinate/coordinate-routing.module.ts @@ -1,10 +1,10 @@ -import { NgModule } from '@angular/core'; +import {NgModule} from '@angular/core'; import {RouterModule, Routes} from "@angular/router"; import {CoordinateListComponent} from "./coordinate-list/coordinate-list.component"; const routes: Routes = [ - { path: 'coordinates/list', component: CoordinateListComponent}, + {path: 'coordinates/list', component: CoordinateListComponent}, ]; @@ -12,4 +12,5 @@ const routes: Routes = [ imports: [RouterModule.forChild(routes)], exports: [RouterModule] }) -export class CoordinateRoutingModule { } +export class CoordinateRoutingModule { +} diff --git a/src/app/coordinate/coordinate-search/coordinate-search.component.ts b/src/app/coordinate/coordinate-search/coordinate-search.component.ts index 54b11f6..0b02cde 100644 --- a/src/app/coordinate/coordinate-search/coordinate-search.component.ts +++ b/src/app/coordinate/coordinate-search/coordinate-search.component.ts @@ -1,4 +1,4 @@ -import { Component } from '@angular/core'; +import {Component} from '@angular/core'; @Component({ selector: 'app-coordinate-search', diff --git a/src/app/coordinate/coordinate-update/coordinate-update.component.ts b/src/app/coordinate/coordinate-update/coordinate-update.component.ts index f3cf8dc..d2d8c66 100644 --- a/src/app/coordinate/coordinate-update/coordinate-update.component.ts +++ b/src/app/coordinate/coordinate-update/coordinate-update.component.ts @@ -1,4 +1,4 @@ -import { Component } from '@angular/core'; +import {Component} from '@angular/core'; @Component({ selector: 'app-coordinate-update', diff --git a/src/app/coordinate/coordinate.service.ts b/src/app/coordinate/coordinate.service.ts index afd4071..2dd62af 100644 --- a/src/app/coordinate/coordinate.service.ts +++ b/src/app/coordinate/coordinate.service.ts @@ -1,19 +1,14 @@ -import { Injectable } from '@angular/core'; -import { Coordinate } from './coordinate'; - -import { Observable } from 'rxjs'; -import { HttpClient } from '@angular/common/http'; +import {Injectable} from '@angular/core'; +import {Coordinate} from './coordinate'; +import {HttpClient} from '@angular/common/http'; /* import { Observable } from 'rxjs/internal/Observable'; */ -import { - HateoasResourceOperation, - ResourceCollection, -} from '@lagoshny/ngx-hateoas-client'; +import {HateoasResourceOperation,} from '@lagoshny/ngx-hateoas-client'; @Injectable({ providedIn: 'root' }) -export class CoordinateService extends HateoasResourceOperation { +export class CoordinateService extends HateoasResourceOperation { constructor(private http: HttpClient) { super(Coordinate); } diff --git a/src/app/coordinate/coordinate.ts b/src/app/coordinate/coordinate.ts index 89b82ee..4d72f0d 100644 --- a/src/app/coordinate/coordinate.ts +++ b/src/app/coordinate/coordinate.ts @@ -1,9 +1,10 @@ -import { HateoasResource, Resource } from '@lagoshny/ngx-hateoas-client'; +import {HateoasResource, Resource} from '@lagoshny/ngx-hateoas-client'; @HateoasResource('coordinates') export class Coordinate extends Resource { id: number coordinate: string + // routeVersion: RouteVersion constructor(values: object = {}) { From a6900fcb43aae99728d006a8f3fd41132c8d032b Mon Sep 17 00:00:00 2001 From: Gerard Date: Tue, 21 Nov 2023 19:06:50 +0100 Subject: [PATCH 11/28] coordinates routing components --- src/app/coordinate/coordinate-routing.module.ts | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/app/coordinate/coordinate-routing.module.ts b/src/app/coordinate/coordinate-routing.module.ts index 23962ea..839d86f 100644 --- a/src/app/coordinate/coordinate-routing.module.ts +++ b/src/app/coordinate/coordinate-routing.module.ts @@ -1,13 +1,21 @@ import {NgModule} from '@angular/core'; import {RouterModule, Routes} from "@angular/router"; import {CoordinateListComponent} from "./coordinate-list/coordinate-list.component"; +import {CoordinateCreateComponent} from "./coordinate-create/coordinate-create.component"; +import {CoordinateSearchComponent} from "./coordinate-search/coordinate-search.component"; +import {CoordinateUpdateComponent} from "./coordinate-update/coordinate-update.component"; +import {CoordinateDeleteComponent} from "./coordinate-delete/coordinate-delete.component"; +import {CoordinateDetailComponent} from "./coordinate-detail/coordinate-detail.component"; const routes: Routes = [ - {path: 'coordinates/list', component: CoordinateListComponent}, + {path: 'coordinates', component: CoordinateListComponent}, + {path: 'coordinates/create', component: CoordinateCreateComponent}, + {path: 'coordinates/:id', component: CoordinateDetailComponent}, + {path: 'coordinates/:id/edit', component: CoordinateUpdateComponent}, + {path: 'coordinates/:id/delete', component: CoordinateDeleteComponent}, ]; - @NgModule({ imports: [RouterModule.forChild(routes)], exports: [RouterModule] From 7f565ecaeda4721ea7c7e183611c20c44969ee79 Mon Sep 17 00:00:00 2001 From: Gerard Date: Wed, 22 Nov 2023 17:49:10 +0100 Subject: [PATCH 12/28] coordinate module extraction --- src/app/app-routing.module.ts | 1 + src/app/app.module.ts | 16 ++------- .../coordinate/coordinate-routing.module.ts | 12 ++++--- src/app/coordinate/coordinate.module.ts | 36 +++++++++++++++++++ src/app/coordinate/coordinate.service.ts | 6 ++-- src/app/coordinate/coordinate.ts | 14 -------- 6 files changed, 49 insertions(+), 36 deletions(-) create mode 100644 src/app/coordinate/coordinate.module.ts delete mode 100644 src/app/coordinate/coordinate.ts diff --git a/src/app/app-routing.module.ts b/src/app/app-routing.module.ts index 1f6d256..cecdbfd 100644 --- a/src/app/app-routing.module.ts +++ b/src/app/app-routing.module.ts @@ -18,6 +18,7 @@ const routes: Routes = [ { path: 'about', component: AboutComponent}, { path: '404', component: NotFoundComponent}, { path: '', redirectTo: 'about', pathMatch: 'full'}, + { path: 'coordinates', loadChildren: () => import('./coordinate/coordinate-routing.module').then(m => m.CoordinateRoutingModule), canActivate: [LoggedInGuard]}, ]; @NgModule({ diff --git a/src/app/app.module.ts b/src/app/app.module.ts index 259fc03..50c99bc 100644 --- a/src/app/app.module.ts +++ b/src/app/app.module.ts @@ -23,13 +23,7 @@ import {HttpErrorInterceptor} from './error-handler/http-error-interceptor'; import {AuthenticationBasicService} from './login-basic/authentication-basic.service'; import {LoggedInGuard} from './login-basic/loggedin.guard'; import {UserService} from './user/user.service'; -import { CoordinateListComponent } from './coordinate/coordinate-list/coordinate-list.component'; -import { CoordinateRoutingModule } from './coordinate/coordinate-routing.module'; -import { CoordinateCreateComponent } from './coordinate/coordinate-create/coordinate-create.component'; -import { CoordinateUpdateComponent } from './coordinate/coordinate-update/coordinate-update.component'; -import { CoordinateDetailComponent } from './coordinate/coordinate-detail/coordinate-detail.component'; -import { CoordinateDeleteComponent } from './coordinate/coordinate-delete/coordinate-delete.component'; -import { CoordinateSearchComponent } from './coordinate/coordinate-search/coordinate-search.component'; +import {CoordinateModule} from "./coordinate/coordinate.module"; @NgModule({ declarations: [ @@ -43,12 +37,6 @@ import { CoordinateSearchComponent } from './coordinate/coordinate-search/coordi UserEditComponent, UserDeleteComponent, UserSearchComponent, - CoordinateListComponent, - CoordinateCreateComponent, - CoordinateUpdateComponent, - CoordinateDetailComponent, - CoordinateDeleteComponent, - CoordinateSearchComponent ], imports: [ BrowserModule, @@ -63,7 +51,7 @@ import { CoordinateSearchComponent } from './coordinate/coordinate-search/coordi ErrorHandlerModule, NgbModule, ReactiveFormsModule, - CoordinateRoutingModule + CoordinateModule ], providers: [ { provide: HTTP_INTERCEPTORS, useClass: AuthInterceptor, multi: true }, diff --git a/src/app/coordinate/coordinate-routing.module.ts b/src/app/coordinate/coordinate-routing.module.ts index 839d86f..5806c96 100644 --- a/src/app/coordinate/coordinate-routing.module.ts +++ b/src/app/coordinate/coordinate-routing.module.ts @@ -9,11 +9,13 @@ import {CoordinateDetailComponent} from "./coordinate-detail/coordinate-detail.c const routes: Routes = [ - {path: 'coordinates', component: CoordinateListComponent}, - {path: 'coordinates/create', component: CoordinateCreateComponent}, - {path: 'coordinates/:id', component: CoordinateDetailComponent}, - {path: 'coordinates/:id/edit', component: CoordinateUpdateComponent}, - {path: 'coordinates/:id/delete', component: CoordinateDeleteComponent}, + {path: '', component: CoordinateListComponent}, + {path: 'create', component: CoordinateCreateComponent}, + {path: ':id', component: CoordinateDetailComponent}, + {path: ':id/edit', component: CoordinateUpdateComponent}, + {path: ':id/delete', component: CoordinateDeleteComponent}, + { path: '**', redirectTo: ''}, + ]; @NgModule({ diff --git a/src/app/coordinate/coordinate.module.ts b/src/app/coordinate/coordinate.module.ts new file mode 100644 index 0000000..92fb8bf --- /dev/null +++ b/src/app/coordinate/coordinate.module.ts @@ -0,0 +1,36 @@ +import {NgModule} from "@angular/core"; +import {CoordinateListComponent} from "./coordinate-list/coordinate-list.component"; +import {CoordinateCreateComponent} from "./coordinate-create/coordinate-create.component"; +import {CoordinateUpdateComponent} from "./coordinate-update/coordinate-update.component"; +import {CoordinateDetailComponent} from "./coordinate-detail/coordinate-detail.component"; +import {CoordinateDeleteComponent} from "./coordinate-delete/coordinate-delete.component"; +import {CoordinateSearchComponent} from "./coordinate-search/coordinate-search.component"; +import {CoordinateRoutingModule} from "./coordinate-routing.module"; +import {HTTP_INTERCEPTORS} from "@angular/common/http"; +import {AuthInterceptor} from "../login-basic/auth-interceptor"; +import {HttpErrorInterceptor} from "../error-handler/http-error-interceptor"; +import {AuthenticationBasicService} from "../login-basic/authentication-basic.service"; +import {LoggedInGuard} from "../login-basic/loggedin.guard"; +import {UserService} from "../user/user.service"; +import {AppComponent} from "../app.component"; + +@NgModule({ + declarations: [ + CoordinateListComponent, + CoordinateCreateComponent, + CoordinateUpdateComponent, + CoordinateDetailComponent, + CoordinateDeleteComponent, + CoordinateSearchComponent + ], + imports: [ + CoordinateRoutingModule + ], + providers: [ + { provide: HTTP_INTERCEPTORS, useClass: AuthInterceptor, multi: true }, + { provide: HTTP_INTERCEPTORS, useClass: HttpErrorInterceptor, multi: true }, + AuthenticationBasicService, LoggedInGuard, UserService + ], + bootstrap: [AppComponent] +}) +export class CoordinateModule { } diff --git a/src/app/coordinate/coordinate.service.ts b/src/app/coordinate/coordinate.service.ts index 2dd62af..21a56c1 100644 --- a/src/app/coordinate/coordinate.service.ts +++ b/src/app/coordinate/coordinate.service.ts @@ -1,5 +1,5 @@ import {Injectable} from '@angular/core'; -import {Coordinate} from './coordinate'; +import {CoordinateModule} from './coordinate.module'; import {HttpClient} from '@angular/common/http'; /* import { Observable } from 'rxjs/internal/Observable'; */ @@ -8,8 +8,8 @@ import {HateoasResourceOperation,} from '@lagoshny/ngx-hateoas-client'; @Injectable({ providedIn: 'root' }) -export class CoordinateService extends HateoasResourceOperation { +export class CoordinateService extends HateoasResourceOperation { constructor(private http: HttpClient) { - super(Coordinate); + super(CoordinateModule); } } diff --git a/src/app/coordinate/coordinate.ts b/src/app/coordinate/coordinate.ts deleted file mode 100644 index 4d72f0d..0000000 --- a/src/app/coordinate/coordinate.ts +++ /dev/null @@ -1,14 +0,0 @@ -import {HateoasResource, Resource} from '@lagoshny/ngx-hateoas-client'; - -@HateoasResource('coordinates') -export class Coordinate extends Resource { - id: number - coordinate: string - - // routeVersion: RouteVersion - - constructor(values: object = {}) { - super(); - Object.assign(this as any, values); - } -} From f5a135c8c354c7418ea29962213ec0ac26d0d76d Mon Sep 17 00:00:00 2001 From: Gerard Date: Wed, 6 Dec 2023 18:41:18 +0100 Subject: [PATCH 13/28] Auto stash before merge of "coordinate-entity" and "origin/main" --- src/app/app-routing.module.ts | 2 +- src/app/app.module.ts | 2 +- src/app/coordinate/coordinate.module.ts | 3 +-- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/src/app/app-routing.module.ts b/src/app/app-routing.module.ts index ad5fadb..7b43e17 100644 --- a/src/app/app-routing.module.ts +++ b/src/app/app-routing.module.ts @@ -31,7 +31,7 @@ const routes: Routes = [ { path: 'about', component: AboutComponent}, { path: '404', component: NotFoundComponent}, { path: '', redirectTo: 'about', pathMatch: 'full'}, - { path: 'coordinates', loadChildren: () => import('./coordinate/coordinate-routing.module').then(m => m.CoordinateRoutingModule), canActivate: [LoggedInGuard]}, + { path: 'coordinates', loadChildren: () => import('./coordinate/coordinate-routing.module').then(m => m.CoordinateRoutingModule), canActivate: [CheckIsNotAdminGuard]}, ]; @NgModule({ diff --git a/src/app/app.module.ts b/src/app/app.module.ts index 6007a54..5af5a3d 100644 --- a/src/app/app.module.ts +++ b/src/app/app.module.ts @@ -48,7 +48,7 @@ import {PermissionsService } from "./login-basic/authentication.guard"; UserSearchComponent, RouteCreateComponent, RouteListComponent, - RouteFilterComponent + RouteFilterComponent, RouteSearchComponent, RouteDeleteComponent, RouteEditComponent, diff --git a/src/app/coordinate/coordinate.module.ts b/src/app/coordinate/coordinate.module.ts index 92fb8bf..75d115a 100644 --- a/src/app/coordinate/coordinate.module.ts +++ b/src/app/coordinate/coordinate.module.ts @@ -10,7 +10,6 @@ import {HTTP_INTERCEPTORS} from "@angular/common/http"; import {AuthInterceptor} from "../login-basic/auth-interceptor"; import {HttpErrorInterceptor} from "../error-handler/http-error-interceptor"; import {AuthenticationBasicService} from "../login-basic/authentication-basic.service"; -import {LoggedInGuard} from "../login-basic/loggedin.guard"; import {UserService} from "../user/user.service"; import {AppComponent} from "../app.component"; @@ -29,7 +28,7 @@ import {AppComponent} from "../app.component"; providers: [ { provide: HTTP_INTERCEPTORS, useClass: AuthInterceptor, multi: true }, { provide: HTTP_INTERCEPTORS, useClass: HttpErrorInterceptor, multi: true }, - AuthenticationBasicService, LoggedInGuard, UserService + AuthenticationBasicService, UserService ], bootstrap: [AppComponent] }) From 977462679de82f2a442daf803e23964d4614f8bf Mon Sep 17 00:00:00 2001 From: Gerard Date: Wed, 6 Dec 2023 18:42:03 +0100 Subject: [PATCH 14/28] Auto stash before merge of "coordinate-entity" and "origin/main" --- angular.json | 5 ++ .../coordinate-list.component.html | 33 +++++++++- .../coordinate-list.component.ts | 62 +++++++++++++++++++ src/app/coordinate/coordinate.entity.ts | 8 +++ src/app/coordinate/coordinate.module.ts | 8 ++- src/app/coordinate/coordinate.service.ts | 7 +-- 6 files changed, 117 insertions(+), 6 deletions(-) create mode 100644 src/app/coordinate/coordinate.entity.ts diff --git a/angular.json b/angular.json index 5882a41..cbe2323 100644 --- a/angular.json +++ b/angular.json @@ -36,6 +36,11 @@ "styles": [ "node_modules/bootstrap/dist/css/bootstrap.min.css", "node_modules/@fortawesome/fontawesome-free/css/all.css", + "./node_modules/@swimlane/ngx-datatable/index.css", + "./node_modules/@swimlane/ngx-datatable/themes/material.scss", + "./node_modules/@swimlane/ngx-datatable/themes/dark.scss", + "./node_modules/@swimlane/ngx-datatable/themes/bootstrap.scss", + "./node_modules/@swimlane/ngx-datatable/assets/icons.css", "src/styles.css" ], "scripts": [] diff --git a/src/app/coordinate/coordinate-list/coordinate-list.component.html b/src/app/coordinate/coordinate-list/coordinate-list.component.html index e27d45c..2ebc46e 100644 --- a/src/app/coordinate/coordinate-list/coordinate-list.component.html +++ b/src/app/coordinate/coordinate-list/coordinate-list.component.html @@ -1 +1,32 @@ -

coordinate-list works!

+
+

+ Client-side Search and Filtering + + + Source + + +

+ + + +
diff --git a/src/app/coordinate/coordinate-list/coordinate-list.component.ts b/src/app/coordinate/coordinate-list/coordinate-list.component.ts index a3393cc..7944476 100644 --- a/src/app/coordinate/coordinate-list/coordinate-list.component.ts +++ b/src/app/coordinate/coordinate-list/coordinate-list.component.ts @@ -1,4 +1,10 @@ import {Component} from '@angular/core'; +import {Coordinate} from "../coordinate.entity"; +import {Router} from "@angular/router"; +import {CoordinateService} from "../coordinate.service"; +import {AuthenticationBasicService} from "../../login-basic/authentication-basic.service"; +import {PagedResourceCollection} from "@lagoshny/ngx-hateoas-client"; +import {ColumnMode} from "@swimlane/ngx-datatable"; @Component({ selector: 'app-coordinate-list', @@ -6,5 +12,61 @@ import {Component} from '@angular/core'; styleUrls: ['./coordinate-list.component.scss'] }) export class CoordinateListComponent { + public coordinates: Coordinate[] = []; + public pageSize = 5; + public page = 1; + public totalCoordinates = 0; + public sortBy = 'Coordinate'; + public sortOrder = 'A-Z'; + rows = [ + { name: 'Austin', gender: 'Male', company: 'Swimlane' }, + { name: 'Dany', gender: 'Male', company: 'KFC' }, + { name: 'Molly', gender: 'Female', company: 'Burger King' } + ]; + columns = [{ prop: 'name' }, { name: 'Gender' }, { name: 'Company' }]; + constructor( + public router: Router, + private coordinateService: CoordinateService, + private authenticationService: AuthenticationBasicService + ) { + } + + ngOnInit() { + this.coordinateService.getPage({ + pageParams: {size: this.pageSize}, + sort: {coordinate: 'ASC'}, + }).subscribe((page: PagedResourceCollection) => { + this.coordinates = page.resources; + this.totalCoordinates = page.totalElements; + // this.sortSeeds(); + }); + + } + + isRole(admin: string) { + return true; + } + + searchSeeds($event: any) { + + } + + updateSortOrder(az: string) { + + } + + changePage() { + + } + + detail(coordinates: Coordinate[]) { + + } + + protected readonly ColumnMode = ColumnMode; + + updateFilter($event: KeyboardEvent) { + + } } diff --git a/src/app/coordinate/coordinate.entity.ts b/src/app/coordinate/coordinate.entity.ts new file mode 100644 index 0000000..1cf0e6d --- /dev/null +++ b/src/app/coordinate/coordinate.entity.ts @@ -0,0 +1,8 @@ +import { HateoasResource, Resource } from '@lagoshny/ngx-hateoas-client'; + +@HateoasResource('coordinates') +export class Coordinate extends Resource { + coordinate: string; + // routeVersion: RouteVersion; + +} diff --git a/src/app/coordinate/coordinate.module.ts b/src/app/coordinate/coordinate.module.ts index 75d115a..5498425 100644 --- a/src/app/coordinate/coordinate.module.ts +++ b/src/app/coordinate/coordinate.module.ts @@ -12,6 +12,9 @@ import {HttpErrorInterceptor} from "../error-handler/http-error-interceptor"; import {AuthenticationBasicService} from "../login-basic/authentication-basic.service"; import {UserService} from "../user/user.service"; import {AppComponent} from "../app.component"; +import {NgbPagination} from "@ng-bootstrap/ng-bootstrap"; +import {NgForOf} from "@angular/common"; +import {NgxDatatableModule} from "@swimlane/ngx-datatable"; @NgModule({ declarations: [ @@ -23,7 +26,10 @@ import {AppComponent} from "../app.component"; CoordinateSearchComponent ], imports: [ - CoordinateRoutingModule + CoordinateRoutingModule, + NgbPagination, + NgForOf, + NgxDatatableModule ], providers: [ { provide: HTTP_INTERCEPTORS, useClass: AuthInterceptor, multi: true }, diff --git a/src/app/coordinate/coordinate.service.ts b/src/app/coordinate/coordinate.service.ts index 21a56c1..e395409 100644 --- a/src/app/coordinate/coordinate.service.ts +++ b/src/app/coordinate/coordinate.service.ts @@ -1,15 +1,14 @@ import {Injectable} from '@angular/core'; -import {CoordinateModule} from './coordinate.module'; import {HttpClient} from '@angular/common/http'; -/* import { Observable } from 'rxjs/internal/Observable'; */ import {HateoasResourceOperation,} from '@lagoshny/ngx-hateoas-client'; +import {Coordinate} from "./coordinate.entity"; @Injectable({ providedIn: 'root' }) -export class CoordinateService extends HateoasResourceOperation { +export class CoordinateService extends HateoasResourceOperation { constructor(private http: HttpClient) { - super(CoordinateModule); + super(Coordinate); } } From 613f27eb8aa3097c48d1b380ccadfcfc28e27e1d Mon Sep 17 00:00:00 2001 From: Gerard Date: Wed, 6 Dec 2023 20:28:42 +0100 Subject: [PATCH 15/28] coordinate list datatable --- .../coordinate-list.component.html | 34 ++++++++++++++++--- 1 file changed, 30 insertions(+), 4 deletions(-) diff --git a/src/app/coordinate/coordinate-list/coordinate-list.component.html b/src/app/coordinate/coordinate-list/coordinate-list.component.html index 2ebc46e..ec8d9f0 100644 --- a/src/app/coordinate/coordinate-list/coordinate-list.component.html +++ b/src/app/coordinate/coordinate-list/coordinate-list.component.html @@ -17,16 +17,42 @@

(keyup)="updateFilter($event)" /> + + + + {{ column.name }} + + + {{ value }} + + + + + + + + From 569e875ab888e9f38ffe65ee0219177af963cf70 Mon Sep 17 00:00:00 2001 From: Gerard Date: Wed, 6 Dec 2023 20:29:04 +0100 Subject: [PATCH 16/28] coordinate list logic --- .../coordinate-list.component.ts | 86 ++++++++++++------- 1 file changed, 56 insertions(+), 30 deletions(-) diff --git a/src/app/coordinate/coordinate-list/coordinate-list.component.ts b/src/app/coordinate/coordinate-list/coordinate-list.component.ts index 7944476..c25b032 100644 --- a/src/app/coordinate/coordinate-list/coordinate-list.component.ts +++ b/src/app/coordinate/coordinate-list/coordinate-list.component.ts @@ -1,64 +1,62 @@ -import {Component} from '@angular/core'; +import {Component, OnInit, ViewChild} from '@angular/core'; import {Coordinate} from "../coordinate.entity"; import {Router} from "@angular/router"; import {CoordinateService} from "../coordinate.service"; import {AuthenticationBasicService} from "../../login-basic/authentication-basic.service"; import {PagedResourceCollection} from "@lagoshny/ngx-hateoas-client"; -import {ColumnMode} from "@swimlane/ngx-datatable"; +import {ColumnMode, DatatableComponent} from "@swimlane/ngx-datatable"; +import {User} from "../../login-basic/user"; @Component({ selector: 'app-coordinate-list', templateUrl: './coordinate-list.component.html', styleUrls: ['./coordinate-list.component.scss'] }) -export class CoordinateListComponent { + +export class CoordinateListComponent implements OnInit { public coordinates: Coordinate[] = []; - public pageSize = 5; - public page = 1; + public pageSize = 10; + public currentPage = 1; public totalCoordinates = 0; - public sortBy = 'Coordinate'; - public sortOrder = 'A-Z'; + temp = []; + @ViewChild(DatatableComponent) tableCoordinates: DatatableComponent; + loading: boolean = true; rows = [ - { name: 'Austin', gender: 'Male', company: 'Swimlane' }, - { name: 'Dany', gender: 'Male', company: 'KFC' }, - { name: 'Molly', gender: 'Female', company: 'Burger King' } + //{ coordinate: 'test,test' }, + //{ coordinate: '1232131,122312331' }, ]; - columns = [{ prop: 'name' }, { name: 'Gender' }, { name: 'Company' }]; + columns = [ + // { prop: 'id', name: 'ID' }, + { prop: 'coordinate', name: 'Coordinate' }, + {name: 'Actions', prop: 'actions', sortable: false, 'template': true}]; constructor( public router: Router, private coordinateService: CoordinateService, private authenticationService: AuthenticationBasicService ) { + this.temp = this.rows; } ngOnInit() { + this.loading = true; this.coordinateService.getPage({ - pageParams: {size: this.pageSize}, + pageParams: {size: this.pageSize, page: this.currentPage}, sort: {coordinate: 'ASC'}, }).subscribe((page: PagedResourceCollection) => { this.coordinates = page.resources; this.totalCoordinates = page.totalElements; - // this.sortSeeds(); + this.coordinates.map(coordinate => { + this.rows.push({coordinate: coordinate.coordinate}); + }); + this.temp = this.rows; + this.rows = [...this.rows]; + this.loading = false; + this.tableCoordinates.offset = 0; }); } - isRole(admin: string) { - return true; - } - - searchSeeds($event: any) { - - } - - updateSortOrder(az: string) { - - } - - changePage() { - - } detail(coordinates: Coordinate[]) { @@ -66,7 +64,35 @@ export class CoordinateListComponent { protected readonly ColumnMode = ColumnMode; - updateFilter($event: KeyboardEvent) { - + updateFilter(event) { + this.loading = true; + const val = event.target.value.toLowerCase(); + const temp = this.temp.filter(function (d) { + // return d.id.toLowerCase().indexOf(val) !== -1 || !val || d.coordinate.toLowerCase().indexOf(val) !== -1; + return !val || d.coordinate.toLowerCase().indexOf(val) !== -1; + }); + this.rows = temp; + this.tableCoordinates.offset = 0; + this.loading = false; + } + + setPage(pageInfo) { + this.currentPage = pageInfo.offset; + this.loading = true; + this.rows = []; + this.coordinateService.getPage({ + pageParams: {size: this.pageSize, page: this.currentPage}, + sort: {coordinate: 'ASC'}, + }).subscribe((page: PagedResourceCollection) => { + this.coordinates = page.resources; + this.totalCoordinates = page.totalElements; + this.coordinates.map(coordinate => { + this.rows.push({coordinate: coordinate.coordinate}); + }); + this.temp = this.rows; + this.rows = [...this.rows]; + this.loading = false; + this.tableCoordinates.offset = 0; + }); } } From 31908a5a62727895689e07ee69128ec324795844 Mon Sep 17 00:00:00 2001 From: Gerard Date: Wed, 6 Dec 2023 20:29:11 +0100 Subject: [PATCH 17/28] coordinate list module --- src/app/coordinate/coordinate.module.ts | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/src/app/coordinate/coordinate.module.ts b/src/app/coordinate/coordinate.module.ts index 5498425..bed86b2 100644 --- a/src/app/coordinate/coordinate.module.ts +++ b/src/app/coordinate/coordinate.module.ts @@ -13,7 +13,7 @@ import {AuthenticationBasicService} from "../login-basic/authentication-basic.se import {UserService} from "../user/user.service"; import {AppComponent} from "../app.component"; import {NgbPagination} from "@ng-bootstrap/ng-bootstrap"; -import {NgForOf} from "@angular/common"; +import {NgForOf, NgIf} from "@angular/common"; import {NgxDatatableModule} from "@swimlane/ngx-datatable"; @NgModule({ @@ -25,12 +25,13 @@ import {NgxDatatableModule} from "@swimlane/ngx-datatable"; CoordinateDeleteComponent, CoordinateSearchComponent ], - imports: [ - CoordinateRoutingModule, - NgbPagination, - NgForOf, - NgxDatatableModule - ], + imports: [ + CoordinateRoutingModule, + NgbPagination, + NgForOf, + NgxDatatableModule, + NgIf + ], providers: [ { provide: HTTP_INTERCEPTORS, useClass: AuthInterceptor, multi: true }, { provide: HTTP_INTERCEPTORS, useClass: HttpErrorInterceptor, multi: true }, From fd1f7be08842fad546360e41d8f59df44ae2c2e3 Mon Sep 17 00:00:00 2001 From: Gerard Date: Thu, 7 Dec 2023 01:57:46 +0100 Subject: [PATCH 18/28] reactive forms --- src/app/coordinate/coordinate.module.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/app/coordinate/coordinate.module.ts b/src/app/coordinate/coordinate.module.ts index bed86b2..b7079ba 100644 --- a/src/app/coordinate/coordinate.module.ts +++ b/src/app/coordinate/coordinate.module.ts @@ -15,6 +15,7 @@ import {AppComponent} from "../app.component"; import {NgbPagination} from "@ng-bootstrap/ng-bootstrap"; import {NgForOf, NgIf} from "@angular/common"; import {NgxDatatableModule} from "@swimlane/ngx-datatable"; +import {ReactiveFormsModule} from "@angular/forms"; @NgModule({ declarations: [ @@ -30,7 +31,8 @@ import {NgxDatatableModule} from "@swimlane/ngx-datatable"; NgbPagination, NgForOf, NgxDatatableModule, - NgIf + NgIf, + ReactiveFormsModule ], providers: [ { provide: HTTP_INTERCEPTORS, useClass: AuthInterceptor, multi: true }, From 525d4abf0d10aaec9145e5ff73f710017a2ab20a Mon Sep 17 00:00:00 2001 From: Gerard Date: Thu, 7 Dec 2023 01:58:21 +0100 Subject: [PATCH 19/28] coordinate list pagination, action buttons --- .../coordinate-list.component.html | 53 +++++++++++------- .../coordinate-list.component.ts | 55 +++++++++---------- 2 files changed, 59 insertions(+), 49 deletions(-) diff --git a/src/app/coordinate/coordinate-list/coordinate-list.component.html b/src/app/coordinate/coordinate-list/coordinate-list.component.html index ec8d9f0..dbf2a73 100644 --- a/src/app/coordinate/coordinate-list/coordinate-list.component.html +++ b/src/app/coordinate/coordinate-list/coordinate-list.component.html @@ -1,24 +1,33 @@
-

- Client-side Search and Filtering - - - Source - - -

- +
+
+

Coordinates List

+
+
+
+ +
+
+
+
+
+
+ + +
+
+
+ - - + + + + diff --git a/src/app/coordinate/coordinate-list/coordinate-list.component.ts b/src/app/coordinate/coordinate-list/coordinate-list.component.ts index c25b032..260d163 100644 --- a/src/app/coordinate/coordinate-list/coordinate-list.component.ts +++ b/src/app/coordinate/coordinate-list/coordinate-list.component.ts @@ -5,7 +5,6 @@ import {CoordinateService} from "../coordinate.service"; import {AuthenticationBasicService} from "../../login-basic/authentication-basic.service"; import {PagedResourceCollection} from "@lagoshny/ngx-hateoas-client"; import {ColumnMode, DatatableComponent} from "@swimlane/ngx-datatable"; -import {User} from "../../login-basic/user"; @Component({ selector: 'app-coordinate-list', @@ -15,12 +14,13 @@ import {User} from "../../login-basic/user"; export class CoordinateListComponent implements OnInit { public coordinates: Coordinate[] = []; - public pageSize = 10; - public currentPage = 1; + public pageSize = 5; + public currentPage = 0; public totalCoordinates = 0; temp = []; @ViewChild(DatatableComponent) tableCoordinates: DatatableComponent; loading: boolean = true; + protected readonly ColumnMode = ColumnMode; rows = [ //{ coordinate: 'test,test' }, //{ coordinate: '1232131,122312331' }, @@ -35,26 +35,10 @@ export class CoordinateListComponent implements OnInit { private coordinateService: CoordinateService, private authenticationService: AuthenticationBasicService ) { - this.temp = this.rows; } ngOnInit() { - this.loading = true; - this.coordinateService.getPage({ - pageParams: {size: this.pageSize, page: this.currentPage}, - sort: {coordinate: 'ASC'}, - }).subscribe((page: PagedResourceCollection) => { - this.coordinates = page.resources; - this.totalCoordinates = page.totalElements; - this.coordinates.map(coordinate => { - this.rows.push({coordinate: coordinate.coordinate}); - }); - this.temp = this.rows; - this.rows = [...this.rows]; - this.loading = false; - this.tableCoordinates.offset = 0; - }); - + this.getCoordinates(); } @@ -62,27 +46,31 @@ export class CoordinateListComponent implements OnInit { } - protected readonly ColumnMode = ColumnMode; - updateFilter(event) { - this.loading = true; const val = event.target.value.toLowerCase(); - const temp = this.temp.filter(function (d) { + if (val.length <= 3) return; + this.loading = true; + + // this.getCoordinatesByCoordinate(val); + + this.rows = this.temp.filter(function (d) { // return d.id.toLowerCase().indexOf(val) !== -1 || !val || d.coordinate.toLowerCase().indexOf(val) !== -1; return !val || d.coordinate.toLowerCase().indexOf(val) !== -1; }); - this.rows = temp; - this.tableCoordinates.offset = 0; this.loading = false; } - setPage(pageInfo) { + setPage(pageInfo: { offset: number; }) { this.currentPage = pageInfo.offset; + this.getCoordinates(); + } + + private getCoordinates() { this.loading = true; this.rows = []; this.coordinateService.getPage({ pageParams: {size: this.pageSize, page: this.currentPage}, - sort: {coordinate: 'ASC'}, + //sort: {coordinate: 'ASC'}, }).subscribe((page: PagedResourceCollection) => { this.coordinates = page.resources; this.totalCoordinates = page.totalElements; @@ -92,7 +80,16 @@ export class CoordinateListComponent implements OnInit { this.temp = this.rows; this.rows = [...this.rows]; this.loading = false; - this.tableCoordinates.offset = 0; }); } + + isRole(role: string): boolean { + // return this.authenticationService.isRole(role); + return true; + } + + getCurrentUserName(): string { + return this.authenticationService.getCurrentUser().id; + } + } From b11ebe44eedc3dd14d3ce3beb3b01bb283ceb3c4 Mon Sep 17 00:00:00 2001 From: Gerard Date: Thu, 7 Dec 2023 02:40:45 +0100 Subject: [PATCH 20/28] coordinate new enity and listing --- .../coordinate-list/coordinate-list.component.html | 5 ++--- .../coordinate-list/coordinate-list.component.ts | 13 ++++--------- src/app/coordinate/coordinate.entity.ts | 5 ++++- 3 files changed, 10 insertions(+), 13 deletions(-) diff --git a/src/app/coordinate/coordinate-list/coordinate-list.component.html b/src/app/coordinate/coordinate-list/coordinate-list.component.html index dbf2a73..e300cb7 100644 --- a/src/app/coordinate/coordinate-list/coordinate-list.component.html +++ b/src/app/coordinate/coordinate-list/coordinate-list.component.html @@ -28,7 +28,6 @@

Coordinates List

Coordinates List

- - diff --git a/src/app/coordinate/coordinate-list/coordinate-list.component.ts b/src/app/coordinate/coordinate-list/coordinate-list.component.ts index 260d163..7bcfb92 100644 --- a/src/app/coordinate/coordinate-list/coordinate-list.component.ts +++ b/src/app/coordinate/coordinate-list/coordinate-list.component.ts @@ -25,10 +25,10 @@ export class CoordinateListComponent implements OnInit { //{ coordinate: 'test,test' }, //{ coordinate: '1232131,122312331' }, ]; - columns = [ - // { prop: 'id', name: 'ID' }, + /*columns = [ + //{ prop: 'id', name: 'ID' }, { prop: 'coordinate', name: 'Coordinate' }, - {name: 'Actions', prop: 'actions', sortable: false, 'template': true}]; + {name: 'Actions', prop: 'actions', sortable: false, 'template': true}];*/ constructor( public router: Router, @@ -41,11 +41,6 @@ export class CoordinateListComponent implements OnInit { this.getCoordinates(); } - - detail(coordinates: Coordinate[]) { - - } - updateFilter(event) { const val = event.target.value.toLowerCase(); if (val.length <= 3) return; @@ -75,7 +70,7 @@ export class CoordinateListComponent implements OnInit { this.coordinates = page.resources; this.totalCoordinates = page.totalElements; this.coordinates.map(coordinate => { - this.rows.push({coordinate: coordinate.coordinate}); + this.rows.push({coordinate: coordinate.coordinate, uri: coordinate.uri}); }); this.temp = this.rows; this.rows = [...this.rows]; diff --git a/src/app/coordinate/coordinate.entity.ts b/src/app/coordinate/coordinate.entity.ts index 1cf0e6d..89c043c 100644 --- a/src/app/coordinate/coordinate.entity.ts +++ b/src/app/coordinate/coordinate.entity.ts @@ -1,8 +1,11 @@ import { HateoasResource, Resource } from '@lagoshny/ngx-hateoas-client'; +import {User} from "../login-basic/user"; @HateoasResource('coordinates') export class Coordinate extends Resource { + id: string; coordinate: string; + creationDate: Date; + uri: string; // routeVersion: RouteVersion; - } From 3a4f6fe699b61ad7eb58172c7db71e6bb56ad2c8 Mon Sep 17 00:00:00 2001 From: Gerard Date: Thu, 7 Dec 2023 02:40:54 +0100 Subject: [PATCH 21/28] coordinate navbar acces --- src/app/navbar/navbar.component.html | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/app/navbar/navbar.component.html b/src/app/navbar/navbar.component.html index c441201..55b5ad8 100644 --- a/src/app/navbar/navbar.component.html +++ b/src/app/navbar/navbar.component.html @@ -28,6 +28,16 @@ [routerLink]="['/routes']"> List + From 7dcb2df8d18842e6919c239189665e34fb616684 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Roberto=20Garc=C3=ADa?= Date: Thu, 7 Dec 2023 19:14:30 +0100 Subject: [PATCH 22/28] Increase size budget to avoid build errors during development --- angular.json | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/angular.json b/angular.json index cbe2323..c235f06 100644 --- a/angular.json +++ b/angular.json @@ -63,13 +63,13 @@ "budgets": [ { "type": "initial", - "maximumWarning": "500kb", - "maximumError": "1mb" + "maximumWarning": "1mb", + "maximumError": "2mb" }, { "type": "anyComponentStyle", - "maximumWarning": "2kb", - "maximumError": "4kb" + "maximumWarning": "4kb", + "maximumError": "8kb" } ] }, From aa50a54ab6afcfd5db17b651675e7b335f12d874 Mon Sep 17 00:00:00 2001 From: Gerard Date: Thu, 7 Dec 2023 19:53:07 +0100 Subject: [PATCH 23/28] coordinates search --- .../coordinate-list.component.ts | 35 +++++++++++++++---- src/app/coordinate/coordinate.service.ts | 14 +++++++- 2 files changed, 41 insertions(+), 8 deletions(-) diff --git a/src/app/coordinate/coordinate-list/coordinate-list.component.ts b/src/app/coordinate/coordinate-list/coordinate-list.component.ts index 7bcfb92..5147ff5 100644 --- a/src/app/coordinate/coordinate-list/coordinate-list.component.ts +++ b/src/app/coordinate/coordinate-list/coordinate-list.component.ts @@ -3,8 +3,11 @@ import {Coordinate} from "../coordinate.entity"; import {Router} from "@angular/router"; import {CoordinateService} from "../coordinate.service"; import {AuthenticationBasicService} from "../../login-basic/authentication-basic.service"; -import {PagedResourceCollection} from "@lagoshny/ngx-hateoas-client"; +import {PagedResourceCollection, ResourceCollection} from "@lagoshny/ngx-hateoas-client"; import {ColumnMode, DatatableComponent} from "@swimlane/ngx-datatable"; +import {catchError, map, tap} from "rxjs/operators"; +import {Route} from "../../routes/route"; +import {of} from "rxjs"; @Component({ selector: 'app-coordinate-list', @@ -43,16 +46,33 @@ export class CoordinateListComponent implements OnInit { updateFilter(event) { const val = event.target.value.toLowerCase(); - if (val.length <= 3) return; + if (val.length == 0) { + this.getCoordinates(); + return; + } + if (val.length <= 3) { + return; + } this.loading = true; + this.currentPage = 0; - // this.getCoordinatesByCoordinate(val); + this.coordinateService.findByCoordinateContainingIgnoreCase(val).subscribe((collection: ResourceCollection) => { + this.coordinates = collection.resources; + this.totalCoordinates = collection.resources.length; + this.pageSize = collection.resources.length; + this.coordinates.map(coordinate => { + this.rows.push({coordinate: coordinate.coordinate, uri: coordinate.uri}); + }); + // this.temp = this.rows; + this.rows = [...this.rows]; + this.loading = false; + }); - this.rows = this.temp.filter(function (d) { + /*this.rows = this.temp.filter(function (d) { // return d.id.toLowerCase().indexOf(val) !== -1 || !val || d.coordinate.toLowerCase().indexOf(val) !== -1; return !val || d.coordinate.toLowerCase().indexOf(val) !== -1; - }); - this.loading = false; + });*/ + // this.loading = false; } setPage(pageInfo: { offset: number; }) { @@ -62,6 +82,7 @@ export class CoordinateListComponent implements OnInit { private getCoordinates() { this.loading = true; + this.pageSize = 10; this.rows = []; this.coordinateService.getPage({ pageParams: {size: this.pageSize, page: this.currentPage}, @@ -72,7 +93,7 @@ export class CoordinateListComponent implements OnInit { this.coordinates.map(coordinate => { this.rows.push({coordinate: coordinate.coordinate, uri: coordinate.uri}); }); - this.temp = this.rows; + // this.temp = this.rows; this.rows = [...this.rows]; this.loading = false; }); diff --git a/src/app/coordinate/coordinate.service.ts b/src/app/coordinate/coordinate.service.ts index e395409..a3e31f7 100644 --- a/src/app/coordinate/coordinate.service.ts +++ b/src/app/coordinate/coordinate.service.ts @@ -1,8 +1,10 @@ import {Injectable} from '@angular/core'; import {HttpClient} from '@angular/common/http'; -import {HateoasResourceOperation,} from '@lagoshny/ngx-hateoas-client'; +import {HateoasResourceOperation, PagedResourceCollection, ResourceCollection,} from '@lagoshny/ngx-hateoas-client'; import {Coordinate} from "./coordinate.entity"; +import {Observable} from "rxjs/internal/Observable"; +import {Route} from "../routes/route"; @Injectable({ providedIn: 'root' @@ -11,4 +13,14 @@ export class CoordinateService extends HateoasResourceOperation { constructor(private http: HttpClient) { super(Coordinate); } + + //public findByCoordinate(cooridnate: string, pageSize: number, currentPage: number): Observable> { + public findByCoordinateContainingIgnoreCase(cooridnate: string): Observable> { + // return this.searchPage("findByCoordinate", { pageParams: {size: pageSize, page: currentPage}, params: { coordinate: cooridnate } }) + return this.searchCollection("findByCoordinateContainingIgnoreCase", { params: { coordinate: cooridnate } }) + } + + /*public findByRouteVersion(routeVersion: RouteVersion): Observable> { + return this.searchCollection("findByRouteVersion", { params: { routeVersion: routeVersion } }) + }*/ } From 9203c2c42bebea6a18febd4de8e6657603ca614b Mon Sep 17 00:00:00 2001 From: Gerard Date: Fri, 8 Dec 2023 17:31:17 +0100 Subject: [PATCH 24/28] coordinates create --- .../coordinate-create.component.html | 40 ++++++++++++++++++- .../coordinate-create.component.ts | 18 ++++++++- src/app/coordinate/coordinate.entity.ts | 6 +++ src/app/coordinate/coordinate.module.ts | 5 ++- 4 files changed, 65 insertions(+), 4 deletions(-) diff --git a/src/app/coordinate/coordinate-create/coordinate-create.component.html b/src/app/coordinate/coordinate-create/coordinate-create.component.html index 6b671bc..aaa061d 100644 --- a/src/app/coordinate/coordinate-create/coordinate-create.component.html +++ b/src/app/coordinate/coordinate-create/coordinate-create.component.html @@ -1 +1,39 @@ -

coordinate-create works!

+
+
+ + +
+ + +
+
+ Coordinate is required. +
+
+ Coordinate must be in the format: [-89.99999 <-> 89.99999],[-179.99999 <-> 179.99999]
+ 41.99999,2.11111 +
+
+
+ + + + + +
+ + +
+ +
+
diff --git a/src/app/coordinate/coordinate-create/coordinate-create.component.ts b/src/app/coordinate/coordinate-create/coordinate-create.component.ts index 7f6e2d2..a9b6785 100644 --- a/src/app/coordinate/coordinate-create/coordinate-create.component.ts +++ b/src/app/coordinate/coordinate-create/coordinate-create.component.ts @@ -1,4 +1,7 @@ -import {Component} from '@angular/core'; +import {Component, OnInit} from '@angular/core'; +import {Coordinate} from "../coordinate.entity"; +import {CoordinateService} from "../coordinate.service"; +import {Router} from "@angular/router"; @Component({ selector: 'app-coordinate-create', @@ -6,5 +9,18 @@ import {Component} from '@angular/core'; styleUrls: ['./coordinate-create.component.scss'] }) export class CoordinateCreateComponent { + public coordinate: Coordinate = new Coordinate(); + coordinatesPattern: "^(-?([0-8]?[0-9](\\.\\d+)?|89(.[0]+)?)[,])+(-?([1]?[0-7]?[0-9](\\.\\d+)?|179((.[0]+)?)))$"; + + constructor( + private coordinateService: CoordinateService, + private router: Router + ) {} + + onSubmit(): void { + debugger; + this.coordinateService.createResource({ body: this.coordinate }).subscribe( + (coordinate:Coordinate) => this.router.navigate([coordinate.uri])); + } } diff --git a/src/app/coordinate/coordinate.entity.ts b/src/app/coordinate/coordinate.entity.ts index 89c043c..34e1b3e 100644 --- a/src/app/coordinate/coordinate.entity.ts +++ b/src/app/coordinate/coordinate.entity.ts @@ -8,4 +8,10 @@ export class Coordinate extends Resource { creationDate: Date; uri: string; // routeVersion: RouteVersion; + + constructor(values: object = {}) { + super(); + Object.assign(this as any, values); + } + } diff --git a/src/app/coordinate/coordinate.module.ts b/src/app/coordinate/coordinate.module.ts index b7079ba..1dfef51 100644 --- a/src/app/coordinate/coordinate.module.ts +++ b/src/app/coordinate/coordinate.module.ts @@ -15,7 +15,7 @@ import {AppComponent} from "../app.component"; import {NgbPagination} from "@ng-bootstrap/ng-bootstrap"; import {NgForOf, NgIf} from "@angular/common"; import {NgxDatatableModule} from "@swimlane/ngx-datatable"; -import {ReactiveFormsModule} from "@angular/forms"; +import {FormsModule, ReactiveFormsModule} from "@angular/forms"; @NgModule({ declarations: [ @@ -32,7 +32,8 @@ import {ReactiveFormsModule} from "@angular/forms"; NgForOf, NgxDatatableModule, NgIf, - ReactiveFormsModule + ReactiveFormsModule, + FormsModule ], providers: [ { provide: HTTP_INTERCEPTORS, useClass: AuthInterceptor, multi: true }, From 2721cad35106b6d91f2f1690c8c8766aaf2182ef Mon Sep 17 00:00:00 2001 From: Gerard Date: Fri, 8 Dec 2023 17:53:54 +0100 Subject: [PATCH 25/28] coordinates edit --- .../coordinate-update.component.html | 45 ++++++++++++++++++- .../coordinate-update.component.ts | 35 ++++++++++++++- 2 files changed, 77 insertions(+), 3 deletions(-) diff --git a/src/app/coordinate/coordinate-update/coordinate-update.component.html b/src/app/coordinate/coordinate-update/coordinate-update.component.html index ee09501..ddf2238 100644 --- a/src/app/coordinate/coordinate-update/coordinate-update.component.html +++ b/src/app/coordinate/coordinate-update/coordinate-update.component.html @@ -1 +1,44 @@ -

coordinate-update works!

+
+
+ + +
+ + +
+
+ Coordinate is required. +
+
+ Coordinate must be in the format: [-89.99999 <-> 89.99999],[-179.99999 <-> 179.99999]
+ 41.99999,2.11111 +
+
+
+ +
+ + +
+ + + + + +
+ + +
+ +
+
diff --git a/src/app/coordinate/coordinate-update/coordinate-update.component.ts b/src/app/coordinate/coordinate-update/coordinate-update.component.ts index d2d8c66..4dcb397 100644 --- a/src/app/coordinate/coordinate-update/coordinate-update.component.ts +++ b/src/app/coordinate/coordinate-update/coordinate-update.component.ts @@ -1,10 +1,41 @@ -import {Component} from '@angular/core'; +import {Component, OnInit} from '@angular/core'; +import {Route} from "../../routes/route"; +import {ActivatedRoute, Router} from "@angular/router"; +import {RouteService} from "../../routes/route.service"; +import {Location} from "@angular/common"; +import {switchMap} from "rxjs/operators"; +import {User} from "../../login-basic/user"; +import {Coordinate} from "../coordinate.entity"; +import {CoordinateService} from "../coordinate.service"; @Component({ selector: 'app-coordinate-update', templateUrl: './coordinate-update.component.html', styleUrls: ['./coordinate-update.component.scss'] }) -export class CoordinateUpdateComponent { +export class CoordinateUpdateComponent implements OnInit{ + public coordinatee: Coordinate = new Coordinate(); + constructor(private activatedRoute: ActivatedRoute, + private router: Router, + private coordinateService: CoordinateService, + private location: Location) { } + + ngOnInit(): void { + + const id = this.activatedRoute.snapshot.paramMap.get('id'); + this.coordinateService.getResource(id).subscribe( + (c: Coordinate) => {this.coordinatee = c; this.coordinatee.id = id;}); + } + + onSubmit() { + this.coordinateService.patchResource(this.coordinatee).subscribe( + (coordinate: Coordinate) => { + this.router.navigate([coordinate.uri]); + }); + } + + goBackToPrevPage(): void { + this.location.back(); + } } From 000505a01562655d7d03fecff03dbcdddcaa1136 Mon Sep 17 00:00:00 2001 From: Gerard Date: Fri, 8 Dec 2023 18:10:39 +0100 Subject: [PATCH 26/28] coordinates detail --- .../coordinate-detail.component.html | 36 +++++++++++++++++- .../coordinate-detail.component.ts | 37 ++++++++++++++++++- 2 files changed, 70 insertions(+), 3 deletions(-) diff --git a/src/app/coordinate/coordinate-detail/coordinate-detail.component.html b/src/app/coordinate/coordinate-detail/coordinate-detail.component.html index 85f154b..9d2a230 100644 --- a/src/app/coordinate/coordinate-detail/coordinate-detail.component.html +++ b/src/app/coordinate/coordinate-detail/coordinate-detail.component.html @@ -1 +1,35 @@ -

coordinate-detail works!

+
+
+ + +
+ + +
+ +
+ + +
+ + + + + + +
+ + + +
+ +
+
diff --git a/src/app/coordinate/coordinate-detail/coordinate-detail.component.ts b/src/app/coordinate/coordinate-detail/coordinate-detail.component.ts index 6b44033..796639f 100644 --- a/src/app/coordinate/coordinate-detail/coordinate-detail.component.ts +++ b/src/app/coordinate/coordinate-detail/coordinate-detail.component.ts @@ -1,10 +1,43 @@ -import {Component} from '@angular/core'; +import {Component, OnInit} from '@angular/core'; +import {ActivatedRoute, Router} from "@angular/router"; +import {AuthenticationBasicService} from "../../login-basic/authentication-basic.service"; +import {switchMap} from "rxjs/operators"; +import {User} from "../../login-basic/user"; +import {CoordinateService} from "../coordinate.service"; +import {Coordinate} from "../coordinate.entity"; +import {Location} from "@angular/common"; @Component({ selector: 'app-coordinate-detail', templateUrl: './coordinate-detail.component.html', styleUrls: ['./coordinate-detail.component.scss'] }) -export class CoordinateDetailComponent { +export class CoordinateDetailComponent implements OnInit{ + public coordinatee = new Coordinate(); + + constructor( + public router: Router, + private activatedRoute: ActivatedRoute, + private coordinateService: CoordinateService, + private authenticationService: AuthenticationBasicService, + private location: Location) { + } + + ngOnInit(): void { + const id = this.activatedRoute.snapshot.paramMap.get('id'); + this.coordinateService.getResource(id).subscribe( + (c: Coordinate) => { + this.coordinatee = c; + }); + } + + isRole(role: string): boolean { + // return this.authenticationService.isRole(role); + return true; + } + + goBackToPrevPage(): void { + this.location.back(); + } } From f73cda199f3eaed40261918116b74ca08a7e770b Mon Sep 17 00:00:00 2001 From: Gerard Date: Fri, 8 Dec 2023 18:31:07 +0100 Subject: [PATCH 27/28] coordinates delete --- .../coordinate-delete.component.html | 14 +++++++++- .../coordinate-delete.component.ts | 28 +++++++++++++++++-- 2 files changed, 39 insertions(+), 3 deletions(-) diff --git a/src/app/coordinate/coordinate-delete/coordinate-delete.component.html b/src/app/coordinate/coordinate-delete/coordinate-delete.component.html index 5528477..f8b9c32 100644 --- a/src/app/coordinate/coordinate-delete/coordinate-delete.component.html +++ b/src/app/coordinate/coordinate-delete/coordinate-delete.component.html @@ -1 +1,13 @@ -

coordinate-delete works!

+
+
+
Please, confirm deletion:
+
+
+
+ + +
+
+
diff --git a/src/app/coordinate/coordinate-delete/coordinate-delete.component.ts b/src/app/coordinate/coordinate-delete/coordinate-delete.component.ts index dee16b5..5ddb6fc 100644 --- a/src/app/coordinate/coordinate-delete/coordinate-delete.component.ts +++ b/src/app/coordinate/coordinate-delete/coordinate-delete.component.ts @@ -1,10 +1,34 @@ -import {Component} from '@angular/core'; +import {Component, OnInit} from '@angular/core'; +import {Route} from "../../routes/route"; +import {ActivatedRoute, Router} from "@angular/router"; +import {RouteService} from "../../routes/route.service"; +import {Coordinate} from "../coordinate.entity"; +import {CoordinateService} from "../coordinate.service"; @Component({ selector: 'app-coordinate-delete', templateUrl: './coordinate-delete.component.html', styleUrls: ['./coordinate-delete.component.scss'] }) -export class CoordinateDeleteComponent { +export class CoordinateDeleteComponent implements OnInit{ + public coordinate: Coordinate = new Coordinate(); + private id: string; + + constructor(private activatedRoute: ActivatedRoute, + private router: Router, + private coordinateService: CoordinateService) { + } + ngOnInit(): void { + this.id = this.activatedRoute.snapshot.paramMap.get('id'); + this.coordinateService.getResource(this.id).subscribe( + c => this.coordinate = c); + } + + delete(): void { + this.coordinateService.deleteResource(this.coordinate).subscribe( + () => { + this.router.navigate(['coordinates']); + }); + } } From e7a05f128c046ccc4e98881e26dbce91b747fc96 Mon Sep 17 00:00:00 2001 From: Gerard Date: Fri, 8 Dec 2023 18:32:13 +0100 Subject: [PATCH 28/28] coordinates reformat --- .../coordinate-create.component.html | 13 +-- .../coordinate-create.component.ts | 21 +++-- .../coordinate-delete.component.html | 6 +- .../coordinate-delete.component.ts | 5 +- .../coordinate-detail.component.html | 13 ++- .../coordinate-detail.component.ts | 4 +- .../coordinate-list.component.html | 88 +++++++++++-------- .../coordinate-list.component.ts | 16 ++-- .../coordinate/coordinate-routing.module.ts | 3 +- .../coordinate-update.component.html | 13 ++- .../coordinate-update.component.ts | 14 +-- src/app/coordinate/coordinate.entity.ts | 14 +-- src/app/coordinate/coordinate.module.ts | 25 +++--- src/app/coordinate/coordinate.service.ts | 5 +- 14 files changed, 133 insertions(+), 107 deletions(-) diff --git a/src/app/coordinate/coordinate-create/coordinate-create.component.html b/src/app/coordinate/coordinate-create/coordinate-create.component.html index aaa061d..5f394d3 100644 --- a/src/app/coordinate/coordinate-create/coordinate-create.component.html +++ b/src/app/coordinate/coordinate-create/coordinate-create.component.html @@ -4,10 +4,13 @@
- -
+
Coordinate is required.
@@ -27,11 +30,11 @@
-
diff --git a/src/app/coordinate/coordinate-create/coordinate-create.component.ts b/src/app/coordinate/coordinate-create/coordinate-create.component.ts index a9b6785..7915c8c 100644 --- a/src/app/coordinate/coordinate-create/coordinate-create.component.ts +++ b/src/app/coordinate/coordinate-create/coordinate-create.component.ts @@ -1,7 +1,9 @@ -import {Component, OnInit} from '@angular/core'; +import {Component} from '@angular/core'; import {Coordinate} from "../coordinate.entity"; import {CoordinateService} from "../coordinate.service"; import {Router} from "@angular/router"; +import {Location} from "@angular/common"; + @Component({ selector: 'app-coordinate-create', @@ -10,17 +12,22 @@ import {Router} from "@angular/router"; }) export class CoordinateCreateComponent { public coordinate: Coordinate = new Coordinate(); - coordinatesPattern: "^(-?([0-8]?[0-9](\\.\\d+)?|89(.[0]+)?)[,])+(-?([1]?[0-7]?[0-9](\\.\\d+)?|179((.[0]+)?)))$"; constructor( private coordinateService: CoordinateService, - private router: Router - ) {} + private router: Router, + private location: Location + ) { + } onSubmit(): void { - debugger; - this.coordinateService.createResource({ body: this.coordinate }).subscribe( - (coordinate:Coordinate) => this.router.navigate([coordinate.uri])); + + this.coordinateService.createResource({body: this.coordinate}).subscribe( + (coordinate: Coordinate) => this.router.navigate([coordinate.uri])); + } + + goBackToPrevPage(): void { + this.location.back(); } } diff --git a/src/app/coordinate/coordinate-delete/coordinate-delete.component.html b/src/app/coordinate/coordinate-delete/coordinate-delete.component.html index f8b9c32..5a1d7e0 100644 --- a/src/app/coordinate/coordinate-delete/coordinate-delete.component.html +++ b/src/app/coordinate/coordinate-delete/coordinate-delete.component.html @@ -5,9 +5,11 @@
+ class="btn btn-outline-danger m-1">Delete + + class="btn btn-outline-primary m-1">Cancel +
diff --git a/src/app/coordinate/coordinate-delete/coordinate-delete.component.ts b/src/app/coordinate/coordinate-delete/coordinate-delete.component.ts index 5ddb6fc..ce11634 100644 --- a/src/app/coordinate/coordinate-delete/coordinate-delete.component.ts +++ b/src/app/coordinate/coordinate-delete/coordinate-delete.component.ts @@ -1,7 +1,5 @@ import {Component, OnInit} from '@angular/core'; -import {Route} from "../../routes/route"; import {ActivatedRoute, Router} from "@angular/router"; -import {RouteService} from "../../routes/route.service"; import {Coordinate} from "../coordinate.entity"; import {CoordinateService} from "../coordinate.service"; @@ -10,7 +8,7 @@ import {CoordinateService} from "../coordinate.service"; templateUrl: './coordinate-delete.component.html', styleUrls: ['./coordinate-delete.component.scss'] }) -export class CoordinateDeleteComponent implements OnInit{ +export class CoordinateDeleteComponent implements OnInit { public coordinate: Coordinate = new Coordinate(); private id: string; @@ -19,6 +17,7 @@ export class CoordinateDeleteComponent implements OnInit{ private router: Router, private coordinateService: CoordinateService) { } + ngOnInit(): void { this.id = this.activatedRoute.snapshot.paramMap.get('id'); this.coordinateService.getResource(this.id).subscribe( diff --git a/src/app/coordinate/coordinate-detail/coordinate-detail.component.html b/src/app/coordinate/coordinate-detail/coordinate-detail.component.html index 9d2a230..69b1b2a 100644 --- a/src/app/coordinate/coordinate-detail/coordinate-detail.component.html +++ b/src/app/coordinate/coordinate-detail/coordinate-detail.component.html @@ -4,14 +4,16 @@
-
-
@@ -26,9 +28,12 @@
+ class="btn m-1 btn-outline-primary">Back + - +
diff --git a/src/app/coordinate/coordinate-detail/coordinate-detail.component.ts b/src/app/coordinate/coordinate-detail/coordinate-detail.component.ts index 796639f..02eb0c0 100644 --- a/src/app/coordinate/coordinate-detail/coordinate-detail.component.ts +++ b/src/app/coordinate/coordinate-detail/coordinate-detail.component.ts @@ -1,8 +1,6 @@ import {Component, OnInit} from '@angular/core'; import {ActivatedRoute, Router} from "@angular/router"; import {AuthenticationBasicService} from "../../login-basic/authentication-basic.service"; -import {switchMap} from "rxjs/operators"; -import {User} from "../../login-basic/user"; import {CoordinateService} from "../coordinate.service"; import {Coordinate} from "../coordinate.entity"; import {Location} from "@angular/common"; @@ -12,7 +10,7 @@ import {Location} from "@angular/common"; templateUrl: './coordinate-detail.component.html', styleUrls: ['./coordinate-detail.component.scss'] }) -export class CoordinateDetailComponent implements OnInit{ +export class CoordinateDetailComponent implements OnInit { public coordinatee = new Coordinate(); constructor( diff --git a/src/app/coordinate/coordinate-list/coordinate-list.component.html b/src/app/coordinate/coordinate-list/coordinate-list.component.html index e300cb7..a71c017 100644 --- a/src/app/coordinate/coordinate-list/coordinate-list.component.html +++ b/src/app/coordinate/coordinate-list/coordinate-list.component.html @@ -25,46 +25,56 @@

Coordinates List

- - - - - {{ column.name }} - - - {{ value }} - - - - - + + + + + {{ column.name }} + + + {{ value }} + + + + + +
+ class="btn btn-outline-primary">View + + + - - - + class="btn btn-outline-danger">Delete + + +
+ +
+
+
diff --git a/src/app/coordinate/coordinate-list/coordinate-list.component.ts b/src/app/coordinate/coordinate-list/coordinate-list.component.ts index 5147ff5..c5425a1 100644 --- a/src/app/coordinate/coordinate-list/coordinate-list.component.ts +++ b/src/app/coordinate/coordinate-list/coordinate-list.component.ts @@ -5,9 +5,6 @@ import {CoordinateService} from "../coordinate.service"; import {AuthenticationBasicService} from "../../login-basic/authentication-basic.service"; import {PagedResourceCollection, ResourceCollection} from "@lagoshny/ngx-hateoas-client"; import {ColumnMode, DatatableComponent} from "@swimlane/ngx-datatable"; -import {catchError, map, tap} from "rxjs/operators"; -import {Route} from "../../routes/route"; -import {of} from "rxjs"; @Component({ selector: 'app-coordinate-list', @@ -25,18 +22,19 @@ export class CoordinateListComponent implements OnInit { loading: boolean = true; protected readonly ColumnMode = ColumnMode; rows = [ - //{ coordinate: 'test,test' }, - //{ coordinate: '1232131,122312331' }, - ]; + //{ coordinate: 'test,test' }, + //{ coordinate: '1232131,122312331' }, + ]; + /*columns = [ //{ prop: 'id', name: 'ID' }, { prop: 'coordinate', name: 'Coordinate' }, {name: 'Actions', prop: 'actions', sortable: false, 'template': true}];*/ constructor( - public router: Router, - private coordinateService: CoordinateService, - private authenticationService: AuthenticationBasicService + public router: Router, + private coordinateService: CoordinateService, + private authenticationService: AuthenticationBasicService ) { } diff --git a/src/app/coordinate/coordinate-routing.module.ts b/src/app/coordinate/coordinate-routing.module.ts index 5806c96..536e982 100644 --- a/src/app/coordinate/coordinate-routing.module.ts +++ b/src/app/coordinate/coordinate-routing.module.ts @@ -2,7 +2,6 @@ import {NgModule} from '@angular/core'; import {RouterModule, Routes} from "@angular/router"; import {CoordinateListComponent} from "./coordinate-list/coordinate-list.component"; import {CoordinateCreateComponent} from "./coordinate-create/coordinate-create.component"; -import {CoordinateSearchComponent} from "./coordinate-search/coordinate-search.component"; import {CoordinateUpdateComponent} from "./coordinate-update/coordinate-update.component"; import {CoordinateDeleteComponent} from "./coordinate-delete/coordinate-delete.component"; import {CoordinateDetailComponent} from "./coordinate-detail/coordinate-detail.component"; @@ -14,7 +13,7 @@ const routes: Routes = [ {path: ':id', component: CoordinateDetailComponent}, {path: ':id/edit', component: CoordinateUpdateComponent}, {path: ':id/delete', component: CoordinateDeleteComponent}, - { path: '**', redirectTo: ''}, + {path: '**', redirectTo: ''}, ]; diff --git a/src/app/coordinate/coordinate-update/coordinate-update.component.html b/src/app/coordinate/coordinate-update/coordinate-update.component.html index ddf2238..10a753e 100644 --- a/src/app/coordinate/coordinate-update/coordinate-update.component.html +++ b/src/app/coordinate/coordinate-update/coordinate-update.component.html @@ -4,10 +4,13 @@
- -
+
Coordinate is required.
@@ -20,7 +23,8 @@
-
@@ -34,7 +38,8 @@
+ class="btn m-1 btn-outline-primary">Back + diff --git a/src/app/coordinate/coordinate-update/coordinate-update.component.ts b/src/app/coordinate/coordinate-update/coordinate-update.component.ts index 4dcb397..8ec04a5 100644 --- a/src/app/coordinate/coordinate-update/coordinate-update.component.ts +++ b/src/app/coordinate/coordinate-update/coordinate-update.component.ts @@ -1,10 +1,6 @@ import {Component, OnInit} from '@angular/core'; -import {Route} from "../../routes/route"; import {ActivatedRoute, Router} from "@angular/router"; -import {RouteService} from "../../routes/route.service"; import {Location} from "@angular/common"; -import {switchMap} from "rxjs/operators"; -import {User} from "../../login-basic/user"; import {Coordinate} from "../coordinate.entity"; import {CoordinateService} from "../coordinate.service"; @@ -13,19 +9,23 @@ import {CoordinateService} from "../coordinate.service"; templateUrl: './coordinate-update.component.html', styleUrls: ['./coordinate-update.component.scss'] }) -export class CoordinateUpdateComponent implements OnInit{ +export class CoordinateUpdateComponent implements OnInit { public coordinatee: Coordinate = new Coordinate(); constructor(private activatedRoute: ActivatedRoute, private router: Router, private coordinateService: CoordinateService, - private location: Location) { } + private location: Location) { + } ngOnInit(): void { const id = this.activatedRoute.snapshot.paramMap.get('id'); this.coordinateService.getResource(id).subscribe( - (c: Coordinate) => {this.coordinatee = c; this.coordinatee.id = id;}); + (c: Coordinate) => { + this.coordinatee = c; + this.coordinatee.id = id; + }); } onSubmit() { diff --git a/src/app/coordinate/coordinate.entity.ts b/src/app/coordinate/coordinate.entity.ts index 34e1b3e..b514130 100644 --- a/src/app/coordinate/coordinate.entity.ts +++ b/src/app/coordinate/coordinate.entity.ts @@ -1,13 +1,13 @@ -import { HateoasResource, Resource } from '@lagoshny/ngx-hateoas-client'; -import {User} from "../login-basic/user"; +import {HateoasResource, Resource} from '@lagoshny/ngx-hateoas-client'; @HateoasResource('coordinates') export class Coordinate extends Resource { - id: string; - coordinate: string; - creationDate: Date; - uri: string; - // routeVersion: RouteVersion; + id: string; + coordinate: string; + creationDate: Date; + uri: string; + + // routeVersion: RouteVersion; constructor(values: object = {}) { super(); diff --git a/src/app/coordinate/coordinate.module.ts b/src/app/coordinate/coordinate.module.ts index 1dfef51..3b9e833 100644 --- a/src/app/coordinate/coordinate.module.ts +++ b/src/app/coordinate/coordinate.module.ts @@ -26,20 +26,21 @@ import {FormsModule, ReactiveFormsModule} from "@angular/forms"; CoordinateDeleteComponent, CoordinateSearchComponent ], - imports: [ - CoordinateRoutingModule, - NgbPagination, - NgForOf, - NgxDatatableModule, - NgIf, - ReactiveFormsModule, - FormsModule - ], + imports: [ + CoordinateRoutingModule, + NgbPagination, + NgForOf, + NgxDatatableModule, + NgIf, + ReactiveFormsModule, + FormsModule + ], providers: [ - { provide: HTTP_INTERCEPTORS, useClass: AuthInterceptor, multi: true }, - { provide: HTTP_INTERCEPTORS, useClass: HttpErrorInterceptor, multi: true }, + {provide: HTTP_INTERCEPTORS, useClass: AuthInterceptor, multi: true}, + {provide: HTTP_INTERCEPTORS, useClass: HttpErrorInterceptor, multi: true}, AuthenticationBasicService, UserService ], bootstrap: [AppComponent] }) -export class CoordinateModule { } +export class CoordinateModule { +} diff --git a/src/app/coordinate/coordinate.service.ts b/src/app/coordinate/coordinate.service.ts index a3e31f7..abe122d 100644 --- a/src/app/coordinate/coordinate.service.ts +++ b/src/app/coordinate/coordinate.service.ts @@ -1,10 +1,9 @@ import {Injectable} from '@angular/core'; import {HttpClient} from '@angular/common/http'; -import {HateoasResourceOperation, PagedResourceCollection, ResourceCollection,} from '@lagoshny/ngx-hateoas-client'; +import {HateoasResourceOperation, ResourceCollection,} from '@lagoshny/ngx-hateoas-client'; import {Coordinate} from "./coordinate.entity"; import {Observable} from "rxjs/internal/Observable"; -import {Route} from "../routes/route"; @Injectable({ providedIn: 'root' @@ -17,7 +16,7 @@ export class CoordinateService extends HateoasResourceOperation { //public findByCoordinate(cooridnate: string, pageSize: number, currentPage: number): Observable> { public findByCoordinateContainingIgnoreCase(cooridnate: string): Observable> { // return this.searchPage("findByCoordinate", { pageParams: {size: pageSize, page: currentPage}, params: { coordinate: cooridnate } }) - return this.searchCollection("findByCoordinateContainingIgnoreCase", { params: { coordinate: cooridnate } }) + return this.searchCollection("findByCoordinateContainingIgnoreCase", {params: {coordinate: cooridnate}}) } /*public findByRouteVersion(routeVersion: RouteVersion): Observable> {