1 Commits

Author SHA1 Message Date
efarooqui
b65c4ad2e2 Adding export_editorials endpoint for vertical stories 2021-03-02 14:09:06 -08:00
9 changed files with 28 additions and 9472 deletions

View File

@@ -4,12 +4,12 @@ LABEL authors="Lachlan Kermode <lk@forensic-architecture.org>"
# Install app dependencies # Install app dependencies
COPY package.json /www/package.json COPY package.json /www/package.json
RUN cd /www; npm install RUN cd /www; yarn
# Copy app source # Copy app source
COPY . /www COPY . /www
WORKDIR /www WORKDIR /www
RUN npm run build RUN yarn build
RUN mkdir -p data RUN mkdir -p data
# set your port # set your port
@@ -17,4 +17,4 @@ ENV PORT 4040
EXPOSE 4040 EXPOSE 4040
# start command as per package.json # start command as per package.json
CMD ["npm", "start"] CMD ["yarn", "start"]

Binary file not shown.

9478
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@@ -30,10 +30,10 @@ export default ({ config, controller }) => {
success: msg success: msg
}) })
) )
.catch(err => { .catch(err =>
res.status(404) res.status(404)
.send({ error: err.message, err }) .send({ error: err.message, err })
}) )
}) })
api.get('/:sheet/:tab/:resource/:frag', (req, res) => { api.get('/:sheet/:tab/:resource/:frag', (req, res) => {

View File

@@ -6,8 +6,8 @@ function prefixedTabs (prefix, cfg) {
return { return {
[`${prf('events')}export_events`]: BP.deeprows, [`${prf('events')}export_events`]: BP.deeprows,
[`${prf('associations')}export_associations`]: BP.deeprows, [`${prf('associations')}export_associations`]: BP.deeprows,
[`${prf('editorials')}export_editorials`]: BP.deeprows,
[`${prf('sources')}export_sources`]: BP.deepids, [`${prf('sources')}export_sources`]: BP.deepids,
[`${prf('shapes')}export_shapes`]: BP.deeprows,
[`${prf('sites')}export_sites`]: BP.rows [`${prf('sites')}export_sites`]: BP.rows
} }
} }

View File

@@ -1,7 +1,7 @@
import copy from '../copy/en' import copy from '../copy/en'
/** /**
* Controller class * Controller
* *
*/ */
class Controller { class Controller {

View File

@@ -217,10 +217,7 @@ class GsheetFetcher extends Fetcher {
}) })
.then(this._buildBlueprintsAsync()) .then(this._buildBlueprintsAsync())
.then(() => true) .then(() => true)
.catch((err) => { .catch(() => false)
console.log(`Error fetching gsheets: ${err.message} `)
return false
})
} }
} }

View File

@@ -19,6 +19,7 @@ class StoreJson {
save (url, data) { save (url, data) {
const parts = url.split('/') const parts = url.split('/')
return fs.writeFile( return fs.writeFile(
`${STORAGE_DIRNAME}/${parts[0]}__${parts[1]}__${parts[2]}.json`, `${STORAGE_DIRNAME}/${parts[0]}__${parts[1]}__${parts[2]}.json`,
JSON.stringify(data) JSON.stringify(data)

View File

@@ -12,8 +12,6 @@ const egInput1 = [
[4, 5, 6] [4, 5, 6]
] ]
// Test default blueprint exports
// Smoke tests
test('defaultBlueprint exports', t => { test('defaultBlueprint exports', t => {
const expected = { const expected = {
sheet: { sheet: {