Skip to content

Commit

Permalink
Merge pull request #1536 from RADAR-base/release-2.5.1
Browse files Browse the repository at this point in the history
Release 2.5.1
  • Loading branch information
mpgxvii committed Aug 16, 2022
2 parents 4931629 + a224ffa commit 827d58c
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 13 deletions.
2 changes: 1 addition & 1 deletion config.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version='1.0' encoding='utf-8'?>
<widget android-versionCode="568" id="org.phidatalab.radar_armt" ios-CFBundleIdentifier="org.phidatalab.radar-armt" ios-CFBundleVersion="1" version="2.5.1-alpha" xmlns:android="http://schemas.android.com/apk/res/android">
<widget android-versionCode="569" id="org.phidatalab.radar_armt" ios-CFBundleIdentifier="org.phidatalab.radar-armt" ios-CFBundleVersion="1" version="2.5.1" xmlns:android="http://schemas.android.com/apk/res/android">
<name>RADAR Questionnaire</name>
<description>An application that collects active data for research.</description>
<author email="radar-base@kcl.ac.uk" href="http://radar-base.org/">RADAR-Base</author>
Expand Down
22 changes: 17 additions & 5 deletions src/app/core/services/app-server/app-server.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
)
)
Expand Down Expand Up @@ -117,6 +119,7 @@ export class AppServerService {
subjectId,
projectId,
enrolmentDate,
attributes,
fcmToken
): Promise<any> {
// NOTE: Adds subject if missing, updates subject if it exists
Expand All @@ -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 => {
Expand All @@ -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(
Expand All @@ -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' } }
)
Expand Down
12 changes: 6 additions & 6 deletions src/app/core/services/config/subject-config.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,31 +74,31 @@ export class SubjectConfigService {
return this.storage.set(this.SUBJECT_CONFIG_STORE.BASE_URI, uri)
}

getParticipantID() {
getParticipantID(): Promise<String> {
return this.storage.get(this.SUBJECT_CONFIG_STORE.PARTICIPANTID)
}

getEnrolmentDate() {
getEnrolmentDate(): Promise<Number> {
return this.storage.get(this.SUBJECT_CONFIG_STORE.ENROLMENTDATE)
}

getProjectName() {
getProjectName(): Promise<String> {
return this.storage.get(this.SUBJECT_CONFIG_STORE.PROJECTNAME)
}

getSourceID() {
getSourceID(): Promise<String> {
return this.storage.get(this.SUBJECT_CONFIG_STORE.SOURCEID)
}

getParticipantLogin() {
return this.storage.get(this.SUBJECT_CONFIG_STORE.PARTICIPANTLOGIN)
}

getParticipantAttributes() {
getParticipantAttributes(): Promise<Map<String, String>> {
return this.storage.get(this.SUBJECT_CONFIG_STORE.PARTICIPANT_ATTRIBUTES)
}

getBaseUrl() {
getBaseUrl(): Promise<String> {
return this.storage.get(this.SUBJECT_CONFIG_STORE.BASE_URI)
}

Expand Down
2 changes: 1 addition & 1 deletion src/app/shared/enums/localisations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down

0 comments on commit 827d58c

Please sign in to comment.