Skip to content

Commit

Permalink
Merge pull request #1414 from RADAR-base/release-2.4.0-alpha
Browse files Browse the repository at this point in the history
Release 2.4.0-alpha
  • Loading branch information
mpgxvii authored Feb 21, 2022
2 parents 3a01386 + f20c2b2 commit 866634b
Show file tree
Hide file tree
Showing 22 changed files with 2,672 additions and 2,153 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ jobs:
uses: android-actions/setup-android@v2

- name: Fix Android directories
run: rm -R /usr/local/lib/android/sdk/build-tools/31.0.0/
run: rm -R /usr/local/lib/android/sdk/build-tools/31.0.0/ && rm -R /usr/local/lib/android/sdk/build-tools/32.0.0/

- name: Setup Node
uses: actions/setup-node@v2
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ jobs:
uses: android-actions/setup-android@v2

- name: Fix Android directories
run: rm -R /usr/local/lib/android/sdk/build-tools/31.0.0/
run: rm -R /usr/local/lib/android/sdk/build-tools/31.0.0/ && rm -R /usr/local/lib/android/sdk/build-tools/32.0.0/

- name: Setup Node
uses: actions/setup-node@v2
Expand Down
29 changes: 22 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,7 @@ Certain values can be overriden using Firebase Remote Config. Specifically, the
| `schedule_year_coverage` | Schedule coverage in years (length of schedule to generate tasks until) | `3` |
| `notification_messaging_type` | Notifications type (either 'FCM_XMPP', 'FCM_REST' or 'LOCAL' notifications) | `FCM_XMPP` |
| `app_server_url` | Default app server url. | `{DefaultEndPoint + '/appserver'}` |
| `github_fetch_strategy` | Default Github fetch strategy for Github requests (default or appserver). | `default` |
| `app_credits_title` | Title of the popup box that appears when you tap on the app logo on the left hand side of the homepage. | `Credits` |
| `app_credits_body` | Body of the popup box that appears when you tap on the app logo on the left hand side of the homepage. | `Made with ♥ for you by the RADAR-Base community.` |
| `auto_next_questionnaire_types` | String list of question/question input types where the questionnaire will automatically move to the next question upon answering the question. It is recommended to always include timed and audio types. | `timed,audio` |
Expand Down Expand Up @@ -170,22 +171,33 @@ Further details on the events that are already logged, default events, and defau

## Other Config Options

Copy `src/assets/data/secret.ts.template` to `src/assets/data/secret.ts` and add the following configuration -
You can change the default config locally in `src/assets/data/defaultConfig.ts`. Some of these can also be modified in Firebase remote config.

The main configs you may want to modify are:

The client secret for OAuth authorisation with the Management Portal (empty by default).

```ts
// The client secret for OAuth authorisation with the Management Portal
export const DefaultSourceProducerAndSecretExport = 'aRMT:<aRMT-secret>'
export const DefaultOAuthClientSecret = ''
```

In `src/assets/data/defaultConfig.ts` the following settings can be changed:

The Default endpoint of where the RADAR-base platform is hosted.
The default endpoint of where the RADAR-base platform is hosted.

```ts
export const DefaultEndPoint = 'https://your-hosted-radar-platform-base-url/'
```

Also change the Default Github source details where the questionnaire scheduling protocols and questionnaire schemas are hosted.
The default appserver configs.

```ts
// The notification type (either 'FCM_XMPP', 'FCM_REST' or 'LOCAL' notifications)
export const DefaultNotificationType: string = 'FCM_XMPP'

// App server URL
export const DefaultAppServerURL = DefaultEndPoint + '/appserver'
```

You can also change the default Github source details where the questionnaire scheduling protocols and questionnaire schemas are hosted.

```ts
// The Github repository where the protocols are located
Expand All @@ -199,6 +211,9 @@ export const DefaultSchemaGithubRepo = 'RADAR-Base/RADAR-Schemas'

// The name of the branch in the schema repository
export const DefaultSchemaBranch = 'master'

// The Github content fetching mechanism, if this is done by a direct request to Github or a request through the app server. (REMOTE CONFIG KEY: `github_fetch_strategy`, VALUES: `default` (direct to Github) or `appserver`)
export const DefaultGithubFetchStrategy = 'default'
```

## Adding Language Support
Expand Down
4 changes: 2 additions & 2 deletions 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="564" id="org.phidatalab.radar_armt" ios-CFBundleIdentifier="org.phidatalab.radar-armt" ios-CFBundleVersion="1" version="2.3.0-alpha" xmlns:android="http://schemas.android.com/apk/res/android">
<widget android-versionCode="565" id="org.phidatalab.radar_armt" ios-CFBundleIdentifier="org.phidatalab.radar-armt" ios-CFBundleVersion="1" version="2.4.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="[email protected]" href="http://radar-base.org/">RADAR-Base</author>
Expand Down Expand Up @@ -149,7 +149,7 @@
<variable name="IOS_SHOULD_ESTABLISH_DIRECT_CHANNEL" value="true" />
</plugin>
<plugin name="cordova-plugin-androidx-adapter" spec="^1.1.0" />
<plugin name="cordova-plugin-background-mode" spec="git+https://bitbucket.org/TheBosZ/cordova-plugin-run-in-background.git" />
<plugin name="cordova-plugin-background-mode" spec="https://bitbucket.org/TheBosZ/cordova-plugin-run-in-background.git" />
<plugin name="com-darryncampbell-cordova-plugin-intent" spec="^2.0.0" />
<plugin name="cordova-plugin-ionic-keyboard" spec="^2.2.0" />
<plugin name="cordova-custom-config" spec="^5.1.0" />
Expand Down
16 changes: 9 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@
"@angular/router": "^7.2.13",
"@auth0/angular-jwt": "^4.2.0",
"@ionic-native/android-permissions": "^5.26.0",
"@ionic-native/app-launcher": "^5.31.1",
"@ionic-native/app-version": "^5.28.0",
"@ionic-native/background-mode": "^5.32.0",
"@ionic-native/barcode-scanner": "^5.33.1",
Expand Down Expand Up @@ -86,7 +87,6 @@
"cordova-plugin-camera": "^5.0.2",
"cordova-plugin-device": "^2.0.3",
"cordova-plugin-dialogs": "^2.0.2",
"cordova-plugin-enable-multidex": "git+https://github.com/adriano-di-giovanni/cordova-plugin-enable-multidex.git",
"cordova-plugin-file": "^6.0.1",
"cordova-plugin-globalization": "^1.11.0",
"cordova-plugin-insomnia": "^4.3.0",
Expand Down Expand Up @@ -133,16 +133,17 @@
"@angular/platform-browser-dynamic": "^7.2.13",
"@angular/platform-server": "^9.0.5",
"@ionic/app-scripts": "^3.2.4",
"@types/jasmine": "^3.6.3",
"@types/jasmine": "^3.7.7",
"@types/jasminewd2": "^2.0.8",
"@types/node": "14.0.22",
"codelyzer": "^5.2.2",
"cordova-android": "^9.0.0",
"cordova-ios": "5.1.1",
"cordova-plugin-background-mode": "git+https://bitbucket.org/TheBosZ/cordova-plugin-run-in-background.git",
"cordova-plugin-firebasex": "git+https://github.com/mpgxvii/cordova-plugin-firebasex.git#cli_build",
"cordova-plugin-app-launcher": "^0.4.0",
"cordova-plugin-background-mode": "https://bitbucket.org/TheBosZ/cordova-plugin-run-in-background.git",
"cordova-plugin-firebasex": "https://github.com/mpgxvii/cordova-plugin-firebasex.git",
"cordova-plugin-ionic-webview": "^4.2.1",
"cordova-plugin-network-information": "git+https://github.com/apache/cordova-plugin-network-information.git",
"cordova-plugin-network-information": "https://github.com/apache/cordova-plugin-network-information.git",
"cordova-sqlite-storage": "^6.0.0",
"eslint": "^6.8.0",
"eslint-scope": "^5.0.0",
Expand Down Expand Up @@ -250,9 +251,10 @@
"cordova-plugin-ionic-webview": {
"ANDROID_SUPPORT_ANNOTATIONS_VERSION": "27.+"
},
"cordova-plugin-background-mode": {}
"cordova-plugin-background-mode": {},
"cordova-plugin-app-launcher": {}
}
},
"ionic_enable_lint": false,
"snyk": true
}
}
6 changes: 4 additions & 2 deletions src/app/app.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { BrowserModule } from '@angular/platform-browser'
import { BrowserAnimationsModule } from '@angular/platform-browser/animations'
import { JWT_OPTIONS, JwtModule } from '@auth0/angular-jwt'
import { AndroidPermissions } from '@ionic-native/android-permissions/ngx'
import { AppLauncher } from '@ionic-native/app-launcher/ngx'
import { AppVersion } from '@ionic-native/app-version/ngx'
import { BackgroundMode } from '@ionic-native/background-mode/ngx'
import { BarcodeScanner } from '@ionic-native/barcode-scanner/ngx'
Expand Down Expand Up @@ -44,7 +45,7 @@ import { Utility } from './shared/utilities/util'
mode: 'md',
activator: 'none',
scrollAssist: false,
autoFocusAssist: false,
autoFocusAssist: false
}),
IonicStorageModule.forRoot({
name: '__appdb',
Expand Down Expand Up @@ -82,7 +83,8 @@ import { Utility } from './shared/utilities/util'
FirebaseX,
LocalNotifications,
LogService,
{ provide: RemoteConfigService, useClass: FirebaseRemoteConfigService },
AppLauncher,
{ provide: RemoteConfigService, useClass: FirebaseRemoteConfigService }
],
schemas: [CUSTOM_ELEMENTS_SCHEMA]
})
Expand Down
3 changes: 2 additions & 1 deletion src/app/core/services/config/config.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,8 @@ export class ConfigService {

cancelNotifications() {
this.sendConfigChangeEvent(NotificationEventType.CANCELLED)
return this.notifications.publish(NotificationActionType.CANCEL_ALL)
if (this.notifications)
return this.notifications.publish(NotificationActionType.CANCEL_ALL)
}

cancelSingleNotification(notificationId: number) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -169,24 +169,29 @@ export class FcmRestNotificationService extends FcmNotificationService {
}

cancelSingleNotification(subject, notification: SingleNotification) {
return this.appServerService
.getHeaders()
.then(headers =>
this.http
.delete(
this.getNotificationEndpoint(
subject.projectId,
subject.subjectId,
notification.id
),
{ headers }
)
.toPromise()
)
.then(() => {
this.logger.log('Success cancelling notification ' + notification.id)
return (notification.id = undefined)
})
if (notification.id) {
return this.appServerService
.getHeaders()
.then(headers =>
this.http
.delete(
this.getNotificationEndpoint(
subject.projectId,
subject.subjectId,
notification.id
),
{ headers }
)
.toPromise()
)
.then(() => {
this.logger.log('Success cancelling notification ' + notification.id)
return (notification.id = undefined)
})
} else {
this.logger.log('Cannot cancel undefined notification id.')
return Promise.resolve()
}
}

updateNotificationState(subject, notificationId, state) {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
<img src="assets/imgs/checkmark-big.svg" class="icon" alt="Completed" />
<h2 text-center>
{{ content }}
<br />
{{ externalAppLaunchDescription }}
</h2>
<div class="pos-bottom">
<div class="pos-bottom-90">
<div *ngIf="displayNextTaskReminder" class="next-task-highlight">
{{ 'FINISH_NEXT_TASK_REMINDER' | translate }}
</div>
<ion-item no-lines *ngIf="requiresInClinicCompletion">
<ion-label>
{{ 'FINISH_COMPLETED_IN_CLINIC' | translate }}
</ion-label>
<ion-toggle item-right [(ngModel)]="completedInClinic"></ion-toggle>
</ion-item>
</div>
<div class="done-button">
<button
ion-button
class="bt bt--full"
round
full
*ngIf="showDoneButton"
(tap)="handleClosePage()"
>
{{
canLaunch
? ('EXTERNAL_APP_LAUNCH_BUTTON' | translate)
: ('BTN_DONE' | translate)
}}
</button>
<ng-container *ngIf="!showDoneButton && isShown">
<div class="extra-info">
<img
class="extra-info-icon"
src="assets/imgs/warning.png"
alt="Warning"
/>
{{ 'WARNING_DO_NOT_CLOSE_APP' | translate }}
</div>
<div>
<ion-spinner name="dots"></ion-spinner>
</div>
</ng-container>
</div>
</div>
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
finish-and-launch {
ion-item.item {
margin-bottom: $item-separation-distance;
background-color: $cl-primary-40;
}

ion-item.item:last-child {
margin-bottom: 0;
}

.pos-bottom-90 {
padding-bottom: 32px;
}

.icon {
width: 30%;
}

.done-button {
padding: 0 24px;
}

.next-task-highlight {
padding: 4px;
background-color: $cl-warning-20;
font-size: 16px;
}

ion-spinner * {
padding-left: 10px;
width: 10px;
height: 30px;
background-color: #fff;
fill: #fff;
stroke: #fff;
}

.extra-info {
text-align: center;
text-transform: uppercase;
font-size: 2vh;
}

.extra-info-icon {
height: 1.5vh;
}

.pos-bottom {
position: absolute;
bottom: 32px;
left: 0;
width: 100%;
}
}
Loading

0 comments on commit 866634b

Please sign in to comment.