-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
37 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
- Adjust the UI | ||
- Create separate E2E test project which locally tests agains running angular + Spring API using Selnium. On CI it uses test containers of both images. Adding authontication headers with own server. | ||
- Try using WebTestClient https://docs.spring.io/spring-framework/reference/testing/webtestclient.html#webtestclient-json | ||
- Add pgAdmin to dev container https://www.pgadmin.org/download/pgadmin-4-container/s | ||
- fix client tests |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
<app-weight></app-weight> | ||
<app-weight *ngIf="$sync | async"></app-weight> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,13 @@ | ||
import { Component } from '@angular/core'; | ||
import { WithingsService } from './withings.service'; | ||
|
||
@Component({ | ||
selector: 'app-root', | ||
templateUrl: './app.component.html', | ||
styleUrls: ['./app.component.css'] | ||
}) | ||
export class AppComponent {} | ||
export class AppComponent { | ||
constructor(private withingsService: WithingsService) {} | ||
|
||
$sync = this.withingsService.sync(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import { HttpClient } from '@angular/common/http'; | ||
import { Injectable } from '@angular/core'; | ||
import { Observable, map } from 'rxjs'; | ||
import { WeightResponse } from './types'; | ||
|
||
@Injectable({ | ||
providedIn: 'root', | ||
}) | ||
export class WeightService { | ||
constructor(private http: HttpClient) {} | ||
|
||
getWeight(): Observable<number | undefined> { | ||
return this.http | ||
.get<WeightResponse>('/api/weight') | ||
.pipe(map((weightResponse) => weightResponse.weight)); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,16 @@ | ||
import { Component } from '@angular/core'; | ||
import { map } from 'rxjs'; | ||
import { WithingsService } from '../withings.service'; | ||
import { WeightService } from '../weight.service'; | ||
|
||
@Component({ | ||
selector: 'app-weight', | ||
templateUrl: './weight.component.html', | ||
styleUrls: ['./weight.component.css'], | ||
}) | ||
export class WeightComponent { | ||
constructor(private withingsService: WithingsService) {} | ||
constructor(private weightService: WeightService) {} | ||
|
||
$weight = this.withingsService | ||
$weight = this.weightService | ||
.getWeight() | ||
.pipe(map((weight) => weight?.toString() ?? '?')); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters