Skip to content

Commit

Permalink
Merge pull request #1730 from RADAR-base/release-3.2.0-alpha
Browse files Browse the repository at this point in the history
Release 3.2.0-alpha
  • Loading branch information
mpgxvii authored Sep 15, 2023
2 parents ece25ae + 53438f6 commit 701c5e5
Show file tree
Hide file tree
Showing 86 changed files with 1,781 additions and 842 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="581" id="org.phidatalab.radar_armt" ios-CFBundleIdentifier="org.phidatalab.radar-armt" ios-CFBundleVersion="1" version="3.1.0-alpha" xmlns:android="http://schemas.android.com/apk/res/android">
<widget android-versionCode="582" id="org.phidatalab.radar_armt" ios-CFBundleIdentifier="org.phidatalab.radar-armt" ios-CFBundleVersion="1" version="3.2.0-alpha" 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
49 changes: 43 additions & 6 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "radar-questionnaire",
"description": "An application that collects active data for research.",
"version": "3.0.0",
"version": "3.2.0",
"author": "RADAR Base",
"homepage": "http://www.radar-base.org/",
"scripts": {
Expand Down Expand Up @@ -114,6 +114,7 @@
"moment-timezone": "^0.5.40",
"morph-expressions": "^1.1.1",
"ngx-moment": "^5.0.0",
"pako": "^2.1.0",
"path": "^0.12.7",
"phonegap-plugin-barcodescanner": "^8.1.0",
"phonegap-plugin-mobile-accessibility": "^1.0.5",
Expand Down
7 changes: 3 additions & 4 deletions publishing_script.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
ionic cordova build --release android
ionic cordova build android --release -- -- --packageType=apk

~/Library/Android/sdk/build-tools/28.0.3/zipalign -v 4 platforms/android/app/build/outputs/apk/release/app-release-unsigned.apk ~/Downloads/radar-armt-app-zipaligned.apk

~/Library/Android/sdk/build-tools/28.0.3/apksigner sign -v --out ~/Downloads/radar-armt-app-$1.apk --ks ~/Downloads/radar-armt-release-key.keystore --ks-key-alias alias_name ~/Downloads/radar-armt-app-zipaligned.apk
~/Library/Android/sdk/build-tools/32.0.0/zipalign -v 4 platforms/android/app/build/outputs/apk/release/app-release-unsigned.apk ~/Downloads/radar-armt-app-zipaligned.apk

~/Library/Android/sdk/build-tools/32.0.0/apksigner sign -v --out ~/Downloads/radar-armt-app-$1.apk --ks ~/Downloads/radar-armt-release-key.keystore --ks-key-alias alias_name ~/Downloads/radar-armt-app-zipaligned.apk
5 changes: 5 additions & 0 deletions src/app/app-routing.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,11 @@ const routes: Routes = [
m => m.ClinicalTasksModule
)
},
{
path: 'on-demand',
loadChildren: () =>
import('./pages/on-demand/on-demand.module').then(m => m.OnDemandModule)
},
{
path: 'settings',
loadChildren: () =>
Expand Down
23 changes: 22 additions & 1 deletion src/app/app.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,15 @@ import {
RemoteConfigService
} from './core/services/config/remote-config.service'
import { SubjectConfigService } from './core/services/config/subject-config.service'
import { CacheService } from './core/services/kafka/cache.service'
import { AppEventConverterService } from './core/services/kafka/converters/app-event-converter.service'
import { AssessmentConverterService } from './core/services/kafka/converters/assessment-converter.service'
import { CompletionLogConverterService } from './core/services/kafka/converters/completion-log-converter.service'
import { ConverterFactoryService } from './core/services/kafka/converters/converter-factory.service.'
import { ConverterService } from './core/services/kafka/converters/converter.service'
import { HealthkitConverterService } from './core/services/kafka/converters/healthkit-converter.service'
import { KeyConverterService } from './core/services/kafka/converters/key-converter.service'
import { TimezoneConverterService } from './core/services/kafka/converters/timezone-converter.service'
import { KafkaService } from './core/services/kafka/kafka.service'
import { SchemaService } from './core/services/kafka/schema.service'
import { AlertService } from './core/services/misc/alert.service'
Expand All @@ -58,6 +67,8 @@ import { LocalScheduleService } from './core/services/schedule/local-schedule.se
import { ScheduleFactoryService } from './core/services/schedule/schedule-factory.service'
import { ScheduleGeneratorService } from './core/services/schedule/schedule-generator.service'
import { ScheduleService } from './core/services/schedule/schedule.service'
import { GlobalStorageService } from './core/services/storage/global-storage.service'
import { HealthStorageService } from './core/services/storage/health-storage.service'
import { StorageService } from './core/services/storage/storage.service'
import { TokenService } from './core/services/token/token.service'
import { AnalyticsService } from './core/services/usage/analytics.service'
Expand Down Expand Up @@ -137,10 +148,20 @@ import { Utility } from './shared/utilities/util'
KafkaService,
LocalizationService,
ScheduleGeneratorService,
StorageService,
GlobalStorageService,
HealthStorageService,
{ provide: StorageService, useClass: GlobalStorageService },
TranslatePipe,
UsageService,
SchemaService,
ConverterFactoryService,
AssessmentConverterService,
AppEventConverterService,
CompletionLogConverterService,
TimezoneConverterService,
KeyConverterService,
HealthkitConverterService,
CacheService,
NotificationGeneratorService,
FcmRestNotificationService,
LocalNotificationService,
Expand Down
32 changes: 21 additions & 11 deletions src/app/core/services/app-server/app-server.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ import {
} from '@angular/common/http'
import { Injectable } from '@angular/core'
import * as moment from 'moment-timezone'
import { Subscription } from 'rxjs'
import { filter } from 'rxjs/operators'
import * as urljoin from 'url-join'

import {
Expand All @@ -24,10 +26,8 @@ import { RemoteConfigService } from '../config/remote-config.service'
import { SubjectConfigService } from '../config/subject-config.service'
import { LocalizationService } from '../misc/localization.service'
import { LogService } from '../misc/log.service'
import { StorageService } from '../storage/storage.service'
import { GlobalStorageService } from '../storage/global-storage.service'
import { TokenService } from '../token/token.service'
import { filter } from "rxjs/operators";
import { Subscription } from "rxjs";

@Injectable()
export class AppServerService {
Expand All @@ -43,7 +43,7 @@ export class AppServerService {
private tokenSubscription: Subscription = null

constructor(
public storage: StorageService,
public storage: GlobalStorageService,
public subjectConfig: SubjectConfigService,
public logger: LogService,
public remoteConfig: RemoteConfigService,
Expand All @@ -66,24 +66,34 @@ export class AppServerService {
)
.then(([subjectId, projectId, enrolmentDate, attributes, fcmToken]) =>
this.addProjectIfMissing(projectId)
.then(() => this.addSubjectIfMissing(
.then(() =>
this.addSubjectIfMissing(
subjectId,
projectId,
enrolmentDate,
attributes,
fcmToken
)
).then(httpRes => {
)
.then(httpRes => {
if (this.tokenSubscription !== null) {
this.tokenSubscription.unsubscribe();
this.tokenSubscription.unsubscribe()
}
this.tokenSubscription = this.storage.observe(StorageKeys.FCM_TOKEN)
this.tokenSubscription = this.storage
.observe(StorageKeys.FCM_TOKEN)
.pipe(filter(t => t && t !== fcmToken))
.subscribe(newFcmToken =>
this.addSubjectIfMissing(subjectId, projectId, enrolmentDate, attributes, newFcmToken))
return httpRes;
this.addSubjectIfMissing(
subjectId,
projectId,
enrolmentDate,
attributes,
newFcmToken
)
)
return httpRes
})
);
)
}

getHeaders() {
Expand Down
3 changes: 2 additions & 1 deletion src/app/core/services/config/app-config.service.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import {
AppVersionMock,
StorageServiceMock
} from '../../../shared/testing/mock-services'
import { GlobalStorageService } from '../storage/global-storage.service'
import { StorageService } from '../storage/storage.service'
import { AppConfigService } from './app-config.service'

Expand All @@ -16,7 +17,7 @@ describe('AppConfigService', () => {
providers: [
AppConfigService,
{ provide: AppVersion, useClass: AppVersionMock },
{ provide: StorageService, useClass: StorageServiceMock }
{ provide: GlobalStorageService, useClass: StorageServiceMock }
]
})
)
Expand Down
6 changes: 5 additions & 1 deletion src/app/core/services/config/app-config.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import {
} from '../../../../assets/data/defaultConfig'
import { StorageKeys } from '../../../shared/enums/storage'
import { setDateTimeToMidnightEpoch } from '../../../shared/utilities/time'
import { GlobalStorageService } from '../storage/global-storage.service'
import { StorageService } from '../storage/storage.service'

@Injectable()
Expand All @@ -24,7 +25,10 @@ export class AppConfigService {
SETTINGS_WEEKLYREPORT: StorageKeys.SETTINGS_WEEKLYREPORT
}

constructor(public storage: StorageService, private appVersion: AppVersion) {}
constructor(
public storage: GlobalStorageService,
private appVersion: AppVersion
) {}

init(enrolmentDate) {
return Promise.all([
Expand Down
5 changes: 4 additions & 1 deletion src/app/core/services/config/config.service.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,13 @@ import { HttpClient, HttpHandler } from '@angular/common/http'
import { TestBed } from '@angular/core/testing'
import { Platform } from '@ionic/angular'
import { PlatformMock } from 'ionic-mocks'
import { HealthkitService } from 'src/app/pages/questions/services/healthkit.service'

import {
AppConfigServiceMock,
AppServerServiceMock,
FirebaseAnalyticsServiceMock,
HealthkitServiceMock,
KafkaServiceMock,
LocalizationServiceMock,
LogServiceMock,
Expand Down Expand Up @@ -58,7 +60,8 @@ describe('ConfigService', () => {
{ provide: Platform, useClass: PlatformMock },
{ provide: RemoteConfigService, useClass: RemoteConfigServiceMock },
{ provide: AppServerService, useClass: AppServerServiceMock },
{ provide: MessageHandlerService, useClass: MessageHandlerServiceMock }
{ provide: MessageHandlerService, useClass: MessageHandlerServiceMock },
{ provide: HealthkitService, useClass: HealthkitServiceMock }
]
})
)
Expand Down
7 changes: 5 additions & 2 deletions src/app/core/services/config/config.service.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { Injectable } from '@angular/core'
import { compare } from 'compare-versions'
import { HealthkitService } from 'src/app/pages/questions/services/healthkit.service'

import {
DefaultAppVersion,
Expand Down Expand Up @@ -46,7 +47,8 @@ export class ConfigService {
private analytics: AnalyticsService,
private logger: LogService,
private remoteConfig: RemoteConfigService,
private messageHandlerService: MessageHandlerService
private messageHandlerService: MessageHandlerService,
private healthKitService: HealthkitService
) {
this.notifications.init()
}
Expand Down Expand Up @@ -300,7 +302,8 @@ export class ConfigService {
this.questionnaire.reset(),
this.schedule.reset(),
this.notifications.reset(),
this.localization.init()
this.localization.init(),
this.healthKitService.reset()
])
}

Expand Down
3 changes: 2 additions & 1 deletion src/app/core/services/config/questionnaire.service.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import { Utility } from '../../../shared/utilities/util'
import { GithubClient } from '../misc/github-client.service'
import { LocalizationService } from '../misc/localization.service'
import { LogService } from '../misc/log.service'
import { GlobalStorageService } from '../storage/global-storage.service'
import { StorageService } from '../storage/storage.service'
import { QuestionnaireService } from './questionnaire.service'

Expand All @@ -24,7 +25,7 @@ describe('QuestionnaireService', () => {
QuestionnaireService,
HttpClient,
HttpHandler,
{ provide: StorageService, useClass: StorageServiceMock },
{ provide: GlobalStorageService, useClass: StorageServiceMock },
{ provide: LocalizationService, useClass: LocalizationServiceMock },
{ provide: LogService, useClass: LogServiceMock },
{ provide: Utility, useClass: UtilityMock },
Expand Down
Loading

0 comments on commit 701c5e5

Please sign in to comment.