From 4dce3c207a064d0f280ab0b4fd2c3682b5a7ed82 Mon Sep 17 00:00:00 2001 From: Christopher Clark Date: Wed, 31 Mar 2021 18:29:44 -0600 Subject: [PATCH] v1.6.5 (#36) * TimeSeriesViewer handle flat 0 axis datarange * initial NeonPage snapshots tests * NeonPage snapshot tests * SiteMap table export CSV * iterate on TimeSeriesViewer series bug * fix TimeSeriesV graph generation when seconds are not in t * iTimeSeriesViewerSummary snapshot tests * attempt to fix SiteMap safari marker click bug * ibump version to v1.6.5 * TimeSeriesViewerSites snapshot tests * lib export * fix lint * document FOREIGN_LOCATION env var in .env.develpoment * SiteMap marker type safety / table layout tweak * Update for DownloadDataButton Icon. * mockReactComponent safer rendering of functions and nodes * add prototype dataset JSON-LD injection * README updates * jettison legacy components; final lint/lib export * fix dialog paper z-index issue Co-authored-by: Robert Markel Co-authored-by: jsampson --- .env.development | 17 +- .eslintignore | 2 - README.md | 5 +- .../DownloadDataButton/DownloadDataButton.js | 9 +- .../NeonEnvironment/NeonEnvironment.js | 2 +- lib/components/NeonFooter/NeonFooter.css | 170 -- lib/components/NeonFooter/NeonFooter.d.ts | 3 - lib/components/NeonFooter/NeonFooter.js | 17 +- .../NeonFooter/NeonLegacyFooter.d.ts | 1 - lib/components/NeonFooter/NeonLegacyFooter.js | 254 -- .../NeonFooter/images/logo--footer.png | Bin 13904 -> 0 bytes .../images/social--facebook--hover.png | Bin 868 -> 0 bytes .../NeonFooter/images/social--facebook.png | Bin 867 -> 0 bytes .../images/social--flickr--hover.png | Bin 987 -> 0 bytes .../NeonFooter/images/social--flickr.png | Bin 967 -> 0 bytes .../images/social--linkedin--hover.png | Bin 931 -> 0 bytes .../NeonFooter/images/social--linkedin.png | Bin 918 -> 0 bytes .../images/social--newsletter--hover.png | Bin 1157 -> 0 bytes .../NeonFooter/images/social--newsletter.png | Bin 1164 -> 0 bytes .../images/social--twitter--hover.png | Bin 1003 -> 0 bytes .../NeonFooter/images/social--twitter.png | Bin 992 -> 0 bytes .../images/social--youtube--hover.png | Bin 903 -> 0 bytes .../NeonFooter/images/social--youtube.png | Bin 880 -> 0 bytes lib/components/NeonFooter/images/tower.png | Bin 1956 -> 0 bytes lib/components/NeonHeader/NeonHeader.js | 81 +- .../NeonHeader/NeonLegacyHeader.d.ts | 3 - lib/components/NeonHeader/NeonLegacyHeader.js | 72 - lib/components/NeonJsonLd/NeonJsonLd.d.ts | 3 + lib/components/NeonJsonLd/NeonJsonLd.js | 62 +- lib/components/NeonMenu/NeonDrawerMenu.d.ts | 12 - lib/components/NeonMenu/NeonDrawerMenu.js | 219 -- lib/components/NeonMenu/NeonMenu.css | 472 ---- lib/components/NeonMenu/NeonMenu.d.ts | 28 - lib/components/NeonMenu/NeonMenu.js | 330 --- lib/components/NeonMenu/index.d.ts | 1 - lib/components/NeonMenu/index.js | 15 - .../NeonMenu/menuDefaultFallback.json | 164 -- lib/components/NeonMenu/package.json | 7 - lib/components/NeonPage/BrowserWarning.js | 8 +- lib/components/NeonPage/NeonPage.d.ts | 25 +- lib/components/NeonPage/NeonPage.js | 26 +- .../NeonUtilityBar/NeonUtilityBar.d.ts | 12 - .../NeonUtilityBar/NeonUtilityBar.js | 131 - lib/components/NeonUtilityBar/index.d.ts | 1 - lib/components/NeonUtilityBar/index.js | 15 - lib/components/NeonUtilityBar/package.json | 6 - lib/components/PopupBase/PopupBase.css | 9 - lib/components/PopupBase/PopupBase.d.ts | 9 - lib/components/PopupBase/PopupBase.js | 90 - lib/components/PopupBase/index.d.ts | 1 - lib/components/PopupBase/index.js | 15 - lib/components/PopupBase/package.json | 6 - lib/components/PopupLoading/PopupLoading.css | 74 - lib/components/PopupLoading/PopupLoading.d.ts | 6 - lib/components/PopupLoading/PopupLoading.js | 97 - lib/components/PopupLoading/index.d.ts | 1 - lib/components/PopupLoading/index.js | 15 - lib/components/PopupLoading/package.json | 6 - .../SiteMap/FetchLocations.worker.d.ts | 1 - .../SiteMap/FetchLocations.worker.js | 67 - lib/components/SiteMap/SiteMapFeature.js | 101 +- lib/components/SiteMap/SiteMapLeaflet.js | 3 +- lib/components/SiteMap/SiteMapTable.d.ts | 2 + lib/components/SiteMap/SiteMapTable.js | 277 +- lib/components/Theme/Theme.js | 2 +- .../TimeSeriesViewerContainer.d.ts | 4 + .../TimeSeriesViewerContainer.js | 1 + .../TimeSeriesViewerContext.d.ts | 75 +- .../TimeSeriesViewerContext.js | 16 +- .../TimeSeriesViewerSites.d.ts | 175 ++ .../TimeSeriesViewer/TimeSeriesViewerSites.js | 23 +- lib/index.d.ts | 4 - lib/index.js | 32 - lib/remoteAssets/drupal-footer.html.d.ts | 2 +- lib/remoteAssets/drupal-footer.html.js | 2 +- lib/remoteAssets/drupal-header.js | 54 +- lib/remoteAssets/drupal-theme.css | 8 +- lib/workers/generateTimeSeriesGraphData.d.ts | 2 +- lib/workers/generateTimeSeriesGraphData.js | 11 +- package-lock.json | 659 +++-- package.json | 6 +- src/__mocks__/README.md | 72 + src/__mocks__/ajax.js | 2 +- src/__mocks__/mockReactComponent.jsx | 4 +- .../__snapshots__/AopDataViewer.jsx.snap | 320 +-- .../BasicAvailabilityInterface.jsx.snap | 49 +- .../EnhancedAvailabilityInterface.jsx.snap | 60 +- .../DownloadDataButton/DownloadDataButton.jsx | 2 +- .../__snapshots__/DownloadDataButton.jsx.snap | 108 +- .../__snapshots__/DownloadStepForm.jsx.snap | 13 +- .../NeonEnvironment/NeonEnvironment.js | 2 +- .../components/NeonFooter/NeonFooter.css | 170 -- .../components/NeonFooter/NeonFooter.jsx | 12 +- .../NeonFooter/NeonLegacyFooter.jsx | 273 -- .../__snapshots__/NeonFooter.jsx.snap | 16 +- .../NeonFooter/images/logo--footer.png | Bin 13904 -> 0 bytes .../images/social--facebook--hover.png | Bin 868 -> 0 bytes .../NeonFooter/images/social--facebook.png | Bin 867 -> 0 bytes .../images/social--flickr--hover.png | Bin 987 -> 0 bytes .../NeonFooter/images/social--flickr.png | Bin 967 -> 0 bytes .../images/social--linkedin--hover.png | Bin 931 -> 0 bytes .../NeonFooter/images/social--linkedin.png | Bin 918 -> 0 bytes .../images/social--newsletter--hover.png | Bin 1157 -> 0 bytes .../NeonFooter/images/social--newsletter.png | Bin 1164 -> 0 bytes .../images/social--twitter--hover.png | Bin 1003 -> 0 bytes .../NeonFooter/images/social--twitter.png | Bin 992 -> 0 bytes .../images/social--youtube--hover.png | Bin 903 -> 0 bytes .../NeonFooter/images/social--youtube.png | Bin 880 -> 0 bytes .../components/NeonFooter/images/tower.png | Bin 1956 -> 0 bytes .../components/NeonHeader/NeonHeader.jsx | 56 +- .../NeonHeader/NeonLegacyHeader.jsx | 57 - .../__snapshots__/NeonHeader.jsx.snap | 148 +- .../components/NeonJsonLd/NeonJsonLd.js | 57 +- .../components/NeonMenu/NeonDrawerMenu.jsx | 166 -- .../components/NeonMenu/NeonMenu.css | 472 ---- .../components/NeonMenu/NeonMenu.jsx | 289 --- .../components/NeonMenu/index.d.ts | 1 - .../components/NeonMenu/index.js | 1 - .../NeonMenu/menuDefaultFallback.json | 164 -- .../components/NeonMenu/package.json | 7 - .../components/NeonPage/BrowserWarning.jsx | 9 +- .../components/NeonPage/NeonPage.jsx | 23 +- .../components/NeonPage/StyleGuide.jsx | 26 +- .../NeonPage/__tests__/BrowserWarning.jsx | 58 + .../__tests__/LiferayNotifications.jsx | 38 + .../NeonPage/__tests__/NeonPage.jsx | 146 ++ .../__snapshots__/BrowserWarning.jsx.snap | 178 ++ .../LiferayNotifications.jsx.snap | 115 + .../__tests__/__snapshots__/NeonPage.jsx.snap | 1354 ++++++++++ .../NeonUtilityBar/NeonUtilityBar.jsx | 103 - .../components/NeonUtilityBar/index.d.ts | 1 - .../components/NeonUtilityBar/index.js | 1 - .../components/NeonUtilityBar/package.json | 6 - .../components/PopupBase/PopupBase.css | 9 - .../components/PopupBase/PopupBase.js | 41 - .../components/PopupBase/index.d.ts | 1 - .../components/PopupBase/index.js | 1 - .../components/PopupBase/package.json | 6 - .../components/PopupLoading/PopupLoading.css | 74 - .../components/PopupLoading/PopupLoading.js | 55 - .../components/PopupLoading/index.d.ts | 1 - .../components/PopupLoading/index.js | 1 - .../components/PopupLoading/package.json | 6 - .../components/SiteMap/SiteMapFeature.jsx | 80 +- .../components/SiteMap/SiteMapLeaflet.jsx | 1 + .../components/SiteMap/SiteMapTable.jsx | 275 +- .../components/SiteMap/StyleGuide.jsx | 2 +- .../SiteMap/__tests__/SiteMapTable.jsx | 61 + src/lib_components/components/Theme/Theme.jsx | 2 +- .../TimeSeriesViewerContainer.jsx | 2 +- .../TimeSeriesViewerContext.jsx | 13 +- .../TimeSeriesViewerSites.jsx | 19 +- .../__tests__/TimeSeriesViewerContainer.jsx | 160 ++ .../__tests__/TimeSeriesViewerContext.jsx | 16 + .../__tests__/TimeSeriesViewerSites.jsx | 266 ++ .../TimeSeriesViewerContainer.jsx.snap | 1414 ++++++++++ .../TimeSeriesViewerSites.jsx.snap | 2286 +++++++++++++++++ src/lib_components/index.ts | 6 - .../remoteAssets/drupal-footer.html.js | 3 + .../remoteAssets/drupal-header.js | 44 +- .../remoteAssets/drupal-theme.css | 8 +- .../__tests__/generateTimeSeriesGraphData.js | 4 +- .../workers/generateTimeSeriesGraphData.js | 13 +- tsconfig.json | 3 +- 164 files changed, 7756 insertions(+), 5725 deletions(-) delete mode 100644 lib/components/NeonFooter/NeonFooter.css delete mode 100644 lib/components/NeonFooter/NeonLegacyFooter.d.ts delete mode 100644 lib/components/NeonFooter/NeonLegacyFooter.js delete mode 100644 lib/components/NeonFooter/images/logo--footer.png delete mode 100644 lib/components/NeonFooter/images/social--facebook--hover.png delete mode 100644 lib/components/NeonFooter/images/social--facebook.png delete mode 100644 lib/components/NeonFooter/images/social--flickr--hover.png delete mode 100644 lib/components/NeonFooter/images/social--flickr.png delete mode 100644 lib/components/NeonFooter/images/social--linkedin--hover.png delete mode 100644 lib/components/NeonFooter/images/social--linkedin.png delete mode 100644 lib/components/NeonFooter/images/social--newsletter--hover.png delete mode 100644 lib/components/NeonFooter/images/social--newsletter.png delete mode 100644 lib/components/NeonFooter/images/social--twitter--hover.png delete mode 100644 lib/components/NeonFooter/images/social--twitter.png delete mode 100644 lib/components/NeonFooter/images/social--youtube--hover.png delete mode 100644 lib/components/NeonFooter/images/social--youtube.png delete mode 100644 lib/components/NeonFooter/images/tower.png delete mode 100644 lib/components/NeonHeader/NeonLegacyHeader.d.ts delete mode 100644 lib/components/NeonHeader/NeonLegacyHeader.js delete mode 100644 lib/components/NeonMenu/NeonDrawerMenu.d.ts delete mode 100644 lib/components/NeonMenu/NeonDrawerMenu.js delete mode 100644 lib/components/NeonMenu/NeonMenu.css delete mode 100644 lib/components/NeonMenu/NeonMenu.d.ts delete mode 100644 lib/components/NeonMenu/NeonMenu.js delete mode 100644 lib/components/NeonMenu/index.d.ts delete mode 100644 lib/components/NeonMenu/index.js delete mode 100644 lib/components/NeonMenu/menuDefaultFallback.json delete mode 100644 lib/components/NeonMenu/package.json delete mode 100644 lib/components/NeonUtilityBar/NeonUtilityBar.d.ts delete mode 100644 lib/components/NeonUtilityBar/NeonUtilityBar.js delete mode 100644 lib/components/NeonUtilityBar/index.d.ts delete mode 100644 lib/components/NeonUtilityBar/index.js delete mode 100644 lib/components/NeonUtilityBar/package.json delete mode 100644 lib/components/PopupBase/PopupBase.css delete mode 100644 lib/components/PopupBase/PopupBase.d.ts delete mode 100644 lib/components/PopupBase/PopupBase.js delete mode 100644 lib/components/PopupBase/index.d.ts delete mode 100644 lib/components/PopupBase/index.js delete mode 100644 lib/components/PopupBase/package.json delete mode 100644 lib/components/PopupLoading/PopupLoading.css delete mode 100644 lib/components/PopupLoading/PopupLoading.d.ts delete mode 100644 lib/components/PopupLoading/PopupLoading.js delete mode 100644 lib/components/PopupLoading/index.d.ts delete mode 100644 lib/components/PopupLoading/index.js delete mode 100644 lib/components/PopupLoading/package.json delete mode 100644 lib/components/SiteMap/FetchLocations.worker.d.ts delete mode 100644 lib/components/SiteMap/FetchLocations.worker.js create mode 100644 src/__mocks__/README.md delete mode 100644 src/lib_components/components/NeonFooter/NeonFooter.css delete mode 100644 src/lib_components/components/NeonFooter/NeonLegacyFooter.jsx delete mode 100644 src/lib_components/components/NeonFooter/images/logo--footer.png delete mode 100644 src/lib_components/components/NeonFooter/images/social--facebook--hover.png delete mode 100644 src/lib_components/components/NeonFooter/images/social--facebook.png delete mode 100644 src/lib_components/components/NeonFooter/images/social--flickr--hover.png delete mode 100644 src/lib_components/components/NeonFooter/images/social--flickr.png delete mode 100644 src/lib_components/components/NeonFooter/images/social--linkedin--hover.png delete mode 100644 src/lib_components/components/NeonFooter/images/social--linkedin.png delete mode 100644 src/lib_components/components/NeonFooter/images/social--newsletter--hover.png delete mode 100644 src/lib_components/components/NeonFooter/images/social--newsletter.png delete mode 100644 src/lib_components/components/NeonFooter/images/social--twitter--hover.png delete mode 100644 src/lib_components/components/NeonFooter/images/social--twitter.png delete mode 100644 src/lib_components/components/NeonFooter/images/social--youtube--hover.png delete mode 100644 src/lib_components/components/NeonFooter/images/social--youtube.png delete mode 100644 src/lib_components/components/NeonFooter/images/tower.png delete mode 100644 src/lib_components/components/NeonHeader/NeonLegacyHeader.jsx delete mode 100644 src/lib_components/components/NeonMenu/NeonDrawerMenu.jsx delete mode 100644 src/lib_components/components/NeonMenu/NeonMenu.css delete mode 100644 src/lib_components/components/NeonMenu/NeonMenu.jsx delete mode 100644 src/lib_components/components/NeonMenu/index.d.ts delete mode 100644 src/lib_components/components/NeonMenu/index.js delete mode 100644 src/lib_components/components/NeonMenu/menuDefaultFallback.json delete mode 100644 src/lib_components/components/NeonMenu/package.json create mode 100644 src/lib_components/components/NeonPage/__tests__/BrowserWarning.jsx create mode 100644 src/lib_components/components/NeonPage/__tests__/LiferayNotifications.jsx create mode 100644 src/lib_components/components/NeonPage/__tests__/NeonPage.jsx create mode 100644 src/lib_components/components/NeonPage/__tests__/__snapshots__/BrowserWarning.jsx.snap create mode 100644 src/lib_components/components/NeonPage/__tests__/__snapshots__/LiferayNotifications.jsx.snap create mode 100644 src/lib_components/components/NeonPage/__tests__/__snapshots__/NeonPage.jsx.snap delete mode 100644 src/lib_components/components/NeonUtilityBar/NeonUtilityBar.jsx delete mode 100644 src/lib_components/components/NeonUtilityBar/index.d.ts delete mode 100644 src/lib_components/components/NeonUtilityBar/index.js delete mode 100644 src/lib_components/components/NeonUtilityBar/package.json delete mode 100644 src/lib_components/components/PopupBase/PopupBase.css delete mode 100644 src/lib_components/components/PopupBase/PopupBase.js delete mode 100644 src/lib_components/components/PopupBase/index.d.ts delete mode 100644 src/lib_components/components/PopupBase/index.js delete mode 100644 src/lib_components/components/PopupBase/package.json delete mode 100644 src/lib_components/components/PopupLoading/PopupLoading.css delete mode 100644 src/lib_components/components/PopupLoading/PopupLoading.js delete mode 100644 src/lib_components/components/PopupLoading/index.d.ts delete mode 100644 src/lib_components/components/PopupLoading/index.js delete mode 100644 src/lib_components/components/PopupLoading/package.json create mode 100644 src/lib_components/components/TimeSeriesViewer/__tests__/TimeSeriesViewerContainer.jsx create mode 100644 src/lib_components/components/TimeSeriesViewer/__tests__/TimeSeriesViewerSites.jsx create mode 100644 src/lib_components/components/TimeSeriesViewer/__tests__/__snapshots__/TimeSeriesViewerContainer.jsx.snap create mode 100644 src/lib_components/components/TimeSeriesViewer/__tests__/__snapshots__/TimeSeriesViewerSites.jsx.snap diff --git a/.env.development b/.env.development index 356f1d47..936aedaa 100644 --- a/.env.development +++ b/.env.development @@ -41,7 +41,18 @@ REACT_APP_NEON_SHOW_AOP_VIEWER="true" REACT_APP_NEON_VISUS_PRODUCTS_BASE_URL="https://neon.visus.org/neonapi/products/" REACT_APP_NEON_VISUS_IFRAME_BASE_URL="https://neon.visus.org/visus-frame.html" -# Override for development purposes to point at various environments -# Otherwise will derive from where the app is running (window.location.host) +# API ROOT +# +# By default API calls made by core components use window.location.host for the root. +# +# This can be overridden using REACT_APP_NEON_HOST_OVERRIDE. Note that the override will +# only be applied in a dev environment. To also apply override in production environments +# set REACT_APP_FOREIGN_LOCATION to "true". +# +# Using portal-core-components as a dependency hosted outside of data.neonscience.org: +# * Set REACT_APP_NEON_HOST_OVERRIDE to "https://data.neonscience.org" +# * Set REACT_APP_FOREIGN_LOCATION to "true" +# Rate limiting may apply. See https://data.neonscience.org/data-api/rate-limiting/ for details. + REACT_APP_NEON_HOST_OVERRIDE="https://int-data.neonscience.org" -#REACT_APP_NEON_WS_HOST_OVERRIDE="" +# REACT_APP_FOREIGN_LOCATION="true" diff --git a/.eslintignore b/.eslintignore index ab6891c1..57865887 100644 --- a/.eslintignore +++ b/.eslintignore @@ -1,5 +1,3 @@ src/registerServiceWorker.js -src/lib_components/components/PopupBase -src/lib_components/components/PopupLoading src/lib_components/components/**/*.d.ts src/lib_components/remoteAssets diff --git a/README.md b/README.md index b7c385ed..bfb0da91 100644 --- a/README.md +++ b/README.md @@ -187,6 +187,8 @@ To update **all** snapshots (after confirming all failures are expected from rec npm run test:updateSnapshots +When tests are run test coverage information is generated. This appears in the shell and can also be found formatted as HTML pages in the `test_coverage` directory. + ### Writing Tests The Jest configuration will pick up all javascript files in a `__tests__` directory. By convention, for portal-core-components, every file that has accompanying unit tests should have an adjacent `__tests__` folder containing any/all test files, and each test file should bear the same name as the source file it is testing. @@ -208,6 +210,7 @@ Example: | | | | __tests__/ | | | | | OtherComponent.jsx +Several mocks exist for testing any part of the core components library that may need them. These can be found in `~/src/__mocks__`. See README.md in that directory for details. ## Building the Library @@ -226,7 +229,7 @@ For Windows users the `npm run lib` command may fail with complaint about 'NODE_ ## Library Composition -This package was configured with advice from [this article](https://medium.com/@lokhmakov/best-way-to-create-npm-packages-with-create-react-app-b24dd449c354). +This package was originally onfigured with advice from [this article](https://medium.com/@lokhmakov/best-way-to-create-npm-packages-with-create-react-app-b24dd449c354). In summary, it began as a create-react-app app that was ejected. A `babel.config.json` was added with minor configuration and a script to invoke babel to run a library build was added. diff --git a/lib/components/DownloadDataButton/DownloadDataButton.js b/lib/components/DownloadDataButton/DownloadDataButton.js index d1c4dca1..15cfaa38 100644 --- a/lib/components/DownloadDataButton/DownloadDataButton.js +++ b/lib/components/DownloadDataButton/DownloadDataButton.js @@ -92,12 +92,9 @@ var DownloadDataButton = function DownloadDataButton(props) { color: "primary", variant: "contained", onClick: handleOpenDialog, - "data-selenium": "download-data-button" - }, gtmProps, other), label, /*#__PURE__*/_react.default.createElement(_SaveAlt.default, { - style: { - marginLeft: _Theme.default.spacing(1) - } - })), !dialogOpen ? null : /*#__PURE__*/_react.default.createElement(_react.Suspense, { + "data-selenium": "download-data-button", + endIcon: /*#__PURE__*/_react.default.createElement(_SaveAlt.default, null) + }, gtmProps, other), label), !dialogOpen ? null : /*#__PURE__*/_react.default.createElement(_react.Suspense, { fallback: null }, /*#__PURE__*/_react.default.createElement(DownloadDataDialog, null))); }; diff --git a/lib/components/NeonEnvironment/NeonEnvironment.js b/lib/components/NeonEnvironment/NeonEnvironment.js index 42b720a4..9e5b3684 100644 --- a/lib/components/NeonEnvironment/NeonEnvironment.js +++ b/lib/components/NeonEnvironment/NeonEnvironment.js @@ -270,7 +270,7 @@ var NeonEnvironment = { var root = NeonEnvironment.getRootJsonLdPath(); var appliedPath = ''; - if (['products'].includes(path)) { + if (['products', 'prototype'].includes(path)) { appliedPath = NeonEnvironment.getApiPath[path](); } else if (typeof NeonEnvironment.getApiLdPath[path] === 'function') { appliedPath = NeonEnvironment.getApiLdPath[path](); diff --git a/lib/components/NeonFooter/NeonFooter.css b/lib/components/NeonFooter/NeonFooter.css deleted file mode 100644 index 8bef0949..00000000 --- a/lib/components/NeonFooter/NeonFooter.css +++ /dev/null @@ -1,170 +0,0 @@ -body: { - background-color: #ffff00 !important; -} -.neon-footer { - display: grid; - grid-gap: 2px; - grid-template-columns: minmax(330px, 100%) minmax(325px, 325px) minmax( - 200px, - 200px - ); - grid-template-areas: "social contact neonlogo" "nsftext battelletext neonlogo"; - padding-top: 1em; -} - -.neon-footer__box { - font-size: 100%; -} - -.neon-footer__div--social { - float:left; - grid-area: social; - display: flex; - flex-direction: row; - flex-wrap: nowrap; - height: 50px; - border-bottom: 1px rgba(208,208,208,0.6) solid; - box-sizing: content-box; -} - -.neon-footer__neon-logo { - background-image: url("./images/social--newsletter.png"); - background-repeat: no-repeat; - - text-decoration-line: none; - word-wrap: break-word; - font-size: 12px; - font-weight: 500; - line-height: 14px; - color: #00a1b1; - max-width: 99px; - padding-left: 35px; -} - -.neon-footer__neon-logo:hover { - background-image: url("./images/social--newsletter--hover.png"); - background-repeat: no-repeat; -} - -.neon-footer__facebook { - background-image: url("./images/social--facebook.png"); - background-repeat: no-repeat; - width: 29px; - text-indent: -9999px; -} - -.neon-footer__facebook:hover { - background-image: url("./images/social--facebook--hover.png"); - background-repeat: no-repeat; -} - -.neon-footer__twitter { - background-image: url("./images/social--twitter.png"); - background-repeat: no-repeat; - width: 29px; - text-indent: -9999px; -} - -.neon-footer__twitter:hover { - background-image: url("./images/social--twitter--hover.png"); - background-repeat: no-repeat; -} - -.neon-footer__linkedin { - background-image: url("./images/social--linkedin.png"); - background-repeat: no-repeat; - width: 29px; - text-indent: -9999px; -} -.neon-footer__linkedin:hover { - background-image: url("./images/social--linkedin--hover.png"); - background-repeat: no-repeat; -} - -.neon-footer__youtube { - background-image: url("./images/social--youtube.png"); - background-repeat: no-repeat; - width: 29px; - text-indent: -9999px; -} - -.neon-footer__youtube:hover { - background-image: url("./images/social--youtube--hover.png"); - background-repeat: no-repeat; -} - -.neon-footer__logo--social { - min-height: 29px; - /* padding-top: 5px; */ - padding-right: 6px; -} - -.neon-footer__div--contact { - float: right; - grid-area: contact; - display: flex; - flex-direction: row; - flex-wrap: nowrap; - height: 50px; - border-bottom: 1px rgba(208,208,208,0.6) solid; -} - -.neon-footer__link--contact:hover { - text-decoration: underline; -} - -.neon-footer__link--contact { - min-height: 29px; - padding-right: 6px; - padding-top: 10px; - margin-left: 4px; - margin-right: 4px; - color: #00a1b1; - font-size: 12px; - font-weight: 400; - line-height: 18.36px; - text-decoration-line: none; - white-space: nowrap; -} - -.neon-footer__icon--tower { - width: 40px; - background-image: url("./images/tower.png"); - background-repeat: no-repeat; -} - -.neon-footer__text--nsf { - float: left; - grid-area: nsftext; - color: #999; - font-size: 12px; - font-weight: 500; - line-height: 18px; - padding-top: 6.75px; - padding-bottom: 6.75px; - text-rendering: optimizeLegibility; -} - -.neon-footer__span--nsf-text { - max-width: 395px; -} - -.neon-footer__text--battelle { - float:right; - grid-area: battelletext; - color: #999; - font-size: 12px; - font-weight: 500; - line-height: 18px; - padding-top: 6.75px; - padding-bottom: 6.75px; - padding-right: 10px; - text-rendering: optimizeLegibility; - text-align: right; -} - -.neon-footer__logo--footer{ - float: right; - top: -0.75em; - width: 11.25em; -} diff --git a/lib/components/NeonFooter/NeonFooter.d.ts b/lib/components/NeonFooter/NeonFooter.d.ts index 54e42e36..df27dd18 100644 --- a/lib/components/NeonFooter/NeonFooter.d.ts +++ b/lib/components/NeonFooter/NeonFooter.d.ts @@ -3,13 +3,10 @@ declare function NeonFooter(props: any): JSX.Element; declare namespace NeonFooter { export namespace propTypes { export const drupalCssLoaded: PropTypes.Requireable; - export const useCoreHeader: PropTypes.Requireable; } export namespace defaultProps { const drupalCssLoaded_1: boolean; export { drupalCssLoaded_1 as drupalCssLoaded }; - const useCoreHeader_1: boolean; - export { useCoreHeader_1 as useCoreHeader }; } } import PropTypes from "prop-types"; diff --git a/lib/components/NeonFooter/NeonFooter.js b/lib/components/NeonFooter/NeonFooter.js index 87e69772..23769eb3 100644 --- a/lib/components/NeonFooter/NeonFooter.js +++ b/lib/components/NeonFooter/NeonFooter.js @@ -21,8 +21,6 @@ var _drupalFooter = _interopRequireDefault(require("../../remoteAssets/drupal-fo var _NeonContext = _interopRequireWildcard(require("../NeonContext/NeonContext")); -var _NeonLegacyFooter = _interopRequireDefault(require("./NeonLegacyFooter")); - function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; } function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; } @@ -44,8 +42,7 @@ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } var DRUPAL_FOOTER_HTML = _remoteAssetsMap.default.DRUPAL_FOOTER_HTML.KEY; var NeonFooter = function NeonFooter(props) { - var drupalCssLoaded = props.drupalCssLoaded, - useCoreHeader = props.useCoreHeader; + var drupalCssLoaded = props.drupalCssLoaded; var _NeonContext$useNeonC = _NeonContext.default.useNeonContextState(), _NeonContext$useNeonC2 = _slicedToArray(_NeonContext$useNeonC, 1), @@ -56,7 +53,7 @@ var NeonFooter = function NeonFooter(props) { var renderMode = 'legacy'; - if (!useCoreHeader && neonContextIsActive) { + if (neonContextIsActive) { switch (footerFetch.status) { case _NeonContext.FETCH_STATUS.SUCCESS: renderMode = footerHTML && drupalCssLoaded ? 'drupal' : 'loading'; @@ -88,22 +85,18 @@ var NeonFooter = function NeonFooter(props) { }, (0, _htmlReactParser.default)(footerHTML)); case 'drupal-fallback': + default: return /*#__PURE__*/_react.default.createElement("footer", { id: "footer" }, (0, _htmlReactParser.default)(_drupalFooter.default)); - - default: - return /*#__PURE__*/_react.default.createElement(_NeonLegacyFooter.default, null); } }; NeonFooter.propTypes = { - drupalCssLoaded: _propTypes.default.bool, - useCoreHeader: _propTypes.default.bool + drupalCssLoaded: _propTypes.default.bool }; NeonFooter.defaultProps = { - drupalCssLoaded: false, - useCoreHeader: false + drupalCssLoaded: false }; var _default = NeonFooter; exports.default = _default; \ No newline at end of file diff --git a/lib/components/NeonFooter/NeonLegacyFooter.d.ts b/lib/components/NeonFooter/NeonLegacyFooter.d.ts deleted file mode 100644 index 870d6dbd..00000000 --- a/lib/components/NeonFooter/NeonLegacyFooter.d.ts +++ /dev/null @@ -1 +0,0 @@ -export default function NeonFooter(): JSX.Element; diff --git a/lib/components/NeonFooter/NeonLegacyFooter.js b/lib/components/NeonFooter/NeonLegacyFooter.js deleted file mode 100644 index fd9ecee7..00000000 --- a/lib/components/NeonFooter/NeonLegacyFooter.js +++ /dev/null @@ -1,254 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = NeonFooter; - -var _react = _interopRequireDefault(require("react")); - -require("./NeonFooter.css"); - -var _styles = require("@material-ui/core/styles"); - -var _Divider = _interopRequireDefault(require("@material-ui/core/Divider")); - -var _Hidden = _interopRequireDefault(require("@material-ui/core/Hidden")); - -var _Link = _interopRequireDefault(require("@material-ui/core/Link")); - -var _Grid = _interopRequireDefault(require("@material-ui/core/Grid")); - -var _Container = _interopRequireDefault(require("@material-ui/core/Container")); - -var _Typography = _interopRequireDefault(require("@material-ui/core/Typography")); - -var _Theme = _interopRequireDefault(require("../Theme/Theme")); - -var _logoFooter = _interopRequireDefault(require("./images/logo--footer.png")); - -var _socialNewsletter = _interopRequireDefault(require("./images/social--newsletter.png")); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -require('font-awesome/css/font-awesome.min.css'); - -var useStyles = (0, _styles.makeStyles)(function (theme) { - return { - box: { - padding: theme.spacing(0), - margin: theme.spacing(0) - }, - container: { - padding: theme.spacing(1, 4), - backgroundColor: '#fff', - boxShadow: '0 50vh 0 50vh #fff' - }, - smContainer: { - padding: theme.spacing(2, 0), - display: 'flex', - justifyContent: 'space-around' - }, - smCaption: { - padding: theme.spacing(0), - marginBottom: theme.spacing(2), - color: theme.palette.grey[300], - textAlign: 'justify' - }, - smCopyright: { - padding: theme.spacing(0), - color: theme.palette.grey[300], - display: 'flex', - justifyContent: 'space-around', - alignItems: 'center' - }, - linkIcon: { - color: theme.palette.grey[200], - '&:hover, &:focus': { - color: theme.palette.grey[500] - } - }, - newsletterIcon: { - verticalAlign: 'middle', - marginRight: theme.spacing(1), - opacity: 0.6, - '&:hover, &:focus': { - opacity: 1 - } - }, - footerTextLink: { - color: '#00a1b1' - } - }; -}); - -function NeonFooter() { - var classes = useStyles(_Theme.default); - var year = new Date().getFullYear(); - var copyrightDisplay = "\xA9 ".concat(year.toString(), " Battelle"); - var bottomCaption = "\nThe National Ecological Observatory Network is a major facility fully funded by\nthe National Science Foundation. Any opinions, findings and conclusions or\nrecommendations expressed in this material do not necessarily reflect the views\nof the National Science Foundation.\n"; - return /*#__PURE__*/_react.default.createElement("div", { - className: classes.box, - "data-selenium": "neon-footer" - }, /*#__PURE__*/_react.default.createElement(_Divider.default, null), /*#__PURE__*/_react.default.createElement(_Container.default, { - className: classes.container - }, /*#__PURE__*/_react.default.createElement(_Hidden.default, { - mdUp: true - }, /*#__PURE__*/_react.default.createElement(_Grid.default, { - container: true, - spacing: 2 - }, /*#__PURE__*/_react.default.createElement(_Grid.default, { - item: true, - xs: 6 - }, /*#__PURE__*/_react.default.createElement(_Container.default, { - style: { - padding: _Theme.default.spacing(2, 0) - } - }, /*#__PURE__*/_react.default.createElement(_Link.default, { - className: classes.footerTextLink, - title: "Sign up for the NEON Newsletter", - href: "http://visitor.r20.constantcontact.com/manage/optin?v=001VGGvr8xQIKjYc_kFiPLlwv2eCR5mvCy-l84uOGp_mC-N67a0MgiOjSJIWa1ZibyTJYm9YZbvasF-RX5OWfNMI7gIq2IjIF6fDARps7B---g%3D", - target: "_blank", - rel: "noopener noreferrer" - }, /*#__PURE__*/_react.default.createElement("img", { - title: "Sign up for the NEON Newsletter", - alt: "Sign up for the NEON Newsletter", - src: _socialNewsletter.default, - className: classes.newsletterIcon - }), "Newsletter"))), /*#__PURE__*/_react.default.createElement(_Grid.default, { - item: true, - xs: 6 - }, /*#__PURE__*/_react.default.createElement(_Container.default, { - className: classes.smContainer - }, /*#__PURE__*/_react.default.createElement(_Link.default, { - className: classes.linkIcon, - title: "Facebook", - href: "https://www.facebook.com/NEONScienceData", - target: "_blank", - rel: "noopener noreferrer" - }, /*#__PURE__*/_react.default.createElement("i", { - className: "fa fa-facebook-square fa-2x fa-fw" - })), /*#__PURE__*/_react.default.createElement(_Link.default, { - className: classes.linkIcon, - title: "Twitter", - href: "https://twitter.com/NEON_Sci", - target: "_blank", - rel: "noopener noreferrer" - }, /*#__PURE__*/_react.default.createElement("i", { - className: "fa fa-twitter-square fa-2x fa-fw" - })), /*#__PURE__*/_react.default.createElement(_Link.default, { - className: classes.linkIcon, - title: "LinkedIn", - href: "https://www.linkedin.com/company/neon-science/", - target: "_blank", - rel: "noopener noreferrer" - }, /*#__PURE__*/_react.default.createElement("i", { - className: "fa fa-linkedin-square fa-2x fa-fw" - })), /*#__PURE__*/_react.default.createElement(_Link.default, { - className: classes.linkIcon, - title: "YouTube", - href: "https://www.youtube.com/neonscience", - target: "_blank", - rel: "noopener noreferrer" - }, /*#__PURE__*/_react.default.createElement("i", { - className: "fa fa-youtube-square fa-2x fa-fw" - }))))), /*#__PURE__*/_react.default.createElement(_Divider.default, null), /*#__PURE__*/_react.default.createElement(_Container.default, { - className: classes.smContainer - }, /*#__PURE__*/_react.default.createElement(_Link.default, { - className: classes.footerTextLink, - href: "http://www.neonscience.org/about/contact" - }, "Contact"), /*#__PURE__*/_react.default.createElement(_Link.default, { - className: classes.footerTextLink, - href: "http://www.neonscience.org/opportunities/careers" - }, "Careers"), /*#__PURE__*/_react.default.createElement(_Link.default, { - className: classes.footerTextLink, - href: "http://www.neonscience.org/about/faq" - }, "FAQ"), /*#__PURE__*/_react.default.createElement(_Link.default, { - className: classes.footerTextLink, - href: "http://www.neonscience.org/about/contact/media" - }, "Media"), /*#__PURE__*/_react.default.createElement(_Link.default, { - className: classes.footerTextLink, - href: "http://www.neonscience.org/about/terms-use" - }, "Terms of Use")), /*#__PURE__*/_react.default.createElement(_Container.default, { - className: classes.smCaption - }, /*#__PURE__*/_react.default.createElement(_Typography.default, { - variant: "caption" - }, bottomCaption)), /*#__PURE__*/_react.default.createElement(_Container.default, { - className: classes.smCopyright - }, /*#__PURE__*/_react.default.createElement(_Typography.default, { - variant: "caption" - }, copyrightDisplay), /*#__PURE__*/_react.default.createElement("img", { - src: _logoFooter.default, - style: { - maxHeight: _Theme.default.spacing(2) - }, - title: "Proudly operated by Battelle", - alt: "Proudly operated by Battelle" - }))), /*#__PURE__*/_react.default.createElement(_Hidden.default, { - smDown: true - }, /*#__PURE__*/_react.default.createElement("div", { - className: "neon-footer" - }, /*#__PURE__*/_react.default.createElement("img", { - src: _logoFooter.default, - className: "neon-footer__logo--footer", - title: "Proudly operated by Battelle", - alt: "Proudly operated by Battelle" - }), /*#__PURE__*/_react.default.createElement("div", { - className: "neon-footer__box neon-footer__div--social" - }, /*#__PURE__*/_react.default.createElement("a", { - title: "Sign up for our Newsletter", - className: "neon-footer__social--logo neon-footer__neon-logo", - href: "http://visitor.r20.constantcontact.com/manage/optin?v=001VGGvr8xQIKjYc_kFiPLlwv2eCR5mvCy-l84uOGp_mC-N67a0MgiOjSJIWa1ZibyTJYm9YZbvasF-RX5OWfNMI7gIq2IjIF6fDARps7B---g%3D", - target: "_blank", - rel: "noopener noreferrer" - }, "Sign Up for Our Newsletter"), /*#__PURE__*/_react.default.createElement("a", { - title: "Facebook", - className: "neon-footer__social--logo neon-footer__facebook", - href: "https://www.facebook.com/NEONScienceData", - target: "_blank", - rel: "noopener noreferrer" - }, "Facebook"), /*#__PURE__*/_react.default.createElement("a", { - title: "Twitter", - className: "neon-footer__social--logo neon-footer__twitter", - href: "https://twitter.com/NEON_Sci", - target: "_blank", - rel: "noopener noreferrer" - }, "Twitter"), /*#__PURE__*/_react.default.createElement("a", { - title: "LinkedIn", - className: "neon-footer__social--logo neon-footer__linkedin", - href: "https://www.linkedin.com/company/neon-science/", - target: "_blank", - rel: "noopener noreferrer" - }, "LinkedIn"), /*#__PURE__*/_react.default.createElement("a", { - title: "YouTube", - className: "neon-footer__logo--social neon-footer__youtube", - href: "https://www.youtube.com/neonscience", - target: "_blank", - rel: "noopener noreferrer" - }, "YouTube")), /*#__PURE__*/_react.default.createElement("div", { - className: "neon-footer__box neon-footer__div--contact" - }, /*#__PURE__*/_react.default.createElement("a", { - className: "neon-footer__link--contact", - href: "http://www.neonscience.org/about/contact" - }, "Contact"), /*#__PURE__*/_react.default.createElement("a", { - className: "neon-footer__link--contact", - href: "http://www.neonscience.org/opportunities/careers" - }, "Careers"), /*#__PURE__*/_react.default.createElement("a", { - className: "neon-footer__link--contact", - href: "http://www.neonscience.org/about/faq" - }, "FAQ"), /*#__PURE__*/_react.default.createElement("a", { - className: "neon-footer__link--contact", - href: "http://www.neonscience.org/about/contact/media" - }, "Media"), /*#__PURE__*/_react.default.createElement("a", { - className: "neon-footer__link--contact", - href: "http://www.neonscience.org/about/terms-use" - }, "Terms of Use"), /*#__PURE__*/_react.default.createElement("div", { - className: "neon-footer__icon--tower" - })), /*#__PURE__*/_react.default.createElement("div", { - className: "neon-footer__box neon-footer__text--nsf" - }, /*#__PURE__*/_react.default.createElement("div", { - className: "neon-footer__span--nsf-text" - }, bottomCaption)), /*#__PURE__*/_react.default.createElement("div", { - className: "neon-footer__box neon-footer__text--battelle" - }, copyrightDisplay))))); -} \ No newline at end of file diff --git a/lib/components/NeonFooter/images/logo--footer.png b/lib/components/NeonFooter/images/logo--footer.png deleted file mode 100644 index 336b4332e5c9f6ccccb04691c1edea2d6c13200b..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 13904 zcmYLv1yEdT6XjqbcoN(R?ykYz-Q7L7y9Edk9D=(g1b1f$?(R0YyZhd}f43HDsHv$t zeA3;g&*|<6B?UrZ4n_7ZPn)g>%c1N__+?k|wz<*fHwGjSK(_UivU`J!*>i~aa|VcLbqD~bGya@nfHkhAsh^i-{w zYkk{Uc;&aMPmenI_66oEBy~m;#{(@K9e#<;!>znn%YyRw=@f)8%*Yn?Nt90&n6qK6CRaz&P06X=_ArckS@>F2YdJ=r)(gHr z8{fNwc{{ywKw51L_<5h)hvbOh|51Vj`z#ZVOrbg5PAVI`0}S$97OJ@ zwkP2^O82I>nbM29z9`n9=FtO6re{rrxj9(q@B{B%W*x?8+85OGG_jbVBsgeoA{vFH zqAnjWF2(IG-soAg_|P8n?ImI%S;j|b=(4#&w`-;#$7L(<*u~gou-~4h&IDh&av4lO_S#Zni z{KjST5T)Z46nS-xZ9|~(QZ0tc8xKbAkr^hb2m*a$4ARDHuKzRuXE7+_N82Hu^a1Ko>UsT1P)y>k^i_?9#vipy#~^tT+uvk=+ld?7E$tU9Dtdmv{8h85qD(He+nKCs zs2DE4mp1={kd35#dN^p3fxgVAzhjVe+Fz>k-s=%>{%%DA_SA^E>6_3|%Oa%ky5aO3 z4kn|y|8WkIIGrcU1MX{mc=KzMPb%otbx^YJDhdc ziDlR$la`ExsNHxvksbBAkPUfHCV@YGvds;$%CKYF$84(gcD^UGt24K{`{_EOgRh-#tF;SA8s-~qPCT>A%}QdA zxnu{lcJ~-0QpeJz+a{94v&Uk7)B)O9*xRS!HHr*1??)}dv*!7E)ffKO*Ce9SSqkll zXZ(z;M!BBe*w*&Q76`_Y|Kx^JPG(H3>if~;OC!&h%V4E=9HbdtqZzqhWP&waFs~`A zdm}3BBDA(_?^g}XE6_ibhkYxl~U24Z&Js(8K$P)f3@6B z-9=vNH`1y>KiNNQ`2GAOWXJ-Ak^XctVs*W&5Fm4k4F-K|K)X|yNTIk7GY^?1tVc0j z5t`fjY_C+uGHS# z2%1-LN+wEEk&5RUf;Mt)wDQ4w0=ae1rRseN#q+;Wg zl*2lcdU9tC=;oQZ38u#72k3O0iDRknG_aaOl_4O`NH?}H^3BDM3 zcem4vtv9D){w-Z4$zuy)FFuKuj|(O~rXe``RT;TZU@P_enCt9ezfaY##-5evTvcg! zp=mmr+dXUOljAY#>HT8V>lXAMnP_f{$nWEqLoc9@eB9_KC?9UJ_HpCCtJ){~JvpCd z+KU;JnYvJqF&6B(QG8b^+v%XCOfctzlgxv{KX4uW^a5SRa%5#Ytf}=xp7w6k`jCjQ zw-V#%{tM+t)TAflSuao*@!7-Pi`D--p%2ntAvFrVN?647RPrP3to2vAI|GKkjCaCL zxW8iY`eSMjU~Yx(75c|!xpst}J}b*~o5|9$(e+G5AqO*~iqf3^m9ShjvouOG4VK2q z(8!3Y%vBpRfnE>6YP%ITFG{f0Uqe#BvFnbskF)knHQtJjfJdS{utc>8Rr`@m1ey@A zh7KkAQ>Rs;J(ez-4)elhp4-<$2yE}f3lcx1&WtqY^JFVzaB4oso8&-}{LHaP{~FuEGwI|61op7tWR`f|WU?ca++ zVi0$1bm98UQZl80o0ln^5kH~=Px7AoTgKK8-dqzQ2Nu(4R_qYXBH4sL6Nz?{F7Edn zOQJF7WCQy8hy~PI_^Y`S^Pg~w%6a4*`U|6@RsU9Hq#}k*`dK-xY;oiuj~9j_s-qnULbLQ_iE`f`{+8nSihqFm_A$iJq&RzsaTmhVak{Z} zq@QW&mGk6+Oe>xUB@pi!a}XxpCd^lBeUNz3e4wsF~ z;+*ES`Mz4~)VMiZyH_cqB%&a)RJkM0LwlpGSG$};YcKmbG%vp)Vdu-JGI{kkjHwTw z3xa5Esy>vcll6*)-J%n{e(cYoOp&Xg#o@tH3P&8g2zl!|vmc$BDa^o-0R>?%zv93I zw+gjdFR%AEtO`IqkAsuvZsv8t$5aQS6YC2i>?-c?#&9DWNP4xNE~xmKr89_k?7Zwa)#cpD*A;b|d{KozHk37kYrCpH((i+8MQO|zR^ z^zegM1y)U@w5DHMdOhqN9;C#{oz6SHj?1|!B2`ctUw%6vA4p=#FVg=cCO_H?mblEgzl|K94cc*mr z?RRN~-}822i=W>qkLBPx%T@$>pidB|0RQq*pFq=Pq-;bly5Ms7ONCO?FL@g0%{wou z32BojROY^t`fXGQ$)J2}Jo&Ob+^bK<2PGFnVd2k`p}U!`;-x~4b=>0PSzG~K>gmPO z>z;v$4&4yi6 zfM%qJIIX`YPhu^}&7JsKrqhlGnS;i@dT*phpWS49KcLLYl??@U6BzC=LW|svws}Wu z2EHoJJG*W>gCn4LAR52NNS{UL?hrC(xOQW7UoZ|oRT~2AEK+YH|sip2_hYvaP5k75>rcUSuGyM18m@A_&n^c{jZiGY{CPe0z{q|#Rq-&Bf@0&CY z{jHh)@6Nbmrite-XFpB6Yhp6=I2uy_1N91Wz0zJ|D9+=;V)Njj)lm2xa_NBgC`nY* z$vv5bmj{j&1sICYw^R-3X=zpdyG{k> zz*`2T)2&M-BY4pKDFsgoJTz{~ZjcZi#|y?3^D6r_MRv0{j{RkbT$>r*A=<}Ddf=p!Pnj}ls!B>$W73bzxeiE}0irQc zkHm|u!V|-6*H0H<^M7YF#y?jnQOHt(M++pD>F7@ZznLKsRpO#vnmTk!Kr1`aXYYg8 zYJ2v|M!eRk%@u@&^LU!-;f7zuQKKF&j*F| zUEZbx4I-?-$n7xkc&0e8-~P4nrB!3R$HO{*K{RgtQK3-wG8luakwnsMUB|tQu-6VW z+X&*qEm=9y9D3mf(*d$8KPDqy-1qUx|HW4wWt}+^I9B(ZtWC#z3tZOuJeb*B9@Kvq zlo`dUg`oDp7%KNYBdlZf>eY99{+RGM@pun ztT1H=9loKFzzxlNynegcMt-jWT~L^FHLY2nQqHgkMLeY8 z>-L>nINFQybjckis~O$({Y<)?sY;nY8X_X1e3w(^aGc@$C!XnvPC4CF4R!VTwa|V) zaws<;zGbGU!te=!!^0ga*VUqor}v?nc{>GI2xbl0JTKXnV-4c|(q-1gc}%o)$$v&7 z9{<*KW3O?b_$hSM^le7e2AxU$w4?u!ScDXH`#%Rnf2OuYci5g`^3lh$2V8cM{yM$* zV-yt;+|p@*zroL2e`C~)x)9xuLX_24HV`WREKC44ugDvD-*Z*aV|$5!;SzSds>`^N_PT3e1Zr&|eI=|69LG zQcZonLBt>TH&1b1XGVol#Ard|wvYJ^txn6=hYlIv}u!Iq;0l?DTq6D)t( zuTx$~V#-S^_&@A_ZeEOKm-m^olE^HS%)SL*CG0#PrylfwJ6LH(ul5vix7c@w6iqAg zs@oKl>(rBCDGn5K$v{W=;(M9@we=@A_a&OBi|{esP-1cUclmj++)~aN-D__~cN0x) z-kGS*Y4e)UWHk?)x(|$-x5*d!LKP?>~5m0D1>@5*jdC(Hm{ugdEJK)$F&T5x2 z0k&zA08Gcao+mzUsg#gJZGk=Fpu{_;l<`rQ+ON^Rnv*5z#qDQX&k1(wr7#8qqC|^b z4>yI$1_{V8R%FeimVOEIVjZ*hUeYyd+uc`v@Yl<{a4!G5WU8H9^a(}hT8GrIj;8o% zH4CpCroaF_uU_*-K1L=0)iPJ-^Yo zJtYX@;AIU)imp3Gu1P0Gv7Ft9GOPs`odv$fu~{Jcr~71scad zv&FCntLRmfUK1!Q3?Ee-L8D|%0%SefHUF=gVS7=X#L*e$g;0sdL+6?{>-OuF&6csEKr=qzahzOB5=PrB{p{blBZVWQK6AIM))H1G;8yYmj3vLNm* zmeeY=<$L1o*e^ouMr>3V$*H(O_V=C*5oaD(zMZf*6%rN7I}owll5LA{0OADrqv}gr zG+<5>Tw~3_<%=Wjlct8&y&b==kD%s);i@*M`-p_E^z>n%h zr~2F}27IhG1l-B{|JPi=@&+-S*=-21|t8Yv!xSq zeRX|ZSY)WN1hcf};^hb`-?Y&U7_NhjLcX(yh{6u-?4!_4Z8KGYV^G+G+c|pVcgp62 zOufHEUS_&6k&ZmGW^KiV$!A}XxW#MQM4ty*+z9quA##JGsP@yv(a72_Rrc@5W1eQ@ zc3N3iC;r5D(i;?jm~8wJ(Y`wE?fWi_x8K6r0 zRy#zuwDs<@tuk*--xHxRuAGy;T{T_z@)SIURVXTK2UGUZ3*aS$bv2bkTg`&tcde{? zIU7V--#+OP*OTGb9GE%j+v?5RQyHN!^V>)sPFE`WjFnsF`0dW231&`WHQ{hE-);RO zTrA*~SUGEL+DYMrp3ZkS(+%?>Bq-nfJ2(?n$Ii)oB%?8`KCqh3b%@kGm# zjQt4;d!(IG?Q&(HwaaG#-Oqwgm!{Jbf;V}-n&9w|4LRU_f>Os3`?e-ge8de{cF~um zz&dmwDCoD&5jZ(htYnn=lG!b8&Zx$!6S<3gC8R=SGz6SL zj(n`}JXTFGA~o4HDT1fFp@rkD;N3i?<~?$zbmd|sFclfi4(;X2b}u-?9WJ-)9~sQ zZnAh=uk~4Skz9EUKrg?H>{Hor_!KGT9kxCTp6MD#=4T)Mt452_p(+-@&@)m=zKLSV)qkFW|!0J<4OOcvAT5z%7RQ z!1sA%G?En39wuMpYYvoEdOC)|mUku8inpoXp5COjT+NiUxr_7ml1>2uC~b);bE@So}t{olCvGD;h8(m2jfFVPdC}hK_c$ z6RMrLVf!0>)D|29*2&9M+roM+hdJ$Y6U9Ur7B9_u3f7>moFao$)Mz~g3IZUAtkmD?I7Ge?e6QT`|jqxP{sz1S~Re4Sq+1mO-BBKCQ?nZ0N68k#h^ zhb;SZnepEDBL&Pz6mT`TfQW0~c+-oc`j=bOQoOy$M_D+QH|jJwi_Hg`K8AdKDvYIH z#nyuWaD6+HXpyJ>P8cdD+T#`u>a6(v8!j~*ACiu@9P0? zITMo^c;u~c^ThG~uItyNsmj$6;`sgT<&QJACah&Wr;7dY)BMp|>w)b@Mx_dCJYd80 zsFa|PZ^L}EXYgLzK8!Y!4O5paAnrOLa~H?*=J|{;e+z)x-tT5kNJitrpTl3G5#(6l zd2?KHcVO)~PwrP&2Kr)Sf!PEs@(rW;5b-ME$kMjzQ@EUs7%)aSQT!StAC3c`6SUA> zD0J*al`2_Wbq+f%EZYtFmu8x+9YBWmy|REH4tVEJA@D{pZ=MoE z3TgO7*gRE%yl$x(Howv5P`F~}K|ED7Oy+Lx*{+YPu#~)^+~l_H{(bx{&elX+$7lyD zw^AQBdy^X#ctU(8W`zdp^(&?*UnC-UoNq|Q18-_B2Vhh_dI#TRIg6g74_AIqp8$`> z$DP2ibg71>1Q6AUq^)$x2Ccc9--|k}>gj!nPU4k7)5$|6qBD@JUQB+yrfMuXt%sXu z$a2~P*$Ei*-qi$MQ`e=Kn|c>dX^$UR+-z+fh$*Xdh_=qgyd{Ggcl_> zHoFMQ+7;S~ccR%HwEfU+u!oz^*SAUyJxV_^!FzNAR1VY5)O-e)0}l~TGEvzDI%RO1 zXGUfMF{j=hi7)b4O2lW?;?uuaD#5u~I#=fN z&3+0AWsMm3O@eQ0PsC;~=9R1-Y!w;QH|cZ=Rgjj!Qz^ywA8~}`Tv<~$w+h!M%Q3kR{hHJVo zEP1;d?1BM6E(kzAA*V=LIL#dV(k7li;U@-#kVAo{dh7-FY{}iuj2sa+04bXQ4D#q5}AqdJ+))|sNT<-4>^}54AeSAesdG-*iXk<>=go!taVH%`Yiiyku=+3LtE3^SY{!Aag$BP=zJ!90`) z8pm;zn{uqzKt&xX^B8DU|+;zEW8wTRTcuJsdB|DqDf;Mr@+Vp(abbiCXnH%b( z_51ys5q}2ODGnfgImH<0+V<%dbYzQg)bt&O4xaFr=lht_tUcDuSeub;R_k=O3wf#H5 z=xm+-lW3uB+SE>Of;`j!*do5pgX8WCQyK{@Wdp!D~){w$sSG?7rBY{QA zq|Uy_d|M*HRCMWrA*qav^?_qRCjMR=+P+=M^29}V2RT)H zZY}{*3YRU{a5^lz^l)jeX;AE86R7A|BFey~W!Tgv5}RCzNfP%R`N>ZUT$xV55{{ez zq8f1~({mG{dC0{wX#A!`#dhrvx}hRrgPG<7&Y|ivfIPuIMfI<@twuh zix-0n(#eqH$Q7P7AYZo^oM_+!=pbANRQtJ@U#6zh96UG2+cKWGB1OneLWW@)kb2yv zdzJ+Nb})}jHE+nSd2fJyCkL(gy-{Z`M--`co?k@micj5R{)YLHQ>AK&_eDCwVzPo|NGa)1e zpx-I7hEjIeO!-}uChcww1M@@Ow1RxfMI{(WGWQ<=xE5_n-HWjGhA*FRs(d?(c38qV z-Sm|adZEq2lc28V^2TU(;MC3=>7ZPDU8#+a`LPs_Ww`7ynqDtCX++523LCh`Ww*3q zmf!b1MWSR^x&t?7IY`iJuBVnlV0@FHq8YUdo#vy{R$q{RvzB6){Fj7?%!p_>>+3rt z&lrci&l}P8M{~9Vu~#|~XhrnmUIL40`K=RrJCQUF@<*`OOb{o<1Q=OSFqLt3NgjJN zA&^1qhUmUT;FK9O&0zcnjdglrNuEWV=KvnD1H7v7x$Iitxc(#{BmPz0wBt3(R5zHE zUD-p_%IIF3mBPS}>;4AG#SM9}ke~}#2K6;%X&w zM;eDMCy}iTuhHf=1oTea^~c9YszIjLT{%74B!JbNZBnWgmbwaJ)|0teUonVVJB3+3 zXFvaJ(h6AlyL}>tw`V4S^7ZM~)M>T$VKc&>D!XdLMX60_vv$O;Vy8Pix}6B;uwSU1 z&xYQ_C8d3DyN8RiCJ<%2)z{plPE#3BjC!(PROsa^8Fh|*O2VF8IbNjnqjt<|eJ?SunVv2AZEzG=JryXv*=U)D?dwADC3 zabl!MVd)*lNN)-ZJ2rbdJL3X`!3Ga{L)D`G&7#%u``OD(t<*X){f8RA-RjpiC@r7w z@U8FfrS!OB-_4z2g3nav5xmYm%z;nAWx1F-1OUneDLO^qS5gcg^U6{Fz zi*l2xUp2IKm>J)esB!!1I-}^MgiXBB2gVl+d=6RAEg8Doa`%v$; z%!v|rV)BBR@~dO9srYS{Bi-ruoxE$ekaB!kJ>N?K3fW9^BnDLl$jk|JFx=wU!{9*95LWuDl(> zuP0OgtCCDQ&PT*`il)bPDh}Ym3G&NAWL@z5M);}XW_rFV1{^lDVE0Z8l6O*rhPB@< z2qlS*#uwG`ej^;co@~o8#6-2tt{>9ZZY|=~#%d!;>Afq~u4MF<%-Mlz|6}iDlrPgW zrxv;qQKH2p9mMFh-}S_4kve~4!grx{mQd#il<>}`gtqC+wWlZElr?lNn>-hb^WHx2 z%#hGz&i1(6bQL)dU{BUeCER4Yj|&^*57ZEFPd$_H`du6fwELwQ#%$>c`CpW$F#|Oq2eROFDR-2ut z%aU6v0Z6!gvZibIXa^r&D(-vOT`2Oz!A-flI-tVCA^+qCs8+JFFXcf%v-aqzx5;U% zzHsZ&v{1atkcC)3J09=O@TYCV70tcrpHq@RX zG%u=u940RaC?j1u0(Az;>_3F({!UI8k?^N)s-|;bgu8F2FAA(_eBxR{iQpeXBvs_? z#el#P^dQ*729@hJuJz6ssHyev?*!<5e7PdSo}ZuhfawUy&|?93dIPYOp?K%Hm)L55ZGt!Y&m(u6WF$xsNI~$Ql0gcy7wCp zuXcbk&`tl8*~8%1*9h`&(z2a;>T@C}Ew$Z~YLhJ3Ss~Z()*3s-;9gI>M;@&i@(La{ zH$g{nRi0wt08)Fn0DG3pLxmRKh9pmQMuzC+5{5?kT4?v3$aYGP_fkncFo1bJBGag{ ziy&B5-N}j4uAyN{r%^F-;&IEc_`R@;wz5e<%U7Vst+~G2%_F-G9w~j~>F!)>Zs=sF zs$9Z+U8Dy=AV~M`*LvNZ?>>F}wDUl)ucM)(ve*BJ9z_-Q zIc21kh&!*W&MXbBX6V_j(9szXu)YX2qg^Qd389riqCn@sm&R|N09I+iyviw&5Vd

8dCV^88NKR>Q51OY0Cp)e)Nu& zMj?Do?pXf~A-l zzVf5(Zm!%gN80!q-+91Du_ro0d&kQ!XvOnS8Q1Jl#cC*64@(2WihS=TM6@kBJ-!X> z^HwCDN>(of5bTN->s7)wA^2SOuv}w0?pe#0^A-AZ1zEa&I2oRK1pCPu>cYl?68~ED zD`i4yq2rdosKDxV{mzN?S(VvAjbzZeOk0XJV3_1vIllpxVJG5^CBUr8+A;IVO$f%U z7vHS+J1+)%m$a$7Ss%{VP++0=QVzMcNfqHg$BsM*w7QfiSY9_DA{r)bXz{TSarKB| zH9$#vqkEGNefh-oSsBY6QG0%y2Q8{6Z-+UehJgj8-8OGuX$WYcR^^D$i*U)TEr7yC zU(N0a!YO1^tOttV77*Gp8>||ki5!eY<1zgb6t7tzmFk0NCR@gR(L5=$$9vtr#7m9i z$sMi+K#dkQMMH+t01#vCXf;IN@UzL$3*BE{KqgX5HW50H=@)5}9L4w$?EcE^S2B&TR)6Qv_XRzn1{ItdWg_6ia zQWk$xNZpsI(IiRthl&=x9c#qIk~TP{u;DQhbWvZGHTmuN=FtoW$Q35t#fArrlHY|m zHr5Df{z@4l;u8%32d$7kt0A+l94kEUvuii;CL;;ZylmS%3Lx&u_{Uw4?M1|%u-K8K zEnX~eDpghxnOU83toP9#w@prHG1Su}LY#{8?uNzJ00ltil!jnd^EM7^Pa0jqrrA5e ze$8W$4*?3&M9#9gc3tMy3!hC-e7GV^+v>x5Zjaka9xAifORtco%4f8w=}!b_noNupf(uB|2b%nEMsrzaSi8k(4ktpzWnsB z(uxy;C@Na3Z>8jD$X6<=-(}E>7#yj8S{BFwjV;l5MMak1zkXRY6Qj+}my>_au>A_d z{P>*=)!{ZYMSltDdC(*|qGW2w14SgJcO1<(g4%T7sl=9AiU+g@Z4OL3ETC1p9nB@i z8@}g7Xd{fGQaMBWyK`l8(oN>u9YrZ+^tL7vPO7W(X*ImtV>X&%{^?RFe`RqnA%oBy z?{Th1g$mnCLDawbOPW?Jl`Id?vT|H)42`su7p-KXb5q%Al~EpmALR_V5PhTS4F2-d!?qDDK7I zJEDi$@yGz3*4e99KE0T3k#8_Pe5OuV_6Jg-D}8>6|93RPbJP)qEBkj*K5Kn^&nAL) zGSMyOPxhNoExt*@#M*|bJUhV7@l5Z{!0P4KV${6NF2BMah38lVuL z3!MYgJ#{!@5CK45O&qLE#pyEd%`4)zv*f9wr$FrE-+wLQg&d$os#6b1yj~3_@*WTg zWZCM&hEbHVxr1Br9*}RBknzuE0*VQfJ)SqP3UR*c8v%Jb0A!)#k&5@ZXq_4&zZCk;fp)r39YSWtkY6R8iiC?F_|c!^^=*?elV5o@ SP7RoV1xbr5h*gLf1^*w~xqXNL diff --git a/lib/components/NeonFooter/images/social--facebook--hover.png b/lib/components/NeonFooter/images/social--facebook--hover.png deleted file mode 100644 index 2f31a356c38119f96a7f8df01e00bac32ad2f2e0..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 868 zcmV-q1DpJbP)_ki40^zT!?07u99E?R(FeH|fG%X)AOi=t38|5^@qO31K1;If7h!nBuVl^Ei_HjdAz@>s!!}1_(1ne zWFd~@YuiGzEIVms`CSmu`#()}4d@RF9RcP>fjzuAJmM{Ap67?GELW+Y(t9TIK^(_d zhJ(E{O@J@9@obpLZ1s<|ids>e3jl)I`A2~Pn!@|@RYPHOTX?fmA#PLsX1Kl5?Y@|% z>C3>g<9s6WVXxPF0l)#6b1j9SZ6PB4>O0G_qu%US9cOqTr7TYaAE}v%_kJPF_pr?D z$sHL)-UD!Xo*z@y!vTbAi2NcVcdL-QfB#PD+~)vd_6Dl2)l`|vJDr!D6~(M*{RDZD zuahKM8ICQUIdcd23?S=v4-3>mA&QRc;PBqFM0GkO&tS#@lOf4!_I58#kNj5@?N+O` z0kCr6!gT3eV~}zpuz!<|!HH5Uk$GT#Vq)SdumMmUI54enHV{^+uMynZp=nPtk##N1 zuJ0!_D$7+}US7VzV7m4}w-=kuH3cxUOZ$Qxa5kYLZSQ^gn2`lh)Y*b2N%Fg@u8jBW zO=gxg8jU};pa6yUpBSt^4xopdsD4_tA9^|Ty4_b%{T?_trofMC_74DNPt~5c-uEqv zUXSDW=aEo=EX&>!v#-X1gXMi6c&E{9emfi<`5H{q^c8_C0?+K42RB9J-Qf{d8hO1W zN%B+a{hWE9?qXFJX4Vmrxlup}c;R2{cAqQYw23UJ$he#2HfEQIqE59+w^J>2SXq`G u74MHD@-&;bQ{P0^qq1CGY&O?I>--M}_&E7kP9N?70000F$@^eX-qc-+UtI%F4>~^?Lm);A5ax zHn@V!%)SeP;PYm)`B!CVk|f80%fR$5V2{Y%ABf25D2jgG*`_-kX__vWS+W-(fQY;R zbmBNZ`B+=gNRs5ZnI)?FOohCE0Bi2v1911lsyaI&?jbN&obeFa|A(uT&+sAeVH8DI ziq1HWKNXR$M|Ci>jUWhS2LE`ty!}m6x}@%YaVM}$sydnH`Ng3P+sA_KU0Ny;St;5{ zlDwK_*_*&iCE$;`-R>&@0f3pErQ)$r)!yJc%d*$Z>~}Lmr1Z$Eh@1gFQ+F5ObQRzT z9oS8l?ru8mRjRtK zB658{p}?xPTCE#qwy{sZdr=gvDS)aj?-O(x{ww&4z}C~GnOUCa`O**?MbRzb(%4>m zl&XF^KR~8s~uZrvWsxJ7)I9z<%U_W?A-jp698mK07AIFYf*~fQURtdFkt! z*}Ls_``Sn-Kpe*>-2I0Va8>n05->Xo2o+xV-EQ}Ys-9u{q91pY+yj>LJYO2@(*IL=r7x)e tJUM1&FRJQmXUBr(qJ~;O{sC{ivJ|1D zA{vw!(>4hxQf)Sd&YZ`K?5^wV>}C^_bN8P2d7s}ovuEEKL5D$7q9{7RI3A?x0Dvwb z*Fatu*S$76I{LkcuoExYOb|^@?x*V>2XGWXZ!4Xdtq5>YTzAs*yt!>bqbTZT9G@}r zRaJF1E3T1G@?)sJ<@^3`9Yez~JS^lz00UcqrO>uys>4ALe7z~OR4P3KvrDRa*S3NG z#yUlYec%7GB{U4f!%UK|b_iGp8}L+P$8~5FMcqu2S^S?z+B%jgGFbbKwU%WZpV=iK z0QAD_z1l*6jlV^r`ok8dbgN-debn>3IRyZ^?(tm)0)Qe(jsbv@6f+ynE)Cz3JR!gl z0H~xEl2bRAmroXpMXTker>F1!`}XZi zP<^^V`q|q0`b+tIe!bzWl+T@eUsO*uag*eLGL8qEDkra|fdDWvGP1gM=gv_xTLAz9 zi+`=IzT61hXh?W-W#vsHuQqk-I0v;G;CK7WsVsPZ9Z~+R}xwv9Yx*U9ng+ z0jAS=0s{)5tLcR5LY7hepvZi+qhH$TR3yu%O952USs@>2YX&?F03`RdEe`0*NLSPW zu4jl}D-;TDmeIt-L=S)$s?d=z4DZR(6$%9f`AU|R-3>1Y_PPK-az;enNGnwJK>+V=wBPn4qeoOv)D|t3 z`M!UpF`YSRrBdlh0X`Mr z{%!Msg=&Xa(tDb9AP9oXiP<5Vm9{a}G07 diff --git a/lib/components/NeonFooter/images/social--flickr.png b/lib/components/NeonFooter/images/social--flickr.png deleted file mode 100644 index 7d31ede8466c044a06799d2ccf601293eea7405b..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 967 zcmV;&133JNP)SjzJ&4W0 z##GQ!{8Mdv5+RVl?y#<`7qysHMMb>XRzy(I9>N|KPtt&bf_i8}{dWr+H#-A+vJ|1D zA{vw$(-I4cD43G4`<{o+uIps-uW7!gdGCGa`+dKeH^1Kq8-%+{6h(X8eIGC=B6;A7 zyI&NM^TlHEdlB)CXvunnIF9$2*-puFl?r4nodMf^r)FNwqgh% zA_KtJ)6>(Bt*G?|jYeb0%o?hC(^d>qSOOmIU2)emd51G>afMkhv)_Us*w=Z--N%~@ z&2={fP}QBSR_mQkEYSTdeqeJ`x>=Z+-B&7=W;Kb9ZnGhPipUWFb$0;{uhQDL?tTn7 z=_<$aLU~mfV)NHX`nxY_lLWm1ZG8Kz|2Nfbx#KG zQW%E2f@H}Pz$+P~yMVVu*8Rcg7m;I~Ky}55*}(+-x8a`v+UqHA1!mT2wOZp{(=ZHw z20q+QQ&s(-TrOYengZlOXU;B_=!6p<%NrPA5nWad~#QS^|ze+Jxft!`#E$JG^{P1iDKyI3rq$>nkf zfcM$tRGV1~7zYky8Nvqs@ay&ZZdE<>iB_vM-kH+Xu&!w@;yAw7%=Vkv pE>+E&*`lh>12bV5{)G`@l7h}6DWa5-(xiw$bhd=B z3y{4Y*+`%y5betH%sCXSmu0<=*~NU)6!+e5&hOrtd(ORtj8avKqG()`WI~zq0ES7m z2Gwmc&9#}CnTJHASz=KyL*#j9)ih@Td#pdk?LIl`95GRXxS0wDaUdC>IwCI|1v~=W#(f81K(&* ziKcAZ{;eZ42!czRrhgt0umKj}i{=$KpivZ!Xqv9#T|Q}N?JCj4!9O++dNoOIfv6qu ze*phwjV>a`nfb$(?i@sJ1NaW8uQc+!vnlhV)?F$hFZcHM3-j~yFS0_HmX=0`3}Xw- z!>#iH^Lfj%HW&cZG-unT1v9_s2M7Rjb92uHc-dx%k*3!GfK`=5WUANf!*Y2wD3^cl zX99;rbOiv+D2m3J`D8cm(9qBaNRl(kYt%Qb!|}SATrW)m5asVLjb$oj3SZ(h~Rt2$K_ns1cePm#fDuAzS+kVj8-S#%<`~K$y{6fGd1M`5* z`U)SkjsH(M3e1+K!zLs&*k#z1h}R|Q%v-67i$dF6&Oaz zvaBcFV)leKD+q#5N#r7k3V3}wRh6h>r0MFk>#k>w^9uQwTuSWjUYh^_002ovPDHLk FV1lFbuaf`( diff --git a/lib/components/NeonFooter/images/social--linkedin.png b/lib/components/NeonFooter/images/social--linkedin.png deleted file mode 100644 index bb7d0ddf361705f1eec59738b5910eda9eba7646..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 918 zcmV;H18Mw;P)+uJ>h0)f)mQbb&U zlJhA>3IY;zk$rpLP-Jb^cbB`pbNHk!-kaI^&D(u%<_U7j%p{KEQ)V^|U`j+L06a0X zZ4uclm&Xo7qh>yB-9=)=1E`wY68q#>Tz{@EL%@ zpyV5 zm1?#6VV5mCh@$8`$w*aSI0~>sy8zzLuJ{0&{=*F%afQ7^a>w($>HUA~?Hkff(*-2? zkE;GX1mk4@FJ>oHbuvkkYXCk6(v_yi;um!6Qj(8btyXDqaq&@JVi<?$n1epq^gsZO688`GrPLHyxdjcI;E-;YG%z*p@l->l5_4Wl7Fe{G3VUzLGO@ks+nz%3iW+I0RUCq z1%P(DJ+K?8YF$NSb5!Vv+R*v=`8y>0?mSg(188LY8tF5v8qT@9UK(^2z?Elt&d$z0 z08rW=JLgJSyK}DJjUua6;J?Fu9l#gpE``U!Fnq`JykBz$MXS|%gXBx9hc`0Ggyag4 zX>Cyy-2jmHtc{`-=iCyIxj7Vz#jgR>{|_3;dnCWvA0I$xW@i3W)e9t_JZEMTz$ZZv z9Q5QvAKv%*9+yKxX5|#j10dS@l5Xf=E55w?HRlSU-jsCSht_=XINs_EAEG+!iFXljKR<&B~ sU6Q9smQ;0uWK&h^05+U+ck{;i7vLsZlL@NhX8-^I07*qoM6N<$f@oWx82|tP diff --git a/lib/components/NeonFooter/images/social--newsletter--hover.png b/lib/components/NeonFooter/images/social--newsletter--hover.png deleted file mode 100644 index 5996207f9e9a19d86b386bd8fea2d3e80808d390..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1157 zcmV;01bX|4P)R7i=XmRoF8RTPH5wK|1TgqW%k zEk+STpr)Wkqv1h`M5A(RJ5xmLCD71lAn;;LjEO!NWAO4~z)QtM+ES32mOeltAvA$_ z2~h$m0)c3-6a*7NA#qyD%vwH7JDr)%FjM&7_B!jVZ~c3pz4s9cmk?~IK&%pza)eTl z0mRPXdW_E26Mz?1D4#-g58<*7^OsSbc7x2nfStsB6Wwj6Zw?x2D#M00;<5^*C~tEk zGBZTBGBNfh+qeH+I5b!{A7dw~H^LRx>^tBhgLT(f_Mbgl3M@{%dREB?cKSd z35WX&0-8NSphz&A2eJ@j8Oqe`V0}K-@hCLZR7U(-Z^2Wlau4CH7n9?~&818jT#eg1 zsNR*);6+N}l_P7cqYs8Q-qITGZi&*>x(Sy#z`pbbbsE#42<0+z#W#l{k|T-2(Ci_#W^j zs639?D;S3|-g=khuCPgCYASOB!-sbkgLa%!f0lvR8bsD7nqW6wZA((J4%6J+$)$lG z5)A>uovd7WI~^VW0FP#=T&{`RB8!S-4coR|#r=(BOzgWcc`Ys1ae7iBm+0vDmtf<9 z#F}SHN);zM)+Hy1wEaY=sVw7WSx#;3gtXkHtEV7RogBM=Ol|X2h<~2d3?2;t=f=d9 zqlu=jULij5GOA_651uAA=?FFTUxW4`J_Ckc8+GI@sDFzM_JGdL%2fIlwPRVF4gwGk z$3fo9c&P%BPY{m)9}NRff;Z#xCviOnJeJ)hfb}Lmq3XH|>C1=-{ISe+g$Nc@Y zZDRZf^r8F#6l1mk)#BVR!0bG`+NY147CSQLU_PO`8OdSi)=zPN0AvHO7qiPKlTj*w zmw@N;0#i5%r&SFz5l*EYh35OYeD(zn9EfEt5PG!&FFKwVG^!Y4vxu~xNjU9p{T;C_ z>0QY}?zlg~($!P4mayXM;{by5C6V?skb1S1*jr%zX^FxziekS~Q@@hh+Vl%SEPd9f=j>2`V8e?TojJhc zltpo=p{s3gYBbm1;FCZY^uAjl_F-C^>TpDwEt}5vLrk=JIA37I#|ew!Y(`7wWdlMX zfA}@49z^16!B>FXn={YsJgPeo+dT4>=2CuWS_6%<5uc0ubdXZ;C`vzAFOhAh3N7X?JpaO!4AeuN>+S$v8Q)cE&51lEjr?dB3XMOA6XRp1FP^g&+v7SoQsxYYl z$}qW%x-&TGCt7n95i2B>5ah+_Rw5u3eP-10;^PEkx^&Umvukvz+46%{ZD+ zyu8I_%mFbX@*21(qiX?19JFEruw3*x#8%K)cQDtbV}jedmtgeX5YW#&9kH+I z=&8$f1(o^=dqGR{CKbJ()QF%uAG1Z6)uK9OY@i#$>fF?OiX@9G{wYH8fm7-3$2b zbJY~Q4gQ0fU~WYL6o>IGun*h-a0QqJJcDQp#YMl-o_IM+@o}6T%1P1SLt{Oah~6;{ zD+%shgms830+xW@hjMcuOmzyv$FwIlrssqc!CX3x*q*tHTGcq}eq^Mm3Um@iE9k?% zQkG%vA;g};5maODEzJC`5V>h=N|_fKJ-ovd4xlBE6B%9$Z1SgUFHLpJ0!1}9@22$j zZ$=9O)m!;|-z~sjzyl%B3I)o-q25|nE&d1GtC=aj922&F{V+&hrdBSna>*syx~lQN zdC-h91(G3-qeN@IqouPvaI=^+5RVrJVq3c><79byto8xhc1}V0Bvgx#jDR~6as(d+ zV5qqp#P#}QV5r3D(y3XZX&`Cl3{PSU?6~KGplP)LiVeK-`Lz2|Anc87u| zY%U4Z6J5SPdv@%PS!2x?c(#z-rJksn4U+PzbAjPdfYo(}hh(KQ!CgdgdTD53v~-We7<`P9t`N eRdvS-P4hpojc|XRab)5E0000A-D!j*{&UFkw% zB=MswO=%c{rY21U>U-z7AkYzJ-VBtU-M#1B|L>f4KcCQ~nVCdU)NOIxW6pH}ZDO{D z*^+qP;_&eB&mv;YXi1}hXky|~^StxG8KARXoT{z}ToKQk@O}U4zMxSQ9kMvSpk{;4 zxlE(vs`+Mi3FqD}6bgSf4K0_;r^M_E(6tBH4zw<-a|1yTeA^HjhG8G7pF8Jr`v%^& z4HFqC6bfI|g_g_ZQIiKBuVq_XJDlg;r|>$e z%VsvaIrM+#NRo2^&dfwr2kNEg;IgPb4^(#g%-(XczJeqHkZ%mSN$N!D?AL0U^d;}-oC4v<42Bk0mZs%nM|)|&UH07fWO?>*ysip z0D>S`2Euy5NjCeSSp9R~pvwVmX+(wYAP5%H^SW(f_EehR%$Cl$HvC) z0j3&CdESBmOoibxDHk+=swN`xe#ha%@AmiiC)K|3@$uGNYwKl!7gIINR+lT4P7lD$ zJ`<5QYJk=SBH%~od0+XyziTR{OQk1NWCnP$QI$?)espwHH=!aEruyp6qtH2*Q`NHq zpOPehO_xgTsIHrH4=9`jUQ*}!sJb}P3Y8?8fU2u)DhxxQ(8S>Vnb{?OWaKPVWf-fz zV{q**AuE}dmbbPV+t6aMctceCfwhCAsp>5g8OZ1JtGl28ezEwSiJU$tu&Um2n{T9V zs{3p1yD$u&7MK?}eh0u6$z;y#1VWuv7X-ogiRwvH4OKO%6_dsTX8ui*$7=zhi5LFI zrP3oYoHLODC-P8AXvI|LGcY++EdG|J*$`T7<#PEkQSC+K7|^D$mVu?%Y%vIeUz+`w Z`430ect*Ju4^jXC002ovPDHLkV1l;t-U9#t diff --git a/lib/components/NeonFooter/images/social--twitter.png b/lib/components/NeonFooter/images/social--twitter.png deleted file mode 100644 index 7c786c84dcd3f030f46c569c3f39df9f04a82546..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 992 zcmV<610Vc}P)@;vXafuUg-9s+O+W8=gqA8N$c7OmN zBKHHREG;b^?#i_XVHh4F8LH~gc7Pqa0pOYT8MmO#HT((NoMA7KT+3uK2R7HZ_4hV6 z&5i>BKvjn~Ha6bdj0I>Ni(j#|UAk3~-+u>xm<44%ubWs*vvVO^F^nBa&l6e_3rL5f#FJ} zvR|8bX`;;Rxj2r83WY+wSS-Hiy6!_}_A-Fa>h*fpY)Ixs zsp^UVK($(3O=-{o&;aoM`uh4i<#M^vo|vDX&$+I9Rz#ldSHR5bwOVaB)1-d|;Pp-u z$?GEWsfhfjsuj=kx|Sl2%LCL2wLc8=>pEZv*(_|Dcgv z%Vx80ZpJO>`1tr0RV|aew!_Suj^j)h3Wa(X6aYNW`%XlT>>&82nN9n?|4sYDp64!# zqNmJk4#0!k0A3c6qn$t?Vb}S-|Gn$F2XX6SZ}jr?5t}XWv0gx6fH(YVwfeBC9>=Xl z|3D&%ToaKw5&1X>g5UbpOog^9j^js3j*{G`s=Lgr^(_+w!7qb;%lr#+w|xQy^~5>= O0000^@R7i=nmQRQrRS<{2s_tE64}!V4 zxY2_Mn!qL?f{?Qa;z3<8?p2cQ?wLdqK?0(8iPxP!-P7a2+Y&|MMHCUiQ$p~vi=qLM zun9>(5HAzO?kW%2S!ZWvcYDUo@Am4ws_(tm)m2ZZD0i1U&yRXhEV}9fFemQ!aK9;G zxUsUb@{@>ol~}Uhg1pgq%ERz1@Fp<7+d4D5D{x7|un|Sk^{JqFo*(j}xM=QgscNv_ z<_7uh{t2oV;yC`jGBnGw6XJdeSeO7dgtptJx|}4*_xnQAG<_Mf&s6oHse%9LZx>mP z>uN z`U8RczeTC~^MqMCsSMR4Q50Pd0Xz)PDvSW#y%V^v{$(~c^~Y&;cJ^T}%bJLsADU9i z@(ge;ba%Ae%@`hp5C1)&U674T!H-OjtKtB+Onb68MdZW<_nss@Ohwwak9vMiga=r*T7Z(1l|xOWYn zjpO*AiaxzCfSZ+?;0VsXGSv%7t+p|Vn~Q9Qh5JSzqs>Mk95IUAHCPYa-(9KKzu7am zdnjY#24%S}0G%|w%}|4O_##e{S0_2epgQgLmx#PHWWE(8$>DHoS8Kx+MBtSyO}nDn z04i4`GkZkgJTMFd_chqMLKkVc+1talSKt(8r>X*Bpo5I6APAbu7x+}*@u_)mW9x+1hUdm6TaqMKOS9u{mYP{PA+K=vridIL z2ZRbQ{Eu6$Ckr^^BFieWS2wwZ`x-&e>}Tn2+7~*gEX$q|vtx)H=6-kTxyWWvmg}eM d^YT?~O2`++DIPJLc{)z_f@=0uS8% zcM-W2$MH`h;-kcpy%x0F?PtyGyqUeJs#Cixz3=W<+m*4|mD)?6TCLVK5jov&GqZbXnjVU>EIU>J#NEFu2=tMN%!+gWCokf~x9NqtQ63-CA0tyudaC)ZP7h2;r*`!gISoi~JFh9`TF(0oDbe*=%kOHfVSMre3cPb%;?F zLiiSVX~29pNs_}6fU2%AP(eiGl@P+RsxDHZB5iGLJ)x=>3V;AB@ZS+E0`D?h3eTF^ z*-?Q2l}d5>HnZH!mY~~Zk|g;RSS}O1tW@>$g@uLRdQgCBwfX_D@qYl#?2egT>b=0u z!`$55pQ`$XnLRjQW(RmZP1C=Ipa8X6?YfA(c7WiHh@4K-^k%=YuqtF(_M*FA1&)kM zGqXGVyThAYX0!Q>s-6SR0K0XQyTD4G z=Sw?T`Y4quy6txRc{4k1W`|XE(#$%lx&f>wN%G66asB}=SvcP+3l>QL00008U}fi7AzZCsS=07?_naLn2Bde0{8v^K*7iAWdWaj57fJ{tG z$}cUkRRX#c;)UD-xUqS~&|m@vn0`fKfxe-h0mw@*g}%P{mFDKcRTq~8r6Sym)!^cg z%7Rq=pw#00(xPNw#HA^NtSYc_E=o--$uA1Y&(DE{Vn9ZINq%ugeu09svx0_iVsd64 zh_4CO;OlGUnO9trn3tUD>0+w{G(s;kGsVi;(#gf#$;rgY(9OWm(AC(|*x1F%%@9bN znVGscS-|wVdBEge1WeZpwtQw}U|2n zn?_fQ`im~q_+S5N|H-?|eu1F`@1;XJN`Kj|u=hH&DA~FP?tQq`XLe`;^9kl@O>GYh z^KVp$uqTzCJDR@ZU4vQAqTYpb7bt14uglEqdUiRNr zWYp|VXKm^JB9XO^qNL}=yQQT+o{{-j(AJV|Uqj^r%@a-TSMEqk_kYs7^H9i8c?N60 z-=h~>4UeSHZ>mjLYItA%OcBpjX6-3^MGt&tXglQ=5hKRa_<^LTA`r52^(4 zim+w><>_U;dXS@lMP$N++l@^zZ^{!k2H8h)x;gTFF+Q^CA@kiY{ofim7Z|5LG8Nf( zucFf}+jGG=4c=`{t_u1QD<)Mp#ZQj@p?-R`l;69RDI4teGR#*=3cIoD;HQkXxV|aZ zYyL@EtoqIV<>bkOht8YMTs!Hai{RsK?w)kLX2!fv9S0+Le`)DzbXqNF&Jwg;^U_Q) z|HK3L+GiQH&&n!m&%0&Ehptu*+5Np~-l@Yn(w%<-os6=sn{E%CYJB_HVhztHoGWxJ z%BN3N@DVSby3pLQQuZ%9_dn&A-Magx?mAJ+HLJ}iMDM&|PuB?rgLCHvqD!*hGVW>$ ze_)WouVGVZFHbgxf81IO4LhXDnVNkXdp^V>{E(JJe6(cPFG#OTenuco_s6i>eX{gIwwAyy4P`A)j};@ncr7k)_)2%x$ge-d(MWI z6sBuzyebnbawksaQT#mJF>X8O$(WZ**d{FGux{SZC6v2GY_;66efvFkiyz-yus!Ot z=B$se^6i#3`bSykE#9jBO6jQxNB_0H)^%%oU5r9k=Vxzz+M~M7UUAXXlX7o6&s=;q bpMjZy`J+>; -import React from "react"; diff --git a/lib/components/NeonHeader/NeonLegacyHeader.js b/lib/components/NeonHeader/NeonLegacyHeader.js deleted file mode 100644 index 1de58a84..00000000 --- a/lib/components/NeonHeader/NeonLegacyHeader.js +++ /dev/null @@ -1,72 +0,0 @@ -"use strict"; - -function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = void 0; - -var _react = _interopRequireWildcard(require("react")); - -var _propTypes = _interopRequireDefault(require("prop-types")); - -var _styles = require("@material-ui/core/styles"); - -var _Divider = _interopRequireDefault(require("@material-ui/core/Divider")); - -var _NeonUtilityBar = _interopRequireDefault(require("../NeonUtilityBar/NeonUtilityBar")); - -var _NeonMenu = _interopRequireDefault(require("../NeonMenu/NeonMenu")); - -var _NeonEnvironment = _interopRequireDefault(require("../NeonEnvironment/NeonEnvironment")); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; } - -function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; } - -function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } - -var useStyles = (0, _styles.makeStyles)(function () { - return { - root: { - flexGrow: 1, - boxShadow: '0px 1px 3px rgba(0, 0, 0, 0.25), 0px 1px 1px rgba(0, 0, 0, 0.25)', - zIndex: 2000 - } - }; -}); -var NeonHeader = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) { - var classes = useStyles(); - var notifications = props.notifications, - onShowNotifications = props.onShowNotifications; - var notificationsProps = typeof onShowNotifications === 'function' ? { - notifications: notifications, - onShowNotifications: onShowNotifications - } : {}; - return /*#__PURE__*/_react.default.createElement("div", { - ref: ref, - className: classes.root, - "data-selenium": "neon-header" - }, /*#__PURE__*/_react.default.createElement(_NeonUtilityBar.default, null), /*#__PURE__*/_react.default.createElement(_NeonMenu.default, _extends({ - loginPath: _NeonEnvironment.default.getFullAuthPath('login'), - logoutPath: _NeonEnvironment.default.getFullAuthPath('logout'), - accountPath: _NeonEnvironment.default.route.buildAccountRoute() - }, notificationsProps)), /*#__PURE__*/_react.default.createElement(_Divider.default, null)); -}); -NeonHeader.propTypes = { - notifications: _propTypes.default.arrayOf(_propTypes.default.shape({ - id: _propTypes.default.string.isRequired, - message: _propTypes.default.string.isRequired, - dismissed: _propTypes.default.bool.isRequired - })), - onShowNotifications: _propTypes.default.func -}; -NeonHeader.defaultProps = { - notifications: [], - onShowNotifications: null -}; -var _default = NeonHeader; -exports.default = _default; \ No newline at end of file diff --git a/lib/components/NeonJsonLd/NeonJsonLd.d.ts b/lib/components/NeonJsonLd/NeonJsonLd.d.ts index f8307813..6e388fbd 100644 --- a/lib/components/NeonJsonLd/NeonJsonLd.d.ts +++ b/lib/components/NeonJsonLd/NeonJsonLd.d.ts @@ -6,8 +6,11 @@ declare namespace NeonJsonLd { export function getProductJsonLdObservable(productCode: string, release: string): import("rxjs").Observable; export function inject(data: Object | null | undefined, injectReleaseMeta?: boolean): void; export function injectReleaseMeta(data: Object | null | undefined): void; + export function removeAllMetadata(): void; + export function removeJsonLdScript(): void; export function removeReleaseMeta(): void; export function getJsonLdWithInjection(url: string, injectReleaseMeta?: boolean): void; export function injectRepo(): void; export function injectProduct(productCode: string, release: string, injectReleaseMeta?: boolean, onNotExistsOnly?: boolean): void | null; + export function injectPrototypeDataset(uuid: string, onNotExistsOnly?: boolean): void | null; } diff --git a/lib/components/NeonJsonLd/NeonJsonLd.js b/lib/components/NeonJsonLd/NeonJsonLd.js index ec159273..ae8d52de 100644 --- a/lib/components/NeonJsonLd/NeonJsonLd.js +++ b/lib/components/NeonJsonLd/NeonJsonLd.js @@ -64,16 +64,7 @@ var NeonJsonLd = { inject: function inject(data) { var injectReleaseMeta = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; if (!data) return; - - try { - var existingBlock = document.head.querySelector('script[type="application/ld+json"]'); - - if (typeof existingBlock !== 'undefined' && existingBlock !== null) { - existingBlock.remove(); - } - } catch (e) { - console.error(e); // eslint-disable-line no-console - } + NeonJsonLd.removeJsonLdScript(); if (injectReleaseMeta) { NeonJsonLd.injectReleaseMeta(data); @@ -148,6 +139,29 @@ var NeonJsonLd = { } }, + /** + * Removes all JSON-LD based metadata + */ + removeAllMetadata: function removeAllMetadata() { + NeonJsonLd.removeJsonLdScript(); + NeonJsonLd.removeReleaseMeta(); + }, + + /** + * Removes the JDON-LD script block when present + */ + removeJsonLdScript: function removeJsonLdScript() { + try { + var existingBlock = document.head.querySelector('script[type="application/ld+json"]'); + + if (typeof existingBlock !== 'undefined' && existingBlock !== null) { + existingBlock.remove(); + } + } catch (e) { + console.error(e); // eslint-disable-line no-console + } + }, + /** * Removes the release meta tags from the DOM head element when exists. */ @@ -237,6 +251,34 @@ var NeonJsonLd = { NeonJsonLd.removeReleaseMeta(); return NeonJsonLd.getJsonLdWithInjection("".concat(_NeonEnvironment.default.getFullJsonLdApiPath('products'), "/").concat(productCode)); + }, + + /** + * Fetches and injects the prototype dataset JSON-LD based on the specified UUID. + * @param {string} uuid The dataset UUID to query with. + * @param {boolean} onNotExistsOnly Inject only if JSON-LD is not already injected + */ + injectPrototypeDataset: function injectPrototypeDataset(uuid) { + var onNotExistsOnly = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; + var shouldFetch = true; + + if (onNotExistsOnly) { + try { + var existingBlock = document.head.querySelector('script[type="application/ld+json"]'); + + if (typeof existingBlock !== 'undefined' && existingBlock !== null) { + shouldFetch = false; + } + } catch (e) { + console.error(e); // eslint-disable-line no-console + } + } + + if (!shouldFetch) { + return null; + } + + return NeonJsonLd.getJsonLdWithInjection("".concat(_NeonEnvironment.default.getFullJsonLdApiPath('prototype'), "/datasets/").concat(uuid), true); } }; Object.freeze(NeonJsonLd); diff --git a/lib/components/NeonMenu/NeonDrawerMenu.d.ts b/lib/components/NeonMenu/NeonDrawerMenu.d.ts deleted file mode 100644 index a78a6540..00000000 --- a/lib/components/NeonMenu/NeonDrawerMenu.d.ts +++ /dev/null @@ -1,12 +0,0 @@ -export default NeonDrawerMenu; -declare function NeonDrawerMenu(props: any): JSX.Element; -declare namespace NeonDrawerMenu { - export namespace propTypes { - export const items: PropTypes.Validator<(PropTypes.InferProps<{ - name: PropTypes.Validator; - url: PropTypes.Validator; - children: PropTypes.Requireable; - }> | null | undefined)[]>; - } -} -import PropTypes from "prop-types"; diff --git a/lib/components/NeonMenu/NeonDrawerMenu.js b/lib/components/NeonMenu/NeonDrawerMenu.js deleted file mode 100644 index d5ee5008..00000000 --- a/lib/components/NeonMenu/NeonDrawerMenu.js +++ /dev/null @@ -1,219 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = void 0; - -var _react = _interopRequireDefault(require("react")); - -var _propTypes = _interopRequireDefault(require("prop-types")); - -var _styles = require("@material-ui/core/styles"); - -var _List = _interopRequireDefault(require("@material-ui/core/List")); - -var _ListItem = _interopRequireDefault(require("@material-ui/core/ListItem")); - -var _ListItemIcon = _interopRequireDefault(require("@material-ui/core/ListItemIcon")); - -var _ListItemText = _interopRequireDefault(require("@material-ui/core/ListItemText")); - -var _Collapse = _interopRequireDefault(require("@material-ui/core/Collapse")); - -var _HomeOutlined = _interopRequireDefault(require("@material-ui/icons/HomeOutlined")); - -var _ExpandLess = _interopRequireDefault(require("@material-ui/icons/ExpandLess")); - -var _ExpandMore = _interopRequireDefault(require("@material-ui/icons/ExpandMore")); - -var _SaveAlt = _interopRequireDefault(require("@material-ui/icons/SaveAlt")); - -var _InfoOutlined = _interopRequireDefault(require("@material-ui/icons/InfoOutlined")); - -var _LiveHelpOutlined = _interopRequireDefault(require("@material-ui/icons/LiveHelpOutlined")); - -var _ListAltOutlined = _interopRequireDefault(require("@material-ui/icons/ListAltOutlined")); - -var _PersonOutline = _interopRequireDefault(require("@material-ui/icons/PersonOutline")); - -var _Theme = _interopRequireDefault(require("../Theme/Theme")); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } - -function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } - -function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); } - -function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } - -function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } - -function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; } - -function _iterableToArrayLimit(arr, i) { if (typeof Symbol === "undefined" || !(Symbol.iterator in Object(arr))) return; var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } - -function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } - -var menuItemIconMap = { - Home: /*#__PURE__*/_react.default.createElement(_HomeOutlined.default, null), - About: /*#__PURE__*/_react.default.createElement(_InfoOutlined.default, null), - 'Download Data': /*#__PURE__*/_react.default.createElement(_SaveAlt.default, null), - Resources: /*#__PURE__*/_react.default.createElement(_ListAltOutlined.default, null), - 'Contact Us': /*#__PURE__*/_react.default.createElement(_LiveHelpOutlined.default, null), - 'My Datasets': /*#__PURE__*/_react.default.createElement(_PersonOutline.default, null) -}; -var domParser = new DOMParser(); - -var decodeName = function decodeName(name) { - return domParser.parseFromString(name, 'text/html').documentElement.textContent; -}; - -var useStyles = (0, _styles.makeStyles)(function (theme) { - return { - root: { - width: '100%', - maxWidth: 360, - backgroundColor: theme.palette.background.paper - }, - listItemIcon: { - minWidth: theme.spacing(5) - }, - listItemText: { - paddingRight: theme.spacing(4) - } - }; -}); - -var NeonDrawerMenu = function NeonDrawerMenu(props) { - var classes = useStyles(_Theme.default); - var items = props.items; // Menu items need a unique identifier so we can map their - // open states, if they have children. One isn't discretely - // provided so the function can be used to make one. - - var getMenuId = function getMenuId(item) { - return "".concat(item.name, "|").concat(item.url); - }; - - var initialState = items.reduce(function (acc, cur) { - if (cur.children.length) { - acc[getMenuId(cur)] = false; - } - - return acc; - }, {}); - - var _React$useState = _react.default.useState(initialState), - _React$useState2 = _slicedToArray(_React$useState, 2), - open = _React$useState2[0], - setOpen = _React$useState2[1]; - - var handleClick = function handleClick(id) { - setOpen(_extends({}, open, _defineProperty({}, id, !open[id]))); - }; - - var renderMenuItem = function renderMenuItem(item) { - var nesting = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0; - - if (item.url === '/home') { - return null; - } - - var id = getMenuId(item); - var listItemIcon = menuItemIconMap[item.name] ? /*#__PURE__*/_react.default.createElement(_ListItemIcon.default, { - className: classes.listItemIcon - }, menuItemIconMap[item.name]) : null; - var expandIcon = null; - var collapse = null; - var listItemProps = { - component: 'a', - href: item.url, - onClick: null - }; - var seleniumKey = item.name.toLowerCase().replace(/[^a-z0-9-]/g, '-'); - - if (item.children.length) { - // Throw out the item's URL. - // - // Sometimes we have items that have children that also are supposed to have - // a working URL. In Liferay menus all items have URLs whether they're links - // or not, but if an item has children and isContainer is true then we treat - // the menu item as "only a container" and don't wire up an tag. - // - // But for a small viewport menu like this that's not workable. Phones and - // tablets don't have hover states. A "parent" menu item MUST be ONLY a menu - // item and NOT a link, since the click is the only interaction and it must - // be used for expand/collapse. Thus, if this item has children, don't ever - // allow it to be a link here in the drawer menu for small viewports. - listItemProps.href = null; - listItemProps.component = 'div'; - - listItemProps.onClick = function () { - return handleClick(id); - }; - - expandIcon = open[id] ? /*#__PURE__*/_react.default.createElement(_ExpandLess.default, null) : /*#__PURE__*/_react.default.createElement(_ExpandMore.default, null); - collapse = /*#__PURE__*/_react.default.createElement(_Collapse.default, { - in: open[id], - timeout: "auto", - unmountOnExit: true - }, /*#__PURE__*/_react.default.createElement(_List.default, { - "data-selenium": "neon-drawer-menu.submenu.".concat(seleniumKey), - component: "div", - disablePadding: true - }, item.children.map(function (child) { - return renderMenuItem(child, nesting + 1); - }))); - } - - return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, { - key: id - }, /*#__PURE__*/_react.default.createElement(_ListItem.default, _extends({ - button: true, - "data-selenium": "neon-drawer-menu.link.".concat(seleniumKey), - style: { - paddingLeft: _Theme.default.spacing(2 + nesting * 3) - } - }, listItemProps), listItemIcon, /*#__PURE__*/_react.default.createElement(_ListItemText.default, { - primary: decodeName(item.name), - className: classes.listItemText - }), expandIcon), collapse); - }; - - return /*#__PURE__*/_react.default.createElement(_List.default, { - component: "nav", - className: classes.root - }, renderMenuItem({ - name: 'Home', - url: '/', - children: [] - }), items.map(function (item) { - return renderMenuItem(item); - })); -}; // for nested proptypes - - -function lazyFunction(f) { - // eslint-disable-next-line func-names - return function () { - // eslint-disable-next-line prefer-rest-params - return f().apply(this, arguments); - }; -} - -var itemShape; // eslint-disable-next-line prefer-const - -itemShape = _propTypes.default.shape({ - name: _propTypes.default.string.isRequired, - url: _propTypes.default.string.isRequired, - children: _propTypes.default.arrayOf(lazyFunction(function () { - return itemShape; - })) -}); -NeonDrawerMenu.propTypes = { - items: _propTypes.default.arrayOf(itemShape).isRequired -}; -var _default = NeonDrawerMenu; -exports.default = _default; \ No newline at end of file diff --git a/lib/components/NeonMenu/NeonMenu.css b/lib/components/NeonMenu/NeonMenu.css deleted file mode 100644 index da6b8c89..00000000 --- a/lib/components/NeonMenu/NeonMenu.css +++ /dev/null @@ -1,472 +0,0 @@ -.neon-menu__container { - display: -ms-flexbox; - display: flex; - -ms-flex-direction: row; - flex-direction: row; - height: auto; - width: 100%; - z-index: 100; - margin: 0 auto; - background-color: #ffffff; - -webkit-box-sizing: border-box; - box-sizing: border-box; -} - -.neon-menu__nochild { - margin-top: .5em !important; -} - -.rc-menu-item-active.neon-menu__nochild { - background-color: #002c77 !important; -} - -.neon-menu__logo { - box-sizing: content-box; - display: inline-flex; - vertical-align: middle; - width: auto; - padding: 0.5em 1em; - height: 4em; - background-color: transparent; -} - -@media (max-width: 959px) { - .neon-menu__logo { - height: 3.5em; - padding: 0.5em; - } -} - -.neon-menu__item--relative { - position: relative; - top: 8px; -} - -.neon-menu__auth { - display: flex; - align-items: center; - justify-content: flex-end; - padding: 0.5em 2em; -} - -.neon-menu__header-container { - display: flex; - justify-content: flex-start; - align-items: center; -} - -.neon-menu__drawer-header-container { - display: flex; - justify-content: space-around; - padding: 0px 8px; - background-color: #f3f5f5; -} - -li.rc-menu-item a { - text-decoration-line: none !important; - display: block; - white-space: nowrap; - padding: 8px 9px; -} - -li.rc-menu-item a, -li.rc-menu-item a:hover { - color: rgba(0, 0, 0, 0.87) !important; -} - -li.rc-menu-item-active a, -li.rc-menu-item a:hover, -li.rc-menu-item-active a:hover { - color: white !important; -} - -.rc-menu li.rc-menu-submenu ul.rc-menu-sub li.rc-menu-submenu a { - text-decoration: none !important; - color: rgba(0, 0, 0, 0.87) !important; - display: block; - white-space: nowrap; - padding: 12px 30px 12px 24px; -} -.rc-menu li.rc-menu-submenu ul.rc-menu-sub li.rc-menu-submenu a:hover { - color: #fff !important; -} -.rc-menu li.rc-menu-submenu-active ul.rc-menu-sub li.rc-menu-submenu-active .rc-menu-submenu-title a { - color: #fff !important; - display: block; - white-space: nowrap; - padding: 12px 30px 12px 24px; -} -.rc-menu li.rc-menu-submenu-active ul.rc-menu-sub li.rc-menu-submenu-active ul.rc-menu-sub li.rc-menu-item-active a { - color: #fff !important; -} - -.rc-menu-sub li.rc-menu-item a, -.rc-menu-sub li.rc-menu-submenu div { - padding: 12px 30px 12px 24px; -} - -/*imported from rc-menu*/ - -.rc-menu { - outline: none; - margin-bottom: 0; - margin-top: 0; - padding-left: 0; - list-style: none; - z-index: 3; - border: 1px solid #cccece; - /* box-shadow: 0 0 4px #d9d9d9; */ - /* border-radius: 3px; */ - /* border-radius: 5px; */ - color: rgba(0, 0, 0, 0.87); - -webkit-margin-before: 0; - -webkit-margin-after: 0; - font-family: "Source Sans Pro", Helvetica, Arial, sans-serif; - font-size: 16px; - font-weight: 600; - font-style: normal; - text-transform: uppercase; - box-shadow: 0px 2px 4px -1px rgba(0,0,0,0.2), 0px 4px 5px 0px rgba(0,0,0,0.14), 0px 1px 10px 0px rgba(0,0,0,0.12); -} -.rc-menu-hidden { - display: none; -} -.rc-menu-collapse { - overflow: hidden; -} -.rc-menu-collapse-active { - transition: height 0.3s ease-out; -} -.rc-menu-item-group-list { - margin: 0; - padding: 0; -} -.rc-menu-item-group-title { - color: #898c8d; - line-height: 1.5; - padding: 8px 6px; - border-bottom: 1px solid #cccece; -} -.rc-menu-item-active, -.rc-menu-submenu-active > .rc-menu-submenu-title { - /* background-color: #eaf8fe; */ - background-color: #002c77; - color: white; -} -.rc-menu-item-selected { - -webkit-transform: translateZ(0); - transform: translateZ(0); -} -.rc-menu > li.rc-menu-submenu { - padding: 0; -} -.rc-menu > .rc-menu-sub > li.rc-menu-submenu { - padding: 0; -} -.rc-menu > li.rc-menu-submenu > ul.rc-menu-sub > li.rc-menu-submenu { - margin-top: 0; -} -.rc-menu-submenu-horizontal > .rc-menu { - top: 100%; - left: 0; - position: absolute; - min-width: 160px; - margin-top: 4px; -} -.rc-menu-submenu-vertical > .rc-menu { - top: 0; - left: 100%; - position: absolute; - min-width: 160px; - margin-left: 4px; -} -.rc-menu-item, -.rc-menu-submenu-title { - margin: 0; - position: relative; -} -.rc-menu-item.rc-menu-item-disabled, -.rc-menu-submenu-title.rc-menu-item-disabled, -.rc-menu-item.rc-menu-submenu-disabled, -.rc-menu-submenu-title.rc-menu-submenu-disabled { - color: #777 !important; -} -.rc-menu > .rc-menu-item-divider { - height: 1px; - margin: 1px 0; - overflow: hidden; - padding: 0; - line-height: 0; - background-color: #cccece; -} -.rc-menu-submenu { - position: relative; -} -.rc-menu-submenu > .rc-menu { - background-color: #f3f5f5; -} -.rc-menu .rc-menu-submenu-title .anticon, -.rc-menu .rc-menu-item .anticon { - width: 14px; - height: 14px; - margin-right: 8px; - top: -1px; -} -.rc-menu-horizontal { - border: none; - box-shadow: none; -} -.rc-menu-submenu-title { - cursor: default; - padding: 8px 9px; -} -.rc-menu-horizontal > .rc-menu-submenu, -.rc-menu-horizontal > .rc-menu-item { - float: left; -} -.rc-menu-horizontal:after { - content: "\20"; - display: block; - height: 0; - clear: both; -} -.rc-menu-vertical, -.rc-menu-inline { - padding: 12px 0; - z-index: 99999; -} -.rc-menu-vertical .rc-menu-submenu-arrow, -.rc-menu-inline .rc-menu-submenu-arrow { - display: inline-block; - font: normal normal normal 14px/1 FontAwesome; - font-size: inherit; - vertical-align: baseline; - text-align: center; - text-transform: none; - text-rendering: auto; - position: absolute; - right: 16px; - line-height: 1.5em; -} -.rc-menu-vertical .rc-menu-submenu-arrow:before, -.rc-menu-inline .rc-menu-submenu-arrow:before { - content: "\f0da"; -} -.rc-menu-inline .rc-menu-submenu-arrow { - -webkit-transform: rotate(90deg); - transform: rotate(90deg); - transition: -webkit-transform 0.3s; - transition: transform 0.3s; - transition: transform 0.3s, -webkit-transform 0.3s; -} -.rc-menu-inline - .rc-menu-submenu-open - > .rc-menu-submenu-title - .rc-menu-submenu-arrow { - -webkit-transform: rotate(-90deg); - transform: rotate(-90deg); -} -.rc-menu-vertical.rc-menu-sub { - padding: 0; -} -.rc-menu-sub.rc-menu-inline { - padding: 0; - border: none; - border-radius: 0; - box-shadow: none; -} -.rc-menu-sub.rc-menu-inline > .rc-menu-item, -.rc-menu-sub.rc-menu-inline > .rc-menu-submenu > .rc-menu-submenu-title { - padding-top: 8px; - padding-bottom: 8px; - padding-right: 0; -} -.rc-menu-open-slide-up-enter, -.rc-menu-open-slide-up-appear { - -webkit-animation-duration: 0.3s; - animation-duration: 0.3s; - -webkit-animation-fill-mode: both; - animation-fill-mode: both; - -webkit-transform-origin: 0 0; - transform-origin: 0 0; - opacity: 0; - -webkit-animation-timing-function: cubic-bezier(0.08, 0.82, 0.17, 1); - animation-timing-function: cubic-bezier(0.08, 0.82, 0.17, 1); - -webkit-animation-play-state: paused; - animation-play-state: paused; -} -.rc-menu-open-slide-up-leave { - -webkit-animation-duration: 0.3s; - animation-duration: 0.3s; - -webkit-animation-fill-mode: both; - animation-fill-mode: both; - -webkit-transform-origin: 0 0; - transform-origin: 0 0; - opacity: 1; - -webkit-animation-timing-function: cubic-bezier(0.6, 0.04, 0.98, 0.34); - animation-timing-function: cubic-bezier(0.6, 0.04, 0.98, 0.34); - -webkit-animation-play-state: paused; - animation-play-state: paused; -} -.rc-menu-open-slide-up-enter.rc-menu-open-slide-up-enter-active, -.rc-menu-open-slide-up-appear.rc-menu-open-slide-up-appear-active { - -webkit-animation-name: rcMenuOpenSlideUpIn; - animation-name: rcMenuOpenSlideUpIn; - -webkit-animation-play-state: running; - animation-play-state: running; -} -.rc-menu-open-slide-up-leave.rc-menu-open-slide-up-leave-active { - -webkit-animation-name: rcMenuOpenSlideUpOut; - animation-name: rcMenuOpenSlideUpOut; - -webkit-animation-play-state: running; - animation-play-state: running; -} -@-webkit-keyframes rcMenuOpenSlideUpIn { - 0% { - opacity: 0; - -webkit-transform-origin: 0% 0%; - transform-origin: 0% 0%; - -webkit-transform: scaleY(0); - transform: scaleY(0); - } - 100% { - opacity: 1; - -webkit-transform-origin: 0% 0%; - transform-origin: 0% 0%; - -webkit-transform: scaleY(1); - transform: scaleY(1); - } -} -@keyframes rcMenuOpenSlideUpIn { - 0% { - opacity: 0; - -webkit-transform-origin: 0% 0%; - transform-origin: 0% 0%; - -webkit-transform: scaleY(0); - transform: scaleY(0); - } - 100% { - opacity: 1; - -webkit-transform-origin: 0% 0%; - transform-origin: 0% 0%; - -webkit-transform: scaleY(1); - transform: scaleY(1); - } -} -@-webkit-keyframes rcMenuOpenSlideUpOut { - 0% { - opacity: 1; - -webkit-transform-origin: 0% 0%; - transform-origin: 0% 0%; - -webkit-transform: scaleY(1); - transform: scaleY(1); - } - 100% { - opacity: 0; - -webkit-transform-origin: 0% 0%; - transform-origin: 0% 0%; - -webkit-transform: scaleY(0); - transform: scaleY(0); - } -} -@keyframes rcMenuOpenSlideUpOut { - 0% { - opacity: 1; - -webkit-transform-origin: 0% 0%; - transform-origin: 0% 0%; - -webkit-transform: scaleY(1); - transform: scaleY(1); - } - 100% { - opacity: 0; - -webkit-transform-origin: 0% 0%; - transform-origin: 0% 0%; - -webkit-transform: scaleY(0); - transform: scaleY(0); - } -} -.rc-menu-open-zoom-enter, -.rc-menu-open-zoom-appear { - opacity: 0; - -webkit-animation-duration: 0.3s; - animation-duration: 0.3s; - -webkit-animation-fill-mode: both; - animation-fill-mode: both; - -webkit-transform-origin: 0 0; - transform-origin: 0 0; - -webkit-animation-timing-function: cubic-bezier(0.08, 0.82, 0.17, 1); - animation-timing-function: cubic-bezier(0.08, 0.82, 0.17, 1); - -webkit-animation-play-state: paused; - animation-play-state: paused; -} -.rc-menu-open-zoom-leave { - -webkit-animation-duration: 0.3s; - animation-duration: 0.3s; - -webkit-animation-fill-mode: both; - animation-fill-mode: both; - -webkit-transform-origin: 0 0; - transform-origin: 0 0; - -webkit-animation-timing-function: cubic-bezier(0.6, 0.04, 0.98, 0.34); - animation-timing-function: cubic-bezier(0.6, 0.04, 0.98, 0.34); - -webkit-animation-play-state: paused; - animation-play-state: paused; -} -.rc-menu-open-zoom-enter.rc-menu-open-zoom-enter-active, -.rc-menu-open-zoom-appear.rc-menu-open-zoom-appear-active { - -webkit-animation-name: rcMenuOpenZoomIn; - animation-name: rcMenuOpenZoomIn; - -webkit-animation-play-state: running; - animation-play-state: running; -} -.rc-menu-open-zoom-leave.rc-menu-open-zoom-leave-active { - -webkit-animation-name: rcMenuOpenZoomOut; - animation-name: rcMenuOpenZoomOut; - -webkit-animation-play-state: running; - animation-play-state: running; -} -@-webkit-keyframes rcMenuOpenZoomIn { - 0% { - opacity: 0; - -webkit-transform: scale(0, 0); - transform: scale(0, 0); - } - 100% { - opacity: 1; - -webkit-transform: scale(1, 1); - transform: scale(1, 1); - } -} -@keyframes rcMenuOpenZoomIn { - 0% { - opacity: 0; - -webkit-transform: scale(0, 0); - transform: scale(0, 0); - } - 100% { - opacity: 1; - -webkit-transform: scale(1, 1); - transform: scale(1, 1); - } -} -@-webkit-keyframes rcMenuOpenZoomOut { - 0% { - -webkit-transform: scale(1, 1); - transform: scale(1, 1); - } - 100% { - opacity: 0; - -webkit-transform: scale(0, 0); - transform: scale(0, 0); - } -} -@keyframes rcMenuOpenZoomOut { - 0% { - -webkit-transform: scale(1, 1); - transform: scale(1, 1); - } - 100% { - opacity: 0; - -webkit-transform: scale(0, 0); - transform: scale(0, 0); - } -} diff --git a/lib/components/NeonMenu/NeonMenu.d.ts b/lib/components/NeonMenu/NeonMenu.d.ts deleted file mode 100644 index 7d085fca..00000000 --- a/lib/components/NeonMenu/NeonMenu.d.ts +++ /dev/null @@ -1,28 +0,0 @@ -export default NeonMenu; -declare function NeonMenu(props: any): JSX.Element; -declare namespace NeonMenu { - export namespace propTypes { - export const loginPath: PropTypes.Requireable; - export const logoutPath: PropTypes.Requireable; - export const accountPath: PropTypes.Requireable; - export const notifications: PropTypes.Requireable<(PropTypes.InferProps<{ - id: PropTypes.Validator; - message: PropTypes.Validator; - dismissed: PropTypes.Validator; - }> | null | undefined)[]>; - export const onShowNotifications: PropTypes.Requireable<(...args: any[]) => any>; - } - export namespace defaultProps { - const loginPath_1: string; - export { loginPath_1 as loginPath }; - const logoutPath_1: string; - export { logoutPath_1 as logoutPath }; - const accountPath_1: string; - export { accountPath_1 as accountPath }; - const notifications_1: never[]; - export { notifications_1 as notifications }; - const onShowNotifications_1: null; - export { onShowNotifications_1 as onShowNotifications }; - } -} -import PropTypes from "prop-types"; diff --git a/lib/components/NeonMenu/NeonMenu.js b/lib/components/NeonMenu/NeonMenu.js deleted file mode 100644 index 374108f3..00000000 --- a/lib/components/NeonMenu/NeonMenu.js +++ /dev/null @@ -1,330 +0,0 @@ -"use strict"; - -function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = void 0; - -var _react = _interopRequireWildcard(require("react")); - -var _propTypes = _interopRequireDefault(require("prop-types")); - -var _rcMenu = _interopRequireWildcard(require("rc-menu")); - -var _rxjs = require("rxjs"); - -var _get = _interopRequireDefault(require("lodash/get")); - -var _Grid = _interopRequireDefault(require("@material-ui/core/Grid")); - -var _Hidden = _interopRequireDefault(require("@material-ui/core/Hidden")); - -var _IconButton = _interopRequireDefault(require("@material-ui/core/IconButton")); - -var _Drawer = _interopRequireDefault(require("@material-ui/core/Drawer")); - -var _Divider = _interopRequireDefault(require("@material-ui/core/Divider")); - -var _CircularProgress = _interopRequireDefault(require("@material-ui/core/CircularProgress")); - -var _Menu = _interopRequireDefault(require("@material-ui/icons/Menu")); - -var _ChevronLeft = _interopRequireDefault(require("@material-ui/icons/ChevronLeft")); - -var _Home = _interopRequireDefault(require("@material-ui/icons/Home")); - -var _Notifications = _interopRequireDefault(require("@material-ui/icons/Notifications")); - -var _NeonApi = _interopRequireDefault(require("../NeonApi/NeonApi")); - -var _NeonAuth = _interopRequireWildcard(require("../NeonAuth/NeonAuth")); - -var _NeonDrawerMenu = _interopRequireDefault(require("./NeonDrawerMenu")); - -var _NeonEnvironment = _interopRequireDefault(require("../NeonEnvironment/NeonEnvironment")); - -var _Theme = require("../Theme/Theme"); - -require("./NeonMenu.css"); - -var _NSFNEONLogo = _interopRequireDefault(require("../../images/NSF-NEON-logo.png")); - -var _menuDefaultFallback = _interopRequireDefault(require("./menuDefaultFallback.json")); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; } - -function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; } - -function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); } - -function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } - -function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } - -function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; } - -function _iterableToArrayLimit(arr, i) { if (typeof Symbol === "undefined" || !(Symbol.iterator in Object(arr))) return; var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } - -function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } - -var domParser = new DOMParser(); - -var decodeName = function decodeName(name) { - return domParser.parseFromString(name, 'text/html').documentElement.textContent; -}; -/** - * Generates the specified menu item for rc-menu (NOT material-ui) - * @param {item} object The menu item definition to build from - * @param {index} int The index of the menu item in the collection - * @param {depth} int The relative depth of the menu item (0 is top-level) - * @return The generate menu item JSX.Element - */ - - -var generateRCMenuItem = function generateRCMenuItem(item, index) { - var depth = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0; - - if (item.url === '/home') { - return null; - } - - var childElements = []; - - if (item.children.length > 0) { - childElements = item.children.map(function (childItem, childIndex) { - return generateRCMenuItem(childItem, "".concat(index.toString(), "-").concat(childIndex.toString()), depth + 1); - }); - } - - var key = "".concat(index.toString(), "-1"); - var seleniumKey = item.name.toLowerCase().replace(/[^a-z0-9-]/g, '-'); - - var linkElement = /*#__PURE__*/_react.default.createElement("a", { - href: item.url, - "data-selenium": "neon-menu.link.".concat(seleniumKey) - }, decodeName(item.name)); - - var element = null; - - if (childElements.length > 0) { - // isContainer is a Liferay boolean that means "has children but is not a link" - // Liferay also mandates all menu items have a non-empty url EVEN IF they are not links - // So this bit here updates the href we're actually going to use accordingly. - var titleElement = decodeName(item.name); - - if (!item.isContainer) { - titleElement = linkElement; - } // NOTE: We want to put data-selenium={`neon-menu.submenu.${seleniumKey}`} as a - // prop on this element but unfortunately rc-menu doesn't preserve unsupported - // props as attributes on the final DOM nodes. - - - element = /*#__PURE__*/_react.default.createElement(_rcMenu.SubMenu, { - key: key, - title: titleElement, - className: depth ? null : 'neon-menu__item--relative' - }, childElements); - } else { - element = /*#__PURE__*/_react.default.createElement(_rcMenu.MenuItem, { - key: index, - className: depth ? null : 'neon-menu__item--relative neon-menu__nochild' - }, linkElement); - } - - return element; -}; - -var neonLogo = /*#__PURE__*/_react.default.createElement("img", { - "data-selenium": "neon-menu.logo", - title: "NEON Data Portal", - alt: "NEON Data Portal", - className: "neon-menu__logo", - src: _NSFNEONLogo.default -}); - -var NeonMenu = function NeonMenu(props) { - var loginPath = props.loginPath, - logoutPath = props.logoutPath, - accountPath = props.accountPath, - notifications = props.notifications, - onShowNotifications = props.onShowNotifications; - - var _useState = (0, _react.useState)(false), - _useState2 = _slicedToArray(_useState, 2), - menuFetched = _useState2[0], - setMenuFetched = _useState2[1]; - - var _useState3 = (0, _react.useState)([]), - _useState4 = _slicedToArray(_useState3, 2), - menuItems = _useState4[0], - setMenuItems = _useState4[1]; - - var _useState5 = (0, _react.useState)(false), - _useState6 = _slicedToArray(_useState5, 2), - drawerIsOpen = _useState6[0], - setDrawerIsOpen = _useState6[1]; - - (0, _react.useEffect)(function () { - var cancellationSubject$ = new _rxjs.Subject(); - - _NeonApi.default.getJson(_NeonEnvironment.default.getFullApiPath('menu'), function (response) { - if (cancellationSubject$.closed) return; - setMenuItems((0, _get.default)(response || {}, 'data.menuItems', _menuDefaultFallback.default)); - setMenuFetched(true); - }, function () { - if (cancellationSubject$.closed) return; - setMenuItems(_menuDefaultFallback.default); - setMenuFetched(true); - }, cancellationSubject$); - - return function () { - try { - cancellationSubject$.next(true); - cancellationSubject$.unsubscribe(); - } catch (e) { - if (_NeonEnvironment.default.isDevEnv) { - console.error(e); // eslint-disable-line no-console - } - } - }; - }, []); - var notificationsDisabled = notifications.some(function (n) { - return !n.dismissed; - }); - var notificationsColor = notificationsDisabled ? _Theme.COLORS.GREY[200] : _Theme.COLORS.GOLD[500]; - var notificationsContent = notifications.length ? /*#__PURE__*/_react.default.createElement(_IconButton.default, { - key: "show-notifications", - "aria-label": "show-notifications", - title: "Show Notifications", - onClick: onShowNotifications, - style: { - marginRight: '12px' - }, - disabled: notificationsDisabled - }, /*#__PURE__*/_react.default.createElement(_Notifications.default, { - style: { - color: notificationsColor, - fontSize: '1.65rem !important' - } - })) : null; - - var authContainer = /*#__PURE__*/_react.default.createElement("div", { - className: "neon-menu__auth" - }, notificationsContent, /*#__PURE__*/_react.default.createElement(_NeonAuth.default, { - loginPath: loginPath, - logoutPath: logoutPath, - accountPath: accountPath, - loginType: _NeonAuth.NeonAuthType.REDIRECT, - logoutType: _NeonAuth.NeonAuthType.SILENT, - displayType: _NeonAuth.NeonAuthDisplayType.MENU - })); - - var menu = /*#__PURE__*/_react.default.createElement(_rcMenu.default, { - id: "main-menu", - mode: "horizontal" - }, /*#__PURE__*/_react.default.createElement(_rcMenu.MenuItem, null, /*#__PURE__*/_react.default.createElement(_CircularProgress.default, { - size: 24 - }))); - - if (menuFetched) { - menu = /*#__PURE__*/_react.default.createElement(_rcMenu.default, { - id: "main-menu", - mode: "horizontal" - }, /*#__PURE__*/_react.default.createElement(_rcMenu.MenuItem, { - key: "home", - className: "rc-menu-item", - role: "menuitem" - }, /*#__PURE__*/_react.default.createElement("a", { - href: "/", - title: "NEON Data Portal | Home" - }, /*#__PURE__*/_react.default.createElement(_Home.default, null))), (menuItems.length ? menuItems : _menuDefaultFallback.default).map(generateRCMenuItem)); - } - - return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement("div", { - className: "neon-menu__container", - "data-selenium": "neon-menu" - }, /*#__PURE__*/_react.default.createElement(_Grid.default, { - container: true, - direction: "row", - justify: "space-around", - alignItems: "center", - spacing: 0 - }, /*#__PURE__*/_react.default.createElement(_Hidden.default, { - mdUp: true - }, /*#__PURE__*/_react.default.createElement(_Grid.default, { - item: true, - xs: 7, - style: { - whiteSpace: 'nowrap' - } - }, /*#__PURE__*/_react.default.createElement(_IconButton.default, { - "data-selenium": "neon-menu.drawer-iconbutton.open", - edge: "start", - "aria-label": "Menu", - onClick: function onClick() { - return setDrawerIsOpen(true); - }, - style: { - margin: '4px 0px 4px 12px' - } - }, /*#__PURE__*/_react.default.createElement(_Menu.default, null)), neonLogo), /*#__PURE__*/_react.default.createElement(_Grid.default, { - item: true, - xs: 5 - }, authContainer)), /*#__PURE__*/_react.default.createElement(_Hidden.default, { - smDown: true - }, /*#__PURE__*/_react.default.createElement(_Grid.default, { - item: true, - md: 9 - }, /*#__PURE__*/_react.default.createElement("div", { - className: "neon-menu__header-container" - }, neonLogo, menu)), /*#__PURE__*/_react.default.createElement(_Grid.default, { - item: true, - md: 3 - }, authContainer)))), /*#__PURE__*/_react.default.createElement(_Hidden.default, { - mdUp: true - }, /*#__PURE__*/_react.default.createElement(_Drawer.default, { - open: drawerIsOpen, - onClose: function onClose() { - return setDrawerIsOpen(false); - } - }, /*#__PURE__*/_react.default.createElement("div", { - className: "neon-menu__drawer-header-container" - }, neonLogo, /*#__PURE__*/_react.default.createElement(_IconButton.default, { - "data-selenium": "neon-menu.drawer-iconbutton.close", - color: "primary", - "aria-label": "Close Menu", - onClick: function onClick() { - return setDrawerIsOpen(false); - }, - style: { - margin: '8px 0px' - } - }, /*#__PURE__*/_react.default.createElement(_ChevronLeft.default, null))), /*#__PURE__*/_react.default.createElement(_Divider.default, null), /*#__PURE__*/_react.default.createElement(_NeonDrawerMenu.default, { - items: menuItems - })))); -}; - -NeonMenu.propTypes = { - loginPath: _propTypes.default.string, - logoutPath: _propTypes.default.string, - accountPath: _propTypes.default.string, - notifications: _propTypes.default.arrayOf(_propTypes.default.shape({ - id: _propTypes.default.string.isRequired, - message: _propTypes.default.string.isRequired, - dismissed: _propTypes.default.bool.isRequired - })), - onShowNotifications: _propTypes.default.func -}; -NeonMenu.defaultProps = { - loginPath: '', - logoutPath: '', - accountPath: '', - notifications: [], - onShowNotifications: null -}; -var _default = NeonMenu; -exports.default = _default; \ No newline at end of file diff --git a/lib/components/NeonMenu/index.d.ts b/lib/components/NeonMenu/index.d.ts deleted file mode 100644 index c01ef9a3..00000000 --- a/lib/components/NeonMenu/index.d.ts +++ /dev/null @@ -1 +0,0 @@ -export { default } from "./NeonMenu"; diff --git a/lib/components/NeonMenu/index.js b/lib/components/NeonMenu/index.js deleted file mode 100644 index 1587ca40..00000000 --- a/lib/components/NeonMenu/index.js +++ /dev/null @@ -1,15 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -Object.defineProperty(exports, "default", { - enumerable: true, - get: function get() { - return _NeonMenu.default; - } -}); - -var _NeonMenu = _interopRequireDefault(require("./NeonMenu")); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } \ No newline at end of file diff --git a/lib/components/NeonMenu/menuDefaultFallback.json b/lib/components/NeonMenu/menuDefaultFallback.json deleted file mode 100644 index 7a4927de..00000000 --- a/lib/components/NeonMenu/menuDefaultFallback.json +++ /dev/null @@ -1,164 +0,0 @@ -[ - { - "name": "About", - "url": "/about", - "isContainer": true, - "children": [ - { - "name": "Usage and Citation Policies", - "url": "/data-policy", - "isContainer": false, - "children": [] - }, - { - "name": "Data Quality Program", - "url": "/data-quality", - "isContainer": false, - "children": [] - }, - { - "name": "Data Portal News", - "url": "/news", - "isContainer": false, - "children": [] - } - ] - }, - { - "name": "Download Data", - "url": "/download-data", - "isContainer": true, - "children": [ - { - "name": "Data Products", - "url": "/browse-data", - "isContainer": false, - "children": [] - }, - { - "name": "API", - "url": "/data-api", - "isContainer": false, - "children": [] - }, - { - "name": "Prototype Data", - "url": "/prototype-search", - "isContainer": false, - "children": [] - } - ] - }, - { - "name": "Resources", - "url": "/resources", - "isContainer": true, - "children": [ - { - "name": "Document Library", - "url": "/documents", - "isContainer": false, - "children": [] - }, - { - "name": "Data Product Catalog", - "url": "/data-product-catalog", - "isContainer": false, - "children": [] - }, - { - "name": "Data Availability Chart", - "url": "/view-data-availability", - "isContainer": false, - "children": [] - }, - { - "name": "Taxonomy Lists", - "url": "/apps/taxon", - "type": "url", - "isContainer": false, - "children": [] - }, - { - "name": "Sample Viewer", - "url": "/apps/samples", - "type": "url", - "isContainer": false, - "children": [] - }, - { - "name": "Frequently Asked Questions", - "url": "/faq", - "type": "url", - "isContainer": false, - "children": [] - }, - { - "name": "Using NEON Data", - "url": "/using-neon-data", - "isContainer": true, - "children": [ - { - "name": "File Naming Conventions", - "url": "/file-naming-conventions", - "type": "portlet", - "isContainer": false, - "children": [] - }, - { - "name": "Data Tutorials, Workshops & More", - "url": "https://neonscience.org/resources", - "isContainer": false, - "children": [] - }, - { - "name": "Software @ GitHub", - "url": "https://github.com/NEONScience", - "isContainer": false, - "isExternalLink": true, - "navExternalLink": null, - "isExpanded": false, - "children": [] - } - ] - }, - { - "name": "Learn More", - "url": "/learn-more", - "isContainer": true, - "children": [ - { - "name": "Field Sites", - "url": "https://www.neonscience.org/field-sites", - "isContainer": false, - "children": [] - }, - { - "name": "Airborne Data", - "url": "https://www.neonscience.org/data-resources/get-data/airborne-data", - "isContainer": false, - "children": [] - }, - { - "name": "Data Collection", - "url": "https://www.neonscience.org/data-collection", - "isContainer": false, - "children": [] - }, - { - "name": "Sampling Schedules", - "url": "https://www.neonscience.org/resources/information-researchers#schedules", - "isContainer": false, - "children": [] - } - ] - } - ] - }, - { - "name": "Contact Us", - "url": "/feedback", - "isContainer": false, - "children": [] - } -] diff --git a/lib/components/NeonMenu/package.json b/lib/components/NeonMenu/package.json deleted file mode 100644 index cb42739c..00000000 --- a/lib/components/NeonMenu/package.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "private": true, - "name": "neon-menu", - "main": "./NeonMenu.jsx", - "module": "./NeonMenu.js" -} - diff --git a/lib/components/NeonPage/BrowserWarning.js b/lib/components/NeonPage/BrowserWarning.js index 2e440589..68aa82b0 100644 --- a/lib/components/NeonPage/BrowserWarning.js +++ b/lib/components/NeonPage/BrowserWarning.js @@ -48,11 +48,14 @@ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } /* Browser duck typing and warning We know detecting browser on user agent strings for feature gating is bad practice. - Here, though, we just want a generic wanring if we know the browser is IE. + Here, though, we just want a generic warning if we know the browser is IE. Nothing else is or should be predicated on the value detected here. Don't make this any more complicated! */ -var browserIsIE = navigator.userAgent.indexOf('MSIE') !== -1 || navigator.appVersion.indexOf('Trident/') > -1; +var isBrowserIE = function isBrowserIE() { + return navigator.userAgent.indexOf('MSIE') !== -1 || navigator.appVersion.indexOf('Trident/') > -1; +}; + var useStyles = (0, _styles.makeStyles)(function (theme) { return { browserWarning: { @@ -73,6 +76,7 @@ var cookies = new _universalCookie.default(); var BrowserWarning = function BrowserWarning() { var classes = useStyles(_Theme.default); + var browserIsIE = isBrowserIE(); var _useState = (0, _react.useState)(browserIsIE), _useState2 = _slicedToArray(_useState, 2), diff --git a/lib/components/NeonPage/NeonPage.d.ts b/lib/components/NeonPage/NeonPage.d.ts index fd2d649a..3f33b894 100644 --- a/lib/components/NeonPage/NeonPage.d.ts +++ b/lib/components/NeonPage/NeonPage.d.ts @@ -1,7 +1,18 @@ +export function NeonErrorPage(props: any): JSX.Element; +export namespace NeonErrorPage { + export namespace propTypes { + export const error: PropTypes.Validator; + stack: PropTypes.Requireable; + }>>; + export const resetErrorBoundary: PropTypes.Validator<(...args: any[]) => any>; + } +} export default NeonPage; +import PropTypes from "prop-types"; declare function NeonPage(props: any): JSX.Element; declare namespace NeonPage { - export namespace propTypes { + export namespace propTypes_1 { export const breadcrumbHomeHref: PropTypes.Requireable; export const breadcrumbs: PropTypes.Requireable<(PropTypes.InferProps<{ name: PropTypes.Validator; @@ -9,7 +20,8 @@ declare namespace NeonPage { }> | null | undefined)[]>; export const customHeader: PropTypes.Requireable; export const customFooter: PropTypes.Requireable; - export const error: PropTypes.Requireable; + const error_1: PropTypes.Requireable; + export { error_1 as error }; export const loading: PropTypes.Requireable; export const notification: PropTypes.Requireable; export const outerPageContainerMaxWidth: PropTypes.Requireable; @@ -32,7 +44,6 @@ declare namespace NeonPage { export const sidebarUnsticky: PropTypes.Requireable; export const subtitle: PropTypes.Requireable; export const title: PropTypes.Requireable; - export const useCoreHeader: PropTypes.Requireable; export const unstickyDrupalHeader: PropTypes.Requireable; export const NeonContextProviderProps: PropTypes.Requireable; @@ -43,6 +54,7 @@ declare namespace NeonPage { const children_1: PropTypes.Validator; export { children_1 as children }; } + export { propTypes_1 as propTypes }; export namespace defaultProps { const breadcrumbHomeHref_1: string; export { breadcrumbHomeHref_1 as breadcrumbHomeHref }; @@ -52,8 +64,8 @@ declare namespace NeonPage { export { customHeader_1 as customHeader }; const customFooter_1: null; export { customFooter_1 as customFooter }; - const error_1: null; - export { error_1 as error }; + const error_2: null; + export { error_2 as error }; const loading_1: null; export { loading_1 as loading }; const notification_1: null; @@ -84,13 +96,10 @@ declare namespace NeonPage { export { subtitle_1 as subtitle }; const title_1: null; export { title_1 as title }; - const useCoreHeader_1: boolean; - export { useCoreHeader_1 as useCoreHeader }; const unstickyDrupalHeader_1: boolean; export { unstickyDrupalHeader_1 as unstickyDrupalHeader }; const NeonContextProviderProps_1: {}; export { NeonContextProviderProps_1 as NeonContextProviderProps }; } } -import PropTypes from "prop-types"; declare const children: PropTypes.Requireable; diff --git a/lib/components/NeonPage/NeonPage.js b/lib/components/NeonPage/NeonPage.js index d4d040d2..d6539aa0 100644 --- a/lib/components/NeonPage/NeonPage.js +++ b/lib/components/NeonPage/NeonPage.js @@ -5,7 +5,7 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi Object.defineProperty(exports, "__esModule", { value: true }); -exports.default = void 0; +exports.default = exports.NeonErrorPage = void 0; var _react = _interopRequireWildcard(require("react")); @@ -369,6 +369,7 @@ var NeonErrorPage = function NeonErrorPage(props) { }))); }; +exports.NeonErrorPage = NeonErrorPage; NeonErrorPage.propTypes = { error: _propTypes.default.shape({ message: _propTypes.default.string.isRequired, @@ -399,7 +400,6 @@ var NeonPage = function NeonPage(props) { sidebarUnsticky = props.sidebarUnsticky, subtitle = props.subtitle, title = props.title, - useCoreHeader = props.useCoreHeader, unstickyDrupalHeader = props.unstickyDrupalHeader, NeonContextProviderProps = props.NeonContextProviderProps, children = props.children; @@ -418,13 +418,15 @@ var NeonPage = function NeonPage(props) { var _useState = (0, _react.useState)(false), _useState2 = _slicedToArray(_useState, 2), overlayDismissed = _useState2[0], - setOverlayDismissed = _useState2[1]; + setOverlayDismissed = _useState2[1]; // Boolean - whether any Drupal assets are used; only false if both header and footer are custom + + + var useSomeDrupalAssets = !(customHeader && customFooter); /** Sidebar Setup */ // Sidebar can have content OR links, not both. If both are set then content wins. - var hasSidebarContent = sidebarContent !== null; var hasSidebarLinks = !sidebarContent && Array.isArray(sidebarLinks) && sidebarLinks.length > 0; var hasSidebar = hasSidebarContent || hasSidebarLinks; // sidebarLinksAsStandaloneChildren can only be true if all sidebar links have a defined component @@ -556,7 +558,11 @@ var NeonPage = function NeonPage(props) { setDrupalCssStatus = _useState10[1]; (0, _react.useEffect)(function () { - if (useCoreHeader || drupalCssStatus !== _NeonContext.FETCH_STATUS.AWAITING_CALL) { + if (!useSomeDrupalAssets) { + return; + } + + if (drupalCssStatus !== _NeonContext.FETCH_STATUS.AWAITING_CALL) { return; } @@ -583,7 +589,7 @@ var NeonPage = function NeonPage(props) { }; document.body.appendChild(link); - }, [useCoreHeader, drupalCssStatus, setDrupalCssStatus]); + }, [useSomeDrupalAssets, drupalCssStatus, setDrupalCssStatus]); /** Liferay Notifications */ @@ -762,7 +768,7 @@ var NeonPage = function NeonPage(props) { component: "h3", gutterBottom: true }, loading), progress === null ? /*#__PURE__*/_react.default.createElement(_CircularProgress.default, null) : /*#__PURE__*/_react.default.createElement(_CircularProgress.default, { - variant: "static", + variant: "determinate", value: progress }))); }; @@ -938,7 +944,6 @@ var NeonPage = function NeonPage(props) { ref: headerRef }, customHeader) : /*#__PURE__*/_react.default.createElement(_NeonHeader.default, { ref: headerRef, - useCoreHeader: useCoreHeader, unstickyDrupalHeader: unstickyDrupalHeader, notifications: notifications, onShowNotifications: handleShowNotifications, @@ -957,14 +962,13 @@ var NeonPage = function NeonPage(props) { notifications: notifications, onHideNotifications: handleHideNotifications }), /*#__PURE__*/_react.default.createElement(_BrowserWarning.default, null), customFooter ? /*#__PURE__*/_react.default.createElement("footer", null, customFooter) : /*#__PURE__*/_react.default.createElement(_NeonFooter.default, { - useCoreHeader: useCoreHeader, drupalCssLoaded: drupalCssStatus === _NeonContext.FETCH_STATUS.SUCCESS }), renderLoading(), renderError()); }; var renderedPage = neonContextIsActive ? renderNeonPage() : /*#__PURE__*/_react.default.createElement(_NeonContext.default.Provider, _extends({ useCoreAuth: true, - fetchPartials: !useCoreHeader + fetchPartials: useSomeDrupalAssets }, NeonContextProviderProps), renderNeonPage()); return /*#__PURE__*/_react.default.createElement(_reactErrorBoundary.ErrorBoundary, { FallbackComponent: NeonErrorPage, @@ -1005,7 +1009,6 @@ NeonPage.propTypes = { sidebarUnsticky: _propTypes.default.bool, subtitle: _propTypes.default.oneOfType([_propTypes.default.string, children]), title: _propTypes.default.oneOfType([_propTypes.default.string, children]), - useCoreHeader: _propTypes.default.bool, unstickyDrupalHeader: _propTypes.default.bool, NeonContextProviderProps: _propTypes.default.shape(_NeonContext.default.ProviderPropTypes), children: children.isRequired @@ -1032,7 +1035,6 @@ NeonPage.defaultProps = { sidebarUnsticky: false, subtitle: null, title: null, - useCoreHeader: false, unstickyDrupalHeader: true, NeonContextProviderProps: {} }; diff --git a/lib/components/NeonUtilityBar/NeonUtilityBar.d.ts b/lib/components/NeonUtilityBar/NeonUtilityBar.d.ts deleted file mode 100644 index 516df75b..00000000 --- a/lib/components/NeonUtilityBar/NeonUtilityBar.d.ts +++ /dev/null @@ -1,12 +0,0 @@ -export default NeonUtilityBar; -declare function NeonUtilityBar(props: any): JSX.Element; -declare namespace NeonUtilityBar { - export namespace propTypes { - export const selectedTab: PropTypes.Requireable; - } - export namespace defaultProps { - const selectedTab_1: string; - export { selectedTab_1 as selectedTab }; - } -} -import PropTypes from "prop-types"; diff --git a/lib/components/NeonUtilityBar/NeonUtilityBar.js b/lib/components/NeonUtilityBar/NeonUtilityBar.js deleted file mode 100644 index 8ced8432..00000000 --- a/lib/components/NeonUtilityBar/NeonUtilityBar.js +++ /dev/null @@ -1,131 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = void 0; - -var _react = _interopRequireDefault(require("react")); - -var _propTypes = _interopRequireDefault(require("prop-types")); - -var _styles = require("@material-ui/core/styles"); - -var _AppBar = _interopRequireDefault(require("@material-ui/core/AppBar")); - -var _Tabs = _interopRequireDefault(require("@material-ui/core/Tabs")); - -var _Tab = _interopRequireDefault(require("@material-ui/core/Tab")); - -var _Theme = _interopRequireDefault(require("../Theme/Theme")); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } - -/** - NOTE: The excessive styling here is intended to make the NeonUtilityBar - component have visual parity with the legacy Utility Bar still being used - on the Neon Science and Biorepository sites. - - When those sites are serving their utility bars from this shared component - (i.e. this component is the ONLY implementation of the utility bar) then - visual changes can be made here and appear consistently across all sites. -*/ -var useTabsStyles = (0, _styles.makeStyles)(function (theme) { - return { - root: { - width: '100%', - minHeight: theme.spacing(3) - /* borderBottom: '3px solid #fff', */ - - }, - indicator: { - display: 'none' - }, - flexContainer: _defineProperty({ - justifyContent: 'flex-end' - }, theme.breakpoints.down('sm'), { - justifyContent: 'flex-start' - }) - }; -}); -var useTabStyles = (0, _styles.makeStyles)(function (theme) { - var _root; - - return { - root: (_root = { - color: '#fff', - backgroundColor: theme.palette.secondary.main, - border: 'none', - minHeight: theme.spacing(3), - '&:hover': { - textDecoration: 'underline', - color: '#fff', - backgroundColor: theme.palette.secondary.main - }, - '&$selected': { - color: "".concat(theme.palette.secondary.main, " !important"), - backgroundColor: '#fff !important' - }, - fontWeight: 600, - letterSpacing: '1px', - lineHeight: 1.65, - fontSize: '1rem', - padding: "".concat(theme.spacing(0.25), "px ").concat(theme.spacing(3.5), "px") - }, _defineProperty(_root, theme.breakpoints.down('sm'), { - lineHeight: 1.8, - fontSize: '0.8rem', - padding: "".concat(theme.spacing(0.25), "px ").concat(theme.spacing(2), "px") - }), _defineProperty(_root, theme.breakpoints.down('xs'), { - fontSize: '0.75rem', - padding: "".concat(theme.spacing(0.25), "px ").concat(theme.spacing(1.5), "px") - }), _root), - selected: {}, - textColorInherit: { - opacity: 1 - } - }; -}); - -var NeonUtilityBar = function NeonUtilityBar(props) { - var tabsClasses = useTabsStyles(_Theme.default); - var tabClasses = useTabStyles(_Theme.default); - var selectedTab = props.selectedTab; - var scienceUrl = 'https://neonscience.org'; - var dataUrl = 'https://data.neonscience.org/home'; - var bioUrl = 'https://biorepo.neonscience.org/portal/index.php'; - return /*#__PURE__*/_react.default.createElement(_AppBar.default, { - position: "static", - "data-selenium": "neon-utility-bar", - color: "secondary", - elevation: 2 - }, /*#__PURE__*/_react.default.createElement(_Tabs.default, { - value: selectedTab, - classes: tabsClasses - }, /*#__PURE__*/_react.default.createElement(_Tab.default, { - classes: tabClasses, - value: "science", - label: "Neon Science", - href: scienceUrl - }), /*#__PURE__*/_react.default.createElement(_Tab.default, { - classes: tabClasses, - value: "data", - label: "Data Portal", - href: dataUrl - }), /*#__PURE__*/_react.default.createElement(_Tab.default, { - classes: tabClasses, - value: "bio", - label: "Biorepository", - href: bioUrl - }))); -}; - -NeonUtilityBar.propTypes = { - selectedTab: _propTypes.default.string -}; -NeonUtilityBar.defaultProps = { - selectedTab: 'data' -}; -var _default = NeonUtilityBar; -exports.default = _default; \ No newline at end of file diff --git a/lib/components/NeonUtilityBar/index.d.ts b/lib/components/NeonUtilityBar/index.d.ts deleted file mode 100644 index 2443200c..00000000 --- a/lib/components/NeonUtilityBar/index.d.ts +++ /dev/null @@ -1 +0,0 @@ -export { default } from "./NeonUtilityBar"; diff --git a/lib/components/NeonUtilityBar/index.js b/lib/components/NeonUtilityBar/index.js deleted file mode 100644 index cb856a81..00000000 --- a/lib/components/NeonUtilityBar/index.js +++ /dev/null @@ -1,15 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -Object.defineProperty(exports, "default", { - enumerable: true, - get: function get() { - return _NeonUtilityBar.default; - } -}); - -var _NeonUtilityBar = _interopRequireDefault(require("./NeonUtilityBar")); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } \ No newline at end of file diff --git a/lib/components/NeonUtilityBar/package.json b/lib/components/NeonUtilityBar/package.json deleted file mode 100644 index a2e66cef..00000000 --- a/lib/components/NeonUtilityBar/package.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "private": true, - "name": "neon-utility-bar", - "main": "./NeonUtilityBar.jsx", - "module": "./NeonUtilityBar.js" -} diff --git a/lib/components/PopupBase/PopupBase.css b/lib/components/PopupBase/PopupBase.css deleted file mode 100644 index 4011615e..00000000 --- a/lib/components/PopupBase/PopupBase.css +++ /dev/null @@ -1,9 +0,0 @@ -.popup__base { - position: fixed; - background: #FFF; - z-index: 201; -} - -.popup__base--noscroll { - overflow: hidden; -} diff --git a/lib/components/PopupBase/PopupBase.d.ts b/lib/components/PopupBase/PopupBase.d.ts deleted file mode 100644 index fc2df849..00000000 --- a/lib/components/PopupBase/PopupBase.d.ts +++ /dev/null @@ -1,9 +0,0 @@ -export default PopupBase; -/** - DEPRECATED - Use DialogBase Instead! -*/ -declare class PopupBase extends React.Component { - constructor(props: any); - constructor(props: any, context: any); -} -import React from "react"; diff --git a/lib/components/PopupBase/PopupBase.js b/lib/components/PopupBase/PopupBase.js deleted file mode 100644 index 7188f89d..00000000 --- a/lib/components/PopupBase/PopupBase.js +++ /dev/null @@ -1,90 +0,0 @@ -"use strict"; - -function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = void 0; - -var _react = _interopRequireWildcard(require("react")); - -require("./PopupBase.css"); - -function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; } - -function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; } - -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - -function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } - -function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } - -function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); } - -function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } - -function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; } - -function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); } - -function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } - -function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } } - -function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } - -/** - DEPRECATED - Use DialogBase Instead! -*/ -var PopupBase = /*#__PURE__*/function (_Component) { - _inherits(PopupBase, _Component); - - var _super = _createSuper(PopupBase); - - function PopupBase() { - _classCallCheck(this, PopupBase); - - return _super.apply(this, arguments); - } - - _createClass(PopupBase, [{ - key: "componentDidMount", - value: function componentDidMount() { - // keep the background from scrolling when the popup is visible - document.body.classList.add('popup__base--noscroll'); - } - }, { - key: "componentWillUnmount", - value: function componentWillUnmount() { - document.body.classList.remove('popup__base--noscroll'); - } - }, { - key: "render", - value: function render() { - var popupBaseStyle = { - height: this.props.popupHeight, - width: this.props.popupWidth, - top: this.props.top, - left: this.props.left, - marginTop: this.props.marginTop, - marginLeft: this.props.marginLeft - }; - - if (this.props.zIndex) { - popupBaseStyle.zIndex = this.props.zIndex; - } - - return /*#__PURE__*/_react.default.createElement("div", { - style: popupBaseStyle, - className: "popup__base" - }, this.props.children); - } - }]); - - return PopupBase; -}(_react.Component); - -var _default = PopupBase; -exports.default = _default; \ No newline at end of file diff --git a/lib/components/PopupBase/index.d.ts b/lib/components/PopupBase/index.d.ts deleted file mode 100644 index 118bd6c2..00000000 --- a/lib/components/PopupBase/index.d.ts +++ /dev/null @@ -1 +0,0 @@ -export { default } from "./PopupBase"; diff --git a/lib/components/PopupBase/index.js b/lib/components/PopupBase/index.js deleted file mode 100644 index 34740396..00000000 --- a/lib/components/PopupBase/index.js +++ /dev/null @@ -1,15 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -Object.defineProperty(exports, "default", { - enumerable: true, - get: function get() { - return _PopupBase.default; - } -}); - -var _PopupBase = _interopRequireDefault(require("./PopupBase")); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } \ No newline at end of file diff --git a/lib/components/PopupBase/package.json b/lib/components/PopupBase/package.json deleted file mode 100644 index f647de92..00000000 --- a/lib/components/PopupBase/package.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "private": true, - "name": "popup-base", - "main": "./PopupBase.js", - "module": "./index.js" -} diff --git a/lib/components/PopupLoading/PopupLoading.css b/lib/components/PopupLoading/PopupLoading.css deleted file mode 100644 index 098d0c66..00000000 --- a/lib/components/PopupLoading/PopupLoading.css +++ /dev/null @@ -1,74 +0,0 @@ -.popup-loading { - position: relative; - background: #fff; - border-radius: 10px; - display: flex; - flex-direction: column; - border: 1px solid #cccccc; - padding: 4%; - max-height: 650px; - overflow: auto; - z-index: 300; - font-size: 18px; - text-align: center; - opacity: 1; - color: #002c77; -} - -.popup-loading__background { - position: fixed; - top: 60px; - bottom: 173px; - left: 0; - background: white; - width: 100%; - z-index: 199; -} - -.popup-loading__row { - width: 100%; - min-height: min-content; - font-family: Helvetica; - padding-bottom: 6px; - padding-top: 6px; -} - -.popup-loading__row--padding-bottom { - padding-bottom: 18px; -} - -.popup-loading__row--flexrow { - display: flex; - flex-direction: row; -} - -.popup-loading__header { - font-size: 28px; - font-weight: 650; - border-bottom: 1px solid black; - padding: 8px; -} - -.popup-loading__name { - font-size: 22px; - font-weight: 550; - color: #002c77; - padding: 22px 8px 8px 8px; -} - -.popup-loading__dpidq { - font-size: 16px; - padding: 4px 8px 8px 8px; -} - -.popup-loading__div { - height: auto; - padding-bottom: 10px; -} - -.popup-loading__close { - position: absolute; - top: 20px; - right: 20px; - cursor: pointer; -} diff --git a/lib/components/PopupLoading/PopupLoading.d.ts b/lib/components/PopupLoading/PopupLoading.d.ts deleted file mode 100644 index d32738f0..00000000 --- a/lib/components/PopupLoading/PopupLoading.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -export default PopupLoading; -declare class PopupLoading extends React.Component { - constructor(props: any); - constructor(props: any, context: any); -} -import React from "react"; diff --git a/lib/components/PopupLoading/PopupLoading.js b/lib/components/PopupLoading/PopupLoading.js deleted file mode 100644 index 83993744..00000000 --- a/lib/components/PopupLoading/PopupLoading.js +++ /dev/null @@ -1,97 +0,0 @@ -"use strict"; - -function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = void 0; - -var _react = _interopRequireWildcard(require("react")); - -var _PopupBase = _interopRequireDefault(require("../PopupBase/PopupBase")); - -require("./PopupLoading.css"); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; } - -function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; } - -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - -function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } - -function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } - -function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); } - -function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } - -function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; } - -function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); } - -function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } - -function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } } - -function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } - -var PopupLoading = /*#__PURE__*/function (_Component) { - _inherits(PopupLoading, _Component); - - var _super = _createSuper(PopupLoading); - - function PopupLoading() { - _classCallCheck(this, PopupLoading); - - return _super.apply(this, arguments); - } - - _createClass(PopupLoading, [{ - key: "render", - value: function render() { - var popupBackground = /*#__PURE__*/_react.default.createElement("div", { - className: "popup-loading__background" - }); - - var spinner = null; - - if (this.props.showSpinner) { - spinner = /*#__PURE__*/_react.default.createElement("div", { - className: "popup-loading__row" - }, /*#__PURE__*/_react.default.createElement("i", { - className: "fa fa-circle-o-notch fa-spin fa-2x fa-fw" - })); - } - - var popupWidth = 320; - var popupHeight = 120; - var marginLeft = -(popupWidth / 2); - var marginTop = -(popupHeight / 2); - var top = '35%'; - var left = '50%'; - var zIndex = 198; - return /*#__PURE__*/_react.default.createElement(_PopupBase.default, { - popupWidth: popupWidth, - popupHeight: popupHeight, - marginTop: marginTop, - marginLeft: marginLeft, - top: top, - left: left, - zIndex: zIndex - }, popupBackground, /*#__PURE__*/_react.default.createElement("div", { - className: "popup-loading" - }, /*#__PURE__*/_react.default.createElement("div", { - className: "popup-loading__row" - }, this.props.message), spinner)); - } - }]); - - return PopupLoading; -}(_react.Component); - -var _default = PopupLoading; -exports.default = _default; \ No newline at end of file diff --git a/lib/components/PopupLoading/index.d.ts b/lib/components/PopupLoading/index.d.ts deleted file mode 100644 index 83325244..00000000 --- a/lib/components/PopupLoading/index.d.ts +++ /dev/null @@ -1 +0,0 @@ -export { default } from "./PopupLoading"; diff --git a/lib/components/PopupLoading/index.js b/lib/components/PopupLoading/index.js deleted file mode 100644 index 199222ae..00000000 --- a/lib/components/PopupLoading/index.js +++ /dev/null @@ -1,15 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -Object.defineProperty(exports, "default", { - enumerable: true, - get: function get() { - return _PopupLoading.default; - } -}); - -var _PopupLoading = _interopRequireDefault(require("./PopupLoading")); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } \ No newline at end of file diff --git a/lib/components/PopupLoading/package.json b/lib/components/PopupLoading/package.json deleted file mode 100644 index faf2a0df..00000000 --- a/lib/components/PopupLoading/package.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "private": true, - "name": "popup-loading", - "main": "./PopupLoading.js", - "module": "./index.js" -} diff --git a/lib/components/SiteMap/FetchLocations.worker.d.ts b/lib/components/SiteMap/FetchLocations.worker.d.ts deleted file mode 100644 index cb0ff5c3..00000000 --- a/lib/components/SiteMap/FetchLocations.worker.d.ts +++ /dev/null @@ -1 +0,0 @@ -export {}; diff --git a/lib/components/SiteMap/FetchLocations.worker.js b/lib/components/SiteMap/FetchLocations.worker.js deleted file mode 100644 index d2b219f1..00000000 --- a/lib/components/SiteMap/FetchLocations.worker.js +++ /dev/null @@ -1,67 +0,0 @@ -"use strict"; - -var _rxjs = require("rxjs"); - -var _operators = require("rxjs/operators"); - -var _NeonGraphQL = _interopRequireDefault(require("../NeonGraphQL/NeonGraphQL")); - -var _SiteMapWorkerSafeUtils = require("./SiteMapWorkerSafeUtils"); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -/* eslint no-restricted-globals: 0, import/prefer-default-export: 0 */ -var fetchLocations = function fetchLocations() { - var event = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null; - var locations = (event || {}).data || null; // Extract locations list and validate - - if (!Array.isArray(locations) || !locations.length || !locations.every(function (loc) { - return typeof loc === 'string'; - })) { - postMessage({ - status: 'error', - error: 'Locations list is not valid; must be non-empty array of only strings' - }); - return; - } // Execute GraphQL query and pipe results to processing function - - - var obs = _NeonGraphQL.default.getManyLocationsByName(locations).pipe( // Success - (0, _operators.map)(function (result) { - if (!result.response || !result.response.data || !Array.isArray(result.response.data.locations)) { - postMessage({ - status: 'error', - error: 'Malformed response' - }); - return (0, _rxjs.of)(false); - } - - var data = {}; - result.response.data.locations.forEach(function (rawLocationData) { - var locationName = rawLocationData.locationName; - - if (!locationName) { - return; - } - - data[locationName] = (0, _SiteMapWorkerSafeUtils.parseLocationData)(rawLocationData); - }); - postMessage({ - status: 'success', - data: data - }); - return (0, _rxjs.of)(true); - }), // Error - (0, _operators.catchError)(function (error) { - postMessage({ - status: 'error', - error: error.message - }); - return (0, _rxjs.of)(false); - })); - - obs.subscribe(); -}; // Listen for the locations list - - -self.addEventListener('message', fetchLocations); \ No newline at end of file diff --git a/lib/components/SiteMap/SiteMapFeature.js b/lib/components/SiteMap/SiteMapFeature.js index 2198b8dc..b2acc8f4 100644 --- a/lib/components/SiteMap/SiteMapFeature.js +++ b/lib/components/SiteMap/SiteMapFeature.js @@ -1614,67 +1614,70 @@ var SiteMapFeature = function SiteMapFeature(props) { var baseIcon = state.map.zoomedIcons[featureKey]; var selection = isSelectable && isSelected ? _SiteMapUtils.SELECTION_STATUS.SELECTED : _SiteMapUtils.SELECTION_STATUS.UNSELECTED; var initialHighlight = isHighlighted ? _SiteMapUtils.HIGHLIGHT_STATUS.HIGHLIGHT : _SiteMapUtils.HIGHLIGHT_STATUS.NONE; - icon = baseIcon[selection][initialHighlight]; - interaction = { - onMouseOver: function onMouseOver(e) { - var highlight = _SiteMapUtils.HIGHLIGHT_STATUS.HIGHLIGHT; - if (selectionActive && selectingCurrentFeatureType && isSelectable) { - highlight = _SiteMapUtils.HIGHLIGHT_STATUS[isSelected ? 'HIGHLIGHT' : 'SELECT']; - } + if (baseIcon && baseIcon[selection]) { + icon = baseIcon[selection][initialHighlight]; + interaction = { + onMouseOver: function onMouseOver(e) { + var highlight = _SiteMapUtils.HIGHLIGHT_STATUS.HIGHLIGHT; - e.target.setIcon(baseIcon[selection][highlight]); + if (selectionActive && selectingCurrentFeatureType && isSelectable) { + highlight = _SiteMapUtils.HIGHLIGHT_STATUS[isSelected ? 'HIGHLIGHT' : 'SELECT']; + } - e.target._bringToFront(); + e.target.setIcon(baseIcon[selection][highlight]); - if (hasPopup && selectionActive) { - e.target.openPopup(); - positionPopup(e.target, e.latlng, selectionActive); - } - }, - onMouseOut: function onMouseOut(e) { - e.target.setIcon(baseIcon[selection][initialHighlight]); - - if (hasPopup && selectionActive) { - e.target.closePopup(); - } - }, - onClick: function onClick(e) { - if (!selectionActive && hasPopup) { - var popupOpen = e.target._popup.isOpen(); + e.target._bringToFront(); - var func = function func() { - return positionPopup(e.target, e.latlng, selectionActive); - }; - - dispatch({ - type: 'setMapRepositionOpenPopupFunc', - func: func - }); + if (hasPopup && selectionActive) { + e.target.openPopup(); + positionPopup(e.target, e.latlng, selectionActive); + } + }, + onMouseOut: function onMouseOut(e) { + e.target.setIcon(baseIcon[selection][initialHighlight]); - if (popupOpen) { - func(); + if (hasPopup && selectionActive) { + e.target.closePopup(); } - } + }, + onClick: function onClick(e) { + if (!selectionActive && hasPopup) { + var popupOpen = e.target._popup.isOpen(); - if (selectionActive && selectingCurrentFeatureType && isSelectable) { - switch (selectionType) { - case _SiteMapUtils.FEATURE_TYPES.SITES.KEY: - if (shapeData.siteCode) { - dispatch({ - type: 'toggleItemSelected', - item: shapeData.siteCode - }); - } + var func = function func() { + return positionPopup(e.target, e.latlng, selectionActive); + }; + + dispatch({ + type: 'setMapRepositionOpenPopupFunc', + func: func + }); - break; + if (popupOpen) { + func(); + } + } - default: - break; + if (selectionActive && selectingCurrentFeatureType && isSelectable) { + switch (selectionType) { + case _SiteMapUtils.FEATURE_TYPES.SITES.KEY: + if (shapeData.siteCode) { + dispatch({ + type: 'toggleItemSelected', + item: shapeData.siteCode + }); + } + + break; + + default: + break; + } } } - } - }; + }; + } } marker = /*#__PURE__*/_react.default.createElement(_reactLeaflet.Marker, _extends({ diff --git a/lib/components/SiteMap/SiteMapLeaflet.js b/lib/components/SiteMap/SiteMapLeaflet.js index e1ddeffb..75cefcbd 100644 --- a/lib/components/SiteMap/SiteMapLeaflet.js +++ b/lib/components/SiteMap/SiteMapLeaflet.js @@ -1079,7 +1079,8 @@ var SiteMapLeaflet = function SiteMapLeaflet() { onBaseLayerChange: handleBaseLayerChange, worldCopyJump: true, "data-component": "SiteMap", - "data-selenium": "sitemap-content-map" + "data-selenium": "sitemap-content-map", + tap: false }, mouseModeProps), /*#__PURE__*/_react.default.createElement(_reactLeaflet.ScaleControl, { imperial: true, metric: true, diff --git a/lib/components/SiteMap/SiteMapTable.d.ts b/lib/components/SiteMap/SiteMapTable.d.ts index ef584a24..ac61590b 100644 --- a/lib/components/SiteMap/SiteMapTable.d.ts +++ b/lib/components/SiteMap/SiteMapTable.d.ts @@ -5,11 +5,13 @@ export function getTestableItems(): { searchOnAttribs?: undefined; calculateMaxBodyHeight?: undefined; getFeatureName?: undefined; + exportCsv?: undefined; } | { ucWord: (word?: string) => string; parseSearchTerms: (input: string) => string[]; searchOnAttribs: (searchString: any, searchableAttribs?: any[]) => boolean; calculateMaxBodyHeight: (tableRef: any) => number; getFeatureName: (featureKey: any) => any; + exportCsv: (columns?: any[], rows?: any[]) => void; }; declare function SiteMapTable(): JSX.Element | null; diff --git a/lib/components/SiteMap/SiteMapTable.js b/lib/components/SiteMap/SiteMapTable.js index c5d8312e..0af253bc 100644 --- a/lib/components/SiteMap/SiteMapTable.js +++ b/lib/components/SiteMap/SiteMapTable.js @@ -13,8 +13,6 @@ var _styles = require("@material-ui/core/styles"); var _Box = _interopRequireDefault(require("@material-ui/core/Box")); -var _Button = _interopRequireDefault(require("@material-ui/core/Button")); - var _Link = _interopRequireDefault(require("@material-ui/core/Link")); var _IconButton = _interopRequireDefault(require("@material-ui/core/IconButton")); @@ -116,6 +114,75 @@ var calculateMaxBodyHeight = function calculateMaxBodyHeight(tableRef) { return Math.max(containerHeight - toolbarHeight - pagerHeight, _SiteMapUtils.MIN_TABLE_MAX_BODY_HEIGHT); }; +var EXPORT_FILENAME = 'NEON-SiteMap-Table'; + +var exportCsv = function exportCsv() { + var columns = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : []; + var rows = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : []; + + if (!columns.length || !rows.length) { + return; + } + + var columnHeaders = columns.reduce(function (acc, cur) { + if (Array.isArray(cur.csvFields)) { + cur.csvFields.forEach(function (field) { + acc.push(field); + }); + } else { + acc.push(cur.field); + } + + return acc; + }, []); + var payloadRows = [columnHeaders.join(',')]; + rows.forEach(function (row) { + var payloadRow = []; + columns.forEach(function (column) { + var render = typeof column.csvRender === 'function' ? column.csvRender : function (r) { + return r[column.field] || null; + }; + payloadRow.push([render(row)].flat().map(function (value) { + if (value === null || typeof value === 'undefined' || Number.isNaN(value)) { + return ''; + } + + if (/["',\s]/.test(value.toString())) { + return "\"".concat(value.toString().replace('"', '\\"'), "\""); + } + + return value; + }).join(',')); + }); + payloadRows.push(payloadRow.join(',')); + }); + var payload = payloadRows.join('\n'); + var mimeType = 'text/csv;charset=utf-8'; + var fileName = "".concat(EXPORT_FILENAME, ".csv"); + + if (navigator.msSaveBlob) { + // IE10+ + navigator.msSaveBlob(new Blob([payload], { + type: mimeType + }), fileName); + } else { + var link = document.createElement('a'); + + if (URL && typeof URL.createObjectURL === 'function') { + link.href = URL.createObjectURL(new Blob([payload], { + type: mimeType + })); + } else { + link.setAttribute('href', "data:".concat(mimeType, ",").concat(encodeURI(payload))); + } + + link.setAttribute('download', fileName); + document.body.appendChild(link); + link.click(); + document.body.removeChild(link); + } +}; + var useStyles = (0, _styles.makeStyles)(function (theme) { var _toolbarContainer; @@ -166,17 +233,26 @@ var useStyles = (0, _styles.makeStyles)(function (theme) { linkButton: { textAlign: 'left' }, + downloadCsvButton: { + marginRight: theme.spacing(2) + }, startFlex: { display: 'flex', alignItems: 'center', justifyContent: 'flex-start' }, + endFlex: { + display: 'flex', + alignItems: 'center', + justifyContent: 'flex-end' + }, toolbarContainer: (_toolbarContainer = { backgroundColor: theme.palette.grey[50] }, _defineProperty(_toolbarContainer, theme.breakpoints.down('xs'), { paddingTop: theme.spacing(4.5) }), _defineProperty(_toolbarContainer, '& div.MuiToolbar-root', { - padding: theme.spacing(0, 2), + width: '100%', + padding: theme.spacing(0, 0, 0, 2), backgroundColor: theme.palette.grey[50] }), _defineProperty(_toolbarContainer, '& button', { color: theme.palette.primary.main, @@ -188,7 +264,10 @@ var useStyles = (0, _styles.makeStyles)(function (theme) { } }), _toolbarContainer), toolbarContainerNoSplit: { - // This hides all but the search input and show columns buttons. + '& div.MuiToolbar-root': { + width: 'calc(100% - 244px)' + }, + // This hides all but the search input, show columns, and export buttons. // No other way to have material table NOT show a selection title in the toolbar. '& div.MuiToolbar-root > div:not(:nth-last-child(-n+2))': { display: 'none' @@ -248,6 +327,9 @@ var useStyles = (0, _styles.makeStyles)(function (theme) { fontSize: '1.2rem', fontWeight: 500 } + }, + paginationRoot: { + width: 'auto' } }; }); @@ -279,8 +361,6 @@ var SiteMapTable = function SiteMapTable() { maxBodyHeight = _state$table.maxBodyHeight, maxBodyHeightUpdateFromAspectRatio = _state$table.maxBodyHeightUpdateFromAspectRatio; var _state$selection = state.selection, - selectionLimit = _state$selection.limit, - selectionValid = _state$selection.valid, selection = _state$selection.set, selectableItems = _state$selection.validSet, hideUnselectable = _state$selection.hideUnselectable; @@ -414,8 +494,6 @@ var SiteMapTable = function SiteMapTable() { return false; }; - var selectRow = function selectRow() {}; - switch (focus) { case _SiteMapUtils.FEATURE_TYPES.SITES.KEY: rowIsSelected = function rowIsSelected(row) { @@ -426,13 +504,6 @@ var SiteMapTable = function SiteMapTable() { return !selectableItems || selectableItems.has(row.siteCode); }; - selectRow = function selectRow(row) { - return dispatch({ - type: 'toggleItemSelected', - item: row.siteCode - }); - }; - break; default: @@ -622,23 +693,25 @@ var SiteMapTable = function SiteMapTable() { var commonColumns = { site: { field: 'siteCode', + csvFields: ['siteCode', 'siteName'], + // Some single table columns are split in the CSV like so title: 'Site', sorting: true, defaultSort: 'desc', searchable: true, - lookup: Object.fromEntries(Array.from(sitesInMap).map(function (siteCode) { + lookup: Object.fromEntries(Array.from(sitesInMap).sort().map(function (siteCode) { return [siteCode, siteCode]; })), customFilterAndSearch: function customFilterAndSearch(input, row) { - if (typeof input === 'string') { + if (typeof input === 'string' && input.length) { return searchOnAttribs(input, [row.siteCode, row.description]); } - if (Array.isArray(input)) { + if (Array.isArray(input) && input.length) { return input.includes(row.siteCode); } - return false; + return true; }, customSort: function customSort(rowA, rowB) { var siteA = getSite(rowA); @@ -655,6 +728,8 @@ var SiteMapTable = function SiteMapTable() { return null; } + var siteCode = site.siteCode, + description = site.description; var isDecommissioned = site.manualLocationType === _SiteMapUtils.MANUAL_LOCATION_TYPES.PROTOTYPE_SITE; var featureKey = isDecommissioned ? _SiteMapUtils.FEATURES.DECOMMISSIONED_SITES.KEY : "".concat(site.terrain.toUpperCase(), "_").concat(site.type.toUpperCase(), "_SITES"); var unselectable = selectionActive && !rowIsSelectable(row); @@ -662,20 +737,29 @@ var SiteMapTable = function SiteMapTable() { component: "button", className: classes.siteName, onClick: function onClick() { - return jumpTo(row.siteCode); + return jumpTo(siteCode); }, - title: "Click to view ".concat(row.siteCode, " on the map") - }, renderFeatureIcon(featureKey, unselectable), /*#__PURE__*/_react.default.createElement("span", null, "".concat(site.description || 'Unnamed Site', " (").concat(site.siteCode, ")"))), /*#__PURE__*/_react.default.createElement("div", { + title: "Click to view ".concat(siteCode, " on the map") + }, renderFeatureIcon(featureKey, unselectable), /*#__PURE__*/_react.default.createElement("span", null, "".concat(description || 'Unnamed Site', " (").concat(siteCode, ")"))), /*#__PURE__*/_react.default.createElement("div", { className: classes.startFlex }, /*#__PURE__*/_react.default.createElement(_Link.default, { className: classes.siteDetailsLink, - href: "".concat((0, _SiteMapUtils.getHref)('SITE_DETAILS', site.siteCode)) + href: "".concat((0, _SiteMapUtils.getHref)('SITE_DETAILS', siteCode)) }, "Site Details"), /*#__PURE__*/_react.default.createElement("span", { className: classes.siteLinksDivider }, "|"), /*#__PURE__*/_react.default.createElement(_Link.default, { className: classes.siteDetailsLink, - href: "".concat((0, _SiteMapUtils.getHref)('EXPLORE_DATA_PRODUCTS_BY_SITE', site.siteCode)) + href: "".concat((0, _SiteMapUtils.getHref)('EXPLORE_DATA_PRODUCTS_BY_SITE', siteCode)) }, "Explore Data"))); + }, + csvRender: function csvRender(row) { + var siteName = null; + + if (state.sites[row.siteCode]) { + siteName = state.sites[row.siteCode].description; + } + + return [row.siteCode, siteName]; } }, domain: { @@ -684,7 +768,7 @@ var SiteMapTable = function SiteMapTable() { sorting: true, defaultSort: 'desc', searchable: true, - lookup: Object.fromEntries(Array.from(domainsInMap).map(function (domainCode) { + lookup: Object.fromEntries(Array.from(domainsInMap).sort().map(function (domainCode) { return [domainCode, domainCode]; })), customSort: function customSort(rowA, rowB) { @@ -710,7 +794,7 @@ var SiteMapTable = function SiteMapTable() { sorting: true, defaultSort: 'desc', searchable: true, - lookup: Object.fromEntries(Array.from(statesInMap).map(function (stateCode) { + lookup: Object.fromEntries(Array.from(statesInMap).sort().map(function (stateCode) { return [stateCode, state.featureData.STATES.STATES[stateCode].name]; })), customSort: function customSort(rowA, rowB) { @@ -719,37 +803,46 @@ var SiteMapTable = function SiteMapTable() { return stateA.name > stateB.name ? -1 : 1; }, customFilterAndSearch: function customFilterAndSearch(input, row) { - if (typeof input === 'string') { + if (typeof input === 'string' && input.length) { var rowState = getState(row); return searchOnAttribs(input, [row.stateCode, rowState.name]); } - if (Array.isArray(input)) { + if (Array.isArray(input) && input.length) { return input.includes(row.stateCode); } - return false; + return true; }, render: function render(row) { var usstate = getState(row); + var stateCode = row.stateCode; return !usstate ? null : /*#__PURE__*/_react.default.createElement("div", null, /*#__PURE__*/_react.default.createElement(_Link.default, { component: "button", className: classes.linkButton, onClick: function onClick() { - return jumpTo(row.stateCode); + return jumpTo(stateCode); }, - title: "Click to view ".concat(row.stateCode, " on the map") + title: "Click to view ".concat(stateCode, " on the map") }, usstate.name)); } }, coordinates: { field: 'latitude', + csvFields: ['latitude', 'longitude'], title: 'Coordinates', sorting: false, filtering: false, searchable: false, render: function render(row) { - return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, renderCaptionString(row.latitude.toFixed(5), 'Latitude'), /*#__PURE__*/_react.default.createElement("br", null), renderCaptionString(row.longitude.toFixed(5), 'Longitude')); + var rowLatitude = row.latitude, + rowLongitude = row.longitude; + var latitude = Number.isFinite(rowLatitude) ? rowLatitude.toFixed(5) : null; + var longitude = Number.isFinite(rowLongitude) ? rowLongitude.toFixed(5) : null; + return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, renderCaptionString(latitude, 'Latitude'), /*#__PURE__*/_react.default.createElement("br", null), renderCaptionString(longitude, 'Longitude')); + }, + csvRender: function csvRender(row) { + return [Number.isFinite(row.latitude) ? row.latitude.toFixed(5) : null, Number.isFinite(row.longitude) ? row.longitude.toFixed(5) : null]; } }, latitude: { @@ -758,7 +851,10 @@ var SiteMapTable = function SiteMapTable() { sorting: true, filtering: false, render: function render(row) { - return renderCaptionString(row.latitude.toFixed(5), 'Latitude'); + return renderCaptionString(Number.isFinite(row.latitude) ? row.latitude.toFixed(5) : null, 'Latitude'); + }, + csvRender: function csvRender(row) { + return Number.isFinite(row.latitude) ? row.latitude.toFixed(5) : null; } }, longitude: { @@ -767,7 +863,10 @@ var SiteMapTable = function SiteMapTable() { sorting: true, filtering: false, render: function render(row) { - return renderCaptionString(row.longitude.toFixed(5), 'Longitude'); + return renderCaptionString(Number.isFinite(row.longitude) ? row.longitude.toFixed(5) : null, 'Longitude'); + }, + csvRender: function csvRender(row) { + return Number.isFinite(row.longitude) ? row.longitude.toFixed(5) : null; } } }; @@ -807,12 +906,7 @@ var SiteMapTable = function SiteMapTable() { render: function render(row) { return ucWord(row.terrain); } - }, commonColumns.domain, commonColumns.state, commonColumns.coordinates - /* - commonColumns.latitude, - commonColumns.longitude, - */ - ]; + }, commonColumns.domain, commonColumns.state, commonColumns.coordinates]; } if (focus === _SiteMapUtils.FEATURE_TYPES.LOCATIONS.KEY) { @@ -824,14 +918,15 @@ var SiteMapTable = function SiteMapTable() { defaultSort: 'desc', searchable: true, render: function render(row) { + var name = row.name; return /*#__PURE__*/_react.default.createElement(_Link.default, { component: "button", className: classes.linkButton, onClick: function onClick() { - return jumpTo(row.name); + return jumpTo(name); }, - title: "View ".concat(row.name, " on map") - }, row.name); + title: "View ".concat(name, " on map") + }, name); } }, { // Location Type @@ -863,16 +958,23 @@ var SiteMapTable = function SiteMapTable() { return /*#__PURE__*/_react.default.createElement("div", { className: classes.startFlex }, renderFeatureIcon(featureKey), /*#__PURE__*/_react.default.createElement("span", null, featureName)); + }, + csvRender: function csvRender(row) { + return getFeatureName(row.featureKey); } }, { // Elevation field: 'elevation', + csvFields: ['elevation (m)'], title: 'Elevation', sorting: true, defaultSort: 'desc', filtering: false, render: function render(row) { return renderCaptionString(Number.isFinite(row.elevation) ? "".concat(row.elevation.toFixed(2), "m") : '--', 'Elevation'); + }, + csvRender: function csvRender(row) { + return Number.isFinite(row.elevation) ? row.elevation.toFixed(2) : null; } }, { // NLCD Class @@ -885,21 +987,23 @@ var SiteMapTable = function SiteMapTable() { return rows.some(function (row) { return row.nlcdClass === classKey; }); - }).map(function (classKey) { + }).sort().map(function (classKey) { return [classKey, _SiteMapUtils.NLCD_CLASSES[classKey].name]; })), render: function render(row) { - if (!row.nlcdClass) { + var nlcdClass = row.nlcdClass; + + if (!nlcdClass) { return renderCaptionString(); } - if (!_SiteMapUtils.NLCD_CLASSES[row.nlcdClass]) { - return renderCaptionString(row.nlcdClass, 'NLCD Class'); + if (!_SiteMapUtils.NLCD_CLASSES[nlcdClass]) { + return renderCaptionString(nlcdClass, 'NLCD Class'); } - var _NLCD_CLASSES$row$nlc = _SiteMapUtils.NLCD_CLASSES[row.nlcdClass], - title = _NLCD_CLASSES$row$nlc.name, - backgroundColor = _NLCD_CLASSES$row$nlc.color; + var _NLCD_CLASSES$nlcdCla = _SiteMapUtils.NLCD_CLASSES[nlcdClass], + title = _NLCD_CLASSES$nlcdCla.name, + backgroundColor = _NLCD_CLASSES$nlcdCla.color; return /*#__PURE__*/_react.default.createElement("div", { className: classes.nlcdClassContainer }, /*#__PURE__*/_react.default.createElement("div", { @@ -909,40 +1013,75 @@ var SiteMapTable = function SiteMapTable() { backgroundColor: backgroundColor } }), renderCaptionString(title, 'NLCD Class')); + }, + csvRender: function csvRender(row) { + var nlcdClass = row.nlcdClass; + + if (!nlcdClass) { + return null; + } + + if (!_SiteMapUtils.NLCD_CLASSES[nlcdClass]) { + return nlcdClass; + } + + return _SiteMapUtils.NLCD_CLASSES[nlcdClass].name; } }, { // Plot Size field: 'plotSize', + csvFields: ['plotDimensions', 'plotArea (m^2)'], title: 'Plot Size', sorting: true, deafultSort: 'asc', filtering: false, render: function render(row) { - return row.plotDimensions ? /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, renderCaptionString("".concat(row.plotDimensions), 'Plot Size (Dimensions)'), Number.isFinite(row.plotSize) ? /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement("br", null), renderCaptionString("(".concat(row.plotSize.toFixed(0), "m\xB2)"), 'Plot Size (Area)')) : null) : renderCaptionString(); + var plotDimensions = row.plotDimensions, + plotSize = row.plotSize; + + if (!plotDimensions) { + return renderCaptionString(); + } + + return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, renderCaptionString("".concat(plotDimensions), 'Plot Size (Dimensions)'), Number.isFinite(plotSize) ? /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement("br", null), renderCaptionString("(".concat(plotSize.toFixed(0), "m\xB2)"), 'Plot Size (Area)')) : null); + }, + csvRender: function csvRender(row) { + var plotDimensions = row.plotDimensions, + plotSize = row.plotSize; + return [plotDimensions || null, Number.isFinite(plotSize) ? plotSize.toFixed(0) : null]; } }, { // Plot Slope Aspect field: 'slopeAspect', + csvFields: ['slopeAspect (deg)'], title: 'Slope Aspect', sorting: true, deafultSort: 'asc', filtering: false, render: function render(row) { return renderCaptionString(Number.isFinite(row.slopeAspect) ? "".concat(row.slopeAspect.toFixed(2), "\xB0") : '--', 'Slope Aspect'); + }, + csvRender: function csvRender(row) { + return Number.isFinite(row.slopeAspect) ? row.slopeAspect.toFixed(2) : null; } }, { // Plot Slope Gradient field: 'slopeGradient', + csvFields: ['slopeGradient (%)'], title: 'Slope Gradient', sorting: true, deafultSort: 'asc', filtering: false, render: function render(row) { return renderCaptionString(Number.isFinite(row.slopeGradient) ? "".concat(row.slopeGradient.toFixed(2), "%") : '--', 'Slope Gradient'); + }, + csvRender: function csvRender(row) { + return Number.isFinite(row.slopeGradient) ? row.slopeGradient.toFixed(2) : null; } }, { // Sampling Module Count field: 'samplingModules', + csvFields: 'samplingModulesCount', title: 'Potential Sampling Modules', filtering: false, sorting: true, @@ -967,34 +1106,38 @@ var SiteMapTable = function SiteMapTable() { return a > b ? 1 : -1; }, render: function render(row) { - return Array.isArray(row.samplingModules) ? /*#__PURE__*/_react.default.createElement(_Tooltip.default, { + var samplingModules = row.samplingModules; + + if (!Array.isArray(samplingModules)) { + return renderCaptionString(); + } + + return /*#__PURE__*/_react.default.createElement(_Tooltip.default, { interactive: true, placement: "left", - title: row.samplingModules.length ? /*#__PURE__*/_react.default.createElement("ul", { + title: samplingModules.length ? /*#__PURE__*/_react.default.createElement("ul", { style: { marginLeft: _Theme.default.spacing(-1) } - }, row.samplingModules.map(function (m) { + }, samplingModules.map(function (m) { return /*#__PURE__*/_react.default.createElement("li", { key: m }, _SiteMapUtils.PLOT_SAMPLING_MODULES[m]); })) : /*#__PURE__*/_react.default.createElement("i", null, "none") }, /*#__PURE__*/_react.default.createElement("div", { className: classes.startFlex - }, renderCaptionString(row.samplingModules.length, 'Potential Sampling Modules'), /*#__PURE__*/_react.default.createElement(_IconButton.default, { + }, renderCaptionString(samplingModules.length, 'Potential Sampling Modules'), /*#__PURE__*/_react.default.createElement(_IconButton.default, { size: "small", className: classes.iconButton, "aria-label": "Potential Sampling Modules" }, /*#__PURE__*/_react.default.createElement(_InfoOutlined.default, { fontSize: "inherit" - })))) : renderCaptionString(); + })))); + }, + csvRender: function csvRender(row) { + return Array.isArray(row.samplingModules) ? row.samplingModules.length : null; } - }, commonColumns.site, commonColumns.domain, commonColumns.state, commonColumns.coordinates - /* - commonColumns.latitude, - commonColumns.longitude, - */ - ]; + }, commonColumns.site, commonColumns.domain, commonColumns.state, commonColumns.coordinates]; } var toolbarClassName = view === _SiteMapUtils.VIEWS.SPLIT ? classes.toolbarContainer : "".concat(classes.toolbarContainer, " ").concat(classes.toolbarContainerNoSplit); @@ -1042,6 +1185,13 @@ var SiteMapTable = function SiteMapTable() { }, pageSize: 100, pageSizeOptions: [100, 200, 500], + exportButton: { + csv: true + }, + exportCsv: exportCsv, + exportFileName: EXPORT_FILENAME, + emptyRowsWhenPaging: false, + thirdSortClick: false, rowStyle: function rowStyle(row) { if (selectionActive) { if (!rowIsSelectable(row)) { @@ -1127,7 +1277,8 @@ var getTestableItems = function getTestableItems() { parseSearchTerms: parseSearchTerms, searchOnAttribs: searchOnAttribs, calculateMaxBodyHeight: calculateMaxBodyHeight, - getFeatureName: getFeatureName + getFeatureName: getFeatureName, + exportCsv: exportCsv }; }; diff --git a/lib/components/Theme/Theme.js b/lib/components/Theme/Theme.js index af2396ee..d35acb96 100644 --- a/lib/components/Theme/Theme.js +++ b/lib/components/Theme/Theme.js @@ -462,7 +462,7 @@ var baseTheme = (0, _styles2.createMuiTheme)({ zIndex: 105 }, paper: { - zIndex: 10 + zIndex: 60 } }, MuiFormControlLabel: { diff --git a/lib/components/TimeSeriesViewer/TimeSeriesViewerContainer.d.ts b/lib/components/TimeSeriesViewer/TimeSeriesViewerContainer.d.ts index 72da3f99..ba7ee177 100644 --- a/lib/components/TimeSeriesViewer/TimeSeriesViewerContainer.d.ts +++ b/lib/components/TimeSeriesViewer/TimeSeriesViewerContainer.d.ts @@ -1 +1,5 @@ +/** + Summary Component +*/ +export function TimeSeriesViewerSummary(): JSX.Element; export default function TimeSeriesViewerContainer(): JSX.Element; diff --git a/lib/components/TimeSeriesViewer/TimeSeriesViewerContainer.js b/lib/components/TimeSeriesViewer/TimeSeriesViewerContainer.js index 068a869c..f243690e 100644 --- a/lib/components/TimeSeriesViewer/TimeSeriesViewerContainer.js +++ b/lib/components/TimeSeriesViewer/TimeSeriesViewerContainer.js @@ -5,6 +5,7 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi Object.defineProperty(exports, "__esModule", { value: true }); +exports.TimeSeriesViewerSummary = TimeSeriesViewerSummary; exports.default = TimeSeriesViewerContainer; var _react = _interopRequireWildcard(require("react")); diff --git a/lib/components/TimeSeriesViewer/TimeSeriesViewerContext.d.ts b/lib/components/TimeSeriesViewer/TimeSeriesViewerContext.d.ts index a7455adf..915d0c61 100644 --- a/lib/components/TimeSeriesViewer/TimeSeriesViewerContext.d.ts +++ b/lib/components/TimeSeriesViewer/TimeSeriesViewerContext.d.ts @@ -56,6 +56,62 @@ export namespace TabComponentPropTypes { [x: string]: import("../../types/core").Nullable; }>; } +export namespace DEFAULT_STATE { + import status = INIT_PRODUCT; + export { status }; + export const displayError: null; + export namespace fetchProduct { + import status_1 = AWAITING_CALL; + export { status_1 as status }; + export const error: null; + } + export const metaFetches: {}; + export const dataFetches: {}; + export const dataFetchProgress: number; + export const variables: {}; + export namespace product { + export const productCode: null; + export const productName: null; + export const productDescription: null; + export const productSensor: null; + export const dateRange: null[]; + export const continuousDateRange: never[]; + export const sites: {}; + } + export namespace graphData { + export const data: never[]; + export const qualityData: never[]; + export const monthOffsets: {}; + export const timestampMap: {}; + export const series: never[]; + export const labels: string[]; + export const qualityLabels: string[]; + } + export namespace selection { + const dateRange_1: null[]; + export { dateRange_1 as dateRange }; + const continuousDateRange_1: never[]; + export { continuousDateRange_1 as continuousDateRange }; + const variables_1: never[]; + export { variables_1 as variables }; + export const dateTimeVariable: null; + const sites_1: never[]; + export { sites_1 as sites }; + export const timeStep: string; + export const autoTimeStep: null; + export const qualityFlags: never[]; + export const rollPeriod: number; + export const logscale: boolean; + export namespace yAxes { + export const y1: any; + export const y2: any; + } + export const isDefault: boolean; + export const invalidDefaultVariables: Set; + } + export const availableQualityFlags: Set; + export const availableTimeSteps: Set; +} /** Time Step Definitions and Functions */ @@ -212,6 +268,13 @@ export type ParseSiteVariablesReturn = { variablesObject: Object; }; import PropTypes from "prop-types"; +declare namespace FETCH_STATUS { + export const AWAITING_CALL: string; + export const FETCHING: string; + const ERROR_2: string; + export { ERROR_2 as ERROR }; + export const SUCCESS: string; +} declare namespace TimeSeriesViewerContext { export { Provider }; export { useTimeSeriesViewerState }; @@ -223,23 +286,23 @@ declare namespace TimeSeriesViewerContext { declare function Provider(props: any): JSX.Element; declare namespace Provider { export namespace propTypes { - import productCode = productCode; - export { productCode }; + import productCode_1 = productCode; + export { productCode_1 as productCode }; import productData = productData; export { productData }; export const children: PropTypes.Validator; } export namespace defaultProps { - const productCode_1: null; - export { productCode_1 as productCode }; + const productCode_2: null; + export { productCode_2 as productCode }; const productData_1: null; export { productData_1 as productData }; } } declare function useTimeSeriesViewerState(): any; declare namespace TimeSeriesViewerPropTypes { - export function productCode_2(props: any, propName: any, componentName: any): Error | null; - export { productCode_2 as productCode }; + export function productCode_3(props: any, propName: any, componentName: any): Error | null; + export { productCode_3 as productCode }; export function productData_2(props: any, propName: any, componentName: any): Error | null; export { productData_2 as productData }; } diff --git a/lib/components/TimeSeriesViewer/TimeSeriesViewerContext.js b/lib/components/TimeSeriesViewer/TimeSeriesViewerContext.js index 1e2952f1..fc8d3c01 100644 --- a/lib/components/TimeSeriesViewer/TimeSeriesViewerContext.js +++ b/lib/components/TimeSeriesViewer/TimeSeriesViewerContext.js @@ -5,7 +5,7 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi Object.defineProperty(exports, "__esModule", { value: true }); -exports.getTestableItems = exports.default = exports.summarizeTimeSteps = exports.TIME_STEPS = exports.TabComponentPropTypes = exports.Y_AXIS_RANGE_MODE_DETAILS = exports.Y_AXIS_RANGE_MODES = exports.TIME_SERIES_VIEWER_STATUS_TITLES = exports.TIME_SERIES_VIEWER_STATUS = void 0; +exports.getTestableItems = exports.default = exports.summarizeTimeSteps = exports.TIME_STEPS = exports.DEFAULT_STATE = exports.TabComponentPropTypes = exports.Y_AXIS_RANGE_MODE_DETAILS = exports.Y_AXIS_RANGE_MODES = exports.TIME_SERIES_VIEWER_STATUS_TITLES = exports.TIME_SERIES_VIEWER_STATUS = void 0; var _react = _interopRequireWildcard(require("react")); @@ -143,9 +143,20 @@ var generateYAxisRange = function generateYAxisRange() { if (!Object.keys(Y_AXIS_RANGE_MODES).includes(rangeMode) || !Number.isFinite(standardDeviation) || !Number.isFinite(precision)) { return axisRange; + } // Most of the time the margin for our auto-generated axis range is one standard deviation above + // and below our high and low values of our data range. Edge cases for when stddev is zero: + // * Data range is flat at zero: margin of 1 + // * Data range is flat at another value: margin of half the absolute value above and below + + + var margin = 1; + + if (standardDeviation !== 0) { + margin = standardDeviation; + } else if (dataRange[0] !== 0) { + margin = Math.abs(dataRange[0] / 2); } - var margin = standardDeviation !== 0 ? standardDeviation : dataRange[0] / 2; var low = (dataRange[0] || 0) - margin; var high = (dataRange[1] || 0) + margin; low = parseFloat(low.toFixed(precision), 10); @@ -237,6 +248,7 @@ var DEFAULT_STATE = { availableQualityFlags: new Set(), availableTimeSteps: new Set(['auto']) }; +exports.DEFAULT_STATE = DEFAULT_STATE; var Context = /*#__PURE__*/(0, _react.createContext)((0, _cloneDeep.default)(DEFAULT_STATE)); var useTimeSeriesViewerState = function useTimeSeriesViewerState() { diff --git a/lib/components/TimeSeriesViewer/TimeSeriesViewerSites.d.ts b/lib/components/TimeSeriesViewer/TimeSeriesViewerSites.d.ts index 8b504ca2..b907f408 100644 --- a/lib/components/TimeSeriesViewer/TimeSeriesViewerSites.d.ts +++ b/lib/components/TimeSeriesViewer/TimeSeriesViewerSites.d.ts @@ -6,4 +6,179 @@ declare namespace TimeSeriesViewerSites { export { TabComponentPropTypes as propTypes }; } export default TimeSeriesViewerSites; +export function getTestableItems(): { + ucWord?: undefined; + PositionHistoryButton?: undefined; + PositionDetail?: undefined; + SelectedPosition?: undefined; + SelectPositionsButton?: undefined; + SitesControl?: undefined; + SiteOption?: undefined; + SelectedSite?: undefined; +} | { + ucWord: (word: any) => string; + PositionHistoryButton: typeof PositionHistoryButton; + PositionDetail: typeof PositionDetail; + SelectedPosition: typeof SelectedPosition; + SelectPositionsButton: typeof SelectPositionsButton; + SitesControl: typeof SitesControl; + SiteOption: typeof SiteOption; + SelectedSite: typeof SelectedSite; +}; import { TabComponentPropTypes } from "./TimeSeriesViewerContext"; +/** + PositionHistoryButton - button that opens a dialog to show all history for a given position +*/ +declare function PositionHistoryButton(props: any): JSX.Element; +declare namespace PositionHistoryButton { + export namespace propTypes { + export const siteCode: PropTypes.Validator; + export const position: PropTypes.Validator; + export const history: PropTypes.Validator<(PropTypes.InferProps<{ + 'HOR.VER': PropTypes.Validator; + azimuth: PropTypes.Validator; + pitch: PropTypes.Validator; + roll: PropTypes.Validator; + start: PropTypes.Requireable; + end: PropTypes.Requireable; + xOffset: PropTypes.Validator; + yOffset: PropTypes.Validator; + zOffset: PropTypes.Validator; + referenceStart: PropTypes.Requireable; + referenceEnd: PropTypes.Requireable; + referenceLatitude: PropTypes.Validator; + referenceLongitude: PropTypes.Validator; + referenceElevation: PropTypes.Validator; + }> | null | undefined)[]>; + } +} +/** + PositionDetail - Component to display neatly-formatted position content +*/ +declare function PositionDetail(props: any): JSX.Element; +declare namespace PositionDetail { + export namespace propTypes_1 { + const siteCode_1: PropTypes.Validator; + export { siteCode_1 as siteCode }; + const position_1: PropTypes.Validator; + export { position_1 as position }; + export const wide: PropTypes.Requireable; + } + export { propTypes_1 as propTypes }; + export namespace defaultProps { + const wide_1: boolean; + export { wide_1 as wide }; + } +} +/** + Selected Position - Component for a single deletable position paper to show within a SelectedSite +*/ +declare function SelectedPosition(props: any): JSX.Element; +declare namespace SelectedPosition { + export namespace propTypes_2 { + const siteCode_2: PropTypes.Validator; + export { siteCode_2 as siteCode }; + const position_2: PropTypes.Validator; + export { position_2 as position }; + export const disabled: PropTypes.Requireable; + } + export { propTypes_2 as propTypes }; + export namespace defaultProps_1 { + const disabled_1: boolean; + export { disabled_1 as disabled }; + } + export { defaultProps_1 as defaultProps }; +} +/** + SelectPositionsButton - button that opens a dialog for position selection +*/ +declare function SelectPositionsButton(props: any): JSX.Element; +declare namespace SelectPositionsButton { + export namespace propTypes_3 { + export const selectedSite: PropTypes.Validator; + positions: PropTypes.Validator[]>; + }>>; + } + export { propTypes_3 as propTypes }; +} +/** + SitesControl - Component for the top-level Sites search field +*/ +declare function SitesControl(props: any): JSX.Element; +declare namespace SitesControl { + export { ControlPropTypes as propTypes }; +} +/** + SiteOption - Component for a single site as it appears in the drop-down menu +*/ +declare function SiteOption(props: any): JSX.Element; +declare namespace SiteOption { + export { OptionPropTypes as propTypes }; + export { OptionDefaultProps as defaultProps }; +} +/** + Selected Site - Component for a single deletable site paper to show below the search box +*/ +declare function SelectedSite(props: any): JSX.Element; +declare namespace SelectedSite { + const propTypes_4: { + setSelectedTab: PropTypes.Validator<(...args: any[]) => any>; + TAB_IDS: PropTypes.Validator<{ + [x: string]: import("../../types/core").Nullable; + }>; + site: PropTypes.Validator; + positions: PropTypes.Validator[]>; + }>>; + disabled: PropTypes.Requireable; + }; + export { propTypes_4 as propTypes }; + export namespace defaultProps_2 { + const disabled_2: boolean; + export { disabled_2 as disabled }; + } + export { defaultProps_2 as defaultProps }; +} +import PropTypes from "prop-types"; +declare namespace ControlPropTypes { + export const children: PropTypes.Validator; + export const innerProps: PropTypes.Validator any>; + }>>; + export const innerRef: PropTypes.Validator<((...args: any[]) => any) | PropTypes.InferProps<{ + current: PropTypes.Validator; + }>>; + export const selectProps: PropTypes.Validator; +} +declare namespace OptionPropTypes { + const children_1: PropTypes.Requireable; + export { children_1 as children }; + const innerProps_1: PropTypes.Requireable; + key: PropTypes.Requireable; + onClick: PropTypes.Requireable<(...args: any[]) => any>; + onMouseMove: PropTypes.Requireable<(...args: any[]) => any>; + onMouseOver: PropTypes.Requireable<(...args: any[]) => any>; + tabIndex: PropTypes.Validator; + }>>; + export { innerProps_1 as innerProps }; + const innerRef_1: PropTypes.Requireable<((...args: any[]) => any) | PropTypes.InferProps<{ + current: PropTypes.Validator; + }>>; + export { innerRef_1 as innerRef }; + export const isFocused: PropTypes.Validator; + export const isSelected: PropTypes.Validator; + export const isDisabled: PropTypes.Requireable; + export const data: PropTypes.Validator; +} +declare namespace OptionDefaultProps { + const children_2: null; + export { children_2 as children }; + const innerProps_2: null; + export { innerProps_2 as innerProps }; + const innerRef_2: null; + export { innerRef_2 as innerRef }; + const isDisabled_1: boolean; + export { isDisabled_1 as isDisabled }; +} diff --git a/lib/components/TimeSeriesViewer/TimeSeriesViewerSites.js b/lib/components/TimeSeriesViewer/TimeSeriesViewerSites.js index 7c240581..30657086 100644 --- a/lib/components/TimeSeriesViewer/TimeSeriesViewerSites.js +++ b/lib/components/TimeSeriesViewer/TimeSeriesViewerSites.js @@ -6,6 +6,7 @@ Object.defineProperty(exports, "__esModule", { value: true }); exports.default = TimeSeriesViewerSites; +exports.getTestableItems = void 0; var _react = _interopRequireWildcard(require("react")); @@ -136,7 +137,7 @@ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) r function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } var ucWord = function ucWord(word) { - return "".concat(word.slice(0, 1)).concat(word.slice(1).toLowerCase()); + return "".concat(word.slice(0, 1).toUpperCase()).concat(word.slice(1).toLowerCase()); }; var ICON_SVGS = { @@ -469,8 +470,9 @@ function PositionHistoryButton(props) { fontWeight: '600', borderBottom: 'none' }; + var key = "".concat(start).concat(end).concat(xOffset).concat(yOffset).concat(zOffset); return /*#__PURE__*/_react.default.createElement(_TableRow.default, { - key: row.start + key: key }, /*#__PURE__*/_react.default.createElement(_TableCell.default, { component: "th", scope: "row", @@ -1365,4 +1367,19 @@ function TimeSeriesViewerSites(props) { }))); } -TimeSeriesViewerSites.propTypes = _TimeSeriesViewerContext.TabComponentPropTypes; \ No newline at end of file +TimeSeriesViewerSites.propTypes = _TimeSeriesViewerContext.TabComponentPropTypes; // Additional items exported for unit testing + +var getTestableItems = function getTestableItems() { + return process.env.NODE_ENV !== 'test' ? {} : { + ucWord: ucWord, + PositionHistoryButton: PositionHistoryButton, + PositionDetail: PositionDetail, + SelectedPosition: SelectedPosition, + SelectPositionsButton: SelectPositionsButton, + SitesControl: SitesControl, + SiteOption: SiteOption, + SelectedSite: SelectedSite + }; +}; + +exports.getTestableItems = getTestableItems; \ No newline at end of file diff --git a/lib/index.d.ts b/lib/index.d.ts index 66f81dd9..48d9adf2 100644 --- a/lib/index.d.ts +++ b/lib/index.d.ts @@ -19,9 +19,5 @@ export { default as ExternalHostProductSpecificLinks } from './components/Extern export { default as FullWidthVisualization } from './components/FullWidthVisualization'; export { default as NeonFooter } from './components/NeonFooter'; export { default as NeonHeader } from './components/NeonHeader'; -export { default as NeonMenu } from './components/NeonMenu'; -export { default as NeonUtilityBar } from './components/NeonUtilityBar'; export { default as NeonJsonLd } from './components/NeonJsonLd'; export { default as DialogBase } from './components/DialogBase'; -export { default as PopupBase } from './components/PopupBase'; -export { default as PopupLoading } from './components/PopupLoading'; diff --git a/lib/index.js b/lib/index.js index e684abe8..f8915a47 100644 --- a/lib/index.js +++ b/lib/index.js @@ -129,18 +129,6 @@ Object.defineProperty(exports, "NeonHeader", { return _NeonHeader.default; } }); -Object.defineProperty(exports, "NeonMenu", { - enumerable: true, - get: function get() { - return _NeonMenu.default; - } -}); -Object.defineProperty(exports, "NeonUtilityBar", { - enumerable: true, - get: function get() { - return _NeonUtilityBar.default; - } -}); Object.defineProperty(exports, "NeonJsonLd", { enumerable: true, get: function get() { @@ -153,18 +141,6 @@ Object.defineProperty(exports, "DialogBase", { return _DialogBase.default; } }); -Object.defineProperty(exports, "PopupBase", { - enumerable: true, - get: function get() { - return _PopupBase.default; - } -}); -Object.defineProperty(exports, "PopupLoading", { - enumerable: true, - get: function get() { - return _PopupLoading.default; - } -}); var _AopDataViewer = _interopRequireDefault(require("./components/AopDataViewer")); @@ -208,16 +184,8 @@ var _NeonFooter = _interopRequireDefault(require("./components/NeonFooter")); var _NeonHeader = _interopRequireDefault(require("./components/NeonHeader")); -var _NeonMenu = _interopRequireDefault(require("./components/NeonMenu")); - -var _NeonUtilityBar = _interopRequireDefault(require("./components/NeonUtilityBar")); - var _NeonJsonLd = _interopRequireDefault(require("./components/NeonJsonLd")); var _DialogBase = _interopRequireDefault(require("./components/DialogBase")); -var _PopupBase = _interopRequireDefault(require("./components/PopupBase")); - -var _PopupLoading = _interopRequireDefault(require("./components/PopupLoading")); - function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } \ No newline at end of file diff --git a/lib/remoteAssets/drupal-footer.html.d.ts b/lib/remoteAssets/drupal-footer.html.d.ts index a035dd34..ab1ce952 100644 --- a/lib/remoteAssets/drupal-footer.html.d.ts +++ b/lib/remoteAssets/drupal-footer.html.d.ts @@ -1,2 +1,2 @@ -declare var _default: "\n\n
\n
\n
\n
\n \"NEON\n
\n
\n

Follow Us:

\n
    \n
  • \n
  • \n
  • \n
  • \n
\n
\n\n
\n\n\n
\n \n \n
\n\n\n
\n
\n\n
\n
\n
\n
\n \n\n
\n\n
\n
\n

Copyright © Battelle, 2019-2020

\n
\n
\n

The National Ecological Observatory Network is a major facility fully funded by the National Science Foundation.

Any opinions, findings and conclusions or recommendations expressed in this material do not necessarily reflect the views of the National Science Foundation.

\n
\n
\n
\n"; +declare var _default: "\n\n
\n
\n
\n
\n \"NEON\n
\n
\n

Follow Us:

\n
    \n
  • \n
  • \n
  • \n
  • \n
\n
\n\n
\n\n\n
\n \n \n
\n\n\n
\n
\n\n
\n
\n
\n
\n \n\n
\n\n
\n
\n

Copyright © Battelle, 2019-2020

\n
\n
\n

The National Ecological Observatory Network is a major facility fully funded by the National Science Foundation.

Any opinions, findings and conclusions or recommendations expressed in this material do not necessarily reflect the views of the National Science Foundation.

\n
\n
\n
\n"; export default _default; diff --git a/lib/remoteAssets/drupal-footer.html.js b/lib/remoteAssets/drupal-footer.html.js index 8008b284..0064892a 100644 --- a/lib/remoteAssets/drupal-footer.html.js +++ b/lib/remoteAssets/drupal-footer.html.js @@ -6,6 +6,6 @@ Object.defineProperty(exports, "__esModule", { exports.default = void 0; var html; -var _default = html = "\n\n
\n
\n
\n
\n \"NEON\n
\n
\n

Follow Us:

\n
    \n
  • \n
  • \n
  • \n
  • \n
\n
\n\n
\n\n\n
\n \n \n
\n\n\n
\n
\n\n
\n
\n
\n
\n \n\n
\n\n
\n
\n

Copyright © Battelle, 2019-2020

\n
\n
\n

The National Ecological Observatory Network is a major facility fully funded by the National Science Foundation.

Any opinions, findings and conclusions or recommendations expressed in this material do not necessarily reflect the views of the National Science Foundation.

\n
\n
\n
\n"; +var _default = html = "\n\n
\n
\n
\n
\n \"NEON\n
\n
\n

Follow Us:

\n
    \n
  • \n
  • \n
  • \n
  • \n
\n
\n\n
\n\n\n
\n \n \n
\n\n\n
\n
\n\n
\n
\n
\n
\n \n\n
\n\n
\n
\n

Copyright © Battelle, 2019-2020

\n
\n
\n

The National Ecological Observatory Network is a major facility fully funded by the National Science Foundation.

Any opinions, findings and conclusions or recommendations expressed in this material do not necessarily reflect the views of the National Science Foundation.

\n
\n
\n
\n"; exports.default = _default; \ No newline at end of file diff --git a/lib/remoteAssets/drupal-header.js b/lib/remoteAssets/drupal-header.js index b0092957..a21a456d 100644 --- a/lib/remoteAssets/drupal-header.js +++ b/lib/remoteAssets/drupal-header.js @@ -39,7 +39,7 @@ require = function e(t, n, r) { try { onReady(); } catch (error) { - console.log(error); + console.error(error); } }); @@ -116,8 +116,8 @@ require = function e(t, n, r) { onResize(); // Mobile Nav trigger $(".js-mobile-nav-trigger").on("change", function (e) { - $("body")[e.target.checked ? "addClass" : "removeClass"]("js-prevent-scroll"); - console.log("mobile trigger"); + $("body")[e.target.checked ? "addClass" : "removeClass"]("js-prevent-scroll"); // console.log("mobile trigger"); + $(".subNavWrapper").each(function (e) { $(this).removeClass("depthZero depthOne depthTwo depthThree depthFour").addClass("subNavWrapper"); }); @@ -172,8 +172,8 @@ require = function e(t, n, r) { }); // ===== Mobile Back Button ==== $("nav#block-neon-main-menu ul.menu--main li.menu__item.menu__item--expanded .mobileBack").click(function (e) { - e.stopPropagation(); - console.log("mobile back"); + e.stopPropagation(); // console.log("mobile back"); + var thisParent = $(this).parent().closest(".subNavWrapper"); var depthFour = $(thisParent).hasClass("depthFour").toString(); var depthThree = $(thisParent).hasClass("depthThree").toString(); @@ -182,25 +182,31 @@ require = function e(t, n, r) { var depthZero = $(thisParent).hasClass("depthZero").toString(); if (depthFour === "true") { + // console.log('depth 4') thisParent.removeClass("depthFour"); $(thisParent).find("ul[data-depth='4'] > li.expandable").removeClass("active"); } else if (depthThree === "true") { + // console.log('depth 3') thisParent.removeClass("depthThree"); $(thisParent).find("ul[data-depth='3'] > li.expandable").removeClass("active"); } else if (depthTwo === "true") { + // console.log('depth 2') thisParent.removeClass("depthTwo"); $(thisParent).find("ul[data-depth='2'] > li.expandable").removeClass("active"); } else if (depthOne === "true") { + // console.log('depth 1') thisParent.removeClass("depthOne"); $(thisParent).find("ul[data-depth='1'] > li.expandable").removeClass("active"); } else if (depthZero === "true") { + // console.log('depth 0') thisParent.removeClass("depthZero"); $("ul[data-depth='0'] > li.menu__item--expanded").removeClass("over"); $(thisParent).find("ul[data-depth='0'] > li.expandable").removeClass("active"); $("nav#block-neon-main-menu ul[data-depth='0'] > li.menu__item--expanded .subNavWrapper").each(function (e) { $(this).removeClass("depthZero depthOne depthTwo depthThree depthFour").addClass("subNavWrapper"); }); - } else {} + } else {// console.log('depth ?') + } }); // Press esc key to close the mega menu $(document).keyup(function (e) { @@ -233,13 +239,13 @@ require = function e(t, n, r) { $('nav#block-neon-main-menu ul.menu--main[data-depth="1"] > li.expandable').click(function (e) { e.stopPropagation(); // check if item is active - var $active = $(this).hasClass("active").toString(); - console.log("level one " + $active); + var $active = $(this).hasClass("active").toString(); // console.log(`level one ${$active}`); + var $MegaMenu3rdCol = $(".subNavWrapper").hasClass("depthOne").toString(); var $MegaMenu4thCol = $(".subNavWrapper").hasClass("depthThree").toString(); if ($active === "true") { - console.log("active"); + // console.log("active"); $(this).parent().closest(".subNavWrapper").removeClass("depthOne"); $(this).parent().closest(".subNavWrapper").removeClass("depthThree"); $(this).children().find("li.active").removeClass("active"); // $(this).parent().parent().children().find('li.active').removeClass("active"); @@ -249,26 +255,22 @@ require = function e(t, n, r) { $(this).siblings("li").find("li.active").removeClass("active"); if ($MegaMenu3rdCol === "true" && $MegaMenu4thCol === "true") { - console.log("not active 1"); + // console.log("not active 1"); $(this).parent().closest(".subNavWrapper").toggleClass("depthThree"); - } else if ($MegaMenu3rdCol === "true") { - console.log("not active 2"); + } else if ($MegaMenu3rdCol === "true") {// console.log("not active 2"); } else { - console.log("not active 3"); + // console.log("not active 3"); $(this).parent().closest(".subNavWrapper").toggleClass("depthOne"); } } }); $('nav#block-neon-main-menu ul.menu--main[data-depth="2"] > li.expandable').click(function (e) { e.stopPropagation(); - console.log("level two"); + $(this).addClass("active"); $(this).parent().closest(".subNavWrapper").toggleClass("depthTwo"); - $(this).parent().closest(".subNavWrapper").toggleClass("depthThree"); }); $('nav#block-neon-main-menu ul.menu--main[data-depth="3"] > li.expandable').click(function (e) { - e.stopPropagation(); //$(this).parents("ul[data-depth='2']").children("li").removeClass("active"); - // $(this).addClass("active"); - + e.stopPropagation(); var $MegaMenu4thCol = $(".subNavWrapper").hasClass("depthThree").toString(); if ($MegaMenu4thCol !== "true") { @@ -277,31 +279,28 @@ require = function e(t, n, r) { }); $('nav#block-neon-main-menu ul.menu--main[data-depth="4"] > li.expandable').click(function (e) { e.stopPropagation(); - console.log("level four"); // - + $(this).addClass("active"); $(this).parent().closest(".subNavWrapper").toggleClass("depthFour"); }); // Add a class to the sub items that expand more sub lists - FOR the first level $("nav#block-neon-main-menu ul.menu--main[data-depth='1'] > li.expandable").click(function (e) { e.stopPropagation(); //$(this).toggleClass("active").parents("ul").children("li").removeClass("active"); - $(this).toggleClass("active").siblings("li").removeClass("active"); - console.log("remove active - Level One"); + $(this).toggleClass("active").siblings("li").removeClass("active"); // console.log("remove active - Level One"); }); // Add a class to the sub items that expand more sub lists - FOR the third level $("nav#block-neon-main-menu ul.menu--main[data-depth='3'] > li.expandable").click(function (e) { e.stopPropagation(); if ($(this).hasClass("active").toString() === "true") { - console.log("true"); + // console.log("true"); $(this).removeClass("active"); } else { - console.log("false"); + // console.log("false"); $("ul[data-depth='3']").children("li").removeClass("active"); $(this).addClass("active").siblings("li").removeClass("active"); - } + } // console.log("remove active - Level Three"); - console.log("remove active - Level Three"); }); // Hide/show Desktop Search $("li.siteSearch a.menu__link").click(function (e) { @@ -310,8 +309,7 @@ require = function e(t, n, r) { return false; }); $(".header__search-close button").click(function (e) { - e.stopPropagation(); - console.log("close mega menu"); + e.stopPropagation(); // console.log("close mega menu"); if ($(".header__search").hasClass("visually-hidden")) { return false; diff --git a/lib/remoteAssets/drupal-theme.css b/lib/remoteAssets/drupal-theme.css index f72916ba..69461aa1 100644 --- a/lib/remoteAssets/drupal-theme.css +++ b/lib/remoteAssets/drupal-theme.css @@ -2987,7 +2987,13 @@ background: none; -webkit-appearance: none; -moz-appearance: none; - appearance: none; } + appearance: none; + display: -ms-flexbox; + display: flex; + -ms-flex-pack: center; + justify-content: center; + -ms-flex-align: center; + align-items: center; } #header nav#block-neon-main-menu ul[data-depth="0"], #footer nav#block-neon-main-menu ul[data-depth="0"] { visibility: visible; width: 100%; diff --git a/lib/workers/generateTimeSeriesGraphData.d.ts b/lib/workers/generateTimeSeriesGraphData.d.ts index c0f9d17d..f0355d11 100644 --- a/lib/workers/generateTimeSeriesGraphData.d.ts +++ b/lib/workers/generateTimeSeriesGraphData.d.ts @@ -83,6 +83,6 @@ declare function monthIsValid(month: any): boolean; declare function monthToTicker(month: any): number; declare function tickerIsValid(ticker: any): boolean; declare function tickerToMonth(ticker: any): string | null; -declare function tickerToIso(ticker: any): string | null; +declare function tickerToIso(ticker: any, includeSeconds?: boolean): string | null; declare function getNextMonth(month: any): string | null; export {}; diff --git a/lib/workers/generateTimeSeriesGraphData.js b/lib/workers/generateTimeSeriesGraphData.js index 9b44fefc..489b71ff 100644 --- a/lib/workers/generateTimeSeriesGraphData.js +++ b/lib/workers/generateTimeSeriesGraphData.js @@ -115,6 +115,8 @@ function tickerToMonth(ticker) { } function tickerToIso(ticker) { + var includeSeconds = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true; + if (!tickerIsValid(ticker)) { return null; } @@ -126,7 +128,7 @@ function tickerToIso(ticker) { var hh = d.getUTCHours().toString().padStart(2, '0'); var mm = d.getUTCMinutes().toString().padStart(2, '0'); var ss = d.getUTCSeconds().toString().padStart(2, '0'); - return "".concat(YYYY, "-").concat(MM, "-").concat(DD, "T").concat(hh, ":").concat(mm, ":").concat(ss, "Z"); + return includeSeconds ? "".concat(YYYY, "-").concat(MM, "-").concat(DD, "T").concat(hh, ":").concat(mm, ":").concat(ss, "Z") : "".concat(YYYY, "-").concat(MM, "-").concat(DD, "T").concat(hh, ":").concat(mm, "Z"); } function getNextMonth(month) { @@ -405,11 +407,14 @@ function generateTimeSeriesGraphData() { } // Series data length is shorter than expected month length: // Add what data we have by going through each time step in the month and comparing to // start dates in the data set, null-filling any steps without a corresponding datum + // Note that sometimes dates come back with seconds and sometimes without, so for + // matching we look for either. var setSeriesValueByTimestamp = function setSeriesValueByTimestamp(t) { - var isodate = tickerToIso(newData[t][0].getTime()); + var isodateS = tickerToIso(newData[t][0].getTime(), true); + var isodateM = tickerToIso(newData[t][0].getTime(), false); var dataIdx = posData[month][pkg][timeStep].series[dateTimeVariable].data.findIndex(function (dateTimeVal) { - return dateTimeVal === isodate; + return dateTimeVal === isodateS || dateTimeVal === isodateM; }); newData[t][columnIdx] = dataIdx !== -1 ? posData[month][pkg][timeStep].series[variable].data[dataIdx] : null; }; diff --git a/package-lock.json b/package-lock.json index 178617c6..dec2920e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,13 +1,13 @@ { "name": "portal-core-components", - "version": "1.6.3", + "version": "1.6.5", "lockfileVersion": 1, "requires": true, "dependencies": { "@babel/cli": { - "version": "7.13.0", - "resolved": "https://registry.npmjs.org/@babel/cli/-/cli-7.13.0.tgz", - "integrity": "sha512-y5AohgeVhU+wO5kU1WGMLdocFj83xCxVjsVFa2ilII8NEwmBZvx7Ambq621FbFIK68loYJ9p43nfoi6es+rzSA==", + "version": "7.13.14", + "resolved": "https://registry.npmjs.org/@babel/cli/-/cli-7.13.14.tgz", + "integrity": "sha512-zmEFV8WBRsW+mPQumO1/4b34QNALBVReaiHJOkxhUsdo/AvYM62c+SKSuLi2aZ42t3ocK6OI0uwUXRvrIbREZw==", "dev": true, "requires": { "@nicolo-ribaudo/chokidar-2": "2.1.8-no-fsevents", @@ -31,31 +31,30 @@ } }, "@babel/compat-data": { - "version": "7.13.8", - "resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.13.8.tgz", - "integrity": "sha512-EaI33z19T4qN3xLXsGf48M2cDqa6ei9tPZlfLdb2HC+e/cFtREiRd8hdSqDbwdLB0/+gLwqJmCYASH0z2bUdog==", + "version": "7.13.12", + "resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.13.12.tgz", + "integrity": "sha512-3eJJ841uKxeV8dcN/2yGEUy+RfgQspPEgQat85umsE1rotuquQ2AbIub4S6j7c50a2d+4myc+zSlnXeIHrOnhQ==", "dev": true }, "@babel/core": { - "version": "7.13.8", - "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.13.8.tgz", - "integrity": "sha512-oYapIySGw1zGhEFRd6lzWNLWFX2s5dA/jm+Pw/+59ZdXtjyIuwlXbrId22Md0rgZVop+aVoqow2riXhBLNyuQg==", + "version": "7.13.14", + "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.13.14.tgz", + "integrity": "sha512-wZso/vyF4ki0l0znlgM4inxbdrUvCb+cVz8grxDq+6C9k6qbqoIJteQOKicaKjCipU3ISV+XedCqpL2RJJVehA==", "dev": true, "requires": { "@babel/code-frame": "^7.12.13", - "@babel/generator": "^7.13.0", - "@babel/helper-compilation-targets": "^7.13.8", - "@babel/helper-module-transforms": "^7.13.0", - "@babel/helpers": "^7.13.0", - "@babel/parser": "^7.13.4", + "@babel/generator": "^7.13.9", + "@babel/helper-compilation-targets": "^7.13.13", + "@babel/helper-module-transforms": "^7.13.14", + "@babel/helpers": "^7.13.10", + "@babel/parser": "^7.13.13", "@babel/template": "^7.12.13", - "@babel/traverse": "^7.13.0", - "@babel/types": "^7.13.0", + "@babel/traverse": "^7.13.13", + "@babel/types": "^7.13.14", "convert-source-map": "^1.7.0", "debug": "^4.1.0", "gensync": "^1.0.0-beta.2", "json5": "^2.1.2", - "lodash": "^4.17.19", "semver": "^6.3.0", "source-map": "^0.5.0" }, @@ -114,12 +113,12 @@ } }, "@babel/helper-compilation-targets": { - "version": "7.13.8", - "resolved": "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.13.8.tgz", - "integrity": "sha512-pBljUGC1y3xKLn1nrx2eAhurLMA8OqBtBP/JwG4U8skN7kf8/aqwwxpV1N6T0e7r6+7uNitIa/fUxPFagSXp3A==", + "version": "7.13.13", + "resolved": "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.13.13.tgz", + "integrity": "sha512-q1kcdHNZehBwD9jYPh3WyXcsFERi39X4I59I3NadciWtNDyZ6x+GboOxncFK0kXlKIv6BJm5acncehXWUjWQMQ==", "dev": true, "requires": { - "@babel/compat-data": "^7.13.8", + "@babel/compat-data": "^7.13.12", "@babel/helper-validator-option": "^7.12.17", "browserslist": "^4.14.5", "semver": "^6.3.0" @@ -134,9 +133,9 @@ } }, "@babel/helper-create-class-features-plugin": { - "version": "7.13.8", - "resolved": "https://registry.npmjs.org/@babel/helper-create-class-features-plugin/-/helper-create-class-features-plugin-7.13.8.tgz", - "integrity": "sha512-qioaRrKHQbn4hkRKDHbnuQ6kAxmmOF+kzKGnIfxPK4j2rckSJCpKzr/SSTlohSCiE3uAQpNDJ9FIh4baeE8W+w==", + "version": "7.13.11", + "resolved": "https://registry.npmjs.org/@babel/helper-create-class-features-plugin/-/helper-create-class-features-plugin-7.13.11.tgz", + "integrity": "sha512-ays0I7XYq9xbjCSvT+EvysLgfc3tOkwCULHjrnscGT3A9qD4sk3wXnJ3of0MAWsWGjdinFvajHU2smYuqXKMrw==", "dev": true, "requires": { "@babel/helper-function-name": "^7.12.13", @@ -235,37 +234,36 @@ } }, "@babel/helper-member-expression-to-functions": { - "version": "7.13.0", - "resolved": "https://registry.npmjs.org/@babel/helper-member-expression-to-functions/-/helper-member-expression-to-functions-7.13.0.tgz", - "integrity": "sha512-yvRf8Ivk62JwisqV1rFRMxiSMDGnN6KH1/mDMmIrij4jztpQNRoHqqMG3U6apYbGRPJpgPalhva9Yd06HlUxJQ==", + "version": "7.13.12", + "resolved": "https://registry.npmjs.org/@babel/helper-member-expression-to-functions/-/helper-member-expression-to-functions-7.13.12.tgz", + "integrity": "sha512-48ql1CLL59aKbU94Y88Xgb2VFy7a95ykGRbJJaaVv+LX5U8wFpLfiGXJJGUozsmA1oEh/o5Bp60Voq7ACyA/Sw==", "dev": true, "requires": { - "@babel/types": "^7.13.0" + "@babel/types": "^7.13.12" } }, "@babel/helper-module-imports": { - "version": "7.12.13", - "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.12.13.tgz", - "integrity": "sha512-NGmfvRp9Rqxy0uHSSVP+SRIW1q31a7Ji10cLBcqSDUngGentY4FRiHOFZFE1CLU5eiL0oE8reH7Tg1y99TDM/g==", + "version": "7.13.12", + "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.13.12.tgz", + "integrity": "sha512-4cVvR2/1B693IuOvSI20xqqa/+bl7lqAMR59R4iu39R9aOX8/JoYY1sFaNvUMyMBGnHdwvJgUrzNLoUZxXypxA==", "requires": { - "@babel/types": "^7.12.13" + "@babel/types": "^7.13.12" } }, "@babel/helper-module-transforms": { - "version": "7.13.0", - "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.13.0.tgz", - "integrity": "sha512-Ls8/VBwH577+pw7Ku1QkUWIyRRNHpYlts7+qSqBBFCW3I8QteB9DxfcZ5YJpOwH6Ihe/wn8ch7fMGOP1OhEIvw==", + "version": "7.13.14", + "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.13.14.tgz", + "integrity": "sha512-QuU/OJ0iAOSIatyVZmfqB0lbkVP0kDRiKj34xy+QNsnVZi/PA6BoSoreeqnxxa9EHFAIL0R9XOaAR/G9WlIy5g==", "dev": true, "requires": { - "@babel/helper-module-imports": "^7.12.13", - "@babel/helper-replace-supers": "^7.13.0", - "@babel/helper-simple-access": "^7.12.13", + "@babel/helper-module-imports": "^7.13.12", + "@babel/helper-replace-supers": "^7.13.12", + "@babel/helper-simple-access": "^7.13.12", "@babel/helper-split-export-declaration": "^7.12.13", "@babel/helper-validator-identifier": "^7.12.11", "@babel/template": "^7.12.13", - "@babel/traverse": "^7.13.0", - "@babel/types": "^7.13.0", - "lodash": "^4.17.19" + "@babel/traverse": "^7.13.13", + "@babel/types": "^7.13.14" } }, "@babel/helper-optimise-call-expression": { @@ -295,24 +293,24 @@ } }, "@babel/helper-replace-supers": { - "version": "7.13.0", - "resolved": "https://registry.npmjs.org/@babel/helper-replace-supers/-/helper-replace-supers-7.13.0.tgz", - "integrity": "sha512-Segd5me1+Pz+rmN/NFBOplMbZG3SqRJOBlY+mA0SxAv6rjj7zJqr1AVr3SfzUVTLCv7ZLU5FycOM/SBGuLPbZw==", + "version": "7.13.12", + "resolved": "https://registry.npmjs.org/@babel/helper-replace-supers/-/helper-replace-supers-7.13.12.tgz", + "integrity": "sha512-Gz1eiX+4yDO8mT+heB94aLVNCL+rbuT2xy4YfyNqu8F+OI6vMvJK891qGBTqL9Uc8wxEvRW92Id6G7sDen3fFw==", "dev": true, "requires": { - "@babel/helper-member-expression-to-functions": "^7.13.0", + "@babel/helper-member-expression-to-functions": "^7.13.12", "@babel/helper-optimise-call-expression": "^7.12.13", "@babel/traverse": "^7.13.0", - "@babel/types": "^7.13.0" + "@babel/types": "^7.13.12" } }, "@babel/helper-simple-access": { - "version": "7.12.13", - "resolved": "https://registry.npmjs.org/@babel/helper-simple-access/-/helper-simple-access-7.12.13.tgz", - "integrity": "sha512-0ski5dyYIHEfwpWGx5GPWhH35j342JaflmCeQmsPWcrOQDtCN6C1zKAVRFVbK53lPW2c9TsuLLSUDf0tIGJ5hA==", + "version": "7.13.12", + "resolved": "https://registry.npmjs.org/@babel/helper-simple-access/-/helper-simple-access-7.13.12.tgz", + "integrity": "sha512-7FEjbrx5SL9cWvXioDbnlYTppcZGuCY6ow3/D5vMggb2Ywgu4dMrpTJX0JdQAIcRRUElOIxF3yEooa9gUb9ZbA==", "dev": true, "requires": { - "@babel/types": "^7.12.13" + "@babel/types": "^7.13.12" } }, "@babel/helper-skip-transparent-expression-wrappers": { @@ -357,9 +355,9 @@ } }, "@babel/helpers": { - "version": "7.13.0", - "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.13.0.tgz", - "integrity": "sha512-aan1MeFPxFacZeSz6Ld7YZo5aPuqnKlD7+HZY75xQsueczFccP9A7V05+oe0XpLwHK3oLorPe9eaAUljL7WEaQ==", + "version": "7.13.10", + "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.13.10.tgz", + "integrity": "sha512-4VO883+MWPDUVRF3PhiLBUFHoX/bsLTGFpFK/HqvvfBZz2D57u9XzPVNFVBTc0PW/CWR9BXTOKt8NF4DInUHcQ==", "dev": true, "requires": { "@babel/template": "^7.12.13", @@ -368,9 +366,9 @@ } }, "@babel/highlight": { - "version": "7.13.8", - "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.13.8.tgz", - "integrity": "sha512-4vrIhfJyfNf+lCtXC2ck1rKSzDwciqF7IWFhXXrSOUC2O5DrVp+w4c6ed4AllTxhTkUP5x2tYj41VaxdVMMRDw==", + "version": "7.13.10", + "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.13.10.tgz", + "integrity": "sha512-5aPpe5XQPzflQrFwL1/QoeHkP2MsA4JCntcXHRhEsdsfPVkvPi2w7Qix4iV7t5S/oC9OodGrggd8aco1g3SZFg==", "requires": { "@babel/helper-validator-identifier": "^7.12.11", "chalk": "^2.0.0", @@ -378,11 +376,22 @@ } }, "@babel/parser": { - "version": "7.13.9", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.13.9.tgz", - "integrity": "sha512-nEUfRiARCcaVo3ny3ZQjURjHQZUo/JkEw7rLlSZy/psWGnvwXFtPcr6jb7Yb41DVW5LTe6KRq9LGleRNsg1Frw==", + "version": "7.13.13", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.13.13.tgz", + "integrity": "sha512-OhsyMrqygfk5v8HmWwOzlYjJrtLaFhF34MrfG/Z73DgYCI6ojNUTUp2TYbtnjo8PegeJp12eamsNettCQjKjVw==", "dev": true }, + "@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining": { + "version": "7.13.12", + "resolved": "https://registry.npmjs.org/@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining/-/plugin-bugfix-v8-spread-parameters-in-optional-chaining-7.13.12.tgz", + "integrity": "sha512-d0u3zWKcoZf379fOeJdr1a5WPDny4aOFZ6hlfKivgK0LY7ZxNfoaHL2fWwdGtHyVvra38FC+HVYkO+byfSA8AQ==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.13.0", + "@babel/helper-skip-transparent-expression-wrappers": "^7.12.1", + "@babel/plugin-proposal-optional-chaining": "^7.13.12" + } + }, "@babel/plugin-proposal-async-generator-functions": { "version": "7.13.8", "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-async-generator-functions/-/plugin-proposal-async-generator-functions-7.13.8.tgz", @@ -499,9 +508,9 @@ } }, "@babel/plugin-proposal-optional-chaining": { - "version": "7.13.8", - "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-optional-chaining/-/plugin-proposal-optional-chaining-7.13.8.tgz", - "integrity": "sha512-hpbBwbTgd7Cz1QryvwJZRo1U0k1q8uyBmeXOSQUjdg/A2TASkhR/rz7AyqZ/kS8kbpsNA80rOYbxySBJAqmhhQ==", + "version": "7.13.12", + "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-optional-chaining/-/plugin-proposal-optional-chaining-7.13.12.tgz", + "integrity": "sha512-fcEdKOkIB7Tf4IxrgEVeFC4zeJSTr78no9wTdBuZZbqF64kzllU0ybo2zrzm7gUQfxGhBgq4E39oRs8Zx/RMYQ==", "dev": true, "requires": { "@babel/helper-plugin-utils": "^7.13.0", @@ -922,12 +931,12 @@ } }, "@babel/plugin-transform-react-constant-elements": { - "version": "7.12.13", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-react-constant-elements/-/plugin-transform-react-constant-elements-7.12.13.tgz", - "integrity": "sha512-qmzKVTn46Upvtxv8LQoQ8mTCdUC83AOVQIQm57e9oekLT5cmK9GOMOfcWhe8jMNx4UJXn/UDhVZ/7lGofVNeDQ==", + "version": "7.13.13", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-react-constant-elements/-/plugin-transform-react-constant-elements-7.13.13.tgz", + "integrity": "sha512-SNJU53VM/SjQL0bZhyU+f4kJQz7bQQajnrZRSaU21hruG/NWY41AEM9AWXeXX90pYr/C2yAmTgI6yW3LlLrAUQ==", "dev": true, "requires": { - "@babel/helper-plugin-utils": "^7.12.13" + "@babel/helper-plugin-utils": "^7.13.0" } }, "@babel/plugin-transform-react-display-name": { @@ -940,16 +949,16 @@ } }, "@babel/plugin-transform-react-jsx": { - "version": "7.12.17", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-react-jsx/-/plugin-transform-react-jsx-7.12.17.tgz", - "integrity": "sha512-mwaVNcXV+l6qJOuRhpdTEj8sT/Z0owAVWf9QujTZ0d2ye9X/K+MTOTSizcgKOj18PGnTc/7g1I4+cIUjsKhBcw==", + "version": "7.13.12", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-react-jsx/-/plugin-transform-react-jsx-7.13.12.tgz", + "integrity": "sha512-jcEI2UqIcpCqB5U5DRxIl0tQEProI2gcu+g8VTIqxLO5Iidojb4d77q+fwGseCvd8af/lJ9masp4QWzBXFE2xA==", "dev": true, "requires": { "@babel/helper-annotate-as-pure": "^7.12.13", - "@babel/helper-module-imports": "^7.12.13", - "@babel/helper-plugin-utils": "^7.12.13", + "@babel/helper-module-imports": "^7.13.12", + "@babel/helper-plugin-utils": "^7.13.0", "@babel/plugin-syntax-jsx": "^7.12.13", - "@babel/types": "^7.12.17" + "@babel/types": "^7.13.12" } }, "@babel/plugin-transform-react-jsx-development": { @@ -1096,15 +1105,16 @@ } }, "@babel/preset-env": { - "version": "7.13.9", - "resolved": "https://registry.npmjs.org/@babel/preset-env/-/preset-env-7.13.9.tgz", - "integrity": "sha512-mcsHUlh2rIhViqMG823JpscLMesRt3QbMsv1+jhopXEb3W2wXvQ9QoiOlZI9ZbR3XqPtaFpZwEZKYqGJnGMZTQ==", + "version": "7.13.12", + "resolved": "https://registry.npmjs.org/@babel/preset-env/-/preset-env-7.13.12.tgz", + "integrity": "sha512-JzElc6jk3Ko6zuZgBtjOd01pf9yYDEIH8BcqVuYIuOkzOwDesoa/Nz4gIo4lBG6K861KTV9TvIgmFuT6ytOaAA==", "dev": true, "requires": { - "@babel/compat-data": "^7.13.8", - "@babel/helper-compilation-targets": "^7.13.8", + "@babel/compat-data": "^7.13.12", + "@babel/helper-compilation-targets": "^7.13.10", "@babel/helper-plugin-utils": "^7.13.0", "@babel/helper-validator-option": "^7.12.17", + "@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining": "^7.13.12", "@babel/plugin-proposal-async-generator-functions": "^7.13.8", "@babel/plugin-proposal-class-properties": "^7.13.0", "@babel/plugin-proposal-dynamic-import": "^7.13.8", @@ -1115,7 +1125,7 @@ "@babel/plugin-proposal-numeric-separator": "^7.12.13", "@babel/plugin-proposal-object-rest-spread": "^7.13.8", "@babel/plugin-proposal-optional-catch-binding": "^7.13.8", - "@babel/plugin-proposal-optional-chaining": "^7.13.8", + "@babel/plugin-proposal-optional-chaining": "^7.13.12", "@babel/plugin-proposal-private-methods": "^7.13.0", "@babel/plugin-proposal-unicode-property-regex": "^7.12.13", "@babel/plugin-syntax-async-generators": "^7.8.4", @@ -1163,7 +1173,7 @@ "@babel/plugin-transform-unicode-escapes": "^7.12.13", "@babel/plugin-transform-unicode-regex": "^7.12.13", "@babel/preset-modules": "^0.1.4", - "@babel/types": "^7.13.0", + "@babel/types": "^7.13.12", "babel-plugin-polyfill-corejs2": "^0.1.4", "babel-plugin-polyfill-corejs3": "^0.1.3", "babel-plugin-polyfill-regenerator": "^0.1.2", @@ -1193,15 +1203,16 @@ } }, "@babel/preset-react": { - "version": "7.12.13", - "resolved": "https://registry.npmjs.org/@babel/preset-react/-/preset-react-7.12.13.tgz", - "integrity": "sha512-TYM0V9z6Abb6dj1K7i5NrEhA13oS5ujUYQYDfqIBXYHOc2c2VkFgc+q9kyssIyUfy4/hEwqrgSlJ/Qgv8zJLsA==", + "version": "7.13.13", + "resolved": "https://registry.npmjs.org/@babel/preset-react/-/preset-react-7.13.13.tgz", + "integrity": "sha512-gx+tDLIE06sRjKJkVtpZ/t3mzCDOnPG+ggHZG9lffUbX8+wC739x20YQc9V35Do6ZAxaUc/HhVHIiOzz5MvDmA==", "dev": true, "requires": { - "@babel/helper-plugin-utils": "^7.12.13", + "@babel/helper-plugin-utils": "^7.13.0", + "@babel/helper-validator-option": "^7.12.17", "@babel/plugin-transform-react-display-name": "^7.12.13", - "@babel/plugin-transform-react-jsx": "^7.12.13", - "@babel/plugin-transform-react-jsx-development": "^7.12.12", + "@babel/plugin-transform-react-jsx": "^7.13.12", + "@babel/plugin-transform-react-jsx-development": "^7.12.17", "@babel/plugin-transform-react-pure-annotations": "^7.12.1" } }, @@ -1217,17 +1228,17 @@ } }, "@babel/runtime": { - "version": "7.13.9", - "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.13.9.tgz", - "integrity": "sha512-aY2kU+xgJ3dJ1eU6FMB9EH8dIe8dmusF1xEku52joLvw6eAFN0AI+WxCLDnpev2LEejWBAy2sBvBOBAjI3zmvA==", + "version": "7.13.10", + "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.13.10.tgz", + "integrity": "sha512-4QPkjJq6Ns3V/RgpEahRk+AGfL0eO6RHHtTWoNNr5mO49G6B5+X6d6THgWEAvTrznU5xYpbAlVKRYcsCgh/Akw==", "requires": { "regenerator-runtime": "^0.13.4" } }, "@babel/runtime-corejs3": { - "version": "7.13.9", - "resolved": "https://registry.npmjs.org/@babel/runtime-corejs3/-/runtime-corejs3-7.13.9.tgz", - "integrity": "sha512-p6WSr71+5u/VBf1KDS/Y4dK3ZwbV+DD6wQO3X2EbUVluEOiyXUk09DzcwSaUH4WomYXrEPC+i2rqzuthhZhOJw==", + "version": "7.13.10", + "resolved": "https://registry.npmjs.org/@babel/runtime-corejs3/-/runtime-corejs3-7.13.10.tgz", + "integrity": "sha512-x/XYVQ1h684pp1mJwOV4CyvqZXqbc8CMsMGUnAbuc82ZCdv1U63w5RSUzgDSXQHG5Rps/kiksH6g2D5BuaKyXg==", "requires": { "core-js-pure": "^3.0.0", "regenerator-runtime": "^0.13.4" @@ -1245,20 +1256,19 @@ } }, "@babel/traverse": { - "version": "7.13.0", - "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.13.0.tgz", - "integrity": "sha512-xys5xi5JEhzC3RzEmSGrs/b3pJW/o87SypZ+G/PhaE7uqVQNv/jlmVIBXuoh5atqQ434LfXV+sf23Oxj0bchJQ==", + "version": "7.13.13", + "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.13.13.tgz", + "integrity": "sha512-CblEcwmXKR6eP43oQGG++0QMTtCjAsa3frUuzHoiIJWpaIIi8dwMyEFUJoXRLxagGqCK+jALRwIO+o3R9p/uUg==", "dev": true, "requires": { "@babel/code-frame": "^7.12.13", - "@babel/generator": "^7.13.0", + "@babel/generator": "^7.13.9", "@babel/helper-function-name": "^7.12.13", "@babel/helper-split-export-declaration": "^7.12.13", - "@babel/parser": "^7.13.0", - "@babel/types": "^7.13.0", + "@babel/parser": "^7.13.13", + "@babel/types": "^7.13.13", "debug": "^4.1.0", - "globals": "^11.1.0", - "lodash": "^4.17.19" + "globals": "^11.1.0" }, "dependencies": { "debug": { @@ -1279,9 +1289,9 @@ } }, "@babel/types": { - "version": "7.13.0", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.13.0.tgz", - "integrity": "sha512-hE+HE8rnG1Z6Wzo+MhaKE5lM5eMx71T4EHJgku2E3xIfaULhDcxiiRxUYgwX8qwP1BBSlag+TdGOt6JAidIZTA==", + "version": "7.13.14", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.13.14.tgz", + "integrity": "sha512-A2aa3QTkWoyqsZZFl56MLUsfmh7O0gN41IPvXAE/++8ojpbz12SszD7JEGYVdn4f9Kt4amIei07swF1h4AqmmQ==", "requires": { "@babel/helper-validator-identifier": "^7.12.11", "lodash": "^4.17.19", @@ -2141,9 +2151,9 @@ } }, "@material-ui/pickers": { - "version": "3.2.10", - "resolved": "https://registry.npmjs.org/@material-ui/pickers/-/pickers-3.2.10.tgz", - "integrity": "sha512-B8G6Obn5S3RCl7hwahkQj9sKUapwXWFjiaz/Bsw1fhYFdNMnDUolRiWQSoKPb1/oKe37Dtfszoywi1Ynbo3y8w==", + "version": "3.3.10", + "resolved": "https://registry.npmjs.org/@material-ui/pickers/-/pickers-3.3.10.tgz", + "integrity": "sha512-hS4pxwn1ZGXVkmgD4tpFpaumUaAg2ZzbTrxltfC5yPw4BJV+mGkfnQOB4VpWEYZw2jv65Z0wLwDE/piQiPPZ3w==", "requires": { "@babel/runtime": "^7.6.0", "@date-io/core": "1.x", @@ -2496,9 +2506,9 @@ } }, "@testing-library/react-hooks": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/@testing-library/react-hooks/-/react-hooks-5.1.0.tgz", - "integrity": "sha512-ChRyyA14e0CeVkWGp24v8q/IiWUqH+B8daRx4lGZme4dsudmMNWz+Qo2Q2NzbD2O5rAVXh2hSbS/KTKeqHYhkw==", + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/@testing-library/react-hooks/-/react-hooks-5.1.1.tgz", + "integrity": "sha512-52D2XnpelFDefnWpy/V6z2qGNj8JLIvW5DjYtelMvFXdEyWiykSaI7IXHwFy4ICoqXJDmmwHAiFRiFboub/U5g==", "dev": true, "requires": { "@babel/runtime": "^7.12.5", @@ -2510,9 +2520,9 @@ } }, "@types/babel__core": { - "version": "7.1.12", - "resolved": "https://registry.npmjs.org/@types/babel__core/-/babel__core-7.1.12.tgz", - "integrity": "sha512-wMTHiiTiBAAPebqaPiPDLFA4LYPKr6Ph0Xq/6rq1Ur3v66HXyG+clfR9CNETkD7MQS8ZHvpQOtA53DLws5WAEQ==", + "version": "7.1.14", + "resolved": "https://registry.npmjs.org/@types/babel__core/-/babel__core-7.1.14.tgz", + "integrity": "sha512-zGZJzzBUVDo/eV6KgbE0f0ZI7dInEYvo12Rb70uNQDshC3SkRMb67ja0GgRHZgAX3Za6rhaWlvbDO8rrGyAb1g==", "dev": true, "requires": { "@babel/parser": "^7.1.0", @@ -2542,9 +2552,9 @@ } }, "@types/babel__traverse": { - "version": "7.11.0", - "resolved": "https://registry.npmjs.org/@types/babel__traverse/-/babel__traverse-7.11.0.tgz", - "integrity": "sha512-kSjgDMZONiIfSH1Nxcr5JIRMwUetDki63FSQfpTCz8ogF3Ulqm8+mr5f78dUYs6vMiB6gBusQqfQmBvHZj/lwg==", + "version": "7.11.1", + "resolved": "https://registry.npmjs.org/@types/babel__traverse/-/babel__traverse-7.11.1.tgz", + "integrity": "sha512-Vs0hm0vPahPMYi9tDjtP66llufgO3ST16WXaSTtDGEl9cewAl3AibmxWw6TINOqHPT9z0uABKAYjT9jNSg4npw==", "dev": true, "requires": { "@babel/types": "^7.3.0" @@ -2581,6 +2591,15 @@ "resolved": "https://registry.npmjs.org/@types/history/-/history-4.7.8.tgz", "integrity": "sha512-S78QIYirQcUoo6UJZx9CSP0O2ix9IaeAXwQi26Rhr/+mg7qqPy8TzaxHSUut7eGjL8WmLccT7/MXf304WjqHcA==" }, + "@types/hoist-non-react-statics": { + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/@types/hoist-non-react-statics/-/hoist-non-react-statics-3.3.1.tgz", + "integrity": "sha512-iMIqiko6ooLrTh1joXodJK5X9xeEALT1kM5G3ZLhD3hszxBdIEd5C75U834D9mLcINgD4OyZf5uQXjkuYydWvA==", + "requires": { + "@types/react": "*", + "hoist-non-react-statics": "^3.3.0" + } + }, "@types/istanbul-lib-coverage": { "version": "2.0.3", "resolved": "https://registry.npmjs.org/@types/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.3.tgz", @@ -2618,15 +2637,15 @@ "dev": true }, "@types/minimatch": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/@types/minimatch/-/minimatch-3.0.3.tgz", - "integrity": "sha512-tHq6qdbT9U1IRSGf14CL0pUlULksvY9OZ+5eEgl1N7t+OA3tGvNpxJCzuKQlsNgCVwbAs670L1vcVQi8j9HjnA==", + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/@types/minimatch/-/minimatch-3.0.4.tgz", + "integrity": "sha512-1z8k4wzFnNjVK/tlxvrWuK5WMt6mydWWP7+zvH5eFep4oj+UkrfiJTRtjCeBXNpwaA/FYqqtb4/QS4ianFpIRA==", "dev": true }, "@types/node": { - "version": "14.14.32", - "resolved": "https://registry.npmjs.org/@types/node/-/node-14.14.32.tgz", - "integrity": "sha512-/Ctrftx/zp4m8JOujM5ZhwzlWLx22nbQJiVqz8/zE15gOeEW+uly3FSX4fGFpcfEvFzXcMCJwq9lGVWgyARXhg==", + "version": "14.14.37", + "resolved": "https://registry.npmjs.org/@types/node/-/node-14.14.37.tgz", + "integrity": "sha512-XYmBiy+ohOR4Lh5jE379fV2IU+6Jn4g5qASinhitfyO71b/sCo6MKsMLF5tc7Zf2CE8hViVQyYSobJNke8OvUw==", "dev": true }, "@types/parse-json": { @@ -2669,18 +2688,29 @@ } }, "@types/react-dom": { - "version": "17.0.2", - "resolved": "https://registry.npmjs.org/@types/react-dom/-/react-dom-17.0.2.tgz", - "integrity": "sha512-Icd9KEgdnFfJs39KyRyr0jQ7EKhq8U6CcHRMGAS45fp5qgUvxL3ujUCfWFttUK2UErqZNj97t9gsVPNAqcwoCg==", + "version": "17.0.3", + "resolved": "https://registry.npmjs.org/@types/react-dom/-/react-dom-17.0.3.tgz", + "integrity": "sha512-4NnJbCeWE+8YBzupn/YrJxZ8VnjcJq5iR1laqQ1vkpQgBiA7bwk0Rp24fxsdNinzJY2U+HHS4dJJDPdoMjdJ7w==", "dev": true, "requires": { "@types/react": "*" } }, + "@types/react-redux": { + "version": "7.1.16", + "resolved": "https://registry.npmjs.org/@types/react-redux/-/react-redux-7.1.16.tgz", + "integrity": "sha512-f/FKzIrZwZk7YEO9E1yoxIuDNRiDducxkFlkw/GNMGEnK9n4K8wJzlJBghpSuOVDgEUHoDkDF7Gi9lHNQR4siw==", + "requires": { + "@types/hoist-non-react-statics": "^3.3.0", + "@types/react": "*", + "hoist-non-react-statics": "^3.3.0", + "redux": "^4.0.0" + } + }, "@types/react-router": { - "version": "5.1.12", - "resolved": "https://registry.npmjs.org/@types/react-router/-/react-router-5.1.12.tgz", - "integrity": "sha512-0bhXQwHYfMeJlCh7mGhc0VJTRm0Gk+Z8T00aiP4702mDUuLs9SMhnd2DitpjWFjdOecx2UXtICK14H9iMnziGA==", + "version": "5.1.13", + "resolved": "https://registry.npmjs.org/@types/react-router/-/react-router-5.1.13.tgz", + "integrity": "sha512-ZIuaO9Yrln54X6elg8q2Ivp6iK6p4syPsefEYAhRDAoqNh48C8VYUmB9RkXjKSQAJSJV0mbIFCX7I4vZDcHrjg==", "requires": { "@types/history": "*", "@types/react": "*" @@ -2807,9 +2837,9 @@ "dev": true }, "semver": { - "version": "7.3.4", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.4.tgz", - "integrity": "sha512-tCfb2WLjqFAtXn4KEdxIhalnRtoKFN7nAwj0B3ZXCbQloV2tq5eDbcTmT68JJD3nRJq24/XgxtQKFIpQdtvmVw==", + "version": "7.3.5", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.5.tgz", + "integrity": "sha512-PoeGJYh8HK4BTO/a9Tf6ZG3veo/A7ZVsYrSA6J8ny9nb3B1VrpkuN+z9OE5wfE5p6H4LchYZsegiQgbJD94ZFQ==", "dev": true, "requires": { "lru-cache": "^6.0.0" @@ -2881,9 +2911,9 @@ "dev": true }, "semver": { - "version": "7.3.4", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.4.tgz", - "integrity": "sha512-tCfb2WLjqFAtXn4KEdxIhalnRtoKFN7nAwj0B3ZXCbQloV2tq5eDbcTmT68JJD3nRJq24/XgxtQKFIpQdtvmVw==", + "version": "7.3.5", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.5.tgz", + "integrity": "sha512-PoeGJYh8HK4BTO/a9Tf6ZG3veo/A7ZVsYrSA6J8ny9nb3B1VrpkuN+z9OE5wfE5p6H4LchYZsegiQgbJD94ZFQ==", "dev": true, "requires": { "lru-cache": "^6.0.0" @@ -3140,14 +3170,6 @@ "integrity": "sha512-7evsyfH1cLOCdAzZAd43Cic04yKydNx0cF+7tiA19p1XnLLPU4dpCQOqpjqwokFe//vS0QqfqqjCS2JkiIs0cA==", "dev": true }, - "add-dom-event-listener": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/add-dom-event-listener/-/add-dom-event-listener-1.1.0.tgz", - "integrity": "sha512-WCxx1ixHT0GQU9hb0KI/mhgRQhnU+U3GvwY6ZvVjYq8rsihIGoaIOUbY0yMPBxLH5MDtr0kz3fisWGNcbWW7Jw==", - "requires": { - "object-assign": "4.x" - } - }, "address": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/address/-/address-1.1.2.tgz", @@ -3224,18 +3246,18 @@ "dev": true }, "ansi-escapes": { - "version": "4.3.1", - "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-4.3.1.tgz", - "integrity": "sha512-JWF7ocqNrp8u9oqpgV+wH5ftbt+cfvv+PTjOvKLT3AdYly/LmORARfEVT1iyjwN+4MqE5UmVKoAdIBqeoCHgLA==", + "version": "4.3.2", + "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-4.3.2.tgz", + "integrity": "sha512-gKXj5ALrKWQLsYG9jlTRmR/xKluxHV+Z9QEwNIgCfM1/uwPMCuzVVnh5mwTd+OuBZcwSIMbqssNWRm1lE51QaQ==", "dev": true, "requires": { - "type-fest": "^0.11.0" + "type-fest": "^0.21.3" }, "dependencies": { "type-fest": { - "version": "0.11.0", - "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.11.0.tgz", - "integrity": "sha512-OdjXJxnCN1AvyLSzeKIgXTXxV+99ZuXl3Hpo9XpJAv9MBcHrrJOQ5kV7ypXOuQie+AmWG25hLbiKdwYTifzcfQ==", + "version": "0.21.3", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.21.3.tgz", + "integrity": "sha512-t0rzBq87m3fVcduHDUFhKmyyX+9eo6WQjZvf51Ea/M0Q7+T374Jp1aUiyUl0GKxp8M/OETVHSDvmkyPgvX+X2w==", "dev": true } } @@ -4138,6 +4160,7 @@ "version": "6.26.0", "resolved": "https://registry.npmjs.org/babel-runtime/-/babel-runtime-6.26.0.tgz", "integrity": "sha1-llxwWGaOgrVde/4E/yM3vItWR/4=", + "dev": true, "requires": { "core-js": "^2.4.0", "regenerator-runtime": "^0.11.0" @@ -4146,12 +4169,14 @@ "core-js": { "version": "2.6.12", "resolved": "https://registry.npmjs.org/core-js/-/core-js-2.6.12.tgz", - "integrity": "sha512-Kb2wC0fvsWfQrgk8HU5lW6U/Lcs8+9aaYcy4ZFc6DDlo4nZ7n70dEgE5rtR0oG6ufKDUnrwfWL1mXR5ljDatrQ==" + "integrity": "sha512-Kb2wC0fvsWfQrgk8HU5lW6U/Lcs8+9aaYcy4ZFc6DDlo4nZ7n70dEgE5rtR0oG6ufKDUnrwfWL1mXR5ljDatrQ==", + "dev": true }, "regenerator-runtime": { "version": "0.11.1", "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.11.1.tgz", - "integrity": "sha512-MguG95oij0fC3QV3URf4V2SDYGJhJnJGqvIIgdECeODCT98wSWDAJ94SSuVpYQUoTcGUIL6L4yNB7j1DFFHSBg==" + "integrity": "sha512-MguG95oij0fC3QV3URf4V2SDYGJhJnJGqvIIgdECeODCT98wSWDAJ94SSuVpYQUoTcGUIL6L4yNB7j1DFFHSBg==", + "dev": true } } }, @@ -4710,9 +4735,9 @@ } }, "caniuse-lite": { - "version": "1.0.30001197", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001197.tgz", - "integrity": "sha512-8aE+sqBqtXz4G8g35Eg/XEaFr2N7rd/VQ6eABGBmNtcB8cN6qNJhMi6oSFy4UWWZgqgL3filHT8Nha4meu3tsw==", + "version": "1.0.30001205", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001205.tgz", + "integrity": "sha512-TL1GrS5V6LElbitPazidkBMD9sa448bQDDLrumDqaggmKFcuU2JW1wTOHJPukAcOMtEmLcmDJEzfRrf+GjM0Og==", "dev": true }, "canvg": { @@ -5115,25 +5140,12 @@ "integrity": "sha1-3dgA2gxmEnOTzKWVDqloo6rxJTs=", "dev": true }, - "component-classes": { - "version": "1.2.6", - "resolved": "https://registry.npmjs.org/component-classes/-/component-classes-1.2.6.tgz", - "integrity": "sha1-xkI5TDYYpNiwuJGe/Mu9kw5c1pE=", - "requires": { - "component-indexof": "0.0.3" - } - }, "component-emitter": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/component-emitter/-/component-emitter-1.3.0.tgz", "integrity": "sha512-Rd3se6QB+sO1TwqZjscQrurpEPIfO0/yYnSin6Q/rD3mOutHvUrCAhJub3r90uNb+SESBuE0QYoB90YdfatsRg==", "dev": true }, - "component-indexof": { - "version": "0.0.3", - "resolved": "https://registry.npmjs.org/component-indexof/-/component-indexof-0.0.3.tgz", - "integrity": "sha1-EdCRMSI5648yyPJa6csAL/6NPCQ=" - }, "compose-function": { "version": "3.0.3", "resolved": "https://registry.npmjs.org/compose-function/-/compose-function-3.0.3.tgz", @@ -5354,14 +5366,14 @@ } }, "core-js": { - "version": "3.9.1", - "resolved": "https://registry.npmjs.org/core-js/-/core-js-3.9.1.tgz", - "integrity": "sha512-gSjRvzkxQc1zjM/5paAmL4idJBFzuJoo+jDjF1tStYFMV2ERfD02HhahhCGXUyHxQRG4yFKVSdO6g62eoRMcDg==" + "version": "3.10.0", + "resolved": "https://registry.npmjs.org/core-js/-/core-js-3.10.0.tgz", + "integrity": "sha512-MQx/7TLgmmDVamSyfE+O+5BHvG1aUGj/gHhLn1wVtm2B5u1eVIPvh7vkfjwWKNCjrTJB8+He99IntSQ1qP+vYQ==" }, "core-js-compat": { - "version": "3.9.1", - "resolved": "https://registry.npmjs.org/core-js-compat/-/core-js-compat-3.9.1.tgz", - "integrity": "sha512-jXAirMQxrkbiiLsCx9bQPJFA6llDadKMpYrBJQJ3/c4/vsPP/fAf29h24tviRlvwUL6AmY5CHLu2GvjuYviQqA==", + "version": "3.10.0", + "resolved": "https://registry.npmjs.org/core-js-compat/-/core-js-compat-3.10.0.tgz", + "integrity": "sha512-9yVewub2MXNYyGvuLnMHcN1k9RkvB7/ofktpeKTIaASyB88YYqGzUnu0ywMMhJrDHOMiTjSHWGzR+i7Wb9Z1kQ==", "dev": true, "requires": { "browserslist": "^4.16.3", @@ -5377,9 +5389,9 @@ } }, "core-js-pure": { - "version": "3.9.1", - "resolved": "https://registry.npmjs.org/core-js-pure/-/core-js-pure-3.9.1.tgz", - "integrity": "sha512-laz3Zx0avrw9a4QEIdmIblnVuJz8W51leY9iLThatCsFawWxC3sE4guASC78JbCin+DkwMpCdp1AVAuzL/GN7A==" + "version": "3.10.0", + "resolved": "https://registry.npmjs.org/core-js-pure/-/core-js-pure-3.10.0.tgz", + "integrity": "sha512-CC582enhrFZStO4F8lGI7QL3SYx7/AIRc+IdSi3btrQGrVsTawo5K/crmKbRrQ+MOMhNX4v+PATn0k2NN6wI7A==" }, "core-util-is": { "version": "1.0.2", @@ -5444,15 +5456,6 @@ "sha.js": "^2.4.8" } }, - "create-react-class": { - "version": "15.7.0", - "resolved": "https://registry.npmjs.org/create-react-class/-/create-react-class-15.7.0.tgz", - "integrity": "sha512-QZv4sFWG9S5RUvkTYWbflxeZX+JG7Cz0Tn33rQBJ+WFQTqTfUTjMjiv9tnfXazjsO5r0KhPs+AqCjyrQX6h2ng==", - "requires": { - "loose-envify": "^1.3.1", - "object-assign": "^4.1.1" - } - }, "cross-spawn": { "version": "6.0.5", "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-6.0.5.tgz", @@ -5505,15 +5508,6 @@ } } }, - "css-animation": { - "version": "1.6.1", - "resolved": "https://registry.npmjs.org/css-animation/-/css-animation-1.6.1.tgz", - "integrity": "sha512-/48+/BaEaHRY6kNQ2OIPzKf9A6g8WjZYjhiNDNuIVbsm5tXCGIAsHDjB4Xu1C4vXJtUWZo26O68OQkDpNBaPog==", - "requires": { - "babel-runtime": "6.x", - "component-classes": "^1.2.5" - } - }, "css-blank-pseudo": { "version": "0.1.4", "resolved": "https://registry.npmjs.org/css-blank-pseudo/-/css-blank-pseudo-0.1.4.tgz", @@ -5843,9 +5837,9 @@ }, "dependencies": { "css-tree": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/css-tree/-/css-tree-1.1.2.tgz", - "integrity": "sha512-wCoWush5Aeo48GLhfHPbmvZs59Z+M7k5+B1xDnXbdWNcEF423DoFdqSWE0PM5aNk5nI5cp1q7ms36zGApY/sKQ==", + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/css-tree/-/css-tree-1.1.3.tgz", + "integrity": "sha512-tRpdppF7TRazZrjJ6v3stzv93qxRcSsFmW6cX0Zm2NVKpxE1WV1HblnghVv9TreireHkqI/VDEsfolRF1p6y7Q==", "dev": true, "requires": { "mdn-data": "2.0.14", @@ -6199,9 +6193,9 @@ "dev": true }, "detect-node": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/detect-node/-/detect-node-2.0.4.tgz", - "integrity": "sha512-ZIzRpLJrOj7jjP2miAtgqIfmzbxa4ZOr5jJc601zklsfEx9oTzmmj2nVpIPRpNlRTIh8lc1kyViIY7BWSGNmKw==", + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/detect-node/-/detect-node-2.0.5.tgz", + "integrity": "sha512-qi86tE6hRcFHy8jI1m2VG+LaPUR1LhqDa5G8tVjuUXmOrpuAgqsA1pN0+ldgr3aKUH+QLI9hCY/OcRYisERejw==", "dev": true }, "detect-port-alt": { @@ -6351,11 +6345,6 @@ } } }, - "dom-scroll-into-view": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/dom-scroll-into-view/-/dom-scroll-into-view-1.2.1.tgz", - "integrity": "sha1-6PNnMt0ImwIBqI14Fdw/iObWbH4=" - }, "dom-serializer": { "version": "0.2.2", "resolved": "https://registry.npmjs.org/dom-serializer/-/dom-serializer-0.2.2.tgz", @@ -6411,9 +6400,9 @@ } }, "dompurify": { - "version": "2.2.6", - "resolved": "https://registry.npmjs.org/dompurify/-/dompurify-2.2.6.tgz", - "integrity": "sha512-7b7ZArhhH0SP6W2R9cqK6RjaU82FZ2UPM7RO8qN1b1wyvC/NY1FNWcX1Pu00fFOAnzEORtwXe4bPaClg6pUybQ==", + "version": "2.2.7", + "resolved": "https://registry.npmjs.org/dompurify/-/dompurify-2.2.7.tgz", + "integrity": "sha512-jdtDffdGNY+C76jvodNTu9jt5yYj59vuTUyx+wXdzcSwAGTYZDAQkQ7Iwx9zcGrA4ixC1syU4H3RZROqRxokxg==", "optional": true }, "domutils": { @@ -6542,9 +6531,9 @@ "dev": true }, "electron-to-chromium": { - "version": "1.3.683", - "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.683.tgz", - "integrity": "sha512-8mFfiAesXdEdE0DhkMKO7W9U6VU/9T3VTWwZ+4g84/YMP4kgwgFtQgUxuu7FUMcvSeKSNhFQNU+WZ68BQTLT5A==", + "version": "1.3.703", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.703.tgz", + "integrity": "sha512-SVBVhNB+4zPL+rvtWLw7PZQkw/Eqj1HQZs22xtcqW36+xoifzEOEEDEpkxSMfB6RFeSIOcG00w6z5mSqLr1Y6w==", "dev": true }, "elliptic": { @@ -7092,22 +7081,23 @@ } }, "eslint-plugin-react": { - "version": "7.22.0", - "resolved": "https://registry.npmjs.org/eslint-plugin-react/-/eslint-plugin-react-7.22.0.tgz", - "integrity": "sha512-p30tuX3VS+NWv9nQot9xIGAHBXR0+xJVaZriEsHoJrASGCJZDJ8JLNM0YqKqI0AKm6Uxaa1VUHoNEibxRCMQHA==", + "version": "7.23.1", + "resolved": "https://registry.npmjs.org/eslint-plugin-react/-/eslint-plugin-react-7.23.1.tgz", + "integrity": "sha512-MvFGhZjI8Z4HusajmSw0ougGrq3Gs4vT/0WgwksZgf5RrLrRa2oYAw56okU4tZJl8+j7IYNuTM+2RnFEuTSdRQ==", "dev": true, "requires": { - "array-includes": "^3.1.1", - "array.prototype.flatmap": "^1.2.3", + "array-includes": "^3.1.3", + "array.prototype.flatmap": "^1.2.4", "doctrine": "^2.1.0", "has": "^1.0.3", "jsx-ast-utils": "^2.4.1 || ^3.0.0", - "object.entries": "^1.1.2", - "object.fromentries": "^2.0.2", - "object.values": "^1.1.1", + "minimatch": "^3.0.4", + "object.entries": "^1.1.3", + "object.fromentries": "^2.0.4", + "object.values": "^1.1.3", "prop-types": "^15.7.2", - "resolve": "^1.18.1", - "string.prototype.matchall": "^4.0.2" + "resolve": "^2.0.0-next.3", + "string.prototype.matchall": "^4.0.4" }, "dependencies": { "doctrine": { @@ -7118,6 +7108,16 @@ "requires": { "esutils": "^2.0.2" } + }, + "resolve": { + "version": "2.0.0-next.3", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-2.0.0-next.3.tgz", + "integrity": "sha512-W8LucSynKUIDu9ylraa7ueVZ7hc0uAgJBxVsQSKOXOyle8a93qXhcz+XAXZ8bIq2d6i4Ehddn6Evt+0/UwKk6Q==", + "dev": true, + "requires": { + "is-core-module": "^2.2.0", + "path-parse": "^1.0.6" + } } } }, @@ -7234,9 +7234,9 @@ "dev": true }, "eventsource": { - "version": "1.0.7", - "resolved": "https://registry.npmjs.org/eventsource/-/eventsource-1.0.7.tgz", - "integrity": "sha512-4Ln17+vVT0k8aWq+t/bF5arcS3EpT9gYtW66EPacdj/mAFevznsnyoHLPy2BA8gbIQeIHoPsvwmfBftfcG//BQ==", + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/eventsource/-/eventsource-1.1.0.tgz", + "integrity": "sha512-VSJjT5oCNrFvCS6igjzPAt5hBzQ2qPBFIbJ03zLI9SE0mxwZpMw6BfJrbFHm1a141AavMEB8JHmBhWAd66PfCg==", "requires": { "original": "^1.0.0" } @@ -7252,9 +7252,9 @@ } }, "exec-sh": { - "version": "0.3.4", - "resolved": "https://registry.npmjs.org/exec-sh/-/exec-sh-0.3.4.tgz", - "integrity": "sha512-sEFIkc61v75sWeOe72qyrqg2Qg0OuLESziUDk/O/z2qgS15y2gWVFrI6f2Qn/qw/0/NCfCEsmNA4zOjkwEZT1A==", + "version": "0.3.6", + "resolved": "https://registry.npmjs.org/exec-sh/-/exec-sh-0.3.6.tgz", + "integrity": "sha512-nQn+hI3yp+oD0huYhKwvYI32+JFeq+XkNcD1GAo3Y/MjxsfVGmrrzrnzjWiNY6f+pUCP440fThsFh5gZrRAU/w==", "dev": true }, "execa": { @@ -7932,11 +7932,6 @@ "integrity": "sha512-DUgl6+HDzB0iEptNQEXLx/KhTmDb8tZUHSeLqpnjpknR70H0nC2t9N73BK6fN4hOvJ84pKlIQVQ4k5FFlBedKA==", "dev": true }, - "font-awesome": { - "version": "4.7.0", - "resolved": "https://registry.npmjs.org/font-awesome/-/font-awesome-4.7.0.tgz", - "integrity": "sha1-j6jPBBGhoxr9B7BtKQK7n8gVoTM=" - }, "for-in": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/for-in/-/for-in-1.0.2.tgz", @@ -8665,9 +8660,9 @@ } }, "domutils": { - "version": "2.4.4", - "resolved": "https://registry.npmjs.org/domutils/-/domutils-2.4.4.tgz", - "integrity": "sha512-jBC0vOsECI4OMdD0GC9mGn7NXPLb+Qt6KW1YDQzeQYRUFKmNG8lh7mO5HiELfr+lLQE7loDVI4QcAxV80HS+RA==", + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/domutils/-/domutils-2.5.0.tgz", + "integrity": "sha512-Ho16rzNMOFk2fPwChGh3D2D9OEHAfG19HgmRR2l+WLSsIstNsAYBzePH412bL0y5T44ejABIVfTHQ8nqi/tBCg==", "dev": true, "requires": { "dom-serializer": "^1.0.1", @@ -9147,9 +9142,9 @@ "dev": true }, "rxjs": { - "version": "6.6.6", - "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-6.6.6.tgz", - "integrity": "sha512-/oTwee4N4iWzAMAL9xdGKjkEHmIwupR3oXbQjCKywF1BeFohswF3vZdogbmEF6pZkOsXTzWkrZszrWpQTByYVg==", + "version": "6.6.7", + "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-6.6.7.tgz", + "integrity": "sha512-hTdwr+7yYNIT5n4AMYp85KA6yw2Va0FLa3Rguvbpa4W3I5xynaBZo41cM3XM+4Q6fRMj3sBYIR1VAmZMXYJvRQ==", "dev": true, "requires": { "tslib": "^1.9.0" @@ -12590,9 +12585,9 @@ } }, "jss": { - "version": "10.5.1", - "resolved": "https://registry.npmjs.org/jss/-/jss-10.5.1.tgz", - "integrity": "sha512-hbbO3+FOTqVdd7ZUoTiwpHzKXIo5vGpMNbuXH1a0wubRSWLWSBvwvaq4CiHH/U42CmjOnp6lVNNs/l+Z7ZdDmg==", + "version": "10.6.0", + "resolved": "https://registry.npmjs.org/jss/-/jss-10.6.0.tgz", + "integrity": "sha512-n7SHdCozmxnzYGXBHe0NsO0eUf9TvsHVq2MXvi4JmTn3x5raynodDVE/9VQmBdWFyyj9HpHZ2B4xNZ7MMy7lkw==", "requires": { "@babel/runtime": "^7.3.1", "csstype": "^3.0.2", @@ -12609,70 +12604,70 @@ } }, "jss-plugin-camel-case": { - "version": "10.5.1", - "resolved": "https://registry.npmjs.org/jss-plugin-camel-case/-/jss-plugin-camel-case-10.5.1.tgz", - "integrity": "sha512-9+oymA7wPtswm+zxVti1qiowC5q7bRdCJNORtns2JUj/QHp2QPXYwSNRD8+D2Cy3/CEMtdJzlNnt5aXmpS6NAg==", + "version": "10.6.0", + "resolved": "https://registry.npmjs.org/jss-plugin-camel-case/-/jss-plugin-camel-case-10.6.0.tgz", + "integrity": "sha512-JdLpA3aI/npwj3nDMKk308pvnhoSzkW3PXlbgHAzfx0yHWnPPVUjPhXFtLJzgKZge8lsfkUxvYSQ3X2OYIFU6A==", "requires": { "@babel/runtime": "^7.3.1", "hyphenate-style-name": "^1.0.3", - "jss": "10.5.1" + "jss": "10.6.0" } }, "jss-plugin-default-unit": { - "version": "10.5.1", - "resolved": "https://registry.npmjs.org/jss-plugin-default-unit/-/jss-plugin-default-unit-10.5.1.tgz", - "integrity": "sha512-D48hJBc9Tj3PusvlillHW8Fz0y/QqA7MNmTYDQaSB/7mTrCZjt7AVRROExoOHEtd2qIYKOYJW3Jc2agnvsXRlQ==", + "version": "10.6.0", + "resolved": "https://registry.npmjs.org/jss-plugin-default-unit/-/jss-plugin-default-unit-10.6.0.tgz", + "integrity": "sha512-7y4cAScMHAxvslBK2JRK37ES9UT0YfTIXWgzUWD5euvR+JR3q+o8sQKzBw7GmkQRfZijrRJKNTiSt1PBsLI9/w==", "requires": { "@babel/runtime": "^7.3.1", - "jss": "10.5.1" + "jss": "10.6.0" } }, "jss-plugin-global": { - "version": "10.5.1", - "resolved": "https://registry.npmjs.org/jss-plugin-global/-/jss-plugin-global-10.5.1.tgz", - "integrity": "sha512-jX4XpNgoaB8yPWw/gA1aPXJEoX0LNpvsROPvxlnYe+SE0JOhuvF7mA6dCkgpXBxfTWKJsno7cDSCgzHTocRjCQ==", + "version": "10.6.0", + "resolved": "https://registry.npmjs.org/jss-plugin-global/-/jss-plugin-global-10.6.0.tgz", + "integrity": "sha512-I3w7ji/UXPi3VuWrTCbHG9rVCgB4yoBQLehGDTmsnDfXQb3r1l3WIdcO8JFp9m0YMmyy2CU7UOV6oPI7/Tmu+w==", "requires": { "@babel/runtime": "^7.3.1", - "jss": "10.5.1" + "jss": "10.6.0" } }, "jss-plugin-nested": { - "version": "10.5.1", - "resolved": "https://registry.npmjs.org/jss-plugin-nested/-/jss-plugin-nested-10.5.1.tgz", - "integrity": "sha512-xXkWKOCljuwHNjSYcXrCxBnjd8eJp90KVFW1rlhvKKRXnEKVD6vdKXYezk2a89uKAHckSvBvBoDGsfZrldWqqQ==", + "version": "10.6.0", + "resolved": "https://registry.npmjs.org/jss-plugin-nested/-/jss-plugin-nested-10.6.0.tgz", + "integrity": "sha512-fOFQWgd98H89E6aJSNkEh2fAXquC9aZcAVjSw4q4RoQ9gU++emg18encR4AT4OOIFl4lQwt5nEyBBRn9V1Rk8g==", "requires": { "@babel/runtime": "^7.3.1", - "jss": "10.5.1", + "jss": "10.6.0", "tiny-warning": "^1.0.2" } }, "jss-plugin-props-sort": { - "version": "10.5.1", - "resolved": "https://registry.npmjs.org/jss-plugin-props-sort/-/jss-plugin-props-sort-10.5.1.tgz", - "integrity": "sha512-t+2vcevNmMg4U/jAuxlfjKt46D/jHzCPEjsjLRj/J56CvP7Iy03scsUP58Iw8mVnaV36xAUZH2CmAmAdo8994g==", + "version": "10.6.0", + "resolved": "https://registry.npmjs.org/jss-plugin-props-sort/-/jss-plugin-props-sort-10.6.0.tgz", + "integrity": "sha512-oMCe7hgho2FllNc60d9VAfdtMrZPo9n1Iu6RNa+3p9n0Bkvnv/XX5San8fTPujrTBScPqv9mOE0nWVvIaohNuw==", "requires": { "@babel/runtime": "^7.3.1", - "jss": "10.5.1" + "jss": "10.6.0" } }, "jss-plugin-rule-value-function": { - "version": "10.5.1", - "resolved": "https://registry.npmjs.org/jss-plugin-rule-value-function/-/jss-plugin-rule-value-function-10.5.1.tgz", - "integrity": "sha512-3gjrSxsy4ka/lGQsTDY8oYYtkt2esBvQiceGBB4PykXxHoGRz14tbCK31Zc6DHEnIeqsjMUGbq+wEly5UViStQ==", + "version": "10.6.0", + "resolved": "https://registry.npmjs.org/jss-plugin-rule-value-function/-/jss-plugin-rule-value-function-10.6.0.tgz", + "integrity": "sha512-TKFqhRTDHN1QrPTMYRlIQUOC2FFQb271+AbnetURKlGvRl/eWLswcgHQajwuxI464uZk91sPiTtdGi7r7XaWfA==", "requires": { "@babel/runtime": "^7.3.1", - "jss": "10.5.1", + "jss": "10.6.0", "tiny-warning": "^1.0.2" } }, "jss-plugin-vendor-prefixer": { - "version": "10.5.1", - "resolved": "https://registry.npmjs.org/jss-plugin-vendor-prefixer/-/jss-plugin-vendor-prefixer-10.5.1.tgz", - "integrity": "sha512-cLkH6RaPZWHa1TqSfd2vszNNgxT1W0omlSjAd6hCFHp3KIocSrW21gaHjlMU26JpTHwkc+tJTCQOmE/O1A4FKQ==", + "version": "10.6.0", + "resolved": "https://registry.npmjs.org/jss-plugin-vendor-prefixer/-/jss-plugin-vendor-prefixer-10.6.0.tgz", + "integrity": "sha512-doJ7MouBXT1lypLLctCwb4nJ6lDYqrTfVS3LtXgox42Xz0gXusXIIDboeh6UwnSmox90QpVnub7au8ybrb0krQ==", "requires": { "@babel/runtime": "^7.3.1", "css-vendor": "^2.0.8", - "jss": "10.5.1" + "jss": "10.6.0" } }, "jsx-ast-utils": { @@ -13679,9 +13674,9 @@ "dev": true }, "node-notifier": { - "version": "5.4.3", - "resolved": "https://registry.npmjs.org/node-notifier/-/node-notifier-5.4.3.tgz", - "integrity": "sha512-M4UBGcs4jeOK9CjTsYwkvH6/MzuUmGCyTW+kCY7uO+1ZVr0+FHGdPdIf5CCLqAaxnRrWidyoQlNkMIIVwbKB8Q==", + "version": "5.4.5", + "resolved": "https://registry.npmjs.org/node-notifier/-/node-notifier-5.4.5.tgz", + "integrity": "sha512-tVbHs7DyTLtzOiN78izLA85zRqB9NvEXkAf014Vx3jtSvn/xBl6bR8ZYifj+dFcFrKI21huSQgJZ6ZtL3B4HfQ==", "dev": true, "requires": { "growly": "^1.3.0", @@ -13734,9 +13729,9 @@ } }, "npm": { - "version": "6.14.11", - "resolved": "https://registry.npmjs.org/npm/-/npm-6.14.11.tgz", - "integrity": "sha512-1Zh7LjuIoEhIyjkBflSSGzfjuPQwDlghNloppjruOH5bmj9midT9qcNT0tRUZRR04shU9ekrxNy9+UTBrqeBpQ==", + "version": "6.14.12", + "resolved": "https://registry.npmjs.org/npm/-/npm-6.14.12.tgz", + "integrity": "sha512-La0TNNm1TLYaSeOyit+p3xGTRYYRsHae6/RG69MVXurZsWna9jccPP7FOi/u7V9WdiCV5OOojrfMD+WstO5MZQ==", "requires": { "JSONStream": "^1.3.5", "abbrev": "~1.1.1", @@ -16728,7 +16723,7 @@ "bundled": true }, "y18n": { - "version": "4.0.0", + "version": "4.0.1", "bundled": true }, "yallist": { @@ -18931,53 +18926,6 @@ } } }, - "rc-animate": { - "version": "2.11.1", - "resolved": "https://registry.npmjs.org/rc-animate/-/rc-animate-2.11.1.tgz", - "integrity": "sha512-1NyuCGFJG/0Y+9RKh5y/i/AalUCA51opyyS/jO2seELpgymZm2u9QV3xwODwEuzkmeQ1BDPxMLmYLcTJedPlkQ==", - "requires": { - "babel-runtime": "6.x", - "classnames": "^2.2.6", - "css-animation": "^1.3.2", - "prop-types": "15.x", - "raf": "^3.4.0", - "rc-util": "^4.15.3", - "react-lifecycles-compat": "^3.0.4" - } - }, - "rc-menu": { - "version": "5.1.4", - "resolved": "https://registry.npmjs.org/rc-menu/-/rc-menu-5.1.4.tgz", - "integrity": "sha512-ZUkUNda70GtTXcQDiO3rSDdk3sgIwDwzPUm5dVM8nRH/j84qv0BVBkIUwIBu8+s+G3G9lWLurRqh22dCqZPeOA==", - "requires": { - "babel-runtime": "6.x", - "classnames": "2.x", - "create-react-class": "^15.5.2", - "dom-scroll-into-view": "1.x", - "prop-types": "^15.5.6", - "rc-animate": "2.x", - "rc-util": "^4.0.2" - } - }, - "rc-util": { - "version": "4.21.1", - "resolved": "https://registry.npmjs.org/rc-util/-/rc-util-4.21.1.tgz", - "integrity": "sha512-Z+vlkSQVc1l8O2UjR3WQ+XdWlhj5q9BMQNLk2iOBch75CqPfrJyGtcWMcnhRlNuDu0Ndtt4kLVO8JI8BrABobg==", - "requires": { - "add-dom-event-listener": "^1.1.0", - "prop-types": "^15.5.10", - "react-is": "^16.12.0", - "react-lifecycles-compat": "^3.0.4", - "shallowequal": "^1.1.0" - }, - "dependencies": { - "react-is": { - "version": "16.13.1", - "resolved": "https://registry.npmjs.org/react-is/-/react-is-16.13.1.tgz", - "integrity": "sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ==" - } - } - }, "react": { "version": "16.14.0", "resolved": "https://registry.npmjs.org/react/-/react-16.14.0.tgz", @@ -19230,9 +19178,9 @@ "dev": true }, "rxjs": { - "version": "6.6.6", - "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-6.6.6.tgz", - "integrity": "sha512-/oTwee4N4iWzAMAL9xdGKjkEHmIwupR3oXbQjCKywF1BeFohswF3vZdogbmEF6pZkOsXTzWkrZszrWpQTByYVg==", + "version": "6.6.7", + "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-6.6.7.tgz", + "integrity": "sha512-hTdwr+7yYNIT5n4AMYp85KA6yw2Va0FLa3Rguvbpa4W3I5xynaBZo41cM3XM+4Q6fRMj3sBYIR1VAmZMXYJvRQ==", "dev": true, "requires": { "tslib": "^1.9.0" @@ -19348,9 +19296,9 @@ } }, "react-is": { - "version": "17.0.1", - "resolved": "https://registry.npmjs.org/react-is/-/react-is-17.0.1.tgz", - "integrity": "sha512-NAnt2iGDXohE5LI7uBnLnqvLQMtzhkiAOLXTmv+qnF9Ky7xAPcX8Up/xWIhxvLVGJvuLiNc4xQLtuqDRzb4fSA==" + "version": "17.0.2", + "resolved": "https://registry.npmjs.org/react-is/-/react-is-17.0.2.tgz", + "integrity": "sha512-w2GsyukL62IJnlaff/nRegPQR94C/XXamvMWmSHRJ4y7Ts/4ocGRmTHvOs8PSE6pB3dWOrD/nueuU5sduBsQ4w==" }, "react-leaflet": { "version": "2.8.0", @@ -19375,22 +19323,18 @@ "resolved": "https://registry.npmjs.org/react-leaflet-grouped-layer-control/-/react-leaflet-grouped-layer-control-0.0.13.tgz", "integrity": "sha512-+esm6AJ52uCbKbG5o5Td0olVDcQBOd0dDb0j0iw7mdOe5SOiN6HtWx1Sq2GkIfxWPjuDPUs6UmnzkQYp2Ppoag==" }, - "react-lifecycles-compat": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/react-lifecycles-compat/-/react-lifecycles-compat-3.0.4.tgz", - "integrity": "sha512-fBASbA6LnOU9dOU2eW7aQ8xmYBSXUIWr+UmF9b1efZBazGNO+rcXT/icdKnYm2pTwcRylVUYwW7H1PHfLekVzA==" - }, "react-property": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/react-property/-/react-property-1.0.1.tgz", "integrity": "sha512-1tKOwxFn3dXVomH6pM9IkLkq2Y8oh+fh/lYW3MJ/B03URswUTqttgckOlbxY2XHF3vPG6uanSc4dVsLW/wk3wQ==" }, "react-redux": { - "version": "7.2.2", - "resolved": "https://registry.npmjs.org/react-redux/-/react-redux-7.2.2.tgz", - "integrity": "sha512-8+CQ1EvIVFkYL/vu6Olo7JFLWop1qRUeb46sGtIMDCSpgwPQq8fPLpirIB0iTqFe9XYEFPHssdX8/UwN6pAkEA==", + "version": "7.2.3", + "resolved": "https://registry.npmjs.org/react-redux/-/react-redux-7.2.3.tgz", + "integrity": "sha512-ZhAmQ1lrK+Pyi0ZXNMUZuYxYAZd59wFuVDGUt536kSGdD0ya9Q7BfsE95E3TsFLE3kOSFp5m6G5qbatE+Ic1+w==", "requires": { "@babel/runtime": "^7.12.1", + "@types/react-redux": "^7.1.16", "hoist-non-react-statics": "^3.3.2", "loose-envify": "^1.4.0", "prop-types": "^15.7.2", @@ -19575,9 +19519,9 @@ }, "dependencies": { "semver": { - "version": "7.3.4", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.4.tgz", - "integrity": "sha512-tCfb2WLjqFAtXn4KEdxIhalnRtoKFN7nAwj0B3ZXCbQloV2tq5eDbcTmT68JJD3nRJq24/XgxtQKFIpQdtvmVw==", + "version": "7.3.5", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.5.tgz", + "integrity": "sha512-PoeGJYh8HK4BTO/a9Tf6ZG3veo/A7ZVsYrSA6J8ny9nb3B1VrpkuN+z9OE5wfE5p6H4LchYZsegiQgbJD94ZFQ==", "dev": true, "requires": { "lru-cache": "^6.0.0" @@ -20003,9 +19947,9 @@ "dev": true }, "regjsparser": { - "version": "0.6.7", - "resolved": "https://registry.npmjs.org/regjsparser/-/regjsparser-0.6.7.tgz", - "integrity": "sha512-ib77G0uxsA2ovgiYbCVGx4Pv3PSttAx2vIwidqQzbL2U5S4Q+j00HdSAneSBuyVcMvEnTXMjiGgB+DlXozVhpQ==", + "version": "0.6.9", + "resolved": "https://registry.npmjs.org/regjsparser/-/regjsparser-0.6.9.tgz", + "integrity": "sha512-ZqbNRz1SNjLAiYuwY0zoXW8Ne675IX5q+YHioAGbCw4X96Mjl2+dcX9B2ciaeyYjViDAfvIjFpQjJgLttTEERQ==", "dev": true, "requires": { "jsesc": "~0.5.0" @@ -20752,11 +20696,6 @@ } } }, - "shallowequal": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/shallowequal/-/shallowequal-1.1.0.tgz", - "integrity": "sha512-y0m1JoUZSlPAjXVtPPW70aZWfIL/dSP7AFkRnniLCrK/8MDKog3TySTBmckD+RObVxH0v4Tox67+F14PdED2oQ==" - }, "shebang-command": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-1.2.0.tgz", @@ -21003,16 +20942,16 @@ } }, "sockjs-client": { - "version": "1.5.0", - "resolved": "https://registry.npmjs.org/sockjs-client/-/sockjs-client-1.5.0.tgz", - "integrity": "sha512-8Dt3BDi4FYNrCFGTL/HtwVzkARrENdwOUf1ZoW/9p3M8lZdFT35jVdrHza+qgxuG9H3/shR4cuX/X9umUrjP8Q==", + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/sockjs-client/-/sockjs-client-1.5.1.tgz", + "integrity": "sha512-VnVAb663fosipI/m6pqRXakEOw7nvd7TUgdr3PlR/8V2I95QIdwT8L4nMxhyU8SmDBHYXU1TOElaKOmKLfYzeQ==", "requires": { "debug": "^3.2.6", "eventsource": "^1.0.7", "faye-websocket": "^0.11.3", "inherits": "^2.0.4", "json3": "^3.3.3", - "url-parse": "^1.4.7" + "url-parse": "^1.5.1" } }, "sort-keys": { @@ -22396,15 +22335,15 @@ "dev": true }, "unbox-primitive": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/unbox-primitive/-/unbox-primitive-1.0.0.tgz", - "integrity": "sha512-P/51NX+JXyxK/aigg1/ZgyccdAxm5K1+n8+tvqSntjOivPt19gvm1VC49RWYetsiub8WViUchdxl/KWHHB0kzA==", + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/unbox-primitive/-/unbox-primitive-1.0.1.tgz", + "integrity": "sha512-tZU/3NqK3dA5gpE1KtyiJUrEB0lxnGkMFHptJ7q6ewdZ8s12QrODwNbhIJStmJkd1QDXa1NRA8aF2A1zk/Ypyw==", "dev": true, "requires": { "function-bind": "^1.1.1", - "has-bigints": "^1.0.0", - "has-symbols": "^1.0.0", - "which-boxed-primitive": "^1.0.1" + "has-bigints": "^1.0.1", + "has-symbols": "^1.0.2", + "which-boxed-primitive": "^1.0.2" } }, "unicode-canonical-property-names-ecmascript": { @@ -23639,9 +23578,9 @@ "dev": true }, "yaml": { - "version": "1.10.0", - "resolved": "https://registry.npmjs.org/yaml/-/yaml-1.10.0.tgz", - "integrity": "sha512-yr2icI4glYaNG+KWONODapy2/jDdMSDnrONSjblABjD9B4Z5LgiircSt8m8sRZFNi08kG9Sm0uSHtEmP3zaEGg==" + "version": "1.10.2", + "resolved": "https://registry.npmjs.org/yaml/-/yaml-1.10.2.tgz", + "integrity": "sha512-r3vXyErRCYJ7wg28yvBY5VSoAF8ZvlcW9/BwUzEtUsjvX/DKs24dIkuwjtuprwJJHsbyUbLApepYTR1BN4uHrg==" }, "yargs": { "version": "13.3.2", diff --git a/package.json b/package.json index bc959738..ec11fcc3 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "portal-core-components", - "version": "1.6.4", + "version": "1.6.5", "main": "./lib/index.js", "private": true, "homepage": "http://localhost:3010/core-components", @@ -25,7 +25,6 @@ "dom-to-image": "^2.6.0", "dygraphs": "^2.1.0", "file-saver": "^2.0.2", - "font-awesome": "4.7.0", "history": "^4.10.1", "html-react-parser": "^0.10.3", "leaflet": "^1.6.0", @@ -37,7 +36,6 @@ "papaparse": "^5.1.1", "paralleljs": "^1.0.1", "prop-types": "^15.7.2", - "rc-menu": "5.1.4", "react": "^16.9.0", "react-copy-to-clipboard": "^5.0.2", "react-dom": "^16.8.6", @@ -78,7 +76,7 @@ "jest-canvas-mock": "^2.3.0", "node-fetch": "^2.6.1", "react-app-rewired": "^2.1.7", - "react-scripts": "^3.3.0", + "react-scripts": "^3.4.4", "react-test-renderer": "^16.13.1", "svg-url-loader": "^3.0.3", "svgo-loader": "^2.2.1", diff --git a/src/__mocks__/README.md b/src/__mocks__/README.md new file mode 100644 index 00000000..2f4981ef --- /dev/null +++ b/src/__mocks__/README.md @@ -0,0 +1,72 @@ +# Portal Core Components Mocks + +This directory contains mocks that can be used in unit tests to stub out complex components and facilitate test development. + + +## NeonContext.js + +Various tests cover modules that use NeonContext to get state/site/domain metadata. This mock emulated NeonContext by plugging in all fallback data and presenting itself as already "hydrated" (it will not trigger any fetches for cacheable data the way normal NeonContext does. + +### Usage + +``` +import 'path/to/src/__mocks__/NeonContext'; +``` + + +## ajax.js + +Use this mock to inject an arbitrary synchronous response wherever rjsx/ajax.getJSON is used. + +### Usage + +``` +import { mockAjaxResponse, mockAjaxError } from 'path/to/src/__mocks__/ajax'; + +// Set a mock response (for ajax() AND ajax.getJSON() methods) +mockAjaxResponse({ ...response }); + +// Set a mock error (for ajax() AND ajax.getJSON() methods) +mockAjaxError('fail'); +``` + + +## fileMock.js + +Super basic mock that returns a static stub string. This is used for stubbing the import of the primary typeface in the NEON Theme generally for all unit test suites, as defined in the top-level `package.json` for core-components. + + +## fileTransformer.js + +Basic mock that converts a file import into a string reflecting the file name. This is used for stubbing the import of various file formats (such as images) generally for all unit test suites, as defined in the top-level `package.json` for core-components. + + +## mockReactComponent.jsx + +General-purpose mock designed as a stand-in for any React component. When used the component in question will render out to snapshots as a `
` with with props mapped safely to HTML attributes. Children are kept intact and not mocked. + +### Usage + +``` +import 'path/to/__mocks__/mockReactComponent'; + +jest.mock('path/to/Component', () => mockReactComponent('path/to/Component')); +``` + +### Example + +Use this mock when snapshot tests are too complex and not due to what is actually being tested. A good example of this is when snapshot testing anything that makes use of Material UI Select or Material UI Slider. Those components, coming from a third party component library, do not require high-fidelity snapshot tests here. Also, the trees they render for snapshots are non-deterministic and complex. Here is how it would look to mock those two at the top of a test suite: + +``` +import 'path/to/__mocks__/mockReactComponent'; + +jest.mock('@material-ui/core/Select', () => mockReactComponent('@material-ui/core/Select')); +jest.mock('@material-ui/core/Slider', () => mockReactComponent('@material-ui/core/Slider')); +``` + +In the tree that renders for such a component the Select and Slider subtrees will be simple `
` tags with props and children intact. Props that cannot be rendered to strings cleanly (e.g. functions, objects with circular references, etc.) will be safely rendered out to a stub. All other props will render to strings to make for a meaningful snapshot tree. + + +## styleMock.js + +Super basic mock that returns an empty object. This is used for stubbing the import of CSS files generally for all unit test suites, as defined in the top-level `package.json` for core-components. diff --git a/src/__mocks__/ajax.js b/src/__mocks__/ajax.js index 0b3f233b..f6ea013f 100644 --- a/src/__mocks__/ajax.js +++ b/src/__mocks__/ajax.js @@ -5,7 +5,7 @@ Usage: - import { mockAjaxResponse, mockAjaxError } from ''path/to/src/__mocks__/ajax'; + import { mockAjaxResponse, mockAjaxError } from 'path/to/src/__mocks__/ajax'; // Set a mock response (for ajax() AND ajax.getJSON() methods) mockAjaxResponse({ ...response }); diff --git a/src/__mocks__/mockReactComponent.jsx b/src/__mocks__/mockReactComponent.jsx index bf84c7f6..29207359 100644 --- a/src/__mocks__/mockReactComponent.jsx +++ b/src/__mocks__/mockReactComponent.jsx @@ -27,9 +27,9 @@ export default function mockReactComponent(path) { let renderableValue = value; try { if (typeof value === 'object') { renderableValue = JSON.stringify(value); } - if (typeof value === 'function') { renderableValue = value.toString(); } + if (typeof value === 'function') { renderableValue = '[Function]'; } } catch (error) { - renderableValue = `Non-renderable ${typeof value} (${error})`; + renderableValue = `Non-renderable ${typeof value}`; } dataProps[`prop-${prop}`] = renderableValue; }); diff --git a/src/lib_components/components/AopDataViewer/__tests__/__snapshots__/AopDataViewer.jsx.snap b/src/lib_components/components/AopDataViewer/__tests__/__snapshots__/AopDataViewer.jsx.snap index 2261a3b0..2cd1f1ba 100644 --- a/src/lib_components/components/AopDataViewer/__tests__/__snapshots__/AopDataViewer.jsx.snap +++ b/src/lib_components/components/AopDataViewer/__tests__/__snapshots__/AopDataViewer.jsx.snap @@ -164,26 +164,9 @@ exports[`AopDataViewer renders with a specified initial site 1`] = ` ComponentPath="@material-ui/core/Select" prop-aria-labelledby="site-label" prop-data-selenium="aop-data-viewer.site-select" - prop-input="Non-renderable object (TypeError: Converting circular structure to JSON - --> starting at object with constructor 'Object' - | property '_context' -> object with constructor 'Object' - --- property 'Provider' closes the circle)" - prop-onChange="function - /* istanbul ignore next */ - onChange(event) { - /* istanbul ignore next */ - cov_1pyg19vp3l.f[28]++; - cov_1pyg19vp3l.s[129]++; - return handleSiteChange(event.target.value); - }" - prop-renderValue="function - /* istanbul ignore next */ - renderValue(value) { - /* istanbul ignore next */ - cov_1pyg19vp3l.f[29]++; - cov_1pyg19vp3l.s[130]++; - return value; - }" + prop-input="Non-renderable object" + prop-onChange="[Function]" + prop-renderValue="[Function]" prop-value="BONA" >
  • { variant="contained" onClick={handleOpenDialog} data-selenium="download-data-button" + endIcon={} {...gtmProps} {...other} > {label} - {!dialogOpen ? null : ( diff --git a/src/lib_components/components/DownloadDataButton/__tests__/__snapshots__/DownloadDataButton.jsx.snap b/src/lib_components/components/DownloadDataButton/__tests__/__snapshots__/DownloadDataButton.jsx.snap index 699ec68c..761bfd1f 100644 --- a/src/lib_components/components/DownloadDataButton/__tests__/__snapshots__/DownloadDataButton.jsx.snap +++ b/src/lib_components/components/DownloadDataButton/__tests__/__snapshots__/DownloadDataButton.jsx.snap @@ -25,21 +25,20 @@ exports[`DownloadDataButton Automatically includes data-gtm props from product i className="MuiButton-label" > foo - - - + + + + foo - - - + + + + foo - - - + + + + `; @@ -160,21 +157,20 @@ exports[`DownloadDataButton Renders with the dialog open from context state 1`] className="MuiButton-label" > foo - - - + + + + `; diff --git a/src/lib_components/components/DownloadStepForm/__tests__/__snapshots__/DownloadStepForm.jsx.snap b/src/lib_components/components/DownloadStepForm/__tests__/__snapshots__/DownloadStepForm.jsx.snap index aecf3f52..47c633fe 100644 --- a/src/lib_components/components/DownloadStepForm/__tests__/__snapshots__/DownloadStepForm.jsx.snap +++ b/src/lib_components/components/DownloadStepForm/__tests__/__snapshots__/DownloadStepForm.jsx.snap @@ -482,18 +482,7 @@ exports[`DownloadStepForm Step s3Files renders correctly 1`] = ` prop-data="[{\\"url\\":\\"f1\\",\\"tableData\\":\\"f1\\"},{\\"url\\":\\"f2\\",\\"tableData\\":\\"f2\\"},{\\"url\\":\\"f3\\",\\"tableData\\":\\"f3\\"}]" prop-icons="{\\"Add\\":{},\\"Check\\":{},\\"Clear\\":{},\\"Delete\\":{},\\"DetailPanel\\":{},\\"Edit\\":{},\\"Export\\":{},\\"Filter\\":{},\\"FirstPage\\":{},\\"LastPage\\":{},\\"NextPage\\":{},\\"PreviousPage\\":{},\\"ResetSearch\\":{},\\"Search\\":{},\\"SortArrow\\":{},\\"ThirdStateCheck\\":{},\\"ViewColumn\\":{}}" prop-localization="{\\"pagination\\":{\\"labelRowsSelect\\":\\"files\\"},\\"toolbar\\":{\\"nRowsSelected\\":\\"{0} files selected (12.1 KB uncompressed)\\"},\\"body\\":{\\"emptyDataSourceMessage\\":\\"No files to display. Select more sites, broaden date range, or broaden search / filters.\\"}}" - prop-onSelectionChange="function - /* istanbul ignore next */ - onSelectionChange(rows, file) { - /* istanbul ignore next */ - cov_9h6mzt5r9.f[26]++; - cov_9h6mzt5r9.s[71]++; - dispatch({ - type: 'setIndividualS3FileSelected', - url: file.url, - selected: file.tableData.checked - }); - }" + prop-onSelectionChange="[Function]" prop-options="{\\"selection\\":true,\\"showSelectAllCheckbox\\":false,\\"padding\\":\\"dense\\",\\"filtering\\":true,\\"columnsButton\\":false,\\"pageSize\\":10,\\"pageSizeOptions\\":[5,10,50,100],\\"showTitle\\":false,\\"search\\":false,\\"isLoading\\":false}" />
    { - const { drupalCssLoaded, useCoreHeader } = props; + const { drupalCssLoaded } = props; const [{ isActive: neonContextIsActive, fetches: { [DRUPAL_FOOTER_HTML]: footerFetch }, @@ -21,7 +19,7 @@ const NeonFooter = (props) => { }] = NeonContext.useNeonContextState(); let renderMode = 'legacy'; - if (!useCoreHeader && neonContextIsActive) { + if (neonContextIsActive) { switch (footerFetch.status) { case FETCH_STATUS.SUCCESS: renderMode = (footerHTML && drupalCssLoaded) ? 'drupal' : 'loading'; @@ -51,25 +49,21 @@ const NeonFooter = (props) => { ); case 'drupal-fallback': + default: return (
    {HTMLReactParser(DRUPAL_FOOTER_HTML_FALLBACK)}
    ); - - default: - return ; } }; NeonFooter.propTypes = { drupalCssLoaded: PropTypes.bool, - useCoreHeader: PropTypes.bool, }; NeonFooter.defaultProps = { drupalCssLoaded: false, - useCoreHeader: false, }; export default NeonFooter; diff --git a/src/lib_components/components/NeonFooter/NeonLegacyFooter.jsx b/src/lib_components/components/NeonFooter/NeonLegacyFooter.jsx deleted file mode 100644 index 80b4ad98..00000000 --- a/src/lib_components/components/NeonFooter/NeonLegacyFooter.jsx +++ /dev/null @@ -1,273 +0,0 @@ -import React from 'react'; -import './NeonFooter.css'; - -import { makeStyles } from '@material-ui/core/styles'; -import Divider from '@material-ui/core/Divider'; -import Hidden from '@material-ui/core/Hidden'; -import Link from '@material-ui/core/Link'; -import Grid from '@material-ui/core/Grid'; -import Container from '@material-ui/core/Container'; -import Typography from '@material-ui/core/Typography'; -import Theme from '../Theme/Theme'; - -import LogoFooter from './images/logo--footer.png'; -import NewsletterIcon from './images/social--newsletter.png'; - -require('font-awesome/css/font-awesome.min.css'); - -const useStyles = makeStyles((theme) => ({ - box: { - padding: theme.spacing(0), - margin: theme.spacing(0), - }, - container: { - padding: theme.spacing(1, 4), - backgroundColor: '#fff', - boxShadow: '0 50vh 0 50vh #fff', - }, - smContainer: { - padding: theme.spacing(2, 0), - display: 'flex', - justifyContent: 'space-around', - }, - smCaption: { - padding: theme.spacing(0), - marginBottom: theme.spacing(2), - color: theme.palette.grey[300], - textAlign: 'justify', - }, - smCopyright: { - padding: theme.spacing(0), - color: theme.palette.grey[300], - display: 'flex', - justifyContent: 'space-around', - alignItems: 'center', - }, - linkIcon: { - color: theme.palette.grey[200], - '&:hover, &:focus': { - color: theme.palette.grey[500], - }, - }, - newsletterIcon: { - verticalAlign: 'middle', - marginRight: theme.spacing(1), - opacity: 0.6, - '&:hover, &:focus': { - opacity: 1, - }, - }, - footerTextLink: { - color: '#00a1b1', - }, -})); - -export default function NeonFooter() { - const classes = useStyles(Theme); - const year = new Date().getFullYear(); - const copyrightDisplay = `© ${year.toString()} Battelle`; - const bottomCaption = ` -The National Ecological Observatory Network is a major facility fully funded by -the National Science Foundation. Any opinions, findings and conclusions or -recommendations expressed in this material do not necessarily reflect the views -of the National Science Foundation. -`; - return ( -
    - - - - - - - - Sign up for the NEON Newsletter - Newsletter - - - - - - - - - - - - - - - - - - - - - - - Contact - Careers - FAQ - Media - Terms of Use - - - - {bottomCaption} - - - - - {copyrightDisplay} - - Proudly operated by Battelle - - - - - ); -} diff --git a/src/lib_components/components/NeonFooter/__tests__/__snapshots__/NeonFooter.jsx.snap b/src/lib_components/components/NeonFooter/__tests__/__snapshots__/NeonFooter.jsx.snap index ef34ed7b..e1ca5ff5 100644 --- a/src/lib_components/components/NeonFooter/__tests__/__snapshots__/NeonFooter.jsx.snap +++ b/src/lib_components/components/NeonFooter/__tests__/__snapshots__/NeonFooter.jsx.snap @@ -53,17 +53,13 @@ exports[`NeonFooter renders with no props and error NeonContext state 1`] = ` `; exports[`NeonFooter renders with no props and inactive NeonContext state 1`] = ` -} sidebarTitle="foo" loading="Loading"> +
    content
    + , + ).toJSON(); + expect(tree).toMatchSnapshot(); + }); + test('renders with sidebar links', () => { + const StubIcon = () =>
    stub icon
    ; + const StubComponent = () =>
    stub component
    ; + const sidebarLinks = [ + { name: 'Section A' }, + { name: 'Section B', pageTitle: 'This is B', hash: '#sectionB' }, + { name: 'Section C', hash: '#sectionC', icon: StubIcon }, + { name: 'Section D', hash: '#sectionD', component: StubComponent }, + ]; + const tree = renderer.create( + More
    } + > +
    content
    + , + ).toJSON(); + expect(tree).toMatchSnapshot(); + }); + test('renders with sidebar links as standlone children', () => { + const StubComponentA = () =>
    stub component A
    ; + const StubComponentB = () =>
    stub component B
    ; + const sidebarLinks = [ + { name: 'Section A', hash: '#sectionA', component: StubComponentA }, + { name: 'Section B', hash: '#sectionA', component: StubComponentB }, + ]; + const tree = renderer.create( + +
    content
    +
    , + ).toJSON(); + expect(tree).toMatchSnapshot(); + }); + test('NeonErrorPage', () => { + const error = { + message: 'fail', + stack: 'Disregard; this is console.error() call is expected in the NeonErrorPage test', + }; + const tree = renderer.create( + {}} />, + ).toJSON(); + expect(tree).toMatchSnapshot(); + }); +}); diff --git a/src/lib_components/components/NeonPage/__tests__/__snapshots__/BrowserWarning.jsx.snap b/src/lib_components/components/NeonPage/__tests__/__snapshots__/BrowserWarning.jsx.snap new file mode 100644 index 00000000..9d603ffd --- /dev/null +++ b/src/lib_components/components/NeonPage/__tests__/__snapshots__/BrowserWarning.jsx.snap @@ -0,0 +1,178 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`NeonPage - BrowserWarning renders nothing if browser is found to be IE but ignore cookie is present 1`] = `null`; + +exports[`NeonPage - BrowserWarning renders nothing if browser is not IE 1`] = `null`; + +exports[`NeonPage - BrowserWarning renders warning if browser is found to be IE and ignore cookie is not set 1`] = ` +
    +`; diff --git a/src/lib_components/components/NeonPage/__tests__/__snapshots__/LiferayNotifications.jsx.snap b/src/lib_components/components/NeonPage/__tests__/__snapshots__/LiferayNotifications.jsx.snap new file mode 100644 index 00000000..87a48fdf --- /dev/null +++ b/src/lib_components/components/NeonPage/__tests__/__snapshots__/LiferayNotifications.jsx.snap @@ -0,0 +1,115 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`NeonPage - LiferayNotifications renders nothing if passed an empty array 1`] = `null`; + +exports[`NeonPage - LiferayNotifications renders notifications with actions if onHideNotifications is present 1`] = ` +
    +
    +
    +
    +
    +
    HTML", + } + } + /> +
    +
    +
    + +
    +
    +
    +`; + +exports[`NeonPage - LiferayNotifications renders notifications with no actions if onHideNotifications not present 1`] = ` +
    +
    +
    +
    +
    +
    HTML", + } + } + /> +
    +
    +
    +
    +`; diff --git a/src/lib_components/components/NeonPage/__tests__/__snapshots__/NeonPage.jsx.snap b/src/lib_components/components/NeonPage/__tests__/__snapshots__/NeonPage.jsx.snap new file mode 100644 index 00000000..34626c63 --- /dev/null +++ b/src/lib_components/components/NeonPage/__tests__/__snapshots__/NeonPage.jsx.snap @@ -0,0 +1,1354 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`NeonPage NeonErrorPage 1`] = ` +
    +
    + NEON Data Portal +

    + + + + Something broke. +

    +
    + + fail + +
    +
    + + + + + + + + + Return Home + + + +
    +
    + +
    +`; + +exports[`NeonPage renders a basic functional page with no props 1`] = ` +Array [ + , +
    +
    +
    + content +
    +
    +
    , +
    + +
    , +] +`; + +exports[`NeonPage renders sidebar items as skeletons when in appropriate state 1`] = ` +Array [ + , +
    +
    +
    + Sidebar +
    +
    +
    + +
    + content +
    +
    +
    , +
    + +
    , +
    +
    +

    + Loading +

    +
    + + + +
    +
    + +
    +
    +
    , +] +`; + +exports[`NeonPage renders with a custom header/footer 1`] = ` +Array [ +
    +
    + Header +
    +
    , +
    +
    +
    + content +
    +
    +
    , +
    +
    + Header +
    +
    , +] +`; + +exports[`NeonPage renders with a notification 1`] = ` +Array [ + , +
    +
    +
    + content +
    +
    +
    , +
    +
    +
    +
    +
    +
    +
    +
    + +
    +
    +
    , +
    + +
    , +] +`; + +exports[`NeonPage renders with a title and subtitle 1`] = ` +Array [ + , +
    +
    +

    + Title +

    +

    + Subtitle +

    +
    + content +
    +
    +
    , +
    + +
    , +] +`; + +exports[`NeonPage renders with an error 1`] = ` +Array [ + , +
    +
    + +
    + content +
    +
    +
    , +
    + +
    , +
    +
    + + + +

    + Fail +

    +
    + +
    +
    +
    , +] +`; + +exports[`NeonPage renders with custom sidebar content 1`] = ` +Array [ + , +
    +
    +
    + Sidebar +
    +
    +
    +
    + content +
    +
    +
    , +
    + +
    , +] +`; + +exports[`NeonPage renders with loading message 1`] = ` +Array [ + , +
    +
    + +
    + content +
    +
    +
    , +
    + +
    , +
    +
    +

    + Loading +

    +
    + + + +
    +
    + +
    +
    +
    , +] +`; + +exports[`NeonPage renders with loading message and progress 1`] = ` +Array [ + , +
    +
    + +
    + content +
    +
    +
    , +
    + +
    , +
    +
    +

    + Loading +

    +
    + + + +
    +
    + +
    +
    +
    , +] +`; + +exports[`NeonPage renders with sidebar links 1`] = ` +Array [ + , +
    +
    +
    +
    +
    +

    + foo +

    +

    + bar +

    +
    +
    +
    +
    + More +
    +
    + +
    +
    +
    +
    +
    + content +
    +
    +
    , +
    + +
    , +] +`; + +exports[`NeonPage renders with sidebar links as standlone children 1`] = ` +Array [ + , +
    +
    + +
    +

    + Section B +

    +
    + stub component B +
    +
    +
    , +
    + +
    , +] +`; diff --git a/src/lib_components/components/NeonUtilityBar/NeonUtilityBar.jsx b/src/lib_components/components/NeonUtilityBar/NeonUtilityBar.jsx deleted file mode 100644 index c23c5ff1..00000000 --- a/src/lib_components/components/NeonUtilityBar/NeonUtilityBar.jsx +++ /dev/null @@ -1,103 +0,0 @@ -import React from 'react'; -import PropTypes from 'prop-types'; - -import { makeStyles } from '@material-ui/core/styles'; -import AppBar from '@material-ui/core/AppBar'; -import Tabs from '@material-ui/core/Tabs'; -import Tab from '@material-ui/core/Tab'; - -import Theme from '../Theme/Theme'; - -/** - NOTE: The excessive styling here is intended to make the NeonUtilityBar - component have visual parity with the legacy Utility Bar still being used - on the Neon Science and Biorepository sites. - - When those sites are serving their utility bars from this shared component - (i.e. this component is the ONLY implementation of the utility bar) then - visual changes can be made here and appear consistently across all sites. -*/ - -const useTabsStyles = makeStyles((theme) => ({ - root: { - width: '100%', - minHeight: theme.spacing(3), - /* borderBottom: '3px solid #fff', */ - }, - indicator: { - display: 'none', - }, - flexContainer: { - justifyContent: 'flex-end', - [theme.breakpoints.down('sm')]: { - justifyContent: 'flex-start', - }, - }, -})); - -const useTabStyles = makeStyles((theme) => ({ - root: { - color: '#fff', - backgroundColor: theme.palette.secondary.main, - border: 'none', - minHeight: theme.spacing(3), - '&:hover': { - textDecoration: 'underline', - color: '#fff', - backgroundColor: theme.palette.secondary.main, - }, - '&$selected': { - color: `${theme.palette.secondary.main} !important`, - backgroundColor: '#fff !important', - }, - fontWeight: 600, - letterSpacing: '1px', - lineHeight: 1.65, - fontSize: '1rem', - padding: `${theme.spacing(0.25)}px ${theme.spacing(3.5)}px`, - [theme.breakpoints.down('sm')]: { - lineHeight: 1.8, - fontSize: '0.8rem', - padding: `${theme.spacing(0.25)}px ${theme.spacing(2)}px`, - }, - [theme.breakpoints.down('xs')]: { - fontSize: '0.75rem', - padding: `${theme.spacing(0.25)}px ${theme.spacing(1.5)}px`, - }, - }, - selected: {}, - textColorInherit: { - opacity: 1, - }, -})); - -const NeonUtilityBar = (props) => { - const tabsClasses = useTabsStyles(Theme); - const tabClasses = useTabStyles(Theme); - - const { selectedTab } = props; - - const scienceUrl = 'https://neonscience.org'; - const dataUrl = 'https://data.neonscience.org/home'; - const bioUrl = 'https://biorepo.neonscience.org/portal/index.php'; - - return ( - - - - - - - - ); -}; - -NeonUtilityBar.propTypes = { - selectedTab: PropTypes.string, -}; - -NeonUtilityBar.defaultProps = { - selectedTab: 'data', -}; - -export default NeonUtilityBar; diff --git a/src/lib_components/components/NeonUtilityBar/index.d.ts b/src/lib_components/components/NeonUtilityBar/index.d.ts deleted file mode 100644 index 1d06ff95..00000000 --- a/src/lib_components/components/NeonUtilityBar/index.d.ts +++ /dev/null @@ -1 +0,0 @@ -export { default } from './NeonUtilityBar'; diff --git a/src/lib_components/components/NeonUtilityBar/index.js b/src/lib_components/components/NeonUtilityBar/index.js deleted file mode 100644 index 1d06ff95..00000000 --- a/src/lib_components/components/NeonUtilityBar/index.js +++ /dev/null @@ -1 +0,0 @@ -export { default } from './NeonUtilityBar'; diff --git a/src/lib_components/components/NeonUtilityBar/package.json b/src/lib_components/components/NeonUtilityBar/package.json deleted file mode 100644 index a2e66cef..00000000 --- a/src/lib_components/components/NeonUtilityBar/package.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "private": true, - "name": "neon-utility-bar", - "main": "./NeonUtilityBar.jsx", - "module": "./NeonUtilityBar.js" -} diff --git a/src/lib_components/components/PopupBase/PopupBase.css b/src/lib_components/components/PopupBase/PopupBase.css deleted file mode 100644 index 4011615e..00000000 --- a/src/lib_components/components/PopupBase/PopupBase.css +++ /dev/null @@ -1,9 +0,0 @@ -.popup__base { - position: fixed; - background: #FFF; - z-index: 201; -} - -.popup__base--noscroll { - overflow: hidden; -} diff --git a/src/lib_components/components/PopupBase/PopupBase.js b/src/lib_components/components/PopupBase/PopupBase.js deleted file mode 100644 index 4a6b3424..00000000 --- a/src/lib_components/components/PopupBase/PopupBase.js +++ /dev/null @@ -1,41 +0,0 @@ -/* eslint-disable react/prop-types, react/jsx-filename-extension, react/destructuring-assignment */ -import React, { Component } from 'react'; -import './PopupBase.css'; - -/** - DEPRECATED - Use DialogBase Instead! -*/ - -class PopupBase extends Component { - componentDidMount() { - // keep the background from scrolling when the popup is visible - document.body.classList.add('popup__base--noscroll'); - } - - componentWillUnmount() { - document.body.classList.remove('popup__base--noscroll'); - } - - render() { - const popupBaseStyle = { - height: this.props.popupHeight, - width: this.props.popupWidth, - top: this.props.top, - left: this.props.left, - marginTop: this.props.marginTop, - marginLeft: this.props.marginLeft, - }; - - if (this.props.zIndex) { - popupBaseStyle.zIndex = this.props.zIndex; - } - - return ( -
    - {this.props.children} -
    - ); - } -} - -export default PopupBase; diff --git a/src/lib_components/components/PopupBase/index.d.ts b/src/lib_components/components/PopupBase/index.d.ts deleted file mode 100644 index d36e2a0f..00000000 --- a/src/lib_components/components/PopupBase/index.d.ts +++ /dev/null @@ -1 +0,0 @@ -export { default } from './PopupBase'; diff --git a/src/lib_components/components/PopupBase/index.js b/src/lib_components/components/PopupBase/index.js deleted file mode 100644 index d36e2a0f..00000000 --- a/src/lib_components/components/PopupBase/index.js +++ /dev/null @@ -1 +0,0 @@ -export { default } from './PopupBase'; diff --git a/src/lib_components/components/PopupBase/package.json b/src/lib_components/components/PopupBase/package.json deleted file mode 100644 index f647de92..00000000 --- a/src/lib_components/components/PopupBase/package.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "private": true, - "name": "popup-base", - "main": "./PopupBase.js", - "module": "./index.js" -} diff --git a/src/lib_components/components/PopupLoading/PopupLoading.css b/src/lib_components/components/PopupLoading/PopupLoading.css deleted file mode 100644 index 098d0c66..00000000 --- a/src/lib_components/components/PopupLoading/PopupLoading.css +++ /dev/null @@ -1,74 +0,0 @@ -.popup-loading { - position: relative; - background: #fff; - border-radius: 10px; - display: flex; - flex-direction: column; - border: 1px solid #cccccc; - padding: 4%; - max-height: 650px; - overflow: auto; - z-index: 300; - font-size: 18px; - text-align: center; - opacity: 1; - color: #002c77; -} - -.popup-loading__background { - position: fixed; - top: 60px; - bottom: 173px; - left: 0; - background: white; - width: 100%; - z-index: 199; -} - -.popup-loading__row { - width: 100%; - min-height: min-content; - font-family: Helvetica; - padding-bottom: 6px; - padding-top: 6px; -} - -.popup-loading__row--padding-bottom { - padding-bottom: 18px; -} - -.popup-loading__row--flexrow { - display: flex; - flex-direction: row; -} - -.popup-loading__header { - font-size: 28px; - font-weight: 650; - border-bottom: 1px solid black; - padding: 8px; -} - -.popup-loading__name { - font-size: 22px; - font-weight: 550; - color: #002c77; - padding: 22px 8px 8px 8px; -} - -.popup-loading__dpidq { - font-size: 16px; - padding: 4px 8px 8px 8px; -} - -.popup-loading__div { - height: auto; - padding-bottom: 10px; -} - -.popup-loading__close { - position: absolute; - top: 20px; - right: 20px; - cursor: pointer; -} diff --git a/src/lib_components/components/PopupLoading/PopupLoading.js b/src/lib_components/components/PopupLoading/PopupLoading.js deleted file mode 100644 index d3de7be4..00000000 --- a/src/lib_components/components/PopupLoading/PopupLoading.js +++ /dev/null @@ -1,55 +0,0 @@ -/* eslint-disable react/prop-types, react/jsx-filename-extension, react/destructuring-assignment, react/prefer-stateless-function, max-len */ -import React, { Component } from 'react'; -import PopupBase from '../PopupBase/PopupBase'; - -import './PopupLoading.css'; - -class PopupLoading extends Component { - render() { - const popupBackground = ( -
    - ); - - let spinner = null; - if (this.props.showSpinner) { - spinner = ( -
    - -
    - ); - } - - const popupWidth = 320; - const popupHeight = 120; - const marginLeft = -(popupWidth / 2); - const marginTop = -(popupHeight / 2); - const top = '35%'; - const left = '50%'; - const zIndex = 198; - - return ( - - {popupBackground} - -
    - -
    - {this.props.message} -
    - {spinner} - -
    -
    - ); - } -} - -export default PopupLoading; diff --git a/src/lib_components/components/PopupLoading/index.d.ts b/src/lib_components/components/PopupLoading/index.d.ts deleted file mode 100644 index 54eccc0c..00000000 --- a/src/lib_components/components/PopupLoading/index.d.ts +++ /dev/null @@ -1 +0,0 @@ -export { default } from './PopupLoading'; diff --git a/src/lib_components/components/PopupLoading/index.js b/src/lib_components/components/PopupLoading/index.js deleted file mode 100644 index 54eccc0c..00000000 --- a/src/lib_components/components/PopupLoading/index.js +++ /dev/null @@ -1 +0,0 @@ -export { default } from './PopupLoading'; diff --git a/src/lib_components/components/PopupLoading/package.json b/src/lib_components/components/PopupLoading/package.json deleted file mode 100644 index faf2a0df..00000000 --- a/src/lib_components/components/PopupLoading/package.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "private": true, - "name": "popup-loading", - "main": "./PopupLoading.js", - "module": "./index.js" -} diff --git a/src/lib_components/components/SiteMap/SiteMapFeature.jsx b/src/lib_components/components/SiteMap/SiteMapFeature.jsx index 284c48a3..63fbe4e7 100644 --- a/src/lib_components/components/SiteMap/SiteMapFeature.jsx +++ b/src/lib_components/components/SiteMap/SiteMapFeature.jsx @@ -1506,46 +1506,48 @@ const SiteMapFeature = (props) => { ? SELECTION_STATUS.SELECTED : SELECTION_STATUS.UNSELECTED; const initialHighlight = isHighlighted ? HIGHLIGHT_STATUS.HIGHLIGHT : HIGHLIGHT_STATUS.NONE; - icon = baseIcon[selection][initialHighlight]; - interaction = { - onMouseOver: (e) => { - let highlight = HIGHLIGHT_STATUS.HIGHLIGHT; - if (selectionActive && selectingCurrentFeatureType && isSelectable) { - highlight = HIGHLIGHT_STATUS[isSelected ? 'HIGHLIGHT' : 'SELECT']; - } - e.target.setIcon(baseIcon[selection][highlight]); - e.target._bringToFront(); - if (hasPopup && selectionActive) { - e.target.openPopup(); - positionPopup(e.target, e.latlng, selectionActive); - } - }, - onMouseOut: (e) => { - e.target.setIcon(baseIcon[selection][initialHighlight]); - if (hasPopup && selectionActive) { - e.target.closePopup(); - } - }, - onClick: (e) => { - if (!selectionActive && hasPopup) { - const popupOpen = e.target._popup.isOpen(); - const func = () => positionPopup(e.target, e.latlng, selectionActive); - dispatch({ type: 'setMapRepositionOpenPopupFunc', func }); - if (popupOpen) { func(); } - } - if (selectionActive && selectingCurrentFeatureType && isSelectable) { - switch (selectionType) { - case FEATURE_TYPES.SITES.KEY: - if (shapeData.siteCode) { - dispatch({ type: 'toggleItemSelected', item: shapeData.siteCode }); - } - break; - default: - break; + if (baseIcon && baseIcon[selection]) { + icon = baseIcon[selection][initialHighlight]; + interaction = { + onMouseOver: (e) => { + let highlight = HIGHLIGHT_STATUS.HIGHLIGHT; + if (selectionActive && selectingCurrentFeatureType && isSelectable) { + highlight = HIGHLIGHT_STATUS[isSelected ? 'HIGHLIGHT' : 'SELECT']; } - } - }, - }; + e.target.setIcon(baseIcon[selection][highlight]); + e.target._bringToFront(); + if (hasPopup && selectionActive) { + e.target.openPopup(); + positionPopup(e.target, e.latlng, selectionActive); + } + }, + onMouseOut: (e) => { + e.target.setIcon(baseIcon[selection][initialHighlight]); + if (hasPopup && selectionActive) { + e.target.closePopup(); + } + }, + onClick: (e) => { + if (!selectionActive && hasPopup) { + const popupOpen = e.target._popup.isOpen(); + const func = () => positionPopup(e.target, e.latlng, selectionActive); + dispatch({ type: 'setMapRepositionOpenPopupFunc', func }); + if (popupOpen) { func(); } + } + if (selectionActive && selectingCurrentFeatureType && isSelectable) { + switch (selectionType) { + case FEATURE_TYPES.SITES.KEY: + if (shapeData.siteCode) { + dispatch({ type: 'toggleItemSelected', item: shapeData.siteCode }); + } + break; + default: + break; + } + } + }, + }; + } } marker = ( { worldCopyJump data-component="SiteMap" data-selenium="sitemap-content-map" + tap={false} {...mouseModeProps} > diff --git a/src/lib_components/components/SiteMap/SiteMapTable.jsx b/src/lib_components/components/SiteMap/SiteMapTable.jsx index e09f484a..ffdbc416 100644 --- a/src/lib_components/components/SiteMap/SiteMapTable.jsx +++ b/src/lib_components/components/SiteMap/SiteMapTable.jsx @@ -1,9 +1,8 @@ -/* eslint-disable jsx-a11y/anchor-is-valid, no-unused-vars */ +/* eslint-disable jsx-a11y/anchor-is-valid */ import React, { useRef, useEffect, useLayoutEffect } from 'react'; import { makeStyles } from '@material-ui/core/styles'; import Box from '@material-ui/core/Box'; -import Button from '@material-ui/core/Button'; import Link from '@material-ui/core/Link'; import IconButton from '@material-ui/core/IconButton'; import Tooltip from '@material-ui/core/Tooltip'; @@ -75,6 +74,59 @@ const calculateMaxBodyHeight = (tableRef) => { return Math.max(containerHeight - toolbarHeight - pagerHeight, MIN_TABLE_MAX_BODY_HEIGHT); }; +const EXPORT_FILENAME = 'NEON-SiteMap-Table'; +const exportCsv = (columns = [], rows = []) => { + if (!columns.length || !rows.length) { return; } + const columnHeaders = columns.reduce((acc, cur) => { + if (Array.isArray(cur.csvFields)) { + cur.csvFields.forEach((field) => { acc.push(field); }); + } else { + acc.push(cur.field); + } + return acc; + }, []); + const payloadRows = [columnHeaders.join(',')]; + rows.forEach((row) => { + const payloadRow = []; + columns.forEach((column) => { + const render = typeof column.csvRender === 'function' + ? column.csvRender + : (r) => (r[column.field] || null); + payloadRow.push( + [render(row)].flat().map( + (value) => { + if (value === null || typeof value === 'undefined' || Number.isNaN(value)) { + return ''; + } + if (/["',\s]/.test(value.toString())) { + return `"${value.toString().replace('"', '\\"')}"`; + } + return value; + }, + ).join(','), + ); + }); + payloadRows.push(payloadRow.join(',')); + }); + const payload = payloadRows.join('\n'); + const mimeType = 'text/csv;charset=utf-8'; + const fileName = `${EXPORT_FILENAME}.csv`; + if (navigator.msSaveBlob) { // IE10+ + navigator.msSaveBlob(new Blob([payload], { type: mimeType }), fileName); + } else { + const link = document.createElement('a'); + if (URL && typeof URL.createObjectURL === 'function') { + link.href = URL.createObjectURL(new Blob([payload], { type: mimeType })); + } else { + link.setAttribute('href', `data:${mimeType},${encodeURI(payload)}`); + } + link.setAttribute('download', fileName); + document.body.appendChild(link); + link.click(); + document.body.removeChild(link); + } +}; + const useStyles = makeStyles((theme) => ({ tableContainer: { backgroundColor: 'white', @@ -123,18 +175,27 @@ const useStyles = makeStyles((theme) => ({ linkButton: { textAlign: 'left', }, + downloadCsvButton: { + marginRight: theme.spacing(2), + }, startFlex: { display: 'flex', alignItems: 'center', justifyContent: 'flex-start', }, + endFlex: { + display: 'flex', + alignItems: 'center', + justifyContent: 'flex-end', + }, toolbarContainer: { backgroundColor: theme.palette.grey[50], [theme.breakpoints.down('xs')]: { paddingTop: theme.spacing(4.5), }, '& div.MuiToolbar-root': { - padding: theme.spacing(0, 2), + width: '100%', + padding: theme.spacing(0, 0, 0, 2), backgroundColor: theme.palette.grey[50], }, // Make the columns button more prominent (really hard to do with component overriding) @@ -149,7 +210,10 @@ const useStyles = makeStyles((theme) => ({ }, }, toolbarContainerNoSplit: { - // This hides all but the search input and show columns buttons. + '& div.MuiToolbar-root': { + width: 'calc(100% - 244px)', + }, + // This hides all but the search input, show columns, and export buttons. // No other way to have material table NOT show a selection title in the toolbar. '& div.MuiToolbar-root > div:not(:nth-last-child(-n+2))': { display: 'none', @@ -210,6 +274,9 @@ const useStyles = makeStyles((theme) => ({ fontWeight: 500, }, }, + paginationRoot: { + width: 'auto', + }, })); const SiteMapTable = () => { @@ -233,8 +300,6 @@ const SiteMapTable = () => { maxBodyHeightUpdateFromAspectRatio, } = state.table; const { - limit: selectionLimit, - valid: selectionValid, set: selection, validSet: selectableItems, hideUnselectable, @@ -341,12 +406,10 @@ const SiteMapTable = () => { // Selection functions let rowIsSelected = () => false; let rowIsSelectable = () => false; - let selectRow = () => {}; switch (focus) { case FEATURE_TYPES.SITES.KEY: rowIsSelected = (row) => selection.has(row.siteCode); rowIsSelectable = (row) => !selectableItems || selectableItems.has(row.siteCode); - selectRow = (row) => dispatch({ type: 'toggleItemSelected', item: row.siteCode }); break; default: break; @@ -471,21 +534,22 @@ const SiteMapTable = () => { const commonColumns = { site: { field: 'siteCode', + csvFields: ['siteCode', 'siteName'], // Some single table columns are split in the CSV like so title: 'Site', sorting: true, defaultSort: 'desc', searchable: true, lookup: Object.fromEntries( - Array.from(sitesInMap).map((siteCode) => [siteCode, siteCode]), + Array.from(sitesInMap).sort().map((siteCode) => [siteCode, siteCode]), ), customFilterAndSearch: (input, row) => { - if (typeof input === 'string') { + if (typeof input === 'string' && input.length) { return searchOnAttribs(input, [row.siteCode, row.description]); } - if (Array.isArray(input)) { + if (Array.isArray(input) && input.length) { return input.includes(row.siteCode); } - return false; + return true; }, customSort: (rowA, rowB) => { const siteA = getSite(rowA); @@ -498,6 +562,7 @@ const SiteMapTable = () => { render: (row) => { const site = getSite(row); if (!site) { return null; } + const { siteCode, description } = site; const isDecommissioned = site.manualLocationType === MANUAL_LOCATION_TYPES.PROTOTYPE_SITE; const featureKey = isDecommissioned ? FEATURES.DECOMMISSIONED_SITES.KEY @@ -508,23 +573,23 @@ const SiteMapTable = () => { jumpTo(row.siteCode)} - title={`Click to view ${row.siteCode} on the map`} + onClick={() => jumpTo(siteCode)} + title={`Click to view ${siteCode} on the map`} > {renderFeatureIcon(featureKey, unselectable)} - {`${site.description || 'Unnamed Site'} (${site.siteCode})`} + {`${description || 'Unnamed Site'} (${siteCode})`}
    Site Details | Explore Data @@ -532,6 +597,11 @@ const SiteMapTable = () => {
    ); }, + csvRender: (row) => { + let siteName = null; + if (state.sites[row.siteCode]) { siteName = state.sites[row.siteCode].description; } + return [row.siteCode, siteName]; + }, }, domain: { field: 'domainCode', @@ -540,7 +610,7 @@ const SiteMapTable = () => { defaultSort: 'desc', searchable: true, lookup: Object.fromEntries( - Array.from(domainsInMap).map((domainCode) => [domainCode, domainCode]), + Array.from(domainsInMap).sort().map((domainCode) => [domainCode, domainCode]), ), customSort: (rowA, rowB) => { const domainA = getDomain(rowA); @@ -570,7 +640,7 @@ const SiteMapTable = () => { defaultSort: 'desc', searchable: true, lookup: Object.fromEntries( - Array.from(statesInMap).map((stateCode) => [ + Array.from(statesInMap).sort().map((stateCode) => [ stateCode, state.featureData.STATES.STATES[stateCode].name, ]), @@ -581,24 +651,25 @@ const SiteMapTable = () => { return stateA.name > stateB.name ? -1 : 1; }, customFilterAndSearch: (input, row) => { - if (typeof input === 'string') { + if (typeof input === 'string' && input.length) { const rowState = getState(row); return searchOnAttribs(input, [row.stateCode, rowState.name]); } - if (Array.isArray(input)) { + if (Array.isArray(input) && input.length) { return input.includes(row.stateCode); } - return false; + return true; }, render: (row) => { const usstate = getState(row); + const { stateCode } = row; return !usstate ? null : (
    jumpTo(row.stateCode)} - title={`Click to view ${row.stateCode} on the map`} + onClick={() => jumpTo(stateCode)} + title={`Click to view ${stateCode} on the map`} > {usstate.name} @@ -608,31 +679,49 @@ const SiteMapTable = () => { }, coordinates: { field: 'latitude', + csvFields: ['latitude', 'longitude'], title: 'Coordinates', sorting: false, filtering: false, searchable: false, - render: (row) => ( - <> - {renderCaptionString(row.latitude.toFixed(5), 'Latitude')} -
    - {renderCaptionString(row.longitude.toFixed(5), 'Longitude')} - - ), + render: (row) => { + const { latitude: rowLatitude, longitude: rowLongitude } = row; + const latitude = Number.isFinite(rowLatitude) ? rowLatitude.toFixed(5) : null; + const longitude = Number.isFinite(rowLongitude) ? rowLongitude.toFixed(5) : null; + return ( + <> + {renderCaptionString(latitude, 'Latitude')} +
    + {renderCaptionString(longitude, 'Longitude')} + + ); + }, + csvRender: (row) => ([ + Number.isFinite(row.latitude) ? row.latitude.toFixed(5) : null, + Number.isFinite(row.longitude) ? row.longitude.toFixed(5) : null, + ]), }, latitude: { field: 'latitude', title: 'Latitude', sorting: true, filtering: false, - render: (row) => renderCaptionString(row.latitude.toFixed(5), 'Latitude'), + render: (row) => renderCaptionString( + Number.isFinite(row.latitude) ? row.latitude.toFixed(5) : null, + 'Latitude', + ), + csvRender: (row) => (Number.isFinite(row.latitude) ? row.latitude.toFixed(5) : null), }, longitude: { field: 'longitude', title: 'Longitude', sorting: true, filtering: false, - render: (row) => renderCaptionString(row.longitude.toFixed(5), 'Longitude'), + render: (row) => renderCaptionString( + Number.isFinite(row.longitude) ? row.longitude.toFixed(5) : null, + 'Longitude', + ), + csvRender: (row) => (Number.isFinite(row.longitude) ? row.longitude.toFixed(5) : null), }, }; @@ -671,10 +760,6 @@ const SiteMapTable = () => { commonColumns.domain, commonColumns.state, commonColumns.coordinates, - /* - commonColumns.latitude, - commonColumns.longitude, - */ ]; } if (focus === FEATURE_TYPES.LOCATIONS.KEY) { @@ -685,16 +770,19 @@ const SiteMapTable = () => { sorting: true, defaultSort: 'desc', searchable: true, - render: (row) => ( - jumpTo(row.name)} - title={`View ${row.name} on map`} - > - {row.name} - - ), + render: (row) => { + const { name } = row; + return ( + jumpTo(name)} + title={`View ${name} on map`} + > + {name} + + ); + }, }, { // Location Type field: 'featureKey', @@ -723,9 +811,11 @@ const SiteMapTable = () => {
    ); }, + csvRender: (row) => getFeatureName(row.featureKey), }, { // Elevation field: 'elevation', + csvFields: ['elevation (m)'], title: 'Elevation', sorting: true, defaultSort: 'desc', @@ -734,6 +824,9 @@ const SiteMapTable = () => { Number.isFinite(row.elevation) ? `${row.elevation.toFixed(2)}m` : '--', 'Elevation', ), + csvRender: (row) => ( + Number.isFinite(row.elevation) ? row.elevation.toFixed(2) : null + ), }, { // NLCD Class field: 'nlcdClass', @@ -744,16 +837,14 @@ const SiteMapTable = () => { lookup: Object.fromEntries( Object.keys(NLCD_CLASSES) .filter((classKey) => rows.some((row) => row.nlcdClass === classKey)) + .sort() .map((classKey) => [classKey, NLCD_CLASSES[classKey].name]), ), render: (row) => { - if (!row.nlcdClass) { - return renderCaptionString(); - } - if (!NLCD_CLASSES[row.nlcdClass]) { - return renderCaptionString(row.nlcdClass, 'NLCD Class'); - } - const { name: title, color: backgroundColor } = NLCD_CLASSES[row.nlcdClass]; + const { nlcdClass } = row; + if (!nlcdClass) { return renderCaptionString(); } + if (!NLCD_CLASSES[nlcdClass]) { return renderCaptionString(nlcdClass, 'NLCD Class'); } + const { name: title, color: backgroundColor } = NLCD_CLASSES[nlcdClass]; return (
    @@ -761,27 +852,46 @@ const SiteMapTable = () => {
    ); }, + csvRender: (row) => { + const { nlcdClass } = row; + if (!nlcdClass) { return null; } + if (!NLCD_CLASSES[nlcdClass]) { return nlcdClass; } + return NLCD_CLASSES[nlcdClass].name; + }, }, { // Plot Size field: 'plotSize', + csvFields: ['plotDimensions', 'plotArea (m^2)'], title: 'Plot Size', sorting: true, deafultSort: 'asc', filtering: false, - render: (row) => (row.plotDimensions ? ( - <> - {renderCaptionString(`${row.plotDimensions}`, 'Plot Size (Dimensions)')} - {Number.isFinite(row.plotSize) ? ( - <> -
    - {renderCaptionString(`(${row.plotSize.toFixed(0)}m\u00b2)`, 'Plot Size (Area)')} - - ) : null} - - ) : renderCaptionString()), + render: (row) => { + const { plotDimensions, plotSize } = row; + if (!plotDimensions) { return renderCaptionString(); } + return ( + <> + {renderCaptionString(`${plotDimensions}`, 'Plot Size (Dimensions)')} + {Number.isFinite(plotSize) ? ( + <> +
    + {renderCaptionString(`(${plotSize.toFixed(0)}m\u00b2)`, 'Plot Size (Area)')} + + ) : null} + + ); + }, + csvRender: (row) => { + const { plotDimensions, plotSize } = row; + return [ + plotDimensions || null, + Number.isFinite(plotSize) ? plotSize.toFixed(0) : null, + ]; + }, }, { // Plot Slope Aspect field: 'slopeAspect', + csvFields: ['slopeAspect (deg)'], title: 'Slope Aspect', sorting: true, deafultSort: 'asc', @@ -790,9 +900,11 @@ const SiteMapTable = () => { Number.isFinite(row.slopeAspect) ? `${row.slopeAspect.toFixed(2)}\u00b0` : '--', 'Slope Aspect', ), + csvRender: (row) => (Number.isFinite(row.slopeAspect) ? row.slopeAspect.toFixed(2) : null), }, { // Plot Slope Gradient field: 'slopeGradient', + csvFields: ['slopeGradient (%)'], title: 'Slope Gradient', sorting: true, deafultSort: 'asc', @@ -801,9 +913,13 @@ const SiteMapTable = () => { Number.isFinite(row.slopeGradient) ? `${row.slopeGradient.toFixed(2)}%` : '--', 'Slope Gradient', ), + csvRender: (row) => ( + Number.isFinite(row.slopeGradient) ? row.slopeGradient.toFixed(2) : null + ), }, { // Sampling Module Count field: 'samplingModules', + csvFields: 'samplingModulesCount', title: 'Potential Sampling Modules', filtering: false, sorting: true, @@ -817,15 +933,17 @@ const SiteMapTable = () => { if (a !== null && b === null) { return -1; } return a > b ? 1 : -1; }, - render: (row) => ( - Array.isArray(row.samplingModules) ? ( + render: (row) => { + const { samplingModules } = row; + if (!Array.isArray(samplingModules)) { return renderCaptionString(); } + return ( - {row.samplingModules.map((m) => ( + {samplingModules.map((m) => (
  • {PLOT_SAMPLING_MODULES[m]}
  • ))} @@ -833,7 +951,7 @@ const SiteMapTable = () => { } >
    - {renderCaptionString(row.samplingModules.length, 'Potential Sampling Modules')} + {renderCaptionString(samplingModules.length, 'Potential Sampling Modules')} {
    - ) : ( - renderCaptionString() - ) + ); + }, + csvRender: (row) => ( + Array.isArray(row.samplingModules) ? row.samplingModules.length : null ), }, commonColumns.site, commonColumns.domain, commonColumns.state, commonColumns.coordinates, - /* - commonColumns.latitude, - commonColumns.longitude, - */ ]; } @@ -899,6 +1014,11 @@ const SiteMapTable = () => { }, pageSize: 100, pageSizeOptions: [100, 200, 500], + exportButton: { csv: true }, + exportCsv, + exportFileName: EXPORT_FILENAME, + emptyRowsWhenPaging: false, + thirdSortClick: false, rowStyle: (row) => { if (selectionActive) { if (!rowIsSelectable(row)) { @@ -966,5 +1086,6 @@ export const getTestableItems = () => ( searchOnAttribs, calculateMaxBodyHeight, getFeatureName, + exportCsv, } ); diff --git a/src/lib_components/components/SiteMap/StyleGuide.jsx b/src/lib_components/components/SiteMap/StyleGuide.jsx index 99ae2bb7..69cc0128 100644 --- a/src/lib_components/components/SiteMap/StyleGuide.jsx +++ b/src/lib_components/components/SiteMap/StyleGuide.jsx @@ -505,7 +505,7 @@ import SiteMap from 'portal-core-components/lib/components/SiteMap'; )} {/* 4: Manual Locations */} - {tabValue !== 3 ? null : ( + {tabValue !== 4 ? null : (
    Manual Locations diff --git a/src/lib_components/components/SiteMap/__tests__/SiteMapTable.jsx b/src/lib_components/components/SiteMap/__tests__/SiteMapTable.jsx index 644f6c80..c7750075 100644 --- a/src/lib_components/components/SiteMap/__tests__/SiteMapTable.jsx +++ b/src/lib_components/components/SiteMap/__tests__/SiteMapTable.jsx @@ -8,6 +8,7 @@ const { searchOnAttribs, getFeatureName, calculateMaxBodyHeight, + exportCsv, } = getTestableItems(); describe('SiteMap - SiteMapTable', () => { @@ -86,4 +87,64 @@ describe('SiteMap - SiteMapTable', () => { expect(calculateMaxBodyHeight(tableRef)).toBe(270); }); }); + + describe('exportCsv()', () => { + let createElementMock = null; + const setAttributeMock = jest.fn(); + const clickMock = jest.fn(); + beforeAll(() => { + createElementMock = jest.spyOn(document, 'createElement').mockReturnValue({ + href: null, + setAttribute: setAttributeMock, + click: clickMock, + }); + Object.defineProperty(window.document, 'body', { + writeable: false, + value: { appendChild: jest.fn(), removeChild: jest.fn() }, + }); + }); + afterEach(() => { jest.clearAllMocks(); }); + afterAll(() => { jest.resetAllMocks(); }); + test('does nothing if either columns or rows are empty', () => { + exportCsv(); + expect(createElementMock).not.toHaveBeenCalled(); + exportCsv([{ name: 'foo' }], []); + expect(createElementMock).not.toHaveBeenCalled(); + exportCsv([], [{ name: 'foo' }]); + expect(createElementMock).not.toHaveBeenCalled(); + }); + test('generates a csv with appropriate column spreading', () => { + const columns = [ + { + field: 'siteCode', + csvFields: ['siteCode', 'siteName'], + csvRender: (row) => [row.siteCode, row.siteName || null], + }, + { + field: 'domainCode', + }, + { + field: 'elevation', + csvFields: ['elevation (m)'], + csvRender: (row) => ( + Number.isFinite(row.elevation) ? row.elevation.toFixed(2) : null + ), + }, + ]; + const rows = [ + // eslint-disable-next-line object-curly-newline + { siteCode: 'ABBY', siteName: 'Abbey, Road', domainCode: 'D16', elevation: 123.4567 }, + { siteCode: 'BARR', domainCode: 'D12', elevation: 'n/a' }, + { siteName: 'Some "site"', domainCode: null, elevation: 45.678 }, + ]; + const expectedHref = 'data:text/csv;charset=utf-8,siteCode,siteName,domainCode,elevation%20(m)%0AABBY,%22Abbey,%20Road%22,D16,123.46%0ABARR,,D12,%0A,%22Some%20%5C%22site%22%22,,45.68'; + const expectedFilename = 'NEON-SiteMap-Table.csv'; + exportCsv(columns, rows); + expect(createElementMock).toHaveBeenCalled(); + expect(setAttributeMock).toHaveBeenCalledTimes(2); + expect(setAttributeMock).toHaveBeenNthCalledWith(1, 'href', expectedHref); + expect(setAttributeMock).toHaveBeenNthCalledWith(2, 'download', expectedFilename); + expect(clickMock).toHaveBeenCalled(); + }); + }); }); diff --git a/src/lib_components/components/Theme/Theme.jsx b/src/lib_components/components/Theme/Theme.jsx index 0a3af24d..94128a6c 100644 --- a/src/lib_components/components/Theme/Theme.jsx +++ b/src/lib_components/components/Theme/Theme.jsx @@ -444,7 +444,7 @@ const baseTheme = createMuiTheme({ zIndex: 105, }, paper: { - zIndex: 10, + zIndex: 60, }, }, MuiFormControlLabel: { diff --git a/src/lib_components/components/TimeSeriesViewer/TimeSeriesViewerContainer.jsx b/src/lib_components/components/TimeSeriesViewer/TimeSeriesViewerContainer.jsx index 6810415e..db5c0462 100644 --- a/src/lib_components/components/TimeSeriesViewer/TimeSeriesViewerContainer.jsx +++ b/src/lib_components/components/TimeSeriesViewer/TimeSeriesViewerContainer.jsx @@ -180,7 +180,7 @@ const useTabStyles = makeStyles((theme) => ({ /** Summary Component */ -function TimeSeriesViewerSummary() { +export function TimeSeriesViewerSummary() { const classes = useStyles(Theme); const [state] = TimeSeriesViewerContext.useTimeSeriesViewerState(); diff --git a/src/lib_components/components/TimeSeriesViewer/TimeSeriesViewerContext.jsx b/src/lib_components/components/TimeSeriesViewer/TimeSeriesViewerContext.jsx index ff491eb2..e7a3cd02 100644 --- a/src/lib_components/components/TimeSeriesViewer/TimeSeriesViewerContext.jsx +++ b/src/lib_components/components/TimeSeriesViewer/TimeSeriesViewerContext.jsx @@ -104,7 +104,16 @@ const generateYAxisRange = (axis = {}) => { !Object.keys(Y_AXIS_RANGE_MODES).includes(rangeMode) || !Number.isFinite(standardDeviation) || !Number.isFinite(precision)) { return axisRange; } - const margin = standardDeviation !== 0 ? standardDeviation : (dataRange[0] / 2); + // Most of the time the margin for our auto-generated axis range is one standard deviation above + // and below our high and low values of our data range. Edge cases for when stddev is zero: + // * Data range is flat at zero: margin of 1 + // * Data range is flat at another value: margin of half the absolute value above and below + let margin = 1; + if (standardDeviation !== 0) { + margin = standardDeviation; + } else if (dataRange[0] !== 0) { + margin = Math.abs(dataRange[0] / 2); + } let low = (dataRange[0] || 0) - margin; let high = (dataRange[1] || 0) + margin; low = parseFloat(low.toFixed(precision), 10); @@ -134,7 +143,7 @@ const DEFAULT_AXIS_STATE = { rangeMode: Y_AXIS_RANGE_MODES.CENTERED, axisRange: [0, 0], }; -const DEFAULT_STATE = { +export const DEFAULT_STATE = { status: TIME_SERIES_VIEWER_STATUS.INIT_PRODUCT, displayError: null, fetchProduct: { status: FETCH_STATUS.AWAITING_CALL, error: null }, diff --git a/src/lib_components/components/TimeSeriesViewer/TimeSeriesViewerSites.jsx b/src/lib_components/components/TimeSeriesViewer/TimeSeriesViewerSites.jsx index 3276fc1d..72017a0e 100644 --- a/src/lib_components/components/TimeSeriesViewer/TimeSeriesViewerSites.jsx +++ b/src/lib_components/components/TimeSeriesViewer/TimeSeriesViewerSites.jsx @@ -56,7 +56,7 @@ import iconRelocatableAquaticSVG from '../SiteMap/svg/icon-site-relocatable-aqua import TimeSeriesViewerContext, { TabComponentPropTypes } from './TimeSeriesViewerContext'; -const ucWord = (word) => `${word.slice(0, 1)}${word.slice(1).toLowerCase()}`; +const ucWord = (word) => `${word.slice(0, 1).toUpperCase()}${word.slice(1).toLowerCase()}`; const ICON_SVGS = { CORE: { @@ -378,8 +378,9 @@ function PositionHistoryButton(props) { const end = rawEnd === '' ? 'Current' : rawEnd; const cellStyle = idx !== history.length - 1 ? {} : { fontWeight: '600', borderBottom: 'none' }; + const key = `${start}${end}${xOffset}${yOffset}${zOffset}`; return ( - + {start} {end} {`${xOffset}m`} @@ -1131,3 +1132,17 @@ export default function TimeSeriesViewerSites(props) { } TimeSeriesViewerSites.propTypes = TabComponentPropTypes; + +// Additional items exported for unit testing +export const getTestableItems = () => ( + process.env.NODE_ENV !== 'test' ? {} : { + ucWord, + PositionHistoryButton, + PositionDetail, + SelectedPosition, + SelectPositionsButton, + SitesControl, + SiteOption, + SelectedSite, + } +); diff --git a/src/lib_components/components/TimeSeriesViewer/__tests__/TimeSeriesViewerContainer.jsx b/src/lib_components/components/TimeSeriesViewer/__tests__/TimeSeriesViewerContainer.jsx new file mode 100644 index 00000000..d57c4c9b --- /dev/null +++ b/src/lib_components/components/TimeSeriesViewer/__tests__/TimeSeriesViewerContainer.jsx @@ -0,0 +1,160 @@ +import React from 'react'; +import renderer from 'react-test-renderer'; + +import cloneDeep from 'lodash/cloneDeep'; + +import TimeSeriesViewerContext, { DEFAULT_STATE } from '../TimeSeriesViewerContext'; +import { TimeSeriesViewerSummary } from '../TimeSeriesViewerContainer'; + +// Mock the SiteMapContext state +jest.mock('../TimeSeriesViewerContext', () => ({ + ...(jest.requireActual('../TimeSeriesViewerContext').default), + DEFAULT_STATE: jest.requireActual('../TimeSeriesViewerContext').DEFAULT_STATE, + summarizeTimeSteps: jest.requireActual('../TimeSeriesViewerContext').summarizeTimeSteps, + Y_AXIS_RANGE_MODE_DETAILS: jest.requireActual('../TimeSeriesViewerContext').Y_AXIS_RANGE_MODE_DETAILS, + useTimeSeriesViewerState: jest.fn(), +})); + +const { useTimeSeriesViewerState } = TimeSeriesViewerContext; + +describe('TimeSeriesViewerContainer', () => { + describe('TimeSeriesViewerSummary', () => { + test('Renders for default state', () => { + useTimeSeriesViewerState.mockReturnValue([{ + ...cloneDeep(DEFAULT_STATE), + }]); + const tree = renderer + .create() + .toJSON(); + expect(tree).toMatchSnapshot(); + }); + test('Renders for defined product without sensor / with default selection', () => { + useTimeSeriesViewerState.mockReturnValue([{ + ...cloneDeep(DEFAULT_STATE), + product: { + productName: 'Foo product', + productCode: 'DP0.00000.000', + productDescription: 'This is a product that products', + }, + }]); + const tree = renderer + .create() + .toJSON(); + expect(tree).toMatchSnapshot(); + }); + test('Renders for defined product with sensor / with default selection', () => { + useTimeSeriesViewerState.mockReturnValue([{ + ...cloneDeep(DEFAULT_STATE), + product: { + productName: 'Foo product', + productCode: 'DP0.00000.000', + productDescription: 'This is a product that products', + productSensor: 'product sensor 123', + }, + }]); + const tree = renderer + .create() + .toJSON(); + expect(tree).toMatchSnapshot(); + }); + test('Renders for selection with only sites', () => { + useTimeSeriesViewerState.mockReturnValue([{ + ...cloneDeep(DEFAULT_STATE), + product: { + productName: 'Foo product', + productCode: 'DP0.00000.000', + productDescription: 'This is a product that products', + }, + selection: { + ...cloneDeep(DEFAULT_STATE.selection), + sites: [ + { siteCode: 'ABBY', positions: ['000.010', '000.020'] }, + { siteCode: 'BARR', positions: ['000.030'] }, + ], + }, + }]); + const tree = renderer + .create() + .toJSON(); + expect(tree).toMatchSnapshot(); + }); + test('Renders for selection with only date range', () => { + useTimeSeriesViewerState.mockReturnValue([{ + ...cloneDeep(DEFAULT_STATE), + product: { + productName: 'Foo product', + productCode: 'DP0.00000.000', + productDescription: 'This is a product that products', + }, + selection: { + ...cloneDeep(DEFAULT_STATE.selection), + dateRange: ['2018-04', '2020-01'], + }, + }]); + const tree = renderer + .create() + .toJSON(); + expect(tree).toMatchSnapshot(); + }); + test('Renders for selection with only variables', () => { + useTimeSeriesViewerState.mockReturnValue([{ + ...cloneDeep(DEFAULT_STATE), + product: { + productName: 'Foo product', + productCode: 'DP0.00000.000', + productDescription: 'This is a product that products', + }, + selection: { + ...cloneDeep(DEFAULT_STATE.selection), + variables: ['var1', 'var2'], + }, + }]); + const tree = renderer + .create() + .toJSON(); + expect(tree).toMatchSnapshot(); + }); + test('Renders for selection with variables and qualityFlags', () => { + useTimeSeriesViewerState.mockReturnValue([{ + ...cloneDeep(DEFAULT_STATE), + product: { + productName: 'Foo product', + productCode: 'DP0.00000.000', + productDescription: 'This is a product that products', + }, + selection: { + ...cloneDeep(DEFAULT_STATE.selection), + variables: ['var1', 'var2'], + qualityFlags: ['qfA', 'qfB', 'qfC'], + }, + }]); + const tree = renderer + .create() + .toJSON(); + expect(tree).toMatchSnapshot(); + }); + test('Renders for selection with axes', () => { + useTimeSeriesViewerState.mockReturnValue([{ + ...cloneDeep(DEFAULT_STATE), + product: { + productName: 'Foo product', + productCode: 'DP0.00000.000', + productDescription: 'This is a product that products', + }, + selection: { + ...cloneDeep(DEFAULT_STATE.selection), + timeStep: '30min', + rollPeriod: 10, + yAxes: { + y1: { units: 'meters', rangeMode: 'FROM_ZERO', axisRange: [0, 36.7] }, + y2: { units: 'degrees', rangeMode: 'CENTERED', axisRange: [10, 30] }, + }, + }, + }]); + const tree = renderer + .create() + .toJSON(); + expect(tree).toMatchSnapshot(); + }); + }); +}); diff --git a/src/lib_components/components/TimeSeriesViewer/__tests__/TimeSeriesViewerContext.jsx b/src/lib_components/components/TimeSeriesViewer/__tests__/TimeSeriesViewerContext.jsx index b5376e7d..5ff4116a 100644 --- a/src/lib_components/components/TimeSeriesViewer/__tests__/TimeSeriesViewerContext.jsx +++ b/src/lib_components/components/TimeSeriesViewer/__tests__/TimeSeriesViewerContext.jsx @@ -153,6 +153,22 @@ describe('TimeSeriesViewerContext', () => { standardDeviation: 7, })).toStrictEqual([0, 10]); }); + test('returns proper range for CENTERED with 0 stddev; flat at zero', () => { + expect(generateYAxisRange({ + rangeMode: Y_AXIS_RANGE_MODES.CENTERED, + axisRange: [0, 0], + dataRange: [0, 0], + standardDeviation: 0, + })).toStrictEqual([-1, 1]); + }); + test('returns proper range for CENTERED with 0 stddev; flat at non-zero value', () => { + expect(generateYAxisRange({ + rangeMode: Y_AXIS_RANGE_MODES.CENTERED, + axisRange: [0, 0], + dataRange: [-12, -12], + standardDeviation: 0, + })).toStrictEqual([-18, -6]); + }); }); describe('getTimeStep', () => { diff --git a/src/lib_components/components/TimeSeriesViewer/__tests__/TimeSeriesViewerSites.jsx b/src/lib_components/components/TimeSeriesViewer/__tests__/TimeSeriesViewerSites.jsx new file mode 100644 index 00000000..5ccc11f8 --- /dev/null +++ b/src/lib_components/components/TimeSeriesViewer/__tests__/TimeSeriesViewerSites.jsx @@ -0,0 +1,266 @@ +import React from 'react'; +import renderer from 'react-test-renderer'; + +import cloneDeep from 'lodash/cloneDeep'; + +import '../../../../__mocks__/NeonContext'; + +import TimeSeriesViewerContext, { DEFAULT_STATE } from '../TimeSeriesViewerContext'; + +import { getTestableItems } from '../TimeSeriesViewerSites'; + +// Mock the SiteMapContext state +jest.mock('../TimeSeriesViewerContext', () => ({ + ...(jest.requireActual('../TimeSeriesViewerContext').default), + DEFAULT_STATE: jest.requireActual('../TimeSeriesViewerContext').DEFAULT_STATE, + useTimeSeriesViewerState: jest.fn(), +})); + +const { useTimeSeriesViewerState } = TimeSeriesViewerContext; + +const { + ucWord, + PositionHistoryButton, + PositionDetail, + SelectedPosition, + SelectPositionsButton, + SitesControl, + SiteOption, + SelectedSite, +} = getTestableItems(); + +const history010 = [ + { + 'HOR.VER': '000.010', + start: '2019-02-02', + end: '2020-01-09', + azimuth: '0', + pitch: '0', + roll: '0', + xOffset: '2', + yOffset: '1', + zOffset: '0', + referenceLatitude: '67.82', + referenceLongitude: '120.03', + referenceElevation: '980', + }, + { + 'HOR.VER': '000.010', + azimuth: '0', + pitch: '0', + roll: '0', + xOffset: '5', + yOffset: '6', + zOffset: '1', + referenceLatitude: '67.82', + referenceLongitude: '120.03', + referenceElevation: '990', + }, +]; + +describe('TimeSeriesViewerSites', () => { + // ucWord + describe('ucWord', () => { + test('capitalizes as expected', () => { + const cases = [ + ['FOO', 'Foo'], + ['bar', 'Bar'], + ['Qux', 'Qux'], + ]; + cases.forEach((c) => { + expect(ucWord(c[0])).toBe(c[1]); + }); + }); + }); + + // PositionHistoryButton + describe('PositionHistoryButton', () => { + test('Renders disabled when history has less than two entries', () => { + const tree = renderer.create( + , + ).toJSON(); + expect(tree).toMatchSnapshot(); + }); + test('Renders enabled when history has two or more entries', () => { + const tree = renderer.create( + , + ).toJSON(); + expect(tree).toMatchSnapshot(); + }); + }); + + // PositionDetail + describe('PositionDetail', () => { + test('Renders trimmed down detail when position not present in state', () => { + useTimeSeriesViewerState.mockReturnValue([{ + ...cloneDeep(DEFAULT_STATE), + product: { + sites: { + ABBY: { + positions: {}, + }, + }, + }, + }]); + const tree = renderer.create( + , + ).toJSON(); + expect(tree).toMatchSnapshot(); + }); + test('Renders full detail when position history is present', () => { + useTimeSeriesViewerState.mockReturnValue([{ + ...cloneDeep(DEFAULT_STATE), + product: { + sites: { + ABBY: { + positions: { + '000.010': { history: history010 }, + }, + }, + }, + }, + }]); + const tree = renderer.create( + , + ).toJSON(); + expect(tree).toMatchSnapshot(); + }); + test('Renders full wide detail when position history is present', () => { + useTimeSeriesViewerState.mockReturnValue([{ + ...cloneDeep(DEFAULT_STATE), + product: { + sites: { + ABBY: { + positions: { + '000.010': { history: history010 }, + }, + }, + }, + }, + }]); + const tree = renderer.create( + , + ).toJSON(); + expect(tree).toMatchSnapshot(); + }); + }); + + // SelectedPosition + describe('SelectedPosition', () => { + test('Renders as expected', () => { + useTimeSeriesViewerState.mockReturnValue([{ + ...cloneDeep(DEFAULT_STATE), + product: { + sites: { + ABBY: { + positions: {}, + }, + }, + }, + }]); + const tree = renderer.create( + , + ).toJSON(); + expect(tree).toMatchSnapshot(); + }); + }); + + // SelectPositionsButton + describe('SelectPositionsButton', () => { + test('Renders as expected', () => { + useTimeSeriesViewerState.mockReturnValue([{ + ...cloneDeep(DEFAULT_STATE), + product: { + sites: { + ABBY: { + positions: { + '000.010': { history: history010 }, + '000.020': { history: [] }, + }, + }, + }, + }, + }]); + const tree = renderer.create( + , + ).toJSON(); + expect(tree).toMatchSnapshot(); + }); + }); + + // SitesControl + describe('SitesControl', () => { + test('Renders as expected', () => { + const tree = renderer.create( + {} }} + selectProps={{ TextFieldProps: { 'data-textField': 'bar' } }} + innerRef={() => {}} + > +
    children
    +
    , + ).toJSON(); + expect(tree).toMatchSnapshot(); + }); + }); + + // SiteOption + describe('SiteOption', () => { + test('Renders as expected without stateCode', () => { + const data = { + siteCode: 'ABBY', + description: 'Abby Road', + type: 'RELOCATABLE', + stateCode: 'WA', + domainCode: 'D16', + domainName: 'D16 Name', + terrain: 'TERRESTRIAL', + latitude: 45.762439, + longitude: -122.330317, + }; + const tree = renderer.create( + {} }} + innerRef={() => {}} + data={data} + isSelected + isFocused + />, + ).toJSON(); + expect(tree).toMatchSnapshot(); + }); + }); + + // SelectedSite + describe('SelectedSite', () => { + beforeEach(() => { + useTimeSeriesViewerState.mockReturnValue([cloneDeep(DEFAULT_STATE), () => {}]); + }); + test('Renders as expected (terrestrial / relocatable)', () => { + const tree = renderer.create( + , + ).toJSON(); + expect(tree).toMatchSnapshot(); + }); + test('Renders as expected (terrestrial / core)', () => { + const tree = renderer.create( + , + ).toJSON(); + expect(tree).toMatchSnapshot(); + }); + test('Renders as expected (aquatic / relocatable)', () => { + const tree = renderer.create( + , + ).toJSON(); + expect(tree).toMatchSnapshot(); + }); + test('Renders as expected (aquatic / core)', () => { + const tree = renderer.create( + , + ).toJSON(); + expect(tree).toMatchSnapshot(); + }); + }); +}); diff --git a/src/lib_components/components/TimeSeriesViewer/__tests__/__snapshots__/TimeSeriesViewerContainer.jsx.snap b/src/lib_components/components/TimeSeriesViewer/__tests__/__snapshots__/TimeSeriesViewerContainer.jsx.snap new file mode 100644 index 00000000..4709331f --- /dev/null +++ b/src/lib_components/components/TimeSeriesViewer/__tests__/__snapshots__/TimeSeriesViewerContainer.jsx.snap @@ -0,0 +1,1414 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`TimeSeriesViewerContainer TimeSeriesViewerSummary Renders for default state 1`] = ` +
    +
    +
    +
    + Data Product +
    +

    +

    +
    + + + + +
    +
    +
    +
    + Sites & Positions +
    + +
    +
    +
    + Date Range +
    + +
    +
    +
    + Variables +
    + +
    +
    +
    + x/y Axes +
    + + + + + + + +
    + x + +
    + + Time step: + + Auto (null) +
    +
    +
    +
    +`; + +exports[`TimeSeriesViewerContainer TimeSeriesViewerSummary Renders for defined product with sensor / with default selection 1`] = ` +
    +
    +
    +
    + Data Product +
    +

    + + Foo product - (DP0.00000.000) + +

    +
    +
    +

    + This is a product that products +

    +

    + + Sensor: + + + product sensor 123 + +

    +
    +
    +
    +
    + Sites & Positions +
    + +
    +
    +
    + Date Range +
    + +
    +
    +
    + Variables +
    + +
    +
    +
    + x/y Axes +
    + + + + + + + +
    + x + +
    + + Time step: + + Auto (null) +
    +
    +
    +
    +`; + +exports[`TimeSeriesViewerContainer TimeSeriesViewerSummary Renders for defined product without sensor / with default selection 1`] = ` +
    +
    +
    +
    + Data Product +
    +

    + + Foo product - (DP0.00000.000) + +

    +
    +
    +

    + This is a product that products +

    +
    +
    +
    +
    + Sites & Positions +
    + +
    +
    +
    + Date Range +
    + +
    +
    +
    + Variables +
    + +
    +
    +
    + x/y Axes +
    + + + + + + + +
    + x + +
    + + Time step: + + Auto (null) +
    +
    +
    +
    +`; + +exports[`TimeSeriesViewerContainer TimeSeriesViewerSummary Renders for selection with axes 1`] = ` +
    +
    +
    +
    + Data Product +
    +

    + + Foo product - (DP0.00000.000) + +

    +
    +
    +

    + This is a product that products +

    +
    +
    +
    +
    + Sites & Positions +
    + +
    +
    +
    + Date Range +
    + +
    +
    +
    + Variables +
    + +
    +
    +
    + x/y Axes +
    + + + + + + + + + + + + + + + +
    + x + +
    + + Time step: + + 30min +
    +
    + + Roll period: + + 5 hour +
    +
    + y1 + +
    + + Scale: + + Linear +
    +
    + + Units: + + meters +
    +
    + + Range: + + From Zero (0 – 36.7 meters) +
    +
    + y2 + +
    + + Scale: + + Linear +
    +
    + + Units: + + degrees +
    +
    + + Range: + + Centered (10 – 30 degrees) +
    +
    +
    +
    +`; + +exports[`TimeSeriesViewerContainer TimeSeriesViewerSummary Renders for selection with only date range 1`] = ` +
    +
    +
    +
    + Data Product +
    +

    + + Foo product - (DP0.00000.000) + +

    +
    +
    +

    + This is a product that products +

    +
    +
    +
    +
    + Sites & Positions +
    + +
    +
    +
    + Date Range +
    +

    + Apr 2018 - Jan 2020 (1 year, 10 months) +

    +
    +
    +
    + Variables +
    + +
    +
    +
    + x/y Axes +
    + + + + + + + +
    + x + +
    + + Time step: + + Auto (null) +
    +
    +
    +
    +`; + +exports[`TimeSeriesViewerContainer TimeSeriesViewerSummary Renders for selection with only sites 1`] = ` +
    +
    +
    +
    + Data Product +
    +

    + + Foo product - (DP0.00000.000) + +

    +
    +
    +

    + This is a product that products +

    +
    +
    +
    +
    + Sites & Positions +
    +

    + ABBY - 000.010, 000.020 +

    +

    + BARR - 000.030 +

    +
    +
    +
    + Date Range +
    + +
    +
    +
    + Variables +
    + +
    +
    +
    + x/y Axes +
    + + + + + + + +
    + x + +
    + + Time step: + + Auto (null) +
    +
    +
    +
    +`; + +exports[`TimeSeriesViewerContainer TimeSeriesViewerSummary Renders for selection with only variables 1`] = ` +
    +
    +
    +
    + Data Product +
    +

    + + Foo product - (DP0.00000.000) + +

    +
    +
    +

    + This is a product that products +

    +
    +
    +
    +
    + Sites & Positions +
    + +
    +
    +
    + Date Range +
    + +
    +
    +
    + Variables +
    +

    + var1, var2 +

    +
    +
    +
    + x/y Axes +
    + + + + + + + +
    + x + +
    + + Time step: + + Auto (null) +
    +
    +
    +
    +`; + +exports[`TimeSeriesViewerContainer TimeSeriesViewerSummary Renders for selection with variables and qualityFlags 1`] = ` +
    +
    +
    +
    + Data Product +
    +

    + + Foo product - (DP0.00000.000) + +

    +
    +
    +

    + This is a product that products +

    +
    +
    +
    +
    + Sites & Positions +
    + +
    +
    +
    + Date Range +
    + +
    +
    +
    + Variables +
    +

    + var1, var2 +

    +

    + Quality flags: qfA, qfB, qfC +

    +
    +
    +
    + x/y Axes +
    + + + + + + + +
    + x + +
    + + Time step: + + Auto (null) +
    +
    +
    +
    +`; diff --git a/src/lib_components/components/TimeSeriesViewer/__tests__/__snapshots__/TimeSeriesViewerSites.jsx.snap b/src/lib_components/components/TimeSeriesViewer/__tests__/__snapshots__/TimeSeriesViewerSites.jsx.snap new file mode 100644 index 00000000..c9d92bac --- /dev/null +++ b/src/lib_components/components/TimeSeriesViewer/__tests__/__snapshots__/TimeSeriesViewerSites.jsx.snap @@ -0,0 +1,2286 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`TimeSeriesViewerSites PositionDetail Renders full detail when position history is present 1`] = ` +
    +
    +

    + 000.010 +

    +

    + Elevation: +

    +
    + + + +

    + 991.00m +

    +
    +
    +
    +

    + + x: + + 5m +
    + + y: + + 6m +
    + + z: + + 1m +

    +
    +
    + +
    +
    +`; + +exports[`TimeSeriesViewerSites PositionDetail Renders full wide detail when position history is present 1`] = ` +
    +
    +

    + 000.010 +

    +
    +

    + Elevation: +

    + + + +

    + 991.00m +

    +
    +
    +
    +

    + + x / y / z: + + 5m / 6m / 1m +

    +
    +
    +`; + +exports[`TimeSeriesViewerSites PositionDetail Renders trimmed down detail when position not present in state 1`] = ` +

    + 000.010 +

    +`; + +exports[`TimeSeriesViewerSites PositionHistoryButton Renders disabled when history has less than two entries 1`] = ` + +`; + +exports[`TimeSeriesViewerSites PositionHistoryButton Renders enabled when history has two or more entries 1`] = ` + +`; + +exports[`TimeSeriesViewerSites SelectPositionsButton Renders as expected 1`] = ` + +`; + +exports[`TimeSeriesViewerSites SelectedPosition Renders as expected 1`] = ` +
    + +
    +

    + 000.010 +

    +
    +
    +`; + +exports[`TimeSeriesViewerSites SelectedSite Renders as expected (aquatic / core) 1`] = ` +
    +
    +
    + Aquatic Core +
    + Rio Cupeyes (CUPE) +
    + +
    +
    +
    +
    +
    + Aquatic Core +
    +

    + + water-based; fixed location + +

    +
    +
    +
    + + + 18.11352 +
    + -66.98676 +
    +
    +
    +
    +
    +
    +
    + Territory +
    +

    + Puerto Rico +

    +
    +
    +
    + Domain +
    +

    + D04 - Atlantic Neotropical +

    +
    +
    +
    +
    +
    +
    +
    + Position(s) +
    + + +
    +
    +
    + +
    +

    + 000.010 +

    +
    +
    +
    +
    +
    +`; + +exports[`TimeSeriesViewerSites SelectedSite Renders as expected (aquatic / relocatable) 1`] = ` +
    +
    +
    + Aquatic Relocatable +
    + Upper Big Creek (BIGC) +
    + +
    +
    +
    +
    +
    + Aquatic Relocatable +
    +

    + + water-based; location may change + +

    +
    +
    +
    + + + 37.059719 +
    + -119.257549 +
    +
    +
    +
    +
    +
    +
    + State +
    +

    + California +

    +
    +
    +
    + Domain +
    +

    + D17 - Pacific Southwest +

    +
    +
    +
    +
    +
    +
    +
    + Position(s) +
    + + +
    +
    +
    + +
    +

    + 000.030 +

    +
    +
    +
    + +
    +

    + 000.010 +

    +
    +
    +
    +
    +
    +`; + +exports[`TimeSeriesViewerSites SelectedSite Renders as expected (terrestrial / core) 1`] = ` +
    +
    +
    + Terrestrial Core +
    + Central Plains Experimental Range (CPER) +
    + +
    +
    +
    +
    +
    + Terrestrial Core +
    +

    + + land-based; fixed location + +

    +
    +
    +
    + + + 40.815536 +
    + -104.745591 +
    +
    +
    +
    +
    +
    +
    + State +
    +

    + Colorado +

    +
    +
    +
    + Domain +
    +

    + D10 - Central Plains +

    +
    +
    +
    +
    +
    +
    +
    + Position(s) +
    + + +
    +
    +
    + +
    +

    + 000.050 +

    +
    +
    +
    + +
    +

    + 000.040 +

    +
    +
    +
    +
    +
    +`; + +exports[`TimeSeriesViewerSites SelectedSite Renders as expected (terrestrial / relocatable) 1`] = ` +
    +
    +
    + Terrestrial Relocatable +
    + Abby Road (ABBY) +
    + +
    +
    +
    +
    +
    + Terrestrial Relocatable +
    +

    + + land-based; location may change + +

    +
    +
    +
    + + + 45.762439 +
    + -122.330317 +
    +
    +
    +
    +
    +
    +
    + State +
    +

    + Washington +

    +
    +
    +
    + Domain +
    +

    + D16 - Pacific Northwest +

    +
    +
    +
    +
    +
    +
    +
    + Position(s) +
    + + +
    +
    +
    + +
    +

    + 000.020 +

    +
    +
    +
    + +
    +

    + 000.010 +

    +
    +
    +
    +
    +
    +`; + +exports[`TimeSeriesViewerSites SiteOption Renders as expected without stateCode 1`] = ` + +`; + +exports[`TimeSeriesViewerSites SitesControl Renders as expected 1`] = ` +
    + +
    +
    +
    + children +
    +
    +
    + + + +
    +
    + + + Add Sites + + +
    +
    +
    +`; diff --git a/src/lib_components/index.ts b/src/lib_components/index.ts index 71c3d7c4..15967f4d 100644 --- a/src/lib_components/index.ts +++ b/src/lib_components/index.ts @@ -21,13 +21,7 @@ export { default as ExternalHost } from './components/ExternalHost'; export { default as ExternalHostInfo } from './components/ExternalHostInfo'; export { default as ExternalHostProductSpecificLinks } from './components/ExternalHostProductSpecificLinks'; export { default as FullWidthVisualization } from './components/FullWidthVisualization'; - export { default as NeonFooter } from './components/NeonFooter'; export { default as NeonHeader } from './components/NeonHeader'; -export { default as NeonMenu } from './components/NeonMenu'; -export { default as NeonUtilityBar } from './components/NeonUtilityBar'; export { default as NeonJsonLd } from './components/NeonJsonLd'; - export { default as DialogBase } from './components/DialogBase'; -export { default as PopupBase } from './components/PopupBase'; -export { default as PopupLoading } from './components/PopupLoading'; diff --git a/src/lib_components/remoteAssets/drupal-footer.html.js b/src/lib_components/remoteAssets/drupal-footer.html.js index 4abb98bb..fac77d55 100644 --- a/src/lib_components/remoteAssets/drupal-footer.html.js +++ b/src/lib_components/remoteAssets/drupal-footer.html.js @@ -62,6 +62,9 @@ export default html = ` + diff --git a/src/lib_components/remoteAssets/drupal-header.js b/src/lib_components/remoteAssets/drupal-header.js index 66ecc053..db89b303 100644 --- a/src/lib_components/remoteAssets/drupal-header.js +++ b/src/lib_components/remoteAssets/drupal-header.js @@ -6,7 +6,7 @@ require=(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof requ try { onReady(); } catch (error) { - console.log(error); + console.error(error); } }); @@ -92,7 +92,7 @@ require=(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof requ // Mobile Nav trigger $(".js-mobile-nav-trigger").on("change", function (e) { $("body")[e.target.checked ? "addClass" : "removeClass"]("js-prevent-scroll"); - console.log("mobile trigger"); + // console.log("mobile trigger"); $(".subNavWrapper").each(function (e) { $(this).removeClass("depthZero depthOne depthTwo depthThree depthFour").addClass("subNavWrapper"); }); @@ -155,7 +155,7 @@ require=(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof requ // ===== Mobile Back Button ==== $("nav#block-neon-main-menu ul.menu--main li.menu__item.menu__item--expanded .mobileBack").click(function (e) { e.stopPropagation(); - console.log("mobile back"); + // console.log("mobile back"); var thisParent = $(this).parent().closest(".subNavWrapper"); var depthFour = $(thisParent).hasClass("depthFour").toString(); @@ -165,25 +165,32 @@ require=(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof requ var depthZero = $(thisParent).hasClass("depthZero").toString(); if (depthFour === "true") { + // console.log('depth 4') thisParent.removeClass("depthFour"); $(thisParent).find("ul[data-depth='4'] > li.expandable").removeClass("active"); } else if (depthThree === "true") { + // console.log('depth 3') thisParent.removeClass("depthThree"); $(thisParent).find("ul[data-depth='3'] > li.expandable").removeClass("active"); } else if (depthTwo === "true") { + // console.log('depth 2') thisParent.removeClass("depthTwo"); $(thisParent).find("ul[data-depth='2'] > li.expandable").removeClass("active"); } else if (depthOne === "true") { + // console.log('depth 1') thisParent.removeClass("depthOne"); $(thisParent).find("ul[data-depth='1'] > li.expandable").removeClass("active"); } else if (depthZero === "true") { + // console.log('depth 0') thisParent.removeClass("depthZero"); $("ul[data-depth='0'] > li.menu__item--expanded").removeClass("over"); $(thisParent).find("ul[data-depth='0'] > li.expandable").removeClass("active"); $("nav#block-neon-main-menu ul[data-depth='0'] > li.menu__item--expanded .subNavWrapper").each(function (e) { $(this).removeClass("depthZero depthOne depthTwo depthThree depthFour").addClass("subNavWrapper"); }); - } else {} + } else { + // console.log('depth ?') + } }); // Press esc key to close the mega menu @@ -223,11 +230,11 @@ require=(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof requ e.stopPropagation(); // check if item is active var $active = $(this).hasClass("active").toString(); - console.log("level one " + $active); + // console.log(`level one ${$active}`); var $MegaMenu3rdCol = $(".subNavWrapper").hasClass("depthOne").toString(); var $MegaMenu4thCol = $(".subNavWrapper").hasClass("depthThree").toString(); if ($active === "true") { - console.log("active"); + // console.log("active"); $(this).parent().closest(".subNavWrapper").removeClass("depthOne"); $(this).parent().closest(".subNavWrapper").removeClass("depthThree"); $(this).children().find("li.active").removeClass("active"); @@ -238,12 +245,12 @@ require=(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof requ $(this).siblings("li").find("li.active").removeClass("active"); if ($MegaMenu3rdCol === "true" && $MegaMenu4thCol === "true") { - console.log("not active 1"); + // console.log("not active 1"); $(this).parent().closest(".subNavWrapper").toggleClass("depthThree"); } else if ($MegaMenu3rdCol === "true") { - console.log("not active 2"); + // console.log("not active 2"); } else { - console.log("not active 3"); + // console.log("not active 3"); $(this).parent().closest(".subNavWrapper").toggleClass("depthOne"); } } @@ -251,16 +258,12 @@ require=(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof requ $('nav#block-neon-main-menu ul.menu--main[data-depth="2"] > li.expandable').click(function (e) { e.stopPropagation(); - console.log("level two"); + $(this).addClass("active"); $(this).parent().closest(".subNavWrapper").toggleClass("depthTwo"); - $(this).parent().closest(".subNavWrapper").toggleClass("depthThree"); }); $('nav#block-neon-main-menu ul.menu--main[data-depth="3"] > li.expandable').click(function (e) { e.stopPropagation(); - //$(this).parents("ul[data-depth='2']").children("li").removeClass("active"); - // $(this).addClass("active"); - var $MegaMenu4thCol = $(".subNavWrapper").hasClass("depthThree").toString(); if ($MegaMenu4thCol !== "true") { $(this).parent().closest(".subNavWrapper").toggleClass("depthThree"); @@ -269,8 +272,7 @@ require=(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof requ $('nav#block-neon-main-menu ul.menu--main[data-depth="4"] > li.expandable').click(function (e) { e.stopPropagation(); - console.log("level four"); - // + $(this).addClass("active"); $(this).parent().closest(".subNavWrapper").toggleClass("depthFour"); }); @@ -279,7 +281,7 @@ require=(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof requ e.stopPropagation(); //$(this).toggleClass("active").parents("ul").children("li").removeClass("active"); $(this).toggleClass("active").siblings("li").removeClass("active"); - console.log("remove active - Level One"); + // console.log("remove active - Level One"); }); // Add a class to the sub items that expand more sub lists - FOR the third level @@ -287,14 +289,14 @@ require=(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof requ e.stopPropagation(); if ($(this).hasClass("active").toString() === "true") { - console.log("true"); + // console.log("true"); $(this).removeClass("active"); } else { - console.log("false"); + // console.log("false"); $("ul[data-depth='3']").children("li").removeClass("active"); $(this).addClass("active").siblings("li").removeClass("active"); } - console.log("remove active - Level Three"); + // console.log("remove active - Level Three"); }); // Hide/show Desktop Search @@ -306,7 +308,7 @@ require=(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof requ $(".header__search-close button").click(function (e) { e.stopPropagation(); - console.log("close mega menu"); + // console.log("close mega menu"); if ($(".header__search").hasClass("visually-hidden")) { return false; } else { diff --git a/src/lib_components/remoteAssets/drupal-theme.css b/src/lib_components/remoteAssets/drupal-theme.css index f72916ba..69461aa1 100644 --- a/src/lib_components/remoteAssets/drupal-theme.css +++ b/src/lib_components/remoteAssets/drupal-theme.css @@ -2987,7 +2987,13 @@ background: none; -webkit-appearance: none; -moz-appearance: none; - appearance: none; } + appearance: none; + display: -ms-flexbox; + display: flex; + -ms-flex-pack: center; + justify-content: center; + -ms-flex-align: center; + align-items: center; } #header nav#block-neon-main-menu ul[data-depth="0"], #footer nav#block-neon-main-menu ul[data-depth="0"] { visibility: visible; width: 100%; diff --git a/src/lib_components/workers/__tests__/generateTimeSeriesGraphData.js b/src/lib_components/workers/__tests__/generateTimeSeriesGraphData.js index e5f39ec4..12a7421f 100644 --- a/src/lib_components/workers/__tests__/generateTimeSeriesGraphData.js +++ b/src/lib_components/workers/__tests__/generateTimeSeriesGraphData.js @@ -81,7 +81,9 @@ describe('generateTimeSeriesGraphData worker', () => { expect(tickerToIso()).toBe(null); expect(tickerToIso('2020-01')).toBe(null); expect(tickerToIso(946684800000)).toBe('2000-01-01T00:00:00Z'); - expect(tickerToIso(2077453337000)).toBe('2035-10-31T14:22:17Z'); + expect(tickerToIso(2077453337000, true)).toBe('2035-10-31T14:22:17Z'); + expect(tickerToIso(946684800000, false)).toBe('2000-01-01T00:00Z'); + expect(tickerToIso(2077453337000, false)).toBe('2035-10-31T14:22Z'); }); test('getNextMonth()', () => { expect(getNextMonth()).toBe(null); diff --git a/src/lib_components/workers/generateTimeSeriesGraphData.js b/src/lib_components/workers/generateTimeSeriesGraphData.js index 92801512..43483e09 100644 --- a/src/lib_components/workers/generateTimeSeriesGraphData.js +++ b/src/lib_components/workers/generateTimeSeriesGraphData.js @@ -48,7 +48,7 @@ function tickerToMonth(ticker) { return `${YYYY}-${MM}`; } -function tickerToIso(ticker) { +function tickerToIso(ticker, includeSeconds = true) { if (!tickerIsValid(ticker)) { return null; } const d = new Date(ticker); const YYYY = d.getUTCFullYear().toString(); @@ -57,7 +57,9 @@ function tickerToIso(ticker) { const hh = d.getUTCHours().toString().padStart(2, '0'); const mm = d.getUTCMinutes().toString().padStart(2, '0'); const ss = d.getUTCSeconds().toString().padStart(2, '0'); - return `${YYYY}-${MM}-${DD}T${hh}:${mm}:${ss}Z`; + return includeSeconds + ? `${YYYY}-${MM}-${DD}T${hh}:${mm}:${ss}Z` + : `${YYYY}-${MM}-${DD}T${hh}:${mm}Z`; } function getNextMonth(month) { @@ -332,10 +334,13 @@ export default function generateTimeSeriesGraphData(payload = {}) { // Series data length is shorter than expected month length: // Add what data we have by going through each time step in the month and comparing to // start dates in the data set, null-filling any steps without a corresponding datum + // Note that sometimes dates come back with seconds and sometimes without, so for + // matching we look for either. const setSeriesValueByTimestamp = (t) => { - const isodate = tickerToIso(newData[t][0].getTime()); + const isodateS = tickerToIso(newData[t][0].getTime(), true); + const isodateM = tickerToIso(newData[t][0].getTime(), false); const dataIdx = posData[month][pkg][timeStep].series[dateTimeVariable].data - .findIndex((dateTimeVal) => dateTimeVal === isodate); + .findIndex((dateTimeVal) => (dateTimeVal === isodateS || dateTimeVal === isodateM)); newData[t][columnIdx] = dataIdx !== -1 ? posData[month][pkg][timeStep].series[variable].data[dataIdx] : null; diff --git a/tsconfig.json b/tsconfig.json index 512359be..05a2f792 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -23,7 +23,8 @@ "noEmit": true, "jsx": "react", "allowJs": true, - "isolatedModules": true + "isolatedModules": true, + "noFallthroughCasesInSwitch": true }, "include": [ "./src/**/*"