@civicactions/cmsds-open-data-components 1.16.0-beta.3 → 1.16.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -2,4 +2,6 @@
2
2
 
3
3
  require("./templates/footer");
4
4
 
5
- require("./templates/header");
5
+ require("./templates/header");
6
+
7
+ require("./templates/page_not_found");
@@ -12,12 +12,12 @@ Cypress.Commands.add('testFooterGetUpdates', function (title, description, link)
12
12
  });
13
13
  Cypress.Commands.add('testFooterCMSInfo', function () {
14
14
  cy.findByRole('link', {
15
- name: 'U.S. Department of Health & Human Services'
15
+ name: 'HHS Logo opens in new window'
16
16
  }).should('have.attr', 'href', 'http://www.hhs.gov/'); //change to https when moving upstream
17
17
 
18
18
  cy.findByAltText('HHS Logo').should('exist');
19
19
  cy.findByRole('link', {
20
- name: 'CMS.gov Centers for Medicare & Medicaid Services'
20
+ name: 'CMS Logo opens in new window'
21
21
  }).should('have.attr', 'href', 'http://www.cms.gov/'); //change to https when moving upstream
22
22
 
23
23
  cy.findByAltText('CMS Logo').should('exist');
@@ -0,0 +1,14 @@
1
+ "use strict";
2
+
3
+ Cypress.Commands.add('testPageNotFound', function () {
4
+ cy.findByRole("heading", {
5
+ level: 1,
6
+ name: "Error: Page not found"
7
+ }).should("exist");
8
+ cy.findByText("We're sorry, but there is no web page that matches your entry. You may have been directed here because:").should("exist");
9
+ cy.get(".ds-l-container").findAllByRole("listitem").should("have.length", 3);
10
+ cy.findByText("The address you typed contains a typo;").should("exist");
11
+ cy.findByText("The requested page may have expired or;").should("exist");
12
+ cy.findByText("The requested page may have been moved.").should("exist");
13
+ cy.findByText("If you were using a bookmark, please reset it once you find the correct page.").should("exist");
14
+ });
@@ -71,7 +71,8 @@ var MobileHeader = function MobileHeader(_ref) {
71
71
 
72
72
  function handleClick(event) {
73
73
  // Links are wrapped in spans, this checks if the parent is an A, also check if in the search modal.
74
- if (event.target.parentElement.nodeName === 'A' || event.target.closest('.dc-c-search-dialog')) {
74
+ if ( // event.target.parentElement.nodeName === 'A' ||
75
+ event.target.closest('.dc-c-search-dialog')) {
75
76
  setMenuOpen(false);
76
77
  }
77
78
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@civicactions/cmsds-open-data-components",
3
- "version": "1.16.0-beta.3",
3
+ "version": "1.16.0",
4
4
  "description": "Components for the open data catalog frontend using CMS Design System",
5
5
  "main": "lib/index.js",
6
6
  "scripts": {
@@ -1,44 +0,0 @@
1
- "use strict";
2
-
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
-
5
- Object.defineProperty(exports, "__esModule", {
6
- value: true
7
- });
8
- exports["default"] = void 0;
9
-
10
- var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
11
-
12
- var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
13
-
14
- var _react = require("react");
15
-
16
- function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
17
-
18
- function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0, _defineProperty2["default"])(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
19
-
20
- var useAddLoginLink = function useAddLoginLink(hosts, menuItems, targetKey, loginLinkObj) {
21
- var _useState = (0, _react.useState)(_objectSpread({}, menuItems)),
22
- _useState2 = (0, _slicedToArray2["default"])(_useState, 2),
23
- linksArray = _useState2[0],
24
- setLinksArray = _useState2[1];
25
-
26
- (0, _react.useEffect)(function () {
27
- var localLinks = _objectSpread({}, menuItems);
28
-
29
- if (hosts.findIndex(function (host) {
30
- return host === window.location.host;
31
- }) > -1) {
32
- if (localLinks[targetKey].findIndex(function (link) {
33
- return link.id === loginLinkObj.id;
34
- }) === -1) {
35
- localLinks[targetKey].unshift(loginLinkObj);
36
- setLinksArray(localLinks);
37
- }
38
- }
39
- }, [linksArray]);
40
- return linksArray;
41
- };
42
-
43
- var _default = useAddLoginLink;
44
- exports["default"] = _default;