Skip to content

Commit

Permalink
Merge pull request #3170 from GoogleCloudPlatform/2.0.2-release-candi…
Browse files Browse the repository at this point in the history
…date

FDA MyStudies 2.0.2 Release
  • Loading branch information
jkrogers18 authored Feb 18, 2021
2 parents 7627c0a + c511e46 commit 0edb7f2
Show file tree
Hide file tree
Showing 644 changed files with 12,416 additions and 10,832 deletions.
28 changes: 28 additions & 0 deletions .github/workflows/lint-participant-manager-datastore.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# This file is used for adding styleCheck for participant manager and participant manager datastore
name: lint-participant-manager-datastore

on:
pull_request:
branches:
- develop
paths:
- 'participant-manager-datastore/participant-manager-service/**'
- '.github/workflows/lint-participant-manager-datastore.yml'
jobs:
checkstyle_job:
runs-on: ubuntu-latest
defaults:
run:
working-directory: /participant-manager-datastore/participant-manager-service
name: Checkstyle job
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Run check style
uses: nikitasavinov/checkstyle-action@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
reporter: 'github-pr-review'
level: error
workdir: ./participant-manager-datastore/participant-manager-service
tool_name: participant-manager-datastore Checks
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2020 Google LLC
* Copyright 2020-2021 Google LLC
*
* Use of this source code is governed by an MIT-style
* license that can be found in the LICENSE file or at
Expand All @@ -24,6 +24,9 @@ public class AppControllerTest {
private static final boolean TEST_TRUE = true;
private static final boolean TEST_FALSE = false;
private static final String INVALID_DATE_FORMAT = "Invalid date format";
private static final String SIMPLETEXT = "input";
private static final String HTMLTEXT = "<p>input</p>";


@Test
public void isDateWithinRangeTest() {
Expand Down Expand Up @@ -54,4 +57,12 @@ public void checkafterTest() {
boolean checkAfter = AppController.checkafter(startDate);
assertThat(checkAfter, equalTo(TEST_FALSE));
}

@Test
public void verifyHtmlInputTest() {
String checkSimpleText = AppController.verifyHtmlInput(SIMPLETEXT);
String checkHtmlText = AppController.verifyHtmlInput(HTMLTEXT);
assertThat(checkSimpleText, equalTo(HTMLTEXT));
assertThat(checkHtmlText, equalTo(HTMLTEXT));
}
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* Copyright © 2017-2019 Harvard Pilgrim Health Care Institute (HPHCI) and its Contributors.
* Copyright 2020 Google LLC
* Copyright 2020-2021 Google LLC
* Permission is hereby granted, free of charge, to any person obtaining a copy of this software and
* associated documentation files (the "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
Expand Down Expand Up @@ -240,11 +240,6 @@ public void checkForNotification(Intent intent1) {
StudyActivity.this,
getString(R.string.title),
"" + studyListArrayList.get(i).getTitle());
AppController.getHelperSharedPreference()
.writePreference(
StudyActivity.this,
getString(R.string.bookmark),
"" + studyListArrayList.get(i).isBookmarked());
AppController.getHelperSharedPreference()
.writePreference(
StudyActivity.this,
Expand Down Expand Up @@ -303,7 +298,6 @@ public void checkForNotification(Intent intent1) {
Intent intent = new Intent(getApplicationContext(), StudyInfoActivity.class);
intent.putExtra("studyId", studyListArrayList.get(i).getStudyId());
intent.putExtra("title", studyListArrayList.get(i).getTitle());
intent.putExtra("bookmark", studyListArrayList.get(i).isBookmarked());
intent.putExtra("status", studyListArrayList.get(i).getStatus());
intent.putExtra("studyStatus", studyListArrayList.get(i).getStudyStatus());
intent.putExtra("position", "" + i);
Expand Down Expand Up @@ -357,11 +351,6 @@ public void checkForNotification(Intent intent1) {
StudyActivity.this,
getString(R.string.title),
"" + studyListArrayList.get(i).getTitle());
AppController.getHelperSharedPreference()
.writePreference(
StudyActivity.this,
getString(R.string.bookmark),
"" + studyListArrayList.get(i).isBookmarked());
AppController.getHelperSharedPreference()
.writePreference(
StudyActivity.this,
Expand Down Expand Up @@ -1184,7 +1173,7 @@ protected void onPostExecute(String result) {
NotificationManagerCompat.from(StudyActivity.this);
notificationManager.cancelAll();
Toast.makeText(StudyActivity.this, R.string.signed_out, Toast.LENGTH_SHORT).show();
loadstudylist();
AppController.signout(StudyActivity.this);
}

@Override
Expand Down
5 changes: 5 additions & 0 deletions Android/app/src/fda/res/anim/slide_in_left.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android">
<translate android:fromXDelta="-100%p" android:toXDelta="0"
android:duration="@android:integer/config_mediumAnimTime"/>
</set>
5 changes: 5 additions & 0 deletions Android/app/src/fda/res/anim/slide_in_right.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android">
<translate android:fromXDelta="100%p" android:toXDelta="0"
android:duration="@android:integer/config_mediumAnimTime"/>
</set>
5 changes: 5 additions & 0 deletions Android/app/src/fda/res/anim/slide_out_left.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android">
<translate android:fromXDelta="0" android:toXDelta="-100%p"
android:duration="@android:integer/config_mediumAnimTime"/>
</set>
5 changes: 5 additions & 0 deletions Android/app/src/fda/res/anim/slide_out_right.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android">
<translate android:fromXDelta="0" android:toXDelta="100%p"
android:duration="@android:integer/config_mediumAnimTime"/>
</set>
18 changes: 9 additions & 9 deletions Android/app/src/fda/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,22 +15,22 @@
<!-- Update `deeplink_host` with a value that defines your deeplink URL (do not include app:// or context-path) -->
<!-- For example, a `deeplink_host` value of "subdomain.domain" would establish "app://subdomain.domain/mystudies" as the deeplink URL -->
<string name="deeplink_host">YOUR_DEEPLINK_HOST</string>
<!--The following strings may be customized as desired-->

<!--The following strings may be customized as desired-->
<string name="app_name">&app_name;</string>
<string name="poweredby">Powered by FDA MyStudies on Google Cloud</string>
<string name="website"></string>
<string name="websitetxt">App Website</string>
<string name="websitetxt">App website</string>
<string name="gateway_des">&lt;Introductory content paragraph goes here&gt;</string>
<string name="gateway_des1">&lt;Introductory content paragraph goes here&gt;</string>
<string name="delete_account_content">You have chosen to delete your &app_name; Account. This will result in automatic withdrawal from all studies.\n\nBelow is a list of studies that you are a part of and information on how your response data will be handled with each after you withdraw. Please review and confirm.</string>
<string name="delete_message">Are you sure you wish to permanently delete your &app_name; Gateway app account? You will need to register again if you wish to join a study.</string>
<string name="studie_your_enrolled">It\'s been a while since you visited the &app_name; app. Please consider continuing your participation in any studies in which you\'re enrolled.</string>
<string name="delete_account_content">You have chosen to delete your &app_name; account. This will result in automatic withdrawal from the studies you were enrolled in.</string>
<string name="delete_message">Are you sure you want to delete your app account? </string>
<string name="studie_your_enrolled">It\'s been a while since you visited the &app_name; app. Your participation in research studies is important. We encourage you to visit the app often and actively participate. </string>
<string name="termsurl"></string>
<string name="privacyurl"></string>
<string name="view_consent">View Consent</string>
<string name="visit_website">Visit Website</string>
<string name="join_study">Join Study</string>
<string name="view_consent">View consent</string>
<string name="visit_website">Visit website</string>
<string name="join_study">Participate</string>
<string name="clientToken">clientToken</string>
<string name="account_type">&package_name;.offlineModule.auth.syncadapterexample</string>
<string name="sync_provider">&package_name;.offlineModule.auth.syncadapterexample.provider</string>
Expand Down
2 changes: 1 addition & 1 deletion Android/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
<application
android:name=".FdaApplication"
android:allowBackup="false"
android:hardwareAccelerated="false"
android:hardwareAccelerated="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:largeHeap="true"
Expand Down
Binary file added Android/app/src/main/assets/fonts/HLM.ttf
Binary file not shown.
11 changes: 9 additions & 2 deletions Android/app/src/main/java/com/harvard/WebViewActivity.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* Copyright © 2017-2019 Harvard Pilgrim Health Care Institute (HPHCI) and its Contributors.
* Copyright 2020 Google LLC
* Copyright 2020-2021 Google LLC
* Permission is hereby granted, free of charge, to any person obtaining a copy of this software and
* associated documentation files (the "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
Expand All @@ -15,8 +15,10 @@

package com.harvard;

import android.os.Build;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.text.Html;
import android.view.View;
import android.webkit.WebView;
import android.widget.RelativeLayout;
Expand All @@ -34,7 +36,12 @@ protected void onCreate(Bundle savedInstanceState) {

webView.setScrollBarStyle(View.SCROLLBARS_INSIDE_OVERLAY);
String webData = getIntent().getStringExtra("consent");
webView.loadData(webData, "text/html; charset=utf-8", "UTF-8");
if (Build.VERSION.SDK_INT >= 24) {
webView.loadData(
Html.fromHtml((webData), Html.FROM_HTML_MODE_LEGACY).toString(), "text/html", "UTF-8");
} else {
webView.loadData(Html.fromHtml((webData)).toString(), "text/html", "UTF-8");
}
RelativeLayout backBtn = (RelativeLayout) findViewById(R.id.backBtn);
backBtn.setOnClickListener(
new View.OnClickListener() {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
/*
* Copyright © 2017-2019 Harvard Pilgrim Health Care Institute (HPHCI) and its Contributors.
* Copyright 2020-2021 Google LLC
* Permission is hereby granted, free of charge, to any person obtaining a copy of this software and
* associated documentation files (the "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
Expand All @@ -10,6 +11,7 @@
* Funding Source: Food and Drug Administration (“Funding Agency”) effective 18 September 2014 as Contract no. HHSF22320140030I/HHSF22301006T (the “Prime Contract”).
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*
*/

package com.harvard.eligibilitymodule;
Expand Down Expand Up @@ -53,6 +55,7 @@ public class CustomViewTaskActivity extends AppCompatActivity implements StepCal
private static final String EXTRA_STUDYID = "ViewTaskActivity.ExtraStudyId";
private static final String STUDYID = "ViewTaskActivity.StudyId";
private static final String ENROLLID = "ViewTaskActivity.EnrollId";
private static final String SITEID = "ViewTaskActivity.siteId";
private static final String PDF_TITLE = "ViewTaskActivity.pdfTitle";
private static final String EXTRA_TASK_RESULT = "ViewTaskActivity.ExtraTaskResult";
private static final String EXTRA_STEP = "ViewTaskActivity.ExtraStep";
Expand All @@ -63,6 +66,7 @@ public class CustomViewTaskActivity extends AppCompatActivity implements StepCal
private Task task;
private String studyId;
private String enrollId;
private String siteId;
private String eligibility;
private String type;
private String pdfTitle;
Expand All @@ -77,13 +81,15 @@ public static Intent newIntent(
Eligibility correctAnswers,
String title,
String enrollId,
String siteId,
String eligibility,
String type) {
Intent intent = new Intent(context, CustomViewTaskActivity.class);
intent.putExtra(EXTRA_TASK, task);
intent.putExtra(EXTRA_STUDYID, surveyId);
intent.putExtra(PDF_TITLE, title);
intent.putExtra(STUDYID, studyId);
intent.putExtra(SITEID, siteId);
intent.putExtra(ENROLLID, enrollId);
intent.putExtra(ELIGIBILITY, eligibility);
intent.putExtra(TYPE, type);
Expand All @@ -108,6 +114,7 @@ protected void onCreate(Bundle savedInstanceState) {
if (savedInstanceState == null) {
task = (Task) getIntent().getSerializableExtra(EXTRA_TASK);
studyId = (String) getIntent().getSerializableExtra(STUDYID);
siteId = (String) getIntent().getSerializableExtra(SITEID);
enrollId = (String) getIntent().getSerializableExtra(ENROLLID);
eligibility = (String) getIntent().getSerializableExtra(ELIGIBILITY);
type = (String) getIntent().getSerializableExtra(TYPE);
Expand All @@ -116,6 +123,7 @@ protected void onCreate(Bundle savedInstanceState) {
} else {
task = (Task) savedInstanceState.getSerializable(EXTRA_TASK);
studyId = (String) savedInstanceState.getSerializable(STUDYID);
siteId = (String) savedInstanceState.getSerializable(SITEID);
enrollId = (String) savedInstanceState.getSerializable(ENROLLID);
eligibility = (String) savedInstanceState.getSerializable(ELIGIBILITY);
type = (String) savedInstanceState.getSerializable(TYPE);
Expand Down Expand Up @@ -154,6 +162,7 @@ protected void showNextStep() {
} else {
Intent intent = new Intent(this, NotEligibleActivity.class);
intent.putExtra("studyId", "" + studyId);
intent.putExtra("siteId", "" + siteId);
startActivity(intent);
finish();
}
Expand Down Expand Up @@ -253,6 +262,7 @@ private void saveAndFinish() {

Intent intent = new Intent(this, EligibleActivity.class);
intent.putExtra("studyId", studyId);
intent.putExtra("siteId", siteId);
intent.putExtra("enrollId", enrollId);
intent.putExtra("title", pdfTitle);
intent.putExtra("eligibility", eligibility);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* Copyright © 2017-2019 Harvard Pilgrim Health Care Institute (HPHCI) and its Contributors.
* Copyright 2020 Google LLC
* Copyright 2020-2021 Google LLC
* Permission is hereby granted, free of charge, to any person obtaining a copy of this software and
* associated documentation files (the "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
Expand All @@ -11,6 +11,7 @@
* Funding Source: Food and Drug Administration (“Funding Agency”) effective 18 September 2014 as Contract no. HHSF22320140030I/HHSF22301006T (the “Prime Contract”).
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*
*/

package com.harvard.eligibilitymodule;
Expand Down Expand Up @@ -159,6 +160,10 @@ public void updateuserpreference() {
JSONObject studiestatus = new JSONObject();
try {
studiestatus.put("studyId", getIntent().getStringExtra("studyId"));
if (getIntent().getStringExtra("siteId") != null
&& !getIntent().getStringExtra("siteId").equalsIgnoreCase("")) {
studiestatus.put("siteId", getIntent().getStringExtra("siteId"));
}
studiestatus.put("status", StudyFragment.YET_TO_JOIN);
} catch (JSONException e) {
Logger.log(e);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* Copyright © 2017-2019 Harvard Pilgrim Health Care Institute (HPHCI) and its Contributors.
* Copyright 2020 Google LLC
* Copyright 2020-2021 Google LLC
* Permission is hereby granted, free of charge, to any person obtaining a copy of this software and
* associated documentation files (the "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
Expand All @@ -11,6 +11,7 @@
* Funding Source: Food and Drug Administration (“Funding Agency”) effective 18 September 2014 as Contract no. HHSF22320140030I/HHSF22301006T (the “Prime Contract”).
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*
*/

package com.harvard.eligibilitymodule;
Expand Down Expand Up @@ -76,6 +77,10 @@ public void updateuserpreference() {
JSONObject studiestatus = new JSONObject();
try {
studiestatus.put("studyId", getIntent().getStringExtra("studyId"));
if (getIntent().getStringExtra("siteId") != null
&& !getIntent().getStringExtra("siteId").equalsIgnoreCase("")) {
studiestatus.put("siteId", getIntent().getStringExtra("siteId"));
}
studiestatus.put("status", StudyFragment.NOT_ELIGIBLE);
} catch (JSONException e) {
Logger.log(e);
Expand Down
Loading

0 comments on commit 0edb7f2

Please sign in to comment.