-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
cfcb83d
commit b8bf79c
Showing
291 changed files
with
22,673 additions
and
1,806 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
#!/usr/bin/env bash | ||
set -e # halt script on error | ||
|
||
echo "Get ready, we're pushing to gh-pages!" | ||
cd dist | ||
git init | ||
git config user.name "Travis-CI" | ||
git config user.email "[email protected]" | ||
git add . | ||
git commit -m "CI deploy to gh-pages" | ||
git push --force --quiet "https://${GH_TOKEN}@github.com/${TRAVIS_REPO_SLUG}.git" master:gh-pages > /dev/null 2>&1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,8 @@ | ||
#!/usr/bin/env bash | ||
set -e # halt script on error | ||
# If deploying, don't balk on lint errors | ||
if [ $TRAVIS_PULL_REQUEST = "false" ] && [ $TRAVIS_BRANCH = ${PRODUCTION_BRANCH} ]; then | ||
npm run lint || true | ||
if [ $TRAVIS_PULL_REQUEST = "false" ] && [ $TRAVIS_BRANCH = ${DEPLOY_BRANCH} ]; then | ||
yarn run lint || true | ||
else | ||
npm run lint | ||
yarn run lint | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
# EditorConfig is awesome: https://EditorConfig.org | ||
|
||
# top-most EditorConfig file | ||
root = true | ||
|
||
# Unix-style newlines with a newline ending every file | ||
[*] | ||
end_of_line = lf | ||
insert_final_newline = true | ||
|
||
# Matches multiple files with brace expansion notation | ||
# Set default charset | ||
[*.{js}] | ||
charset = utf-8 | ||
|
||
# Indentation override for all JS under lib directory | ||
[lib/**.js] | ||
indent_style = space | ||
indent_size = 2 | ||
|
||
# Matches the exact files either package.json or .travis.yml | ||
[{package.json,.travis.yml}] | ||
indent_style = space | ||
indent_size = 2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
10 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,35 @@ | ||
language: node_js | ||
node_js: | ||
- '4' | ||
- '10' | ||
env: | ||
global: | ||
- PRODUCTION_BRANCH=publish | ||
cache: | ||
directories: | ||
- node_modules | ||
before_install: | ||
- chmod +x ./.build_scripts/lint.sh | ||
script: | ||
# - npm test | ||
# - ./.build_scripts/lint.sh | ||
- npm run build | ||
- STAGING_BRANCH=develop | ||
- PRODUCTION_BRANCH=master | ||
cache: npm | ||
script: npm run lint | ||
after_success: | ||
- '[[ $TRAVIS_BRANCH == $STAGING_BRANCH ]] && npm run stage' | ||
- '[[ $TRAVIS_BRANCH == $PRODUCTION_BRANCH ]] && npm run build' | ||
deploy: | ||
- provider: s3 | ||
access_key_id: AKIAIHACHLPCT2PIL4TA | ||
secret_access_key: | ||
secure: JmalFAU1SCF2NruC1FjpsfvBPMyyZAc0FrFefki8mC6r8QamQyv/xesq0KPQlraA1Lll0dE1b7qMdoSZNZIR8itzOlDQZXC4Hnu4HEd+vOhAkkVlCPSxF3yGvL/i2OGL+ocJmY5tlGcPzWD8TSBpLFlML5dUhUwAWIhxDXnHQuAFaC/yIkmO2lq3ldSwAy/4CVX+24wh2kg8pNms0T9FVTGSirERJwMsUFLKzXtcUd0QLWZ1j2Fao1CClSiiRX2841F0UNIkQOm5XFbIii4iCr+xtq+U1LmqoMnGi78WwR0JuZ+WgbPFfxXuHHVtQrVngOWGrSm0SJwx+IplqwVq1u/IQM+vAK36UIv0at5vZ77eGP4wOnpBA2J/Vdie/41/4+E4aIxcUBFZmtdfwolSdT9LXJrJP8KgmV3suwcbX5h/8/6dsI+7pGTi+CX9fQ4Ecs0rUtBmynNV4SP6jgJoylDRoZHAf/HZCs//JsA2nbO8E5JUf5tLAHTU0aDEI7EaMdtDO46EYnQhbeHp5MdnFrz6jZm42FqkYsIaA423X4cYsDuRph1IV6gqJiSzeGwfyDxDCFYke2+uEm3CDu10jCdTaNMcchdpg7/1VUjdq3V+A+uz8Eq/OeK1JRfPkFD7RzcJx18nNNMjHQQkiknjJc8/jNKzc9GZSjADXWFRpoo= | ||
bucket: metadata.openaq-staging.org | ||
acl: public_read | ||
local_dir: dist | ||
skip_cleanup: true | ||
on: | ||
repo: openaq/openaq-metadata-editor | ||
branch: ${STAGING_BRANCH} | ||
- provider: s3 | ||
access_key_id: AKIAIHACHLPCT2PIL4TA | ||
secret_access_key: | ||
secure: JmalFAU1SCF2NruC1FjpsfvBPMyyZAc0FrFefki8mC6r8QamQyv/xesq0KPQlraA1Lll0dE1b7qMdoSZNZIR8itzOlDQZXC4Hnu4HEd+vOhAkkVlCPSxF3yGvL/i2OGL+ocJmY5tlGcPzWD8TSBpLFlML5dUhUwAWIhxDXnHQuAFaC/yIkmO2lq3ldSwAy/4CVX+24wh2kg8pNms0T9FVTGSirERJwMsUFLKzXtcUd0QLWZ1j2Fao1CClSiiRX2841F0UNIkQOm5XFbIii4iCr+xtq+U1LmqoMnGi78WwR0JuZ+WgbPFfxXuHHVtQrVngOWGrSm0SJwx+IplqwVq1u/IQM+vAK36UIv0at5vZ77eGP4wOnpBA2J/Vdie/41/4+E4aIxcUBFZmtdfwolSdT9LXJrJP8KgmV3suwcbX5h/8/6dsI+7pGTi+CX9fQ4Ecs0rUtBmynNV4SP6jgJoylDRoZHAf/HZCs//JsA2nbO8E5JUf5tLAHTU0aDEI7EaMdtDO46EYnQhbeHp5MdnFrz6jZm42FqkYsIaA423X4cYsDuRph1IV6gqJiSzeGwfyDxDCFYke2+uEm3CDu10jCdTaNMcchdpg7/1VUjdq3V+A+uz8Eq/OeK1JRfPkFD7RzcJx18nNNMjHQQkiknjJc8/jNKzc9GZSjADXWFRpoo= | ||
bucket: metadata.openaq.org | ||
acl: public_read | ||
local_dir: dist | ||
skip_cleanup: true | ||
on: | ||
repo: openaq/openaq-metadata-editor | ||
branch: ${PRODUCTION_BRANCH} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
MIT License | ||
|
||
Copyright (c) 2018 Development Seed | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE. |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,44 +1,33 @@ | ||
# OpenAQ Uploader Page | ||
A page used to upload CSV data to the OpenAQ project, which checks the data against rules in a JSON schema and delivers helpful error messages in cases of nonconformance. | ||
# openaq-upload-tool | ||
|
||
## Development environment | ||
To set up the development environment for this website, you'll need to install the following on your system: | ||
A tool to upload research-grade data to the OpenAQ platform | ||
|
||
- Node (v4.2.x) & Npm ([nvm](https://github.com/creationix/nvm) usage is advised) | ||
## Dev dependencies | ||
|
||
> The versions mentioned are the ones used during development. It could work with newer ones. | ||
- [gulp](https://github.com/gulpjs/gulp) | ||
- [nvm](https://github.com/nvm-sh/nvm#install-script) | ||
|
||
After these basic requirements are met, run the following commands in the website's folder: | ||
``` | ||
$ npm install | ||
``` | ||
|
||
## Development environment (server) | ||
This site depends on the server to acquire credentials for uploading to S3. At present, it sends | ||
a file name to an API which returns the parameters necessary to sign an AWS S3 upload submission form, as listed below: | ||
``` | ||
data.append('acl', params.acl); | ||
data.append('key', params.key); | ||
data.append('policy', params.policy); | ||
data.append('success_action_status', params['success_action_status']); | ||
data.append('x-amz-algorithm', params['x-amz-algorithm']); | ||
data.append('x-amz-credential', params['x-amz-credential']); | ||
data.append('x-amz-date', params['x-amz-date']); | ||
data.append('x-amz-signature', params['x-amz-signature']); | ||
data.append('file', file); | ||
``` | ||
## Getting started | ||
|
||
In production, this API will integrated with the larger OpenAQ project, but a development server can be launched locally from the __server__ directory of this project. After running `npm install` in the __server__ directory, the server can be launched using the command `env S3_ACCESS_KEY=xxx S3_SECRET_KEY=xxx S3_BUCKET=xxx S3_REGION=xxx node server.js`, with the credentials to the desired S3 bucket. The bucket will need to have a CORS policy permissive of uploads from localhost. The server launches on port 5000, which is the endpoint used in this development version of the upload form. | ||
1. Install [nvm](https://github.com/nvm-sh/nvm#install-script) | ||
2. Run `nvm use` and `nvm install` to install the correct version of node for the project | ||
3. Run `npm install` to install node modules | ||
4. Install gulp globally `npm install -g gulp` | ||
5. Run `npm run serve` to start project | ||
|
||
### Getting started | ||
|
||
``` | ||
$ npm run serve | ||
``` | ||
Compiles the sass files, javascript, and launches the server making the site available at `http://localhost:3000/` The system will watch files and execute tasks whenever one of them changes. The site will automatically refresh since it is bundled with livereload. | ||
Compiles the sass files, javascript, and launches the server making the site available at `http://localhost:3000/` | ||
The system will watch files and execute tasks whenever one of them changes. | ||
The site will automatically refresh since it is bundled with livereload. | ||
|
||
### Other commands | ||
Compile the sass files, javascript... Use this instead of ```npm run serve``` if you don't want to watch. | ||
``` | ||
$ npm run build | ||
``` | ||
|
||
### Troubleshooting: | ||
|
||
- If you run into issues running `npm run serve`, you may not have the correct version of node or gulp. Please make sure you follow the steps using `nvm` above in "Getting started" | ||
|
||
- If you follow the steps above and `npm run serve` is still not running, try tunning `npm rebuild node-sass | ||
`. More info on this solution [here](https://stackoverflow.com/questions/55921442/how-to-fix-referenceerror-primordials-is-not-defined-in-node/58022933#58022933) |
Empty file.
Binary file not shown.
Empty file.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.