From 178d0756b0b3590fa6543d562a2804a792e33148 Mon Sep 17 00:00:00 2001 From: Adalcino Junior Date: Mon, 2 Mar 2020 16:46:30 -0300 Subject: [PATCH 1/8] =?UTF-8?q?[hotfix/3.3.1]=20-=20Corre=C3=A7=C3=A3o=20d?= =?UTF-8?q?e=20Bugs=20Tarefas:=20Dialog=20n=C3=A3o=20fecha=20Bugs:=20Os=20?= =?UTF-8?q?dialogs=20para=20edi=C3=A7=C3=A3o=20de=20usu=C3=A1rios=20n?= =?UTF-8?q?=C3=A3o=20fechava=20ap=C3=B3s=20pressionar=20o=20bot=C3=A3o=20E?= =?UTF-8?q?SC.=20Outras=20Informa=C3=A7=C3=B5es:=20Inser=C3=A7=C3=A3o=20do?= =?UTF-8?q?=20m=C3=A9todo=20para=20fechar=20os=20dialog=20ap=C3=B3s=20o=20?= =?UTF-8?q?evento=20close=20dos=20modais=20de=20edi=C3=A7=C3=A3o=20e=20ins?= =?UTF-8?q?er=C3=A7=C3=A3o=20de=20usu=C3=A1rios.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../admin/administrators/administrators.component.html | 8 ++++---- .../admin/administrators/administrators.component.ts | 10 ++++++++-- .../health.professionals.component.html | 6 +++--- .../health.professionals.component.ts | 8 +++++++- .../modules/admin/modal.user/modal.user.component.ts | 2 +- 5 files changed, 23 insertions(+), 11 deletions(-) diff --git a/src/app/modules/admin/administrators/administrators.component.html b/src/app/modules/admin/administrators/administrators.component.html index b47e303..42909e3 100755 --- a/src/app/modules/admin/administrators/administrators.component.html +++ b/src/app/modules/admin/administrators/administrators.component.html @@ -12,7 +12,7 @@
- @@ -21,13 +21,13 @@
- + - + + [userId]="userEdit.id" [typeUser]="typeUser" (onclose)="closeModalEdit()"> diff --git a/src/app/modules/admin/administrators/administrators.component.ts b/src/app/modules/admin/administrators/administrators.component.ts index 9eefa6b..fef88a3 100755 --- a/src/app/modules/admin/administrators/administrators.component.ts +++ b/src/app/modules/admin/administrators/administrators.component.ts @@ -125,17 +125,23 @@ export class AdministratorsComponent implements OnInit { }); } - openModal() { + openModalNew() { this.modalService.open('modalUser'); this.userEdit = new Admin(''); } + closeModalNew() { + this.modalService.close('modalUser'); + this.userEdit = new Admin(''); + } + editUser(event) { this.modalService.open('modalUserEdit'); this.userEdit = event; } - cleanUser(): void { + closeModalEdit(): void { + this.modalService.close('modalUserEdit'); this.userEdit = new Admin('FLAG'); } diff --git a/src/app/modules/admin/health.professionals/health.professionals.component.html b/src/app/modules/admin/health.professionals/health.professionals.component.html index db086fd..7653300 100755 --- a/src/app/modules/admin/health.professionals/health.professionals.component.html +++ b/src/app/modules/admin/health.professionals/health.professionals.component.html @@ -21,12 +21,12 @@ - + - + + [typeUser]="typeUser" [userId]="userEdit.id" (onclose)="closeModalEdit()"> diff --git a/src/app/modules/admin/health.professionals/health.professionals.component.ts b/src/app/modules/admin/health.professionals/health.professionals.component.ts index 7ae01bd..a84e646 100755 --- a/src/app/modules/admin/health.professionals/health.professionals.component.ts +++ b/src/app/modules/admin/health.professionals/health.professionals.component.ts @@ -128,12 +128,18 @@ export class HealthProfessionalComponent implements OnInit { this.userEdit = new HealthProfessional(''); } + closeModalNew() { + this.modalService.close('modalUser'); + this.userEdit = new HealthProfessional(''); + } + editUser(event) { this.modalService.open('modalUserEdit'); this.userEdit = event; } - cleanUser(): void { + closeModalEdit(): void { + this.modalService.close('modalUserEdit'); this.userEdit = new HealthProfessional('FLAG'); } diff --git a/src/app/modules/admin/modal.user/modal.user.component.ts b/src/app/modules/admin/modal.user/modal.user.component.ts index 5451e3c..f2cba48 100755 --- a/src/app/modules/admin/modal.user/modal.user.component.ts +++ b/src/app/modules/admin/modal.user/modal.user.component.ts @@ -267,8 +267,8 @@ export class ModalUserComponent implements OnInit, OnChanges, OnDestroy { } ngOnChanges() { + this.createForm(); if (this.userId && this.userId !== 'FLAG') { - this.createForm(); this.loadUserInForm(); } } From 5e7dab1ca16859572f0582465ccb3b9717021be0 Mon Sep 17 00:00:00 2001 From: Adalcino Junior Date: Mon, 2 Mar 2020 18:12:31 -0300 Subject: [PATCH 2/8] =?UTF-8?q?[hotfix/3.3.1]=20-=20Corre=C3=A7=C3=A3o=20d?= =?UTF-8?q?e=20Bugs=20Tarefas:=20Bugs=20e=20melhorias=20Bugs:=20Impacto=20?= =?UTF-8?q?ultrapassando=20100%.=20Outras=20Informa=C3=A7=C3=B5es:=20Limit?= =?UTF-8?q?ando=20o=20valor=20do=20impacto=20da=20atividade=20para=20ser?= =?UTF-8?q?=20no=20m=C3=A1ximo=20100.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../activity.details.component.html | 32 ++++++++----------- .../activity.details.component.scss | 26 +++++++++++++++ .../activity.details.component.ts | 10 ++++++ 3 files changed, 50 insertions(+), 18 deletions(-) diff --git a/src/app/modules/activity/activity.details/activity.details.component.html b/src/app/modules/activity/activity.details/activity.details.component.html index 6abe39c..fec38d3 100755 --- a/src/app/modules/activity/activity.details/activity.details.component.html +++ b/src/app/modules/activity/activity.details/activity.details.component.html @@ -163,8 +163,8 @@

-
-
+
+
-
-
-
+
+
@@ -192,11 +190,10 @@

+{{physicalActivity ? physicalActivity.steps : ''}}

-
-
-
+
+
@@ -209,11 +206,10 @@

+{{physicalActivity ? physicalActivity.calories : ''}}

-
-
-
+
+
@@ -257,4 +253,4 @@

\ No newline at end of file + (noconfirmation)="closeModalConfirmation()"> diff --git a/src/app/modules/activity/activity.details/activity.details.component.scss b/src/app/modules/activity/activity.details/activity.details.component.scss index 51bc57e..ba49ff1 100755 --- a/src/app/modules/activity/activity.details/activity.details.component.scss +++ b/src/app/modules/activity/activity.details/activity.details.component.scss @@ -75,3 +75,29 @@ i:hover { vertical-align: bottom; width: 0px; } + +.impact-extern{ + border: 1px dashed black; + display: flex; + align-items: center; + justify-content: center; + border-radius: 50px; + position: relative; + width: 60px; + height: 60px; +} + +.impact-inner{ + display: flex; + position: absolute; + align-items: center; + justify-content: center; + border-radius: 50px; + background-color: #B7D331; +} + +.flex-center{ + display: flex; + align-content: center; + justify-content: center; +} diff --git a/src/app/modules/activity/activity.details/activity.details.component.ts b/src/app/modules/activity/activity.details/activity.details.component.ts index 79014ff..865e5af 100755 --- a/src/app/modules/activity/activity.details/activity.details.component.ts +++ b/src/app/modules/activity/activity.details/activity.details.component.ts @@ -29,6 +29,9 @@ export class ActivityDetailsComponent implements OnInit { caloriesValue: number; activeMinutesValue: number; distanceValue: number; + impactOfSteps: number; + impactOfCalories: number; + impactOfActiveMinutes: number; constructor( private activeRouter: ActivatedRoute, @@ -50,6 +53,12 @@ export class ActivityDetailsComponent implements OnInit { }) } + calcImpact(): void { + this.impactOfSteps = Math.min(Math.floor((this.physicalActivity.steps * 100) / this.stepsValue), 100); + this.impactOfCalories = Math.min(Math.floor((this.physicalActivity.calories * 100) / this.caloriesValue), 100); + this.impactOfActiveMinutes = Math.min(Math.floor(((this.physicalActivity.duration / 60000) * 100) / this.activeMinutesValue)); + } + loadActivity(activityId: string): void { this.loadingPhysicalActivity = true; this.physicalActivitiesService.getById(this.patientId, activityId) @@ -321,6 +330,7 @@ export class ActivityDetailsComponent implements OnInit { this.caloriesValue = timeSeries.calories.summary.total; this.activeMinutesValue = timeSeries.active_minutes.summary.total; this.distanceValue = timeSeries.distance.summary.total; + this.calcImpact(); }) .catch(err => { this.stepsValue = 0; From 78abcd7c3ec913e06b26306043fc65c7f35712c7 Mon Sep 17 00:00:00 2001 From: Adalcino Junior Date: Mon, 2 Mar 2020 18:40:03 -0300 Subject: [PATCH 3/8] =?UTF-8?q?[hotfix/3.3.1]=20-=20Corre=C3=A7=C3=A3o=20d?= =?UTF-8?q?e=20Bugs=20Tarefas:=20Bugs=20e=20melhorias=20Bugs:=20Dura=C3=A7?= =?UTF-8?q?=C3=A3o=20de=20atividade=20formatada=20errada.=20Outras=20Infor?= =?UTF-8?q?ma=C3=A7=C3=B5es:=20Adicionando=20pipe=20para=20formata=C3=A7?= =?UTF-8?q?=C3=A3o=20de=20dura=C3=A7=C3=A3o=20de=20atividade=20f=C3=ADsica?= =?UTF-8?q?.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../activity.list.component.html | 9 +++---- src/app/modules/activity/activity.module.ts | 10 +++++--- .../modules/activity/pipes/duration.pipe.ts | 25 +++++++++++++++++++ 3 files changed, 35 insertions(+), 9 deletions(-) create mode 100644 src/app/modules/activity/pipes/duration.pipe.ts diff --git a/src/app/modules/activity/activity.list/activity.list.component.html b/src/app/modules/activity/activity.list/activity.list.component.html index 6b36da5..94d0d66 100644 --- a/src/app/modules/activity/activity.list/activity.list.component.html +++ b/src/app/modules/activity/activity.list/activity.list.component.html @@ -61,7 +61,8 @@

- {{getCaloriesTotal()}}{{'TIME-SERIES.CALORIES.CALORIES'|translate}} + {{getCaloriesTotal()}} + {{'TIME-SERIES.CALORIES.CALORIES'|translate}}

@@ -144,11 +145,7 @@

{{'MEASUREMENTS.LOG-MEASUREMENTS-CARD.LIST-EMPTY'|translate}}

- {{Math.floor((activity.duration / 3600000)) ? Math.floor((activity.duration / 3600000)) + ('HABITS.SLEEP.TIME-ABBREVIATION'|translate) + ('SHARED.AND'|translate) + ' ' : ('')}} - {{(activity.duration % 3600000) ? - Math.floor((activity.duration % 3600000) / 60000) + - ('HABITS.SLEEP.MINUTES-ABBREVIATION'|translate) : undefined - }} + {{activity.duration|duration}}

1 ? this.translateService.instant('HABITS.SLEEP.TIME-ABBREVIATION') : 'h'; + const time_rest = value % 3600000; + const minutes = Math.floor((value % 3600000) / 60000); + const minutes_abbreviation = minutes > 1 ? this.translateService.instant('HABITS.SLEEP.MINUTES-ABBREVIATION') : 'min'; + const and = this.translateService.instant('SHARED.AND'); + + return (hours ? hours + time_abbreviation + ' ' + and + ' ' : '') + + (time_rest ? minutes + minutes_abbreviation : '') + + } + +} From 46a7f26a70482949c355ff6a80faf0726e8c22a7 Mon Sep 17 00:00:00 2001 From: Adalcino Junior Date: Tue, 3 Mar 2020 14:32:08 -0300 Subject: [PATCH 4/8] =?UTF-8?q?[hotfix/3.3.1]=20-=20Corre=C3=A7=C3=A3o=20d?= =?UTF-8?q?e=20Bugs=20Tarefas:=20Bugs=20e=20melhorias=20Bugs:=20Bugs=20rep?= =?UTF-8?q?ortados=20no=20trelo=20do=20bug-03=20ao=20bug-07.=20Outras=20In?= =?UTF-8?q?forma=C3=A7=C3=B5es:=20=09*=20Adi=C3=A7=C3=A3o=20do=20cursor=20?= =?UTF-8?q?default=20na=20classe=20css=20disabled;=20=09*=20Adi=C3=A7?= =?UTF-8?q?=C3=A3o=20das=20mensagens=20de=20lista=20vazia=20para=20ativida?= =?UTF-8?q?des=20f=C3=ADsicas=20e=20sono;=20=09*=20Ajuste=20na=20responsiv?= =?UTF-8?q?idade=20do=20dashboard=20de=20medi=C3=A7=C3=B5es;=20=09*=20Ajus?= =?UTF-8?q?te=20no=20componente=20de=20heart=20rate=20do=20dashboard=20de?= =?UTF-8?q?=20medi=C3=A7=C3=B5es;=20=09*=20Adi=C3=A7=C3=A3o=20do=20trigger?= =?UTF-8?q?=20axis=20no=20tooltip=20do=20gr=C3=A1fico=20de=20sono.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../activity.list.component.html | 7 +- .../sleep.list/sleep.list.component.html | 9 +- .../sleep.list/sleep.list.component.ts | 14 +- .../dental.evaluation.list.component.ts | 2 +- .../nutritional.evaluation.list.component.ts | 4 +- .../edit.mypilot/edit.mypilot.component.ts | 2 +- .../measurement.dashboard.component.html | 532 ++++++++---------- .../measurement.dashboard.component.scss | 69 +-- .../measurement.dashboard.component.ts | 93 +-- .../modules/measurement/measurement.module.ts | 4 +- .../pilot.study.form.component.ts | 2 +- .../pilot.study.view.component.ts | 41 +- .../dashboard.card.component.html | 6 +- .../time.series.card.component.scss | 1 + .../shared/shared.pipes/pipes/my.date.pipe.ts | 3 +- src/assets/i18n/en-US.json | 5 +- src/assets/i18n/pt-BR.json | 7 +- 17 files changed, 373 insertions(+), 428 deletions(-) diff --git a/src/app/modules/activity/activity.list/activity.list.component.html b/src/app/modules/activity/activity.list/activity.list.component.html index 94d0d66..ceb8416 100644 --- a/src/app/modules/activity/activity.list/activity.list.component.html +++ b/src/app/modules/activity/activity.list/activity.list.component.html @@ -111,13 +111,12 @@

- + -

{{'MEASUREMENTS.LOG-MEASUREMENTS-CARD.LIST-EMPTY'|translate}} +

{{'ACTIVITY.PHYSICAL-ACTIVITY.LIST-EMPTY'|translate}}
- {{'MEASUREMENTS.LOG-MEASUREMENTS-CARD.LIST-EMPTY-MESSAGE'|translate}} + {{'ACTIVITY.NO-RECENT-EXERCISES-MESSAGE'|translate}}

diff --git a/src/app/modules/activity/sleep.list/sleep.list.component.html b/src/app/modules/activity/sleep.list/sleep.list.component.html index 8f712db..6c92e7b 100644 --- a/src/app/modules/activity/sleep.list/sleep.list.component.html +++ b/src/app/modules/activity/sleep.list/sleep.list.component.html @@ -106,13 +106,12 @@

- + - -

{{'MEASUREMENTS.LOG-MEASUREMENTS-CARD.LIST-EMPTY'|translate}} + +

{{'ACTIVITY.SLEEP.LIST-EMPTY'|translate}}
- {{'MEASUREMENTS.LOG-MEASUREMENTS-CARD.LIST-EMPTY-MESSAGE'|translate}} + {{'ACTIVITY.SLEEP.LIST-EMPTY-MESSAGE'|translate}}

diff --git a/src/app/modules/activity/sleep.list/sleep.list.component.ts b/src/app/modules/activity/sleep.list/sleep.list.component.ts index 4d788a3..d7620ca 100644 --- a/src/app/modules/activity/sleep.list/sleep.list.component.ts +++ b/src/app/modules/activity/sleep.list/sleep.list.component.ts @@ -33,7 +33,6 @@ export class SleepListComponent implements OnInit { echartSleepInstance: any; Math: any; listGraphIsEmpty: boolean; - listLogsIsEmpty: boolean; filter: TimeSeriesIntervalFilter | TimeSeriesSimpleFilter; pageSizeOptions: number[]; pageEvent: PageEvent; @@ -158,13 +157,9 @@ export class SleepListComponent implements OnInit { loadGraph() { const MAX_SLEEP_VALUE = 12; - const date = this.translateService.instant('SHARED.DATE-AND-HOUR'); - const at = this.translateService.instant('SHARED.AT'); - const hours = this.translateService.instant('MYDATEPIPE.HOURS'); const hours_abbreviation = this.translateService.instant('HABITS.SLEEP.TIME-ABBREVIATION'); const duration = this.translateService.instant('ACTIVITY.SLEEP.DURATION'); const title = this.translateService.instant('ACTIVITY.SLEEP.CLICK-TO-VIEW'); - const viewStages = this.translateService.instant('ACTIVITY.SLEEP.VIEW-STAGES'); const and = this.translateService.instant('SHARED.AND'); const minutes_abbreviation = this.translateService.instant('HABITS.SLEEP.MINUTES-ABBREVIATION'); const period = this.translateService.instant('MEASUREMENTS.MEASUREMENT-CARD.PERIOD'); @@ -264,12 +259,13 @@ export class SleepListComponent implements OnInit { subtext: title }, tooltip: { + trigger: 'axis', formatter: function (params) { - const hours_trucate = Math.floor(params.data.value); - const minutes = Math.floor(((params.data.value * 3600000) % 3600000) / 60000); - return `${params.name}
${duration}: ${hours_trucate + hours_abbreviation} ${minutes ? and + ' ' + const hours_trucate = Math.floor(params[1].data.value); + const minutes = Math.floor(((params[1].data.value * 3600000) % 3600000) / 60000); + return `${params[1].name}
${duration}: ${hours_trucate + hours_abbreviation} ${minutes ? and + ' ' + minutes + minutes_abbreviation : ''}
` + - `${period}: ${params.data.start_time} - ${params.data.end_time}`; + `${period}: ${params[1].data.start_time} - ${params[1].data.end_time}`; } }, xAxis, diff --git a/src/app/modules/evaluation/dental.evaluation.list/dental.evaluation.list.component.ts b/src/app/modules/evaluation/dental.evaluation.list/dental.evaluation.list.component.ts index 5196f58..88f8993 100755 --- a/src/app/modules/evaluation/dental.evaluation.list/dental.evaluation.list.component.ts +++ b/src/app/modules/evaluation/dental.evaluation.list/dental.evaluation.list.component.ts @@ -32,7 +32,7 @@ export class DentalEvaluationListComponent implements OnInit { } selectStudy(pilotstudy_id) { - this.pilotForm.get('pilotstudyId').setValue(pilotstudy_id); + this.pilotForm.get('pilotstudyId').patchValue(pilotstudy_id); this.pilotstudy_id = pilotstudy_id; } diff --git a/src/app/modules/evaluation/nutritional.evaluation.list/nutritional.evaluation.list.component.ts b/src/app/modules/evaluation/nutritional.evaluation.list/nutritional.evaluation.list.component.ts index 256c23b..b03bd61 100755 --- a/src/app/modules/evaluation/nutritional.evaluation.list/nutritional.evaluation.list.component.ts +++ b/src/app/modules/evaluation/nutritional.evaluation.list/nutritional.evaluation.list.component.ts @@ -40,13 +40,13 @@ export class NutritionalEvaluationListComponent implements OnInit { selectStudy(pilotstudy_id, stepper) { this.patientForm.reset(); - this.pilotForm.get('pilotstudyId').setValue(pilotstudy_id); + this.pilotForm.get('pilotstudyId').patchValue(pilotstudy_id); this.pilotstudy_id = pilotstudy_id; stepper.next(); } selectPatient(patient_id) { - this.patientForm.get('patientId').setValue(patient_id); + this.patientForm.get('patientId').patchValue(patient_id); this.patient_id = patient_id; this.router.navigate(['/app/evaluations/nutritional', patient_id]); } diff --git a/src/app/modules/health.professional/edit.mypilot/edit.mypilot.component.ts b/src/app/modules/health.professional/edit.mypilot/edit.mypilot.component.ts index eb83c2e..9ab6e57 100755 --- a/src/app/modules/health.professional/edit.mypilot/edit.mypilot.component.ts +++ b/src/app/modules/health.professional/edit.mypilot/edit.mypilot.component.ts @@ -51,7 +51,7 @@ export class EditMypilotComponent implements OnInit, OnChanges, OnDestroy { if (this.pilotStudyId) { this.pilotStudyService.getById(this.pilotStudyId) .then(res => { - this.pilotStudyForm.setValue(res); + this.pilotStudyForm.patchValue(res); }) .catch() } diff --git a/src/app/modules/measurement/measurement.dashboard/measurement.dashboard.component.html b/src/app/modules/measurement/measurement.dashboard/measurement.dashboard.component.html index 27ae478..a287776 100644 --- a/src/app/modules/measurement/measurement.dashboard/measurement.dashboard.component.html +++ b/src/app/modules/measurement/measurement.dashboard/measurement.dashboard.component.html @@ -1,308 +1,274 @@
-
-
- -
-
- - -
-
-
- -

- {{measurementLast.weight.value ? (measurementLast.weight.value|number:'1.0-0') : ' - - '}}{{this.measurementLast.weight.unit}} -

-
-
- -

- {{measurementLast.weight.body_fat ? (measurementLast.weight.body_fat|number:'1.0-0') : ' - - '}}% -

-
-
-
-

{{'MEASUREMENTS.BMI'|translate}}

- - - {{bmi|number:'2.1-2'}} - - -
-
- -
- + + + + +
+
+
+ +

+ {{measurementLast.weight.value ? (measurementLast.weight.value|number:'1.0-0') : ' - - '}}{{this.measurementLast.weight.unit}} +

-
- - {{'MEASUREMENTS.LAST-REGISTER-DATE'|translate}} - : {{measurementLast.weight.timestamp | myDate}} - {{'MEASUREMENTS.LAST-REGISTER-DATE'|translate}} - : {{'MEASUREMENTS.PATTERN-DATE'|translate}} +
+ +

+ {{measurementLast.weight.body_fat ? (measurementLast.weight.body_fat|number:'1.0-0') : ' - - '}}% +

- - - +
+
+

{{'MEASUREMENTS.BMI'|translate}}

+ + + {{bmi|number:'2.1-2'}} + + +
-
- -
-
- -
-
- -

- {{measurementLast.height.value ? measurementLast.height.value : ' - - '}}{{this.measurementLast.height.unit}} -

-
-
-
- -
-
- - {{'MEASUREMENTS.LAST-REGISTER-DATE'|translate}} - : {{measurementLast.height.timestamp | myDate}} - {{'MEASUREMENTS.LAST-REGISTER-DATE'|translate}} - : {{'MEASUREMENTS.PATTERN-DATE'|translate}} -
- -
+
+
-
+
+ + {{measurementLast.weight.timestamp | myDate}} + + {{'MEASUREMENTS.PATTERN-DATE'|translate}} + +
+ + + + + + +
+
+ +

+ {{measurementLast.height.value ? measurementLast.height.value : ' - - '}}{{this.measurementLast.height.unit}} +

+
+
+
+ +
+
+ + {{measurementLast.height.timestamp | myDate}} + + {{'MEASUREMENTS.PATTERN-DATE'|translate}} + +
+ +
+
+ -
-
- - -
-
- -

- {{measurementLast.waist_circumference.value ? measurementLast.waist_circumference.value : ' - - '}}{{measurementLast.waist_circumference.unit}} -

-
- - - -
-
- -
-
- - {{'MEASUREMENTS.LAST-REGISTER-DATE'|translate}} - : {{measurementLast.waist_circumference.timestamp | myDate}} - {{'MEASUREMENTS.LAST-REGISTER-DATE'|translate}} - : {{'MEASUREMENTS.PATTERN-DATE'|translate}} -
- -
- + +
+
+ +

+ {{measurementLast.waist_circumference.value ? measurementLast.waist_circumference.value : ' - - '}}{{measurementLast.waist_circumference.unit}} +

+
+ + +
-
+
+ +
+
+ + {{measurementLast.waist_circumference.timestamp | myDate}} + + + {{'MEASUREMENTS.PATTERN-DATE'|translate}} + +
+ + + + -
-
- -
-
- -

- {{measurementLast.body_fat.value ? (measurementLast.body_fat.value|number:'1.0-0') : ' - - '}}{{measurementLast.body_fat.unit}} -

-
-
+ +
+
+ +

+ {{measurementLast.body_fat.value ? (measurementLast.body_fat.value|number:'1.0-0') : ' - - '}}{{measurementLast.body_fat.unit}} +

+
+
-
- -
-
- - {{'MEASUREMENTS.LAST-REGISTER-DATE'|translate}} - : {{measurementLast.body_fat.timestamp | myDate}} - {{'MEASUREMENTS.LAST-REGISTER-DATE'|translate}} - : {{'MEASUREMENTS.PATTERN-DATE'|translate}} -
- -
+
+
-
+
+ + {{measurementLast.body_fat.timestamp | myDate}} + + + {{'MEASUREMENTS.PATTERN-DATE'|translate}} + +
+ + + + -
-
- -
- - {{'MEASUREMENTS.BODY-TEMPERATURE.FEVER'|translate}} - -
- -

- {{measurementLast.body_temperature.value ? (measurementLast.body_temperature.value|number:'2.1-1') : ' - - '}}{{measurementLast.body_temperature.unit}} -

-
- - - - - - - - - - - - - - - - - - - - -
-
- -
-
- - {{'MEASUREMENTS.LAST-REGISTER-DATE'|translate}} - : {{measurementLast.body_temperature.timestamp | myDate}} - {{'MEASUREMENTS.LAST-REGISTER-DATE'|translate}} - : {{'MEASUREMENTS.PATTERN-DATE'|translate}} -
- -
+ +
+ + {{'MEASUREMENTS.BODY-TEMPERATURE.FEVER'|translate}} + +
+ +

+ {{measurementLast.body_temperature.value ? (measurementLast.body_temperature.value|number:'2.1-1') : ' - - '}}{{measurementLast.body_temperature.unit}} +

+
-
+
+ +
+
+ + {{measurementLast.body_temperature.timestamp | myDate}} + + + {{'MEASUREMENTS.PATTERN-DATE'|translate}} + +
+ + + + -
-
- - -
-
- -

- {{measurementLast.blood_pressure.systolic ? (measurementLast.blood_pressure.systolic|number:'1.0-0') : ' - - '}}/{{measurementLast.blood_pressure.diastolic ? (measurementLast.blood_pressure.diastolic|number:'1.0-0') : ' - - '}}{{measurementLast.blood_pressure.unit}} -

-
-
- -

- {{measurementLast.blood_pressure.pulse ? (measurementLast.blood_pressure.pulse|number:'1.0-0') : ' - - '}}bpm -

-
-
-
- -
-
- - {{'MEASUREMENTS.LAST-REGISTER-DATE'|translate}} - : {{measurementLast.blood_pressure.timestamp | myDate}} - {{'MEASUREMENTS.LAST-REGISTER-DATE'|translate}} - : {{'MEASUREMENTS.PATTERN-DATE'|translate}} -
- -
- + +
+
+ +

+ {{measurementLast.blood_pressure.systolic ? (measurementLast.blood_pressure.systolic|number:'1.0-0') : ' - - '}}/{{measurementLast.blood_pressure.diastolic ? (measurementLast.blood_pressure.diastolic|number:'1.0-0') : ' - - '}}{{measurementLast.blood_pressure.unit}} +

+
+
+ +

+ {{measurementLast.blood_pressure.pulse ? (measurementLast.blood_pressure.pulse|number:'1.0-0') : ' - - '}}bpm +

+
-
+
+ +
+
+ + {{measurementLast.blood_pressure.timestamp | myDate}} + + + {{'MEASUREMENTS.PATTERN-DATE'|translate}} + +
+ + + + -
-
- - -
-
- -

- {{measurementLast.blood_glucose.value ? (measurementLast.blood_glucose.value|number:'1.0-0') : ' - - '}}{{measurementLast.blood_glucose.unit}} -

-
- {{measurementLast.blood_glucose.meal | meal | translate}} -
-
- -
-
- - {{'MEASUREMENTS.LAST-REGISTER-DATE'|translate}} - : {{measurementLast.blood_glucose.timestamp | myDate}} - {{'MEASUREMENTS.LAST-REGISTER-DATE'|translate}} - : {{'MEASUREMENTS.PATTERN-DATE'|translate}} -
- -
- + +
+
+ +

+ {{measurementLast.blood_glucose.value ? (measurementLast.blood_glucose.value|number:'1.0-0') : ' - - '}}{{measurementLast.blood_glucose.unit}} +

+
+ {{measurementLast.blood_glucose.meal | meal | translate}}
-
+
+ +
+
+ + {{measurementLast.blood_glucose.timestamp | myDate}} + + + {{'MEASUREMENTS.PATTERN-DATE'|translate}} + +
+ + + + -
-
- - -
- - -
-
- + +
+ +
-
-
-
+ +
+
@@ -323,4 +289,4 @@

- \ No newline at end of file + diff --git a/src/app/modules/measurement/measurement.dashboard/measurement.dashboard.component.scss b/src/app/modules/measurement/measurement.dashboard/measurement.dashboard.component.scss index ca79a98..667af19 100644 --- a/src/app/modules/measurement/measurement.dashboard/measurement.dashboard.component.scss +++ b/src/app/modules/measurement/measurement.dashboard/measurement.dashboard.component.scss @@ -1,58 +1,45 @@ @import "../../../../assets/scss/template-colors"; -.grid { - position: relative; +.card-content { + display: flex; + //flex-direction: column; + align-items: center; justify-content: center; + height: 100%; } -.item { - position: absolute; - //line-height: 200px; - margin: 3px 3px; - z-index: 1; +.flex-center { + display: flex; + align-items: center; + justify-content: center } -.item.muuri-item-hidden { - z-index: 0; +#newMeasurmentForm { + label { + font-weight: normal; + } } -.item.muuri-item-releasing { - z-index: 2; +.measurement-icon { + width: 40px; + height: 40px; } -.item.muuri-item-dragging { - z-index: 3; +.data-last-register{ + position: absolute; + left:0; + right:0; + bottom: 10px; + margin: auto; } -.item-content { +gridster { width: 100%; - height: 100%; - //border: 1px solid $primary-color; - border-radius: 3px; - font-size: 25px; - //color: $primary-color; - cursor: pointer; + height: 900px; + background: unset; + border: unset; } -.item.muuri-item-dragging .item-content, -.item.muuri-item-releasing .item-content { - cursor: grabbing; +gridster-item { + max-height: 400px; } - -.muuri-item-placeholder { - border: 2px #b21415 dashed; -} - -.card-content { - display: flex; - //flex-direction: column; - align-items: center; - justify-content: center; - height: 100%; -} - -#newMeasurmentForm { - label { - font-weight: normal; - } -} \ No newline at end of file diff --git a/src/app/modules/measurement/measurement.dashboard/measurement.dashboard.component.ts b/src/app/modules/measurement/measurement.dashboard/measurement.dashboard.component.ts index f1f6d15..85b4d03 100644 --- a/src/app/modules/measurement/measurement.dashboard/measurement.dashboard.component.ts +++ b/src/app/modules/measurement/measurement.dashboard/measurement.dashboard.component.ts @@ -1,14 +1,27 @@ -import { Component, ElementRef, HostListener, Input, OnChanges, OnInit, SimpleChanges, ViewChild } from '@angular/core'; -import * as Muuri from 'muuri'; -import { EnumMeasurementType } from '../models/measurement' -import { MeasurementService } from '../services/measurement.service' -import { MeasurementLast } from '../models/measurement.last' -import { ModalService } from '../../../shared/shared.components/modal/service/modal.service' -import { ActivatedRoute } from '@angular/router' -import { ToastrService } from 'ngx-toastr' -import { LocalStorageService } from '../../../shared/shared.services/local.storage.service' -import { TimeSeries, TimeSeriesIntervalFilter, TimeSeriesType } from '../../activity/models/time.series' -import { TimeSeriesService } from '../../activity/services/time.series.service' +import { Component, Input, OnChanges, OnInit, SimpleChanges } from '@angular/core'; +import { ActivatedRoute } from '@angular/router'; + +import { ToastrService } from 'ngx-toastr'; +import { GridsterConfig, GridsterItem } from 'angular-gridster2'; + +import { EnumMeasurementType } from '../models/measurement'; +import { MeasurementService } from '../services/measurement.service'; +import { MeasurementLast } from '../models/measurement.last'; +import { ModalService } from '../../../shared/shared.components/modal/service/modal.service'; +import { LocalStorageService } from '../../../shared/shared.services/local.storage.service'; +import { TimeSeries, TimeSeriesIntervalFilter, TimeSeriesType } from '../../activity/models/time.series'; +import { TimeSeriesService } from '../../activity/services/time.series.service'; + +const gridConfig = [ + { key: EnumMeasurementType.weight, value: { x: 0, y: 0, rows: 4, cols: 2 } }, + { key: EnumMeasurementType.height, value: { x: 0, y: 0, rows: 2, cols: 2 } }, + { key: EnumMeasurementType.waist_circumference, value: { x: 0, y: 0, rows: 2, cols: 2 } }, + { key: EnumMeasurementType.body_fat, value: { x: 0, y: 0, rows: 2, cols: 2 } }, + { key: EnumMeasurementType.body_temperature, value: { x: 0, y: 0, rows: 2, cols: 2 } }, + { key: EnumMeasurementType.blood_pressure, value: { x: 0, y: 0, rows: 2, cols: 3 } }, + { key: EnumMeasurementType.blood_glucose, value: { x: 0, y: 0, rows: 2, cols: 3 } }, + { key: TimeSeriesType.heart_rate, value: { x: 0, y: 0, rows: 4, cols: 6 } } +] @Component({ selector: 'measurement-dashboard', @@ -19,10 +32,8 @@ export class MeasurementDashboardComponent implements OnInit, OnChanges { @Input() patientId: string; EnumMeasurementType = EnumMeasurementType; TimeSeriesType = TimeSeriesType; - + public options: GridsterConfig; measurementLast: MeasurementLast; - gridDivRef: ElementRef; - gridDivWidth: number; loading: boolean; loadingHeartRate: boolean; fatThreshold = { @@ -33,22 +44,7 @@ export class MeasurementDashboardComponent implements OnInit, OnChanges { bmi: number; nameOfPatientSelected: string; heartRate: TimeSeries; - - - @ViewChild('gridDiv') - set gridDiv(element: ElementRef) { - if (element) { - setTimeout(() => { - this.gridDivRef = element; - this.gridDivWidth = this.gridDivRef.nativeElement.offsetWidth; - }) - } - }; - - @HostListener('window:resize', ['$event']) - onResize() { - this.gridDivWidth = this.gridDivRef.nativeElement.offsetWidth; - } + configItems: Map; constructor( private activeRouter: ActivatedRoute, @@ -57,24 +53,30 @@ export class MeasurementDashboardComponent implements OnInit, OnChanges { private toastService: ToastrService, private localStorageService: LocalStorageService, private timeSeriesService: TimeSeriesService) { + this.options = { + margin: 5, + minCols: 6, + maxCols: 6, + displayGrid: 'none', + minRows: 10, + maxRows: 10, + swap: true, + swapWhileDragging: true, + setGridSize: true, + mobileBreakpoint: 640, + gridType: 'fit', + resizable: { + enabled: false + }, + draggable: { + enabled: false + } + }; + this.configItems = new Map(); + gridConfig.forEach(item => this.configItems.set(item.key, item.value)) } ngOnInit() { - const grid1 = new Muuri('.grid-1', { - dragEnabled: false, - dragPlaceholder: { - enabled: true, - duration: 300, - easing: 'ease', - createElement: null, - onCreate: null, - onRemove: null - }, - dragContainer: document.body, - dragSort: function () { - return [grid1] - } - }); this.activeRouter.paramMap.subscribe((params) => { this.patientId = params.get('patientId'); this.getPatientSelected(); @@ -90,7 +92,6 @@ export class MeasurementDashboardComponent implements OnInit, OnChanges { } - loadMeasurements(): void { this.loading = true; this.measurementService.getLastByUser(this.patientId) diff --git a/src/app/modules/measurement/measurement.module.ts b/src/app/modules/measurement/measurement.module.ts index f37a859..9aa554e 100755 --- a/src/app/modules/measurement/measurement.module.ts +++ b/src/app/modules/measurement/measurement.module.ts @@ -38,6 +38,7 @@ import { MatSelectModule } from '@angular/material/select' import { NgxMatDatetimePickerModule } from 'ngx-mat-datetime-picker' import { ActivityModule } from '../activity/activity.module'; import { NewMeasurementsComponent } from './new.measurements/new.measurements.component' +import { GridsterModule } from 'angular-gridster2' @NgModule({ declarations: [ @@ -76,7 +77,8 @@ import { NewMeasurementsComponent } from './new.measurements/new.measurements.co MatSelectModule, ReactiveFormsModule, NgxMatDatetimePickerModule, - ActivityModule + ActivityModule, + GridsterModule ], exports: [ MeasurementLogsComponent, diff --git a/src/app/modules/pilot.study/pilot.study.form/pilot.study.form.component.ts b/src/app/modules/pilot.study/pilot.study.form/pilot.study.form.component.ts index dacbe5a..73d0359 100755 --- a/src/app/modules/pilot.study/pilot.study.form/pilot.study.form.component.ts +++ b/src/app/modules/pilot.study/pilot.study.form/pilot.study.form.component.ts @@ -108,7 +108,7 @@ export class PilotStudyFormComponent implements OnInit, OnChanges, OnDestroy { if (this.pilotStudyId) { return this.pilotStudyService.getById(this.pilotStudyId) .then(res => { - this.pilotStudyForm.setValue(res); + this.pilotStudyForm.patchValue(res); return res; }) .catch(() => { diff --git a/src/app/modules/pilot.study/pilot.study.view/pilot.study.view.component.ts b/src/app/modules/pilot.study/pilot.study.view/pilot.study.view.component.ts index 240f8fd..8241963 100755 --- a/src/app/modules/pilot.study/pilot.study.view/pilot.study.view.component.ts +++ b/src/app/modules/pilot.study/pilot.study.view/pilot.study.view.component.ts @@ -92,12 +92,13 @@ export class PilotStudyViewComponent implements OnInit, OnDestroy { if (this.pilotStudyId) { this.pilotStudyService.getById(this.pilotStudyId) .then(res => { - this.pilotStudyForm.setValue(res); + this.pilotStudyForm.patchValue(res); this.pilotStudy = res; this.selectPilotStudy(); this.loadHealthProfessionals(); this.loadPatients(); - }).catch(() => { + }).catch((err) => { + console.log(err) const userId = this.localStorageService.getItem('user'); const localPilotSelected = this.localStorageService.getItem(userId); this.selectPilotService.pilotStudyHasUpdated(localPilotSelected); @@ -139,31 +140,17 @@ export class PilotStudyViewComponent implements OnInit, OnDestroy { } createForm() { - if (this.pilotStudyId) { - this.pilotStudyForm = this.fb.group({ - id: [''], - created_at: [''], - name: [''], - location: [''], - start: [''], - end: [''], - total_health_professionals: [''], - total_patients: [''], - is_active: [{ value: true, disabled: true }] - }); - } else { - this.pilotStudyForm = this.fb.group({ - id: [''], - created_at: [''], - name: [''], - location: [''], - start: [''], - end: [''], - total_health_professionals: [''], - total_patients: [''], - is_active: [{ value: true, disabled: true }] - }); - } + this.pilotStudyForm = this.fb.group({ + id: [''], + created_at: [''], + name: [''], + location: [''], + start: [''], + end: [''], + total_health_professionals: [''], + total_patients: [''], + is_active: [{ value: true, disabled: true }] + }); } clickProfessionalPagination(event): void { diff --git a/src/app/shared/shared.components/dashboard.card/dashboard.card.component.html b/src/app/shared/shared.components/dashboard.card/dashboard.card.component.html index 3929a92..163d575 100755 --- a/src/app/shared/shared.components/dashboard.card/dashboard.card.component.html +++ b/src/app/shared/shared.components/dashboard.card/dashboard.card.component.html @@ -3,12 +3,12 @@
-

{{title}}

-

{{subtitle}}

+

{{title}}

+

{{subtitle}}

- + diff --git a/src/app/shared/shared.components/time.series.card/time.series.card.component.scss b/src/app/shared/shared.components/time.series.card/time.series.card.component.scss index 5d1c951..b7517db 100644 --- a/src/app/shared/shared.components/time.series.card/time.series.card.component.scss +++ b/src/app/shared/shared.components/time.series.card/time.series.card.component.scss @@ -96,6 +96,7 @@ i:hover { &:hover { border-radius: 20px !important; background: $primary-color !important; + cursor: default; } } diff --git a/src/app/shared/shared.pipes/pipes/my.date.pipe.ts b/src/app/shared/shared.pipes/pipes/my.date.pipe.ts index 4d6f90e..9449b5d 100755 --- a/src/app/shared/shared.pipes/pipes/my.date.pipe.ts +++ b/src/app/shared/shared.pipes/pipes/my.date.pipe.ts @@ -11,7 +11,8 @@ export class MyDatePipe implements PipeTransform { transform(value: any, args?: any): any { const date = new Date(value); const currentLang = this.translateService.currentLang; - return date.toLocaleDateString(currentLang) + ' ' + this.translateService.instant('MYDATEPIPE.AT') + ' ' + date.toLocaleTimeString(currentLang) + ' ' + this.translateService.instant('MYDATEPIPE.HOURS'); + return date.toLocaleDateString(currentLang) + ' ' + this.translateService.instant('MYDATEPIPE.AT') + + ' ' + date.toLocaleTimeString(currentLang) + ' ' + this.translateService.instant('MYDATEPIPE.HOURS'); } } diff --git a/src/assets/i18n/en-US.json b/src/assets/i18n/en-US.json index 827b7f0..8aa0e80 100755 --- a/src/assets/i18n/en-US.json +++ b/src/assets/i18n/en-US.json @@ -34,6 +34,8 @@ "PERIOD": "Measurement period", "SLEEP": "Sleep", "DURATION": "Duration", + "LIST-EMPTY": "No records found.", + "LIST-EMPTY-MESSAGE": "Record your sleep to follow the stages of it!", "UNAVAILABLE-DATA": "No records within selected period!", "VIEW-STAGES": "View stages", "CLICK-TO-VIEW": "Click on the log to view the stages of sleep.", @@ -50,6 +52,7 @@ "PHYSICAL-ACTIVITY": { "TITLE": "Physical Activity", "LOADING": "Loading physical activity ...", + "LIST-EMPTY": "No exercises found.", "HISTORY-TABLE": { "TITLE": "Physical Activity History", "SELECT-ALL": "Select all", @@ -1185,4 +1188,4 @@ }, "UNAVAILABLE-DATA": "No records within selected period!" } -} \ No newline at end of file +} diff --git a/src/assets/i18n/pt-BR.json b/src/assets/i18n/pt-BR.json index 5534298..3378908 100755 --- a/src/assets/i18n/pt-BR.json +++ b/src/assets/i18n/pt-BR.json @@ -34,7 +34,9 @@ "PERIOD": "Período da medição", "SLEEP": "Sono", "DURATION": "Duração", - "UNAVAILABLE-DATA": "Nenhum registro dentro período selecionado!", + "LIST-EMPTY": "Nenhum registro encontrado.", + "LIST-EMPTY-MESSAGE": "Registre seu sono para acompanhar os estagios do mesmo!", + "UNAVAILABLE-DATA": "Nenhum registro dentro do período selecionado!", "VIEW-STAGES": "Visualizar estágios", "CLICK-TO-VIEW": "Clique sobre o registro para visualizar os estágios do sono.", "REACHED-THE-IDEAL": "Atingiu o ideal", @@ -50,6 +52,7 @@ "PHYSICAL-ACTIVITY": { "TITLE": "Atividade Física", "LOADING": "Carregando atividade física...", + "LIST-EMPTY": "Nenhum exercício encontrado.", "HISTORY-TABLE": { "TITLE": "Histórico de atividades física", "SELECT-ALL": "Selecionar todas", @@ -1185,4 +1188,4 @@ }, "UNAVAILABLE-DATA": "Nenhum registro dentro período selecionado!" } -} \ No newline at end of file +} From 7329ced64cae81844c54d60f9407b571a7196475 Mon Sep 17 00:00:00 2001 From: Adalcino Junior Date: Tue, 3 Mar 2020 20:03:57 -0300 Subject: [PATCH 5/8] =?UTF-8?q?[hotfix/3.3.1]=20-=20Corre=C3=A7=C3=A3o=20d?= =?UTF-8?q?e=20Bugs=20Tarefas:=20Bugs=20e=20melhorias=20Bugs:=20Bugs=20rep?= =?UTF-8?q?ortados=20no=20trelo=20do=20bug-08=20ao=20bug-15.=20Outras=20In?= =?UTF-8?q?forma=C3=A7=C3=B5es:=20=09*=20Corre=C3=A7=C3=A3o=20no=20filtro?= =?UTF-8?q?=20de=20datas=20na=20visualiza=C3=A7=C3=A3o=20mobile;=20=09*=20?= =?UTF-8?q?Na=20p=C3=A1gina=20de=20estudo=20gr=C3=A1fico,=20atualiza=C3=A7?= =?UTF-8?q?=C3=A3o=20dos=20recursos=20disponiveis=20ap=C3=B3s=20remo=C3=A7?= =?UTF-8?q?=C3=A3o=20de=20um=20dos=20selecionados;=20=09*=20Corre=C3=A7?= =?UTF-8?q?=C3=A3o=20no=20style=20aplicado=20aos=20boto=C3=B5es=20de=20rem?= =?UTF-8?q?over=20questionarios;=20=09*=20Adi=C3=A7=C3=A3o=20do=20m=C3=A9t?= =?UTF-8?q?odo=20para=20fechar=20modal=20de=20confirma=C3=A7=C3=A3o=20ap?= =?UTF-8?q?=C3=B3s=20pressionar=20ESC;=20=09*=20Corre=C3=A7=C3=A3o=20nos?= =?UTF-8?q?=20m=C3=A9todos=20de=20pesquisa=20por=20string;=20=09*=20Adi?= =?UTF-8?q?=C3=A7=C3=A3o=20das=20demais=20op=C3=A7=C3=B5es=20para=20o=20st?= =?UTF-8?q?atus=20do=20token=20de=20acesso=20do=20fitbit;=20=09*=20Corre?= =?UTF-8?q?=C3=A7=C3=A3o=20no=20eixo=20x=20do=20gr=C3=A1fico=20de=20heart?= =?UTF-8?q?=20rate.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../activity.dashboard.component.html | 36 ++-- .../activity.details.component.html | 79 +++------ .../activity.details.component.scss | 75 +------- .../activity.details.component.ts | 160 ++++++++++++------ .../activity.list.component.html | 2 +- .../modules/activity/models/time.series.ts | 24 ++- .../activity/shared.style/shared.styles.scss | 68 +++++++- .../sleep.list/sleep.list.component.html | 2 +- .../activity/sleep/sleep.component.html | 2 +- .../haniot.table/haniot.table.component.html | 2 +- .../haniot.table/haniot.table.component.ts | 4 +- .../modules/admin/services/admin.service.ts | 2 +- .../dental.evaluation.table.component.html | 2 +- .../dental.evaluation.table.component.ts | 2 +- .../evaluation.component.html | 2 +- .../nutrition.evaluation.table.component.html | 2 +- .../nutrition.evaluation.table.component.ts | 2 +- .../evaluation/patients/patients.component.ts | 2 +- .../evaluation/studies/studies.component.ts | 4 +- .../myevaluations.component.html | 2 +- .../myevaluations/myevaluations.component.ts | 2 +- .../mypilotstudies.component.html | 2 +- .../mypilotstudies.component.ts | 2 +- .../graphic.study.component.html | 11 +- .../graphic.study/graphic.study.component.ts | 18 +- .../list.pilotstudies.component.ts | 2 +- .../patient/models/external.service.ts | 2 + .../myevaluations.component.html | 2 +- .../myevaluations/myevaluations.component.ts | 2 +- .../mypilotstudies.component.html | 2 +- .../mypilotstudies.component.ts | 2 +- .../patient.manager.component.html | 2 +- .../patient.manager.component.ts | 2 +- .../patient.questionnaires.component.html | 11 +- .../patient.table.component.html | 4 +- .../patient.table/patient.table.component.ts | 2 +- .../patient/shared.style/shared.style.scss | 8 + .../view.resources.component.html | 2 +- .../pilot.study.form.component.html | 4 +- .../pilot.study.table.component.html | 2 +- .../pilot.study.table.component.ts | 2 +- .../delete.account.component.html | 4 +- .../external.service.component.html | 11 +- .../external.service.component.ts | 8 +- .../pipes/fitbit.status.pipe.ts | 8 +- .../modal.confirmation.component.html | 2 +- .../modal.confirmation.component.ts | 5 - .../select.pilotstudy.component.ts | 2 +- .../time.series.card.component.html | 60 +++---- .../time.series.card.component.scss | 5 + .../time.series.card.component.ts | 4 +- src/assets/i18n/en-US.json | 2 + src/assets/i18n/pt-BR.json | 2 + 53 files changed, 376 insertions(+), 297 deletions(-) diff --git a/src/app/modules/activity/activity.dashboard/activity.dashboard.component.html b/src/app/modules/activity/activity.dashboard/activity.dashboard.component.html index f8d3ace..9dec70d 100755 --- a/src/app/modules/activity/activity.dashboard/activity.dashboard.component.html +++ b/src/app/modules/activity/activity.dashboard/activity.dashboard.component.html @@ -68,7 +68,7 @@ calls + {{activity.calories|number:'1.0-0'}}cals

-
{{'ACTIVITY.NO-RECENT-EXERCISES'|translate}}

{{'HABITS.SLEEP.TIME-ABBREVIATION'|translate}} - {{Math.floor((sleepSelected.pattern.summary.awake.duration % 3600000) / 60000)}} - {{'HABITS.SLEEP.MINUTES-ABBREVIATION'|translate}} + {{Math.floor((sleepSelected.pattern.summary.awake.duration % 3600000) / 60000)}}{{'HABITS.SLEEP.MINUTES-ABBREVIATION'|translate}} {{'ACTIVITY.PIPES.SLEEP.AWAKE'|translate}} -
+
{{'SHARED.ADD'|translate}} @@ -146,4 +151,4 @@
-
\ No newline at end of file +
diff --git a/src/app/modules/patient/graphic.study/graphic.study.component.ts b/src/app/modules/patient/graphic.study/graphic.study.component.ts index 507b0df..12a93ee 100644 --- a/src/app/modules/patient/graphic.study/graphic.study.component.ts +++ b/src/app/modules/patient/graphic.study/graphic.study.component.ts @@ -149,6 +149,13 @@ export class GraphicStudyComponent implements OnInit { selectResource(event): void { this.add(event.value); + this.updateResourceGroups(); + setTimeout(() => { + this.select = '' + }, 300) + } + + updateResourceGroups(): void { this.resourceGroups[0].items = this.resourceGroups[0].items.map((item: Item) => { item.disabled = !!this.resourcesSelected.find(element => { return element.resource === item.value @@ -162,9 +169,6 @@ export class GraphicStudyComponent implements OnInit { }) return item }) - setTimeout(() => { - this.select = '' - }, 300) } openSelectGraph(indexSelected: number): void { @@ -208,9 +212,17 @@ export class GraphicStudyComponent implements OnInit { } } + getTitle(resource: EnumMeasurementType | TimeSeriesType): string { + if (Object.keys(EnumMeasurementType).includes(resource)) { + return this.translateService.instant(this.measurementPipe.transform(resource)); + } + return this.translateService.instant(this.timeSeriesPipe.transform(resource)); + } + removeGraph(indexSelected: number): void { this.resourcesSelected = this.resourcesSelected.filter((element, index) => { return indexSelected !== index; }); + this.updateResourceGroups(); } } diff --git a/src/app/modules/patient/list.pilotstudies/list.pilotstudies.component.ts b/src/app/modules/patient/list.pilotstudies/list.pilotstudies.component.ts index f8c7bc1..273ee7a 100755 --- a/src/app/modules/patient/list.pilotstudies/list.pilotstudies.component.ts +++ b/src/app/modules/patient/list.pilotstudies/list.pilotstudies.component.ts @@ -85,7 +85,7 @@ export class ListPilotstudiesComponent implements OnInit, OnDestroy { clearInterval(this.searchTime); this.searchTime = setTimeout(() => { this.list = []; - this.pilotStudyService.getAllByUserId(this.userId, this.page, this.limit, this.search) + this.pilotStudyService.getAllByUserId(this.userId, null, this.limit, this.search) .then(httpResponse => { this.length = parseInt(httpResponse.headers.get('x-total-count'), 10); if (httpResponse.body && httpResponse.body.length) { diff --git a/src/app/modules/patient/models/external.service.ts b/src/app/modules/patient/models/external.service.ts index aba514b..ba1fbb8 100755 --- a/src/app/modules/patient/models/external.service.ts +++ b/src/app/modules/patient/models/external.service.ts @@ -3,6 +3,8 @@ export enum AccessStatus { invalid_token = 'invalid_token', expired_token = 'expired_token', invalid_refresh_token = 'invalid_refresh_token', + invalid_client = 'invalid_client', + too_many_requests = 'rate_limit', none = 'none' } diff --git a/src/app/modules/patient/myevaluations/myevaluations.component.html b/src/app/modules/patient/myevaluations/myevaluations.component.html index 31efd23..fbfc148 100755 --- a/src/app/modules/patient/myevaluations/myevaluations.component.html +++ b/src/app/modules/patient/myevaluations/myevaluations.component.html @@ -70,4 +70,4 @@

{{'EVALUATION.LIST-EMPTY'|translate}}.

+ (close)="closeModalComfimation()"> diff --git a/src/app/modules/patient/myevaluations/myevaluations.component.ts b/src/app/modules/patient/myevaluations/myevaluations.component.ts index 3f3d809..7a03857 100755 --- a/src/app/modules/patient/myevaluations/myevaluations.component.ts +++ b/src/app/modules/patient/myevaluations/myevaluations.component.ts @@ -61,7 +61,7 @@ export class PatientMyEvaluationsComponent implements OnInit, OnChanges { clearInterval(this.searchTime); this.searchTime = setTimeout(() => { this.listOfEvaluations = []; - this.nutritionService.getAllByPatient(this.userId, this.page, this.limit, this.search) + this.nutritionService.getAllByPatient(this.userId, null, this.limit, this.search) .then(httpResponse => { this.length = parseInt(httpResponse.headers.get('x-total-count'), 10); this.listOfEvaluations = new Array(); diff --git a/src/app/modules/patient/mypilotstudies/mypilotstudies.component.html b/src/app/modules/patient/mypilotstudies/mypilotstudies.component.html index cbf4e6e..59a8004 100755 --- a/src/app/modules/patient/mypilotstudies/mypilotstudies.component.html +++ b/src/app/modules/patient/mypilotstudies/mypilotstudies.component.html @@ -83,4 +83,4 @@
+ (close)="closeModalConfirmation()"> diff --git a/src/app/modules/patient/mypilotstudies/mypilotstudies.component.ts b/src/app/modules/patient/mypilotstudies/mypilotstudies.component.ts index 1394a7a..22960a8 100755 --- a/src/app/modules/patient/mypilotstudies/mypilotstudies.component.ts +++ b/src/app/modules/patient/mypilotstudies/mypilotstudies.component.ts @@ -77,7 +77,7 @@ export class PatientMypilotstudiesComponent implements OnInit { clearInterval(this.searchTime); this.searchTime = setTimeout(() => { this.list = []; - this.pilotStudyService.getAllByUserId(this.userId, this.page, this.limit, this.search) + this.pilotStudyService.getAllByUserId(this.userId, null, this.limit, this.search) .then(httpResponse => { this.list = new Array(); this.length = parseInt(httpResponse.headers.get('x-total-count'), 10); diff --git a/src/app/modules/patient/patient.manager/patient.manager.component.html b/src/app/modules/patient/patient.manager/patient.manager.component.html index 1a5aabe..5a13c68 100755 --- a/src/app/modules/patient/patient.manager/patient.manager.component.html +++ b/src/app/modules/patient/patient.manager/patient.manager.component.html @@ -111,4 +111,4 @@ \ No newline at end of file + (close)="closeModalComfimation()"> diff --git a/src/app/modules/patient/patient.manager/patient.manager.component.ts b/src/app/modules/patient/patient.manager/patient.manager.component.ts index 8328d1d..7eb4750 100755 --- a/src/app/modules/patient/patient.manager/patient.manager.component.ts +++ b/src/app/modules/patient/patient.manager/patient.manager.component.ts @@ -63,7 +63,7 @@ export class PatientManagerComponent implements OnInit { const userId = this.localStorageService.getItem('user'); const studyId = this.localStorageService.getItem(userId); this.listOfPatients = []; - this.patientService.getAllByPilotStudy(studyId, this.page, this.limit, this.search) + this.patientService.getAllByPilotStudy(studyId, null, this.limit, this.search) .then(httpResponse => { this.length = parseInt(httpResponse.headers.get('x-total-count'), 10); if (httpResponse.body) { diff --git a/src/app/modules/patient/patient.questionnaires/patient.questionnaires.component.html b/src/app/modules/patient/patient.questionnaires/patient.questionnaires.component.html index 2d91d38..03c1ca2 100644 --- a/src/app/modules/patient/patient.questionnaires/patient.questionnaires.component.html +++ b/src/app/modules/patient/patient.questionnaires/patient.questionnaires.component.html @@ -47,7 +47,7 @@

{{'PATIENTS.VIEW-HABITS.NUTRITIONAL-QUESTIONNAIRE'|transl [ngClass]="nutritionalQuestionnaireOptions.length?'actived':'disabled'">

- \ No newline at end of file + diff --git a/src/app/modules/patient/patient.table/patient.table.component.ts b/src/app/modules/patient/patient.table/patient.table.component.ts index 67f037e..f6e6d0e 100755 --- a/src/app/modules/patient/patient.table/patient.table.component.ts +++ b/src/app/modules/patient/patient.table/patient.table.component.ts @@ -84,7 +84,7 @@ export class PatientTableComponent implements OnInit, OnChanges, OnDestroy { clearInterval(this.searchTime); this.searchTime = setTimeout(() => { this.listOfPatients = []; - this.patientService.getAllByPilotStudy(this.pilotStudyId, this.page, this.limit, this.search) + this.patientService.getAllByPilotStudy(this.pilotStudyId, null, this.limit, this.search) .then(httpResponse => { this.length = parseInt(httpResponse.headers.get('x-total-count'), 10); if (httpResponse.body && httpResponse.body.length) { diff --git a/src/app/modules/patient/shared.style/shared.style.scss b/src/app/modules/patient/shared.style/shared.style.scss index b2b122b..9f59a3e 100644 --- a/src/app/modules/patient/shared.style/shared.style.scss +++ b/src/app/modules/patient/shared.style/shared.style.scss @@ -76,6 +76,14 @@ label { .disabled .remove-questionnaire:hover { box-shadow: none; font-size: 30px; + border-radius: unset; + background: unset; + cursor: default; +} + +.actived .remove-questionnaire:hover { + box-shadow: none; + background: unset; } .borderNone { diff --git a/src/app/modules/patient/view.resources/view.resources.component.html b/src/app/modules/patient/view.resources/view.resources.component.html index b847d42..75f5626 100755 --- a/src/app/modules/patient/view.resources/view.resources.component.html +++ b/src/app/modules/patient/view.resources/view.resources.component.html @@ -125,4 +125,4 @@ ' '+cacheListIdMeasurementRemove.length+' ' + ('MEASUREMENTS.LOG-MEASUREMENTS-CARD.MODAL-REMOVE.CONFIRM-MULTIPLE-REMOVE-PART2'|translate) :'MEASUREMENTS.LOG-MEASUREMENTS-CARD.MODAL-REMOVE.CONFIRM-UNIQUE-REMOVE'|translate" (confirmation)="removeResources()" - (noconfirmation)="closeModalConfirmation()"> \ No newline at end of file + (close)="closeModalConfirmation()"> diff --git a/src/app/modules/pilot.study/pilot.study.form/pilot.study.form.component.html b/src/app/modules/pilot.study/pilot.study.form/pilot.study.form.component.html index 09349b7..7de021c 100755 --- a/src/app/modules/pilot.study/pilot.study.form/pilot.study.form.component.html +++ b/src/app/modules/pilot.study/pilot.study.form/pilot.study.form.component.html @@ -327,11 +327,11 @@ + (close)="closeAndCleanConfirmationRemovePatient()"> + (close)="closeAndCleanConfirmationRemoveProfessional()">
diff --git a/src/app/modules/pilot.study/pilot.study.table/pilot.study.table.component.html b/src/app/modules/pilot.study/pilot.study.table/pilot.study.table.component.html index e06e196..c9facac 100755 --- a/src/app/modules/pilot.study/pilot.study.table/pilot.study.table.component.html +++ b/src/app/modules/pilot.study/pilot.study.table/pilot.study.table.component.html @@ -73,4 +73,4 @@ + (close)="closeModalConfirmation()"> diff --git a/src/app/modules/pilot.study/pilot.study.table/pilot.study.table.component.ts b/src/app/modules/pilot.study/pilot.study.table/pilot.study.table.component.ts index 5bbd918..eebbf39 100755 --- a/src/app/modules/pilot.study/pilot.study.table/pilot.study.table.component.ts +++ b/src/app/modules/pilot.study/pilot.study.table/pilot.study.table.component.ts @@ -67,7 +67,7 @@ export class PilotStudyTableComponent implements OnInit { clearInterval(this.searchTime); this.searchTime = setTimeout(() => { this.list = []; - this.pilotStudyService.getAll(this.page, this.limit, this.search) + this.pilotStudyService.getAll(null, this.limit, this.search) .then(httpResponse => { this.length = parseInt(httpResponse.headers.get('x-total-count'), 10); if (httpResponse.body && httpResponse.body.length) { diff --git a/src/app/modules/settings/delete.account/delete.account.component.html b/src/app/modules/settings/delete.account/delete.account.component.html index 4f099e7..f1eb11f 100755 --- a/src/app/modules/settings/delete.account/delete.account.component.html +++ b/src/app/modules/settings/delete.account/delete.account.component.html @@ -6,4 +6,6 @@ + (close)="closeModalDeleteAccount()"> + + diff --git a/src/app/security/external.services/external.service/external.service.component.html b/src/app/security/external.services/external.service/external.service.component.html index 3bb3b66..c801147 100644 --- a/src/app/security/external.services/external.service/external.service.component.html +++ b/src/app/security/external.services/external.service/external.service.component.html @@ -47,21 +47,21 @@
\ No newline at end of file + [message]="'PATIENTS.EXTERNAL-SERVICES.CONFIRM-REVOKE'|translate" (confirmation)="revoke()" + (close)="closeModalRevoke()"> diff --git a/src/app/security/external.services/external.service/external.service.component.ts b/src/app/security/external.services/external.service/external.service.component.ts index 5ab2af3..4f61465 100644 --- a/src/app/security/external.services/external.service/external.service.component.ts +++ b/src/app/security/external.services/external.service/external.service.component.ts @@ -5,7 +5,12 @@ import { FormGroup } from '@angular/forms' import { TranslateService } from '@ngx-translate/core' import { ToastrService } from 'ngx-toastr'; -import { ExternalService, OAuthUser, SynchronizeData } from '../../../modules/patient/models/external.service'; +import { + AccessStatus, + ExternalService, + OAuthUser, + SynchronizeData +} from '../../../modules/patient/models/external.service'; import { FitbitStatusPipe } from '../pipes/fitbit.status.pipe'; import { ModalService } from '../../../shared/shared.components/modal/service/modal.service'; import { FitbitService } from '../services/fitbit.service'; @@ -33,6 +38,7 @@ export class ExternalServiceComponent implements OnInit, OnDestroy { providingAccess: boolean; synchronizeData: SynchronizeData; intervalSync: any; + AccessStatus = AccessStatus; constructor( private activeRouter: ActivatedRoute, diff --git a/src/app/security/external.services/pipes/fitbit.status.pipe.ts b/src/app/security/external.services/pipes/fitbit.status.pipe.ts index 7dd4129..699f39a 100644 --- a/src/app/security/external.services/pipes/fitbit.status.pipe.ts +++ b/src/app/security/external.services/pipes/fitbit.status.pipe.ts @@ -19,6 +19,12 @@ export class FitbitStatusPipe implements PipeTransform { case 'invalid_refresh_token': return 'PATIENTS.EXTERNAL-SERVICES.PIPE.INVALID-REFRESH-TOKEN'; + case 'invalid_client': + return 'PATIENTS.EXTERNAL-SERVICES.PIPE.INVALID-CLIENT'; + + case 'rate_limit': + return 'PATIENTS.EXTERNAL-SERVICES.PIPE.RATE-LIMIT'; + case 'none': return 'PATIENTS.EXTERNAL-SERVICES.PIPE.NONE'; @@ -27,4 +33,4 @@ export class FitbitStatusPipe implements PipeTransform { } } -} \ No newline at end of file +} diff --git a/src/app/shared/shared.components/modal.confirmation/modal.confirmation.component.html b/src/app/shared/shared.components/modal.confirmation/modal.confirmation.component.html index 1d79cb5..3c7d955 100755 --- a/src/app/shared/shared.components/modal.confirmation/modal.confirmation.component.html +++ b/src/app/shared/shared.components/modal.confirmation/modal.confirmation.component.html @@ -1,4 +1,4 @@ - + @@ -196,4 +196,4 @@

{{title}}

-
\ No newline at end of file +
diff --git a/src/app/shared/shared.components/time.series.card/time.series.card.component.scss b/src/app/shared/shared.components/time.series.card/time.series.card.component.scss index b7517db..b7c5c8f 100644 --- a/src/app/shared/shared.components/time.series.card/time.series.card.component.scss +++ b/src/app/shared/shared.components/time.series.card/time.series.card.component.scss @@ -132,3 +132,8 @@ i:hover { .mat-datepicker-toggle { color: white; } + +.dropdown-menu{ + position: absolute; + z-index: 9999 !important; +} diff --git a/src/app/shared/shared.components/time.series.card/time.series.card.component.ts b/src/app/shared/shared.components/time.series.card/time.series.card.component.ts index ca85441..91b9b88 100644 --- a/src/app/shared/shared.components/time.series.card/time.series.card.component.ts +++ b/src/app/shared/shared.components/time.series.card/time.series.card.component.ts @@ -18,7 +18,7 @@ export const FilterOptions = { @Component({ selector: 'time-series-card', templateUrl: './time.series.card.component.html', - styleUrls: ['../../../modules/activity/shared.style/shared.styles.scss', './time.series.card.component.scss'] + styleUrls: ['./time.series.card.component.scss'] }) export class TimeSeriesCardComponent implements OnInit { readonly today: Date = new Date(); @@ -164,7 +164,7 @@ export class TimeSeriesCardComponent implements OnInit { this.currentDate = dateSelected.getTime() <= new Date().getTime() ? dateSelected : new Date(); } if (start_date && end_date) { - this.filterSelected = 'period'; + this.filterSelected = this.filterOptions.period; const timeZoneOffset = new Date().getTimezoneOffset(); const startSelected: Date = timeZoneOffset ? new Date(`${start_date}T0${timeZoneOffset / 60}:00:00Z`) : new Date(`${start_date}T00:00:00Z`); diff --git a/src/assets/i18n/en-US.json b/src/assets/i18n/en-US.json index 8aa0e80..d928e25 100755 --- a/src/assets/i18n/en-US.json +++ b/src/assets/i18n/en-US.json @@ -754,6 +754,8 @@ "INVALID-TOKEN": "Invalid token!", "EXPIRED-TOKEN": "Expired token!", "INVALID-REFRESH-TOKEN": "Invalid Refresh Token!", + "INVALID-CLIENT": "Invalid client!", + "RATE-LIMIT": "Sync limit reached!", "NONE": " - - ", "UNDEFINED": "Out of parameters" } diff --git a/src/assets/i18n/pt-BR.json b/src/assets/i18n/pt-BR.json index 3378908..df9b47a 100755 --- a/src/assets/i18n/pt-BR.json +++ b/src/assets/i18n/pt-BR.json @@ -754,6 +754,8 @@ "INVALID-TOKEN": "Token inválido!", "EXPIRED-TOKEN": "Token expirado!", "INVALID-REFRESH-TOKEN": "Refresh Token Inválido", + "INVALID-CLIENT": "Cliente inválido!", + "RATE-LIMIT": "Limite de sincronização atingindo!", "NONE": " - - ", "UNDEFINED": "Fora dos parâmetros" } From a99053fe376a0043846ab6f64eaf8103eddf76cc Mon Sep 17 00:00:00 2001 From: Adalcino Junior Date: Wed, 4 Mar 2020 18:26:02 -0300 Subject: [PATCH 6/8] =?UTF-8?q?[hotfix/3.3.1]=20-=20Corre=C3=A7=C3=A3o=20d?= =?UTF-8?q?e=20Bugs=20Tarefas:=20Bugs=20e=20melhorias=20Bugs:=20Refatora?= =?UTF-8?q?=C3=A7=C3=A3o=20no=20bug-15=20e=20adii=C3=A7=C3=A3o=20das=20mel?= =?UTF-8?q?horias=2001=20e=2002.=20Outras=20Informa=C3=A7=C3=B5es:=20=09*?= =?UTF-8?q?=20Ajuste=20nos=20gr=C3=A1ficos=20de=20calorias=20e=20heart=20r?= =?UTF-8?q?ate,=20na=20p=C3=A1gina=20de=20detalhes=20de=20atividade=20f?= =?UTF-8?q?=C3=ADsica;=20=09*=20Adi=C3=A7=C3=A3o=20do=20onClick=20nos=20ca?= =?UTF-8?q?rds=20de=20medi=C3=A7=C3=B5es;=20=09*=20Adi=C3=A7=C3=A3o=20do?= =?UTF-8?q?=20bot=C3=A3o=20de=20sincroniza=C3=A7=C3=A3o=20no=20dashboard?= =?UTF-8?q?=20do=20paciente.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../activity.dashboard.component.html | 140 +++++++--- .../activity.dashboard.component.scss | 25 ++ .../activity.dashboard.component.ts | 44 ++- .../activity.details.component.html | 143 ++++------ .../activity.details.component.scss | 5 + .../activity.details.component.ts | 253 +++++++++++------- .../activity.list.component.html | 3 +- .../modules/activity/pipes/duration.pipe.ts | 11 +- .../measurement/fat/fat.component.html | 2 +- .../external.service.component.html | 6 +- .../external.service.component.scss | 4 +- .../dashboard.card.component.html | 4 +- src/assets/i18n/pt-BR.json | 6 +- 13 files changed, 405 insertions(+), 241 deletions(-) diff --git a/src/app/modules/activity/activity.dashboard/activity.dashboard.component.html b/src/app/modules/activity/activity.dashboard/activity.dashboard.component.html index 9dec70d..f279059 100755 --- a/src/app/modules/activity/activity.dashboard/activity.dashboard.component.html +++ b/src/app/modules/activity/activity.dashboard/activity.dashboard.component.html @@ -5,7 +5,7 @@
@@ -163,8 +170,8 @@

{{'ACTIVITY.NO-RECENT-EXERCISES'|translate}}

-
{{'ACTIVITY.NO-RECENT-EXERCISES'|translate}}

@@ -259,7 +269,8 @@

{{'ACTIVITY.NO-RECENT-EXERCISES'|translate}}

@@ -301,10 +312,12 @@

{{'ACTIVITY.NO-RECENT-EXERCISES'|translate}}

@@ -314,7 +327,8 @@

{{'ACTIVITY.NO-RECENT-EXERCISES'|translate}}

@@ -355,11 +369,17 @@

{{'ACTIVITY.NO-RECENT-EXERCISES'|translate}}

- +
+ + +
@@ -369,12 +389,6 @@

{{'ACTIVITY.NO-RECENT-EXERCISES'|translate}}

- - @@ -413,11 +427,17 @@

{{'ACTIVITY.NO-RECENT-EXERCISES'|translate}}

- +
+ + +
@@ -427,12 +447,6 @@

{{'ACTIVITY.NO-RECENT-EXERCISES'|translate}}

- -
{{'ACTIVITY.NO-RECENT-EXERCISES'|translate}}
+ + + + + +
+
+ +
+ +
diff --git a/src/app/modules/activity/activity.dashboard/activity.dashboard.component.scss b/src/app/modules/activity/activity.dashboard/activity.dashboard.component.scss index 09236f0..d1ed24b 100755 --- a/src/app/modules/activity/activity.dashboard/activity.dashboard.component.scss +++ b/src/app/modules/activity/activity.dashboard/activity.dashboard.component.scss @@ -219,3 +219,28 @@ i:hover { } } } + +.separator { + overflow: visible; /* For IE */ + padding: 0; + border: none; + border-top: medium double #333; + color: #333; + text-align: center; + + &:after { + content: attr(data-label); + display: inline-block; + position: relative; + top: -0.7em; + font-size: 1em; + padding: 0 0.25em; + background: white; + } +} + +.disabled { + i { + color: rgb(212, 207, 207); + } +} diff --git a/src/app/modules/activity/activity.dashboard/activity.dashboard.component.ts b/src/app/modules/activity/activity.dashboard/activity.dashboard.component.ts index faee071..50df338 100755 --- a/src/app/modules/activity/activity.dashboard/activity.dashboard.component.ts +++ b/src/app/modules/activity/activity.dashboard/activity.dashboard.component.ts @@ -18,6 +18,9 @@ import { PhysicalActivitiesService } from '../services/physical.activities.servi import { TimeSeriesService } from '../services/time.series.service' import { SleepFilter, SleepService } from '../services/sleep.service' import { VerifyScopeService } from '../../../security/services/verify.scope.service' +import { AccessStatus, SynchronizeData } from '../../patient/models/external.service' +import { FitbitService } from '../../../security/external.services/services/fitbit.service' +import { ModalService } from '../../../shared/shared.components/modal/service/modal.service' @Component({ selector: 'activity-dashboard', @@ -59,6 +62,9 @@ export class ActivityDashboardComponent implements OnInit, OnChanges { currentFilter: TimeSeriesIntervalFilter; sleepDivRef: ElementRef; visibilityFitBitSync: boolean; + synchronizing: boolean; + synchronizeData: SynchronizeData; + AccessStatus = AccessStatus; @ViewChild('sleepDiv') set sleepDiv(element: ElementRef) { @@ -154,10 +160,12 @@ export class ActivityDashboardComponent implements OnInit, OnChanges { private localStorageService: LocalStorageService, private translateService: TranslateService, private timeSeriesService: TimeSeriesService, - private verifyScopeService: VerifyScopeService + private verifyScopeService: VerifyScopeService, + private fitbitService: FitbitService, + private modalService: ModalService ) { this.currentDate = new Date(); - this.activityGraph = []; + this.activityGraph = new Array(3); this.timeSeriesTypes = Object.keys(TimeSeriesType); this.measurementSelected = TimeSeriesType.steps; this.loadingTimeSeries = true; @@ -170,6 +178,7 @@ export class ActivityDashboardComponent implements OnInit, OnChanges { this.caloriesSize = 200; this.distanceSize = 200; this.activeMinutesSize = 200; + this.synchronizeData = new SynchronizeData(); } ngOnInit() { @@ -270,7 +279,7 @@ export class ActivityDashboardComponent implements OnInit, OnChanges { } loadActivitiesGraph(): void { - this.listActivities.forEach(activity => { + this.listActivities.forEach((activity, index) => { if (activity.heart_rate_average) { this.timeSeriesService.getByLink(activity.heart_rate_link) .then(heartRate => { @@ -347,7 +356,7 @@ export class ActivityDashboardComponent implements OnInit, OnChanges { series }; - this.activityGraph.push(activityHearRateGraph); + this.activityGraph[index] = activityHearRateGraph; }) .catch(() => { @@ -428,7 +437,7 @@ export class ActivityDashboardComponent implements OnInit, OnChanges { series } - this.activityGraph.push(activityCalorieGraph); + this.activityGraph[index] = activityCalorieGraph; }) .catch(() => { @@ -505,6 +514,31 @@ export class ActivityDashboardComponent implements OnInit, OnChanges { this.updateQueryParams(); } + async synchronize(): Promise { + this.synchronizing = true; + try { + this.synchronizeData = await this.fitbitService.synchronize(this.patientId); + this.currentDate = new Date(); + this.loadGoals(); + this.loadActivities(); + this.loadTimeSeries(); + this.loadSleep(); + this.modalService.open('synchronized'); + } catch (err) { + if (err && err.status === 429) { + this.toastService.error(this.translateService.instant('SECURITY.FORGOT.TOO-MANY-ATTEMPTS')) + } else { + this.toastService.error(this.translateService.instant('TOAST-MESSAGES.COULD-NOT-SYNC')) + } + } finally { + this.synchronizing = false; + } + } + + closeModalSynchronized(): void { + this.modalService.close('synchronized'); + } + verifyScopes(): void { this.visibilityFitBitSync = this.verifyScopeService.verifyScopes(['external:sync']); } diff --git a/src/app/modules/activity/activity.details/activity.details.component.html b/src/app/modules/activity/activity.details/activity.details.component.html index bb6867f..8612011 100755 --- a/src/app/modules/activity/activity.details/activity.details.component.html +++ b/src/app/modules/activity/activity.details/activity.details.component.html @@ -18,16 +18,6 @@

{{physicalActivity ? (physicalActivity.name | physicalAct