Skip to content

Commit

Permalink
fix: Adjust version
Browse files Browse the repository at this point in the history
Wiremock added a version endpoint. It provides less information,
but I keep it like this. So only the WireMock version is shown
at the moment. This might change in the future.
  • Loading branch information
Holomek Christopher; BMW Group committed Feb 19, 2024
1 parent 3a3d839 commit d26f6f7
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 12 deletions.
7 changes: 1 addition & 6 deletions webapp/wiremock/src/app/components/home/home.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -113,15 +113,10 @@
Shutdown
</button>
<div class="dropdown-divider"></div>
<h6 class="dropdown-header" [ngbTooltip]="versionTooltipContent">{{ version }}</h6>
<h6 class="dropdown-header">{{ version }}</h6>
</div>
</div>
</div>
</nav>
<wm-message></wm-message>
<router-outlet></router-outlet>
<ng-template #versionTooltipContent>
<pre class="text-wrap mb-0">
{{ versionTooltip }}
</pre>
</ng-template>
4 changes: 0 additions & 4 deletions webapp/wiremock/src/app/components/home/home.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,10 +83,6 @@ export class HomeComponent implements OnInit, OnDestroy {
this.wiremockService.getVersion().subscribe({
next: version => {
this.version = `Version: ${version.version}`;
this.versionTooltip = `WireMock: ${version.version.substring(
0,
version.version.lastIndexOf(".")
)}\nBuildTime: ${version.buildTime}`;
},
});
}
Expand Down
5 changes: 4 additions & 1 deletion webapp/wiremock/src/app/model/wiremock/version.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
export class Version {
version!: string;
buildTime!: string;

constructor(version: string) {
this.version = version;
}
}
6 changes: 5 additions & 1 deletion webapp/wiremock/src/app/services/wiremock.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,11 @@ export class WiremockService {
}

getVersion(): Observable<Version> {
return this.defaultPipe(this.http.get<Version>(WiremockService.getUrl("version")));
return this.defaultPipe(this.http.get(WiremockService.getUrl('version'), {
responseType: 'text'
}).pipe(map(v => {
return new Version(v);
})));
}

shutdown(): Observable<ResponseDefinition> {
Expand Down

0 comments on commit d26f6f7

Please sign in to comment.