Skip to content

Commit

Permalink
Merge branch 'develop' into ts-theme-button
Browse files Browse the repository at this point in the history
* develop: (60 commits)
  Recommend PR best practices in PR template (#750)
  Add eslint react-hooks checks (#751)
  iOS: Added local notification in terminate function. (#521)
  Update dev README (#705)
  Better error logging in Google import (#703)
  Remove rebasing from suggestions in CONTRIBUTING.md (#724)
  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)
  ...
  • Loading branch information
tstirrat committed May 2, 2020
2 parents 0a32ff1 + 9bb5a57 commit 4b91a3e
Show file tree
Hide file tree
Showing 162 changed files with 5,542 additions and 2,114 deletions.
17 changes: 16 additions & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,11 @@ module.exports = {
extends: [
'eslint:recommended',
'plugin:react/recommended',
'plugin:react-hooks/recommended',
'plugin:jest/recommended',
],
parser: 'babel-eslint',
plugins: ['react', 'react-native', 'detox'],
plugins: ['react', 'react-hooks', 'react-native', 'detox'],
parserOptions: {
ecmaVersion: 6,
sourceType: 'module',
Expand Down Expand Up @@ -65,4 +66,18 @@ module.exports = {
'react/react-in-jsx-scope': 2, // Prevent missing React when using JSX
'react/self-closing-comp': 2, // Prevent extra closing tags for components without children
},
overrides: [
{
files: ['*.spec.js'], // Or *.test.js
rules: {
'react-native/no-raw-text': 0,
},
},
{
files: ['e2e/**/*.js'], // Or *.test.js
rules: {
'jest/expect-expect': 0, // these files do expectations inside page objects
},
},
],
};
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
16 changes: 13 additions & 3 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,17 @@
## Description
<!-- Please read https://github.com/tripleblindmarket/covid-safe-paths/wiki/Pull-Request-Best-Practices for recommended best practices before opening your first pull request -->

<!-- Description of what the PR does, including a fixed issue with Resolves #{issue number} -->
#### Description:

## How to test
<!-- Description of what the PR does -->

#### Linked issues:

<!-- Add issues here e.g.: Fixes #1234 -->

#### Screenshots:

<!-- If you're changing visuals, add a screenshot here -->

#### How to test:

<!-- Description of how to validate or test this PR -->
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


2 changes: 2 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,7 @@ jobs:
- run: yarn test:e2e:iphone11

- name: Upload Screenshots
if: always()
uses: actions/upload-artifact@v1
with:
name: iPhone 11 screenshots
Expand Down Expand Up @@ -182,6 +183,7 @@ jobs:
- run: yarn test:e2e:iphone-se

- name: Upload Screenshots
if: always()
uses: actions/upload-artifact@v1
with:
name: iPhone SE screenshots
Expand Down
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:
2 changes: 2 additions & 0 deletions App.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,12 @@ import SplashScreen from 'react-native-splash-screen';

import { Theme } from './app/constants/themes';
import Entry from './app/Entry';
import VersionCheckService from './app/services/VersionCheckService';

const App = () => {
useEffect(() => {
SplashScreen.hide();
VersionCheckService.start();
}, []);

return (
Expand Down
107 changes: 48 additions & 59 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@

We welcome participation in an open project. We want to make it as easy as possible for people to work together, so please follow these guidelines to prepare and submit a pull request.

## How to prepare
- Filtering by [good first issues](https://github.com/tripleblindmarket/covid-safe-paths/labels/good%20first%20issue) is the recommended way to begin contributing to the project

## Create A New Issue

- You need a Github account. You can [create one](https://github.com/signup/free) for free.

Expand All @@ -23,71 +25,71 @@ We welcome participation in an open project. We want to make it as easy as possi

cd ~ # get to your home directory or where ever you want to go

git clone https://github.com/YOURACCOUNT/covid-safe-paths
git clone git@github.com:YOURACCOUNT/covid-safe-paths.git

# change into the newly created directory
cd covid-safe-paths

# set upstream against COVID Safe Paths repository
git remote add upstream https://github.com/tripleblindmarket/covid-safe-paths.git
git remote add upstream git@github.com:tripleblindmarket/covid-safe-paths.git

```

(see also how to [fork a repo](https://help.github.com/articles/fork-a-repo/))

## Make Changes

1. Create a branch based on the `develop` branch on your forked repository. Name the branch something to reflect what you are doing. For example, if you want to add a new icon, a branch name you could use:

```bash
git checkout develop # you want to branch from the main 'develop' branch

git pull # make sure you have the latest code when you start the branch

git checkout -b "feature/new-icon" develop # new branch created!

"or"

git checkout -b "fix/new-icon" develop # new branch created!

"or"

git checkout -b "release/new-icon" develop # new branch created!
```

2. Stick to the coding style and patterns that are used already.

3. Document code! Comments are good. More comments are better. :)

4. Make commits as you desire. Ultimately they will be squashed, so make

notes to yourself. It's as simple as `git commit -m "commit message goes here"`!

5. Rebase your feature branch with upstream/develop to avoid any code conflicts:
### Create a branch

1. Always create a new branch from the latest `upstream/develop`:
```bash
git checkout develop # you want to branch from the latest 'develop' branch
git pull upstream/develop # make sure you have the latest code from upstream
git push origin develop # optional, push these changes to YOUR fork's develop branch
```
2. Create the branch. Name the branch something to reflect what you are doing.
```
git checkout -b "feature/new-icon" develop # new branch created!
"or"
git checkout -b "fix/new-icon" develop # new branch created!
"or"
git checkout -b "release/new-icon" develop # new branch created!
```
3. Stick to the coding style and patterns that are used already.
4. Document code! Comments are good. More comments are better. :)
5. Make commits as you desire. Ultimately they will be squashed, so make notes to yourself. It's as simple as `git commit -m "commit message goes here"`!

### Merge upstream/develop into your branch to get the latest changes.

```bash
# 1. Rebase Base(COVID Safe Paths) repository with fork repository - develop branch

git checkout develop # switch to base branch(local)

git fetch upstream # fetch latest commits from "COVID Safe Paths" develop branch

git rebase upstream/develop # rebase code against your forked develop branch(local)
# if you've already done this it will fail, that's fine:
git remote add upstream [email protected]:tripleblindmarket/covid-safe-paths.git

git push -f origin develop # push rebased code after resolving conflicts to forked develop branch(remote)
# ensure you are on your feature/fix branch
git checkout feature/my-feature

# 2. Rebase feature branch(local) with develop branch(local)
# get latest upstream branches e.g. upstream/develop
git fetch upstream

git checkout <feature-branch-name-you-created> # switch back to original feature branch(local) you are working
# merge upstream/develop into your local branch, this will always create a single merge commit
git merge upstream/develop --no-ff

git rebase develop # now rebase your feature branch(local) against develop branch(local)
# you may need to resolve conflicts. If so, resolve them and commit the merge:
git commit

git push origin feature/<your-feature-branch-name> # after resolving all conflicts, push your new feature branch to the remote forked repository
# push your changes up to your branch again
git push -u origin

# now your feature branch is ready for PR against COVID Safe Paths develop branch.
```

6. Start a PR to submit your changes back to the original project:
### Start a PR to submit your changes back to the original project:

- Visit https://github.com/your-git-userid/covid-safe-paths/branches

Expand All @@ -108,25 +110,10 @@ git push origin feature/<your-feature-branch-name> # after resolving all conflic

- Provide a meaningful title and description to your PR, as shown in the above image.
- Provide Issue ID on PR description to link/close the issue upon PR merged.
- If you are changing visuals, please provide screenshots so the PR reviewer can see what you've done without running it in the app.

## Helpful resources on Git

- Git commands:

```
git checkout develop
git fetch
git reset --hard origin/develop
git checkout <your_branch_name>
git rebase develop
git push -f
```

- Documentation on how to [create a Pull Request (PR) on Github](https://help.github.com/articles/using-pull-requests/) for review and merging.

**Note**: Even if you have write access, do not work directly on `master` or push directly to `develop`! All work is done against `develop` reviewed and merged via PRs, and ultimately `develop` gets merged into `master` for tagged code releases.
Expand Down Expand Up @@ -173,6 +160,8 @@ _Advanced users may install the `hub` gem and use the [`hub pull-request` comman

## Reviewing Pull Requests

- If you are using VS Code, use the [GitHub PR extension](https://marketplace.visualstudio.com/items?itemName=GitHub.vscode-pull-request-github), which will allow you to checkout and run anyone's PR with ease.

- Open the PR on Github. At the top of the PR page is a number which identifies it -123 and the name of the author's branch -branch-name. Copy down both of these.

* Open git bash and ensure your working directory is clean by running `git status`
Expand Down
Loading

0 comments on commit 4b91a3e

Please sign in to comment.