Skip to content

Commit

Permalink
feat: Update 3.4.0.0
Browse files Browse the repository at this point in the history
- Merge upstream 3.4.0
- Replace version approach with WireMock solution
  wiremock-gui version is lost now.
  • Loading branch information
holomekc committed Feb 19, 2024
1 parent e2cd0fb commit b41be01
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 94 deletions.
13 changes: 1 addition & 12 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -443,19 +443,8 @@ task generateWebapp(type: NpmTask) {
args = ['run', 'prod']
}

task versionTxt() {
dependsOn generateWebapp
doLast {
new File(projectDir.getAbsolutePath() + "/src/main/resources", "version.json").text = """{
"buildTime": "${new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSZ").format(new Date())}",
"version": "$version"
}
"""
}
}

task finalizeWebapp(type: Copy) {
dependsOn versionTxt
dependsOn generateWebapp
// Because of: https://github.com/angular/angular-cli/issues/26304
// we need to copy some things around.
from 'webapp/wiremock/dist/browser'
Expand Down

This file was deleted.

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>
5 changes: 0 additions & 5 deletions webapp/wiremock/src/app/components/home/home.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ export class HomeComponent implements OnInit, OnDestroy {

currentRecordingStatus?: RecordingStatus;
version?: string;
versionTooltip?: string;

RecordingStatus = RecordingStatus;

Expand Down Expand Up @@ -83,10 +82,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
1 change: 0 additions & 1 deletion webapp/wiremock/src/app/model/wiremock/version.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
export class Version {
version!: string;
buildTime!: string;
}
16 changes: 14 additions & 2 deletions webapp/wiremock/src/app/services/wiremock.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,19 @@ 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 => {
const version = new Version();
version.version = v;
return version;
})
)
);
}

shutdown(): Observable<ResponseDefinition> {
Expand Down Expand Up @@ -213,7 +225,7 @@ export class WiremockService {
if (error.error instanceof ErrorEvent) {
console.error("An error occurred:", error.error.message);
} else {
console.error("An error occurred:", error);
console.error("An error occurred:", JSON.stringify(error));
}
}
console.log(`Attempt ${count}: retrying in ${count * delay}ms`);
Expand Down

0 comments on commit b41be01

Please sign in to comment.