mirror of
https://github.com/bellingcat/datasheet-server.git
synced 2026-06-09 20:08:32 +03:00
Compare commits
1 Commits
project/ye
...
grenfell
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9455348001 |
7
.github/workflows/ci.yml
vendored
7
.github/workflows/ci.yml
vendored
@@ -10,16 +10,11 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
with:
|
||||
ref: ${{ github.head_ref }}
|
||||
- uses: actions/setup-node@v2-beta
|
||||
with:
|
||||
node-version: '12'
|
||||
|
||||
- run: npm install
|
||||
- run: npm test
|
||||
env:
|
||||
CI: true
|
||||
- run: npm run lint
|
||||
env:
|
||||
CI: true
|
||||
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
import { version } from '../../package.json'
|
||||
import fetch from 'node-fetch'
|
||||
import { Router } from 'express'
|
||||
import { getParameterByName } from '../lib/util'
|
||||
import copy from '../copy/en'
|
||||
|
||||
export default ({ config, controller }) => {
|
||||
@@ -24,21 +22,6 @@ export default ({ config, controller }) => {
|
||||
})
|
||||
})
|
||||
|
||||
api.get('/media/:code', (req, res) => {
|
||||
const { code } = req.params
|
||||
fetch(`${process.env.MEDIA_API_ENDPOINT}/${code}`, {
|
||||
method: 'get',
|
||||
headers: {
|
||||
'Authorization': 'Basic ' + new Buffer(process.env.MEDIA_AUTH_USER + ":" + process.env.MEDIA_AUTH_PWORD).toString("base64")
|
||||
}
|
||||
})
|
||||
.then(response => response.json())
|
||||
.then(data => res.send(data))
|
||||
.catch(err => {
|
||||
res.status(err.status || 404).send({ error: err.message })
|
||||
});
|
||||
})
|
||||
|
||||
api.get('/update', (req, res) => {
|
||||
controller
|
||||
.update()
|
||||
@@ -47,10 +30,10 @@ export default ({ config, controller }) => {
|
||||
success: msg
|
||||
})
|
||||
)
|
||||
.catch(err => {
|
||||
.catch(err =>
|
||||
res.status(404)
|
||||
.send({ error: err.message, err })
|
||||
})
|
||||
)
|
||||
})
|
||||
|
||||
api.get('/:sheet/:tab/:resource/:frag', (req, res) => {
|
||||
|
||||
1
src/datasheet.config.js
Symbolic link
1
src/datasheet.config.js
Symbolic link
@@ -0,0 +1 @@
|
||||
CONFIG=../configs/timemap/grenfell/datasheet.config.js
|
||||
@@ -7,7 +7,6 @@ function prefixedTabs (prefix, cfg) {
|
||||
[`${prf('events')}export_events`]: BP.deeprows,
|
||||
[`${prf('associations')}export_associations`]: BP.deeprows,
|
||||
[`${prf('sources')}export_sources`]: BP.deepids,
|
||||
[`${prf('shapes')}export_shapes`]: BP.deeprows,
|
||||
[`${prf('sites')}export_sites`]: BP.rows
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import copy from '../copy/en'
|
||||
|
||||
/**
|
||||
* Controller class
|
||||
* Controller
|
||||
*
|
||||
*/
|
||||
class Controller {
|
||||
|
||||
@@ -217,10 +217,7 @@ class GsheetFetcher extends Fetcher {
|
||||
})
|
||||
.then(this._buildBlueprintsAsync())
|
||||
.then(() => true)
|
||||
.catch((err) => {
|
||||
console.log(`Error fetching gsheets: ${err.message} `)
|
||||
return false
|
||||
})
|
||||
.catch(() => false)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -19,6 +19,7 @@ class StoreJson {
|
||||
|
||||
save (url, data) {
|
||||
const parts = url.split('/')
|
||||
|
||||
return fs.writeFile(
|
||||
`${STORAGE_DIRNAME}/${parts[0]}__${parts[1]}__${parts[2]}.json`,
|
||||
JSON.stringify(data)
|
||||
|
||||
@@ -12,8 +12,6 @@ const egInput1 = [
|
||||
[4, 5, 6]
|
||||
]
|
||||
|
||||
// Test default blueprint exports
|
||||
// Smoke tests
|
||||
test('defaultBlueprint exports', t => {
|
||||
const expected = {
|
||||
sheet: {
|
||||
|
||||
Reference in New Issue
Block a user