Skip to content

Commit

Permalink
Merge pull request #27 from RENCI/mapbox-token
Browse files Browse the repository at this point in the history
adding the mapbox token to the build
  • Loading branch information
PhillipsOwen authored May 7, 2024
2 parents cf145c9 + 1b57d36 commit f29515e
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 4 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/image-push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,8 @@ jobs:
APP_VERSION=${{ steps.get_version.outputs.VERSION }}
APP_GS_DATA_URL=${{ secrets.GS_DATA_URL }}
APP_UI_DATA_URL=${{ secrets.UI_DATA_URL }}
APP_UI_DATA_TOKEN=${{ secrets.TOKEN }}
APP_UI_DATA_TOKEN=${{ secrets.UI_DATA_TOKEN }}
APP_UI_MAPBOX_TOKEN=${{ secrets.UI_MAPBOX_TOKEN }}
tags: |
${{ env.REGISTRY }}:latest
Expand Down
3 changes: 3 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -25,16 +25,19 @@ ARG APP_VERSION=$(APP_VERSION)
ARG APP_GS_DATA_URL=$(APP_GS_DATA_URL)
ARG APP_UI_DATA_URL=$(APP_UI_DATA_URL)
ARG APP_UI_DATA_TOKEN=$(APP_UI_DATA_TOKEN)
ARG APP_UI_MAPBOX_TOKEN=$(APP_UI_MAPBOX_TOKEN)

# now add the values into ENV params
ENV REACT_APP_VERSION=$APP_VERSION
ENV REACT_APP_GS_DATA_URL=$APP_GS_DATA_URL
ENV REACT_APP_UI_DATA_URL=$APP_UI_DATA_URL
ENV REACT_APP_UI_DATA_TOKEN=$APP_UI_DATA_TOKEN
ENV REACT_APP_MAPBOX_TOKEN=$APP_UI_MAPBOX_TOKEN

# create the env file
RUN printf "NODE_ENV=production\nREACT_APP_VERSION=$APP_VERSION\nREACT_APP_GS_DATA_URL=$APP_GS_DATA_URL\n" > .env
RUN printf "REACT_APP_UI_DATA_URL=$APP_UI_DATA_URL\nREACT_APP_UI_DATA_TOKEN=$APP_UI_DATA_TOKEN\n" >> .env
RUN printf "REACT_APP_MAPBOX_TOKEN=$REACT_APP_MAPBOX_TOKEN\n" >> .env

# Copy in source files
COPY . /src
Expand Down
2 changes: 1 addition & 1 deletion src/components/map/default-layers.js
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ export const DefaultLayers = () => {
markClicked(map, e);

// populate selectedObservations list with the newly selected observation point
setSelectedObservations(previous => [...previous, feature.properties]);
//setSelectedObservations(previous => [...previous, feature.properties]);
});
}
};
Expand Down
4 changes: 2 additions & 2 deletions src/components/map/map.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ export const Map = () => {
whenCreated={setMap}
style={{ height: '100vh', width:'100wh' }}>
{ darkMode.enabled
? <TileLayer url={ `https://api.mapbox.com/styles/v1/mvvatson/clvu3inqs05v901qlabcfhxsr/tiles/256/{z}/{x}/{y}@2x?access_token=${ process.env.MAPBOX_TOKEN }` } />
: <TileLayer url={ `https://api.mapbox.com/styles/v1/mvvatson/clvu2u7iu061901ph15n55v2e/tiles/256/{z}/{x}/{y}@2x?access_token=${ process.env.MAPBOX_TOKEN }` } />
? <TileLayer url={ `https://api.mapbox.com/styles/v1/mvvatson/clvu3inqs05v901qlabcfhxsr/tiles/256/{z}/{x}/{y}@2x?access_token=${ process.env.REACT_APP_MAPBOX_TOKEN }` } />
: <TileLayer url={ `https://api.mapbox.com/styles/v1/mvvatson/clvu2u7iu061901ph15n55v2e/tiles/256/{z}/{x}/{y}@2x?access_token=${ process.env.REACT_APP_MAPBOX_TOKEN }` } />
}
<DefaultLayers/>
</MapContainer>
Expand Down

0 comments on commit f29515e

Please sign in to comment.