Skip to content

Commit

Permalink
Merge branch 'fix/preview-for-goes-app-viewer' of https://github.com/…
Browse files Browse the repository at this point in the history
…US-GHG-Center/custom-interfaces into fix/preview-for-goes-app-viewer
  • Loading branch information
amarouane-ABDELHAK committed Nov 27, 2024
2 parents 5d6eb12 + ea6c11b commit 2faf553
Show file tree
Hide file tree
Showing 39 changed files with 323 additions and 27 deletions.
21 changes: 20 additions & 1 deletion .github/workflows/deploy-emit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,26 @@ jobs:
working-directory: ./emit-ch4plume-v1
run: |
GEOAPIFY_APIKEY="${{ secrets.GEOAPIFY_APIKEY }}" node update_data.js
- name: Validate required variables and secrets
run: |
missing_vars=()
# Check for required variables
[ -z "${{ vars.PUBLIC_URL_EMIT }}" ] && missing_vars+=("vars.PUBLIC_URL_EMIT")
[ -z "${{ vars.MAP_STYLE }}" ] && missing_vars+=("vars.MAP_STYLE")
[ -z "${{ secrets.MAP_ACCESS_TOKEN }}" ] && missing_vars+=("secrets.MAP_ACCESS_TOKEN")
[ -z "${{ secrets.DEPLOYMENT_ROLE_ARN }}" ] && missing_vars+=("secrets.DEPLOYMENT_ROLE_ARN")
[ -z "${{ secrets.CF_DISTRIBUTION_ID }}" ] && missing_vars+=("secrets.CF_DISTRIBUTION_ID")
# If any variables are missing, print them and exit with an error
if [ ${#missing_vars[@]} -ne 0 ]; then
echo "Error: The following required variables are missing:"
printf '%s\n' "${missing_vars[@]}"
exit 1
fi
shell: bash

- name: Build for production 🔧
working-directory: ./emit-ch4plume-v1
run: |
Expand Down
19 changes: 19 additions & 0 deletions .github/workflows/deploy-goes.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,25 @@ jobs:
- name: Install Yarn
run: npm install -g yarn

- name: Validate required variables and secrets
run: |
missing_vars=()
# Check for required variables
[ -z "${{ secrets.REACT_APP_MAPBOX_ACCESS_TOKEN }}" ] && missing_vars+=("secrets.REACT_APP_MAPBOX_ACCESS_TOKEN")
[ -z "${{ secrets.REACT_APP_MAPBOX_STYLE_URL }}" ] && missing_vars+=("secrets.REACT_APP_MAPBOX_STYLE_URL")
[ -z "${{ vars.REACT_APP_BASE_PATH_GOES }}" ] && missing_vars+=("vars.REACT_APP_BASE_PATH_GOES")
[ -z "${{ secrets.DEPLOYMENT_ROLE_ARN }}" ] && missing_vars+=("secrets.DEPLOYMENT_ROLE_ARN")
[ -z "${{ secrets.CF_DISTRIBUTION_ID }}" ] && missing_vars+=("secrets.CF_DISTRIBUTION_ID")
# If any variables are missing, print them and exit with an error
if [ ${#missing_vars[@]} -ne 0 ]; then
echo "Error: The following required variables are missing:"
printf '%s\n' "${missing_vars[@]}"
exit 1
fi
shell: bash

- name: Building 🔧
working-directory: ./goes-plume-viewer
run: |
Expand Down
19 changes: 19 additions & 0 deletions .github/workflows/deploy-nist.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,25 @@ jobs:
- name: Install Yarn
run: npm install -g yarn

- name: Validate required variables and secrets
run: |
missing_vars=()
# Check for required variables
[ -z "${{ secrets.REACT_APP_MAPBOX_ACCESS_TOKEN }}" ] && missing_vars+=("secrets.REACT_APP_MAPBOX_ACCESS_TOKEN")
[ -z "${{ secrets.REACT_APP_MAPBOX_STYLE_URL }}" ] && missing_vars+=("secrets.REACT_APP_MAPBOX_STYLE_URL")
[ -z "${{ vars.REACT_APP_BASE_PATH_NIST }}" ] && missing_vars+=("vars.REACT_APP_BASE_PATH_NIST")
[ -z "${{ secrets.DEPLOYMENT_ROLE_ARN }}" ] && missing_vars+=("secrets.DEPLOYMENT_ROLE_ARN")
[ -z "${{ secrets.CF_DISTRIBUTION_ID }}" ] && missing_vars+=("secrets.CF_DISTRIBUTION_ID")
# If any variables are missing, print them and exit with an error
if [ ${#missing_vars[@]} -ne 0 ]; then
echo "Error: The following required variables are missing:"
printf '%s\n' "${missing_vars[@]}"
exit 1
fi
shell: bash

- name: Building 🔧
working-directory: ./nist-interface
run: |
Expand Down
19 changes: 19 additions & 0 deletions .github/workflows/deploy-noaa.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,25 @@ jobs:
- name: Install Yarn
run: npm install -g yarn


- name: Validate required variables and secrets
run: |
missing_vars=()
# Check for required variables
[ -z "${{ vars.PUBLIC_URL_NOAA }}" ] && missing_vars+=("vars.PUBLIC_URL_NOAA")
[ -z "${{ secrets.MAP_ACCESS_TOKEN }}" ] && missing_vars+=("secrets.MAP_ACCESS_TOKEN")
[ -z "${{ secrets.DEPLOYMENT_ROLE_ARN }}" ] && missing_vars+=("secrets.DEPLOYMENT_ROLE_ARN")
[ -z "${{ secrets.CF_DISTRIBUTION_ID }}" ] && missing_vars+=("secrets.CF_DISTRIBUTION_ID")
# If any variables are missing, print them and exit with an error
if [ ${#missing_vars[@]} -ne 0 ]; then
echo "Error: The following required variables are missing:"
printf '%s\n' "${missing_vars[@]}"
exit 1
fi
shell: bash

- name: Build for production 🔧
working-directory: ./noaa-cpfp-point
run: |
Expand Down
21 changes: 21 additions & 0 deletions .github/workflows/deploy-urban.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,27 @@ jobs:
- name: Install Yarn
run: npm install -g yarn


- name: Validate required variables and secrets
run: |
missing_vars=()
# Check for required variables
[ -z "${{ secrets.REACT_APP_MAPBOX_ACCESS_TOKEN }}" ] && missing_vars+=("secrets.REACT_APP_MAPBOX_ACCESS_TOKEN")
[ -z "${{ secrets.REACT_APP_MAPBOX_STYLE_URL }}" ] && missing_vars+=("secrets.REACT_APP_MAPBOX_STYLE_URL")
[ -z "${{ vars.REACT_APP_BASE_PATH_URBAN }}" ] && missing_vars+=("vars.REACT_APP_BASE_PATH_URBAN")
[ -z "${{ secrets.DEPLOYMENT_ROLE_ARN }}" ] && missing_vars+=("secrets.DEPLOYMENT_ROLE_ARN")
[ -z "${{ secrets.CF_DISTRIBUTION_ID }}" ] && missing_vars+=("secrets.CF_DISTRIBUTION_ID")
# If any variables are missing, print them and exit with an error
if [ ${#missing_vars[@]} -ne 0 ]; then
echo "Error: The following required variables are missing:"
printf '%s\n' "${missing_vars[@]}"
exit 1
fi
shell: bash


- name: Building 🔧
working-directory: ./urban-dashboard
run: |
Expand Down
56 changes: 56 additions & 0 deletions .github/workflows/pr-preview.yml
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,62 @@ jobs:
role-session-name: ${{ github.repository_owner}}
aws-region: us-west-2

- name: Validate required variables and secrets
run: |
IFS=',' read -r -a WEBSITES <<< "${{ env.CHANGED_WEBSITES }}"
for WEBSITE in "${WEBSITES[@]}"; do
if [ "$WEBSITE" == "emit-ch4plume-v1" ]; then
missing_vars=()
# Check for required variables
[ -z "${{ vars.MAP_STYLE }}" ] && missing_vars+=("vars.MAP_STYLE")
[ -z "${{ secrets.MAP_ACCESS_TOKEN }}" ] && missing_vars+=("secrets.MAP_ACCESS_TOKEN")
[ -z "${{ vars.PUBLIC_URL_EMIT }}" ] && missing_vars+=("vars.PUBLIC_URL_EMIT")
[ -z "${{ secrets.GEOAPIFY_APIKEY }}" ] && missing_vars+=("secrets.GEOAPIFY_APIKEY")
# If any variables are missing, print them and exit with an error
if [ ${#missing_vars[@]} -ne 0 ]; then
echo "Error: The following required variables are missing:"
printf '%s\n' "${missing_vars[@]}"
exit 1
fi
elif [ "$WEBSITE" == "noaa-cpfp-point" ]; then
missing_vars=()
# Check for required variables
[ -z "${{ vars.PUBLIC_URL_NOAA }}" ] && missing_vars+=("vars.PUBLIC_URL_NOAA")
[ -z "${{ secrets.MAP_ACCESS_TOKEN }}" ] && missing_vars+=("secrets.MAP_ACCESS_TOKEN")
# If any variables are missing, print them and exit with an error
if [ ${#missing_vars[@]} -ne 0 ]; then
echo "Error: The following required variables are missing:"
printf '%s\n' "${missing_vars[@]}"
exit 1
fi
elif [ "$WEBSITE" == "nist-interface" ]; then
missing_vars=()
# Check for required variables
[ -z "${{ secrets.REACT_APP_MAPBOX_ACCESS_TOKEN }}" ] && missing_vars+=("secrets.REACT_APP_MAPBOX_ACCESS_TOKEN")
[ -z "${{ secrets.REACT_APP_MAPBOX_STYLE_URL }}" ] && missing_vars+=("secrets.REACT_APP_MAPBOX_STYLE_URL")
[ -z "${{ vars.FEATURES_API_URL }}" ] && missing_vars+=("vars.FEATURES_API_URL")
# If any variables are missing, print them and exit with an error
if [ ${#missing_vars[@]} -ne 0 ]; then
echo "Error: The following required variables are missing:"
printf '%s\n' "${missing_vars[@]}"
exit 1
fi
elif [ "$WEBSITE" == "goes-plume-viewer" ]; then
missing_vars=()
# Check for required variables
[ -z "${{ secrets.REACT_APP_MAPBOX_ACCESS_TOKEN }}" ] && missing_vars+=("secrets.REACT_APP_MAPBOX_TOKEN")
[ -z "${{ secrets.REACT_APP_MAPBOX_STYLE_URL }}" ] && missing_vars+=("secrets.REACT_APP_MAPBOX_STYLE_URL")
[ -z "${{ vars.REACT_APP_BASE_PATH_GOES }}" ] && missing_vars+=("vars.REACT_APP_BASE_PATH_GOES")
# If any variables are missing, print them and exit with an error
if [ ${#missing_vars[@]} -ne 0 ]; then
echo "Error: The following required variables are missing:"
printf '%s\n' "${missing_vars[@]}"
exit 1
fi
fi
done
shell: bash

- name: Build and deploy
run: |
IFS=',' read -r -a WEBSITES <<< "${{ env.CHANGED_WEBSITES }}"
Expand Down
16 changes: 16 additions & 0 deletions .github/workflows/update_data.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,22 @@ jobs:
steps:
- uses: actions/checkout@v4

# checks if the required env variables and secrets are present
- name: Validate required variables and secrets
run: |
missing_vars=()
# Check for required variables
[ -z "${{ secrets.GITHUB_TOKEN }}" ] && missing_vars+=("secrets.GITHUB_TOKEN")
# If any variables are missing, print them and exit with an error
if [ ${#missing_vars[@]} -ne 0 ]; then
echo "Error: The following required variables are missing:"
printf '%s\n' "${missing_vars[@]}"
exit 1
fi
shell: bash

# Downloads and extracts the files to the respective directory
- name: Run the data download script
run: |
Expand Down
24 changes: 24 additions & 0 deletions emit-ch4plume-v1/icon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
11 changes: 6 additions & 5 deletions emit-ch4plume-v1/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
<head>
<meta charset='utf-8' />
<title>Interactive Emission Plumes</title>
<link rel="icon" href="icon.svg" />
<meta name='viewport' content='width=device-width, initial-scale=1' />
<link

Expand All @@ -21,12 +22,12 @@
<link rel="stylesheet" href="src/style.css" />
</head>
<body>

<div>
<div id='map'></div>
<div id="loading-spinner" class="loading-spinner">
<div class="spinner">
</div>
</div>
<div id='map'></div>
<div id="loading-spinner" class="loading-spinner">
<div class="spinner"></div>
</div>

<div class="toolbar", id="toolbar">
<h1 class="toolbar-heading"> EMIT Methane Plume Viewer </h1>
Expand Down
1 change: 1 addition & 0 deletions emit-ch4plume-v1/src/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,7 @@ margin: 0px;
font-weight: 400;
opacity: 1;
color: grey;
padding-left: 0px;
}

.toolbar-line {
Expand Down
1 change: 1 addition & 0 deletions emit-ch4plume-v1/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ module.exports = (env) => {
}),
new CopyPlugin({
patterns: [{ from: "data", to: "data" }],
patterns: [{ from: "./icon.svg", to: "./" }],
}),
],
};
Expand Down
Binary file added goes-plume-viewer/public/apple-touch-icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed goes-plume-viewer/public/earth.png
Binary file not shown.
Binary file added goes-plume-viewer/public/favicon.ico
Binary file not shown.
Binary file added goes-plume-viewer/public/icon-192.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added goes-plume-viewer/public/icon-512.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
24 changes: 24 additions & 0 deletions goes-plume-viewer/public/icon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions goes-plume-viewer/public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@
<html lang="en">
<head>
<meta charset="utf-8" />
<link rel="icon" href="%PUBLIC_URL%/earth.png" />
<link rel="icon" href="%PUBLIC_URL%/icon.svg" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="theme-color" content="#000000" />
<meta
name="description"
content="Subdaily Plumes Observed from GOES Satellite."
/>
<link rel="apple-touch-icon" href="%PUBLIC_URL%/earth.png" />
<link rel="apple-touch-icon" href="%PUBLIC_URL%/apple-touch-icon.png" />
<!--
manifest.json provides metadata used when your web app is installed on a
user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/
Expand Down
6 changes: 3 additions & 3 deletions goes-plume-viewer/public/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,17 @@
"name": "Subdaily Plume Viewer Observed from GOES",
"icons": [
{
"src": "earth.png",
"src": "favicon.ico",
"sizes": "64x64 32x32 24x24 16x16",
"type": "image/x-icon"
},
{
"src": "earth.png",
"src": "favicon-192.ico",
"type": "image/png",
"sizes": "192x192"
},
{
"src": "earth.png",
"src": "favicon-512.ico",
"type": "image/png",
"sizes": "512x512"
}
Expand Down
4 changes: 2 additions & 2 deletions goes-plume-viewer/src/components/card/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ export function PlumeCard({ plumeSourceId, plumeSourceName, startDatetime, endDa
<CardMedia
component="img"
height="100"
sx={{ padding: "1em", objectFit: "contain", minWidth: "50px" }}
sx={{ padding: "1em", objectFit: "contain", minWidth: "50px", imageRendering: "pixelated" }}
image={imageUrl}
alt="Plume image"
/>
Expand Down Expand Up @@ -128,7 +128,7 @@ export function PlumeCard({ plumeSourceId, plumeSourceName, startDatetime, endDa
<HorizontalLayout>
<CaptionValue
className="card-plume"
caption = "Approximate Release Duration"
caption = "Approximate Release Duration from Start Time"
value = { formatDuration(moment.duration(duration)) }
/>
</HorizontalLayout>
Expand Down
2 changes: 1 addition & 1 deletion goes-plume-viewer/src/components/colorBar/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export const ColorBar = () => {
<Card id="colorbar">
<div ref={colorBarScale} className="colorbar-scale"></div>
<Typography variant="subtitle2" gutterBottom sx={{ marginBottom: 0 }} className="colorbar-label">
Maximum Methane Column Enhancement (mol/m²)
Methane Column Enhancement (mol/m²)
</Typography>
</Card>
)
Expand Down
2 changes: 1 addition & 1 deletion goes-plume-viewer/src/components/drawer/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ export function PersistentDrawerRight({open, setOpen, selectedPlumes, plumeMetaD
key={selectedPlumeMeta.id}
plumeSourceId={selectedPlumeMeta.id}
plumeSourceName={selectedPlumeMeta.id}
imageUrl={`${process.env.REACT_APP_RASTER_API_URL}/collections/${collectionId}/items/${plumesMap[selectedPlumeMeta.id].representationalPlume.id}/preview.png?assets=rad&rescale=${VMIN}%2C${VMAX}&colormap_name=${colorMap}&width=250&height=250`}
imageUrl={`${process.env.REACT_APP_RASTER_API_URL}/collections/${collectionId}/items/${plumesMap[selectedPlumeMeta.id].representationalPlume.id}/preview.png?assets=rad&rescale=${VMIN}%2C${VMAX}&colormap_name=${colorMap}`}
tiffUrl={`${process.env.REACT_APP_CLOUD_BROWSE_URL}/browseui/#${collectionId}/#q=${selectedPlumeMeta.id.split("_").slice(-1)}`}
lon={selectedPlumeMeta.lon}
lat={selectedPlumeMeta.lat}
Expand Down
Binary file added nist-interface/public/apple-touch-icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added nist-interface/public/favicon.ico
Binary file not shown.
Binary file added nist-interface/public/icon-192.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added nist-interface/public/icon-512.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 2faf553

Please sign in to comment.