Skip to content

Commit

Permalink
Merge staging into Production (#563)
Browse files Browse the repository at this point in the history
* Create data products view

* Guard against missing filter options

* Remove instruments limit from table

* Fix products initial sort order

* Add vertical measurement region filter

* Format products table

* Add products internal links

* Add measurement style filter

* Decouple text input field

* Update glossary.json

Term definitions have been edited to match definitions approved in the ESCO report.

* Update glossary.js

Added sentence including URL for ADMG CASEI Inventory Terms Definitions

* Add dropdown by text input

* Use combobox for filter

* Add product map

* Update gcmd keywords filter

* Fix linting issues

* Update gcmd keyword source

* Cleanup extra comments

* Fix measurment type filter

* Add related parents filter

* Fix missing props validation

* Add missing location prop

* Fix conditional filter

* Fix missing props validation

* Removed header text check on after explore page navigation. We already check that the URL is correct and don't also need to validate the content of the page.

* Update tests for tabs number

* apply linting and fix up test results

* update feedback form with correct link

* remove kruft of old feedback form, add API docs and FEEDBACK form to constants util

* respond to and apply linting

* remove linting callout

* update snapshots

* resolving a build error

* test resolution of issue 505, check description for details

* remove fluff, guard for no bounds in spatial deployment

* update tests, apply linting

* remove onload handler

* Add video retaining config

* Replace ssr location with prop

* Remove commented out lines

* Add testing instruction in README

* apply linting, respond to comment

* apply linting, fix prop validation

* Enhancement/data products (#532)

* Remove queries for campaign bounds

* Update to Link component

* Update variables dropdown logic

* Fix layoutwidth prop type

* Add lower casing to gcmd options

* Add json doi parsing comment

* Replace campaign bounds

* Replace products table link

* Fix broken explore map inputs

* Update/data products view (#551)

* Guard against failing keyword parse

* Add product table tooltip

* Add link out to gcmd

* Feature/in review page closes #507 (#547)

* Create initial upcoming page

* map upcoming sections

* Add link to coming soon

* Update unpublished drafts fetching

* Include new env var in workflows

* Update csp plugin

* Adjust filters and layout closes #548 (#552)

* Adjust filters and layout

* Add campaing aliases

* Add aliases props

* Replace collection periods with platforms closes #546 (#550)

* Replace collection periods with platforms

* Update test to reflect new campaign page

* Undelete websites props

* Update platforms expectation

* Update contact page content closes #545 (#554)

* Update contact page content

* Update contact page test

* Update footer content closes #541 (#555)

* Update footer content

* Update footer snapshot

* Update site definition

* Add filters to instruments page (#556)

* Reduce glossary page padding closes #543 (#557)

* Reduce gloassary page padding

* Update top margins for section headers

* Add glossary data-cy prop

* Feature/data formats closes #410 (#558)

* Reduce gloassary page padding

* Update top margins for section headers

* Add glossary data-cy prop

* Add initial formats query

* Add data format filter

* Add data formats to instruments and platforms

* Update test and snapshot

* Guards against missing doi formats

* Update glossary map image (#559)

* Replace collection periods (#564)

* Replace collection periods

* Update platform tests

---------

Co-authored-by: Rachel Wyatt <114182970+rwyatt19@users.noreply.github.com>
Co-authored-by: Edward Keeble <edward@developmentseed.org>
Co-authored-by: Edward Keeble <edkeeble@users.noreply.github.com>
Co-authored-by: Matt Robinson <pacificrobinson@gmail.com>
  • Loading branch information
5 people authored Jul 10, 2023
1 parent 049b201 commit e1f7181
Show file tree
Hide file tree
Showing 44 changed files with 13,048 additions and 12,918 deletions.
1 change: 1 addition & 0 deletions .github/workflows/deploy-to-production.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,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 }}

steps:
- name: Cancel Previous Runs
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/deploy-to-staging.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,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 }}

steps:
- name: Cancel Previous Runs
Expand Down
4 changes: 2 additions & 2 deletions gatsby-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,8 @@ module.exports = {
"child-src": "'self' blob:",
"connect-src":
process.env.NODE_ENV === "development"
? "'self' https://www.google-analytics.com https://*.tiles.mapbox.com https://api.mapbox.com https://events.mapbox.com http://localhost:* ws://localhost:*"
: "'self' https://www.google-analytics.com https://*.tiles.mapbox.com https://api.mapbox.com https://events.mapbox.com",
? "'self' https://admg.nasa-impact.net https://www.google-analytics.com https://*.tiles.mapbox.com https://api.mapbox.com https://events.mapbox.com http://localhost:* ws://localhost:*"
: "'self' https://admg.nasa-impact.net https://www.google-analytics.com https://*.tiles.mapbox.com https://api.mapbox.com https://events.mapbox.com https://admgstaging.nasa-impact.net/api/unpublished_drafts",
},
},
},
Expand Down
11 changes: 6 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
"@reach/combobox": "^0.18.0",
"@reach/disclosure": "^0.17.0",
"@reach/listbox": "^0.17.0",
"@reach/tooltip": "^0.18.0",
"@reach/visually-hidden": "^0.17.0",
"@turf/area": "^6.5.0",
"@turf/bbox": "^6.5.0",
Expand All @@ -35,11 +36,11 @@
"gatsby-plugin-image": "^2.8.1",
"gatsby-plugin-manifest": "^4.8.1",
"gatsby-plugin-offline": "^5.8.1",
"gatsby-plugin-postcss": "5.10.0",
"gatsby-plugin-react-helmet": "^5.8.0",
"gatsby-plugin-sharp": "^4.8.1",
"gatsby-plugin-styled-components": "^5.8.0",
"gatsby-plugin-typography": "^4.8.0",
"gatsby-plugin-postcss": "5.10.0",
"gatsby-source-filesystem": "^4.8.1",
"gatsby-transformer-json": "^4.8.0",
"gatsby-transformer-sharp": "^4.8.0",
Expand Down Expand Up @@ -78,9 +79,9 @@
"eslint": "^8.10.0",
"eslint-config-prettier": "^8.4.0",
"eslint-config-react-app": "^7.0.0",
"eslint-plugin-playwright": "0.12.0",
"eslint-plugin-inclusive-language": "^2.2.0",
"eslint-plugin-jest": "^26.1.1",
"eslint-plugin-playwright": "0.12.0",
"eslint-plugin-prettier": "^4.0.0",
"eslint-plugin-react": "^7.29.2",
"eslint-plugin-react-hooks": "^4.3.0",
Expand All @@ -89,10 +90,10 @@
"identity-obj-proxy": "^3.0.0",
"jest": "^27.5.1",
"jest-styled-components": "^7.0.8",
"postcss": "8.4.23",
"prettier": "^2.5.1",
"react-test-renderer": "^17.0.1",
"start-server-and-test": "^1.14.0",
"postcss": "8.4.23"
"start-server-and-test": "^1.14.0"
},
"license": "MIT",
"scripts": {
Expand Down Expand Up @@ -127,4 +128,4 @@
"overrides": {
"playwright": "1.31.2"
}
}
}
115 changes: 60 additions & 55 deletions playwright/e2e/campaign.spec.ts
Original file line number Diff line number Diff line change
@@ -1,58 +1,63 @@
const { test, expect } = require('@playwright/test');
const { test, expect } = require("@playwright/test")
import config from "../playwright.config"
const baseUrl = config.use?.baseURL

test.describe('Campaign', () => {
let page;

test.beforeAll(async ({ browser }) => {
page = await browser.newPage();
await page.goto(baseUrl + '/campaign/OLYMPEX');
});

test('provides information on the campaign', async () => {

await expect(page.locator('[data-cy=campaign-hero] h1')).toBeVisible();
await expect(page.locator('[data-cy=campaign-hero-header]')).toHaveCount(1);

const statsItems = await page.locator('[data-cy=campaign-hero] [data-cy=stats] dd');
await expect(statsItems).toHaveCount(3);
await expect(statsItems.nth(0)).toContainText('Deployment');
await expect(statsItems.nth(1)).toContainText('Collection Periods');
await expect(statsItems.nth(2)).toContainText('Data Products');

const statsValues = await page.locator('[data-cy=campaign-hero] [data-cy=stats] dt');
await expect(statsValues).toHaveCount(3);
await expect(statsValues.nth(0)).toContainText('1');
await expect(statsValues.nth(1)).toContainText('713');
await expect(statsValues.nth(2)).toBeVisible();

await expect(page.locator('[data-cy=mapboxgl-map]')).toBeVisible();

const inpageNavItems = await page.locator('[data-cy=inpage-nav] a');
await expect(inpageNavItems).toHaveCount(7);
await expect(inpageNavItems.nth(0)).toBeVisible();
await expect(inpageNavItems.nth(1)).toContainText('Overview');
await expect(inpageNavItems.nth(2)).toContainText('Focus');
await expect(inpageNavItems.nth(3)).toContainText('Platforms & Instruments');
await expect(inpageNavItems.nth(4)).toContainText('Timeline');
await expect(inpageNavItems.nth(5)).toContainText('Data');
await expect(inpageNavItems.nth(6)).toContainText('Program Info');

const sectionIds = ['program-info', 'platform', 'overview', 'timeline', 'focus'];

for (const id of sectionIds) {
await page.locator(`[data-cy=${id}-inpage-link]`).click();
await expect(page.url()).toContain(id);

// TODO: figure out how to properly test the inpage scroll
await expect(page.locator(`[data-cy=${id}-section] h2`)).toBeVisible();
}



});

// ... additional test may need to be added to cover any changes made to this format page, such as search capability

});
test.describe("Campaign", () => {
let page

test.beforeAll(async ({ browser }) => {
page = await browser.newPage()
await page.goto(baseUrl + "/campaign/OLYMPEX")
})

test("provides information on the campaign", async () => {
await expect(page.locator("[data-cy=campaign-hero] h1")).toBeVisible()
await expect(page.locator("[data-cy=campaign-hero-header]")).toHaveCount(1)

const statsItems = await page.locator(
"[data-cy=campaign-hero] [data-cy=stats] dd"
)
await expect(statsItems).toHaveCount(3)
await expect(statsItems.nth(0)).toContainText("Deployment")
await expect(statsItems.nth(1)).toContainText("Platforms")
await expect(statsItems.nth(2)).toContainText("Data Products")

const statsValues = await page.locator(
"[data-cy=campaign-hero] [data-cy=stats] dt"
)
await expect(statsValues).toHaveCount(3)
await expect(statsValues.nth(0)).toContainText("1")
await expect(statsValues.nth(1)).toContainText("8")
await expect(statsValues.nth(2)).toBeVisible()

await expect(page.locator("[data-cy=mapboxgl-map]")).toBeVisible()

const inpageNavItems = await page.locator("[data-cy=inpage-nav] a")
await expect(inpageNavItems).toHaveCount(7)
await expect(inpageNavItems.nth(0)).toBeVisible()
await expect(inpageNavItems.nth(1)).toContainText("Overview")
await expect(inpageNavItems.nth(2)).toContainText("Focus")
await expect(inpageNavItems.nth(3)).toContainText("Platforms & Instruments")
await expect(inpageNavItems.nth(4)).toContainText("Timeline")
await expect(inpageNavItems.nth(5)).toContainText("Data")
await expect(inpageNavItems.nth(6)).toContainText("Program Info")

const sectionIds = [
"program-info",
"platform",
"overview",
"timeline",
"focus",
]

for (const id of sectionIds) {
await page.locator(`[data-cy=${id}-inpage-link]`).click()
await expect(page.url()).toContain(id)

// TODO: figure out how to properly test the inpage scroll
await expect(page.locator(`[data-cy=${id}-section] h2`)).toBeVisible()
}
})

// ... additional test may need to be added to cover any changes made to this format page, such as search capability
})
60 changes: 29 additions & 31 deletions playwright/e2e/contact.spec.ts
Original file line number Diff line number Diff line change
@@ -1,35 +1,33 @@
const { chromium } = require("@playwright/test");
const { test, expect } = require('@playwright/test');
const { chromium } = require("@playwright/test")
const { test, expect } = require("@playwright/test")
import config from "../playwright.config"
const baseUrl = config.use?.baseURL

test.describe("Contact", () => {

let browser, page;

test.beforeAll(async ({ browser }) => {

page = await browser.newPage();
await page.goto(baseUrl);
});

test.afterAll(async (browser) => {
browser = await chromium.launch();
await browser.close();
});

test.beforeEach(async (browser) => {
browser = await chromium.launch();
page = await browser.newPage();
await page.goto(baseUrl + "/contact");
});

test.afterEach(async () => {
await page.close();
});

test("renders correctly", async () => {
await page.waitForSelector("main h1:text('feedback')");
await page.waitForSelector("main p:text('NASA inventory')");
});
});
let browser, page

test.beforeAll(async ({ browser }) => {
page = await browser.newPage()
await page.goto(baseUrl)
})

test.afterAll(async browser => {
browser = await chromium.launch()
await browser.close()
})

test.beforeEach(async browser => {
browser = await chromium.launch()
page = await browser.newPage()
await page.goto(baseUrl + "/contact")
})

test.afterEach(async () => {
await page.close()
})

test("renders correctly", async () => {
await page.waitForSelector("main h1:text('feedback')")
await page.waitForSelector("main p:text('NASA CASEI inventory')")
})
})
Loading

0 comments on commit e1f7181

Please sign in to comment.