diff --git a/.circleci/config.yml b/.circleci/config.yml index 6979496..1498ead 100755 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -49,7 +49,7 @@ jobs: if [ "${CIRCLE_BRANCH}" == "${PRODUCTION_BRANCH}" ]; then cp ./dist/index.html ./dist/200.html echo '*' > ./dist/CORS - ./node_modules/surge/lib/cli.js --project ./dist --domain rah.surge.sh + ./node_modules/surge/lib/cli.js --project ./dist --domain hub.ruralaccess.info else echo "Not the branch you're looking for, skipping deploy" fi diff --git a/app/assets/content/projects/project-local-ram-2001/index.json b/app/assets/content/projects/local-ram--2001--sergipe-brazil/index.json similarity index 100% rename from app/assets/content/projects/project-local-ram-2001/index.json rename to app/assets/content/projects/local-ram--2001--sergipe-brazil/index.json diff --git a/app/assets/content/projects/project-local-ram-2001/index.md b/app/assets/content/projects/local-ram--2001--sergipe-brazil/index.md similarity index 100% rename from app/assets/content/projects/project-local-ram-2001/index.md rename to app/assets/content/projects/local-ram--2001--sergipe-brazil/index.md diff --git a/app/assets/content/projects/project-local-ram-2001/poi-Townhalls.json b/app/assets/content/projects/local-ram--2001--sergipe-brazil/poi-Townhalls.json similarity index 100% rename from app/assets/content/projects/project-local-ram-2001/poi-Townhalls.json rename to app/assets/content/projects/local-ram--2001--sergipe-brazil/poi-Townhalls.json diff --git a/app/assets/content/projects/project-local-ram-2001/poi-Tri poi.json b/app/assets/content/projects/local-ram--2001--sergipe-brazil/poi-Tri poi.json similarity index 100% rename from app/assets/content/projects/project-local-ram-2001/poi-Tri poi.json rename to app/assets/content/projects/local-ram--2001--sergipe-brazil/poi-Tri poi.json diff --git a/app/assets/content/projects/project-local-ram-2001/results-sc-2001.json b/app/assets/content/projects/local-ram--2001--sergipe-brazil/results-sc-2001.json similarity index 100% rename from app/assets/content/projects/project-local-ram-2001/results-sc-2001.json rename to app/assets/content/projects/local-ram--2001--sergipe-brazil/results-sc-2001.json diff --git a/app/assets/content/projects/project-local-ram-2001/results-sc-2003.json b/app/assets/content/projects/local-ram--2001--sergipe-brazil/results-sc-2003.json similarity index 100% rename from app/assets/content/projects/project-local-ram-2001/results-sc-2003.json rename to app/assets/content/projects/local-ram--2001--sergipe-brazil/results-sc-2003.json diff --git a/app/assets/content/projects/project-local-ram-2001/results.zip b/app/assets/content/projects/local-ram--2001--sergipe-brazil/results.zip similarity index 100% rename from app/assets/content/projects/project-local-ram-2001/results.zip rename to app/assets/content/projects/local-ram--2001--sergipe-brazil/results.zip diff --git a/app/assets/content/projects/project-ram-demo-6/results.zip b/app/assets/content/projects/project-ram-demo-6/results.zip deleted file mode 100644 index 15bcef7..0000000 Binary files a/app/assets/content/projects/project-ram-demo-6/results.zip and /dev/null differ diff --git a/app/assets/content/projects/project-ram-demo-6/index.md b/app/assets/content/projects/ram-demo--6--qxn-test/index.md similarity index 66% rename from app/assets/content/projects/project-ram-demo-6/index.md rename to app/assets/content/projects/ram-demo--6--qxn-test/index.md index 3e0258d..d678120 100644 --- a/app/assets/content/projects/project-ram-demo-6/index.md +++ b/app/assets/content/projects/ram-demo--6--qxn-test/index.md @@ -2,13 +2,13 @@ title: QXN Test country: CN date: 2018-09-24T00:00:00.000Z +include_results: false authors: - QL topics: - test for the QXN RAH -contact: - name: QL - email: lqu@worldbank.org +contact_name: QL +contact_email: lqu@worldbank.org --- diff --git a/app/assets/scripts/components/results-map.js b/app/assets/scripts/components/results-map.js index 687b4d9..7e0e148 100644 --- a/app/assets/scripts/components/results-map.js +++ b/app/assets/scripts/components/results-map.js @@ -9,8 +9,6 @@ import { toTimeStr } from '../utils/utils' import LayerControl from './map-layer-control' -const clone = data => JSON.parse(JSON.stringify(data)) - class ResultsMap extends React.Component { setupMap () { this.popover = null diff --git a/app/assets/scripts/config.js b/app/assets/scripts/config.js index a93de52..483002a 100755 --- a/app/assets/scripts/config.js +++ b/app/assets/scripts/config.js @@ -29,7 +29,7 @@ if (process.env.DS_ENV !== 'staging' && process.env.DS_ENV !== 'production') { config = defaultsDeep(configurations.local || {}, config) } -config.default.mbtoken = process.env.MB_TOKEN || config.mbtoken +config.default.mbtoken = process.env.MB_TOKEN || config.default.mbtoken // The require doesn't play super well with es6 imports. It creates an internal // 'default' property. Export that. diff --git a/app/assets/scripts/views/home.js b/app/assets/scripts/views/home.js index e7cf889..259b66f 100644 --- a/app/assets/scripts/views/home.js +++ b/app/assets/scripts/views/home.js @@ -94,11 +94,35 @@ class Home extends React.Component { } render () { - const {fetching, fetched, data} = this.props.projects + const {fetching, fetched, data, error} = this.props.projects const projectsToShow = this.pageSize * this.state.page if (!fetched || fetching) return null + if (error) { + return ( + +
+
+
+
+

An error occurred

+
+
+
+
+
+
+

An error occurred trying to reach the server. Please try again later.

+

In the mean time visit the about page for more information or if the error persists contact us about the problem.

+
+
+
+
+
+ ) + } + const { year, country, topic } = this.state.activeFilters const projectsFiltered = data.index .filter(proj => { diff --git a/app/assets/scripts/views/project.js b/app/assets/scripts/views/project.js index 2c1ac1a..80ff3bb 100644 --- a/app/assets/scripts/views/project.js +++ b/app/assets/scripts/views/project.js @@ -53,9 +53,19 @@ class Project extends React.Component { super(props) this.onFilterChange = this.onFilterChange.bind(this) + + this.fetchData() + } + + componentDidMount () { + // We can't show the loading on the fetchData method, because the + // DOM is not mounted and there is no loading component yet. + // Show it as soon as possible. The fetchData method will then take care of + // hiding it. + showGlobalLoading() } - async componentWillMount () { + async fetchData () { const projId = this.props.match.params.id const {fetchPage, fetchProjectMeta, fetchProjectPoi, fetchProjectResults} = this.props // Fetch the page data. @@ -82,12 +92,6 @@ class Project extends React.Component { } } - componentDidMount () { - // We can't show the loading on the componentWillMount method, because the - // DOM is not mounted and there is no loading component yet. - showGlobalLoading() - } - async onFilterChange (field, value, event) { event.preventDefault() diff --git a/package.json b/package.json index 3fb1a8e..16142f3 100755 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "rah", - "version": "0.1.0", + "version": "0.3.0", "description": "Rural Accessibility Hub", "repository": { "type": "git",