Skip to content

Commit 6f17e33

Browse files
authored
Merge pull request #627 from azavea/feature/asu/update-analysis-links
Parameterize and update URLs to analysis files
2 parents 7ef7365 + f5b3285 commit 6f17e33

6 files changed

Lines changed: 31 additions & 47 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
1717
- Upgrade Postgres from version 13 to version 17 [#616](https://github.com/azavea/echo-locator/pull/616)
1818
- Upgrade Django from version 3.2 to 5.2 [#616](https://github.com/azavea/echo-locator/pull/616) [#622](https://github.com/azavea/echo-locator/pull/622)
1919
- Update SSL cert resource creation with validation [#623](https://github.com/azavea/echo-locator/pull/623)
20+
- Parameterize and update URLs to analysis files [#627](https://github.com/azavea/echo-locator/pull/627)
2021

2122
### Fixed
2223

scripts/bootstrap

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ function pull_env() {
1818
cp .env.sample .env
1919
echo "Copied environment variables file from .env.sample to .env for local development."
2020
echo "Please populate the fields in this file manually."
21-
elif aws s3 cp "s3://${ECHOLOCATOR_SETTINGS_BUCKET}/.env" ".env"; then
21+
elif aws s3 cp "s3://${ECHOLOCATOR_SETTINGS_BUCKET}/dotenv" ".env"; then
2222
echo "Updated environment variables file from ${ECHOLOCATOR_SETTINGS_BUCKET}"
2323
fi
2424
fi

src/frontend/src/actions/network.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import lonlat from "@conveyal/lonlat";
33
import fetch, { fetchMultiple } from "@conveyal/woonerf/fetch";
44
import { isEmpty } from "lodash";
55

6-
import { retrieveConfig, storeConfig } from "../config";
6+
import { retrieveConfig, storeConfig, networks } from "../config";
77
import { ACCESSIBILITY_IS_LOADING, ACCESSIBILITY_IS_EMPTY, TAUI_CONFIG_KEY } from "../constants";
88
import type { LonLat } from "../types";
99
import cacheURL from "../utils/cache-url";
@@ -78,7 +78,7 @@ export const initialize = (startCoordinate?: LonLat) => (dispatch, getState) =>
7878
console.error("Error parsing localStorage configuration " + TAUI_CONFIG_KEY, e);
7979
}
8080

81-
dispatch(loadDataset(config.networks, config.grids, config.pointsOfInterestUrl, start));
81+
dispatch(loadDataset(networks, config.grids, config.pointsOfInterestUrl, start));
8282
}
8383
};
8484

src/frontend/src/config.js

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,26 @@ export const clearLocalStorage = () => window.localStorage.clear();
44
export const retrieveConfig = (key) => JSON.parse(window.localStorage.getItem(key));
55
export const storeConfig = (key, json) =>
66
window.localStorage.setItem(key, JSON.stringify(json, null, " "));
7+
8+
export const networks = [
9+
{
10+
name: "Peak",
11+
url: `${process.env.NETWORK_URL_ROOT}/peak`,
12+
commuter: true,
13+
},
14+
{
15+
name: "Off Peak",
16+
url: `${process.env.NETWORK_URL_ROOT}/off-peak`,
17+
commuter: true,
18+
},
19+
{
20+
name: "Peak No Express",
21+
url: `${process.env.NETWORK_URL_ROOT}/peak-no-express`,
22+
commuter: false,
23+
},
24+
{
25+
name: "Off Peak No Express",
26+
url: `${process.env.NETWORK_URL_ROOT}/off-peak-no-express`,
27+
commuter: false,
28+
},
29+
];

src/frontend/src/config.json

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -6,27 +6,5 @@
66
"url": "https://d2z7d5345ccuw9.cloudfront.net/5c9bdffa37ed813dbe27f8f1/Workers_with_earnings_1250_per_month_or_less.grid",
77
"showOnMap": true
88
}
9-
],
10-
"networks": [
11-
{
12-
"name": "Peak",
13-
"url": "https://d2z7d5345ccuw9.cloudfront.net/5c9bdffa37ed813dbe27f8f1",
14-
"commuter": true
15-
},
16-
{
17-
"name": "Off Peak",
18-
"url": "https://d2z7d5345ccuw9.cloudfront.net/5c9be04737ed813dbe27f8f3",
19-
"commuter": true
20-
},
21-
{
22-
"name": "Peak No Express",
23-
"url": "https://d2z7d5345ccuw9.cloudfront.net/5cb8ebc037ed813dbe29182e",
24-
"commuter": false
25-
},
26-
{
27-
"name": "Off Peak No Express",
28-
"url": "https://d2z7d5345ccuw9.cloudfront.net/5cb8ebe437ed813dbe291830",
29-
"commuter": false
30-
}
319
]
3210
}

src/frontend/src/reducers/data.js

Lines changed: 4 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
// @flow
2+
23
import { handleActions } from "redux-actions";
4+
import { networks } from "../config";
35

46
export default handleActions(
57
{
@@ -159,6 +161,7 @@ export default handleActions(
159161
},
160162
},
161163
{
164+
// TODO: grids are irrelevant and can be scrapped once we move away from Taui
162165
grids: [
163166
{
164167
name: "home locations",
@@ -167,28 +170,7 @@ export default handleActions(
167170
showOnMap: true,
168171
},
169172
],
170-
networks: [
171-
{
172-
name: "Peak",
173-
url: "https://d2z7d5345ccuw9.cloudfront.net/5c9bdffa37ed813dbe27f8f1",
174-
commuter: true,
175-
},
176-
{
177-
name: "Off Peak",
178-
url: "https://d2z7d5345ccuw9.cloudfront.net/5c9be04737ed813dbe27f8f3",
179-
commuter: true,
180-
},
181-
{
182-
name: "Peak No Express",
183-
url: "https://d2z7d5345ccuw9.cloudfront.net/5cb8ebc037ed813dbe29182e",
184-
commuter: false,
185-
},
186-
{
187-
name: "Off Peak No Express",
188-
url: "https://d2z7d5345ccuw9.cloudfront.net/5cb8ebe437ed813dbe291830",
189-
commuter: false,
190-
},
191-
],
173+
networks,
192174
neighborhoods: {},
193175
neighborhoodBounds: {},
194176
page: 0,

0 commit comments

Comments
 (0)