forked from Macn2/ffq-questionnaire-web
-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #272 from babyfeed/feat/new_growth_page
feat: new clinic growth page & fix values in lb
- Loading branch information
Showing
12 changed files
with
175 additions
and
15 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
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
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
62 changes: 62 additions & 0 deletions
62
src/app/pages/clinic-growth/clinic-growth-page.component.css
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,62 @@ | ||
.page-container { | ||
width: 100%; | ||
max-width: 1200px; | ||
min-height: 100vh; | ||
margin: 0 auto; | ||
padding: 16px; | ||
padding-top: 220px; | ||
@media (min-width: 693px) { | ||
padding-top: 164px; | ||
} | ||
} | ||
.header { | ||
margin-top: 32px; | ||
display: flex; | ||
justify-content: space-between; | ||
} | ||
.header-title { | ||
font-size: 24px; | ||
} | ||
|
||
table { | ||
font-family: arial, sans-serif; | ||
border-collapse: collapse; | ||
width: 100%; | ||
margin-top: 16px; | ||
margin-bottom: 32px; | ||
} | ||
|
||
td, | ||
th { | ||
border: 1px solid #ddd; | ||
padding: 8px; | ||
text-align: left; | ||
} | ||
|
||
tr:nth-child(even) { | ||
background-color: #eee; | ||
} | ||
|
||
th { | ||
background-color: #f4f4f4; | ||
} | ||
|
||
.empty-table-message { | ||
width: 100%; | ||
padding: 8px; | ||
background-color: white; | ||
border: 1px solid #ddd; | ||
text-align: center; | ||
color: #888 | ||
} | ||
|
||
.percentile-td { | ||
display: flex; | ||
align-items: center; | ||
gap: 6px; | ||
} | ||
.percentile-indicator { | ||
width: 16px; | ||
height: 16px; | ||
border-radius: 99px; | ||
} |
45 changes: 45 additions & 0 deletions
45
src/app/pages/clinic-growth/clinic-growth-page.component.html
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,45 @@ | ||
<clinical-header></clinical-header> | ||
|
||
<div class="page-container"> | ||
<section class="header"> | ||
<h1 class="header-title">{{ "Growth Charts Results" | translate }}</h1> | ||
<button (click)="toggleLanguage()" mat-raised-button class="lang-button"> | ||
{{ "For English" | translate }} | ||
</button> | ||
</section> | ||
<table> | ||
<thead> | ||
<tr> | ||
<th>{{ "Parent" | translate }}</th> | ||
<th>{{ "Date" | translate }}</th> | ||
<th>{{ "Age (months)" | translate }}</th> | ||
<th>{{ "Gender" | translate }}</th> | ||
<th>{{ "Weight (kg)" | translate }}</th> | ||
<th>{{ "Length (cm)" | translate }}</th> | ||
<th>{{ "Percentile" | translate }}</th> | ||
</tr> | ||
</thead> | ||
<tbody> | ||
<tr *ngFor="let record of records"> | ||
<td>{{ record.parentUsername }}</td> | ||
<td>{{ record.timestamp | date : "medium" }}</td> | ||
<td>{{ record.age }}</td> | ||
<td>{{ record.gender | translate }}</td> | ||
<td>{{ record.weight }}</td> | ||
<td>{{ record.height }}</td> | ||
<td class="percentile-td"> | ||
<span | ||
class="percentile-indicator" | ||
[style.background]="record.percentile.color" | ||
></span> | ||
{{ record.percentile.percentile }} | ||
</td> | ||
</tr> | ||
<tr *ngIf="records.length === 0"> | ||
<td colspan="8" class="empty-table-message"> | ||
{{ "No data available" | translate }} | ||
</td> | ||
</tr> | ||
</tbody> | ||
</table> | ||
</div> |
27 changes: 27 additions & 0 deletions
27
src/app/pages/clinic-growth/clinic-growth-page.component.ts
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,27 @@ | ||
import { Component } from "@angular/core"; | ||
import { | ||
GrowthRecord, | ||
GrowthService, | ||
} from "src/app/services/growth/growth-service"; | ||
|
||
@Component({ | ||
selector: "app-clinic-growth-page", | ||
templateUrl: "./clinic-growth-page.component.html", | ||
styleUrls: ["./clinic-growth-page.component.css"], | ||
}) | ||
export class ClinicGrowthPage { | ||
records: GrowthRecord[] = []; | ||
constructor(private growthService: GrowthService) {} | ||
|
||
ngOnInit() { | ||
this.loadRecords(); | ||
} | ||
|
||
async loadRecords() { | ||
const records = await this.growthService.getClinicRecords(); | ||
this.records = records.data; | ||
} | ||
toggleLanguage(): void { | ||
this.growthService.toggleLanguage(); | ||
} | ||
} |
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
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
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