From 188ef8d2ad8d1cee1f905f280702e4f53acc1c73 Mon Sep 17 00:00:00 2001 From: tillias Date: Sun, 4 Oct 2020 07:44:29 +0200 Subject: [PATCH 1/4] improved microservice status positioning and extracted separate card component --- .../microservice-card.component.html | 32 +++++++++++++++++ .../microservice-card.component.scss | 0 .../microservice-card.component.ts | 15 ++++++++ .../microservice-dashboard.component.html | 35 +------------------ .../microservice-dashboard.module.ts | 3 +- 5 files changed, 50 insertions(+), 35 deletions(-) create mode 100644 src/main/webapp/app/entities/microservice/microservice-dashboard/microservice-card/microservice-card.component.html create mode 100644 src/main/webapp/app/entities/microservice/microservice-dashboard/microservice-card/microservice-card.component.scss create mode 100644 src/main/webapp/app/entities/microservice/microservice-dashboard/microservice-card/microservice-card.component.ts 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 new file mode 100644 index 0000000..6c66ca3 --- /dev/null +++ b/src/main/webapp/app/entities/microservice/microservice-dashboard/microservice-card/microservice-card.component.html @@ -0,0 +1,32 @@ +
+
+

{{microservice.name}}

+ {{microservice.status?.name}} +
+
+
+ + IMAGE +
+ Team: {{microservice.team?.name}} + {{microservice.team?.productOwner}} (PO) + {{microservice.team?.teamLead}} (TL) +
+
+
{{microservice.description}}
+ +
+
+ GIT + | + API +
+ + Details + + +
+
+
diff --git a/src/main/webapp/app/entities/microservice/microservice-dashboard/microservice-card/microservice-card.component.scss b/src/main/webapp/app/entities/microservice/microservice-dashboard/microservice-card/microservice-card.component.scss new file mode 100644 index 0000000..e69de29 diff --git a/src/main/webapp/app/entities/microservice/microservice-dashboard/microservice-card/microservice-card.component.ts b/src/main/webapp/app/entities/microservice/microservice-dashboard/microservice-card/microservice-card.component.ts new file mode 100644 index 0000000..d77e3db --- /dev/null +++ b/src/main/webapp/app/entities/microservice/microservice-dashboard/microservice-card/microservice-card.component.ts @@ -0,0 +1,15 @@ +import { Component, Input, OnInit } from '@angular/core'; +import { IMicroservice } from 'app/shared/model/microservice.model'; + +@Component({ + selector: 'jhi-microservice-card', + templateUrl: './microservice-card.component.html', + styleUrls: ['./microservice-card.component.scss'], +}) +export class MicroserviceCardComponent implements OnInit { + @Input() microservice: IMicroservice; + + constructor() {} + + ngOnInit(): void {} +} 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 0e345e7..9027adb 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,36 +1,3 @@
-
-
-

- {{microservice.name}} - {{microservice.status?.name}} -

-
-
-
- - IMAGE -
- Team: {{microservice.team?.name}} - {{microservice.team?.productOwner}} (PO) - {{microservice.team?.teamLead}} (TL) -
-
-
{{microservice.description}}
- -
-
- GIT - | - API -
- - Details - - -
-
-
+
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 055497c..b494171 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 @@ -2,9 +2,10 @@ import { NgModule } from '@angular/core'; import { MicroserviceDashboardComponent } from './microservice-dashboard.component'; import { MicrocatalogSharedModule } from '../../../shared/shared.module'; import { RouterModule } from '@angular/router'; +import { MicroserviceCardComponent } from './microservice-card/microservice-card.component'; @NgModule({ - declarations: [MicroserviceDashboardComponent], + declarations: [MicroserviceDashboardComponent, MicroserviceCardComponent], imports: [MicrocatalogSharedModule, RouterModule], exports: [MicroserviceDashboardComponent], }) From 55942bb60b0e774d2db6c5209e1cfe9e0fae7836 Mon Sep 17 00:00:00 2001 From: tillias Date: Sun, 4 Oct 2020 09:10:54 +0200 Subject: [PATCH 2/4] code cleanup https://stackoverflow.com/questions/64182868/error-handling-for-missing-image-in-angular-9/64183191?noredirect=1#comment113511993_64183191 --- .../microservice-card/microservice-card.component.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 6c66ca3..48dee02 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 @@ -7,7 +7,7 @@

{{microservice.name}}

IMAGE
Team: {{microservice.team?.name}} From dd4d1584ed525124eb2f336f2936f9e7d51e4ae8 Mon Sep 17 00:00:00 2001 From: tillias Date: Sun, 4 Oct 2020 09:22:17 +0200 Subject: [PATCH 3/4] fixed validation See https://www.bennadel.com/blog/3539-using-the-definite-assignment-assertion-to-define-required-input-bindings-in-angular-7-1-1.htm --- .../microservice-card/microservice-card.component.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/webapp/app/entities/microservice/microservice-dashboard/microservice-card/microservice-card.component.ts b/src/main/webapp/app/entities/microservice/microservice-dashboard/microservice-card/microservice-card.component.ts index d77e3db..ab0723b 100644 --- a/src/main/webapp/app/entities/microservice/microservice-dashboard/microservice-card/microservice-card.component.ts +++ b/src/main/webapp/app/entities/microservice/microservice-dashboard/microservice-card/microservice-card.component.ts @@ -7,7 +7,7 @@ import { IMicroservice } from 'app/shared/model/microservice.model'; styleUrls: ['./microservice-card.component.scss'], }) export class MicroserviceCardComponent implements OnInit { - @Input() microservice: IMicroservice; + @Input() microservice!: IMicroservice; constructor() {} From 903c75da4c5ee5d3f49d733f70de1f15f58ba152 Mon Sep 17 00:00:00 2001 From: tillias Date: Sun, 4 Oct 2020 09:32:42 +0200 Subject: [PATCH 4/4] docker image should be only built in master --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index a92ea5e..3151c58 100644 --- a/.travis.yml +++ b/.travis.yml @@ -47,10 +47,10 @@ script: ./mvnw -ntp clean verify && ./mvnw -ntp com.github.eirslett:frontend-maven-plugin:npm -Dfrontend.npm.arguments='run test' -Dmaven.repo.local=$MAVEN_USER_HOME && ./mvnw -ntp verify -Pprod -DskipTests && + if [ "$BRANCH" = "master" ]; then docker build -t tillias/microcatalog . && echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin && docker push tillias/microcatalog && - if [ "$BRANCH" = "master" ]; then ./mvnw -ntp com.heroku.sdk:heroku-maven-plugin:2.0.5:deploy-only -Pheroku -Dheroku.buildpacks=heroku/jvm -Dheroku.appName=microcatalog; fi notifications: