Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create Deployment Environments #572

Merged
merged 81 commits into from
Aug 31, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
81 commits
Select commit Hold shift + click to select a range
5219346
Create data products view
Tammo-Feldmann May 9, 2023
c7342b0
Guard against missing filter options
Tammo-Feldmann May 9, 2023
a4c5724
Remove instruments limit from table
Tammo-Feldmann May 10, 2023
df1da0f
Fix products initial sort order
Tammo-Feldmann May 10, 2023
639ba2a
Add vertical measurement region filter
Tammo-Feldmann May 10, 2023
51eda39
Format products table
Tammo-Feldmann May 10, 2023
ed37bf7
Add products internal links
Tammo-Feldmann May 10, 2023
4a38a33
Add measurement style filter
Tammo-Feldmann May 15, 2023
506febe
Decouple text input field
Tammo-Feldmann May 16, 2023
dee7829
Update glossary.json
rwyatt19 May 18, 2023
2c25ca7
Update glossary.js
rwyatt19 May 18, 2023
73f898c
Add dropdown by text input
Tammo-Feldmann May 18, 2023
a7561d8
Use combobox for filter
Tammo-Feldmann May 19, 2023
a62ec23
Add product map
Tammo-Feldmann May 24, 2023
f534204
Update gcmd keywords filter
Tammo-Feldmann May 25, 2023
056f6c5
Fix linting issues
Tammo-Feldmann May 25, 2023
f851533
Update gcmd keyword source
Tammo-Feldmann May 25, 2023
080acc3
Merge branch 'develop' into feature/data-products-view
Tammo-Feldmann May 25, 2023
2146efb
Cleanup extra comments
Tammo-Feldmann May 25, 2023
c7d50ce
Fix measurment type filter
Tammo-Feldmann May 30, 2023
e421b90
Add related parents filter
Tammo-Feldmann May 30, 2023
d1a52ac
Fix missing props validation
Tammo-Feldmann May 30, 2023
d5ae002
Add missing location prop
Tammo-Feldmann May 31, 2023
827c20d
Fix conditional filter
Tammo-Feldmann May 31, 2023
dd42516
Fix missing props validation
Tammo-Feldmann May 31, 2023
b1477b2
Removed header text check on after explore page navigation. We alread…
May 31, 2023
6ff3ee3
Merge branch 'bugfix/e2e-header-check' into feature/data-products-view
Tammo-Feldmann May 31, 2023
8f5d903
Merge pull request #528 from NASA-IMPACT/bugfix/e2e-header-check
edkeeble May 31, 2023
ffb7b7b
Update tests for tabs number
Tammo-Feldmann May 31, 2023
fde5082
Merge pull request #509 from NASA-IMPACT/feature/data-products-view
edkeeble May 31, 2023
67b59e9
apply linting and fix up test results
naomatheus Jun 1, 2023
299fb92
Merge pull request #518 from NASA-IMPACT/glossary-text-updates
naomatheus Jun 1, 2023
52de652
update feedback form with correct link
naomatheus Jun 1, 2023
4ca9cf2
remove kruft of old feedback form, add API docs and FEEDBACK form to …
naomatheus Jun 5, 2023
8e2bf9e
respond to and apply linting
naomatheus Jun 5, 2023
29ad117
remove linting callout
naomatheus Jun 5, 2023
b300e28
update snapshots
naomatheus Jun 5, 2023
8128b94
resolving a build error
naomatheus Jun 5, 2023
7b9754a
Merge branch 'bug-fix/issue-505' into feature/issue-525
naomatheus Jun 5, 2023
a28c1b2
test resolution of issue 505, check description for details
naomatheus Jun 5, 2023
2e43ea0
remove fluff, guard for no bounds in spatial deployment
naomatheus Jun 6, 2023
b7eccca
update tests, apply linting
naomatheus Jun 6, 2023
923edf4
remove onload handler
naomatheus Jun 6, 2023
e723df3
Add video retaining config
Tammo-Feldmann Jun 6, 2023
9977ac7
Replace ssr location with prop
Tammo-Feldmann Jun 7, 2023
34f0818
Remove commented out lines
Tammo-Feldmann Jun 7, 2023
531a37e
Add testing instruction in README
Tammo-Feldmann Jun 7, 2023
3ead691
Merge pull request #533 from NASA-IMPACT/fix/issue-525
naomatheus Jun 7, 2023
6c1fb0b
apply linting, respond to comment
naomatheus Jun 7, 2023
b519411
Merge pull request #530 from NASA-IMPACT/feature/issue-525
naomatheus Jun 7, 2023
dd9b0d1
Merge branch 'feature/issue-525' into bug-fix/issue-505
naomatheus Jun 7, 2023
0f8dbec
Merge branch 'develop' into bug-fix/issue-505
naomatheus Jun 7, 2023
ce8c353
apply linting, fix prop validation
naomatheus Jun 7, 2023
80a73aa
Enhancement/data products (#532)
Tammo-Feldmann Jun 7, 2023
ab9544b
Replace products table link
Tammo-Feldmann Jun 8, 2023
8f207de
Fix broken explore map inputs
Tammo-Feldmann Jun 8, 2023
395d615
Merge pull request #536 from NASA-IMPACT/fix/data-products
edkeeble Jun 8, 2023
0795df4
Merge pull request #534 from NASA-IMPACT/bug-fix/issue-505
naomatheus Jun 9, 2023
8b47f43
Update/data products view (#551)
Tammo-Feldmann Jun 22, 2023
af5de3b
Feature/in review page closes #507 (#547)
Tammo-Feldmann Jun 22, 2023
a86ee81
Include new env var in workflows
Tammo-Feldmann Jun 22, 2023
4cffa76
Merge branch 'develop' of https://github.com/NASA-IMPACT/admg-invento…
Tammo-Feldmann Jun 22, 2023
a598935
Update csp plugin
Tammo-Feldmann Jun 22, 2023
2ab8c73
Adjust filters and layout closes #548 (#552)
Tammo-Feldmann Jun 26, 2023
6764dd9
Replace collection periods with platforms closes #546 (#550)
Tammo-Feldmann Jun 26, 2023
d565f9b
Update contact page content closes #545 (#554)
Tammo-Feldmann Jun 27, 2023
0755f8f
Update footer content closes #541 (#555)
Tammo-Feldmann Jun 27, 2023
8ca9711
Add filters to instruments page (#556)
Tammo-Feldmann Jun 27, 2023
c796944
Reduce glossary page padding closes #543 (#557)
Tammo-Feldmann Jun 27, 2023
e5a7e7a
Feature/data formats closes #410 (#558)
Tammo-Feldmann Jun 28, 2023
20181da
Update glossary map image (#559)
Tammo-Feldmann Jun 28, 2023
3a20b9f
Merge branch 'production' into develop
Tammo-Feldmann Jul 10, 2023
f143b20
Replace collection periods (#564)
Tammo-Feldmann Jul 10, 2023
504947e
Add modal and banner to header (#560)
Tammo-Feldmann Jul 10, 2023
df32f87
Add environments to deploy actions
Tammo-Feldmann Aug 21, 2023
1944990
Add grapql resolvers
Tammo-Feldmann Aug 23, 2023
cefe8c3
Remove duplicate keyword parsing
Tammo-Feldmann Aug 23, 2023
1d32c36
Guard against missing doi formats
Tammo-Feldmann Aug 23, 2023
82de02a
Fix incorrect prop types
Tammo-Feldmann Aug 23, 2023
980475f
Fix linting issue
Tammo-Feldmann Aug 23, 2023
eb81060
Merge branch 'production' into develop
Tammo-Feldmann Aug 23, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .github/workflows/deploy-to-production.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ on:
jobs:
build-and-deploy:
runs-on: ubuntu-latest
environment: production

env:
ADMG_ACCESS_TOKEN: ${{ secrets.ADMG_ACCESS_TOKEN }}
Expand All @@ -17,7 +18,7 @@ jobs:
GATSBY_CPU_COUNT: 2
GATSBY_MAPBOX_TOKEN: ${{ secrets.GATSBY_MAPBOX_TOKEN }}
GA_MEASUREMENT_ID: ${{ secrets.GA_MEASUREMENT_ID }}
GATSBY_ADMG_API: ${{ secrets.GATSBY_ADMG_API }}
GATSBY_ADMG_API: ${{ vars.GATSBY_ADMG_API }}

steps:
- name: Cancel Previous Runs
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/deploy-to-staging.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ on:
jobs:
build-and-deploy:
runs-on: ubuntu-latest
environment: staging

if: ${{ github.event.workflow_run.conclusion == 'success' }}

Expand All @@ -22,7 +23,7 @@ jobs:
GATSBY_CPU_COUNT: 2
GATSBY_MAPBOX_TOKEN: ${{ secrets.GATSBY_MAPBOX_TOKEN }}
GA_MEASUREMENT_ID: ${{ secrets.GA_MEASUREMENT_ID }}
GATSBY_ADMG_API: ${{ secrets.GATSBY_ADMG_API }}
GATSBY_ADMG_API: ${{ vars.GATSBY_ADMG_API }}

steps:
- name: Cancel Previous Runs
Expand Down
65 changes: 64 additions & 1 deletion gatsby-node.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,21 @@ exports.createSchemaCustomization = ({ actions }) => {
geographical_regions: [geographical_region] @link
iops: [iop] @link
significant_events: [significant_event] @link
}
type cmr_science_keyword implements Node {
Term: String
Topic: String
Category: String
VariableLevel1: String
VariableLevel2: String
VariableLevel3: String
}
type doi implements Node {
cmr_entry_title: String
doi: String
long_name: String
cmr_science_keywords: String
cmr_data_formats: [String]
cmr_science_keywords: [cmr_science_keyword]
campaigns: [campaign] @link
instruments: [instrument] @link
platforms: [platform] @link
Expand Down Expand Up @@ -295,3 +304,57 @@ exports.onCreateWebpackConfig = ({ stage, loaders, actions }) => {
})
}
}

exports.createResolvers = ({ createResolvers }) => {
const resolvers = {
doi: {
cmr_data_formats: {
resolve: source => {
// parse strings and log errors for arrays in string format
return typeof source.cmr_data_formats === "string"
? source.cmr_data_formats &&
!source.cmr_data_formats.includes("null") &&
source.cmr_data_formats.split("[")[1]
? source.cmr_data_formats
?.split("[")[1]
.split("]")[0]
.split(",")
.map(s =>
s
.replace(/[^a-zA-Z ]/g, "")
.replace(/^\s+|\s+$|\s+(?=\s)/g, "")
)
.filter(f => f !== "")
: []
: source.cmr_data_formats.filter(f => f !== "")
},
},
cmr_science_keywords: {
resolve: source => {
if (
source.cmr_science_keywords &&
typeof source.cmr_science_keywords === "string"
) {
// The doi keywords are stored as a JSON string in the database
// parsing them here into an object
let keywords = []
try {
keywords = JSON.parse(source.cmr_science_keywords).filter(
keyword => keyword.term && keyword.term !== "Not provided"
)
} catch (e) {
if (source.cmr_science_keywords !== null) {
console.error(
`ERROR: Could not parse ${source.cmr_science_keywords}`
)
}
}
return keywords
}
return source.cmr_science_keywords
},
},
},
}
createResolvers(resolvers)
}
34 changes: 12 additions & 22 deletions src/components/data-section.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,24 +19,13 @@ const DataSection = ({ id, dois, filterBy, category }) => {
// manually parse the data formats string to derive array of objects
const parsedDois = dois.map(doi => ({
...doi,
formats:
doi.formats && !doi.formats.includes("null") && doi.formats.split("[")[1]
? doi.formats
?.split("[")[1]
.split("]")[0]
.split(",")
.map(s =>
s.replace(/[^a-zA-Z ]/g, "").replace(/^\s+|\s+$|\s+(?=\s)/g, "")
)
.filter(f => f !== "")
.map(format => ({
id: format,
shortname: format,
longname: format,
}))
: [],
formats: doi.formats?.map(format => ({
id: format,
shortname: format,
longname: format,
})),
}))

console.log(parsedDois)
const clearFilters = () => setSelectedFilterIds([])

const removeFilter = id =>
Expand All @@ -53,7 +42,7 @@ const DataSection = ({ id, dois, filterBy, category }) => {
)
const formatList = parsedDois.reduce(
(acc, doi) => {
if (doi.formats.length > 0) {
if (doi.formats && doi.formats.length > 0) {
for (const format of doi.formats) {
if (!acc.unique.has(format.id)) {
acc.unique.add(format.id)
Expand All @@ -72,7 +61,7 @@ const DataSection = ({ id, dois, filterBy, category }) => {
platform: { options: platformList },
format: { options: formatList },
})

console.log({ formatList })
return (
<Section id={id}>
<SectionHeader headline="Data Products" id={id} />
Expand Down Expand Up @@ -181,9 +170,10 @@ const DataSection = ({ id, dois, filterBy, category }) => {
)}
</div>

{doi[filter1].length +
doi[filter2].length +
doi[filter3].length ? (
{doi[filter1]?.length ??
0 + doi[filter2]?.length ??
0 + doi[filter3]?.length ??
0 ? (
<div
css={`
display: flex;
Expand Down
2 changes: 1 addition & 1 deletion src/components/modal.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,5 +43,5 @@ Modal.propTypes = {
handleClose: PropTypes.func.isRequired,
isOpen: PropTypes.bool.isRequired,
children: PropTypes.element,
Custom: PropTypes.element,
Custom: PropTypes.func,
}
7 changes: 0 additions & 7 deletions src/components/release-banner.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import React, { useEffect, useState } from "react"
import PropTypes from "prop-types"
import styled from "styled-components"

import { CloseIcon } from "../icons"
Expand Down Expand Up @@ -139,10 +138,4 @@ const ReleaseBanner = () => {
)
}

ReleaseBanner.propTypes = {
shortname: PropTypes.string.isRequired,
children: PropTypes.element,
mode: PropTypes.string.isRequired,
}

export default ReleaseBanner
27 changes: 12 additions & 15 deletions src/pages/explore/products.js
Original file line number Diff line number Diff line change
Expand Up @@ -157,22 +157,12 @@ export default function ExploreProducts({ data, location }) {
let shapedGcmdPhenomena = []
let GcmdKeywordSet = new Set()
for (const doi of allShapedDoi) {
// The doi keywords are stored as a JSON string in the database
// parsing them here into an object
let keywords = []
try {
keywords = JSON.parse(doi.keywords)
} catch (e) {
console.error(`ERROR: Could not parse ${doi.keywords}`)
}

if (
keywords?.length &&
keywords != "null" &&
keywords != '"null"' &&
typeof keywords != "string"
doi.keywords?.length &&
doi.keywords != "null" &&
doi.keywords != '"null"'
) {
for (const keyword of keywords) {
for (const keyword of doi.keywords) {
const shortname = `${[
keyword.Term,
keyword.VariableLevel1 ? keyword.VariableLevel1 : "",
Expand Down Expand Up @@ -428,7 +418,14 @@ export const query = graphql`
doi
id
cmr_entry_title
keywords: cmr_science_keywords
keywords: cmr_science_keywords {
Term
Topic
Category
VariableLevel1
VariableLevel2
VariableLevel3
}
shortname: cmr_short_name
campaigns {
id
Expand Down
8 changes: 1 addition & 7 deletions src/utils/filter-utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -131,13 +131,7 @@ export function productsFilter(selectedFilterIds) {
)

const gcmdKeywords = new Set()
// const keywords = JSON.parse(product.keywords)
let keywords = []
try {
keywords = JSON.parse(product.keywords)
} catch (e) {
console.error(`ERROR: Could not parse ${product.keywords}`)
}
const { keywords } = product

if (
keywords?.length &&
Expand Down
Loading