mirror of
https://github.com/bellingcat/datasheet-server.git
synced 2026-06-09 11:58:33 +03:00
Compare commits
7 Commits
topic/cust
...
develop
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a6337e9cba | ||
|
|
18b20356b5 | ||
|
|
75cb1a43cf | ||
|
|
71a8687003 | ||
|
|
63d168a964 | ||
|
|
4d310270d5 | ||
|
|
a6cc9491c6 |
@@ -4,12 +4,12 @@ LABEL authors="Lachlan Kermode <lk@forensic-architecture.org>"
|
||||
|
||||
# Install app dependencies
|
||||
COPY package.json /www/package.json
|
||||
RUN cd /www; yarn
|
||||
RUN cd /www; npm install
|
||||
|
||||
# Copy app source
|
||||
COPY . /www
|
||||
WORKDIR /www
|
||||
RUN yarn build
|
||||
RUN npm run build
|
||||
RUN mkdir -p data
|
||||
|
||||
# set your port
|
||||
@@ -17,4 +17,4 @@ ENV PORT 4040
|
||||
EXPOSE 4040
|
||||
|
||||
# start command as per package.json
|
||||
CMD ["yarn", "start"]
|
||||
CMD ["npm", "start"]
|
||||
|
||||
Binary file not shown.
9478
package-lock.json
generated
9478
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@@ -7,6 +7,7 @@ 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
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,7 +2,7 @@ import path from 'path'
|
||||
import fs from 'fs'
|
||||
import R from 'ramda'
|
||||
|
||||
const defaultBlueprint = {
|
||||
export const defaultBlueprint = {
|
||||
name: null,
|
||||
sheet: {
|
||||
name: null,
|
||||
@@ -11,11 +11,11 @@ const defaultBlueprint = {
|
||||
resources: {}
|
||||
}
|
||||
|
||||
const defaultResource = {
|
||||
export const defaultResource = {
|
||||
data: []
|
||||
}
|
||||
|
||||
function buildDesaturated (sheetId, sheetName, tab, resources) {
|
||||
export function buildDesaturated (sheetId, sheetName, tab, resources) {
|
||||
const bp = R.clone(defaultBlueprint)
|
||||
bp.sheet.name = sheetName
|
||||
bp.sheet.id = sheetId
|
||||
@@ -50,25 +50,10 @@ fs.readdirSync(normalizedPath).forEach(file => {
|
||||
allBps[bpName] = buildBlueprinter(bpName, datafier)
|
||||
})
|
||||
|
||||
function deeprowsWithSchema (datafierName, schema) {
|
||||
const datafier = data => {
|
||||
const transformedData = allBps.deeprows('', '', '', data).resources.deeprows.data
|
||||
return transformedData.map(row => {
|
||||
Object.keys(schema).forEach(key => {
|
||||
row[key] = schema[key](row[key])
|
||||
})
|
||||
return row
|
||||
})
|
||||
}
|
||||
|
||||
return buildBlueprinter(`deeprows_${datafierName}`, datafier)
|
||||
}
|
||||
|
||||
// NB: revert to ES5 'module.exports' required to make blueprinters from
|
||||
// each file in blueprinters folder available for granular import from here.
|
||||
module.exports = Object.assign({
|
||||
defaultBlueprint,
|
||||
defaultResource,
|
||||
buildDesaturated,
|
||||
deeprowsWithSchema
|
||||
buildDesaturated
|
||||
}, allBps)
|
||||
|
||||
Reference in New Issue
Block a user