Skip to content

Commit

Permalink
Merge branch 'develop' into ts-feature-flags
Browse files Browse the repository at this point in the history
* develop: (22 commits)
  Translation refresh (#708)
  updated issue template (#729)
  Set up location after skiping the steps (#721)
  App shows green icon when tracking is inactive (#722)
  Fix postinstall script on Windows (#720)
  Fix isVersionGreater and add tests (#726)
  update the upgrade version to 1.0.0, to match what is in the master branch and avoid mistaken forced upgrades. (#723)
  1.0.1 (#715)
  Put GPS filter behind dev flag (#714)
  Fix headline1 text cutoff (#712)
  Put auto sub behind dev flags (#711)
  remove default news url from News.js constructor (#704)
  Fix i18n placeholder for authorities (#709)
  Remove react-native-maps (#695)
  Fix e2e authority auto sub tests (#706)
  Fallback to English translations in e2e tests (#697)
  Add ja and fil languages (#700)
  Add a script to pull translations from lokalise (#641)
  Really really push to lokalise (#699)
  Run lokalize push on merge into develop (#698)
  ...
  • Loading branch information
tstirrat committed Apr 30, 2020
2 parents b169ee7 + 6ce9fe1 commit ea6557a
Show file tree
Hide file tree
Showing 105 changed files with 2,775 additions and 1,405 deletions.
24 changes: 20 additions & 4 deletions .github/ISSUE_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,27 @@
<!-- When submitting an Issue against this repo, please follow these
guidelines to help us help you. -->

## Version

- Type of phone: Android / iPhone
- OS Version:
- Model: e.g. Samsung Galaxy S8
<!-- Make sure that you are testing against the latest beta or production version -->

<!-- Write the title in a proper, short, descriptive way with a format like: -->
<!-- [Section] - Issue -->
<!-- E.g. [Homepage] - Pulse circle offset -->

## Issue type
<!-- List all appliable type: (Localization, Hardware, UI -->

## Version
- Release build version: <!-- Put here the version of the app tested -->

## Affected Devices

| Brand | Model | OS |
| ------------ |:-------------:| ----:|
<!-- | Samsung | Galaxy S10 | 10.0 | -->

## Affected Languages
<!-- If the issue is specific in a single language please specify it -->

## Steps to reproduce

Expand Down
40 changes: 32 additions & 8 deletions .github/workflows/i18n.yml
Original file line number Diff line number Diff line change
@@ -1,23 +1,25 @@
name: i18n

on:
# upload strings merged into develop
push:
branches: [develop]
paths:
- app/locales/en.json
- ios/en.lproj/*.strings
- android/app/src/main/res/values/strings.xml
# for testing
# pull_request:
# branches: [develop]
# paths:
# - app/locales/en.json
# - ios/en.lproj/*.strings
# - android/app/src/main/res/values/strings.xml
- .github/workflows/*.yml
pull_request:
branches: [develop]
paths:
- app/locales/en.json
- ios/en.lproj/*.strings
- android/app/src/main/res/values/strings.xml
- .github/workflows/*.yml

jobs:
# Only run on a final merge into develop, uploads all changed keys to Lokalised
lokalise-upload:
if: github.event_name == 'push' && github.ref == 'refs/heads/develop'
runs-on: ubuntu-latest
env:
UPLOAD_FLAGS: --lang-iso=en --cleanup-mode --replace-modified --include-path --detect-icu-plurals --apply-tm --convert-placeholders --project-id=${{ secrets.LOKALISE_PROJECT_ID }} --token=${{ secrets.LOKALISE_TOKEN }}
Expand All @@ -29,3 +31,25 @@ jobs:

- name: upload English files
run: ./bin/lokalise2 file upload --file=app/locales/en.json,ios/en.lproj/InfoPlist.strings,ios/en.lproj/Localizable.strings,android/app/src/main/res/values/strings.xml $UPLOAD_FLAGS

# Run on PRs, checks for any added keys that are missing in the app/locales/en.json file
no-missing-keys:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master

- name: cached node_modules/
uses: actions/cache@v1
id: cache
with:
path: node_modules
key: ${{ runner.OS }}-yarn-cache-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.OS }}-yarn-cache-
- run: yarn --frozen-lockfile
if: steps.cache.outputs.cache-hit != 'true'

- run: yarn i18n:check


4 changes: 4 additions & 0 deletions .lokalise.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
project-id: 331553825e9baabce4a297.57936175
# Generate a READ_ONLY token from lokalise.com under your user profile:
# https://app.lokalise.com/profile
# token:
1 change: 1 addition & 0 deletions __mocks__/react-native-push-notification.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@ export default {
onNotification: jest.fn(),
addEventListener: jest.fn(),
requestPermissions: jest.fn(),
localNotification: jest.fn(),
};
4 changes: 2 additions & 2 deletions android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -144,8 +144,8 @@ android {
testBuildType System.getProperty('testBuildType', 'debug')
testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner'

versionCode 24
versionName "1.0.0"
versionCode 25
versionName "1.0.1"
}
splits {
abi {
Expand Down
3 changes: 0 additions & 3 deletions android/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,6 @@
<!-- Change the resource name to your App's accent color - or any other color you want -->
<meta-data android:name="com.dieam.reactnativepushnotification.notification_color"
android:resource="@android:color/white"/>
<meta-data
android:name="com.google.android.geo.API_KEY"
android:value="AIzaSyDNplqevzMxOGNuTr_lv6NXsjzIa1PboVc"/>

<service
android:name="com.dieam.reactnativepushnotification.modules.RNPushNotificationListenerService"
Expand Down
5 changes: 5 additions & 0 deletions android/app/src/main/res/values-es/strings.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<resources>
<!-- Channel label for notifications shown in App > Notifications > Safe Paths -->
<string name="notification_channel_description">Configurar notificaciones locales</string>
</resources>
5 changes: 5 additions & 0 deletions android/app/src/main/res/values-ht/strings.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<resources>
<!-- Channel label for notifications shown in App > Notifications > Safe Paths -->
<string name="notification_channel_description">Kenbe tout notifikasyon lokal yo</string>
</resources>
5 changes: 5 additions & 0 deletions android/app/src/main/res/values-it/strings.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<resources>
<!-- Channel label for notifications shown in App > Notifications > Safe Paths -->
<string name="notification_channel_description">Gestisci tutte le notifiche locali</string>
</resources>
5 changes: 5 additions & 0 deletions android/app/src/main/res/values-ml/strings.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<resources>
<!-- Channel label for notifications shown in App > Notifications > Safe Paths -->
<string name="notification_channel_description">എല്ലാ പ്രാദേശിക അറിയിപ്പുകളും കൈകാര്യം ചെയ്യുക</string>
</resources>
5 changes: 5 additions & 0 deletions android/app/src/main/res/values-nl/strings.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<resources>
<!-- Channel label for notifications shown in App > Notifications > Safe Paths -->
<string name="notification_channel_description">Alle lokale meldingen afhandelen</string>
</resources>
5 changes: 5 additions & 0 deletions android/app/src/main/res/values-pl/strings.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<resources>
<!-- Channel label for notifications shown in App > Notifications > Safe Paths -->
<string name="notification_channel_description">Obsługa wszystkich lokalnych powiadomień</string>
</resources>
5 changes: 5 additions & 0 deletions android/app/src/main/res/values-ru/strings.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<resources>
<!-- Channel label for notifications shown in App > Notifications > Safe Paths -->
<string name="notification_channel_description">Настроить местные оповещения</string>
</resources>
5 changes: 5 additions & 0 deletions android/app/src/main/res/values-sk/strings.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<resources>
<!-- Channel label for notifications shown in App > Notifications > Safe Paths -->
<string name="notification_channel_description">Safe Paths upozornenia</string>
</resources>
15 changes: 7 additions & 8 deletions android/app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<resources>
<!-- Shown on app info, app switcher, etc -->
<string name="app_name" translatable="false">COVID Safe Paths</string>

<!-- Shown below icon on launcher only -->
<string name="app_name_short" translatable="false">Safe Paths</string>

<!-- Channel label for notifications shown in App > Notifications > Safe Paths -->
<string name="notification_channel_description">Handle all local notifications</string>
<!-- Shown on app info, app switcher, etc -->
<string name="app_name" translatable="false">COVID Safe Paths</string>
<!-- Shown below icon on launcher only -->
<string name="app_name_short" translatable="false">Safe Paths</string>
<!-- Channel label for notifications shown in App > Notifications > Safe Paths -->
<string name="notification_channel_description">Safe Paths notifications</string>
</resources>
1 change: 0 additions & 1 deletion app/Entry.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ class Entry extends Component {
componentDidMount() {
GetStoreData('ONBOARDING_DONE')
.then(onboardingDone => {
console.log(onboardingDone);
this.setState({
initialRouteName: onboardingDone,
});
Expand Down
6 changes: 2 additions & 4 deletions app/Util.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import dayjs from 'dayjs';
import { Platform } from 'react-native';
import semver from 'semver';

export function isPlatformiOS() {
return Platform.OS === 'ios';
Expand All @@ -13,10 +14,7 @@ export function nowStr() {
return dayjs().format('H:mm');
}

export const isVersionGreater = (source, target) =>
source
.split('.')
.some((val, index) => parseInt(val) > parseInt(target.split('.')[index]));
export const isVersionGreater = (source, target) => semver.gt(source, target);

export default {
isPlatformiOS,
Expand Down
27 changes: 27 additions & 0 deletions app/__tests__/Util.spec.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
import { isVersionGreater } from '../Util';

describe('Util class', () => {
let versions;

beforeEach(() => {
versions = [
['0.0.1', '0.0.0', true],
['1.0.1', '0.9.9', true],
['3.0.0', '2.7.2+asdf', true],
['1.2.3-a.10', '1.2.3-a.5', true],
['1.2.3-a.b', '1.2.3-a', true],
['0.9.5', '1.0.1', false],
['0.9.9', '1.0.0', false],
['1.3.4', '1.3.5', false],
['2.9.1', '3.0.0', false],
['1.2.3', '1.2.3', false],
];
});

it('version greater than works', () => {
versions.forEach(([v0, v1, expectedValue]) => {
const result = isVersionGreater(v0, v1);
expect(result).toBe(expectedValue);
});
});
});
2 changes: 1 addition & 1 deletion app/components/NativePicker.js
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ export default class NativePicker extends Component {
marginRight: 22,
}}
onPress={() => this.setState({ modalVisible: false })}>
{languages.t('Done')}
{languages.t('common.done')}
</Typography>
</View>
<View
Expand Down
2 changes: 1 addition & 1 deletion app/components/Typography.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ const FONT_SIZE_MAP = {
const getFontSize = ({ use = Type.Body1 }) => FONT_SIZE_MAP[use];

const LINE_HEIGHT_MAP = {
[Type.Headline1]: '48px',
[Type.Headline1]: '52px',
[Type.Headline2]: '34px',
[Type.Headline3]: '40px',
[Type.Body1]: '24px',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ exports[`headline1 is large and bold 1`] = `
"fontFamily": "IBMPlexSans-Bold",
"fontSize": 52,
"fontWeight": "bold",
"lineHeight": 48,
"lineHeight": 52,
"writingDirection": "ltr",
}
}
Expand Down
2 changes: 1 addition & 1 deletion app/constants/__tests__/__snapshots__/Theme.spec.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ exports[`includes extra background View if setBackground=true 1`] = `
"fontFamily": "IBMPlexSans-Bold",
"fontSize": 52,
"fontWeight": "bold",
"lineHeight": 48,
"lineHeight": 52,
"writingDirection": "ltr",
}
}
Expand Down
1 change: 1 addition & 0 deletions app/constants/storage.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,4 @@ export const DEBUG_MODE = 'DEBUG_MODE';
export const AUTHORITY_NEWS = 'AUTHORITY_NEWS';
export const LAST_CHECKED = 'LAST_CHECKED';
export const AUTHORITY_SOURCE_SETTINGS = 'AUTHORITY_SOURCE_SETTINGS';
export const ENABLE_HCA_AUTO_SUBSCRIPTION = 'ENABLE_HCA_AUTO_SUBSCRIPTION';
4 changes: 1 addition & 3 deletions app/helpers/General.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@ import AsyncStorage from '@react-native-community/async-storage';
import DocumentPicker from 'react-native-document-picker';

/**
* Get Data from Store
* Get data from store
*
* @param {string} key
* @param {boolean} isString
Expand All @@ -25,7 +24,6 @@ export async function GetStoreData(key, isString = true) {

/**
* Set data from store
*
* @param {string} key
* @param {object} item
Expand Down
4 changes: 2 additions & 2 deletions app/helpers/Intersect.js
Original file line number Diff line number Diff line change
Expand Up @@ -276,9 +276,9 @@ export function checkIntersect() {
*/
async function asyncCheckIntersect() {
// first things first ... is it time to actually try the intersection?
let last_checked_ms = Number(await GetStoreData(LAST_CHECKED));
let lastCheckedMs = Number(await GetStoreData(LAST_CHECKED));
if (
last_checked_ms + MIN_CHECK_INTERSECT_INTERVAL * 60 * 1000 >
lastCheckedMs + MIN_CHECK_INTERSECT_INTERVAL * 60 * 1000 >
dayjs().valueOf()
)
return null;
Expand Down
Loading

0 comments on commit ea6557a

Please sign in to comment.