Skip to content

Commit

Permalink
Merge pull request #1512 from cityofaustin/18689-vzv-env
Browse files Browse the repository at this point in the history
Set VZV dataset endpoints based on environment
  • Loading branch information
johnclary authored Aug 20, 2024
2 parents 890b006 + 38852ce commit fb4cc24
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 60 deletions.
1 change: 0 additions & 1 deletion atd-vze/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import { Auth0Provider, urlPath, onRedirectCallback } from "./auth/authContext";
import { HashRouter } from "react-router-dom";
import * as serviceWorker from "./serviceWorker";

console.log("🤖 Release Drafter Test");
// Setup Auth0 config for Auth0Provider component
ReactDOM.render(
<HashRouter history={history}>
Expand Down
8 changes: 4 additions & 4 deletions atd-vzv/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,10 @@
"react-dev-utils/chalk/ansi-styles": "https://github.com/codercodingthecode/ansi-styles"
},
"scripts": {
"start": "react-scripts start",
"build": "./patchindex.sh && CI= react-scripts build && cp _redirects build && cp -r build viewer && mv viewer build",
"build:staging": "VZV_ENVIRONMENT=STAGING npm run build",
"build:production": "VZV_ENVIRONMENT=PRODUCTION npm run build",
"start": "REACT_APP_VZV_ENVIRONMENT=STAGING react-scripts start",
"build": "CI= react-scripts build && cp _redirects build && cp -r build viewer && mv viewer build",
"build:staging": "REACT_APP_VZV_ENVIRONMENT=STAGING npm run build",
"build:production": "REACT_APP_VZV_ENVIRONMENT=PRODUCTION npm run build",
"build:preview": "REACT_APP_VZV_ENVIRONMENT=PREVIEW npm run build",
"test": "react-scripts test",
"eject": "react-scripts eject",
Expand Down
39 changes: 0 additions & 39 deletions atd-vzv/patchindex.sh

This file was deleted.

12 changes: 0 additions & 12 deletions atd-vzv/public/header_snippets_production.html

This file was deleted.

1 change: 0 additions & 1 deletion atd-vzv/public/header_snippets_staging.html

This file was deleted.

22 changes: 19 additions & 3 deletions atd-vzv/src/views/summary/queries/socrataQueries.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,22 @@
// const crashDatasetID = "y2wy-tgr5";
const crashDatasetID = "3aut-fhzp"; // staging
const personDatasetID = "v3x4-fjgm"; // staging
const DATASET_IDS = {
staging: {
crash: "3aut-fhzp",
person: "v3x4-fjgm",
},
prod: {
crash: "y2wy-tgr5",
person: "xecs-rpy9",
},
};

const crashDatasetID =
process.env.REACT_APP_VZV_ENVIRONMENT === "PRODUCTION"
? DATASET_IDS.prod.crash
: DATASET_IDS.staging.crash;
const personDatasetID =
process.env.REACT_APP_VZV_ENVIRONMENT === "PRODUCTION"
? DATASET_IDS.prod.person
: DATASET_IDS.staging.person;

export const crashEndpointUrl = `https://data.austintexas.gov/resource/${crashDatasetID}.json`;
export const crashGeoJSONEndpointUrl = `https://data.austintexas.gov/resource/${crashDatasetID}.geojson`;
Expand Down

0 comments on commit fb4cc24

Please sign in to comment.