Skip to content

Commit

Permalink
Add settings screen (#326)
Browse files Browse the repository at this point in the history
* Create Settings screen

* Add navigation and translation for new screen

* Remove irrelevant components from Settings screen

* Add menu for authorities selection in Settings

* Add stylized button, FlatList bit to Settings

* Add styling to flatlist rows, add close icon

* Fix caps, add iterating menu off authorities obj

* Add add/remove data source functions

* Add translation variables and lines to Settings

* Fix menu icon color from purple to bluish grey

* Remove unnecessary whitespace in translation

* Prevent duplicates from authorities list

* Add custom URL input (all function)

* Add check for connection, let user know if error

* Now pulls authorities list from internet source

* Store user settings in async storage

* Version 0.5.4 (Build 9) (#161)

* Simple Script to reset react native

* Version 0.5.4 (Build 9)

* Example code for private-set point intersection (#163)

Add a complete Pytyon example of performing private set intersection.
This solution give pretty good privacy, estimated at approximately
10 days to crack a single published lat/lon/time point.

This is donated to the Private Kit project by Triple Blind, and
may be freely used within the project.

* V2overlap (#166)

* display map

* working v2; only android

* improve and optimize map support;android only

* add heatmap code

* Automating Version & Build Numbers (#169)

* Adding version and build number automator (Changes ReactNative, iOS and Android upon npm version).

* Removing Build Number from Targets on Xcode so that npm version with react-native-version can update the number automatically.

* Test Bundle version and Main Bundle version should be the same.

* 0.5.5

* Add NL (Dutch) locale (#172)

* Changetext (#175)

* Add News, Import, Export buttons

* add new colors

* add positive and sensitive buttons

* change button color in the main menu

* change text for overlap screen

* Version 0.5.6 (#177)

* Adding version and build number automator (Changes ReactNative, iOS and Android upon npm version).

* Removing Build Number from Targets on Xcode so that npm version with react-native-version can update the number automatically.

* Test Bundle version and Main Bundle version should be the same.

* 0.5.5

* Production API keys.

* 0.5.6

* moving pod install command to npm run install:pod (#173)

* Improve data exporter to share data with better names (#174)

* Write file to filesystem before sharing

* Enhance sharing data output

- Updated react-native-share to 3.1.0 because of [issue](react-native-share/react-native-share#702)
- Separated out iOS specific and android share logic as the behaviors for sharing are significanlty different even for a simple case like filename

* Add support for 'Marathi' locale (#154)

* Add support for 'Marathi' locale

* Incorporate review suggestions

Co-authored-by: Sagar Manohar <[email protected]>
Co-authored-by: Abhishek Singh <[email protected]>

* Translated pt locations files (#125)

* Translated locations files from ingles to pt-br

* Updated sentence for better semantics, remintz suggestion

* Fix typo

* fixing broken link to issue list (#186)

* Fix formatting in languages json due to merge (#183)

This fixes a formatting issue due to a merge. Languages were added in multiple PRs and they didn't get merged together correctly.

* Added feedback for trace overlap if it comes back with no results (#190)

See issue #188 - I'd advise this is merged ASAP since the current build feels broken from a user perspective.

* minor version bump to clear Xcode warnings (#168)

Co-authored-by: Vitor Pamplona <[email protected]>

* Bluetooth Broadcasting on Android.  (#193)

* Running build on develop.

* Keeping action to Master

* Starting Bluetooth Beacon Broadcasting.

* Other ID was too big.

* Only runs Bluetooth on Android

* Changing Package version to 0.0.4 to pass tests on Phones without Bluetooth adapters.

* Fix broken layout on low-res devices using flex layout on LocationTracking.js and Overlap.js (#196)

* quality of life improvements

* Add dynamic button text for trace overlap results

* Reenabled Prettier in Overlap.js but didn't format

* Add translation for overlap button text and title

* Move website link footer inside scrollview

* Use flex layout to fix display on low-res devices

* Update CSV data source, refine text (#197)

* Update CSV data source, refine text

The source of the public data moved, breaking this feature.  Also
refined the text show and added a link to the public dataset.

* Change terminology for now

* Version: 0.5.8 (#198)

* Running build on develop.

* Keeping action to Master

* Starting Bluetooth Beacon Broadcasting.

* Other ID was too big.

* Only runs Bluetooth on Android

* Changing Package version to 0.0.4 to pass tests on Phones without Bluetooth adapters.

* 0.5.7

* 0.5.8

* Fix typo in location tracking url_info text (#200)

* Enhancing the License screen (#202)

* Enhancing the License screen

The kebab > License screen now is a combination of an About screen
and a license.  The top of the screen shows information about the current
app version, OS version on which it is running and screen resolution info.

Below that is license test.  It pulls from the new LICENSE.json in the
assets directory.  It will render an array of licenses, so later we can
add the licenses of components we use in addition to the main Private
Kit MIT license.

* Remove debugging console.log() message

* Fix circles crash by only showing nearby circles (#212)

* ESlint added and removed few errors (#201)

Co-authored-by: Harsh Vitra <[email protected]>

* Added Loader for Webviews (#206)

Co-authored-by: Harsh Vitra <[email protected]>

* Change color of three dot menu button to match the color of other button elements - #178 (#208)

* Migrating Bluetooth library to 0.0.5 (#214)

* Add code formatting rules with git-hooks #189 (#210)

* Brazilian Portuguese language support (#229)

* Dutch translation (#225)

* Update index.js

* Update locationTracking.json

* Create overlap.json

* Andynuzzo/it (#223)

* Update macos_build.yml (#236)

Fix breaking gradle error

* Typo fix from Enrico Santus on latest (#239)

* Add jest snapshot testing to the main views (#187)

* Add jest snapshot testing to the main views

    This adds jest snapshot testing the main views for the application. The
    main views it covers are:

    * Export
    * Import
    * Licenses
    * LocationTracking
    * News
    * Overlap
    * Welcome

    The tests are run using `yarn test`.

    Mock setup has been added for some of the react native packages so the testing
    doesn't have to rely on the packages.

    Cleaned up some of the formatting in the language files to not include the trailing
    comma on the last property. This was throwing errors for some of the jest tests.

    Add jestSetupFile to setup some of the mocks for the tests

* Update tests after rebasing the develop branch

* Fix LICENSES json due to failing test

* Add mock for react-native-zip-archive

* Italian missing licenses file- Andy's translation added (#241)

* Andy's translation for the missing licenses file

* Update index.js

* Add custom map styles to the Overlap map (#246)

The custom styles were taken from https://snazzymaps.com/style/127403/no-label-bright-colors
which was linked to in the issue #243

Closes #243

* Haitian Creole with Translation Inputs from Gerald McElroy (#238)

* Spanish language support based on Miquel Vila Porté's translation (#245)

* Notification UI to show histogram and day wise list of intersections (#237)

* Add News, Import, Export buttons

* add new colors

* add positive and sensitive buttons

* change button color in the main menu

* notification UI

* remove callback for button

* Fixed 'Always Allow' for iOS (#97)

* 1. Added RN permissions to dependencies.
2. Added location permissions in AndroidManifest.xml

* 1. Permissions now handled by react-native-permissions
2. If platform is iOS 12.x.x or earlier. Directly acquire 'Always Allow' permission
3. If platform is iOS 13.0 or later, redirect to app settings.
Apps cannot directly ask for 'Always Allow' post iOS 13.

* Added comments

* Added yarn.lock and Podfile.lock to gitignore

* No changes

* Added lock files

* Removed Podfile.lock

Co-authored-by: Rich Paret <[email protected]>
Co-authored-by: Abhishek Singh <[email protected]>

* Change the ui of Notifications (#254)

Co-authored-by: Harsh Vitra <[email protected]>

* Fix design and remove url (#255)

Co-authored-by: Harsh Vitra <[email protected]>

* Cleanup react warning on the Overlap screen (#249)

There were some react warnings being thrown due to the key
prop not being set on some components. This sets the key prop
on the components that are added in a loop

* Fixed text in the Notifications page (#256)

* Fixed Text on Notifications page

* Fixed Font size of Export

Co-authored-by: Harsh Vitra <[email protected]>

* Update Export screen to show more accurate log data (#244)

* Update Export screen to show more accurate log data

This is a pretty update to how the Export screen works and how the
log data is modified.

The Export screen component was rewritten as a functional component
in order to take advantage of hooks. The use for the hooks is to
update the log data details when the Export component comes in to
focus. The old version would only update the data once since the
component would mount and never unmount leading to stale data. The
new Export component will update the log details each time the view
comes in to focus. The log details have now been broken up in to
3 sections: Total time the log covers, Number of points logged, and
Time since last updated.

The LocationService has been updated with a new class called
LocationData. This take the old saveLocation method and makes it
an instance method on the LocationData class. This also allows
access to the location data that is in memory in order for the
Export screen to show more accurate details. The LocationService
has been updated to use this new class when saving the location
data.

* Revert change to the location time interval

* Remove old references to some variable names

* Fix export tests due to changes

* Add LocationData tests

* Remove old test file

* Change location marker and description, get rid of redundant markers as well (#250)

* Add News, Import, Export buttons

* add new colors

* add positive and sensitive buttons

* change button color in the main menu

* change marker icon and description

* remove maps-clustering package

* Minor bug fixes in Share and Overlap features (#265)

* Create Settings screen

* Add navigation and translation for new screen

* Remove irrelevant components from Settings screen

* Add menu for authorities selection in Settings

* Add stylized button, FlatList bit to Settings

* Add styling to flatlist rows, add close icon

* Fix caps, add iterating menu off authorities obj

* Add add/remove data source functions

* Add translation variables and lines to Settings

* Fix menu icon color from purple to bluish grey

* Remove unnecessary whitespace in translation

* Prevent duplicates from authorities list

* Add custom URL input (all function)

* Add check for connection, let user know if error

* Now pulls authorities list from internet source

* Store user settings in async storage

* Hopefully fix the git mess that somehow happened?

* Fix delay bug in async settings storage

* Fix null settings bug on fresh install

* Delete macos_build.yml

* Delete CONTRIBUTING.md

* fixed syntax error in gj labels block on dev, languages.js (#318)

* Revert formatting changes

Co-authored-by: Sam Stowers <[email protected]>
Co-authored-by: Vitor Pamplona <[email protected]>
Co-authored-by: Steve Penrod <[email protected]>
Co-authored-by: Abhishek Singh <[email protected]>
Co-authored-by: Niels de Hoog <[email protected]>
Co-authored-by: Robert Gühne <[email protected]>
Co-authored-by: Tushar Dadlani <[email protected]>
Co-authored-by: Sagar Manohar <[email protected]>
Co-authored-by: Sagar Manohar <[email protected]>
Co-authored-by: Douglas Lara <[email protected]>
Co-authored-by: Greg Knaddison <[email protected]>
Co-authored-by: Tim Banks <[email protected]>
Co-authored-by: Rich Paret <[email protected]>
Co-authored-by: Harsh Vitra <[email protected]>
Co-authored-by: Harsh Vitra <[email protected]>
Co-authored-by: Parth Pathak <[email protected]>
Co-authored-by: alpita-masurkar <[email protected]>
Co-authored-by: Andy Nuzzo <[email protected]>
Co-authored-by: Nilay Kulkarni <[email protected]>
Co-authored-by: Steve Penrod <[email protected]>
  • Loading branch information
21 people authored Apr 3, 2020
1 parent aff311e commit ec42a33
Show file tree
Hide file tree
Showing 11 changed files with 424 additions and 150 deletions.
121 changes: 0 additions & 121 deletions .github/workflows/macos_build.yml

This file was deleted.

6 changes: 6 additions & 0 deletions app/Entry.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import NewsScreen from './views/News';
import ExportScreen from './views/Export';
import ImportScreen from './views/Import';
import OverlapScreen from './views/Overlap';
import SettingsScreen from './views/Settings';
import LicencesScreen from './views/Licenses';
import NotificationScreen from './views/Notification';
import Slider from './views/welcomeScreens/Slider';
Expand Down Expand Up @@ -84,6 +85,11 @@ class Entry extends Component {
component={ImportScreen}
options={{ headerShown: false }}
/>
<Stack.Screen
name='SettingsScreen'
component={SettingsScreen}
options={{ headerShown: false }}
/>
<Stack.Screen
name='LicensesScreen'
component={LicencesScreen}
Expand Down
Binary file added app/assets/images/closeIcon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified app/assets/images/kebabIcon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/assets/images/saveIcon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 2 additions & 0 deletions app/locales/en/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import exportFile from './exportscreen.json';
import licensesFile from './licensesscreen.json';
import overlapFile from './overlap.json';
import notificationFile from './notification.json';
import settingsFile from './settingsScreen.json';

export default {
...intro,
Expand All @@ -14,4 +15,5 @@ export default {
...overlapFile,
...licensesFile,
...notificationFile,
...settingsFile,
};
6 changes: 3 additions & 3 deletions app/locales/en/overlap.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"overlap_title": "Check Overlap",
"overlap_para_1": "The green trail represents your location history\n\nThe light purple circles represent the public dataset",
"show_overlap": "Click to view the public dataset",
"loading_public_data": "loading data...",
"overlap_para_1": "Green circles are clusters of your locations, click to zoom. Red markers are your recorded locations.\n\nPress the button to download public information of confirmed cases, shown as faint purple circles.",
"show_overlap": "Check Public Data",
"loading_public_data": "Loading Data...",
"overlap_no_results_button_label": "Public Data Loaded",
"overlap_found_button_label": "Public Data Loaded",
"nCoV2019_url_info": "For more information on the dataset for this map",
Expand Down
16 changes: 16 additions & 0 deletions app/locales/en/settingsScreen.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"settings_title": "Settings",
"authorities_title": "Trusted Sources",
"authorities_desc": "You can get data from one or more healthcare authorities that you trust. Either select a name from the global registry, or enter the web address of an authority you trust that's implemented Safe Paths.",
"authorities_removal_alert_title": "Remove authority",
"authorities_removal_alert_desc": "Are you sure you want to remove this authority data source?",
"authorities_removal_alert_cancel": "Cancel",
"authorities_removal_alert_proceed": "Procceed",
"authorities_no_sources": "No data sources yet! Tap below to add one.",
"authorities_add_button_label": "Add Trusted Source",
"authorities_coming_soon_title": "Coming soon",
"authorities_coming_soon_desc": "You'll be able to add custom data sources in an imminent update.",
"authorities_done": "Done",
"authorities_add_url": "Add authority via URL",
"authorities_input_placeholder": "Paste your URL here"
}
20 changes: 20 additions & 0 deletions app/views/LocationTracking.js
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,20 @@ class LocationTracking extends Component {
this.props.navigation.navigate('NotificationScreen', {});
}

settings() {
this.props.navigation.navigate('SettingsScreen', {});
}

willParticipate = () => {
SetStoreData('PARTICIPATE', 'true').then(() => {
LocationServices.start();
BroadcastingServices.start();
});
this.setState({
isLogging: true,
});
};

setOptOut = () => {
LocationServices.stop(this.props.navigation);
BroadcastingServices.stop(this.props.navigation);
Expand Down Expand Up @@ -218,6 +232,12 @@ class LocationTracking extends Component {
/>
</MenuTrigger>
<MenuOptions>
<MenuOption
onSelect={() => {
this.settings();
}}>
<Text style={styles.menuOptionText}>Settings</Text>
</MenuOption>
<MenuOption
onSelect={() => {
this.licenses();
Expand Down
Loading

0 comments on commit ec42a33

Please sign in to comment.