From 29b200fa19fc4f4729342e34b2e2dee5858ad8c0 Mon Sep 17 00:00:00 2001 From: mpgxvii Date: Mon, 11 Jul 2022 23:12:35 +0100 Subject: [PATCH 1/5] feat: add user attributes to appserver --- .../services/app-server/app-server.service.ts | 22 ++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/src/app/core/services/app-server/app-server.service.ts b/src/app/core/services/app-server/app-server.service.ts index e7de6585e..83ea1beeb 100644 --- a/src/app/core/services/app-server/app-server.service.ts +++ b/src/app/core/services/app-server/app-server.service.ts @@ -41,15 +41,17 @@ export class AppServerService { this.subjectConfig.getParticipantLogin(), this.subjectConfig.getProjectName(), this.subjectConfig.getEnrolmentDate(), + this.subjectConfig.getParticipantAttributes(), this.getFCMToken() ]) ) - .then(([subjectId, projectId, enrolmentDate, fcmToken]) => + .then(([subjectId, projectId, enrolmentDate, attributes, fcmToken]) => this.addProjectIfMissing(projectId).then(() => this.addSubjectIfMissing( subjectId, projectId, enrolmentDate, + attributes, fcmToken ) ) @@ -117,6 +119,7 @@ export class AppServerService { subjectId, projectId, enrolmentDate, + attributes, fcmToken ): Promise { // NOTE: Adds subject if missing, updates subject if it exists @@ -126,7 +129,8 @@ export class AppServerService { fcmToken, lastOpened: new Date(), timezone: moment.tz.guess(), - language: this.localization.getLanguage().value + language: this.localization.getLanguage().value, + attributes }) ) .catch(e => { @@ -135,13 +139,20 @@ export class AppServerService { subjectId, projectId, enrolmentDate, - fcmToken + fcmToken, + attributes ) else throw e }) } - addSubjectToServer(subjectId, projectId, enrolmentDate, fcmToken) { + addSubjectToServer( + subjectId, + projectId, + enrolmentDate, + fcmToken, + attributes + ) { return this.getHeaders().then(headers => this.http .post( @@ -157,7 +168,8 @@ export class AppServerService { subjectId, fcmToken, timezone: moment.tz.guess(), - language: this.localization.getLanguage().value + language: this.localization.getLanguage().value, + attributes }, { headers, params: { forceFcmToken: 'true' } } ) From d01362482b8f7700b75ef764d0e2905047f0fc99 Mon Sep 17 00:00:00 2001 From: mpgxvii Date: Tue, 12 Jul 2022 11:50:46 +0100 Subject: [PATCH 2/5] fix: add types to subject config service --- .../core/services/config/subject-config.service.ts | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/app/core/services/config/subject-config.service.ts b/src/app/core/services/config/subject-config.service.ts index b3aa3eaa8..1cbabe322 100644 --- a/src/app/core/services/config/subject-config.service.ts +++ b/src/app/core/services/config/subject-config.service.ts @@ -74,31 +74,31 @@ export class SubjectConfigService { return this.storage.set(this.SUBJECT_CONFIG_STORE.BASE_URI, uri) } - getParticipantID() { + getParticipantID(): Promise { return this.storage.get(this.SUBJECT_CONFIG_STORE.PARTICIPANTID) } - getEnrolmentDate() { + getEnrolmentDate(): Promise { return this.storage.get(this.SUBJECT_CONFIG_STORE.ENROLMENTDATE) } - getProjectName() { + getProjectName(): Promise { return this.storage.get(this.SUBJECT_CONFIG_STORE.PROJECTNAME) } - getSourceID() { + getSourceID(): Promise { return this.storage.get(this.SUBJECT_CONFIG_STORE.SOURCEID) } - getParticipantLogin() { + getParticipantLogin(): Promise { return this.storage.get(this.SUBJECT_CONFIG_STORE.PARTICIPANTLOGIN) } - getParticipantAttributes() { + getParticipantAttributes(): Promise> { return this.storage.get(this.SUBJECT_CONFIG_STORE.PARTICIPANT_ATTRIBUTES) } - getBaseUrl() { + getBaseUrl(): Promise { return this.storage.get(this.SUBJECT_CONFIG_STORE.BASE_URI) } From 7415de709d1746c2aeb7365905199343ab59b0db Mon Sep 17 00:00:00 2001 From: mpgxvii Date: Tue, 12 Jul 2022 13:34:34 +0100 Subject: [PATCH 3/5] fix: subject config service --- src/app/core/services/config/subject-config.service.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/app/core/services/config/subject-config.service.ts b/src/app/core/services/config/subject-config.service.ts index 1cbabe322..736324c30 100644 --- a/src/app/core/services/config/subject-config.service.ts +++ b/src/app/core/services/config/subject-config.service.ts @@ -90,7 +90,7 @@ export class SubjectConfigService { return this.storage.get(this.SUBJECT_CONFIG_STORE.SOURCEID) } - getParticipantLogin(): Promise { + getParticipantLogin() { return this.storage.get(this.SUBJECT_CONFIG_STORE.PARTICIPANTLOGIN) } From d9a4f9497414c0350dc576392fe759515fff6c84 Mon Sep 17 00:00:00 2001 From: Pauline Conde Date: Tue, 2 Aug 2022 13:18:36 +0100 Subject: [PATCH 4/5] fix: incorrect localisation key --- src/app/shared/enums/localisations.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/app/shared/enums/localisations.ts b/src/app/shared/enums/localisations.ts index 122ce17a8..955b454f0 100644 --- a/src/app/shared/enums/localisations.ts +++ b/src/app/shared/enums/localisations.ts @@ -168,7 +168,7 @@ export class LocKeys { static CONFIG_ERROR_DESC = new LocKeys('CONFIG_ERROR_DESC') static AUDIO_TASK_ALERT = new LocKeys('AUDIO_TASK_ALERT') static AUDIO_TASK_ALERT_DESC = new LocKeys('AUDIO_TASK_ALERT_DESC') - static AUDIO_TASK_BUTTON_ALERT_DESC = new LocKeys('AUDIO_TASK_ALERT_DESC') + static AUDIO_TASK_BUTTON_ALERT_DESC = new LocKeys('AUDIO_TASK_BUTTON_ALERT_DESC') static AUDIO_TASK_ATTEMPT_ALERT = new LocKeys('AUDIO_TASK_ATTEMPT_ALERT') static AUDIO_TASK_HAPPY_ALERT = new LocKeys('AUDIO_TASK_HAPPY_ALERT') static SPLASH_STATUS_UPDATING_CONFIG = new LocKeys( From a89cf7e598a8a8e782b72e450e1e0d38f1ef75f8 Mon Sep 17 00:00:00 2001 From: Pauline Conde Date: Mon, 15 Aug 2022 19:14:27 +0800 Subject: [PATCH 5/5] chore: bump versions --- config.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config.xml b/config.xml index 3cbc6ec8e..eb723a609 100755 --- a/config.xml +++ b/config.xml @@ -1,5 +1,5 @@ - + RADAR Questionnaire An application that collects active data for research. RADAR-Base