From ece677371919008413e58075a7cdabb9a3888430 Mon Sep 17 00:00:00 2001 From: Joshua Marx Date: Tue, 8 Oct 2019 20:09:33 -0700 Subject: [PATCH 1/8] removed import of config --- src/components/PinMap/PinMap.jsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/PinMap/PinMap.jsx b/src/components/PinMap/PinMap.jsx index bcb0f9cbb..c7722f379 100644 --- a/src/components/PinMap/PinMap.jsx +++ b/src/components/PinMap/PinMap.jsx @@ -1,7 +1,7 @@ import React, { Component } from 'react'; import { Map, Marker, Popup, TileLayer, Rectangle, Tooltip } from 'react-leaflet'; import Choropleth from 'react-leaflet-choropleth'; -import { mapToken } from '../../config.js'; +// import { mapToken } from '../../config.js'; import { getDataResources } from '../../Util/DataService.js'; import neighborhoodOverlay from '../../data/la-county-neighborhoods-v6.json'; import municipalOverlay from '../../data/la-county-municipal-regions-current.json'; From eab2abcd2a99928870108d19fa44289f976f0da7 Mon Sep 17 00:00:00 2001 From: Joshua Marx Date: Tue, 8 Oct 2019 20:27:40 -0700 Subject: [PATCH 2/8] Removed hardcoded API token --- src/components/PinMap/PinMap.jsx | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/components/PinMap/PinMap.jsx b/src/components/PinMap/PinMap.jsx index c7722f379..e4cf30be0 100644 --- a/src/components/PinMap/PinMap.jsx +++ b/src/components/PinMap/PinMap.jsx @@ -1,15 +1,12 @@ import React, { Component } from 'react'; import { Map, Marker, Popup, TileLayer, Rectangle, Tooltip } from 'react-leaflet'; import Choropleth from 'react-leaflet-choropleth'; -// import { mapToken } from '../../config.js'; import { getDataResources } from '../../Util/DataService.js'; import neighborhoodOverlay from '../../data/la-county-neighborhoods-v6.json'; import municipalOverlay from '../../data/la-county-municipal-regions-current.json'; import councilDistrictsOverlay from '../../data/la-city-council-districts-2012.json'; import axios from 'axios'; -const DONT_LOOK_AT_THIS = 'pk.eyJ1Ijoiam9zaHVhbWFyeCIsImEiOiJjazFpb3RwcW8wYXM2M2Nud29zMWhjcnZ4In0.Rg9UY0SSJqCIPp275kRcUg'; - const serviceRequests = [ 'Bulky Items', 'Dead Animal Removal', @@ -59,7 +56,7 @@ class PinMap extends Component { request: serviceRequests[0], position: [34.0173157, -118.2497254], zoom: 10, - mapUrl: `https://api.tiles.mapbox.com/v4/mapbox.streets/{z}/{x}/{y}.png?access_token=${DONT_LOOK_AT_THIS}`, + mapUrl: `https://api.tiles.mapbox.com/v4/mapbox.streets/{z}/{x}/{y}.png?access_token=${process.env.MAPBOX_TOKEN}`, dataUrl: 'https://data.lacity.org/resource/h65r-yf5i.json?$select=location,zipcode,address,requesttype,status,ncname,streetname,housenumber&$where=date_extract_m(CreatedDate)+between+2+and+3', geoJSON: councilDistrictsOverlay, showMarkers: false, From 8685e8e374965968ae53f793059293b5befd4431 Mon Sep 17 00:00:00 2001 From: Joshua Marx Date: Tue, 8 Oct 2019 20:38:26 -0700 Subject: [PATCH 3/8] Removed console.log --- src/components/PinMap/PinMap.jsx | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/components/PinMap/PinMap.jsx b/src/components/PinMap/PinMap.jsx index e1989490f..29e31faf2 100644 --- a/src/components/PinMap/PinMap.jsx +++ b/src/components/PinMap/PinMap.jsx @@ -66,8 +66,6 @@ class PinMap extends Component { showMarkers: false, bounds: null, }; - - console.log(process.env) } componentDidMount() { From 77b46360ead0c8d99231878932c4674c8f9bc803 Mon Sep 17 00:00:00 2001 From: Joshua Marx Date: Tue, 8 Oct 2019 20:44:42 -0700 Subject: [PATCH 4/8] Cleaned up --- src/components/PinMap/PinMap.jsx | 4 ---- 1 file changed, 4 deletions(-) diff --git a/src/components/PinMap/PinMap.jsx b/src/components/PinMap/PinMap.jsx index 29e31faf2..55cbacb8c 100644 --- a/src/components/PinMap/PinMap.jsx +++ b/src/components/PinMap/PinMap.jsx @@ -1,10 +1,6 @@ import React, { Component } from 'react'; import { Map, Marker, Popup, TileLayer, Rectangle, Tooltip } from 'react-leaflet'; import Choropleth from 'react-leaflet-choropleth'; -<<<<<<< HEAD -======= -// import { mapToken } from '../../config.js'; ->>>>>>> 7204c2d5bbe8860a8d71d3ab83d2dd805e7f136e import { getDataResources } from '../../Util/DataService.js'; import neighborhoodOverlay from '../../data/la-county-neighborhoods-v6.json'; import municipalOverlay from '../../data/la-county-municipal-regions-current.json'; From 685e61c36fe73e27259726698e687cbcd04d09c5 Mon Sep 17 00:00:00 2001 From: Russell Date: Tue, 8 Oct 2019 20:35:09 -0700 Subject: [PATCH 5/8] Added mapbox token to actions --- .github/workflows/Continuous_Delivery.yml | 2 ++ .github/workflows/Continuous_Integration.yml | 4 +++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/Continuous_Delivery.yml b/.github/workflows/Continuous_Delivery.yml index 62a76f5c2..64041ae85 100644 --- a/.github/workflows/Continuous_Delivery.yml +++ b/.github/workflows/Continuous_Delivery.yml @@ -22,3 +22,5 @@ jobs: run: npm run-script build - name: Run Tests run: export CI=true && npm run test -- --coverage + env: + MAPBOX_TOKEN: ${{ secrets.MAPBOX_TOKEN }} diff --git a/.github/workflows/Continuous_Integration.yml b/.github/workflows/Continuous_Integration.yml index 847a2ccd1..a49bf29d2 100644 --- a/.github/workflows/Continuous_Integration.yml +++ b/.github/workflows/Continuous_Integration.yml @@ -17,8 +17,10 @@ jobs: with: node-version: ${{ matrix.node-version }} - name: Install Packages - run: npm install && echo $TEST_SECRET + run: npm install - name: Build project run: npm run-script build - name: Run Tests run: export CI=true && npm run test -- --coverage + env: + MAPBOX_TOKEN: ${{ secrets.MAPBOX_TOKEN }} From 6cb40e8d1c5985728e9a9adc62286f9cfb21dabb Mon Sep 17 00:00:00 2001 From: Russell Date: Tue, 8 Oct 2019 20:46:01 -0700 Subject: [PATCH 6/8] Added gh-pages deploy stuff --- .github/workflows/Continuous_Delivery.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.github/workflows/Continuous_Delivery.yml b/.github/workflows/Continuous_Delivery.yml index 64041ae85..779d916c3 100644 --- a/.github/workflows/Continuous_Delivery.yml +++ b/.github/workflows/Continuous_Delivery.yml @@ -24,3 +24,10 @@ jobs: run: export CI=true && npm run test -- --coverage env: MAPBOX_TOKEN: ${{ secrets.MAPBOX_TOKEN }} + -name: Deploy to GH pages + uses: JamesIves/github-pages-deploy-action@master + env: + ACCESS_TOKEN: ${{ secrets.ACCESS_TOKEN }} + BRANCH: gh-pages + FOLDER: dist + BUILD_SCRIPT: npm install && npm run-script build From 80cecbf5f5e5bd4184b7bfecba089185051dec3a Mon Sep 17 00:00:00 2001 From: Russell Date: Tue, 8 Oct 2019 20:52:28 -0700 Subject: [PATCH 7/8] Fixed delivery file --- .github/workflows/Continuous_Delivery.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/Continuous_Delivery.yml b/.github/workflows/Continuous_Delivery.yml index 779d916c3..cdd7dbc20 100644 --- a/.github/workflows/Continuous_Delivery.yml +++ b/.github/workflows/Continuous_Delivery.yml @@ -25,7 +25,7 @@ jobs: env: MAPBOX_TOKEN: ${{ secrets.MAPBOX_TOKEN }} -name: Deploy to GH pages - uses: JamesIves/github-pages-deploy-action@master + uses: hackforla/311-data@master env: ACCESS_TOKEN: ${{ secrets.ACCESS_TOKEN }} BRANCH: gh-pages From 6536a6a6f08a8a1bc4d1e320d8ecd2ed4e09d16d Mon Sep 17 00:00:00 2001 From: Russell Date: Tue, 8 Oct 2019 20:54:03 -0700 Subject: [PATCH 8/8] Fixed delivery file --- .github/workflows/Continuous_Delivery.yml | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/.github/workflows/Continuous_Delivery.yml b/.github/workflows/Continuous_Delivery.yml index cdd7dbc20..0e8ca9c15 100644 --- a/.github/workflows/Continuous_Delivery.yml +++ b/.github/workflows/Continuous_Delivery.yml @@ -24,10 +24,9 @@ jobs: run: export CI=true && npm run test -- --coverage env: MAPBOX_TOKEN: ${{ secrets.MAPBOX_TOKEN }} - -name: Deploy to GH pages - uses: hackforla/311-data@master - env: + - name: Deploy + run: npm run deploy + env: + MAPBOX_TOKEN: ${{ secrets.MAPBOX_TOKEN }} ACCESS_TOKEN: ${{ secrets.ACCESS_TOKEN }} - BRANCH: gh-pages - FOLDER: dist - BUILD_SCRIPT: npm install && npm run-script build +