Skip to content

Commit 759c172

Browse files
authored
Merge pull request #590 from mapswipe/dev
merge togglecorp work into master
2 parents 3143428 + a6106bd commit 759c172

File tree

459 files changed

+509785
-458581
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

459 files changed

+509785
-458581
lines changed

.github/workflows/actions.yml

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -24,24 +24,25 @@ jobs:
2424
- name: Code style
2525
working-directory: ./mapswipe_workers
2626
run: |
27-
black --check mapswipe_workers
28-
flake8 --count --config setup.cfg mapswipe_workers/
29-
isort --check --settings-file setup.cfg mapswipe_workers/
27+
black --check mapswipe_workers ../django
28+
flake8 --count --config setup.cfg mapswipe_workers/ ../django/
29+
isort --check --settings-file setup.cfg mapswipe_workers/ ../django/
3030
- name: Setup Postgres Database Container
3131
env:
32-
POSTGRES_PASSWORD: test
33-
POSTGRES_USER: test
34-
POSTGRES_DB: test
32+
POSTGRES_PASSWORD: postgres
33+
POSTGRES_USER: postgres
34+
POSTGRES_DB: postgres
3535
run: |
3636
# Create a mock file for wal-g setup
3737
touch postgres/serviceAccountKey.json
3838
docker-compose up --build --detach postgres
39+
for i in {1..5}; do docker-compose exec -T postgres pg_isready && s=0 && break || s=$? && sleep 5; done; (docker-compose logs postgres && exit $s)
3940
- name: Deploy Firebase Rules and Functions
4041
env:
4142
FIREBASE_TOKEN: ${{ secrets.FIREBASE_TOKEN }}
4243
FIREBASE_DB: ${{ secrets.FIREBASE_DB }}
4344
run: |
44-
docker-compose run firebase_deploy sh -c "firebase use $FIREBASE_DB && firebase deploy --token $FIREBASE_TOKEN --only database:rules"
45+
docker-compose run --rm firebase_deploy sh -c "firebase use $FIREBASE_DB && firebase deploy --token $FIREBASE_TOKEN --only database"
4546
- name: Decrypt Service Account Key File
4647
working-directory: ./
4748
run: |
@@ -55,10 +56,12 @@ jobs:
5556
env:
5657
FIREBASE_API_KEY: ${{ secrets.FIREBASE_API_KEY }}
5758
FIREBASE_DB: ${{ secrets.FIREBASE_DB }}
58-
POSTGRES_PASSWORD: test
59-
POSTGRES_USER: test
60-
POSTGRES_DB: test
59+
POSTGRES_PASSWORD: postgres
60+
POSTGRES_USER: postgres
61+
POSTGRES_DB: postgres
6162
OSMCHA_API_KEY: ${{ secrets.OSMCHA_API_KEY }}
63+
DJANGO_SECRET_KEY: test-django-secret-key
6264
run: |
63-
docker-compose run mapswipe_workers_creation python -m unittest discover --verbose --start-directory tests/unittests/
64-
docker-compose run mapswipe_workers_creation python -m unittest discover --verbose --start-directory tests/integration/
65+
docker-compose run --rm mapswipe_workers_creation python -m unittest discover --verbose --start-directory tests/unittests/
66+
docker-compose run --rm mapswipe_workers_creation bash -c 'pip install pytest && pytest -ra -v --durations=10 tests/integration/'
67+
docker-compose run --rm django pytest -ra -v --durations=10

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ coverage.xml
5757
# Django stuff:
5858
*.log
5959
local_settings.py
60+
django/assets # Static/media files
6061

6162
# Flask stuff:
6263
instance/
@@ -117,7 +118,10 @@ ENV/
117118
# don´t upload data dir
118119
data/
119120
mapswipe-data/
121+
django-data/
120122
postgres-data/
123+
pgdata_restored/
124+
django/db.sqlite3
121125

122126
# don't upload app config for project managers dashboard
123127
app.js

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,4 +24,4 @@ update_firebase_functions_and_db_rules:
2424
docker compose run --rm firebase_deploy
2525

2626
deploy_latest_workers_version:
27-
git pull; docker compose build postgres manager_dashboard nginx api mapswipe_workers_creation mapswipe_workers_stats mapswipe_workers_firebase_to_postgres firebase_deploy; docker compose up -d postgres manager_dashboard nginx api mapswipe_workers_creation mapswipe_workers_stats mapswipe_workers_firebase_to_postgres firebase_deploy
27+
git pull; docker compose build postgres django django-schedule-task manager_dashboard community_dashboard nginx api mapswipe_workers_creation mapswipe_workers_stats mapswipe_workers_firebase_to_postgres firebase_deploy; docker compose up -d postgres django django-schedule-task manager_dashboard community_dashboard nginx api mapswipe_workers_creation mapswipe_workers_stats mapswipe_workers_firebase_to_postgres firebase_deploy

community-dashboard/.babelrc

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
{
2+
"presets": [
3+
"@babel/preset-env",
4+
"@babel/preset-react",
5+
"@babel/preset-typescript",
6+
],
7+
"plugins": [
8+
// Reuse babel's injected headers
9+
"@babel/plugin-transform-runtime",
10+
11+
// Handle absolute imports
12+
["babel-plugin-module-resolver", {
13+
"root": ["."],
14+
"extensions": [".js", ".jsx", ".ts", ".tsx"],
15+
"alias": {
16+
"#generated": "./generated",
17+
"#components": "./app/components",
18+
"#views": "./app/views",
19+
"#resources": "./app/resources",
20+
"#base": "./app/Base",
21+
"#utils": ["./app/Base/utils"],
22+
"#hooks": './app/hooks',
23+
},
24+
}],
25+
26+
// Extends javascript support
27+
"@babel/plugin-syntax-dynamic-import",
28+
"@babel/plugin-proposal-do-expressions",
29+
30+
// Extends react support
31+
"@babel/plugin-transform-react-constant-elements",
32+
// "@babel/plugin-transform-react-inline-elements",
33+
34+
// Extends graphql support
35+
'babel-plugin-graphql-tag',
36+
37+
// NOTE: we may not need to install these as well
38+
// Polyfill
39+
["polyfill-corejs3", {
40+
"method": "usage-global",
41+
}],
42+
["polyfill-regenerator", {
43+
"method": "usage-global",
44+
}],
45+
],
46+
}

community-dashboard/.dockerignore

Lines changed: 145 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,145 @@
1+
media
2+
postgres-data
3+
redis-data
4+
5+
production.env
6+
7+
# Swap files
8+
*.swp
9+
10+
# Byte-compiled / optimized / DLL files
11+
__pycache__
12+
*.py[cod]
13+
*$py.class
14+
15+
# C extensions
16+
*.so
17+
18+
# Distribution / packaging
19+
.Python
20+
env
21+
build
22+
develop-eggs
23+
dist
24+
downloads
25+
eggs
26+
.eggs
27+
lib
28+
lib64
29+
parts
30+
sdist
31+
var
32+
*.egg-info
33+
.installed.cfg
34+
*.egg
35+
36+
# PyInstaller
37+
# Usually these files are written by a python script from a template
38+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
39+
*.manifest
40+
*.spec
41+
42+
# Installer logs
43+
pip-log.txt
44+
pip-delete-this-directory.txt
45+
46+
# Unit test / coverage reports
47+
htmlcov
48+
.tox
49+
.coverage
50+
.coverage.*
51+
.cache
52+
nosetests.xml
53+
coverage.xml
54+
*,cover
55+
.hypothesis
56+
57+
# Translations
58+
*.mo
59+
*.pot
60+
61+
# Django stuff:
62+
*.log
63+
64+
# Sphinx documentation
65+
docs/_build
66+
67+
# PyBuilder
68+
target
69+
70+
#Ipython Notebook
71+
.ipynb_checkpoints
72+
73+
# SASS cache
74+
.sass-cache
75+
media_test
76+
77+
# Rope project settings
78+
.ropeproject
79+
80+
81+
# Logs
82+
logs
83+
*.log
84+
npm-debug.log*
85+
yarn-debug.log*
86+
yarn-error.log*
87+
88+
# Runtime data
89+
pids
90+
*.pid
91+
*.seed
92+
*.pid.lock
93+
94+
# Directory for instrumented libs generated by jscoverage/JSCover
95+
lib-cov
96+
97+
# Coverage directory used by tools like istanbul
98+
coverage
99+
100+
# nyc test coverage
101+
.nyc_output
102+
103+
# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
104+
.grunt
105+
106+
# Bower dependency directory (https://bower.io/)
107+
bower_components
108+
109+
# node-waf configuration
110+
.lock-wscript
111+
112+
# Compiled binary addons (http://nodejs.org/api/addons.html)
113+
build/Release
114+
115+
# Dependency directories
116+
node_modules
117+
jspm_packages
118+
119+
# Typescript v1 declaration files
120+
typings
121+
122+
# Optional npm cache directory
123+
.npm
124+
125+
# Optional eslint cache
126+
.eslintcache
127+
128+
# Optional REPL history
129+
.node_repl_history
130+
131+
# Output of 'npm pack'
132+
*.tgz
133+
134+
# Yarn Integrity file
135+
.yarn-integrity
136+
137+
# dotenv environment variables file
138+
.env
139+
.env*
140+
141+
# Sensitive Deploy Files
142+
deploy/eb/
143+
144+
# tox
145+
./.tox

community-dashboard/.env.example

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
REACT_APP_SENTRY_DSN=
2+
REACT_APP_SENTRY_TRACES_SAMPLE_RATE=
3+
REACT_APP_ENVIRONMENT=
4+
5+
GRAPHQL_CODEGEN_ENDPOINT=
6+
REACT_APP_GRAPHQL_ENDPOINT=

community-dashboard/.eslintignore

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
node_modules
2+
build
3+
generated
4+
.*
5+
*.test.js
6+
*.test.ts
7+
*.test.jsx
8+
*.test.tsx

0 commit comments

Comments
 (0)