Skip to content
This repository has been archived by the owner on May 23, 2024. It is now read-only.

Commit

Permalink
Release 5.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
nzcovidtracer-dev committed May 24, 2021
1 parent c44af18 commit 15a018a
Show file tree
Hide file tree
Showing 191 changed files with 5,436 additions and 1,489 deletions.
13 changes: 13 additions & 0 deletions android/app/src/main/java/com/uniteapprn/MainActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@
import android.content.SharedPreferences;
import android.os.Bundle;
import com.facebook.react.ReactActivity;
import com.facebook.react.ReactActivityDelegate;
import com.facebook.react.ReactRootView;
import com.swmansion.gesturehandler.react.RNGestureHandlerEnabledRootView;
import org.devio.rn.splashscreen.SplashScreen;

import ie.gov.tracing.storage.SharedPrefs;
Expand Down Expand Up @@ -32,4 +35,14 @@ private void saveLaunchTime() {
editor.putLong("lastLaunchTime", System.currentTimeMillis());
editor.apply();
}

@Override
protected ReactActivityDelegate createReactActivityDelegate() {
return new ReactActivityDelegate(this, getMainComponentName()) {
@Override
protected ReactRootView createRootView() {
return new RNGestureHandlerEnabledRootView(MainActivity.this);
}
};
}
}
1 change: 1 addition & 0 deletions babel.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ module.exports = {
"@utils": "./src/utils",
"@logger": "./src/logger",
"@navigation": "./src/navigation",
"@linking": "./src/linking",
},
},
],
Expand Down
21 changes: 21 additions & 0 deletions docs/CODE_QUALITY.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
### Code Quality

This code-base is available open-source to the general public, it is important that all developers working on this project do their best to write high-quality code that is testable, scalable, and follows software development best practices.

#### Code style
- We will be using TypeScript for all our React components
- Install prettier on your code editor
- Run yarn lint often to check for linting rules

#### Structure
- Write tests for all code relating to reducers/state manipulation
- Unless absolutely necessary do not use any (TypeScript)
- Follow the project folder structure, place files where they belong
- We will be using functional components
- For consistency, use hooks whenever possible. for e.g. Use useDispatch instead of redux HOC

#### Styles
- No inline styles. Use styled-components whenever possible
- Limit custom styles (including styled-components) in views, try to extract component whenever possible
- Use font sizes, colors, etc from constants
- Use our @components/atoms/Text component only, do not use the default Text from react-native (we have custom text styles applied by default)
6 changes: 6 additions & 0 deletions docs/GIT_HYGIENE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
### Git Hygiene

- When merging PRs to develop, please use Squash and merge
- Make sure to review the commit message before finalizing the merge, don't just leave defaults in there
- Use Merge from release branches to master
- Use Merge from master to develop
136 changes: 136 additions & 0 deletions docs/SERVER_DRIVEN_UI.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,136 @@
### Server-driven UI

#### Cards

| key | value |
| --- | ----- |
| component | `Card` |
| title | title of the card |
| body | optional, body of the card |
| backgroundColor | optional, background color of the color, defaults to `#FFFFFF` |
| icon | optional, icon of the card |
| externalLink | optional, if specified, display the card as an external link and open the link in a browser when tapped |
| deepLink | optional, if specified, deep link to a specific screen. |
| action | `share-app` optional, if specified, shares the app when tapped |

> Please specify one of `action`, `deepLink` or `externalLink`
Example:
```json
{
"component": "Card",
"title": "foo",
"body": "bar",
"backgroundColor": "#FF0000",
"icon": "http://foo/image.png",
"externalLink": "http://govt.nz",
"deepLink": "nzcovidtracer://SomeScreen"
}
```
#### Panels

| key | value |
| --- | ----- |
| component | `Panel` |
| title | title of the card |
| body | body of the card |
| backgroundColor | optional, background color of the color, defaults to `#FFFFFF` |
| buttons | optional, primary and secondary button, empty or empty array to hide buttons |
| buttons.text | button text |
| buttons.externalLink | optional, if specified, open the link on a browser when tapped |
| buttons.deepLink | optional, if specified, navigate the deep link when tapped |
| buttons.accessibilityHint | optional, if specified, override the default accessibility hint |

> Please specify either `deepLink` or `externalLink`
Example:
```json
{
"component": "Panel",
"title": "foo",
"body": "bar",
"backgroundColor": "#FF0000",
"buttons": [{
"text": "primary",
"deepLink": "nzcovidtracer://SomeScreen"
}, {
"text": "secondary",
"externalLink": "http://govt.nz",
"accessibilityHint": "Custom hint"
}]
}
```

#### Info blocks

| key | value |
| --- | ----- |
| component | `InfoBlock` |
| icon | optional, icon of the card |
| backgroundColor | optional, background of the card, defaults to `#FFF1D0` |
| title | required, title of the card |
| body | required, body of the card |

Example:
```json
{
"component": "InfoBlock",
"icon": "http://foo/image.png",
"backgroundColor": "#FF0000",
"title": "foo",
"body": "bar"
}
```

#### Sections

Section group cards and panels together:

| key | value |
| --- | ----- |
| title | optional, section title |
| data | an array of `Card` or `Panel` components |

There might be multiple sections in a scroll view.

Example (2 sections):
```json
[{
"data": [{
"component": "Panel",
"title": "foo",
"body": "bar",
"buttons": [{
"text": "primary",
"deepLink": "nzcovidtracer://SomeScreen"
}]
}, {
"component": "Card",
"title": "foo",
"body": "bar"
}]
},
{
"title": "Section 2",
"data": [{
"component": "Panel",
"title": "foo",
"body": "bar"
}]
}]
```


#### Deep links

For security and maintainability reasons, only a specified set of deeplinks will be supported

| link | behaviour |
| --- | ----- |
| nzcovidtracer://dashboard/today | Navigate to `dashboard` on the `today tab` |
| nzcovidtracer://dashboard/resources | Navigate to `dashboard` on the `resources tab` |
| nzcovidtracer://nhi | Navigate to `privacy` -> `add nhi`, if user has no NHI stored. Otherwise navigate to `edit nhi` |
| nzcovidtracer://diary | Navigate to `diary` |
| nzcovidtracer://manualEntry | Navigate to `manual entry` |

> Please note that these links are only supported from server driven components for now
2 changes: 2 additions & 0 deletions global.d.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
declare module "@bugfender/rn-bugfender";
declare module "react-native-bluetooth-state-manager";
declare module "react-native-google-safetynet";
declare module "react-native-ios11-devicecheck";
declare module "*.png";
12 changes: 9 additions & 3 deletions ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -359,6 +359,8 @@ PODS:
- RealmJS (6.1.2):
- GCDWebServer
- React
- RNBluetoothStateManager (1.3.1):
- React
- RNCAsyncStorage (1.12.0):
- React
- RNCClipboard (1.4.0):
Expand All @@ -382,8 +384,8 @@ PODS:
- Firebase/Messaging (~> 7.0.0)
- React-Core
- RNFBApp
- RNGestureHandler (1.8.0):
- React
- RNGestureHandler (1.10.3):
- React-Core
- RNIOS11DeviceCheck (0.0.3):
- React
- RNKeychain (6.2.0):
Expand Down Expand Up @@ -449,6 +451,7 @@ DEPENDENCIES:
- React-RCTVibration (from `../node_modules/react-native/Libraries/Vibration`)
- ReactCommon/turbomodule/core (from `../node_modules/react-native/ReactCommon`)
- RealmJS (from `../node_modules/realm`)
- RNBluetoothStateManager (from `../node_modules/react-native-bluetooth-state-manager`)
- "RNCAsyncStorage (from `../node_modules/@react-native-community/async-storage`)"
- "RNCClipboard (from `../node_modules/@react-native-community/clipboard`)"
- "RNCMaskedView (from `../node_modules/@react-native-community/masked-view`)"
Expand Down Expand Up @@ -567,6 +570,8 @@ EXTERNAL SOURCES:
:path: "../node_modules/react-native/ReactCommon"
RealmJS:
:path: "../node_modules/realm"
RNBluetoothStateManager:
:path: "../node_modules/react-native-bluetooth-state-manager"
RNCAsyncStorage:
:path: "../node_modules/@react-native-community/async-storage"
RNCClipboard:
Expand Down Expand Up @@ -661,6 +666,7 @@ SPEC CHECKSUMS:
React-RCTVibration: 4d2e726957f4087449739b595f107c0d4b6c2d2d
ReactCommon: a0a1edbebcac5e91338371b72ffc66aa822792ce
RealmJS: 44cd1b81352bbd37f582b5061d5abc1f6c783393
RNBluetoothStateManager: afd3d90feffa2e02bb4f6abad588648840d0f727
RNCAsyncStorage: 2a692bcb9b69b76a2f1a95f33db057129700af64
RNCClipboard: a1dd5a278566666ac8f9c9b517b7922c801bcd98
RNCMaskedView: 5a8ec07677aa885546a0d98da336457e2bea557f
Expand All @@ -670,7 +676,7 @@ SPEC CHECKSUMS:
RNFastImage: d4870d58f5936111c56218dbd7fcfc18e65b58ff
RNFBApp: 2810471bdc092151f20f16a9f8915b1ad70325b2
RNFBMessaging: 37ea050803005191f1c42ff02234353225429c07
RNGestureHandler: 7a5833d0f788dbd107fbb913e09aa0c1ff333c39
RNGestureHandler: a479ebd5ed4221a810967000735517df0d2db211
RNIOS11DeviceCheck: a4a545fdd08230a17a8ce7608e95038ee23a32aa
RNKeychain: b8e0711b959a19c5b057d1e970d3c83d159b6da5
RNPermissions: 477d88d0be7ecb0a7b344e4d5fbb0352de104626
Expand Down
14 changes: 14 additions & 0 deletions ios/UniteAppRN.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -817,6 +817,7 @@
"${BUILT_PRODUCTS_DIR}/KeychainSwift/KeychainSwift.framework",
"${BUILT_PRODUCTS_DIR}/PromisesObjC/FBLPromises.framework",
"${BUILT_PRODUCTS_DIR}/RCTTypeSafety/RCTTypeSafety.framework",
"${BUILT_PRODUCTS_DIR}/RNBluetoothStateManager/RNBluetoothStateManager.framework",
"${BUILT_PRODUCTS_DIR}/RNCAsyncStorage/RNCAsyncStorage.framework",
"${BUILT_PRODUCTS_DIR}/RNCClipboard/RNCClipboard.framework",
"${BUILT_PRODUCTS_DIR}/RNCMaskedView/RNCMaskedView.framework",
Expand Down Expand Up @@ -880,6 +881,7 @@
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/KeychainSwift.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/FBLPromises.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/RCTTypeSafety.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/RNBluetoothStateManager.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/RNCAsyncStorage.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/RNCClipboard.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/RNCMaskedView.framework",
Expand Down Expand Up @@ -953,6 +955,7 @@
"${BUILT_PRODUCTS_DIR}/KeychainSwift/KeychainSwift.framework",
"${BUILT_PRODUCTS_DIR}/PromisesObjC/FBLPromises.framework",
"${BUILT_PRODUCTS_DIR}/RCTTypeSafety/RCTTypeSafety.framework",
"${BUILT_PRODUCTS_DIR}/RNBluetoothStateManager/RNBluetoothStateManager.framework",
"${BUILT_PRODUCTS_DIR}/RNCAsyncStorage/RNCAsyncStorage.framework",
"${BUILT_PRODUCTS_DIR}/RNCClipboard/RNCClipboard.framework",
"${BUILT_PRODUCTS_DIR}/RNCMaskedView/RNCMaskedView.framework",
Expand Down Expand Up @@ -1016,6 +1019,7 @@
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/KeychainSwift.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/FBLPromises.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/RCTTypeSafety.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/RNBluetoothStateManager.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/RNCAsyncStorage.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/RNCClipboard.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/RNCMaskedView.framework",
Expand Down Expand Up @@ -1111,6 +1115,7 @@
"${BUILT_PRODUCTS_DIR}/KeychainSwift/KeychainSwift.framework",
"${BUILT_PRODUCTS_DIR}/PromisesObjC/FBLPromises.framework",
"${BUILT_PRODUCTS_DIR}/RCTTypeSafety/RCTTypeSafety.framework",
"${BUILT_PRODUCTS_DIR}/RNBluetoothStateManager/RNBluetoothStateManager.framework",
"${BUILT_PRODUCTS_DIR}/RNCAsyncStorage/RNCAsyncStorage.framework",
"${BUILT_PRODUCTS_DIR}/RNCClipboard/RNCClipboard.framework",
"${BUILT_PRODUCTS_DIR}/RNCMaskedView/RNCMaskedView.framework",
Expand Down Expand Up @@ -1174,6 +1179,7 @@
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/KeychainSwift.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/FBLPromises.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/RCTTypeSafety.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/RNBluetoothStateManager.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/RNCAsyncStorage.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/RNCClipboard.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/RNCMaskedView.framework",
Expand Down Expand Up @@ -1324,6 +1330,7 @@
"${BUILT_PRODUCTS_DIR}/KeychainSwift/KeychainSwift.framework",
"${BUILT_PRODUCTS_DIR}/PromisesObjC/FBLPromises.framework",
"${BUILT_PRODUCTS_DIR}/RCTTypeSafety/RCTTypeSafety.framework",
"${BUILT_PRODUCTS_DIR}/RNBluetoothStateManager/RNBluetoothStateManager.framework",
"${BUILT_PRODUCTS_DIR}/RNCAsyncStorage/RNCAsyncStorage.framework",
"${BUILT_PRODUCTS_DIR}/RNCClipboard/RNCClipboard.framework",
"${BUILT_PRODUCTS_DIR}/RNCMaskedView/RNCMaskedView.framework",
Expand Down Expand Up @@ -1387,6 +1394,7 @@
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/KeychainSwift.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/FBLPromises.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/RCTTypeSafety.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/RNBluetoothStateManager.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/RNCAsyncStorage.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/RNCClipboard.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/RNCMaskedView.framework",
Expand Down Expand Up @@ -1680,6 +1688,7 @@
"${BUILT_PRODUCTS_DIR}/KeychainSwift/KeychainSwift.framework",
"${BUILT_PRODUCTS_DIR}/PromisesObjC/FBLPromises.framework",
"${BUILT_PRODUCTS_DIR}/RCTTypeSafety/RCTTypeSafety.framework",
"${BUILT_PRODUCTS_DIR}/RNBluetoothStateManager/RNBluetoothStateManager.framework",
"${BUILT_PRODUCTS_DIR}/RNCAsyncStorage/RNCAsyncStorage.framework",
"${BUILT_PRODUCTS_DIR}/RNCClipboard/RNCClipboard.framework",
"${BUILT_PRODUCTS_DIR}/RNCMaskedView/RNCMaskedView.framework",
Expand Down Expand Up @@ -1743,6 +1752,7 @@
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/KeychainSwift.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/FBLPromises.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/RCTTypeSafety.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/RNBluetoothStateManager.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/RNCAsyncStorage.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/RNCClipboard.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/RNCMaskedView.framework",
Expand Down Expand Up @@ -1816,6 +1826,7 @@
"${BUILT_PRODUCTS_DIR}/KeychainSwift/KeychainSwift.framework",
"${BUILT_PRODUCTS_DIR}/PromisesObjC/FBLPromises.framework",
"${BUILT_PRODUCTS_DIR}/RCTTypeSafety/RCTTypeSafety.framework",
"${BUILT_PRODUCTS_DIR}/RNBluetoothStateManager/RNBluetoothStateManager.framework",
"${BUILT_PRODUCTS_DIR}/RNCAsyncStorage/RNCAsyncStorage.framework",
"${BUILT_PRODUCTS_DIR}/RNCClipboard/RNCClipboard.framework",
"${BUILT_PRODUCTS_DIR}/RNCMaskedView/RNCMaskedView.framework",
Expand Down Expand Up @@ -1879,6 +1890,7 @@
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/KeychainSwift.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/FBLPromises.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/RCTTypeSafety.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/RNBluetoothStateManager.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/RNCAsyncStorage.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/RNCClipboard.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/RNCMaskedView.framework",
Expand Down Expand Up @@ -1962,6 +1974,7 @@
"${BUILT_PRODUCTS_DIR}/KeychainSwift/KeychainSwift.framework",
"${BUILT_PRODUCTS_DIR}/PromisesObjC/FBLPromises.framework",
"${BUILT_PRODUCTS_DIR}/RCTTypeSafety/RCTTypeSafety.framework",
"${BUILT_PRODUCTS_DIR}/RNBluetoothStateManager/RNBluetoothStateManager.framework",
"${BUILT_PRODUCTS_DIR}/RNCAsyncStorage/RNCAsyncStorage.framework",
"${BUILT_PRODUCTS_DIR}/RNCClipboard/RNCClipboard.framework",
"${BUILT_PRODUCTS_DIR}/RNCMaskedView/RNCMaskedView.framework",
Expand Down Expand Up @@ -2025,6 +2038,7 @@
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/KeychainSwift.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/FBLPromises.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/RCTTypeSafety.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/RNBluetoothStateManager.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/RNCAsyncStorage.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/RNCClipboard.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/RNCMaskedView.framework",
Expand Down
8 changes: 8 additions & 0 deletions ios/UniteAppRN/AppDelegate.m
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
#import <Firebase.h>
#import "RNFBMessagingModule.h"
#import <react_native_exposure_notification_service-Swift.h>
#import <React/RCTLinkingManager.h>

#import <AppCenterReactNative.h>
#import <AppCenterReactNativeCrashes.h>
Expand Down Expand Up @@ -101,4 +102,11 @@ -(void)userNotificationCenter:(UNUserNotificationCenter *)center willPresentNoti
completionHandler(UNAuthorizationOptionSound | UNAuthorizationOptionAlert | UNAuthorizationOptionBadge);
}

// Required to enable deep linking for ios 9.x or newer
- (BOOL)application:(UIApplication *)application
openURL:(NSURL *)url
options:(NSDictionary<UIApplicationOpenURLOptionsKey,id> *)options
{
return [RCTLinkingManager application:application openURL:url options:options];
}
@end
Loading

0 comments on commit 15a018a

Please sign in to comment.