From 70eef8a99ab07c039d33eff3d5df0dc537ec326f Mon Sep 17 00:00:00 2001 From: tillias Date: Sun, 11 Oct 2020 09:14:01 +0200 Subject: [PATCH 1/4] Extracted IMicroserviceGroupFilter and implemented event-handling #16 --- .../microservice-dashboard.component.html | 3 +- .../microservice-dashboard.component.ts | 5 +++ .../microservice-group-filter.component.html | 44 +++++++++++++++++++ .../microservice-group-filter.component.scss | 0 .../microservice-group-filter.component.ts | 23 ++++++++++ .../microservice-group-filter.module.ts | 10 +++++ .../microservice-search.component.html | 1 + .../microservice-search.component.ts | 12 ++++- .../microservice-search.module.ts | 4 +- .../model/util/microservice-group-filter.ts | 13 ++++++ 10 files changed, 111 insertions(+), 4 deletions(-) create mode 100644 src/main/webapp/app/entities/microservice/microservice-dashboard/microservice-search/microservice-group-filter/microservice-group-filter.component.html create mode 100644 src/main/webapp/app/entities/microservice/microservice-dashboard/microservice-search/microservice-group-filter/microservice-group-filter.component.scss create mode 100644 src/main/webapp/app/entities/microservice/microservice-dashboard/microservice-search/microservice-group-filter/microservice-group-filter.component.ts create mode 100644 src/main/webapp/app/entities/microservice/microservice-dashboard/microservice-search/microservice-group-filter/microservice-group-filter.module.ts create mode 100644 src/main/webapp/app/shared/model/util/microservice-group-filter.ts diff --git a/src/main/webapp/app/entities/microservice/microservice-dashboard/microservice-dashboard.component.html b/src/main/webapp/app/entities/microservice/microservice-dashboard/microservice-dashboard.component.html index 9e3a037..14daa99 100644 --- a/src/main/webapp/app/entities/microservice/microservice-dashboard/microservice-dashboard.component.html +++ b/src/main/webapp/app/entities/microservice/microservice-dashboard/microservice-dashboard.component.html @@ -1,5 +1,6 @@
- +
diff --git a/src/main/webapp/app/entities/microservice/microservice-dashboard/microservice-dashboard.component.ts b/src/main/webapp/app/entities/microservice/microservice-dashboard/microservice-dashboard.component.ts index a9c1135..6093ac8 100644 --- a/src/main/webapp/app/entities/microservice/microservice-dashboard/microservice-dashboard.component.ts +++ b/src/main/webapp/app/entities/microservice/microservice-dashboard/microservice-dashboard.component.ts @@ -4,6 +4,7 @@ import { IMicroservice } from 'app/shared/model/microservice.model'; import { HttpResponse } from '@angular/common/http'; import { Subscription } from 'rxjs'; import { JhiEventManager } from 'ng-jhipster'; +import { IMicroserviceGroupFilter } from 'app/shared/model/util/microservice-group-filter'; @Component({ selector: 'jhi-microservice-dashboard', @@ -42,4 +43,8 @@ export class MicroserviceDashboardComponent implements OnInit, OnDestroy { this.loadAll(); } } + + onGroupFilterChanged(groupFilter: IMicroserviceGroupFilter): void { + alert(JSON.stringify(groupFilter)); + } } diff --git a/src/main/webapp/app/entities/microservice/microservice-dashboard/microservice-search/microservice-group-filter/microservice-group-filter.component.html b/src/main/webapp/app/entities/microservice/microservice-dashboard/microservice-search/microservice-group-filter/microservice-group-filter.component.html new file mode 100644 index 0000000..c2ecf47 --- /dev/null +++ b/src/main/webapp/app/entities/microservice/microservice-dashboard/microservice-search/microservice-group-filter/microservice-group-filter.component.html @@ -0,0 +1,44 @@ +
+ + +
diff --git a/src/main/webapp/app/entities/microservice/microservice-dashboard/microservice-search/microservice-group-filter/microservice-group-filter.component.scss b/src/main/webapp/app/entities/microservice/microservice-dashboard/microservice-search/microservice-group-filter/microservice-group-filter.component.scss new file mode 100644 index 0000000..e69de29 diff --git a/src/main/webapp/app/entities/microservice/microservice-dashboard/microservice-search/microservice-group-filter/microservice-group-filter.component.ts b/src/main/webapp/app/entities/microservice/microservice-dashboard/microservice-search/microservice-group-filter/microservice-group-filter.component.ts new file mode 100644 index 0000000..06d94ec --- /dev/null +++ b/src/main/webapp/app/entities/microservice/microservice-dashboard/microservice-search/microservice-group-filter/microservice-group-filter.component.ts @@ -0,0 +1,23 @@ +import { Component, EventEmitter, OnInit, Output } from '@angular/core'; +import { MicroserviceGroupFilter, IMicroserviceGroupFilter } from 'app/shared/model/util/microservice-group-filter'; + +@Component({ + selector: 'jhi-microservice-group-filter', + templateUrl: './microservice-group-filter.component.html', + styleUrls: ['./microservice-group-filter.component.scss'], +}) +export class MicroserviceGroupFilterComponent implements OnInit { + groupFilter: IMicroserviceGroupFilter; + + @Output() filterChanged = new EventEmitter(); + + constructor() { + this.groupFilter = new MicroserviceGroupFilter(); + } + + ngOnInit(): void {} + + onSearch(): void { + this.filterChanged.emit(this.groupFilter); + } +} diff --git a/src/main/webapp/app/entities/microservice/microservice-dashboard/microservice-search/microservice-group-filter/microservice-group-filter.module.ts b/src/main/webapp/app/entities/microservice/microservice-dashboard/microservice-search/microservice-group-filter/microservice-group-filter.module.ts new file mode 100644 index 0000000..0a0fe0e --- /dev/null +++ b/src/main/webapp/app/entities/microservice/microservice-dashboard/microservice-search/microservice-group-filter/microservice-group-filter.module.ts @@ -0,0 +1,10 @@ +import { NgModule } from '@angular/core'; +import { MicroserviceGroupFilterComponent } from './microservice-group-filter.component'; +import { MicrocatalogSharedModule } from 'app/shared/shared.module'; + +@NgModule({ + declarations: [MicroserviceGroupFilterComponent], + imports: [MicrocatalogSharedModule], + exports: [MicroserviceGroupFilterComponent], +}) +export class MicroserviceGroupFilterModule {} diff --git a/src/main/webapp/app/entities/microservice/microservice-dashboard/microservice-search/microservice-search.component.html b/src/main/webapp/app/entities/microservice/microservice-dashboard/microservice-search/microservice-search.component.html index 9c55870..c1791ee 100644 --- a/src/main/webapp/app/entities/microservice/microservice-dashboard/microservice-search/microservice-search.component.html +++ b/src/main/webapp/app/entities/microservice/microservice-dashboard/microservice-search/microservice-search.component.html @@ -9,4 +9,5 @@ (selectItem)="onItemSelected($event.item)" (keyup.escape)="clear()" /> +
diff --git a/src/main/webapp/app/entities/microservice/microservice-dashboard/microservice-search/microservice-search.component.ts b/src/main/webapp/app/entities/microservice/microservice-dashboard/microservice-search/microservice-search.component.ts index fa38c98..49da211 100644 --- a/src/main/webapp/app/entities/microservice/microservice-dashboard/microservice-search/microservice-search.component.ts +++ b/src/main/webapp/app/entities/microservice/microservice-dashboard/microservice-search/microservice-search.component.ts @@ -1,8 +1,9 @@ -import { Component, EventEmitter, OnInit, Output } from '@angular/core'; +import { Component, EventEmitter, Input, OnInit, Output } from '@angular/core'; import { Observable } from 'rxjs'; import { debounceTime, distinctUntilChanged, map, switchMap } from 'rxjs/operators'; import { MicroserviceService } from 'app/entities/microservice/microservice.service'; import { IMicroservice } from 'app/shared/model/microservice.model'; +import { IMicroserviceGroupFilter } from 'app/shared/model/util/microservice-group-filter'; @Component({ selector: 'jhi-microservice-search', @@ -12,7 +13,12 @@ import { IMicroservice } from 'app/shared/model/microservice.model'; export class MicroserviceSearchComponent implements OnInit { model: any; + /** + * Enables advanced search capabilities. Default: false + */ + @Input() advanced = false; @Output() itemSelected = new EventEmitter(); + @Output() groupFilterChanged = new EventEmitter(); constructor(protected microserviceService: MicroserviceService) {} @@ -50,4 +56,8 @@ export class MicroserviceSearchComponent implements OnInit { this.itemSelected.emit(); } } + + onFilterChanged(groupFilter: IMicroserviceGroupFilter): any { + this.groupFilterChanged.emit(groupFilter); + } } diff --git a/src/main/webapp/app/entities/microservice/microservice-dashboard/microservice-search/microservice-search.module.ts b/src/main/webapp/app/entities/microservice/microservice-dashboard/microservice-search/microservice-search.module.ts index 71b33e2..da95326 100644 --- a/src/main/webapp/app/entities/microservice/microservice-dashboard/microservice-search/microservice-search.module.ts +++ b/src/main/webapp/app/entities/microservice/microservice-dashboard/microservice-search/microservice-search.module.ts @@ -1,11 +1,11 @@ import { NgModule } from '@angular/core'; import { MicroserviceSearchComponent } from './microservice-search.component'; import { MicrocatalogSharedModule } from 'app/shared/shared.module'; -import { RouterModule } from '@angular/router'; +import { MicroserviceGroupFilterModule } from 'app/entities/microservice/microservice-dashboard/microservice-search/microservice-group-filter/microservice-group-filter.module'; @NgModule({ declarations: [MicroserviceSearchComponent], - imports: [MicrocatalogSharedModule, RouterModule], + imports: [MicrocatalogSharedModule, MicroserviceGroupFilterModule], exports: [MicroserviceSearchComponent], }) export class MicroserviceSearchModule {} diff --git a/src/main/webapp/app/shared/model/util/microservice-group-filter.ts b/src/main/webapp/app/shared/model/util/microservice-group-filter.ts new file mode 100644 index 0000000..25b7506 --- /dev/null +++ b/src/main/webapp/app/shared/model/util/microservice-group-filter.ts @@ -0,0 +1,13 @@ +import { ITeam } from 'app/shared/model/team.model'; +import { IStatus } from 'app/shared/model/status.model'; + +export interface IMicroserviceGroupFilter { + name?: String; + description?: String; + swaggerUrl?: String; + gitUrl?: String; + team?: ITeam; + status?: IStatus; +} + +export class MicroserviceGroupFilter implements IMicroserviceGroupFilter {} From 5fc5b16595ae8c9debd552b7e70f95d8f774c72e Mon Sep 17 00:00:00 2001 From: tillias Date: Sun, 11 Oct 2020 09:44:02 +0200 Subject: [PATCH 2/4] Status and Team can now be used as a filter #16 --- .../microservice-group-filter.component.html | 20 ++++++++--------- .../microservice-group-filter.component.ts | 22 ++++++++++++++++--- 2 files changed, 29 insertions(+), 13 deletions(-) diff --git a/src/main/webapp/app/entities/microservice/microservice-dashboard/microservice-search/microservice-group-filter/microservice-group-filter.component.html b/src/main/webapp/app/entities/microservice/microservice-dashboard/microservice-search/microservice-group-filter/microservice-group-filter.component.html index c2ecf47..9761b49 100644 --- a/src/main/webapp/app/entities/microservice/microservice-dashboard/microservice-search/microservice-group-filter/microservice-group-filter.component.html +++ b/src/main/webapp/app/entities/microservice/microservice-dashboard/microservice-search/microservice-group-filter/microservice-group-filter.component.html @@ -20,19 +20,19 @@ aria-label="Git url">
- + +
- + +
diff --git a/src/main/webapp/app/entities/microservice/microservice-dashboard/microservice-search/microservice-group-filter/microservice-group-filter.component.ts b/src/main/webapp/app/entities/microservice/microservice-dashboard/microservice-search/microservice-group-filter/microservice-group-filter.component.ts index 06d94ec..5a5e4c5 100644 --- a/src/main/webapp/app/entities/microservice/microservice-dashboard/microservice-search/microservice-group-filter/microservice-group-filter.component.ts +++ b/src/main/webapp/app/entities/microservice/microservice-dashboard/microservice-search/microservice-group-filter/microservice-group-filter.component.ts @@ -1,5 +1,10 @@ import { Component, EventEmitter, OnInit, Output } from '@angular/core'; -import { MicroserviceGroupFilter, IMicroserviceGroupFilter } from 'app/shared/model/util/microservice-group-filter'; +import { IMicroserviceGroupFilter, MicroserviceGroupFilter } from 'app/shared/model/util/microservice-group-filter'; +import { TeamService } from 'app/entities/team/team.service'; +import { StatusService } from 'app/entities/status/status.service'; +import { ITeam } from 'app/shared/model/team.model'; +import { IStatus } from 'app/shared/model/status.model'; +import { HttpResponse } from '@angular/common/http'; @Component({ selector: 'jhi-microservice-group-filter', @@ -8,14 +13,25 @@ import { MicroserviceGroupFilter, IMicroserviceGroupFilter } from 'app/shared/mo }) export class MicroserviceGroupFilterComponent implements OnInit { groupFilter: IMicroserviceGroupFilter; + teams: ITeam[]; + statuses: IStatus[]; @Output() filterChanged = new EventEmitter(); - constructor() { + constructor(private teamService: TeamService, private statusService: StatusService) { this.groupFilter = new MicroserviceGroupFilter(); + this.teams = []; + this.statuses = []; } - ngOnInit(): void {} + ngOnInit(): void { + this.loadItems(); + } + + loadItems(): void { + this.teamService.query().subscribe((res: HttpResponse) => (this.teams = res.body || [])); + this.statusService.query().subscribe((res: HttpResponse) => (this.statuses = res.body || [])); + } onSearch(): void { this.filterChanged.emit(this.groupFilter); From aff765fe63a2a925c043511c9146ba2a12e859f6 Mon Sep 17 00:00:00 2001 From: tillias Date: Sun, 11 Oct 2020 13:04:03 +0200 Subject: [PATCH 3/4] Implemented filtering using custom pipe #16 --- .../microservice-dashboard.component.html | 2 +- .../microservice-dashboard.component.ts | 13 +++-- .../microservice-dashboard.module.ts | 5 +- .../microservice-group-filter.pipe.ts | 53 +++++++++++++++++++ .../microservice-group-filter.component.html | 46 +++++++++++----- .../microservice-group-filter.component.ts | 5 ++ .../model/util/microservice-group-filter.ts | 13 +++-- src/main/webapp/i18n/en/microservice.json | 9 +++- 8 files changed, 120 insertions(+), 26 deletions(-) create mode 100644 src/main/webapp/app/entities/microservice/microservice-dashboard/microservice-group-filter.pipe.ts diff --git a/src/main/webapp/app/entities/microservice/microservice-dashboard/microservice-dashboard.component.html b/src/main/webapp/app/entities/microservice/microservice-dashboard/microservice-dashboard.component.html index 14daa99..e9ca2b7 100644 --- a/src/main/webapp/app/entities/microservice/microservice-dashboard/microservice-dashboard.component.html +++ b/src/main/webapp/app/entities/microservice/microservice-dashboard/microservice-dashboard.component.html @@ -4,7 +4,7 @@
-
diff --git a/src/main/webapp/app/entities/microservice/microservice-dashboard/microservice-dashboard.component.ts b/src/main/webapp/app/entities/microservice/microservice-dashboard/microservice-dashboard.component.ts index 6093ac8..a075568 100644 --- a/src/main/webapp/app/entities/microservice/microservice-dashboard/microservice-dashboard.component.ts +++ b/src/main/webapp/app/entities/microservice/microservice-dashboard/microservice-dashboard.component.ts @@ -4,7 +4,7 @@ import { IMicroservice } from 'app/shared/model/microservice.model'; import { HttpResponse } from '@angular/common/http'; import { Subscription } from 'rxjs'; import { JhiEventManager } from 'ng-jhipster'; -import { IMicroserviceGroupFilter } from 'app/shared/model/util/microservice-group-filter'; +import { IMicroserviceGroupFilter, MicroserviceGroupFilter } from 'app/shared/model/util/microservice-group-filter'; @Component({ selector: 'jhi-microservice-dashboard', @@ -12,10 +12,14 @@ import { IMicroserviceGroupFilter } from 'app/shared/model/util/microservice-gro styleUrls: ['./microservice-dashboard.component.scss'], }) export class MicroserviceDashboardComponent implements OnInit, OnDestroy { - microservices?: IMicroservice[]; + microservices: IMicroservice[]; + filter: IMicroserviceGroupFilter; eventSubscriber?: Subscription; - constructor(protected microserviceService: MicroserviceService, protected eventManager: JhiEventManager) {} + constructor(protected microserviceService: MicroserviceService, protected eventManager: JhiEventManager) { + this.microservices = []; + this.filter = new MicroserviceGroupFilter(); + } ngOnInit(): void { this.loadAll(); @@ -45,6 +49,7 @@ export class MicroserviceDashboardComponent implements OnInit, OnDestroy { } onGroupFilterChanged(groupFilter: IMicroserviceGroupFilter): void { - alert(JSON.stringify(groupFilter)); + this.filter = groupFilter; + this.loadAll(); } } diff --git a/src/main/webapp/app/entities/microservice/microservice-dashboard/microservice-dashboard.module.ts b/src/main/webapp/app/entities/microservice/microservice-dashboard/microservice-dashboard.module.ts index b573fb0..46d80b8 100644 --- a/src/main/webapp/app/entities/microservice/microservice-dashboard/microservice-dashboard.module.ts +++ b/src/main/webapp/app/entities/microservice/microservice-dashboard/microservice-dashboard.module.ts @@ -1,12 +1,13 @@ import { NgModule } from '@angular/core'; import { MicroserviceDashboardComponent } from './microservice-dashboard.component'; -import { MicrocatalogSharedModule } from '../../../shared/shared.module'; +import { MicrocatalogSharedModule } from 'app/shared/shared.module'; import { RouterModule } from '@angular/router'; import { MicroserviceCardComponent } from './microservice-card/microservice-card.component'; import { MicroserviceSearchModule } from 'app/entities/microservice/microservice-dashboard/microservice-search/microservice-search.module'; +import { MicroserviceGroupFilterPipe } from './microservice-group-filter.pipe'; @NgModule({ - declarations: [MicroserviceDashboardComponent, MicroserviceCardComponent], + declarations: [MicroserviceDashboardComponent, MicroserviceCardComponent, MicroserviceGroupFilterPipe], imports: [MicroserviceSearchModule, MicrocatalogSharedModule, RouterModule], exports: [MicroserviceDashboardComponent], }) diff --git a/src/main/webapp/app/entities/microservice/microservice-dashboard/microservice-group-filter.pipe.ts b/src/main/webapp/app/entities/microservice/microservice-dashboard/microservice-group-filter.pipe.ts new file mode 100644 index 0000000..7f5f892 --- /dev/null +++ b/src/main/webapp/app/entities/microservice/microservice-dashboard/microservice-group-filter.pipe.ts @@ -0,0 +1,53 @@ +import { Pipe, PipeTransform } from '@angular/core'; +import { IMicroservice } from 'app/shared/model/microservice.model'; +import { IMicroserviceGroupFilter } from 'app/shared/model/util/microservice-group-filter'; + +@Pipe({ + name: 'microserviceGroupFilter', +}) +export class MicroserviceGroupFilterPipe implements PipeTransform { + transform(items: IMicroservice[], filter: IMicroserviceGroupFilter): IMicroservice[] { + if (!items || !filter) { + return items; + } + + return items.filter(i => { + let match = true; + match = match && this.contains(filter.caseSensitive, i.name, filter.name); + match = match && this.contains(filter.caseSensitive, i.description, filter.description); + match = match && this.contains(filter.caseSensitive, i.swaggerUrl, filter.swaggerUrl); + match = match && this.contains(filter.caseSensitive, i.gitUrl, filter.gitUrl); + + if (filter.status && i.status) { + match = match && i.status.id === filter.status.id; + } + if (filter.team && i.team) { + match = match && i.team.id === filter.team.id; + } + + return match; + }); + } + + contains(caseSensitive: boolean, source?: string, substr?: string): boolean { + if (!substr) { + return true; + } + + if (!source && substr) { + return false; + } + + if (source && substr) { + let sourceTerm = source; + let targetTerm = substr; + if (!caseSensitive) { + sourceTerm = source.toLowerCase(); + targetTerm = substr.toLowerCase(); + } + + return sourceTerm.includes(targetTerm); + } + return false; + } +} diff --git a/src/main/webapp/app/entities/microservice/microservice-dashboard/microservice-search/microservice-group-filter/microservice-group-filter.component.html b/src/main/webapp/app/entities/microservice/microservice-dashboard/microservice-search/microservice-group-filter/microservice-group-filter.component.html index 9761b49..01cafdb 100644 --- a/src/main/webapp/app/entities/microservice/microservice-dashboard/microservice-search/microservice-group-filter/microservice-group-filter.component.html +++ b/src/main/webapp/app/entities/microservice/microservice-dashboard/microservice-search/microservice-group-filter/microservice-group-filter.component.html @@ -4,39 +4,59 @@
- +
+ + +
- +
- +
- + +
+
+
- +
+ + +
diff --git a/src/main/webapp/app/entities/microservice/microservice-dashboard/microservice-search/microservice-group-filter/microservice-group-filter.component.ts b/src/main/webapp/app/entities/microservice/microservice-dashboard/microservice-search/microservice-group-filter/microservice-group-filter.component.ts index 5a5e4c5..181b6b5 100644 --- a/src/main/webapp/app/entities/microservice/microservice-dashboard/microservice-search/microservice-group-filter/microservice-group-filter.component.ts +++ b/src/main/webapp/app/entities/microservice/microservice-dashboard/microservice-search/microservice-group-filter/microservice-group-filter.component.ts @@ -36,4 +36,9 @@ export class MicroserviceGroupFilterComponent implements OnInit { onSearch(): void { this.filterChanged.emit(this.groupFilter); } + + onClearFilter(): void { + this.groupFilter = new MicroserviceGroupFilter(); + this.onSearch(); + } } diff --git a/src/main/webapp/app/shared/model/util/microservice-group-filter.ts b/src/main/webapp/app/shared/model/util/microservice-group-filter.ts index 25b7506..4dee2fb 100644 --- a/src/main/webapp/app/shared/model/util/microservice-group-filter.ts +++ b/src/main/webapp/app/shared/model/util/microservice-group-filter.ts @@ -2,12 +2,15 @@ import { ITeam } from 'app/shared/model/team.model'; import { IStatus } from 'app/shared/model/status.model'; export interface IMicroserviceGroupFilter { - name?: String; - description?: String; - swaggerUrl?: String; - gitUrl?: String; + caseSensitive: boolean; + name?: string; + description?: string; + swaggerUrl?: string; + gitUrl?: string; team?: ITeam; status?: IStatus; } -export class MicroserviceGroupFilter implements IMicroserviceGroupFilter {} +export class MicroserviceGroupFilter implements IMicroserviceGroupFilter { + caseSensitive = false; +} diff --git a/src/main/webapp/i18n/en/microservice.json b/src/main/webapp/i18n/en/microservice.json index 7032db8..7600355 100644 --- a/src/main/webapp/i18n/en/microservice.json +++ b/src/main/webapp/i18n/en/microservice.json @@ -8,7 +8,14 @@ "notFound": "No Microservices found" }, "search": { - "placeholder": "Please type your search text here" + "placeholder": "Please type your search text here", + "group": { + "case": "Case-sensitive search", + "team": "Select Team...", + "status": "Select Status...", + "search": "Search", + "clear": "Clear filters" + } }, "created": "A new Microservice is created with identifier {{ param }}", "updated": "A Microservice is updated with identifier {{ param }}", From a279beb9f3a094d9cbc05c7855816482b630dcc6 Mon Sep 17 00:00:00 2001 From: tillias Date: Sun, 11 Oct 2020 13:37:32 +0200 Subject: [PATCH 4/4] Microservice card now has CI Link #32 --- .jhipster/Microservice.json | 7 ++++ microcatalog.jdl | 3 +- .../microcatalog/domain/Microservice.java | 18 +++++++++ ...201001051657_added_entity_Microservice.xml | 4 ++ .../liquibase/fake-data/microservice.csv | 22 +++++------ .../microservice-card.component.html | 2 + .../microservice-detail.component.html | 4 ++ .../microservice-update.component.html | 12 ++++++ .../microservice-update.component.ts | 3 ++ .../microservice/microservice.component.html | 2 + .../app/shared/model/microservice.model.ts | 2 + .../webapp/i18n/de/custom-microservice.json | 24 ++++++++++++ .../webapp/i18n/de/dependency-dashboard.json | 11 +----- src/main/webapp/i18n/de/microservice.json | 4 +- .../webapp/i18n/en/custom-microservice.json | 24 ++++++++++++ .../webapp/i18n/en/dependency-dashboard.json | 12 ------ src/main/webapp/i18n/en/microservice.json | 11 +----- .../web/rest/MicroserviceResourceIT.java | 39 ++++++++++++++++--- .../microservice/microservice.service.spec.ts | 4 +- 19 files changed, 155 insertions(+), 53 deletions(-) create mode 100644 src/main/webapp/i18n/de/custom-microservice.json create mode 100644 src/main/webapp/i18n/en/custom-microservice.json delete mode 100644 src/main/webapp/i18n/en/dependency-dashboard.json diff --git a/.jhipster/Microservice.json b/.jhipster/Microservice.json index ac13d2b..334c236 100644 --- a/.jhipster/Microservice.json +++ b/.jhipster/Microservice.json @@ -36,6 +36,13 @@ "fieldValidateRules": [ "required" ] + }, + { + "fieldName": "ciUrl", + "fieldType": "String", + "fieldValidateRules": [ + "required" + ] } ], "relationships": [ diff --git a/microcatalog.jdl b/microcatalog.jdl index 0b861a8..acc5cf7 100644 --- a/microcatalog.jdl +++ b/microcatalog.jdl @@ -14,7 +14,8 @@ entity Microservice { description TextBlob required, imageUrl String required, swaggerUrl String required, - gitUrl String required + gitUrl String required, + ciUrl String required } entity Dependency { diff --git a/src/main/java/com/github/microcatalog/domain/Microservice.java b/src/main/java/com/github/microcatalog/domain/Microservice.java index 8a71f0b..5eb91e7 100644 --- a/src/main/java/com/github/microcatalog/domain/Microservice.java +++ b/src/main/java/com/github/microcatalog/domain/Microservice.java @@ -47,6 +47,10 @@ public class Microservice implements Serializable { @Column(name = "git_url", nullable = false) private String gitUrl; + @NotNull + @Column(name = "ci_url", nullable = false) + private String ciUrl; + @ManyToOne(optional = false) @NotNull @JsonIgnoreProperties(value = "microservices", allowSetters = true) @@ -131,6 +135,19 @@ public void setGitUrl(String gitUrl) { this.gitUrl = gitUrl; } + public String getCiUrl() { + return ciUrl; + } + + public Microservice ciUrl(String ciUrl) { + this.ciUrl = ciUrl; + return this; + } + + public void setCiUrl(String ciUrl) { + this.ciUrl = ciUrl; + } + public Team getTeam() { return team; } @@ -184,6 +201,7 @@ public String toString() { ", imageUrl='" + getImageUrl() + "'" + ", swaggerUrl='" + getSwaggerUrl() + "'" + ", gitUrl='" + getGitUrl() + "'" + + ", ciUrl='" + getCiUrl() + "'" + "}"; } } diff --git a/src/main/resources/config/liquibase/changelog/20201001051657_added_entity_Microservice.xml b/src/main/resources/config/liquibase/changelog/20201001051657_added_entity_Microservice.xml index fd75fb8..5cea077 100644 --- a/src/main/resources/config/liquibase/changelog/20201001051657_added_entity_Microservice.xml +++ b/src/main/resources/config/liquibase/changelog/20201001051657_added_entity_Microservice.xml @@ -30,6 +30,9 @@ + + + @@ -64,6 +67,7 @@ + diff --git a/src/main/resources/config/liquibase/fake-data/microservice.csv b/src/main/resources/config/liquibase/fake-data/microservice.csv index f40e7d1..ca16967 100644 --- a/src/main/resources/config/liquibase/fake-data/microservice.csv +++ b/src/main/resources/config/liquibase/fake-data/microservice.csv @@ -1,11 +1,11 @@ -id;name;description;image_url;swagger_url;git_url;team_id;status_id -1;COM silver cultivate;../fake-data/blob/hipster.txt;rich Prairie olive;Handcrafted program hard drive;lime Denmark;1;1 -2;Kenya;../fake-data/blob/hipster.txt;Yemeni Rial Cayman Islands Shoes;infrastructure;Reactive;2;2 -3;interface bifurcated Forint;../fake-data/blob/hipster.txt;teal;Bedfordshire Supervisor;pixel Regional Assimilated;3;3 -4;Home Loan Account;../fake-data/blob/hipster.txt;partnerships Wisconsin;exploit well-modulated;black online;4;4 -5;Games Rwanda Franc networks;../fake-data/blob/hipster.txt;Profound Buckinghamshire panel;Graphical User Interface Tuna;Diverse;5;1 -6;card value-added;../fake-data/blob/hipster.txt;bypass Reduced;Montana;Iceland Krona;6;2 -7;indexing;../fake-data/blob/hipster.txt;Frozen index;Intelligent Central;expedite;7;3 -8;index;../fake-data/blob/hipster.txt;Savings Account Berkshire quantify;web-readiness Investment Account;array Intelligent Rubber Table fuchsia;8;4 -9;calculating;../fake-data/blob/hipster.txt;North Dakota;throughput bluetooth Coordinator;override HTTP Incredible Granite Cheese;9;1 -10;local area network knowledge base;../fake-data/blob/hipster.txt;Fantastic Cotton Chips portals;bypass Euro Optimized;Wooden Keyboard RAM;10;2 +id;name;description;image_url;swagger_url;git_url;ci_url;team_id;status_id +1;COM silver cultivate;../fake-data/blob/hipster.txt;rich Prairie olive;Handcrafted program hard drive;lime Denmark;Kenya;1;1 +2;Yemeni Rial Cayman Islands Shoes;../fake-data/blob/hipster.txt;infrastructure;Reactive;interface bifurcated Forint;teal;2;2 +3;Bedfordshire Supervisor;../fake-data/blob/hipster.txt;pixel Regional Assimilated;Home Loan Account;partnerships Wisconsin;exploit well-modulated;3;3 +4;black online;../fake-data/blob/hipster.txt;Games Rwanda Franc networks;Profound Buckinghamshire panel;Graphical User Interface Tuna;Diverse;4;4 +5;card value-added;../fake-data/blob/hipster.txt;bypass Reduced;Montana;Iceland Krona;indexing;5;1 +6;Frozen index;../fake-data/blob/hipster.txt;Intelligent Central;expedite;index;Savings Account Berkshire quantify;6;2 +7;web-readiness Investment Account;../fake-data/blob/hipster.txt;array Intelligent Rubber Table fuchsia;calculating;North Dakota;throughput bluetooth Coordinator;7;3 +8;override HTTP Incredible Granite Cheese;../fake-data/blob/hipster.txt;local area network knowledge base;Fantastic Cotton Chips portals;bypass Euro Optimized;Wooden Keyboard RAM;8;4 +9;United Kingdom back up cross-platform;../fake-data/blob/hipster.txt;homogeneous Ameliorated;indexing;contextually-based HDD;Tuna Intelligent Steel Shoes;9;1 +10;Strategist Senior;../fake-data/blob/hipster.txt;payment circuit withdrawal;facilitate Principal;Awesome Metal Bacon AGP;Zloty online Massachusetts;10;2 diff --git a/src/main/webapp/app/entities/microservice/microservice-dashboard/microservice-card/microservice-card.component.html b/src/main/webapp/app/entities/microservice/microservice-dashboard/microservice-card/microservice-card.component.html index 88a76fd..d941251 100644 --- a/src/main/webapp/app/entities/microservice/microservice-dashboard/microservice-card/microservice-card.component.html +++ b/src/main/webapp/app/entities/microservice/microservice-dashboard/microservice-card/microservice-card.component.html @@ -21,6 +21,8 @@
{{microservice.description}}
GIT | + CI + | API
diff --git a/src/main/webapp/app/entities/microservice/microservice-detail.component.html b/src/main/webapp/app/entities/microservice/microservice-detail.component.html index 9cd277c..196ded3 100644 --- a/src/main/webapp/app/entities/microservice/microservice-detail.component.html +++ b/src/main/webapp/app/entities/microservice/microservice-detail.component.html @@ -28,6 +28,10 @@

Microservice<
{{ microservice.gitUrl }}
+
Ci Url
+
+ {{ microservice.ciUrl }} +
Team
diff --git a/src/main/webapp/app/entities/microservice/microservice-update.component.html b/src/main/webapp/app/entities/microservice/microservice-update.component.html index aadbf63..1b80e6b 100644 --- a/src/main/webapp/app/entities/microservice/microservice-update.component.html +++ b/src/main/webapp/app/entities/microservice/microservice-update.component.html @@ -71,6 +71,18 @@

+ + +
+ + This field is required. + +
+

+