From a7b98babb0da13a667170b44ea28db146529a12e Mon Sep 17 00:00:00 2001 From: pauline <16977973+mpgxvii@users.noreply.github.com> Date: Fri, 2 Nov 2018 15:31:43 +0000 Subject: [PATCH 01/29] fix translations --- src/assets/data/localisations.ts | 54 ++++++++++++++++---------------- 1 file changed, 27 insertions(+), 27 deletions(-) diff --git a/src/assets/data/localisations.ts b/src/assets/data/localisations.ts index 845435cd5..081336ad8 100644 --- a/src/assets/data/localisations.ts +++ b/src/assets/data/localisations.ts @@ -56,7 +56,7 @@ export const Localisations = { es: 'Antes de poder usar esta aplicación, debe registrarse. Puede escanear el código QR o ingresar el token.', it: - 'Prima di poter usare questa app, deve registrarsi. Puoi scansionare il codice QR o inserire il token.', + 'Prima di poter usare questa app, devi registrarti. Puoi scansionare il codice QR o inserire il token.', nl: 'Voordat u de app kunt gebruiken, moeten we de app eerst registreren. U kunt de QR code scannen of het token invoeren.' }, @@ -70,7 +70,7 @@ export const Localisations = { es: 'Presione el botón "Escanear" e ingrese el código QR que le dio el personal del estudio. A continuación puede ver un ejemplo de código QR', it: - 'Prema il pulsante "Scan" e inquadri il codice QR che le è stato dato dal personale dello studio. Qui sotto può vedere un esempio di QR.', + 'Premi il pulsante "Scan" e inquadra il codice QR che ti è stato fornito dal personale dello studio. Qui sotto puoi vedere un esempio di QR.', nl: 'Klik op de "Scan" knop en richt de camera op de QR code die u heeft ontvangen van de onderzoeker. Hieronder staat een voorbeeld van een QR code afgebeeld.' }, @@ -106,7 +106,7 @@ export const Localisations = { es: 'Le enviaremos cada semana un resumen de los datos que nos envía. Siéntase libre de seleccionar solo los temas sobre los cuales desea recibir información', it: - 'Le invieremo ogni settimana un riepilogo dei dati che ci invierà. Si senta libero di selezionar solo gli argomenti su cui vuole ricevere informazioni.', + 'Ti invieremo ogni settimana un riepilogo dei dati raccolti. Sentiti libero di selezionare solo gli argomenti su cui vuoi ricevere informazioni.', nl: 'We zullen u wekelijks samenvattingen sturen over uw verzamelde gegevens. U kunt zelf de onderwerpen selecteren waarover uw informatie wilt ontvangen.' }, @@ -115,7 +115,7 @@ export const Localisations = { de: 'RADAR-CNS', en: 'RADAR-CNS', es: 'RADAR-CNS', - it: ' RADAR-CNS', + it: 'RADAR-CNS', nl: 'RADAR-CNS' }, FINISH_THANKS: { @@ -132,7 +132,7 @@ export const Localisations = { en: 'Remember, you still have tasks outstanding!', es: 'Recuerda, todavía tiene tareas pendientes!', it: 'Ricorda, hai ancora compiti eccezionali!', - nl: 'Denk eraan, je hebt nog steeds taken uitstekend!' + nl: 'Denk eraan, je hebt nog steeds taken overblijvende!' }, FINISH_COMPLETED_IN_CLINIC: { da: 'Afsluttet i klinik?', @@ -184,7 +184,7 @@ export const Localisations = { de: 'Benutzer ID', en: 'User ID', es: 'Código Usuario', - it: 'User ID', + it: 'ID Utente', nl: 'Gebruikers ID' }, SETTINGS_PROJECTNAME: { @@ -200,7 +200,7 @@ export const Localisations = { de: 'Benutzerinformationen', en: 'User Info', es: 'Información para el usuario', - it: 'User Info', + it: 'Informazioni Utente', nl: 'Gebruikersinformatie' }, SETTINGS_ENROL_DATE: { @@ -224,7 +224,7 @@ export const Localisations = { de: 'Wählen Sie Ihre Sprache', en: 'Select your Language', es: 'Seleccione su idioma', - it: 'Selezioni la lingua desiderata', + it: 'Seleziona la lingua desiderata', nl: 'Kies uw taal' }, SETTINGS_NOTIFICATIONS: { @@ -417,7 +417,7 @@ export const Localisations = { BTN_FINISH: { da: 'Afslut', de: 'Fertig', - en: 'Finish', + en: 'Finalizado', es: 'Terminar', it: 'Fine', nl: 'Voltooid' @@ -514,7 +514,7 @@ export const Localisations = { da: 'Luk', de: 'Beenden', en: 'Close', - es: 'Cerrar', + es: 'Cierre', it: 'Chiudi', nl: 'Sluiten' }, @@ -566,7 +566,7 @@ export const Localisations = { en: 'RADAR-CNS questionnaire needs to be completed tomorrow – please remember.', es: 'Recuerde que mañana tendrá que completar el cuestionario RADAR-CNS', - it: 'Le ricordiamo che domani dovrà compilare il questionario RADAR –CNS', + it: 'Ti ricordiamo che domani dovrai compilare il questionario RADAR-CNS', nl: 'Vergeet u s.v.p. niet om de RADAR-CNS vragenlijst uiterlijk morgen in te vullen?' }, @@ -577,7 +577,7 @@ export const Localisations = { es: 'Recuerde reservarse el tiempo mañana para contestar algunos cuestionarios', it: - 'Domani si ricordi di lasciarsi del tempo libero per rispondere a brevi questionari', + 'Domani ricordati di lasciare del tempo libero per rispondere a brevi questionari', nl: 'Vergeet u niet om morgen wat tijd vrij te maken voor het invullen van enkele vragenlijsten?' }, @@ -610,7 +610,7 @@ export const Localisations = { de: 'Haben Sie einen Fragebogen verpasst?', en: 'Missed a questionnaire?', es: '¿Ha olvidado algún cuestionario?', - it: 'Ha dimenticato un questionario?', + it: 'Hai dimenticato un questionario?', nl: 'Heeft u een vragenlijst vergeten?' }, NOTIFICATION_REMINDER_FORGOTTEN_DESC: { @@ -623,7 +623,7 @@ export const Localisations = { es: 'Parece que no ha respondido todas las preguntas. ¿Podría hacerlo ahora?', it: - 'Sembra che si sia dimenticato di rispondere ad alcune domande. Potrebbe farlo ora?', + 'Sembra che ti sia dimenticato di rispondere alcune domande. Puoi farlo ora?', nl: 'Het lijkt erop dat u niet alle vragen heeft beantwoord. Zou u dit nu alsnog willen doen?' }, @@ -699,7 +699,7 @@ export const Localisations = { da: 'Dagens opgaver', de: 'Heutige Aufgaben', en: "Today's tasks", - es: 'Las tareas de hoy ', + es: 'Las tareas de hoy', it: 'Le attività di oggi', nl: 'Taken voor vandaag' }, @@ -731,17 +731,17 @@ export const Localisations = { da: 'Din næste opgave starter om ', de: 'Ihre nächste Aufgabe started in ', en: 'Your next task starts in ', - es: 'La próxima tarea comienza en ', + es: 'La siguiente tarea comienza en ', it: 'La prossima attività inizierà tra ', nl: 'Uw volgende taak start over ' }, TASK_BAR_NOW_TASK: { - da: 'Din opgave starter', + da: 'Din opgave starter ', de: 'Deine Aufgabe started ', en: 'Your task starts ', - es: 'La tarea comienza', - it: 'Il tuo compito inizia', - nl: 'Je taak begint' + es: 'La tarea comienza ', + it: 'Il tuo compito inizia ', + nl: 'Je taak begint ' }, TASK_BAR_NEXT_TASK_SOON: { da: 'snart', @@ -752,12 +752,12 @@ export const Localisations = { nl: 'spoedig' }, TASK_BAR_AFFIRMATION_1: { - da: 'Godt klaret! ', - de: 'Gut gemacht! ', - en: 'Well done! ', - es: '¡Muy bien! ', - it: 'ben fatto! ', - nl: 'Goed gedaan! ' + da: 'Godt klaret!', + de: 'Gut gemacht!', + en: 'Well done!', + es: '¡Muy bien!', + it: 'ben fatto!', + nl: 'Goed gedaan!' }, TASK_BAR_AFFIRMATION_2: { da: 'Alle opgaver er gennemført', @@ -853,7 +853,7 @@ export const Localisations = { da: 'Luk App', de: 'Schließen Sie die App', en: 'Close App', - es: 'Cerrar App', + es: 'Cierre App', it: 'Chiudi App', nl: 'App Sluiten' } From 8a92378e81e48738f321135f008bf68a0eb4c227 Mon Sep 17 00:00:00 2001 From: pauline <16977973+mpgxvii@users.noreply.github.com> Date: Wed, 7 Nov 2018 12:12:02 +0000 Subject: [PATCH 02/29] fix localisations --- src/assets/data/localisations.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/assets/data/localisations.ts b/src/assets/data/localisations.ts index 081336ad8..c3de8e49d 100644 --- a/src/assets/data/localisations.ts +++ b/src/assets/data/localisations.ts @@ -93,7 +93,7 @@ export const Localisations = { de: 'Einstellungen', en: 'Preferences', es: 'Preferencias', - it: ' Preferenze', + it: 'Preferenze', nl: 'Voorkeurs instellingen' }, ENROL_PREFERENCES_DESC: { @@ -132,7 +132,7 @@ export const Localisations = { en: 'Remember, you still have tasks outstanding!', es: 'Recuerda, todavía tiene tareas pendientes!', it: 'Ricorda, hai ancora compiti eccezionali!', - nl: 'Denk eraan, je hebt nog steeds taken overblijvende!' + nl: 'Denk eraan, je hebt nog steeds taken openstaan!' }, FINISH_COMPLETED_IN_CLINIC: { da: 'Afsluttet i klinik?', @@ -747,9 +747,9 @@ export const Localisations = { da: 'snart', de: 'bald', en: 'soon', - es: 'En breve', + es: 'en breve', it: 'presto', - nl: 'spoedig' + nl: 'binnenkort' }, TASK_BAR_AFFIRMATION_1: { da: 'Godt klaret!', From 78153443bdf9332e518c90e15d8f69fb08e0aa21 Mon Sep 17 00:00:00 2001 From: pauline <16977973+mpgxvii@users.noreply.github.com> Date: Wed, 21 Nov 2018 15:11:34 +0000 Subject: [PATCH 03/29] fix Danish translations --- src/assets/data/localisations.ts | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/src/assets/data/localisations.ts b/src/assets/data/localisations.ts index d159252dd..86dda9ed6 100644 --- a/src/assets/data/localisations.ts +++ b/src/assets/data/localisations.ts @@ -98,7 +98,7 @@ export const Localisations = { }, ENROL_PREFERENCES_DESC: { da: - 'Vi sender dig en ugenlig opsummering om de data du har sendt til os. Vælg lige så mange emner du ønsker at modtage information om.', + 'Vi sender dig en ugentlig opsummering om de data du har sendt til os. Vælg lige så mange emner du ønsker at modtage information om.', de: 'Wir senden Ihnen wöchentliche Zusammenfassungen über die Daten, die Sie uns senden. Wählen Sie beliebig viele Themen aus, zu denen Sie Informationen erhalten möchten.', en: @@ -151,7 +151,7 @@ export const Localisations = { nl: 'Geblokkeerd' }, CALENDAR_ESM_MISSED_DESC: { - da: 'Desværre kan du kun besvare dette spørgeskema ved den anmeldte tid.', + da: 'Spørgsmålet kan ikke besvares længere.', de: 'Leider können Sie diesen Fragebogen nur zum angegebenen Zeitpunkt beantworten.', en: @@ -196,7 +196,7 @@ export const Localisations = { nl: 'Project naam' }, SETTINGS_USER_INFO: { - da: 'Bruger info', + da: 'Bruger information', de: 'Benutzerinformationen', en: 'User Info', es: 'Información para el usuario', @@ -559,7 +559,7 @@ export const Localisations = { nl: 'Laden...' }, STATUS_SUCCESS: { - da: 'Success', + da: 'Succes', de: 'Erfolg', en: 'Success', es: 'Completado', @@ -595,7 +595,7 @@ export const Localisations = { 'Vergeet u s.v.p. niet om de RADAR-CNS vragenlijst uiterlijk morgen in te vullen?' }, NOTIFICATION_REMINDER_SOON_DESC: { - da: 'Husk at sætte lidt tid af imorgen, til at svare på et par spørgsmål.', + da: 'Husk at sætte lidt tid af i morgen, til at svare på et par spørgsmål.', de: 'Denken Sie daran, morgen etwas Zeit für ein paar Fragebögen zu haben.', en: 'Remember to put some time aside for a few questionnaires tomorrow.', es: @@ -653,7 +653,7 @@ export const Localisations = { }, NOTIFICATION_REMINDER_FORGOTTEN_ALERT_DEFAULT_DESC: { da: - 'Du har savnet dette. Du skal ikke bekymre dig! Den næste forespørgsel vil snart ske.', + 'Du har ikke nået at svare på dette. Ingen problemer! De næste spørgsmål kommer snart', de: 'Du hast die letzten Fragen verpasst. Mach dir keine Sorgen! Der nächste Fragebogen wird bald fällig.', en: @@ -666,7 +666,8 @@ export const Localisations = { 'Je hebt deze gemist. Maak je geen zorgen! De volgende vragenlijst zal binnenkort verschijnen.' }, NOTIFICATION_REMINDER_FORGOTTEN_ALERT_LASTOFNIGHT_DESC: { - da: 'Du har savnet den sidste. Du skal ikke bekymre dig! Hav en god aften.', + da: + 'Du har ikke nået at svare på sidste spørgsmål. Ingen problemer! Hav en god aften.', de: 'Du hast den letzten verpasst. Mach dir keine Sorgen! Gute Nacht.', en: "You've missed the last one. Dont worry! Have a good night.", es: 'No ha llegado a contestar el último. No se preocupe! Buenas noches!', @@ -690,7 +691,7 @@ export const Localisations = { nl: 'Stappen' }, MEASURE_HEART_RATE: { - da: 'Hjertetryme', + da: 'Hjerterytme', de: 'Puls', en: 'Heart rate', es: 'Ritmo cardíaco', @@ -840,7 +841,7 @@ export const Localisations = { nl: 'uren' }, TASK_TIME_MINUTE_SINGLE: { - da: 'minuten', + da: 'minut', de: 'Min.', en: 'min', es: 'minuto', From df504f1c8c6c7a5ebca750876574aa821732bc82 Mon Sep 17 00:00:00 2001 From: pauline <16977973+mpgxvii@users.noreply.github.com> Date: Wed, 21 Nov 2018 15:17:02 +0000 Subject: [PATCH 04/29] fix Spanish translations --- src/assets/data/localisations.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/assets/data/localisations.ts b/src/assets/data/localisations.ts index 86dda9ed6..5899e8e2d 100644 --- a/src/assets/data/localisations.ts +++ b/src/assets/data/localisations.ts @@ -130,7 +130,7 @@ export const Localisations = { da: 'Husk, du har stadig udestående opgaver!', de: 'Denken Sie daran, Sie haben noch Aufgaben ausstehend!', en: 'Remember, you still have tasks outstanding!', - es: 'Recuerda, todavía tiene tareas pendientes!', + es: 'Recuerde, todavía tiene tareas pendientes!', it: 'Ricorda, hai ancora compiti eccezionali!', nl: 'Denk eraan, je hebt nog steeds taken openstaan!' }, @@ -138,7 +138,7 @@ export const Localisations = { da: 'Afsluttet i klinik?', de: 'In der Klinik abgeschlossen?', en: 'Completed in clinic?', - es: 'Completado en la visita clínica', + es: 'Completado durante la visita clínica', it: 'Completato in clinica?', nl: 'Voltooid in de kliniek?' }, @@ -146,7 +146,7 @@ export const Localisations = { da: 'Blokeret', de: 'Nich erlaubt', en: 'Blocked', - es: 'Obstruido', + es: 'Bloqueado', it: 'Bloccato', nl: 'Geblokkeerd' }, @@ -306,7 +306,7 @@ export const Localisations = { da: 'Nulstil RADAR-CNS App', de: 'RADAR-CNS App zurücksetzen', en: 'Reset RADAR-CNS App', - es: 'Restablecer la aplicación RADAR-CNS', + es: 'Reiniciar, la aplicación RADAR-CNS', it: 'Reset RADAR-CNS app', nl: 'Reset RADAR-CNS app' }, From dc780bcc78080dbadbc34305bc1254f02d3ab1b9 Mon Sep 17 00:00:00 2001 From: pauline <16977973+mpgxvii@users.noreply.github.com> Date: Wed, 28 Nov 2018 15:46:43 +0000 Subject: [PATCH 05/29] update Italian translations --- src/assets/data/localisations.ts | 46 ++++++++++++++++---------------- 1 file changed, 23 insertions(+), 23 deletions(-) diff --git a/src/assets/data/localisations.ts b/src/assets/data/localisations.ts index 5899e8e2d..9be21ea54 100644 --- a/src/assets/data/localisations.ts +++ b/src/assets/data/localisations.ts @@ -70,7 +70,7 @@ export const Localisations = { es: 'Presione el botón "Escanear" e ingrese el código QR que le dio el personal del estudio. A continuación puede ver un ejemplo de código QR', it: - 'Premi il pulsante "Scan" e inquadra il codice QR che ti è stato fornito dal personale dello studio. Qui sotto puoi vedere un esempio di QR.', + 'Premi il pulsante "Scan" e inquadra il codice QR che hai ricevuto dal personale dello studio. Qui sotto puoi vedere un QR di esempio.', nl: 'Klik op de "Scan" knop en richt de camera op de QR code die u heeft ontvangen van de onderzoeker. Hieronder staat een voorbeeld van een QR code afgebeeld.' }, @@ -106,7 +106,7 @@ export const Localisations = { es: 'Le enviaremos cada semana un resumen de los datos que nos envía. Siéntase libre de seleccionar solo los temas sobre los cuales desea recibir información', it: - 'Ti invieremo ogni settimana un riepilogo dei dati raccolti. Sentiti libero di selezionare solo gli argomenti su cui vuoi ricevere informazioni.', + 'Ti invieremo ogni settimana un riepilogo dei dati raccolti. Sentiti libero di selezionare solo gli argomenti di cui vuoi ricevere le informazioni.', nl: 'We zullen u wekelijks samenvattingen sturen over uw verzamelde gegevens. U kunt zelf de onderwerpen selecteren waarover uw informatie wilt ontvangen.' }, @@ -122,16 +122,16 @@ export const Localisations = { da: 'Tak fordi du udfyldte spørgeskemaet.', de: 'Vielen Dank für das Ausfüllen des Fragebogens.', en: 'Thank you for completing the questionnaire.', - es: 'Gracias por completar el cuestionario', - it: 'Grazie per aver completato il questionario', - nl: 'Bedankt voor het invullen van de vragenlijst' + es: 'Gracias por completar el cuestionario.', + it: 'Grazie per aver completato il questionario.', + nl: 'Bedankt voor het invullen van de vragenlijst.' }, FINISH_NEXT_TASK_REMINDER: { da: 'Husk, du har stadig udestående opgaver!', de: 'Denken Sie daran, Sie haben noch Aufgaben ausstehend!', en: 'Remember, you still have tasks outstanding!', es: 'Recuerde, todavía tiene tareas pendientes!', - it: 'Ricorda, hai ancora compiti eccezionali!', + it: 'Ricorda, hai ancora delle attività in sospeso!', nl: 'Denk eraan, je hebt nog steeds taken openstaan!' }, FINISH_COMPLETED_IN_CLINIC: { @@ -184,7 +184,7 @@ export const Localisations = { de: 'Benutzer ID', en: 'User ID', es: 'Código Usuario', - it: 'ID Utente', + it: 'ID utente', nl: 'Gebruikers ID' }, SETTINGS_PROJECTNAME: { @@ -200,7 +200,7 @@ export const Localisations = { de: 'Benutzerinformationen', en: 'User Info', es: 'Información para el usuario', - it: 'Informazioni Utente', + it: 'Informazioni utente', nl: 'Gebruikersinformatie' }, SETTINGS_ENROL_DATE: { @@ -589,8 +589,8 @@ export const Localisations = { 'Der RADAR-CNS Fragebogen muss morgen ausgefüllt werden – bitte denken Sie daran.', en: 'RADAR-CNS questionnaire needs to be completed tomorrow – please remember.', - es: 'Recuerde que mañana tendrá que completar el cuestionario RADAR-CNS', - it: 'Ti ricordiamo che domani dovrai compilare il questionario RADAR-CNS', + es: 'Recuerde que mañana tendrá que completar el cuestionario RADAR-CNS.', + it: 'Ti ricordiamo che domani dovrai compilare il questionario RADAR-CNS.', nl: 'Vergeet u s.v.p. niet om de RADAR-CNS vragenlijst uiterlijk morgen in te vullen?' }, @@ -601,7 +601,7 @@ export const Localisations = { es: 'Recuerde reservarse el tiempo mañana para contestar algunos cuestionarios', it: - 'Domani ricordati di lasciare del tempo libero per rispondere a brevi questionari', + 'Domani ricordati di lasciare del tempo libero per rispondere a brevi questionari.', nl: 'Vergeet u niet om morgen wat tijd vrij te maken voor het invullen van enkele vragenlijsten?' }, @@ -647,7 +647,7 @@ export const Localisations = { es: 'Parece que no ha respondido todas las preguntas. ¿Podría hacerlo ahora?', it: - 'Sembra che ti sia dimenticato di rispondere alcune domande. Puoi farlo ora?', + 'Sembra che ti sia dimenticato di rispondere ad alcune domande. Puoi farlo ora?', nl: 'Het lijkt erop dat u niet alle vragen heeft beantwoord. Zou u dit nu alsnog willen doen?' }, @@ -716,7 +716,7 @@ export const Localisations = { es: 'Hecho con ♥ para usted por el consorcio RADAR-CNS. Para obtener más información, haga clic en aquí.', it: - 'Fatto con il ♥ per voi dal consorzio RADAR-CNS. Per maggiori informazioni clicca here.', + 'Fatto con il ♥ per te dal consorzio RADAR-CNS. Per maggiori informazioni clicca qui.', nl: 'Met ♥ voor u gemaakt door het RADAR-CNS consortium. Voor meer informatie klik here' }, @@ -733,7 +733,7 @@ export const Localisations = { de: 'Benötigt einen leisen Raum', en: 'Requires a quiet space', es: 'Requiere un espacio tranquilo', - it: 'richiede un posto tranquillo', + it: 'Richiede un posto tranquillo', nl: 'Vereist een rustige omgeving' }, TASK_PROGRESS_TITLE: { @@ -741,7 +741,7 @@ export const Localisations = { de: 'Heute', en: 'Today', es: 'Hoy', - it: 'oggi', + it: 'Oggi', nl: 'Vandaag' }, TASK_PROGRESS_COMPLETED: { @@ -749,7 +749,7 @@ export const Localisations = { de: 'Erledigt', en: 'Completed', es: 'Completado', - it: 'completato', + it: 'Completato', nl: 'Voltooid' }, TASK_BAR_NEXT_TASK: { @@ -773,7 +773,7 @@ export const Localisations = { de: 'bald', en: 'soon', es: 'en breve', - it: 'presto', + it: 'Presto', nl: 'binnenkort' }, TASK_BAR_AFFIRMATION_1: { @@ -781,16 +781,16 @@ export const Localisations = { de: 'Gut gemacht!', en: 'Well done!', es: '¡Muy bien!', - it: 'ben fatto!', + it: 'Ben fatto!', nl: 'Goed gedaan!' }, TASK_BAR_AFFIRMATION_2: { - da: 'Alle opgaver er gennemført', - de: 'Alle Aufgaben komplett', + da: 'Alle opgaver er gennemført.', + de: 'Alle Aufgaben komplett.', en: 'All tasks completed.', - es: 'Todas las tareas han sido completadas', - it: 'Tutte le attività sono state completate', - nl: 'Alle taken voltooid' + es: 'Todas las tareas han sido completadas.', + it: 'Tutte le attività sono state completate.', + nl: 'Alle taken voltooid.' }, TASK_BAR_TASK_LEFT_1: { da: 'Vent venligst! ', From 13209c0564057e5e1dc6f2854b06b67f7498411b Mon Sep 17 00:00:00 2001 From: pauline <16977973+mpgxvii@users.noreply.github.com> Date: Thu, 29 Nov 2018 16:18:12 +0000 Subject: [PATCH 06/29] modify localisations --- src/app/shared/enums/localisations.ts | 6 ++++++ src/assets/data/localisations.ts | 18 +++++++++++++++++- 2 files changed, 23 insertions(+), 1 deletion(-) diff --git a/src/app/shared/enums/localisations.ts b/src/app/shared/enums/localisations.ts index 5abb852ec..c3d6107e5 100644 --- a/src/app/shared/enums/localisations.ts +++ b/src/app/shared/enums/localisations.ts @@ -67,6 +67,12 @@ export class LocKeys { static STATUS_SUCCESS = new LocKeys('STATUS_SUCCESS') static STATUS_FAILURE = new LocKeys('STATUS_FAILURE') static STATUS_NOW = new LocKeys('STATUS_NOW') + static NOTIFICATION_TEST_REMINDER_NOW = new LocKeys( + 'NOTIFICATION_TEST_REMINDER_NOW' + ) + static NOTIFICATION_TEST_REMINDER_NOW_DESC = new LocKeys( + 'NOTIFICATION_TEST_REMINDER_NOW_DESC' + ) static NOTIFICATION_REMINDER_SOON = new LocKeys('NOTIFICATION_REMINDER_SOON') static NOTIFICATION_REMINDER_SOON_DESC = new LocKeys( 'NOTIFICATION_REMINDER_SOON_DESC' diff --git a/src/assets/data/localisations.ts b/src/assets/data/localisations.ts index 565568585..4a44d76b3 100644 --- a/src/assets/data/localisations.ts +++ b/src/assets/data/localisations.ts @@ -582,6 +582,22 @@ export const Localisations = { it: 'Non riuscuto', nl: 'Mislukt' }, + NOTIFICATION_TEST_REMINDER_NOW: { + da: 'Testmeddelelse', + de: 'Testbenachrichtigung', + en: 'Test Notification', + es: 'Notificación de prueba', + it: 'Notifica di prova', + nl: 'Testmelding' + }, + NOTIFICATION_TEST_REMINDER_NOW_DESC: { + da: 'Dette er en test anmeldelse.', + de: 'Dies ist eine Testbenachrichtigung.', + en: 'This is a test notification.', + es: 'Esta es una notificación de prueba.', + it: 'Questa è una notifica di prova.', + nl: 'Dit is een testmelding.' + }, NOTIFICATION_REMINDER_SOON: { da: 'RADAR-CNS spørgsmålene skal være færdige imorgen, husk venligst på dette.', @@ -607,7 +623,7 @@ export const Localisations = { }, NOTIFICATION_REMINDER_NOW: { da: 'Tid til at svare på spørgsmål', - de: 'Zeit für Fragebögen ', + de: 'Zeit für Fragebögen', en: 'Questionnaire time', es: 'Momento para el cuestionario ', it: "E' il momento dei questionari", From a80d89ea5957f8210a54c33066425e3cd5b68895 Mon Sep 17 00:00:00 2001 From: pauline <16977973+mpgxvii@users.noreply.github.com> Date: Thu, 29 Nov 2018 16:18:40 +0000 Subject: [PATCH 07/29] fix test notification message and title --- src/app/core/services/notification.service.ts | 45 +++++++++++++------ src/assets/data/defaultConfig.ts | 13 ++++++ yarn.lock | 5 ++- 3 files changed, 48 insertions(+), 15 deletions(-) diff --git a/src/app/core/services/notification.service.ts b/src/app/core/services/notification.service.ts index 045a4a0be..cf2abf355 100644 --- a/src/app/core/services/notification.service.ts +++ b/src/app/core/services/notification.service.ts @@ -8,7 +8,7 @@ import { DefaultNotificationType, DefaultNumberOfNotificationsToRescue, DefaultNumberOfNotificationsToSchedule, - DefaultTask, + DefaultTaskTest, FCMPluginProjectSenderId } from '../../../assets/data/defaultConfig' import { LocKeys } from '../../shared/enums/localisations' @@ -157,7 +157,7 @@ export class NotificationService { testFCMNotifications() { const TWO_MINUTES = 2 * 60000 - const task = DefaultTask + const task = DefaultTaskTest task.timestamp = new Date().getTime() + TWO_MINUTES const fcmNotification = this.formatFCMNotification( task, @@ -195,20 +195,39 @@ export class NotificationService { } formatFCMNotification(task, participantLogin) { - let text = this.translate.transform( - LocKeys.NOTIFICATION_REMINDER_NOW_DESC_1.toString() - ) - text += ' ' + task.estimatedCompletionTime + ' ' - text += this.translate.transform( - LocKeys.NOTIFICATION_REMINDER_NOW_DESC_2.toString() - ) - const expiry = task.name === 'ESM' ? 15 * 60 : 24 * 60 * 60 + let text, title + let expiry = 24 * 60 * 60 + switch (task.name) { + case 'TEST': + title = this.translate.transform( + LocKeys.NOTIFICATION_TEST_REMINDER_NOW.toString() + ) + text = this.translate.transform( + LocKeys.NOTIFICATION_TEST_REMINDER_NOW_DESC.toString() + ) + break + case 'ESM': + expiry = 15 * 60 + default: + title = this.translate.transform( + LocKeys.NOTIFICATION_REMINDER_NOW.toString() + ) + text = + this.translate.transform( + LocKeys.NOTIFICATION_REMINDER_NOW_DESC_1.toString() + ) + + ' ' + + task.estimatedCompletionTime + + ' ' + + this.translate.transform( + LocKeys.NOTIFICATION_REMINDER_NOW_DESC_2.toString() + ) + break + } const fcmNotification = { eventId: uuid(), action: 'SCHEDULE', - notificationTitle: this.translate.transform( - LocKeys.NOTIFICATION_REMINDER_NOW.toString() - ), + notificationTitle: title, notificationMessage: text, time: task.timestamp, subjectId: participantLogin, diff --git a/src/assets/data/defaultConfig.ts b/src/assets/data/defaultConfig.ts index 667a2d21a..7d5f737bf 100755 --- a/src/assets/data/defaultConfig.ts +++ b/src/assets/data/defaultConfig.ts @@ -50,6 +50,19 @@ export const DefaultTask: Task = { isClinical: false } +export const DefaultTaskTest: Task = { + index: 0, + completed: false, + reportedCompletion: false, + timestamp: 0, + name: 'TEST', + reminderSettings: {}, + nQuestions: 0, + estimatedCompletionTime: 0, + warning: '', + isClinical: false +} + export const DefaultSettingsSelectedLanguage: LanguageSetting = { label: '', value: '' diff --git a/yarn.lock b/yarn.lock index e11583868..c4f254fb7 100755 --- a/yarn.lock +++ b/yarn.lock @@ -5133,9 +5133,10 @@ jsprim@^1.2.2: json-schema "0.2.3" verror "1.3.6" -"kafka-rest@git+https://github.com/mpgxvii/kafka-rest-node": +kafka-rest@^0.0.5: version "0.0.5" - resolved "git+https://github.com/mpgxvii/kafka-rest-node#ee763b4ecfb8f3de6f62ee5818e82f5146549c78" + resolved "https://registry.yarnpkg.com/kafka-rest/-/kafka-rest-0.0.5.tgz#7b8ff99bd259e6b4b14c266884424d81a6ffdd9f" + integrity sha1-e4/5m9JZ5rSxTCZohEJNgab/3Z8= dependencies: async "~0.9.0" From 0680f92458fe29f8eed102470e46be3bc9e84ade Mon Sep 17 00:00:00 2001 From: pauline <16977973+mpgxvii@users.noreply.github.com> Date: Thu, 13 Dec 2018 23:15:34 +0000 Subject: [PATCH 08/29] fix task progress completed ui bug --- .../task-progress.component.html | 31 ++++---- .../task-progress/task-progress.component.ts | 75 ++++++------------- 2 files changed, 39 insertions(+), 67 deletions(-) diff --git a/src/app/pages/home/components/task-progress/task-progress.component.html b/src/app/pages/home/components/task-progress/task-progress.component.html index 05b853a9a..c49b68293 100755 --- a/src/app/pages/home/components/task-progress/task-progress.component.html +++ b/src/app/pages/home/components/task-progress/task-progress.component.html @@ -19,10 +19,14 @@
-
+
-
-
-
- -
+
+
+
@@ -54,6 +58,7 @@
{{ current }}
diff --git a/src/app/pages/home/components/task-progress/task-progress.component.ts b/src/app/pages/home/components/task-progress/task-progress.component.ts index e35f75733..e9bac1d88 100755 --- a/src/app/pages/home/components/task-progress/task-progress.component.ts +++ b/src/app/pages/home/components/task-progress/task-progress.component.ts @@ -1,19 +1,24 @@ -import { - Component, - ElementRef, - EventEmitter, - Input, - OnChanges, - Output, - ViewChild -} from '@angular/core' +import { animate, state, style, transition, trigger } from '@angular/animations' +import { Component, Input, OnChanges } from '@angular/core' import { TasksProgress } from '../../../../shared/models/task' -import { TasksService } from '../../services/tasks.service' @Component({ selector: 'task-progress', - templateUrl: 'task-progress.component.html' + templateUrl: 'task-progress.component.html', + animations: [ + trigger('enterAnimation', [ + transition(':enter', [ + style({ transform: 'translateX(100%)', opacity: 0 }), + animate('500ms', style({ transform: 'translateX(0)', opacity: 1 })) + ]) + ]), + trigger('translateY', [ + state('true', style({ transform: 'translateY(32vh)', opacity: 1 })), + state('false', style({ transform: 'translateY(0)', opacity: 1 })), + transition('true <=> false', animate('1s linear')) + ]) + ] }) export class TaskProgressComponent implements OnChanges { @Input() @@ -22,65 +27,27 @@ export class TaskProgressComponent implements OnChanges { forceComplete: boolean = false @Input() noTasksToday: boolean = false - @Output() - completed: EventEmitter = new EventEmitter() - text: string max: number = 1 current: number = 0 stroke = 22 animation = 'easeInOutQuart' - complete: boolean = false + complete = false showFireworks: boolean = false - @ViewChild('progressActive') - elActive: ElementRef - @ViewChild('progressComplete') - elComplete: ElementRef - @ViewChild('checkmark') - elCheckmark: ElementRef - @ViewChild('counter') - elCounter: ElementRef - - constructor(private tasksService: TasksService) {} - ngOnChanges() { + this.current = this.progress.completedTasks + this.max = this.progress.numberOfTasks this.updateProgress() } updateProgress() { - if (this.progress) { - this.max = this.progress.numberOfTasks - this.current = this.progress.completedTasks - } - if (this.current >= this.max) { + if (this.forceComplete || this.current >= this.max) { this.complete = true this.displayFireworks(800, 980) } else { this.complete = false } - if (this.forceComplete) { - this.complete = true - } - this.transitionToComplete() - this.completed.emit(this.complete) - } - - transitionToComplete() { - if (this.complete) { - this.elActive.nativeElement.style.transform = - 'translate3d(-100%,0,0) scale(0.1)' - this.elComplete.nativeElement.style.transform = - 'translate3d(-100%,0,0) scale(1)' - this.elCheckmark.nativeElement.style.transform = 'scale(1)' - if (this.elCounter) - this.elCounter.nativeElement.style.transform = 'translate3d(0,250px,0)' - } else { - this.elActive.nativeElement.style.transform = - 'translate3d(0,0,0) scale(1)' - if (this.elCounter) - this.elCounter.nativeElement.style.transform = 'translate3d(0,0,0)' - } } displayFireworks(milliDelay, milliDisplay) { @@ -94,7 +61,7 @@ export class TaskProgressComponent implements OnChanges { easterEggFireworks() { if (this.current >= this.max) { - this.displayFireworks(1, 980) + this.displayFireworks(800, 980) } } } From f142176127b8aefa62728eda4ed3dc079e90e5f5 Mon Sep 17 00:00:00 2001 From: pauline <16977973+mpgxvii@users.noreply.github.com> Date: Thu, 13 Dec 2018 23:16:11 +0000 Subject: [PATCH 09/29] fix task info and home page animations --- .../task-info/task-info.component.html | 13 +- .../task-info/task-info.component.ts | 155 +++--------------- .../home/containers/home-page.component.html | 13 +- .../home/containers/home-page.component.scss | 10 +- .../home/containers/home-page.component.ts | 89 ++-------- 5 files changed, 53 insertions(+), 227 deletions(-) diff --git a/src/app/pages/home/components/task-info/task-info.component.html b/src/app/pages/home/components/task-info/task-info.component.html index 41f6a1afb..f5381e5e4 100755 --- a/src/app/pages/home/components/task-info/task-info.component.html +++ b/src/app/pages/home/components/task-info/task-info.component.html @@ -1,6 +1,5 @@
@@ -13,7 +12,7 @@
{{ "STATUS_NOW" | translate }}
@@ -65,10 +64,10 @@
- : + : {{ getMinutes() }}
@@ -79,7 +78,7 @@
out', animate('400ms ease')), - transition('out => in', animate('400ms ease')) + state('false', style({ opacity: '0' })), + state('true', style({ opacity: '1.0' })), + transition('* => *', animate('400ms ease')) ]), trigger('scaleMinutes', [ state( - 'min', - style({ - transform: 'translate3d(-25%, -15%, 0) scale(0.45)' - }) + 'false', + style({ transform: 'translate3d(-25%, -15%, 0) scale(0.45)' }) ), - state( - 'max', - style({ - transform: 'translate3d(0, 0, 0) scale(1)' - }) - ), - transition('max => min', animate('400ms ease')), - transition('min => max', animate('400ms ease')) + state('true', style({ transform: 'translate3d(0, 0, 0) scale(1)' })), + transition('* => *', animate('400ms ease')) ]), trigger('alignCenterRightExtraInfo', [ - state( - 'right', - style({ - transform: 'translate3d(15%, 0, 0)' - }) - ), - state( - 'center', - style({ - transform: 'translate3d(0, 0, 0)' - }) - ), - transition('center => right', animate('400ms ease')), - transition('right => center', animate('400ms ease')) + state('false', style({ transform: 'translate3d(15%, 0, 0)' })), + state('true', style({ transform: 'translate3d(0, 0, 0)' })), + transition('* => *', animate('400ms ease')) ]), trigger('alignCenterRightTime', [ - state( - 'right', - style({ - transform: 'translate3d(15%, 0, 0) scale(0.8)' - }) - ), - state( - 'center', - style({ - transform: 'translate3d(0, 0, 0)' - }) - ), - transition('center => right', animate('400ms ease')), - transition('right => center', animate('400ms ease')) + state('false', style({ transform: 'translate3d(15%, 0, 0) scale(0.8)' })), + state('true', style({ transform: 'translate3d(0, 0, 0)' })), + transition('* => *', animate('400ms ease')) ]), trigger('moveInProgress', [ state( - 'out', - style({ - display: 'none', - transform: 'translate3d(-150%, 0, 0)' - }) + 'true', + style({ display: 'none', transform: 'translate3d(-150%, 0, 0)' }) ), state( - 'in', - style({ - display: 'block', - transform: 'translate3d(0, 0, 0)' - }) + 'false', + style({ display: 'block', transform: 'translate3d(0, 0, 0)' }) ), - transition('out => in', animate('400ms ease')), - transition('in => out', animate('400ms ease')) + transition('* => *', animate('400ms ease')) ]), trigger('alignCenterRightMetrics', [ - state( - 'right', - style({ - transform: 'translate3d(120%, 0, 0)' - }) - ), - state( - 'center', - style({ - transform: 'translate3d(0, 0, 0)' - }) - ), - transition('center => right', animate('400ms ease')), - transition('right => center', animate('400ms ease')) + state('false', style({ transform: 'translate3d(120%, 0, 0)' })), + state('true', style({ transform: 'translate3d(0, 0, 0)' })), + transition('* => *', animate('400ms ease')) ]) ] }) @@ -130,15 +63,12 @@ export class TaskInfoComponent implements OnChanges { isNow = false @Input() progress: TasksProgress + @Input() + expanded = true @Output() collapse: EventEmitter = new EventEmitter() - expanded: Boolean = true hasExtraInfo: Boolean = false displayTask: Boolean = false - animateFade: String - animateMove: String - animateScale: String - animateCenterRight: String private language: string private extraTaskInfo: string @@ -148,20 +78,7 @@ export class TaskInfoComponent implements OnChanges { radius: number = 35 stroke: number = 8 - animationKeys = { - MIN: 'min', - MAX: 'max', - IN: 'in', - OUT: 'out', - CENTER: 'center', - RIGHT: 'right' - } - - constructor( - private tasksService: TasksService, - public storage: StorageService - ) { - this.applyAnimationKeys() + constructor(public storage: StorageService) { this.storage.get(StorageKeys.LANGUAGE).then(resLang => { this.language = resLang.value }) @@ -170,6 +87,7 @@ export class TaskInfoComponent implements OnChanges { ngOnChanges() { this.checkDisplayTask() this.checkHasExtraInfo() + this.updateProgress() } checkDisplayTask() { @@ -192,15 +110,6 @@ export class TaskInfoComponent implements OnChanges { } } - expand() { - if (this.task.name !== 'ESM') { - this.collapse.emit(this.expanded) - this.expanded = !this.expanded - this.applyAnimationKeys() - this.updateProgress() - } - } - updateProgress() { if (this.progress) { this.current = this.progress.completedTasks @@ -208,20 +117,6 @@ export class TaskInfoComponent implements OnChanges { } } - applyAnimationKeys() { - if (this.expanded) { - this.animateFade = this.animationKeys.IN - this.animateMove = this.animationKeys.OUT - this.animateScale = this.animationKeys.MAX - this.animateCenterRight = this.animationKeys.CENTER - } else { - this.animateFade = this.animationKeys.OUT - this.animateMove = this.animationKeys.IN - this.animateScale = this.animationKeys.MIN - this.animateCenterRight = this.animationKeys.RIGHT - } - } - getHour() { const date = new Date() date.setTime(this.task['timestamp']) diff --git a/src/app/pages/home/containers/home-page.component.html b/src/app/pages/home/containers/home-page.component.html index 2db073d7f..0dc3127f2 100755 --- a/src/app/pages/home/containers/home-page.component.html +++ b/src/app/pages/home/containers/home-page.component.html @@ -34,7 +34,7 @@ [progress]="tasksProgress" [forceComplete]="showCompleted" [noTasksToday]="showNoTasksToday" - *ngIf="!hasOnlyESMs" + *ngIf="tasksProgress && !hasOnlyESMs && !showCalendar" >
-
*', animate('300ms ease')) + ]) + ] }) export class HomePageComponent { @ViewChild('content') @@ -82,7 +90,7 @@ export class HomePageComponent { ) this.getElementsAttributes() this.elProgressHeight += this.elProgressOffset - this.applyTransformations() + // this.applyTransformations() this.showNoTasksToday = false this.startingQuestionnaire = false } @@ -114,7 +122,6 @@ export class HomePageComponent { if (task && task.isClinical == false) { this.nextTask = task this.displayCompleted(false) - this.displayEvalTransformations(false) this.taskIsNow = checkTaskIsNow(this.nextTask.timestamp) } else { this.tasksService.areAllTasksComplete().then(completed => { @@ -126,7 +133,6 @@ export class HomePageComponent { } } else { this.nextTask = DefaultTask - this.displayEvalTransformations(true) } }) } @@ -152,10 +158,9 @@ export class HomePageComponent { }) } - displayEvalTransformations(requestDisplay: boolean) { - this.showCalendar = requestDisplay - this.getElementsAttributes() - this.applyTransformations() + displayTaskCalendar() { + this.showCalendar = !this.showCalendar + this.setCalendarScrollHeight(this.showCalendar) } displayCompleted(requestDisplay: boolean) { @@ -176,74 +181,6 @@ export class HomePageComponent { this.elFooterHeight = this.elFooter.nativeElement.offsetHeight } - applyTransformations() { - if (this.showCalendar) { - this.elProgress.nativeElement.style.transform = `translateY(-${ - this.elProgressHeight - }px) scale(1)` - this.elTicker.nativeElement.style.transform = `translateY(-${ - this.elProgressHeight - }px)` - this.elInfo.nativeElement.style.transform = `translateY(-${ - this.elProgressHeight - }px)` - this.elFooter.nativeElement.style.transform = `translateY(${ - this.elFooterHeight - }px) scale(0)` - this.elCalendar.nativeElement.style.transform = `translateY(-${ - this.elProgressHeight - }px)` - this.elCalendar.nativeElement.style.opacity = 1 - } else { - if (this.elProgress) - this.elProgress.nativeElement.style.transform = - 'translateY(0px) scale(1)' - if (this.elTicker) - this.elTicker.nativeElement.style.transform = 'translateY(0px)' - if (this.elInfo) - this.elInfo.nativeElement.style.transform = 'translateY(0px)' - if (this.elFooter) - this.elFooter.nativeElement.style.transform = 'translateY(0px) scale(1)' - if (this.elCalendar) { - this.elCalendar.nativeElement.style.transform = 'translateY(0px)' - this.elCalendar.nativeElement.style.opacity = 0 - } - } - this.setCalendarScrollHeight(this.showCalendar) - } - - // TODO: Rename to something appropriate - isNextTaskESMandNotNow() { - const now = new Date().getTime() - if (!this.showCalendar) { - if (this.nextTask.name === 'ESM' && this.nextTask.timestamp > now) { - this.elProgress.nativeElement.style.transform = `translateY(${ - this.elFooterHeight - }px)` - this.elInfo.nativeElement.style.transform = `translateY(${ - this.elFooterHeight - }px)` - this.elFooter.nativeElement.style.transform = `translateY(${ - this.elFooterHeight - }px) scale(0)` - this.elCalendar.nativeElement.style.transform = 'translateY(0px)' - this.elCalendar.nativeElement.style.opacity = 0 - } else { - this.elProgress.nativeElement.style.transform = `translateY(${ - this.elFooterHeight - }px)` - this.elInfo.nativeElement.style.transform = `translateY(${ - this.elFooterHeight - }px)` - this.elFooter.nativeElement.style.transform = `translateY(${ - this.elFooterHeight - }px) scale(0)` - this.elCalendar.nativeElement.style.transform = 'translateY(0px)' - this.elCalendar.nativeElement.style.opacity = 0 - } - } - } - setCalendarScrollHeight(show: boolean) { if (show) { this.calendarScrollHeight = From 0ae17596edb6ae18d5538ae54cc0c68c2de6ab96 Mon Sep 17 00:00:00 2001 From: pauline <16977973+mpgxvii@users.noreply.github.com> Date: Wed, 12 Dec 2018 22:08:05 +0000 Subject: [PATCH 10/29] remove elementRef animations --- .../task-calendar.component.html | 2 +- .../task-calendar/task-calendar.component.ts | 4 +- .../task-info/task-info.component.html | 24 +++--- .../task-info/task-info.component.scss | 3 +- .../ticker-bar/ticker-bar.component.scss | 1 + .../home/containers/home-page.component.html | 7 +- .../home/containers/home-page.component.scss | 1 - .../home/containers/home-page.component.ts | 84 ++----------------- 8 files changed, 27 insertions(+), 99 deletions(-) diff --git a/src/app/pages/home/components/task-calendar/task-calendar.component.html b/src/app/pages/home/components/task-calendar/task-calendar.component.html index 3eae1f5b8..19c5754ee 100755 --- a/src/app/pages/home/components/task-calendar/task-calendar.component.html +++ b/src/app/pages/home/components/task-calendar/task-calendar.component.html @@ -3,7 +3,7 @@
= new EventEmitter() @Input() @@ -27,6 +27,7 @@ export class TaskCalendarComponent implements OnChanges { currentTime timeIndex: Promise + height constructor( private tasksService: TasksService, @@ -37,6 +38,7 @@ export class TaskCalendarComponent implements OnChanges { ngOnChanges() { this.setCurrentTime() + this.height = this.show ? 100 : 0 } getStartTime(task: Task) { diff --git a/src/app/pages/home/components/task-info/task-info.component.html b/src/app/pages/home/components/task-info/task-info.component.html index f5381e5e4..6229dc28f 100755 --- a/src/app/pages/home/components/task-info/task-info.component.html +++ b/src/app/pages/home/components/task-info/task-info.component.html @@ -14,17 +14,19 @@ id="questionnaire-progress" [@moveInProgress]="expanded" > - -
{{ current }}
+ + +
{{ current }}
+
@@ -121,10 +119,9 @@ -
-
Date: Thu, 13 Dec 2018 23:02:04 +0000 Subject: [PATCH 12/29] cleanup --- src/app/pages/home/components/task-info/task-info.component.ts | 2 -- src/app/pages/home/containers/home-page.component.html | 2 +- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/src/app/pages/home/components/task-info/task-info.component.ts b/src/app/pages/home/components/task-info/task-info.component.ts index cfede6801..18de3c6e6 100755 --- a/src/app/pages/home/components/task-info/task-info.component.ts +++ b/src/app/pages/home/components/task-info/task-info.component.ts @@ -65,8 +65,6 @@ export class TaskInfoComponent implements OnChanges { progress: TasksProgress @Input() expanded = true - @Output() - collapse: EventEmitter = new EventEmitter() hasExtraInfo: Boolean = false displayTask: Boolean = false diff --git a/src/app/pages/home/containers/home-page.component.html b/src/app/pages/home/containers/home-page.component.html index b8a5532de..c8a64c734 100755 --- a/src/app/pages/home/containers/home-page.component.html +++ b/src/app/pages/home/containers/home-page.component.html @@ -81,7 +81,7 @@ [isNow]="taskIsNow" [progress]="tasksProgress" [expanded]="!showCalendar" - (click)="displayTaskCalendar($event)" + (click)="displayTaskCalendar()" >
From c92fcb32096142273bbac012061534f8a6faf53c Mon Sep 17 00:00:00 2001 From: pauline <16977973+mpgxvii@users.noreply.github.com> Date: Thu, 13 Dec 2018 21:09:19 +0000 Subject: [PATCH 13/29] fix clinical icon --- .../components/ticker-bar/ticker-bar.component.ts | 2 ++ .../pages/home/containers/home-page.component.html | 10 ++++++---- .../pages/home/containers/home-page.component.scss | 14 ++++++++------ .../pages/home/containers/home-page.component.ts | 3 ++- 4 files changed, 18 insertions(+), 11 deletions(-) diff --git a/src/app/pages/home/components/ticker-bar/ticker-bar.component.ts b/src/app/pages/home/components/ticker-bar/ticker-bar.component.ts index 52beaaebc..6dfa1ea6c 100755 --- a/src/app/pages/home/components/ticker-bar/ticker-bar.component.ts +++ b/src/app/pages/home/components/ticker-bar/ticker-bar.component.ts @@ -17,6 +17,8 @@ export class TickerBarComponent implements OnChanges { @Input() task: Task @Input() + isNow + @Input() items: TickerItem[] = [] @Input() showAffirmation: boolean = false diff --git a/src/app/pages/home/containers/home-page.component.html b/src/app/pages/home/containers/home-page.component.html index c8a64c734..09ed1e5e5 100755 --- a/src/app/pages/home/containers/home-page.component.html +++ b/src/app/pages/home/containers/home-page.component.html @@ -49,10 +49,12 @@
diff --git a/src/app/pages/home/containers/home-page.component.scss b/src/app/pages/home/containers/home-page.component.scss index 6fd8bb7ca..0e02c3711 100755 --- a/src/app/pages/home/containers/home-page.component.scss +++ b/src/app/pages/home/containers/home-page.component.scss @@ -66,21 +66,23 @@ page-home { width: 50px; height: 50px; border-radius: 50%; + background-color: $cl-primary-60; } .clinical-1 { - bottom: 34vh; - background-color: $cl-primary-60; + bottom: 30vh; } .clinical-2 { - bottom: 20px; - background-color: $cl-primary; + bottom: 3vh; } .clinical-3 { - bottom: 18vw; - background-color: $cl-primary-60; + bottom: 8vh; + } + + .clinical-4 { + bottom: 20vh; } .icon-clinical { diff --git a/src/app/pages/home/containers/home-page.component.ts b/src/app/pages/home/containers/home-page.component.ts index 64bc27e7d..ccf2ec88c 100755 --- a/src/app/pages/home/containers/home-page.component.ts +++ b/src/app/pages/home/containers/home-page.component.ts @@ -81,6 +81,7 @@ export class HomePageComponent { } updateCurrentTask() { + this.showCompleted this.checkForNextTask() this.taskIsNow = checkTaskIsNow(this.nextTask.timestamp) } @@ -134,7 +135,7 @@ export class HomePageComponent { } displayTaskCalendar() { - this.showCalendar = !this.showCalendar + if (this.nextTask.name !== 'ESM') this.showCalendar = !this.showCalendar } openSettingsPage() { From a4d50f6f32a99783628dc0542d1fea5249921d76 Mon Sep 17 00:00:00 2001 From: pauline <16977973+mpgxvii@users.noreply.github.com> Date: Mon, 7 Jan 2019 15:03:46 +0000 Subject: [PATCH 14/29] fix css --- src/app/pages/home/containers/home-page.component.scss | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/app/pages/home/containers/home-page.component.scss b/src/app/pages/home/containers/home-page.component.scss index 0e02c3711..671ac9dfa 100755 --- a/src/app/pages/home/containers/home-page.component.scss +++ b/src/app/pages/home/containers/home-page.component.scss @@ -70,7 +70,7 @@ page-home { } .clinical-1 { - bottom: 30vh; + bottom: 34vh; } .clinical-2 { From f1a79be30ebad2c873193980d480dddbaed7ad7b Mon Sep 17 00:00:00 2001 From: pauline <16977973+mpgxvii@users.noreply.github.com> Date: Mon, 7 Jan 2019 15:59:22 +0000 Subject: [PATCH 15/29] fix task info component --- .../pages/home/components/task-info/task-info.component.html | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/app/pages/home/components/task-info/task-info.component.html b/src/app/pages/home/components/task-info/task-info.component.html index 6229dc28f..e7cc98f9c 100755 --- a/src/app/pages/home/components/task-info/task-info.component.html +++ b/src/app/pages/home/components/task-info/task-info.component.html @@ -68,10 +68,7 @@ class="text-sm" [@scaleMinutes]="expanded" > -
- : - {{ getMinutes() }} -
+
: {{ getMinutes() }}
From ee28cc370cba0274c5e3fa5eabf1fdd94ba64d61 Mon Sep 17 00:00:00 2001 From: pauline <16977973+mpgxvii@users.noreply.github.com> Date: Tue, 8 Jan 2019 12:33:18 +0000 Subject: [PATCH 16/29] fix status bar and progress --- src/app/core/containers/app.component.ts | 2 +- .../components/task-progress/task-progress.component.ts | 8 ++------ 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/src/app/core/containers/app.component.ts b/src/app/core/containers/app.component.ts index e8f92b338..9376d3c45 100755 --- a/src/app/core/containers/app.component.ts +++ b/src/app/core/containers/app.component.ts @@ -22,7 +22,7 @@ export class AppComponent { private notificationService: NotificationService ) { this.platform.ready().then(() => { - this.statusBar.styleDefault() + this.statusBar.hide() this.splashScreen.hide() this.configService.fetchConfigState(false) this.configService.migrateToLatestVersion() diff --git a/src/app/pages/home/components/task-progress/task-progress.component.ts b/src/app/pages/home/components/task-progress/task-progress.component.ts index e9bac1d88..3f330dafd 100755 --- a/src/app/pages/home/components/task-progress/task-progress.component.ts +++ b/src/app/pages/home/components/task-progress/task-progress.component.ts @@ -42,12 +42,8 @@ export class TaskProgressComponent implements OnChanges { } updateProgress() { - if (this.forceComplete || this.current >= this.max) { - this.complete = true - this.displayFireworks(800, 980) - } else { - this.complete = false - } + this.complete = this.forceComplete || this.current >= this.max + if (this.complete) this.displayFireworks(800, 980) } displayFireworks(milliDelay, milliDisplay) { From 748994fe91ad32ef78e91ab6a54a8ad9ddd5a5d1 Mon Sep 17 00:00:00 2001 From: pauline <16977973+mpgxvii@users.noreply.github.com> Date: Tue, 8 Jan 2019 17:19:14 +0000 Subject: [PATCH 17/29] fix finish page and splash page --- src/app/pages/finish/containers/finish-page.component.ts | 9 ++------- src/app/pages/splash/containers/splash-page.component.ts | 7 ++----- 2 files changed, 4 insertions(+), 12 deletions(-) diff --git a/src/app/pages/finish/containers/finish-page.component.ts b/src/app/pages/finish/containers/finish-page.component.ts index e0a82fa7c..07df91126 100755 --- a/src/app/pages/finish/containers/finish-page.component.ts +++ b/src/app/pages/finish/containers/finish-page.component.ts @@ -35,7 +35,7 @@ export class FinishPageComponent { ionViewDidLoad() { this.associatedTask = this.navParams.data.associatedTask this.content = this.navParams.data.endText - const questionnaireName: string = this.navParams.data.associatedTask.name + const questionnaireName = this.navParams.data.associatedTask.name if (!questionnaireName.includes('DEMO')) { try { if ( @@ -53,7 +53,6 @@ export class FinishPageComponent { ) .then( data => { - this.finishTaskService.updateTaskToComplete(this.associatedTask) this.sendToKafka( this.associatedTask, data, @@ -64,12 +63,8 @@ export class FinishPageComponent { console.log(JSON.stringify(error)) } ) - } else { - // This is a Demo Questionnaire. Just update to complete and do nothing else - this.finishTaskService.updateTaskToComplete( - this.navParams.data.associatedTask - ) } + this.finishTaskService.updateTaskToComplete(this.associatedTask) this.displayNextTaskReminder = !this.navParams.data.isLastTask && !this.isClinicalTask } diff --git a/src/app/pages/splash/containers/splash-page.component.ts b/src/app/pages/splash/containers/splash-page.component.ts index 55f7415f7..53e6491fe 100644 --- a/src/app/pages/splash/containers/splash-page.component.ts +++ b/src/app/pages/splash/containers/splash-page.component.ts @@ -91,15 +91,12 @@ export class SplashPageComponent { !lastUpdate ) { console.log('[SPLASH] Scheduling Notifications.') - return this.notificationService.setNextXNotifications( - DefaultNumberOfNotificationsToSchedule - ) + return this.configService.rescheduleNotifications() } else { console.log( 'Not Scheduling Notifications as ' + timeElapsed + - 'ms from last refresh is not greater' + - 'than the default Refresh interval of ' + + 'ms from last refresh is not greater than the default Refresh interval of ' + DefaultNotificationRefreshTime ) } From a3806430c61aceb4cb941e3230be79e820d11c17 Mon Sep 17 00:00:00 2001 From: pauline <16977973+mpgxvii@users.noreply.github.com> Date: Wed, 9 Jan 2019 16:47:14 +0000 Subject: [PATCH 18/29] refactor finish page and splash page and fix css --- .../containers/enrolment-page.component.scss | 5 - .../containers/finish-page.component.ts | 74 ++++--- .../finish/services/prepare-data.service.ts | 2 +- .../task-calendar.component.html | 2 +- .../task-calendar/task-calendar.component.ts | 10 +- .../home/containers/home-page.component.ts | 1 - .../containers/splash-page.component.ts | 181 +++++++----------- 7 files changed, 113 insertions(+), 162 deletions(-) diff --git a/src/app/pages/auth/containers/enrolment-page.component.scss b/src/app/pages/auth/containers/enrolment-page.component.scss index a3f0ebc2e..95fed1fed 100755 --- a/src/app/pages/auth/containers/enrolment-page.component.scss +++ b/src/app/pages/auth/containers/enrolment-page.component.scss @@ -110,9 +110,4 @@ page-enrolment { width: 320px; border-bottom: 1px solid white; } - - .scroll-content { - margin-bottom: 0 !important; - padding-bottom: 0 !important; - } } diff --git a/src/app/pages/finish/containers/finish-page.component.ts b/src/app/pages/finish/containers/finish-page.component.ts index 07df91126..d29a5f2de 100755 --- a/src/app/pages/finish/containers/finish-page.component.ts +++ b/src/app/pages/finish/containers/finish-page.component.ts @@ -16,12 +16,14 @@ import { PrepareDataService } from '../services/prepare-data.service' templateUrl: 'finish-page.component.html' }) export class FinishPageComponent { - content: string = '' - isClinicalTask: boolean = false - completedInClinic: boolean = false - displayNextTaskReminder: boolean = true - hasClickedDoneButton: boolean = false + content = '' + isClinicalTask = false + completedInClinic = false + displayNextTaskReminder = true + hasClickedDoneButton = false associatedTask + questionnaireData + constructor( public navCtrl: NavController, public navParams: NavParams, @@ -33,50 +35,45 @@ export class FinishPageComponent { ) {} ionViewDidLoad() { - this.associatedTask = this.navParams.data.associatedTask - this.content = this.navParams.data.endText - const questionnaireName = this.navParams.data.associatedTask.name - if (!questionnaireName.includes('DEMO')) { - try { - if ( - this.navParams.data['associatedTask']['protocol']['clinicalProtocol'] - ) { - this.isClinicalTask = true - } - } catch (TypeError) { - console.log('INFO: Not in clinic task/questionnaire.') - } - this.prepareDataService - .process_QuestionnaireData( - this.navParams.data.answers, - this.navParams.data.timestamps - ) - .then( - data => { - this.sendToKafka( - this.associatedTask, - data, - this.navParams.data.questions - ) - }, - error => { - console.log(JSON.stringify(error)) - } - ) - } + this.questionnaireData = this.navParams.data + this.associatedTask = this.questionnaireData.associatedTask + this.content = this.questionnaireData.endText + this.isClinicalTask = this.associatedTask.isClinical + const questionnaireName = this.associatedTask.name this.finishTaskService.updateTaskToComplete(this.associatedTask) this.displayNextTaskReminder = - !this.navParams.data.isLastTask && !this.isClinicalTask + !this.questionnaireData.isLastTask && !this.isClinicalTask + !questionnaireName.includes('DEMO') && this.processDataAndSend() + } + + processDataAndSend() { + return this.prepareDataService + .processQuestionnaireData( + this.questionnaireData.answers, + this.questionnaireData.timestamps + ) + .then( + data => { + this.sendToKafka( + this.associatedTask, + data, + this.questionnaireData.questions + ) + }, + error => { + console.log(JSON.stringify(error)) + } + ) } sendToKafka(task: Task, questionnaireData, questions) { + // NOTE: Submit data to kafka this.kafkaService.prepareTimeZoneKafkaObjectAndSend() this.kafkaService.prepareAnswerKafkaObjectAndSend( task, questionnaireData, questions ) - // NOTE: Submit data to kafka } handleClosePage() { @@ -98,6 +95,7 @@ export class FinishPageComponent { } generateClinicalTasks(tasks) { + // TODO: To be refactored and moved in next PR. let clinicalTasks = [] if (tasks) { clinicalTasks = tasks diff --git a/src/app/pages/finish/services/prepare-data.service.ts b/src/app/pages/finish/services/prepare-data.service.ts index ef31f8540..001647fa9 100755 --- a/src/app/pages/finish/services/prepare-data.service.ts +++ b/src/app/pages/finish/services/prepare-data.service.ts @@ -11,7 +11,7 @@ import { StorageKeys } from '../../../shared/enums/storage' export class PrepareDataService { constructor(public storage: StorageService) {} - process_QuestionnaireData(answers, timestamps): Promise { + processQuestionnaireData(answers, timestamps): Promise { console.log(answers) return new Promise((resolve, reject) => { // NOTE: Fetches config version and Patient ID diff --git a/src/app/pages/home/components/task-calendar/task-calendar.component.html b/src/app/pages/home/components/task-calendar/task-calendar.component.html index 19c5754ee..3bc238b8f 100755 --- a/src/app/pages/home/components/task-calendar/task-calendar.component.html +++ b/src/app/pages/home/components/task-calendar/task-calendar.component.html @@ -3,7 +3,7 @@
- height constructor( - private tasksService: TasksService, private alertCtrl: AlertController, - private translate: TranslatePipe, - private platform: Platform + private translate: TranslatePipe ) {} ngOnChanges() { this.setCurrentTime() - this.height = this.show ? 100 : 0 } getStartTime(task: Task) { diff --git a/src/app/pages/home/containers/home-page.component.ts b/src/app/pages/home/containers/home-page.component.ts index ccf2ec88c..e9d3d9329 100755 --- a/src/app/pages/home/containers/home-page.component.ts +++ b/src/app/pages/home/containers/home-page.component.ts @@ -81,7 +81,6 @@ export class HomePageComponent { } updateCurrentTask() { - this.showCompleted this.checkForNextTask() this.taskIsNow = checkTaskIsNow(this.nextTask.timestamp) } diff --git a/src/app/pages/splash/containers/splash-page.component.ts b/src/app/pages/splash/containers/splash-page.component.ts index 53e6491fe..753d6f0f0 100644 --- a/src/app/pages/splash/containers/splash-page.component.ts +++ b/src/app/pages/splash/containers/splash-page.component.ts @@ -2,13 +2,9 @@ import { Component } from '@angular/core' import { Globalization } from '@ionic-native/globalization' import { NavController, NavParams } from 'ionic-angular' -import { - DefaultNotificationRefreshTime, - DefaultNumberOfNotificationsToSchedule -} from '../../../../assets/data/defaultConfig' +import { DefaultNotificationRefreshTime } from '../../../../assets/data/defaultConfig' import { ConfigService } from '../../../core/services/config.service' import { KafkaService } from '../../../core/services/kafka.service' -import { NotificationService } from '../../../core/services/notification.service' import { StorageService } from '../../../core/services/storage.service' import { StorageKeys } from '../../../shared/enums/storage' import { EnrolmentPageComponent } from '../../auth/containers/enrolment-page.component' @@ -21,123 +17,92 @@ import { SplashService } from '../services/splash.service' }) export class SplashPageComponent { status = 'Checking enrolment...' - forceLocalStorageLookUp = true - hasParentPage = false constructor( public navCtrl: NavController, public navParams: NavParams, public storage: StorageService, private splashService: SplashService, - private notificationService: NotificationService, private globalization: Globalization, private kafka: KafkaService, private configService: ConfigService ) { - const parentPage = this.navParams.data.parentPage - if (parentPage) { - console.log(`VIEW ${parentPage}`) - this.hasParentPage = true - } + this.splashService + .evalEnrolment() + .then( + participant => + participant + ? this.onStart() + : this.navCtrl.setRoot(EnrolmentPageComponent) + ) + } - this.splashService.evalEnrolment().then(participant => { - if (!participant) { - this.navCtrl.setRoot(EnrolmentPageComponent) - } else { - this.status = 'Updating notifications...' - Promise.all([ - this.storage.get(StorageKeys.TIME_ZONE), - this.storage.get(StorageKeys.UTC_OFFSET) - ]) - .then(([timeZone, utcOffset]) => { - return this.globalization - .getDatePattern({ - formatLength: 'short', - selector: 'date and time' - }) - .then(res => { - const offset = new Date().getTimezoneOffset() - // NOTE: Cancels all notifications and reschedule tasks if timezone has changed - if (timeZone !== res.timezone || utcOffset !== offset) { - console.log( - '[SPLASH] Timezone has changed to ' + - res.timezone + - '. Cancelling notifications! Rescheduling tasks! Scheduling new notifications!' - ) - return this.storage - .set(StorageKeys.TIME_ZONE, res.timezone) - .then(() => - this.storage.set(StorageKeys.UTC_OFFSET, offset) - ) - .then(() => - this.storage.set(StorageKeys.UTC_OFFSET_PREV, utcOffset) - ) - .then(() => - this.configService.updateConfigStateOnTimezoneChange() - ) - } else { - console.log('[SPLASH] Current Timezone is ' + timeZone) - } - }) - }) - .then(() => { - // NOTE: Only run this if not run in last DefaultNotificationRefreshTime - this.storage - .get(StorageKeys.LAST_NOTIFICATION_UPDATE) - .then(lastUpdate => { - const timeElapsed = Date.now() - lastUpdate - if ( - timeElapsed > DefaultNotificationRefreshTime || - !lastUpdate - ) { - console.log('[SPLASH] Scheduling Notifications.') - return this.configService.rescheduleNotifications() - } else { - console.log( - 'Not Scheduling Notifications as ' + - timeElapsed + - 'ms from last refresh is not greater than the default Refresh interval of ' + - DefaultNotificationRefreshTime - ) - } - }) - }) - .catch(error => { - console.error(error) - console.log('[SPLASH] Notifications error.') - }) - .then(() => { - this.status = 'Sending cached answers...' - return this.kafka.sendAllAnswersInCache() - }) - .then(() => { - this.status = 'Retrieving storage...' + onStart() { + this.status = 'Updating notifications...' + return this.checkTimezoneChange() + .then(() => this.notificationsRefresh()) + .catch(error => { + console.error(error) + console.log('[SPLASH] Notifications error.') + }) + .then(() => { + this.status = 'Sending cached answers...' + return this.kafka.sendAllAnswersInCache() + }) + .catch(e => console.log('Error sending cache')) + .then(() => this.navCtrl.setRoot(HomePageComponent)) + } - if (this.hasParentPage) { - return Promise.resolve(false) - } - }) - .then(() => { - let isFirstIonDidViewLoad = true - if (this.hasParentPage) { - isFirstIonDidViewLoad = false - } - this.navCtrl.setRoot(HomePageComponent, { - isFirstIonDidViewLoad: isFirstIonDidViewLoad - }) - }) - .catch(error => { - console.log('[SPLASH] Error while sending cache.') - const isFirstIonDidViewLoad = false - this.navCtrl.setRoot(HomePageComponent, { - isFirstIonDidViewLoad: isFirstIonDidViewLoad - }) - }) - } + checkTimezoneChange() { + return Promise.all([ + this.storage.get(StorageKeys.TIME_ZONE), + this.storage.get(StorageKeys.UTC_OFFSET) + ]).then(([timezone, prevUtcOffset]) => { + return this.globalization + .getDatePattern({ + formatLength: 'short', + selector: 'date and time' + }) + .then(res => { + const utcOffset = new Date().getTimezoneOffset() + // NOTE: Cancels all notifications and reschedule tasks if timezone has changed + if (timezone !== res.timezone || prevUtcOffset !== utcOffset) { + console.log( + '[SPLASH] Timezone has changed to ' + + res.timezone + + '. Cancelling notifications! Rescheduling tasks! Scheduling new notifications!' + ) + return Promise.all([ + this.storage.set(StorageKeys.TIME_ZONE, res.timezone), + this.storage.set(StorageKeys.UTC_OFFSET, utcOffset), + this.storage.set(StorageKeys.UTC_OFFSET_PREV, prevUtcOffset) + ]).then(() => + this.configService.updateConfigStateOnTimezoneChange() + ) + } else { + console.log('[SPLASH] Current Timezone is ' + timezone) + } + }) }) } - ionViewDidLoad() { - console.log('ionViewDidLoad SplashPage') + notificationsRefresh() { + // NOTE: Only run this if not run in last DefaultNotificationRefreshTime + return this.storage + .get(StorageKeys.LAST_NOTIFICATION_UPDATE) + .then(lastUpdate => { + const timeElapsed = Date.now() - lastUpdate + if (timeElapsed > DefaultNotificationRefreshTime || !lastUpdate) { + console.log('[SPLASH] Scheduling Notifications.') + return this.configService.rescheduleNotifications() + } else { + console.log( + 'Not Scheduling Notifications as ' + + timeElapsed + + 'ms from last refresh is not greater than the default Refresh interval of ' + + DefaultNotificationRefreshTime + ) + } + }) } } From 40a171aae6a93c8e301be602dd87224a8e4be606 Mon Sep 17 00:00:00 2001 From: pauline <16977973+mpgxvii@users.noreply.github.com> Date: Thu, 10 Jan 2019 20:06:47 +0000 Subject: [PATCH 19/29] fix ticker bar component and splash page --- .../ticker-bar/ticker-bar.component.html | 12 +- .../ticker-bar/ticker-bar.component.ts | 147 ++++++------------ .../containers/splash-page.component.ts | 11 +- 3 files changed, 57 insertions(+), 113 deletions(-) diff --git a/src/app/pages/home/components/ticker-bar/ticker-bar.component.html b/src/app/pages/home/components/ticker-bar/ticker-bar.component.html index 22f7c1d8f..5e0f78898 100755 --- a/src/app/pages/home/components/ticker-bar/ticker-bar.component.html +++ b/src/app/pages/home/components/ticker-bar/ticker-bar.component.html @@ -1,13 +1,5 @@
-
-
- {{ item.tickerText1 }} - {{ item.tickerText2 }} - {{ item.tickerText3 }} -
+
+
diff --git a/src/app/pages/home/components/ticker-bar/ticker-bar.component.ts b/src/app/pages/home/components/ticker-bar/ticker-bar.component.ts index 6dfa1ea6c..abd50f89c 100755 --- a/src/app/pages/home/components/ticker-bar/ticker-bar.component.ts +++ b/src/app/pages/home/components/ticker-bar/ticker-bar.component.ts @@ -1,4 +1,4 @@ -import { Component, Input, OnChanges } from '@angular/core' +import { Component, Input, OnChanges, OnInit } from '@angular/core' import { NavController } from 'ionic-angular' import { SchedulingService } from '../../../../core/services/scheduling.service' @@ -19,53 +19,23 @@ export class TickerBarComponent implements OnChanges { @Input() isNow @Input() - items: TickerItem[] = [] - @Input() - showAffirmation: boolean = false - tickerItems: TickerItem[] - tickerIndex: number = 0 + showAffirmation = false + tickerText: string report: ReportScheduling - hasTask: boolean = true - tickerWeeklyReport: string - newWeeklyReport: boolean = false - constructor( private schedule: SchedulingService, private navCtrl: NavController, private translate: TranslatePipe - ) { - // NOTE: Gets ReportScheduling and adds to tickerItems - /*this.schedule.getCurrentReport().then((report) => { - this.report = report - })*/ - } - - ngOnChanges(changes) { - this.updateTickerItems() - if (this.tickerItems.length > 2) { - setInterval(() => { - this.iterateIndex() - }, 7500) - } - } - - showNextTickerItem() { - const style = `translateX(-${this.tickerIndex * 100}%)` - return style - } + ) {} - iterateIndex() { - this.tickerIndex += 1 - if (this.tickerIndex === this.tickerItems.length) { - this.tickerIndex = 0 - this.updateTickerItems() - } + ngOnChanges() { + this.updateTickerItem() } openReport() { this.updateReport() - this.updateTickerItems() + this.updateTickerItem() this.navCtrl.push(ReportPageComponent) } @@ -78,86 +48,71 @@ export class TickerBarComponent implements OnChanges { } } - updateTickerItems() { - this.tickerItems = [] - if (this.report) { - this.addReportAvailable() + updateTickerItem() { + if (!this.tickerText) { + return this.addTasksNone() } if (this.showAffirmation) { - this.addAffirmation() + return this.addAffirmation() } - if (this.task['timestamp'] > 0) { - this.addTask() + if (this.task) { + return this.addTask() } - if (this.tickerItems.length === 0) { - this.addTasksNone() + if (this.report) { + return this.addReportAvailable() } - this.tickerItems = this.tickerItems.concat(this.items) - this.tickerItems.push(this.tickerItems[0]) } addReportAvailable() { if (this.report) { if (this.report['viewed'] === false) { - const item = this.generateTickerItem( - 'report', - '', - 'Report available! ', - 'Click to view.' - ) - this.tickerItems.push(item) + this.tickerText = 'Report available! Click to view.' } } } addTask() { - const now = new Date() - const timeToNext = this.getTimeToNext(now.getTime(), this.task.timestamp) - let item = this.generateTickerItem( - 'task', - this.translate.transform(LocKeys.TASK_BAR_NEXT_TASK.toString()), - timeToNext, - '.' - ) - if (timeToNext.includes('-')) { - item = this.generateTickerItem( - 'task', - this.translate.transform(LocKeys.TASK_BAR_NOW_TASK.toString()), - this.translate.transform(LocKeys.STATUS_NOW.toString()), - '.' - ) - } else if (this.task.name === 'ESM') { - item = this.generateTickerItem( - 'task', - this.translate.transform(LocKeys.TASK_BAR_NOW_TASK.toString()), - this.translate.transform(LocKeys.TASK_BAR_NEXT_TASK_SOON.toString()), - '.' - ) + if (this.isNow) { + this.tickerText = + this.translate.transform(LocKeys.TASK_BAR_NOW_TASK.toString()) + + '' + + this.translate.transform(LocKeys.STATUS_NOW.toString()) + + '.' + } else { + if (this.task.name === 'ESM') { + this.tickerText = + this.translate.transform(LocKeys.TASK_BAR_NOW_TASK.toString()) + + '' + + this.translate.transform(LocKeys.TASK_BAR_NEXT_TASK_SOON.toString()) + + '.' + } else { + this.tickerText = + this.translate.transform(LocKeys.TASK_BAR_NEXT_TASK.toString()) + + '' + + this.getTimeToNext(this.task.timestamp) + + '.' + } } - this.tickerItems.push(item) } addAffirmation() { - const item = this.generateTickerItem( - 'affirmation', - '', - this.translate.transform(LocKeys.TASK_BAR_AFFIRMATION_1.toString()), + this.tickerText = + '' + + this.translate.transform(LocKeys.TASK_BAR_AFFIRMATION_1.toString()) + + '' + this.translate.transform(LocKeys.TASK_BAR_AFFIRMATION_2.toString()) - ) - this.tickerItems.push(item) } addTasksNone() { - const item = this.generateTickerItem( - 'tasks-none', - '', - this.translate.transform(LocKeys.TASK_BAR_TASK_LEFT_1.toString()), + this.tickerText = + '' + + this.translate.transform(LocKeys.TASK_BAR_TASK_LEFT_1.toString()) + + '' + this.translate.transform(LocKeys.TASK_BAR_TASK_LEFT_2.toString()) - ) - this.tickerItems.push(item) } - getTimeToNext(now, next) { + getTimeToNext(next) { + const now = new Date().getTime() let deltaStr = '' const deltaMin = Math.round((next - now) / 60000) const deltaHour = Math.round(deltaMin / 60) @@ -182,14 +137,4 @@ export class TickerBarComponent implements OnChanges { } return deltaStr } - - generateTickerItem(id, t1, t2, t3): TickerItem { - const item = { - id: String(id), - tickerText1: String(t1), - tickerText2: String(t2), - tickerText3: String(t3) - } - return item - } } diff --git a/src/app/pages/splash/containers/splash-page.component.ts b/src/app/pages/splash/containers/splash-page.component.ts index 753d6f0f0..ad6f2c43d 100644 --- a/src/app/pages/splash/containers/splash-page.component.ts +++ b/src/app/pages/splash/containers/splash-page.component.ts @@ -2,9 +2,13 @@ import { Component } from '@angular/core' import { Globalization } from '@ionic-native/globalization' import { NavController, NavParams } from 'ionic-angular' -import { DefaultNotificationRefreshTime } from '../../../../assets/data/defaultConfig' +import { + DefaultNotificationRefreshTime, + DefaultNumberOfNotificationsToSchedule +} from '../../../../assets/data/defaultConfig' import { ConfigService } from '../../../core/services/config.service' import { KafkaService } from '../../../core/services/kafka.service' +import { NotificationService } from '../../../core/services/notification.service' import { StorageService } from '../../../core/services/storage.service' import { StorageKeys } from '../../../shared/enums/storage' import { EnrolmentPageComponent } from '../../auth/containers/enrolment-page.component' @@ -23,6 +27,7 @@ export class SplashPageComponent { public navParams: NavParams, public storage: StorageService, private splashService: SplashService, + private notificationService: NotificationService, private globalization: Globalization, private kafka: KafkaService, private configService: ConfigService @@ -94,7 +99,9 @@ export class SplashPageComponent { const timeElapsed = Date.now() - lastUpdate if (timeElapsed > DefaultNotificationRefreshTime || !lastUpdate) { console.log('[SPLASH] Scheduling Notifications.') - return this.configService.rescheduleNotifications() + return this.notificationService.setNextXNotifications( + DefaultNumberOfNotificationsToSchedule + ) } else { console.log( 'Not Scheduling Notifications as ' + From 5e889d6b75a14e11122876b2c59cf60f3c306e9e Mon Sep 17 00:00:00 2001 From: pauline <16977973+mpgxvii@users.noreply.github.com> Date: Thu, 10 Jan 2019 17:21:21 +0000 Subject: [PATCH 20/29] fix task info and add meridien --- .../task-info/task-info.component.html | 55 +++++++++++-------- .../task-info/task-info.component.scss | 25 +++++++-- .../task-info/task-info.component.ts | 41 +++----------- 3 files changed, 59 insertions(+), 62 deletions(-) diff --git a/src/app/pages/home/components/task-info/task-info.component.html b/src/app/pages/home/components/task-info/task-info.component.html index e7cc98f9c..8f5f8f703 100755 --- a/src/app/pages/home/components/task-info/task-info.component.html +++ b/src/app/pages/home/components/task-info/task-info.component.html @@ -1,7 +1,4 @@ -
+
min
-
- {{ "STATUS_NOW" | translate }} +
+ + {{ "STATUS_NOW" | translate }} +
-
-
- {{ getHour() }} - +
+
+ {{ "TASK_BAR_NEXT_TASK_SOON" | translate }}
-
-
: {{ getMinutes() }}
+
+
+ {{ getHour() }} + + :{{ getMinutes() }} + {{ getMeridiem() }} + +
@@ -80,10 +87,10 @@ [@alignCenterRightExtraInfo]="expanded" > - {{ getExtraInfo() }} + {{ extraTaskInfo }}
diff --git a/src/app/pages/home/components/task-info/task-info.component.scss b/src/app/pages/home/components/task-info/task-info.component.scss index 5a8528b2e..2747ad13c 100755 --- a/src/app/pages/home/components/task-info/task-info.component.scss +++ b/src/app/pages/home/components/task-info/task-info.component.scss @@ -36,7 +36,11 @@ task-info { } .time-expanded { - margin-right: -40px; + margin-right: -12vw; + } + + .time { + margin-right: -5vw; } .text-lg { @@ -48,7 +52,6 @@ task-info { .text-md { float: left; margin-top: -2vw; - padding-right: 3vw; font-size: 14vw; } @@ -66,11 +69,11 @@ task-info { .extra-info { margin-top: -7px; text-align: center; - font-size: 18px; + font-size: 2vh; } .extra-info-icon { - height: 15px; + height: 1.5vh; } .icon-padding { @@ -80,4 +83,18 @@ task-info { .icon-sm { height: 18px; } + + .meridiem { + margin-top: 6px; + margin-left: -4vw; + writing-mode: vertical-rl; + font-size: 2.5vh; + text-orientation: upright; + } + + .min-merid { + margin-top: -5vw; + margin-bottom: -14vw; + width: 30vw; + } } diff --git a/src/app/pages/home/components/task-info/task-info.component.ts b/src/app/pages/home/components/task-info/task-info.component.ts index 18de3c6e6..97c2fc05b 100755 --- a/src/app/pages/home/components/task-info/task-info.component.ts +++ b/src/app/pages/home/components/task-info/task-info.component.ts @@ -1,11 +1,5 @@ import { animate, state, style, transition, trigger } from '@angular/animations' -import { - Component, - EventEmitter, - Input, - OnChanges, - Output -} from '@angular/core' +import { Component, Input, OnChanges } from '@angular/core' import { StorageService } from '../../../../core/services/storage.service' import { StorageKeys } from '../../../../shared/enums/storage' @@ -23,7 +17,7 @@ import { Task, TasksProgress } from '../../../../shared/models/task' trigger('scaleMinutes', [ state( 'false', - style({ transform: 'translate3d(-25%, -15%, 0) scale(0.45)' }) + style({ transform: 'translate3d(-25%, -15%, 0) scale(0.4)' }) ), state('true', style({ transform: 'translate3d(0, 0, 0) scale(1)' })), transition('* => *', animate('400ms ease')) @@ -34,7 +28,7 @@ import { Task, TasksProgress } from '../../../../shared/models/task' transition('* => *', animate('400ms ease')) ]), trigger('alignCenterRightTime', [ - state('false', style({ transform: 'translate3d(15%, 0, 0) scale(0.8)' })), + state('false', style({ transform: 'translate3d(8%, 0, 0) scale(0.8)' })), state('true', style({ transform: 'translate3d(0, 0, 0)' })), transition('* => *', animate('400ms ease')) ]), @@ -65,11 +59,10 @@ export class TaskInfoComponent implements OnChanges { progress: TasksProgress @Input() expanded = true - hasExtraInfo: Boolean = false - displayTask: Boolean = false + hasExtraInfo: boolean + extraTaskInfo: string private language: string - private extraTaskInfo: string max: number = 1 current: number = 0 @@ -83,29 +76,13 @@ export class TaskInfoComponent implements OnChanges { } ngOnChanges() { - this.checkDisplayTask() this.checkHasExtraInfo() this.updateProgress() } - checkDisplayTask() { - if (this.task['timestamp'] > 0) { - this.displayTask = true - } else { - this.displayTask = false - } - } - checkHasExtraInfo() { - if (this.task['warning'] !== '') { - this.hasExtraInfo = true - if (this.language) { - this.extraTaskInfo = this.task.warning[this.language] - this.hasExtraInfo = this.extraTaskInfo ? true : false - } - } else { - this.hasExtraInfo = false - } + this.hasExtraInfo = !!this.task.warning[this.language] + this.extraTaskInfo = this.task.warning[this.language] } updateProgress() { @@ -145,8 +122,4 @@ export class TaskInfoComponent implements OnChanges { : String(numberToFormat) return format } - - getExtraInfo() { - return this.extraTaskInfo - } } From 0782ad77c107db9c01f08b02454f8f572d43c229 Mon Sep 17 00:00:00 2001 From: pauline <16977973+mpgxvii@users.noreply.github.com> Date: Thu, 10 Jan 2019 17:22:10 +0000 Subject: [PATCH 21/29] move notaskstoday to task progress component and fix fireworks --- .../task-progress.component.html | 89 ++++++++++--------- .../task-progress.component.scss | 14 +-- .../task-progress/task-progress.component.ts | 10 +-- 3 files changed, 56 insertions(+), 57 deletions(-) diff --git a/src/app/pages/home/components/task-progress/task-progress.component.html b/src/app/pages/home/components/task-progress/task-progress.component.html index c49b68293..92a9ab792 100755 --- a/src/app/pages/home/components/task-progress/task-progress.component.html +++ b/src/app/pages/home/components/task-progress/task-progress.component.html @@ -1,60 +1,61 @@ -
- +
+
- - -
-
-
-
+
+ -
- +
+
+
-
- +
+ +
+
+
+ +
-
-
= this.max) { - this.displayFireworks(800, 980) - } - } } From f897c245f7c1d7e67c08ec451f43cb0a67476ccd Mon Sep 17 00:00:00 2001 From: pauline <16977973+mpgxvii@users.noreply.github.com> Date: Thu, 10 Jan 2019 17:22:33 +0000 Subject: [PATCH 22/29] add notaskstoday info to tickerbar --- .../ticker-bar/ticker-bar.component.ts | 32 ++++++++++--------- 1 file changed, 17 insertions(+), 15 deletions(-) diff --git a/src/app/pages/home/components/ticker-bar/ticker-bar.component.ts b/src/app/pages/home/components/ticker-bar/ticker-bar.component.ts index abd50f89c..552fe52eb 100755 --- a/src/app/pages/home/components/ticker-bar/ticker-bar.component.ts +++ b/src/app/pages/home/components/ticker-bar/ticker-bar.component.ts @@ -1,11 +1,10 @@ -import { Component, Input, OnChanges, OnInit } from '@angular/core' +import { Component, Input, OnChanges } from '@angular/core' import { NavController } from 'ionic-angular' import { SchedulingService } from '../../../../core/services/scheduling.service' import { LocKeys } from '../../../../shared/enums/localisations' import { ReportScheduling } from '../../../../shared/models/report' import { Task } from '../../../../shared/models/task' -import { TickerItem } from '../../../../shared/models/ticker' import { TranslatePipe } from '../../../../shared/pipes/translate/translate' import { ReportPageComponent } from '../../../report/containers/report-page.component' @@ -20,6 +19,8 @@ export class TickerBarComponent implements OnChanges { isNow @Input() showAffirmation = false + @Input() + noTasksToday = false tickerText: string report: ReportScheduling @@ -49,18 +50,11 @@ export class TickerBarComponent implements OnChanges { } updateTickerItem() { - if (!this.tickerText) { - return this.addTasksNone() - } - if (this.showAffirmation) { - return this.addAffirmation() - } - if (this.task) { - return this.addTask() - } - if (this.report) { - return this.addReportAvailable() - } + if (!this.tickerText) return this.addTasksRemaining() + if (this.noTasksToday) return this.addTasksNone() + if (this.showAffirmation) return this.addAffirmation() + if (this.task) return this.addTask() + if (this.report) return this.addReportAvailable() } addReportAvailable() { @@ -103,7 +97,7 @@ export class TickerBarComponent implements OnChanges { this.translate.transform(LocKeys.TASK_BAR_AFFIRMATION_2.toString()) } - addTasksNone() { + addTasksRemaining() { this.tickerText = '' + this.translate.transform(LocKeys.TASK_BAR_TASK_LEFT_1.toString()) + @@ -111,6 +105,14 @@ export class TickerBarComponent implements OnChanges { this.translate.transform(LocKeys.TASK_BAR_TASK_LEFT_2.toString()) } + addTasksNone() { + this.tickerText = + '' + + this.translate.transform(LocKeys.TASK_BAR_NO_TASK_1.toString()) + + ' ' + + this.translate.transform(LocKeys.TASK_BAR_NO_TASK_2.toString()) + } + getTimeToNext(next) { const now = new Date().getTime() let deltaStr = '' From 67f9adffdb241fdb4e551ead00fe41abef05446f Mon Sep 17 00:00:00 2001 From: pauline <16977973+mpgxvii@users.noreply.github.com> Date: Thu, 10 Jan 2019 17:23:35 +0000 Subject: [PATCH 23/29] fix home page component data functions --- .../home/containers/home-page.component.html | 19 ++--- .../home/containers/home-page.component.scss | 9 -- .../home/containers/home-page.component.ts | 84 +++++++------------ src/app/pages/home/services/tasks.service.ts | 24 ++---- 4 files changed, 43 insertions(+), 93 deletions(-) diff --git a/src/app/pages/home/containers/home-page.component.html b/src/app/pages/home/containers/home-page.component.html index 09ed1e5e5..3614d8a43 100755 --- a/src/app/pages/home/containers/home-page.component.html +++ b/src/app/pages/home/containers/home-page.component.html @@ -34,18 +34,9 @@ [progress]="tasksProgress" [forceComplete]="showCompleted" [noTasksToday]="showNoTasksToday" - *ngIf="tasksProgress && !hasOnlyESMs && !showCalendar" + *ngIf="tasksProgress && !showCalendar" > -
- -
@@ -79,6 +71,7 @@ class="size-static" >
diff --git a/src/app/pages/home/containers/home-page.component.scss b/src/app/pages/home/containers/home-page.component.scss index 671ac9dfa..9b4ac6540 100755 --- a/src/app/pages/home/containers/home-page.component.scss +++ b/src/app/pages/home/containers/home-page.component.scss @@ -92,13 +92,4 @@ page-home { width: 32px; height: 32px; } - - .icon-esm { - width: 80%; - } - - .container-esm { - margin-top: 50px; - margin-left: 16%; - } } diff --git a/src/app/pages/home/containers/home-page.component.ts b/src/app/pages/home/containers/home-page.component.ts index e9d3d9329..63d5e5168 100755 --- a/src/app/pages/home/containers/home-page.component.ts +++ b/src/app/pages/home/containers/home-page.component.ts @@ -35,16 +35,15 @@ import { TasksService } from '../services/tasks.service' }) export class HomePageComponent { tasks: Promise - nextTask: Task = DefaultTask - showCalendar: boolean = false - showCompleted: boolean = false - showNoTasksToday: boolean = false - tasksProgress: TasksProgress - startingQuestionnaire: boolean = false + nextTask: Task + showCalendar = false + showCompleted = false + showNoTasksToday = false + tasksProgress: TasksProgress = { numberOfTasks: 1, completedTasks: 0 } + startingQuestionnaire = false hasClinicalTasks = false - hasOnlyESMs = false taskIsNow = false - nextTaskIsLoading = true + checkTaskInterval constructor( public navCtrl: NavController, @@ -58,73 +57,46 @@ export class HomePageComponent { ) { this.platform.resume.subscribe(e => { this.kafka.sendAllAnswersInCache() - this.updateCurrentTask() + this.checkForNextTask() }) } - ionViewWillEnter() { + ionViewDidLoad() { this.tasks = this.tasksService.getTasksOfToday() - this.tasks.then( - tasks => (this.tasksProgress = this.tasksService.getTaskProgress(tasks)) - ) - this.showNoTasksToday = false + this.tasks.then(tasks => { + this.checkTaskInterval = setInterval(() => { + this.checkForNextTask() + }, 1000) + this.tasksProgress = this.tasksService.getTaskProgress(tasks) + this.showNoTasksToday = this.tasksProgress.numberOfTasks == 0 + }) this.startingQuestionnaire = false - } - - ionViewDidLoad() { - setInterval(() => { - this.updateCurrentTask() - }, 1000) this.evalHasClinicalTasks() - this.checkIfOnlyESM() this.tasksService.sendNonReportedTaskCompletion() } - updateCurrentTask() { - this.checkForNextTask() - this.taskIsNow = checkTaskIsNow(this.nextTask.timestamp) - } - checkForNextTask() { - if (!this.showCalendar) { - this.nextTaskIsLoading = true - this.tasks.then(tasks => - this.checkForNextTaskGeneric(this.tasksService.getNextTask(tasks)) - ) - } + this.tasks.then(tasks => + this.checkForNextTaskGeneric(this.tasksService.getNextTask(tasks)) + ) } checkForNextTaskGeneric(task) { if (task && task.isClinical == false) { this.nextTask = task this.taskIsNow = checkTaskIsNow(this.nextTask.timestamp) + this.showCompleted = !this.nextTask } else { - this.tasksService.areAllTasksComplete().then(completed => { - if (completed) { - this.nextTask = DefaultTask - this.showCompleted = true - if (!this.tasksProgress) { - this.showNoTasksToday = true - } - } else { - this.nextTask = DefaultTask + this.taskIsNow = false + this.nextTask = null + this.tasks.then(tasks => { + this.showCompleted = this.tasksService.areAllTasksComplete(tasks) + if (this.showCompleted) { + clearInterval(this.checkTaskInterval) + this.showCalendar = false } }) } - this.nextTaskIsLoading = false - } - - checkIfOnlyESM() { - this.tasks.then(tasks => { - let tmpHasOnlyESMs = true - for (let i = 0; i < tasks.length; i++) { - if (tasks[i].name !== 'ESM') { - tmpHasOnlyESMs = false - break - } - } - this.hasOnlyESMs = tmpHasOnlyESMs - }) } evalHasClinicalTasks() { @@ -134,7 +106,7 @@ export class HomePageComponent { } displayTaskCalendar() { - if (this.nextTask.name !== 'ESM') this.showCalendar = !this.showCalendar + this.showCalendar = !this.showCalendar } openSettingsPage() { diff --git a/src/app/pages/home/services/tasks.service.ts b/src/app/pages/home/services/tasks.service.ts index 5928d90e2..5791f0043 100644 --- a/src/app/pages/home/services/tasks.service.ts +++ b/src/app/pages/home/services/tasks.service.ts @@ -42,23 +42,17 @@ export class TasksService { } } - getNextTask(tasks) { - return this.retrieveNextTask(tasks) - } - - areAllTasksComplete() { - return this.getTasksOfToday().then((tasks: Task[]) => { - if (tasks) { - for (let i = 0; i < tasks.length; i++) { - if (tasks[i].name !== 'ESM' && tasks[i].isClinical == false) { - if (tasks[i].completed === false) { - return false - } + areAllTasksComplete(tasks) { + if (tasks) { + for (let i = 0; i < tasks.length; i++) { + if (tasks[i].name !== 'ESM' && tasks[i].isClinical == false) { + if (tasks[i].completed === false) { + return false } } } - return true - }) + } + return true } isLastTask(task, todaysTasks) { @@ -82,7 +76,7 @@ export class TasksService { * @returns {@link Task} : The next incomplete task from the list. This essentially * translates to which questionnaire the `START` button on home page corresponds to. */ - retrieveNextTask(tasks: Task[]): Task { + getNextTask(tasks: Task[]): Task { if (tasks) { const now = new Date() const offsetTimeESM = 1000 * 60 * 10 // 10 min From 4a9e145b9fa17ea19ea26174cdf92f5e02040649 Mon Sep 17 00:00:00 2001 From: pauline <16977973+mpgxvii@users.noreply.github.com> Date: Fri, 11 Jan 2019 12:39:26 +0000 Subject: [PATCH 24/29] fix home page animation easing --- src/app/pages/home/containers/home-page.component.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/app/pages/home/containers/home-page.component.ts b/src/app/pages/home/containers/home-page.component.ts index 63d5e5168..c365db7e2 100755 --- a/src/app/pages/home/containers/home-page.component.ts +++ b/src/app/pages/home/containers/home-page.component.ts @@ -29,7 +29,7 @@ import { TasksService } from '../services/tasks.service' trigger('displayCalendar', [ state('true', style({ transform: 'translateY(0%)' })), state('false', style({ transform: 'translateY(100%)' })), - transition('*=>*', animate('300ms')) + transition('*=>*', animate('300ms ease-out')) ]) ] }) From de52db5a05c21dc6266117969f018741c891f5d9 Mon Sep 17 00:00:00 2001 From: pauline <16977973+mpgxvii@users.noreply.github.com> Date: Mon, 14 Jan 2019 17:09:58 +0000 Subject: [PATCH 25/29] fix: update version and minor fix --- config.xml | 188 +++++++++--------- .../home/containers/home-page.component.ts | 5 +- 2 files changed, 97 insertions(+), 96 deletions(-) diff --git a/config.xml b/config.xml index c1821a81c..6f08d617b 100755 --- a/config.xml +++ b/config.xml @@ -1,97 +1,95 @@ - - RADAR Questionnaire - An application that collects active data for research. - RADAR-CNS - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + RADAR Questionnaire + An application that collects active data for research. + RADAR-CNS + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/app/pages/home/containers/home-page.component.ts b/src/app/pages/home/containers/home-page.component.ts index c365db7e2..2cb3eedbf 100755 --- a/src/app/pages/home/containers/home-page.component.ts +++ b/src/app/pages/home/containers/home-page.component.ts @@ -61,6 +61,10 @@ export class HomePageComponent { }) } + ionViewWillEnter() { + this.startingQuestionnaire = false + } + ionViewDidLoad() { this.tasks = this.tasksService.getTasksOfToday() this.tasks.then(tasks => { @@ -70,7 +74,6 @@ export class HomePageComponent { this.tasksProgress = this.tasksService.getTaskProgress(tasks) this.showNoTasksToday = this.tasksProgress.numberOfTasks == 0 }) - this.startingQuestionnaire = false this.evalHasClinicalTasks() this.tasksService.sendNonReportedTaskCompletion() } From aa09299a59657dba9476b297380c8964ad23d794 Mon Sep 17 00:00:00 2001 From: pauline <16977973+mpgxvii@users.noreply.github.com> Date: Mon, 14 Jan 2019 17:36:42 +0000 Subject: [PATCH 26/29] fix translation --- src/assets/data/localisations.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/assets/data/localisations.ts b/src/assets/data/localisations.ts index 1ee85df8c..788fd2df0 100644 --- a/src/assets/data/localisations.ts +++ b/src/assets/data/localisations.ts @@ -441,8 +441,8 @@ export const Localisations = { BTN_FINISH: { da: 'Afslut', de: 'Fertig', - en: 'Finalizado', - es: 'Terminar', + en: 'Finish', + es: 'Finalizado', it: 'Fine', nl: 'Voltooid' }, From e424d2a9fec12d4f657649b0a9213f4579e56496 Mon Sep 17 00:00:00 2001 From: pauline <16977973+mpgxvii@users.noreply.github.com> Date: Mon, 14 Jan 2019 23:10:17 +0000 Subject: [PATCH 27/29] fix animations and answerService reset --- .../components/task-progress/task-progress.component.scss | 1 - .../pages/home/components/ticker-bar/ticker-bar.component.ts | 2 +- src/app/pages/home/containers/home-page.component.html | 1 + src/app/pages/home/containers/home-page.component.scss | 1 - src/app/pages/home/containers/home-page.component.ts | 5 +++++ .../pages/questions/containers/questions-page.component.ts | 4 ++-- 6 files changed, 9 insertions(+), 5 deletions(-) diff --git a/src/app/pages/home/components/task-progress/task-progress.component.scss b/src/app/pages/home/components/task-progress/task-progress.component.scss index 22c6043c0..744b455cb 100755 --- a/src/app/pages/home/components/task-progress/task-progress.component.scss +++ b/src/app/pages/home/components/task-progress/task-progress.component.scss @@ -182,7 +182,6 @@ task-progress { .counter { margin-top: -34vw; text-align: center; - transition: transform 0.4s ease-in-out; } .large { diff --git a/src/app/pages/home/components/ticker-bar/ticker-bar.component.ts b/src/app/pages/home/components/ticker-bar/ticker-bar.component.ts index 552fe52eb..662af4ec1 100755 --- a/src/app/pages/home/components/ticker-bar/ticker-bar.component.ts +++ b/src/app/pages/home/components/ticker-bar/ticker-bar.component.ts @@ -93,7 +93,7 @@ export class TickerBarComponent implements OnChanges { this.tickerText = '' + this.translate.transform(LocKeys.TASK_BAR_AFFIRMATION_1.toString()) + - '' + + ' ' + this.translate.transform(LocKeys.TASK_BAR_AFFIRMATION_2.toString()) } diff --git a/src/app/pages/home/containers/home-page.component.html b/src/app/pages/home/containers/home-page.component.html index 3614d8a43..b39d837d1 100755 --- a/src/app/pages/home/containers/home-page.component.html +++ b/src/app/pages/home/containers/home-page.component.html @@ -29,6 +29,7 @@
*', animate('300ms ease-out')) + ]), + trigger('moveProgress', [ + state('true', style({ transform: 'translateY(-100%)' })), + state('false', style({ transform: 'translateY(0%)' })), + transition('*=>*', animate('300ms ease-out')) ]) ] }) diff --git a/src/app/pages/questions/containers/questions-page.component.ts b/src/app/pages/questions/containers/questions-page.component.ts index df14e21d7..0474d3ed3 100755 --- a/src/app/pages/questions/containers/questions-page.component.ts +++ b/src/app/pages/questions/containers/questions-page.component.ts @@ -81,6 +81,8 @@ export class QuestionsPageComponent { this.associatedTask = this.navParams.data.associatedTask this.endText = this.navParams.data.endText this.isLastTask = this.navParams.data.isLastTask + this.answerService.reset() + this.timestampService.reset() } evalIfFirstQuestionnaireToSkipESMSleepQuestion() { @@ -198,8 +200,6 @@ export class QuestionsPageComponent { navigateToFinishPage() { this.answers = this.answerService.answers this.timestamps = this.timestampService.timestamps - this.answerService.reset() - this.timestampService.reset() this.navCtrl.push(FinishPageComponent, { endText: this.endText, From 9ce716fe36408f03bd77564872d29e15c7125de8 Mon Sep 17 00:00:00 2001 From: pauline <16977973+mpgxvii@users.noreply.github.com> Date: Tue, 15 Jan 2019 12:55:18 +0000 Subject: [PATCH 28/29] fix: cache --- src/app/core/services/kafka.service.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/src/app/core/services/kafka.service.ts b/src/app/core/services/kafka.service.ts index 71b8e682b..62483d5cc 100755 --- a/src/app/core/services/kafka.service.ts +++ b/src/app/core/services/kafka.service.ts @@ -210,6 +210,7 @@ export class KafkaService { cacheAnswers(specs) { const kafkaObject = specs.kafkaObject this.storage.get(StorageKeys.CACHE_ANSWERS).then(cache => { + if (!cache) cache = {} console.log('KAFKA-SERVICE: Caching answers.') cache[kafkaObject.value.time] = specs this.storage.set(StorageKeys.CACHE_ANSWERS, cache) From 74939fb703add15035153851934f34ee23d1a50d Mon Sep 17 00:00:00 2001 From: pauline <16977973+mpgxvii@users.noreply.github.com> Date: Wed, 16 Jan 2019 18:16:04 +0300 Subject: [PATCH 29/29] fix: cache and timezone --- src/app/core/services/kafka.service.ts | 33 ++++++------- src/app/core/services/storage.service.ts | 11 ++++- .../containers/splash-page.component.ts | 49 +++++++------------ 3 files changed, 42 insertions(+), 51 deletions(-) diff --git a/src/app/core/services/kafka.service.ts b/src/app/core/services/kafka.service.ts index 62483d5cc..5fb075eb7 100755 --- a/src/app/core/services/kafka.service.ts +++ b/src/app/core/services/kafka.service.ts @@ -210,7 +210,6 @@ export class KafkaService { cacheAnswers(specs) { const kafkaObject = specs.kafkaObject this.storage.get(StorageKeys.CACHE_ANSWERS).then(cache => { - if (!cache) cache = {} console.log('KAFKA-SERVICE: Caching answers.') cache[kafkaObject.value.time] = specs this.storage.set(StorageKeys.CACHE_ANSWERS, cache) @@ -221,33 +220,29 @@ export class KafkaService { if (!this.cacheSending) { this.cacheSending = !this.cacheSending this.sendToKafkaFromCache() - .then(() => (this.cacheSending = !this.cacheSending)) .catch(e => console.log('Cache could not be sent.')) + .then(() => (this.cacheSending = !this.cacheSending)) } } sendToKafkaFromCache() { return this.storage.get(StorageKeys.CACHE_ANSWERS).then(cache => { - if (!cache) { - return this.storage.set(StorageKeys.CACHE_ANSWERS, {}) - } else { - const promises = [] - let noOfTasks = 0 - for (const answerKey in cache) { - if (answerKey) { - const cacheObject = cache[answerKey] - promises.push(this.createPayloadAndSend(cacheObject)) - noOfTasks += 1 - if (noOfTasks === 20) { - break - } + const promises = [] + let noOfTasks = 0 + for (const answerKey in cache) { + if (answerKey) { + const cacheObject = cache[answerKey] + promises.push(this.createPayloadAndSend(cacheObject)) + noOfTasks += 1 + if (noOfTasks === 20) { + break } } - return Promise.all(promises).then(res => { - console.log(res) - return Promise.resolve(res) - }) } + return Promise.all(promises).then(res => { + console.log(res) + return Promise.resolve(res) + }) }) } diff --git a/src/app/core/services/storage.service.ts b/src/app/core/services/storage.service.ts index 048a02caf..8ce969c80 100755 --- a/src/app/core/services/storage.service.ts +++ b/src/app/core/services/storage.service.ts @@ -74,6 +74,11 @@ export class StorageService { StorageKeys.SCHEDULE_VERSION, DefaultScheduleVersion ) + const utc = this.set( + StorageKeys.UTC_OFFSET, + new Date().getTimezoneOffset() + ) + const cache = this.set(StorageKeys.CACHE_ANSWERS, {}) return Promise.all([ pId, @@ -84,7 +89,11 @@ export class StorageService { notif, report, langs, - version + version, + utc, + cache, + enrolmentDate, + referenceDate ]) } }) diff --git a/src/app/pages/splash/containers/splash-page.component.ts b/src/app/pages/splash/containers/splash-page.component.ts index ad6f2c43d..f45bcb325 100644 --- a/src/app/pages/splash/containers/splash-page.component.ts +++ b/src/app/pages/splash/containers/splash-page.component.ts @@ -1,5 +1,4 @@ import { Component } from '@angular/core' -import { Globalization } from '@ionic-native/globalization' import { NavController, NavParams } from 'ionic-angular' import { @@ -28,7 +27,6 @@ export class SplashPageComponent { public storage: StorageService, private splashService: SplashService, private notificationService: NotificationService, - private globalization: Globalization, private kafka: KafkaService, private configService: ConfigService ) { @@ -59,35 +57,24 @@ export class SplashPageComponent { } checkTimezoneChange() { - return Promise.all([ - this.storage.get(StorageKeys.TIME_ZONE), - this.storage.get(StorageKeys.UTC_OFFSET) - ]).then(([timezone, prevUtcOffset]) => { - return this.globalization - .getDatePattern({ - formatLength: 'short', - selector: 'date and time' - }) - .then(res => { - const utcOffset = new Date().getTimezoneOffset() - // NOTE: Cancels all notifications and reschedule tasks if timezone has changed - if (timezone !== res.timezone || prevUtcOffset !== utcOffset) { - console.log( - '[SPLASH] Timezone has changed to ' + - res.timezone + - '. Cancelling notifications! Rescheduling tasks! Scheduling new notifications!' - ) - return Promise.all([ - this.storage.set(StorageKeys.TIME_ZONE, res.timezone), - this.storage.set(StorageKeys.UTC_OFFSET, utcOffset), - this.storage.set(StorageKeys.UTC_OFFSET_PREV, prevUtcOffset) - ]).then(() => - this.configService.updateConfigStateOnTimezoneChange() - ) - } else { - console.log('[SPLASH] Current Timezone is ' + timezone) - } - }) + return this.storage.get(StorageKeys.UTC_OFFSET).then(prevUtcOffset => { + const utcOffset = new Date().getTimezoneOffset() + // NOTE: Cancels all notifications and reschedule tasks if timezone has changed + if (prevUtcOffset !== utcOffset) { + console.log( + '[SPLASH] Timezone has changed to ' + + utcOffset + + '. Cancelling notifications! Rescheduling tasks! Scheduling new notifications!' + ) + return this.storage + .set(StorageKeys.UTC_OFFSET, utcOffset) + .then(() => + this.storage.set(StorageKeys.UTC_OFFSET_PREV, prevUtcOffset) + ) + .then(() => this.configService.updateConfigStateOnTimezoneChange()) + } else { + console.log('[SPLASH] Current Timezone is ' + utcOffset) + } }) }