diff --git a/LICENSE b/LICENSE index f4159b61..1d310175 100644 --- a/LICENSE +++ b/LICENSE @@ -1,21 +1,65 @@ -The MIT License - -Copyright 2020 Development Seed . - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. +Apache License +Version 2.0, January 2004 +http://www.apache.org/licenses/ + +TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + +1. Definitions. + +"License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. + +"Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. + +"Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. + +"You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. + +"Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. + +"Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. + +"Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). + +"Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. + +"Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." + +"Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. + +2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. + +3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. + +4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: + +You must give any other recipients of the Work or Derivative Works a copy of this License; and +You must cause any modified files to carry prominent notices stating that You changed the files; and +You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and +If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. +You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. + +5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. + +6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. + +7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. + +8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. + +9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. + +END OF TERMS AND CONDITIONS + +Copyright 2023 NASA-IMPACT + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. \ No newline at end of file diff --git a/README.md b/README.md index 9646a23a..7eea6e9c 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,5 @@

- - NASA - + NASA IMPACT - ADMG

ADMG Inventory @@ -9,17 +7,17 @@ The goal of this project is to build a centralized airborne data inventory for easier user access to data and information. Airborne scientists and researchers would like to -- get curated and organized data context for efficient data search, -- gain detailed information with consistent terminology about ongoing and past airborne campaigns in a one-stop-shop for airborne data resources and information +- Obtain curated and organized data context for efficient data search, +- Gain detailed information with consistent terminology about ongoing and past airborne campaigns in a one-stop-shop for airborne data resources and information - quickly* find and access relevant data products and view the associated context (* quickly could mean _fewer clicks_) -- provide feedback on inventory contents, noting inaccuracies or requesting ADMG for more details +- Provide feedback on inventory contents, noting inaccuracies or requesting ADMG for more details _To learn more about the goals and ideas of this project, [have a look at the User Story Map](https://miro.com/app/board/o9J_kumT768=/)._ -## 🪲 Report a Bug +## Report a Bug If you notice that something is not working as it should or looks a bit off, please [create an issue](https://github.com/NASA-IMPACT/admg-inventory/issues/new/choose) here in this repository and we will work to get it fixed. -## 💡 Request a Feature +## Request a Feature There is also an issue template for ideas or suggestions. If you have an idea for something new or something you would like to see different, please follow the same steps above, but select the issue template for feature request. diff --git a/docs/adr/0007-esdis-migration.md b/docs/adr/0007-esdis-migration.md new file mode 100644 index 00000000..46e12eb4 --- /dev/null +++ b/docs/adr/0007-esdis-migration.md @@ -0,0 +1,133 @@ +# ADR - Integration of CMR and CASEI + +## Context + +As part of the ongoing transition of the Catalog of Archived Suborbital Earth Science Investigation (CASEI) from the Airborne Metadata Management Group (ADMG) to the Earth Science Data Systems Program (ESDS), a critical aspect is determining the technical implications and development goals for the next fiscal year, commencing with the next Product Increment (PI). This transition's success hinges on aligning with ESDS's vision for CASEI. Early discussions suggest that ESDS envisions using the Common Metadata Repository (CMR) and Global Change Master Directory (GCMD) Keyword Management System (KMS) as the backends for the CASEI frontend, given their existing maintenance of CMR & KMS. This document describes potential pathways to integrate the CASEI front end with the CMR as a backend. + +### What We Know + +1. ESDS aims to utilize CMR as the backend for the CASEI system. +1. ADMG prefers ESDS to continue providing the unique metadata and frontend features currently available in CASEI. +1. Future metadata curators, whether they be trained Data Archive and Access Centers (DAACs) or the current ADMG curation team, require an interface or non-technical method to contribute data that undergoes an approval workflow. + +## Analysis + +### Comparison of Data Types + +Many data types within CASEI are available within the CMR/KMS, although some appear to be identified with different terminology. Below is an attempt to perform a "crosswalk" between the two systems: + +| CASEI | CMR/KMS | +| ------------- | ------------ | +| Campaign | Project | +| Instrument | Instrument | +| Platform | Platform | +| Data Products | Collection | +| PlatformType | PlatformType | +| Deployment | ? | + +## Challenges + +### Data Overlap + +When comparing the CMR/KMS and CASEI data, many records are unique to only one system. For example, there may be many campaigns listed in the CMR that are absent in CASEI, and vice versa. Similarly, instruments or platforms may only be present in one system and not the other. In such cases, only a small subset of records will be found in both systems. + +An analysis comparing the `short_name` values of Campaigns, Instruments, and Platforms records within CASEI and the CMR can be found in the table below: + +| Model | # in CASEI | # in KMS | # in CASEI & KMS | +| ---------- | ---------- | -------- | ---------------- | +| Campaign | 107 | 1876 | 83 | +| Instrument | 547 | 1885 | 203 | +| Platform | 121 | 939 | 15 | + +The entirety of the comparison can be found in the following spreadsheet: https://docs.google.com/spreadsheets/d/1oclVKPVzcW2DbIuPoY7GhNApe8mg4ov8xbhgbR6Hrp4. + +### Authorship + +The experience of authoring Keywords and Concepts within the KMS & and CMR drastically differs from authoring records within the CASEI backend. + +#### Tools + +- [CMR Metadata Curation Dashboard](https://cmr-dashboard.earthdata.nasa.gov/) +- [Draft Metadata Management Tool (dMMT)](https://draftmmt.earthdata.nasa.gov/) + +#### Schemas + +- [CMR Metadata Best Practices](https://wiki.earthdata.nasa.gov/display/CMR/CMR+Metadata+Best+Practices%3A+Landing+Page) +- [GCMD Keyword Requirements](https://wiki.earthdata.nasa.gov/display/CMR/GCMD+Keyword+Requirements) +- [GCMD Keyword Review and Release Process](https://wiki.earthdata.nasa.gov/display/CMR/Keyword+Review+and+Release+Process) + +### Metadata Gaps + +Records in CMR/KMS do not contain the entire metadata within the current CASEI backend. + +## Strategies + +### Curating within CMR/KMS ecosystem, serve a subset of CMR/KMS data + +Focusing on transferring curation to existing CMR/KMS tools. Focus attention on re-evaluating which metadata within the current CASEI system is required to be maintained post-ESDS transfer. The CASEI frontend should be updated as such: + +1. Utilize the CMR/KMS as the sole backends. Since the CASEI system does not intend to serve the entirety of the CMR/KMS dataset, a simple list of KMS Projects (identified by their short_names) could be maintained within the CASEI frontend. At the time of build, this list would determine which CASEI Campaigns would be retrieved from the KMS backend. Relationships between records stemming from these Campaigns would then be traversed, populating a dataset that would be used to assemble the CASEI front end. +1. Reduce the data displayed on the CASEI UI to conform to the limited metadata schema offered by the CMR/KMS backends. +1. Generate documentation to guide future data curators to use existing CMR and KMS submission processes. + +#### Pros + +- Little/no change is required for the existing CMR/KMS ecosystem. +- Retire the current CASEI backend, reducing operational overhead for ESDS. + +#### Cons + +- Some added complexity maintaining a list of KMS projects to include within CASEI, requiring curators to submit records to CMR/KMS and register them within CASEI. +- Reduced data displayed on the CASEI UI to conform to the limited metadata schema offered by the CMR/KMS backends. +- Future data curators must be trained to use CMR and KMS to submit new metadata. +- The loss of the current CASEI backend public API. However, efforts could be made to add a read-only API to the CASEI frontend where JSON serialized version of the CASEI data. The utility of this is questionable if this data is already accessible from the CMR/KMS. + +#### Estimated level of effort + +Medium; roughly one product increment for a team of two developers. + +### Augment CMR records + +To accommodate the desire to utilize the CMR/KMS as a backend but also to compensate for the lack of completeness in data that the CMR/KMS currently provides, it is possible to retrieve what is available from the CMR but additionally augment that data with data stored in an auxiliary system. During the build process of the CASEI front end, these various data sources would be queried, and records for coincidental concepts would be merged into a single record, likely giving precedent to information retrieved from the CMR/KMS. Such a system requires extensive planning and consultation with future CASEI maintainers. On an elementary level, these records could be stored as flat files within the CASEI frontend repository, wherein the approval process would be reduced to Pull Requests on GitHub, and validation would occur via linting operations via GitHub Actions. At a more complex level, a system similar to the current CASEI backend could be developed to assist in this curation process. Modifying the current CASEI backend to accomplish this task is possible but would likely involve a significant refactor and substantial development hours. + +#### Estimated level of effort + +High; roughly one to two product increments for a team of three or more developers. + +#### Pros + +- Maintain the rich metadata currently within CASEI while fulfilling the desire to serve data from CMR. + +#### Cons + +- Significant added complexity requiring curators to manage records in both CMR/KMS and the CASEI metadata augmentation service/codebase. +- Future data curators must be trained to use CMR and KMS to submit new metadata. +- Loss of the current CASEI backend public API. However, efforts could be made to add a read-only API to the CASEI frontend where JSON serialized version of the CASEI data. + +### Continue usage of CASEI Backend + +The current CASEI backend was custom-built to accommodate the specific needs of the CASEI project, particularly its data model and approval workflow. Given that it is currently addressing the needs of the CASEI project, development requirements could be alleviated by continuing to use the CASEI backend as we do today. As such, efforts should shift towards developing detailed documentation about the software architecture to set up future codebase maintainers for success. + +#### Estimated level of effort + +Low; less than one product increment for a team of two developers. + +#### Pros + +- Minimal attending development needs. The current CASEI backend runs in an isolated Amazon Web Services (AWS) account. It is possible to transfer ownership of this account to ESDS to avoid the need for redeployment of any services. +- Makes use of the entirety of current ADMG metadata. + +#### Cons + +- Onboarding to the current CASEI backend codebase can be a steep learning curve. The CASEI backend should be considered an intermediate-to-expert level Django project, which would greatly benefit from a team of developers with prior experience with Django-based applications. It is worth noting that the CMR source code ([`nasa/Common-Metadata-Repository`](https://github.com/nasa/Common-Metadata-Repository)) or the MMT source code ([`nasa/mmt`](https://github.com/nasa/mmt)) are written in Clojure & Ruby, respectively. + + Suppose the future maintainers need to become more familiar with the Django framework. In that case, it is prudent to identify which languages and frameworks are familiar to these maintainers and evaluate the effort to port the CASEI backend functionality to another toolset in conjunction with future maintainers. + +- Does not make use of the CMR/KMS backends. To be included in CASEI, data must be manually submitted via curators. + +## Decision Criteria + +Determining the direction to take CASEI is largely dependent on two questions: + +1. What is to be done with data that the current iteration of CASEI contains but needs to be added to current CMR/KMS records? This determination will inform us whether efforts should be undertaken to trim down and simplify CASEI to fit in with CMR/KMS' current data model or if we should dedicate time to compensate for CMR/KMS's more sparse data model. +1. Is ESDS capable and willing to take ownership over the maintenance of the current CASEI backend and to adapt to using its existing curator workflow for future CASEI data input? diff --git a/playwright/e2e/explore.spec.ts b/playwright/e2e/explore.spec.ts index a3e87d4c..6a61b4eb 100644 --- a/playwright/e2e/explore.spec.ts +++ b/playwright/e2e/explore.spec.ts @@ -265,11 +265,11 @@ test.describe("Explore", () => { .locator("xpath=..") // TODO expect( await hamsrCard.locator("[data-cy=shortname]").textContent() - ).toContain("HAMSR") + ).toMatch("HAMSR") expect( await hamsrCard.locator("[data-cy=longname]").textContent() - ).toContain( - "High Altitude Monolithic Microwave integrated Circuit(MMIC) Sounding Radiometer" + ).toMatch( + "High Altitude Monolithic Microwave integrated Circuit (MMIC) Sounding Radiometer" ) await page.waitForSelector("[data-cy=instruments-card-footer]", { diff --git a/playwright/e2e/header.spec.ts b/playwright/e2e/header.spec.ts index 4b4c666c..72998e5d 100644 --- a/playwright/e2e/header.spec.ts +++ b/playwright/e2e/header.spec.ts @@ -13,8 +13,10 @@ test.describe("Header", () => { }) test("renders correctly", async () => { - // TODO re-enable this header test once temporary release banner is removed - // await expect(page.locator('header')).toHaveText(site.siteMetadata.headerType); + // disable this header test for temporary release banner + await expect(page.locator("header")).toHaveText( + site.siteMetadata.headerType + ) const nasaLogo = page.locator("[data-cy=nasa-logo]") await expect(nasaLogo).toHaveAttribute( diff --git a/src/components/__tests__/__snapshots__/footer.test.js.snap b/src/components/__tests__/__snapshots__/footer.test.js.snap index d39b20d3..0a5e8d0f 100644 --- a/src/components/__tests__/__snapshots__/footer.test.js.snap +++ b/src/components/__tests__/__snapshots__/footer.test.js.snap @@ -278,7 +278,7 @@ exports[`Footer renders correctly 1`] = ` data-cy="footer-credit-devseed" > © - 2023 + 2024 , Built by -
- July 2023 Update! While CASEI has been publicly available in beta mode - since 2021, we are launching our - - -
-
-
-

- July 2023 Update! While CASEI has been publicly available in beta mode since 2021, there is now a majority (65%) of known NASA airborne and field campaigns represented across the database and a unique range of search/browse functionality built into CASEI and its API. -

-
-

- As you explore CASEI in this full-release version, keep in mind that additional campaigns, platforms, instruments, and data products are still being curated. We welcome - - ! -

-
- -
-
diff --git a/src/components/data-section.js b/src/components/data-section.js index 30ea9f1f..b7f46b19 100644 --- a/src/components/data-section.js +++ b/src/components/data-section.js @@ -25,7 +25,6 @@ const DataSection = ({ id, dois, filterBy, category }) => { longname: format, })), })) - console.log(parsedDois) const clearFilters = () => setSelectedFilterIds([]) const removeFilter = id => @@ -61,7 +60,6 @@ const DataSection = ({ id, dois, filterBy, category }) => { platform: { options: platformList }, format: { options: formatList }, }) - console.log({ formatList }) return (
diff --git a/src/components/footer.js b/src/components/footer.js index f0ca774a..af5e4688 100644 --- a/src/components/footer.js +++ b/src/components/footer.js @@ -184,7 +184,7 @@ const Footer = ({ shortname }) => { aria-label="Visit nasa.gov (opens in a new window)" > { const offsetCalculator = (scrollDirection, _, currentScroll) => { @@ -29,7 +28,6 @@ const Header = ({ shortname, children, mode }) => { rgba(68, 63, 63, 0.08) 0px 2px 6px 0px; `} > -
{ aria-label="Visit nasa.gov (opens in a new window)" > - {backgroundImage && backgroundImage.gatsbyImg && ( + {backgroundImage && (
- + > + +
)} @@ -237,11 +261,5 @@ Hero.propTypes = { cta: PropTypes.node, textToImageRatio: PropTypes.arrayOf(PropTypes.number), image: PropTypes.node, - backgroundImage: PropTypes.shape({ - nasaImgAlt: PropTypes.string.isRequired, - gatsbyImg: PropTypes.shape({ - childImageSharp: PropTypes.object.isRequired, - }).isRequired, - }), id: PropTypes.string, } diff --git a/src/content/faq.json b/src/content/faq.json index 05ffab16..2ed388aa 100644 --- a/src/content/faq.json +++ b/src/content/faq.json @@ -34,12 +34,19 @@ { "section": "2 Inventory Content/What’s New", "question": "What are Geophysical Concepts?", - "answer": "Geophysical concepts are terms that correlate to the six NASA Earth Science Focus Areas and the Global Change Master Directory (GCMD) Earth Science Keywords, bridging the gap between the general and specific terms used to describe scientific studies and data. {{concepts}}", + "answer": "{{link.geophysicalconcepts}} are terms that correlate to the six NASA Earth Science Focus Areas and the Global Change Master Directory (GCMD) Earth Science Keywords, bridging the gap between the general and specific terms used to describe scientific studies and data. {{concepts}}", "images": [ { "id": "concepts", "alt": "Relationship between geophysical concepts, NASA Earth Science Focus Areas, and GCMD Earth Science Keywords" } + ], + "links": [ + { + "id": "link.geophysicalconcepts", + "text": "Geophysical concepts", + "url": "https://drive.google.com/file/d/1YvQ6iR5S_ehJ4cTP87q6Y7odQ8oW5gg0/view?usp=drive_link" + } ] }, { diff --git a/src/content/glossary.json b/src/content/glossary.json index 02d4176c..b798bda0 100644 --- a/src/content/glossary.json +++ b/src/content/glossary.json @@ -31,7 +31,7 @@ }, { "term": "Instrument Package", - "definition": "All instruments operating on a platform. This may consist of a single instrument or multiple individual instruments and any associated technology such as power systems or telecommunications hardware. The instrument package used on a given platform can change over time, by flight, deployment, or field investigation, in order to support specific science/research objectives or due to an individual instrument failure.", + "definition": "All instruments operating on a platform. This may consist of a single instrument or multiple individual instruments and any associated technology such as power systems or telecommunications hardware. The instrument package used on a given platform can change over time, by flight, deployment, or field investigation, in order to support specific science/research objectives or due to an individual instrument failure.", "note": "Note that individuals, science teams, or research groups may also refer to the instrument package as the instrument payload, particularly for airborne platforms." }, { @@ -64,10 +64,17 @@ }, { "term": "Geophysical Concept", - "definition": "High-level science concepts identified by ADMG as a means to bridge the necessary generality of NASA’s Earth Science Focus Areas and the inherent specificity of the GCMD Science Keywords. These intermediary concepts are intended to facilitate improved communication and contextual use of both the NASA Earth Science Focus Areas and the GCMD Earth Science Keywords, bearing in mind the many-to-many relationships among them and the fundamental interconnectedness of the various processes that comprise the Earth system. There are currently 26 ADMG-identified geophysical concepts which can be assigned as metadata in CASEI to categorize a field investigation with respect to its purpose, goals, effort, or findings." + "definition": "High-level science concepts identified by ADMG as a means to bridge the necessary generality of NASA’s Earth Science Focus Areas and the inherent specificity of the GCMD Science Keywords. These intermediary concepts are intended to facilitate improved communication and contextual use of both the NASA Earth Science Focus Areas and the GCMD Earth Science Keywords, bearing in mind the many-to-many relationships among them and the fundamental interconnectedness of the various processes that comprise the Earth system. There are currently 26 {{link.geophysicaldoc}} which can be assigned as metadata in CASEI to categorize a field investigation with respect to its purpose, goals, effort, or findings.", + "links": [ + { + "id": "link.geophysicaldoc", + "text": "ADMG-identified geophysical concepts", + "url": "https://drive.google.com/file/d/1YvQ6iR5S_ehJ4cTP87q6Y7odQ8oW5gg0/view?usp=drive_link" + } + ] }, { "term": "Assigned DAAC", "definition": "The DAAC designated by NASA's Earth Science Data Systems (ESDS) Program to have the responsibility of ensuring proper stewardship of the data and information for an investigation or facility instrument/major airborne instrument. Until recently, formal DAAC assignments were not often completed. Therefore, for older field investigations with data products already within the EOSDIS system, the DAAC that distributes the majority of the data is considered, by default, the assigned DAAC. If data products from a field investigation are archived and distributed by separate DAACs, it is the responsibility of the assigned DAAC to organize all information, clearly identify all data products, provide additional metadata and information links, and obtain a data product group DOI to represent all the data products resulting from an investigation, as needed. The assigned DAAC must maintain all links and preserve all materials needed to fully understand the data products and the campaign context in the future. For historical data not yet available in EOSDIS and the Common Metadata Repository (CMR), a DAAC-assignment procedure is followed to assign the historical field investigation to a DAAC for data publication." } -] +] \ No newline at end of file diff --git a/src/content/nasa-images.json b/src/content/nasa-images.json index c6757b65..eb458128 100644 --- a/src/content/nasa-images.json +++ b/src/content/nasa-images.json @@ -107,12 +107,6 @@ "image": "https://images-assets.nasa.gov/image/AFRC2016-0292-08/AFRC2016-0292-08~orig.jpg", "nasaImgAlt": "NASA’s Global Hawk aircraft being deployed to Florida from Armstrong Flight Research Center (Photography courtesy NASA Images)" }, - { - "shortname": "Home", - "category": "layout", - "image": "https://www.nasa.gov/sites/default/files/images/699943main_ice_bridge_full_full.jpg", - "nasaImgAlt": "NASA's DC-8 flying laboratory passes Antarctica's tallest peak, Mount Vinson, on Oct. 22, 2012, during a flight over the continent to measure changes in the massive ice sheet and sea ice. Credit: NASA/Michael Studinger (Photography courtesy NASA Images)" - }, { "shortname": "about-hero", "category": "layout", diff --git a/src/images/main_ice_bridge.png b/src/images/main_ice_bridge.png new file mode 100644 index 00000000..c7c333da Binary files /dev/null and b/src/images/main_ice_bridge.png differ diff --git a/src/images/nasa-logo-web-rgb.png b/src/images/nasa-logo-web-rgb.png new file mode 100644 index 00000000..07b82277 Binary files /dev/null and b/src/images/nasa-logo-web-rgb.png differ diff --git a/src/pages/about.js b/src/pages/about.js index 7b91ff9f..749c1f5c 100644 --- a/src/pages/about.js +++ b/src/pages/about.js @@ -56,7 +56,6 @@ const About = ({ data }) => { title="NASA" description="conducts and supports Earth Science field investigations, including airborne campaigns, to supplement space-borne observations and advance scientific understanding and predictive capability of our home planet’s natural processes." textToImageRatio={[12, 0]} - backgroundImage={data.heroImage} id="about" /> @@ -161,14 +160,6 @@ const About = ({ data }) => { export const query = graphql` { - heroImage: nasaImagesJson(shortname: { eq: "about-hero" }) { - nasaImgAlt - gatsbyImg { - childImageSharp { - gatsbyImageData(layout: FULL_WIDTH, placeholder: BLURRED) - } - } - } bodyImage: nasaImagesJson(shortname: { eq: "about-body" }) { nasaImgAlt gatsbyImg { @@ -182,12 +173,6 @@ export const query = graphql` About.propTypes = { data: PropTypes.shape({ - heroImage: PropTypes.shape({ - nasaImgAlt: PropTypes.string.isRequired, - gatsbyImg: PropTypes.shape({ - childImageSharp: PropTypes.object.isRequired, - }).isRequired, - }).isRequired, bodyImage: PropTypes.shape({ nasaImgAlt: PropTypes.string.isRequired, gatsbyImg: PropTypes.shape({ diff --git a/src/pages/explore/platforms.js b/src/pages/explore/platforms.js index 1523c638..febe4eff 100644 --- a/src/pages/explore/platforms.js +++ b/src/pages/explore/platforms.js @@ -1,7 +1,7 @@ import React, { useState, useRef, useEffect } from "react" import PropTypes from "prop-types" import { graphql } from "gatsby" - +import { replaceCategoryInGrouped } from "../../utils/replace-category-name" import { NEGATIVE } from "../../utils/constants" import { colors } from "../../theme" import { selector } from "../../utils/filter-utils" @@ -35,13 +35,19 @@ export default function ExplorePlatforms({ data, location }) { } }, [selectedFilterId]) - const platformList = usePlatformList( + let platformList = usePlatformList( allPlatform.list, sortOrder, selectedFilterIds, searchResult ) + // modify after receiving from hook + platformList = { + ...platformList, + grouped: replaceCategoryInGrouped(platformList.grouped), + } + const addFilter = id => setFilter([...selectedFilterIds, id]) const removeFilter = id => setFilter(selectedFilterIds.filter(f => f !== id)) diff --git a/src/pages/glossary.js b/src/pages/glossary.js index 1b556c6f..c0c777ac 100644 --- a/src/pages/glossary.js +++ b/src/pages/glossary.js @@ -3,7 +3,6 @@ import PropTypes from "prop-types" import { graphql } from "gatsby" import { GatsbyImage } from "gatsby-plugin-image" import VisuallyHidden from "@reach/visually-hidden" - import Layout, { PageBody, SectionHeader, @@ -253,7 +252,9 @@ export default function Glossary({ data }) { slimPadding >

{x.term}

-

{x.definition}

+
+ {x.links ? : x.definition} +
{x.note && (

{ + const templatePattern = /{{\s?([^{}\s]*)\s?}}/g + // split definition text by the template pattern + const parts = node.definition.split(templatePattern) + // map over parts and perform replacement + return ( +

+ {parts.map((part, index) => { + // return first element of parts array which matches node.id + // eslint-disable-next-line + const link = node.links?.find(link => link.id === part) + + // if a part matches link.id, replace that part with an ExternalLink, and reconcat as node.definition + if (link) { + return ( + // eslint-disable-next-line + + + + ) + } + // Otherwise, return the part as is + return part + })} +
+ ) +} + +LinkSection.propTypes = { + node: PropTypes.shape({ + definition: PropTypes.string.isRequired, + links: PropTypes.arrayOf( + PropTypes.shape({ + id: PropTypes.string.isRequired, + text: PropTypes.string.isRequired, + url: PropTypes.string.isRequired, + }) + ), + }).isRequired, +} + export const query = graphql` { allGlossaryJson { @@ -282,6 +329,11 @@ export const query = graphql` term definition note + links { + id + text + url + } } } image: file(relativePath: { eq: "glossary-map.jpeg" }) { @@ -300,6 +352,13 @@ Glossary.propTypes = { term: PropTypes.string.isRequired, definition: PropTypes.string.isRequired, note: PropTypes.string, + links: PropTypes.PropTypes.arrayOf( + PropTypes.shape({ + id: PropTypes.string, + text: PropTypes.string, + url: PropTypes.string, + }) + ), }) ), }).isRequired, diff --git a/src/pages/index.js b/src/pages/index.js index 5bc8c206..59db51cd 100644 --- a/src/pages/index.js +++ b/src/pages/index.js @@ -28,7 +28,6 @@ const Home = ({ data }) => { )} description={data.site.siteMetadata.description} cta="Explore CASEI" - backgroundImage={data.heroImage} textToImageRatio={[5, 7]} id="home" /> @@ -153,14 +152,6 @@ export const query = graphql` description } } - heroImage: nasaImagesJson(shortname: { eq: "Home" }) { - nasaImgAlt - gatsbyImg { - childImageSharp { - gatsbyImageData(layout: FULL_WIDTH, placeholder: BLURRED) - } - } - } allFocusArea { nodes { id @@ -235,12 +226,6 @@ Home.propTypes = { description: PropTypes.string.isRequired, }), }), - heroImage: PropTypes.shape({ - nasaImgAlt: PropTypes.string.isRequired, - gatsbyImg: PropTypes.shape({ - childImageSharp: PropTypes.object.isRequired, - }).isRequired, - }).isRequired, allFocusArea: PropTypes.shape({ nodes: PropTypes.arrayOf( PropTypes.shape({ diff --git a/src/templates/campaign/index.js b/src/templates/campaign/index.js index 77d6d04b..f6257be2 100644 --- a/src/templates/campaign/index.js +++ b/src/templates/campaign/index.js @@ -366,7 +366,7 @@ CampaignTemplate.propTypes = { PropTypes.shape({ cmrTitle: PropTypes.string.isRequired, doi: PropTypes.string.isRequired, - format: PropTypes.string, + formats: PropTypes.string, id: PropTypes.string.isRequired, longname: PropTypes.string, }) diff --git a/src/templates/instrument/index.js b/src/templates/instrument/index.js index 80ab6485..37cc7877 100644 --- a/src/templates/instrument/index.js +++ b/src/templates/instrument/index.js @@ -137,7 +137,7 @@ InstrumentTemplate.propTypes = { dois: PropTypes.arrayOf( PropTypes.shape({ cmrTitle: PropTypes.string.isRequired, - format: PropTypes.string, + formats: PropTypes.string, doi: PropTypes.string.isRequired, id: PropTypes.string.isRequired, longname: PropTypes.string, diff --git a/src/templates/platform/index.js b/src/templates/platform/index.js index 6c8109ef..d06b05dc 100644 --- a/src/templates/platform/index.js +++ b/src/templates/platform/index.js @@ -183,7 +183,7 @@ PlatformTemplate.propTypes = { dois: PropTypes.arrayOf( PropTypes.shape({ cmrTitle: PropTypes.string.isRequired, - format: PropTypes.string, + formats: PropTypes.string, doi: PropTypes.string.isRequired, id: PropTypes.string.isRequired, longname: PropTypes.string, diff --git a/src/utils/__tests__/use-platform-list.test.js b/src/utils/__tests__/use-platform-list.test.js index e96db655..a877ec89 100644 --- a/src/utils/__tests__/use-platform-list.test.js +++ b/src/utils/__tests__/use-platform-list.test.js @@ -1,5 +1,5 @@ import { renderHook } from "@testing-library/react-hooks" - +import { getCategoryName } from "../rename-category-test-util" import usePlatformList from "../use-platform-list" import { explorePlatformsQuery } from "../../../test/__fixtures__" @@ -16,7 +16,9 @@ it("the default platform list (without filters)", () => { const firstPlatform = platformList.filtered[0] const lastPlatform = platformList.filtered[platformList.filtered.length - 1] const platformGroups = Object.keys(platformList.grouped) - const firstGroup = platformList.grouped[platformGroups[0]] + const firstGroup = + platformList.grouped[platformGroups[platformGroups.length - 1]] + console.log({ firstGroup }) expect(platformList.filtered.length).toEqual(list.length) expect(platformGroups.length).toBeGreaterThanOrEqual(5) @@ -48,7 +50,8 @@ it("the platform list sorted a > z (without filters)", () => { const firstPlatform = platformList.filtered[0] const lastPlatform = platformList.filtered[platformList.filtered.length - 1] const platformGroups = Object.keys(platformList.grouped) - const firstGroup = platformList.grouped[platformGroups[0]] + const firstGroup = + platformList.grouped[platformGroups[platformGroups.length - 1]] expect(platformList.filtered.length).toEqual(list.length) expect(platformGroups.length).toBeGreaterThanOrEqual(5) @@ -80,7 +83,8 @@ it("the platform list sorted z > a (without filters)", () => { const firstPlatform = platformList.filtered[0] const lastPlatform = platformList.filtered[platformList.filtered.length - 1] const platformGroups = Object.keys(platformList.grouped) - const firstGroup = platformList.grouped[platformGroups[0]] + const firstGroup = + platformList.grouped[platformGroups[platformGroups.length - 1]] expect(platformList.filtered.length).toEqual(list.length) expect(platformGroups.length).toBeGreaterThanOrEqual(5) @@ -115,7 +119,8 @@ it("the platform list with a filter selected", () => { const firstPlatform = platformList.filtered[0] const lastPlatform = platformList.filtered[platformList.filtered.length - 1] const platformGroups = Object.keys(platformList.grouped) - const firstGroup = platformList.grouped[platformGroups[0]] + const firstGroup = + platformList.grouped[platformGroups[platformGroups.length - 1]] expect(platformList.filtered.length).toBeLessThan(list.length) expect(platformGroups.length).toBeGreaterThanOrEqual(5) @@ -137,7 +142,10 @@ it("the platform list with a filter selected", () => { expect(platform.instruments.map(x => x.id)).toContain(instrumentId) }) platformGroups.forEach(group => { - platformList.grouped[group].forEach(platform => { + // Adjusting group name for the changed category name + const adjustedGroupName = getCategoryName(group) + + platformList.grouped[adjustedGroupName].forEach(platform => { expect(platform.instruments.map(x => x.id)).toContain(instrumentId) }) }) diff --git a/src/utils/rename-category-test-util.js b/src/utils/rename-category-test-util.js new file mode 100644 index 00000000..e49fbdc7 --- /dev/null +++ b/src/utils/rename-category-test-util.js @@ -0,0 +1,4 @@ +export const getCategoryName = category => { + if (category === "Aircraft") return "Air-based platforms" + return category +} diff --git a/src/utils/replace-category-name.js b/src/utils/replace-category-name.js new file mode 100644 index 00000000..e4eb6418 --- /dev/null +++ b/src/utils/replace-category-name.js @@ -0,0 +1,10 @@ +export const replaceCategoryInGrouped = grouped => { + const updated = { ...grouped } + + if (updated["Aircraft"]) { + updated["Air-based platforms"] = updated["Aircraft"] + delete updated["Aircraft"] + } + + return updated +} diff --git a/src/utils/use-platform-list.js b/src/utils/use-platform-list.js index e4d7089a..ed35ea8e 100644 --- a/src/utils/use-platform-list.js +++ b/src/utils/use-platform-list.js @@ -1,10 +1,9 @@ import { useState, useEffect } from "react" - import { sortFunctions, platformFilter } from "../utils/filter-utils" // Setting these default search categories will ensure their order of appearance. const searchCategories = { - Aircraft: [], + "Air-based platforms": [], "Mobile land-based platforms": [], "Stationary land sites": [], "Water-based platforms": [], diff --git a/test/__fixtures__/home-query.json b/test/__fixtures__/home-query.json index f519d81d..a4251ff8 100644 --- a/test/__fixtures__/home-query.json +++ b/test/__fixtures__/home-query.json @@ -7,35 +7,6 @@ "description": "An inventory of NASA’s airborne and field campaigns for Earth Science" } }, - "heroImage": { - "nasaImgAlt": "NASA's DC-8 flying laboratory passes Antarctica's tallest peak, Mount Vinson, on Oct. 22, 2012, during a flight over the continent to measure changes in the massive ice sheet and sea ice. Credit: NASA/Michael Studinger (Photography courtesy NASA Images)", - "gatsbyImg": { - "childImageSharp": { - "gatsbyImageData": { - "layout": "fullWidth", - "placeholder": { - "fallback": "data:image/jpeg;base64,/9j/2wBDABALDA4MChAODQ4SERATGCgaGBYWGDEjJR0oOjM9PDkzODdASFxOQERXRTc4UG1RV19iZ2hnPk1xeXBkeFxlZ2P/2wBDARESEhgVGC8aGi9jQjhCY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2P/wgARCAANABQDASIAAhEBAxEB/8QAGQAAAgMBAAAAAAAAAAAAAAAAAAQBAgMF/8QAFQEBAQAAAAAAAAAAAAAAAAAAAQL/2gAMAwEAAhADEAAAAXMGqVMHME//xAAaEAEAAgMBAAAAAAAAAAAAAAACAAEDEhMR/9oACAEBAAEFAuRi0Mqj4zsOdRq8b//EABcRAQADAAAAAAAAAAAAAAAAAAABEiH/2gAIAQMBAT8BrDH/xAAXEQEAAwAAAAAAAAAAAAAAAAAAARIh/9oACAECAQE/AbS1/8QAGRAAAgMBAAAAAAAAAAAAAAAAAAECITEQ/9oACAEBAAY/AjONF2OKw//EABsQAAMAAgMAAAAAAAAAAAAAAAABESExYZGh/9oACAEBAAE/IXwEdrc0N1fCkuUTHe40rHg//9oADAMBAAIAAwAAABBrz//EABcRAQADAAAAAAAAAAAAAAAAAAABUXH/2gAIAQMBAT8Qohl//8QAFxEBAAMAAAAAAAAAAAAAAAAAABFRYf/aAAgBAgEBPxDRN3//xAAaEAEAAwEBAQAAAAAAAAAAAAABABExIVFx/9oACAEBAAE/EOdQBqkyGbIM1PSFBYYJMBqz7cLd9VQiXrrOD2p//9k=" - }, - "images": { - "fallback": { - "src": "/static/cc615e0141fde7a8fd097548c4c05c6b/45171/699943main_ice_bridge_full_full.jpg", - "srcSet": "/static/cc615e0141fde7a8fd097548c4c05c6b/a1f66/699943main_ice_bridge_full_full.jpg 750w,\n/static/cc615e0141fde7a8fd097548c4c05c6b/df080/699943main_ice_bridge_full_full.jpg 1080w,\n/static/cc615e0141fde7a8fd097548c4c05c6b/73892/699943main_ice_bridge_full_full.jpg 1366w,\n/static/cc615e0141fde7a8fd097548c4c05c6b/45171/699943main_ice_bridge_full_full.jpg 1920w", - "sizes": "100vw" - }, - "sources": [ - { - "srcSet": "/static/cc615e0141fde7a8fd097548c4c05c6b/f80d9/699943main_ice_bridge_full_full.webp 750w,\n/static/cc615e0141fde7a8fd097548c4c05c6b/292a9/699943main_ice_bridge_full_full.webp 1080w,\n/static/cc615e0141fde7a8fd097548c4c05c6b/0dd88/699943main_ice_bridge_full_full.webp 1366w,\n/static/cc615e0141fde7a8fd097548c4c05c6b/ddcb4/699943main_ice_bridge_full_full.webp 1920w", - "type": "image/webp", - "sizes": "100vw" - } - ] - }, - "width": 1, - "height": 0.6625 - } - } - } - }, "allFocusArea": { "nodes": [ {