Skip to content

Commit bc105fe

Browse files
authored
Merge pull request #774 from NASA-IMPACT/develop
Production update (20th Aug)
2 parents 3cb39f2 + 25a7bc5 commit bc105fe

File tree

10 files changed

+281
-65
lines changed

10 files changed

+281
-65
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@
7979
"babel-plugin-istanbul": "^6.1.1",
8080
"babel-plugin-styled-components": "^2.1.4",
8181
"babel-preset-gatsby": "^3.13.2",
82-
"eslint": "^8.10.0",
82+
"eslint": "^8.57.1",
8383
"eslint-config-prettier": "^8.4.0",
8484
"eslint-config-react-app": "^7.0.0",
8585
"eslint-plugin-inclusive-language": "^2.2.0",

src/components/button.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,6 @@ const Button = React.forwardRef(
4545
: mode === NEGATIVE
4646
? POSITIVE
4747
: NEGATIVE
48-
console.log(overrideMode)
4948
return (
5049
<Clickable
5150
as={as}

src/components/cards/campaign-card.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,12 @@ export default function CampaignCard({ shortname, mode }) {
5656
`)
5757

5858
const campaign = data.allCampaign.nodes.find(x => x.shortname === shortname)
59+
// this is a temporary fix for the issue #770 that will help us to debug it
60+
if (!campaign) {
61+
console.log(`Campaign ${shortname} not found`)
62+
return null
63+
}
64+
5965
return (
6066
<Card
6167
image={campaign.logo}

src/components/cards/instrument-card.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,11 @@ export default function InstrumentCard({ shortname }) {
4949
const instrument = data.allInstrument.nodes.find(
5050
x => x.shortname === shortname
5151
)
52+
// this is a temporary fix for the issue #770 that will help us to debug it
53+
if (!instrument) {
54+
console.log(`Instrument ${shortname} not found.`)
55+
return null
56+
}
5257

5358
return (
5459
<Card

src/components/explore/filter-by-textinput.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ const FilterByTextInput = React.forwardRef(
3636
`}
3737
>
3838
<IconButton
39-
data-cy="submit"
39+
id="submit"
4040
icon={<SearchIcon color={colors[NEGATIVE].text} />}
4141
type="submit"
4242
/>

src/templates/campaign/__tests__/__snapshots__/program-info-section.test.js.snap

Lines changed: 72 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -234,11 +234,42 @@ exports[`Program Info Section renders logo when present in props 1`] = `
234234
>
235235
NASA Data Repository
236236
</label>
237-
<div
238-
data-cy="program-info-content-text"
239-
>
240-
Currently unavailable
241-
</div>
237+
<p>
238+
<a
239+
className="sc-eqUAAy jxHsRt"
240+
data-cy="program-info-content-link"
241+
href="https://daac.ornl.gov/"
242+
rel="noopener noreferrer"
243+
target="_blank"
244+
>
245+
<span
246+
className="external-link___StyledSpan-sc-1dh0bmj-0 bnwLCF"
247+
>
248+
ORNL DAAC
249+
</span>
250+
<svg
251+
height="16"
252+
role="img"
253+
version="1.1"
254+
viewBox="0 0 16 16"
255+
width="16"
256+
xmlns="http://www.w3.org/2000/svg"
257+
>
258+
<title>
259+
External Link
260+
</title>
261+
<rect
262+
fill="none"
263+
height="16"
264+
width="16"
265+
/>
266+
<path
267+
d="M3,5h4V3H1v12h12V9h-2v4H3V5z M16,8V0L8,0v2h4.587L6.294,8.294l1.413,1.413L14,3.413V8H16z"
268+
fill="#aac9ff"
269+
/>
270+
</svg>
271+
</a>
272+
</p>
242273
</div>
243274
<div
244275
data-cy="program-info-content"
@@ -414,11 +445,42 @@ exports[`Program Info Section renders placeholder when no logo is available 1`]
414445
>
415446
NASA Data Repository
416447
</label>
417-
<div
418-
data-cy="program-info-content-text"
419-
>
420-
Currently unavailable
421-
</div>
448+
<p>
449+
<a
450+
className="sc-eqUAAy jxHsRt"
451+
data-cy="program-info-content-link"
452+
href="https://daac.ornl.gov/"
453+
rel="noopener noreferrer"
454+
target="_blank"
455+
>
456+
<span
457+
className="external-link___StyledSpan-sc-1dh0bmj-0 bnwLCF"
458+
>
459+
ORNL DAAC
460+
</span>
461+
<svg
462+
height="16"
463+
role="img"
464+
version="1.1"
465+
viewBox="0 0 16 16"
466+
width="16"
467+
xmlns="http://www.w3.org/2000/svg"
468+
>
469+
<title>
470+
External Link
471+
</title>
472+
<rect
473+
fill="none"
474+
height="16"
475+
width="16"
476+
/>
477+
<path
478+
d="M3,5h4V3H1v12h12V9h-2v4H3V5z M16,8V0L8,0v2h4.587L6.294,8.294l1.413,1.413L14,3.413V8H16z"
479+
fill="#aac9ff"
480+
/>
481+
</svg>
482+
</a>
483+
</p>
422484
</div>
423485
<div
424486
data-cy="program-info-content"

src/templates/campaign/__tests__/program-info-section.test.js

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,14 @@ const testImage = {
3636
},
3737
},
3838
}
39+
const testRepositories = [
40+
{
41+
id: "1183964c-6517-4e25-89ca-68b1b409aed6",
42+
shortname: "ORNL DAAC",
43+
longname: "Oak Ridge National Laboratory DAAC (ORNL)",
44+
url: "https://daac.ornl.gov/",
45+
},
46+
]
3947

4048
describe("Program Info Section", () => {
4149
it("renders logo when present in props", () => {
@@ -49,7 +57,7 @@ describe("Program Info Section", () => {
4957
programLead={testString}
5058
leadInvestigator={testString}
5159
dataManager={testString}
52-
repositoryWebsite={testUrl}
60+
repositories={testRepositories}
5361
partnerOrgListing={testString}
5462
publicationLink={testUrl}
5563
/>
@@ -78,14 +86,14 @@ describe("Program Info Section", () => {
7886
programLead={testString}
7987
leadInvestigator={testString}
8088
dataManager={testString}
81-
repositoryWebsite={testUrl}
89+
repositories={testRepositories}
8290
partnerOrgListing={testString}
8391
publicationLink={testUrl}
8492
/>
8593
)
8694
const tree = component.toJSON()
8795
const instance = component.root
88-
expect(instance.findByType("svg")).toBeDefined()
96+
expect(instance.findAllByType("svg").length).toBe(2)
8997
expect(tree).toMatchSnapshot()
9098
})
9199
})

src/templates/campaign/program-info-section.js

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,15 @@ const ProgramInfoSection = ({
3737
{ label: "Data Manager / Technical Contact", info: dataManager },
3838
{
3939
label: "NASA Data Repository",
40-
info: repositories && repositories[0]?.shortname,
41-
link: repositories && repositories[0]?.url,
40+
info: repositories
41+
? repositories[0]?.url.startsWith("http")
42+
? repositories[0]?.shortname
43+
: repositories[0]?.longname
44+
: null,
45+
link:
46+
repositories && repositories[0]?.url.startsWith("http")
47+
? repositories[0]?.url
48+
: null,
4249
},
4350
{ label: "Partner Organizations", info: partnerOrgListing },
4451
{
@@ -159,6 +166,7 @@ ProgramInfoSection.propTypes = {
159166
repositories: PropTypes.arrayOf(
160167
PropTypes.shape({
161168
shortname: PropTypes.string.isRequired,
169+
longname: PropTypes.string.isRequired,
162170
url: PropTypes.string.isRequired,
163171
}).isRequired
164172
).isRequired,

src/utils/constants.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,4 +45,5 @@ export const MOVING_PLATFORMS = [
4545
"Drifting Buoy",
4646
"Ships/Boats",
4747
"Saildrone",
48+
"Air Platforms",
4849
]

0 commit comments

Comments
 (0)