...
 
Commits (3)
......@@ -55,15 +55,11 @@ Successfully generated /tmp/app.js
## Deploy
Deploy in pre-production enviroment:
```sh
TARGET_ENV=pre npm run build && scp -r dist/* dbnomics@ioke.nomics.world:dbnomics-ui-static
```
Deploy in production enviroment:
Deploy in different [enviroments](https://git.nomics.world/dbnomics-fetchers/documentation/wikis/servers):
```sh
TARGET_ENV=dev npm run build && scp -r dist/* cepremap@ioke.nomics.world:dbnomics-ui-static
TARGET_ENV=pre npm run build && scp -r dist/* cepremap@eros.nomics.world:dbnomics-ui-static
TARGET_ENV=production npm run build && scp -r dist/* cepremap@dolos.nomics.world:dbnomics-ui-static
```
......@@ -76,7 +72,7 @@ http-server-spa dist
Open http://localhost:8080/
To deploy the application in production, you may serve the contents of the `dist` directory with any static web server. For example we give the configuration file for an Nginx virtual host: see [nginx.conf](./production/nginx.conf).
See also: https://git.nomics.world/dbnomics-fetchers/documentation/wikis/production-configuration
## Notes
......
server {
listen 80;
listen [::]:80;
server_name db.nomics.world;
access_log /var/log/nginx/db.nomics.world-access.log combined;
error_log /var/log/nginx/db.nomics.world-error.log warn;
location / {
root /home/cepremap/dbnomics-ui-static/;
try_files $uri /index.html;
}
}
\ No newline at end of file
......@@ -267,7 +267,9 @@ series =
|: field "provider_code" string
|: field "dataset_code" string
|: (maybe <| field "@frequency" string)
|: field "dimensions" (dict string)
|: (field "dimensions" (dict string)
|> withDefault Dict.empty
)
|: (field "observations_attributes" (list observationsAttribute)
|> withDefault []
)
......
......@@ -64,12 +64,12 @@ init apiBaseUrl cartSeriesTuples =
|> Http.toTask
|> Task.mapError (\error -> ( error, "error loading cart series" ))
|> Task.map
(\{ seriesList } ->
(\{ series } ->
{ displayedGraphSeriesIds = Set.empty
, wholeCartDropdownState = Dropdown.initialState
, seriesDropdownStates = Dict.empty
, activeTab = ListTab
, seriesList = seriesList
, seriesList = series.docs
}
)
......
......@@ -193,7 +193,7 @@ seriesById apiBaseUrl seriesId =
type alias SeriesByIdsResponse =
{ providers : Dict ProviderCode Provider
, datasets : Dict String Dataset
, seriesList : List Series
, series : PaginatedList Series
}
......@@ -265,7 +265,18 @@ seriesByIdResponse =
succeed SeriesByIdResponse
|: field "providers" (firstDictValue provider)
|: field "datasets" (firstDictValue dataset)
|: field "series" (index 0 series)
|: field "series"
(paginatedList series
|> andThen
(\{ docs } ->
case List.head docs of
Nothing ->
fail "Not found"
Just series ->
succeed series
)
)
seriesByIdsResponse : Decoder SeriesByIdsResponse
......@@ -273,4 +284,4 @@ seriesByIdsResponse =
succeed SeriesByIdsResponse
|: field "providers" (dict provider)
|: field "datasets" (dict dataset)
|: field "series" (list series)
|: field "series" (paginatedList series)
......@@ -124,9 +124,9 @@ function buildLineTrace(series, color) {
}
}
function plot(graphElement, series, showLegend) {
function plot(graphElement, seriesList, showLegend) {
var dbnomicsGreenLight = "#b0e3b9"
var data = series.reduce(function(data, series) {
var data = seriesList.reduce(function(data, series) {
var color = showLegend ? null : dbnomicsGreenLight
var newData = buildLineTrace(series, color)
if (newData !== null) {
......@@ -216,7 +216,7 @@ function renderGraphFromUrl(msgData) {
graphElement.innerText = "Could not load data to render graph."
} else {
graphElement.innerText = ""
plot(graphElement, data.series, msgData.showLegend)
plot(graphElement, data.series.docs, msgData.showLegend)
}
})
}
......