Skip to content

Commit

Permalink
Merge pull request #943 from cityofaustin/4188_preview_instance
Browse files Browse the repository at this point in the history
4188 preview instance
  • Loading branch information
tillyw authored Oct 29, 2020
2 parents 5873808 + ea1d181 commit 891b1a4
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 6 deletions.
2 changes: 1 addition & 1 deletion atd-vzv/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 8 additions & 1 deletion atd-vzv/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@
"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",
"build:preview": "REACT_APP_VZV_ENVIRONMENT=PREVIEW npm run build",
"test": "react-scripts test",
"eject": "react-scripts eject",
"postinstall": "patch-package"
Expand All @@ -72,6 +73,12 @@
"not op_mini all",
"ie 11"
],
"preview": [
">0.2%",
"not dead",
"not op_mini all",
"ie 11"
],
"development": [
"last 1 chrome version",
"last 1 firefox version",
Expand All @@ -86,4 +93,4 @@
"devDependencies": {
"react-axe": "^3.5.3"
}
}
}
2 changes: 2 additions & 0 deletions atd-vzv/src/constants/nav.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ import { faChartBar, faMap } from "@fortawesome/free-solid-svg-icons";
export const isDevelopment =
!process.env.NODE_ENV || process.env.NODE_ENV === "development";

export const isPreview = process.env.REACT_APP_VZV_ENVIRONMENT === "PREVIEW";

export const navConfig = [
{
title: "Go to Summary",
Expand Down
3 changes: 2 additions & 1 deletion atd-vzv/src/constants/time.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ import moment from "moment";
// Number of past years data to fetch
export const ROLLING_YEARS_OF_DATA = 4;
// Number of months window slides in the past (to display most accurate data)
export const MONTHS_AGO = 2;
// Accommodate for a preview instance that provide and extra month of data
export const MONTHS_AGO = process.env.REACT_APP_VZV_ENVIRONMENT === "PREVIEW" ? 1 : 2;

// Create array of ints of last n years
export const yearsArray = () => {
Expand Down
6 changes: 3 additions & 3 deletions atd-vzv/src/views/summary/queries/socrataQueries.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { isDevelopment } from "../../../constants/nav";
import { isDevelopment, isPreview } from "../../../constants/nav";

const crashDatasetID = isDevelopment ? "3aut-fhzp" : "y2wy-tgr5";
const personDatasetID = isDevelopment ? "v3x4-fjgm" : "xecs-rpy9";
const crashDatasetID = isDevelopment || isPreview ? "3aut-fhzp" : "y2wy-tgr5";
const personDatasetID = isDevelopment || isPreview ? "v3x4-fjgm" : "xecs-rpy9";

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 891b1a4

Please sign in to comment.