qpp-style 9.13.4 → 9.14.2
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.
- package/README.md +37 -0
- package/components/DropdownButton/DropdownButton.stories.js +137 -0
- package/components/DropdownButton/index.js +148 -0
- package/components/Footer/Footer.stories.js +2 -2
- package/components/Footer/FooterUI.jsx +44 -48
- package/coverage/clover.xml +133 -114
- package/coverage/coverage-final.json +7 -7
- package/coverage/lcov-report/index.html +39 -40
- package/coverage/lcov-report/react/components/Accordion/index.html +2 -3
- package/coverage/lcov-report/react/components/Accordion/index.jsx.html +2 -3
- package/coverage/lcov-report/react/components/Button/index.html +2 -3
- package/coverage/lcov-report/react/components/Button/index.js.html +2 -3
- package/coverage/lcov-report/react/components/Error/Collapsible.jsx.html +2 -3
- package/coverage/lcov-report/react/components/Error/ErrorUI.jsx.html +2 -3
- package/coverage/lcov-report/react/components/Error/error.js.html +2 -3
- package/coverage/lcov-report/react/components/Error/index.html +2 -3
- package/coverage/lcov-report/react/components/Footer/FooterUI.jsx.html +50 -6
- package/coverage/lcov-report/react/components/Footer/LegacyFooterUI.jsx.html +2 -3
- package/coverage/lcov-report/react/components/Footer/SocialLinks.jsx.html +2 -3
- package/coverage/lcov-report/react/components/Footer/Subscribe.jsx.html +2 -3
- package/coverage/lcov-report/react/components/Footer/footer.js.html +2 -3
- package/coverage/lcov-report/react/components/Footer/index.html +2 -3
- package/coverage/lcov-report/react/components/Header/HeaderAccountMenu.jsx.html +2 -3
- package/coverage/lcov-report/react/components/Header/HeaderCancel.jsx.html +2 -3
- package/coverage/lcov-report/react/components/Header/HeaderContainer.jsx.html +2 -3
- package/coverage/lcov-report/react/components/Header/HeaderLogo.jsx.html +2 -3
- package/coverage/lcov-report/react/components/Header/HeaderMenuButton.js.html +2 -3
- package/coverage/lcov-report/react/components/Header/HeaderMenuItem.jsx.html +39 -13
- package/coverage/lcov-report/react/components/Header/HeaderMenuLink.js.html +2 -3
- package/coverage/lcov-report/react/components/Header/HeaderMenuSignOutButton.js.html +2 -3
- package/coverage/lcov-report/react/components/Header/HeaderMobileButton.js.html +2 -3
- package/coverage/lcov-report/react/components/Header/HeaderUI.jsx.html +6 -4
- package/coverage/lcov-report/react/components/Header/HelpIcon.jsx.html +2 -3
- package/coverage/lcov-report/react/components/Header/ImpersonatorBanner.jsx.html +77 -21
- package/coverage/lcov-report/react/components/Header/NavigationButtonIcon.jsx.html +2 -3
- package/coverage/lcov-report/react/components/Header/header.js.html +2 -3
- package/coverage/lcov-report/react/components/Header/hooks.js.html +2 -3
- package/coverage/lcov-report/react/components/Header/index.html +30 -31
- package/coverage/lcov-report/react/components/Header/utag-helpers.js.html +2 -3
- package/coverage/lcov-report/react/components/Infotip/Infotip.jsx.html +2 -3
- package/coverage/lcov-report/react/components/Infotip/InfotipIcon.jsx.html +2 -3
- package/coverage/lcov-report/react/components/Infotip/index.html +2 -3
- package/coverage/lcov-report/react/components/Infotip/index.js.html +2 -3
- package/coverage/lcov-report/react/components/Modal/LegacyModal.jsx.html +2 -3
- package/coverage/lcov-report/react/components/Modal/Modal.jsx.html +2 -3
- package/coverage/lcov-report/react/components/Modal/index.html +2 -3
- package/coverage/lcov-report/react/components/Modal/index.jsx.html +2 -3
- package/coverage/lcov-report/react/components/NotificationBanner/index.html +2 -3
- package/coverage/lcov-report/react/components/NotificationBanner/index.js.html +2 -3
- package/coverage/lcov-report/react/components/SanitizedContent/index.html +2 -3
- package/coverage/lcov-report/react/components/SanitizedContent/index.jsx.html +2 -3
- package/coverage/lcov-report/react/components/SessionDialog/index.html +2 -3
- package/coverage/lcov-report/react/components/SessionDialog/sessionDialog.js.html +2 -3
- package/coverage/lcov-report/react/components/SessionDialogUI.jsx.html +2 -3
- package/coverage/lcov-report/react/components/SideNav/AnimationGroup/AnimationGroup.jsx.html +2 -3
- package/coverage/lcov-report/react/components/SideNav/AnimationGroup/index.html +2 -3
- package/coverage/lcov-report/react/components/SideNav/Chart/ScoreChart.jsx.html +2 -3
- package/coverage/lcov-report/react/components/SideNav/Chart/index.html +2 -3
- package/coverage/lcov-report/react/components/SideNav/Chart/index.js.html +2 -3
- package/coverage/lcov-report/react/components/SideNav/Content/LevelOneContent.jsx.html +109 -14
- package/coverage/lcov-report/react/components/SideNav/Content/LevelTwoContent.jsx.html +2 -3
- package/coverage/lcov-report/react/components/SideNav/Content/index.html +19 -20
- package/coverage/lcov-report/react/components/SideNav/Content/index.js.html +2 -3
- package/coverage/lcov-report/react/components/SideNav/Details/IndividualDetails.jsx.html +2 -3
- package/coverage/lcov-report/react/components/SideNav/Details/PracticeDetails.jsx.html +2 -3
- package/coverage/lcov-report/react/components/SideNav/Details/index.html +2 -3
- package/coverage/lcov-report/react/components/SideNav/Details/index.js.html +2 -3
- package/coverage/lcov-report/react/components/SideNav/Links/CmsSwitchLink.jsx.html +2 -3
- package/coverage/lcov-report/react/components/SideNav/Links/NavItemInline.jsx.html +2 -3
- package/coverage/lcov-report/react/components/SideNav/Links/NavLinkContainer.jsx.html +2 -3
- package/coverage/lcov-report/react/components/SideNav/Links/NavLinkDrawer.jsx.html +2 -3
- package/coverage/lcov-report/react/components/SideNav/Links/NavLinkInline.jsx.html +2 -3
- package/coverage/lcov-report/react/components/SideNav/Links/NavLinkToggle.jsx.html +2 -3
- package/coverage/lcov-report/react/components/SideNav/Links/index.html +2 -3
- package/coverage/lcov-report/react/components/SideNav/Links/index.js.html +2 -3
- package/coverage/lcov-report/react/components/SideNav/UI/SideNavUI.jsx.html +9 -4
- package/coverage/lcov-report/react/components/SideNav/UI/index.html +2 -3
- package/coverage/lcov-report/react/components/SideNav/UI/index.js.html +2 -3
- package/coverage/lcov-report/react/components/SideNav/helpers.js.html +2 -3
- package/coverage/lcov-report/react/components/SideNav/index.html +2 -3
- package/coverage/lcov-report/react/components/SideNav/index.js.html +2 -3
- package/coverage/lcov-report/react/components/Tooltip/Tooltip.jsx.html +2 -3
- package/coverage/lcov-report/react/components/Tooltip/index.html +2 -3
- package/coverage/lcov-report/react/components/Tooltip/index.js.html +2 -3
- package/coverage/lcov-report/react/components/Tooltip/position.js.html +2 -3
- package/coverage/lcov-report/react/components/hooks/index.html +2 -3
- package/coverage/lcov-report/react/components/hooks/useGetConfig.js.html +2 -3
- package/coverage/lcov-report/react/components/index.html +2 -3
- package/coverage/lcov-report/react/index.html +2 -3
- package/coverage/lcov-report/react/index.js.html +2 -3
- package/coverage/lcov-report/react/lib/Chevron.jsx.html +2 -3
- package/coverage/lcov-report/react/lib/SvgComponents.jsx.html +2 -3
- package/coverage/lcov-report/react/lib/index.html +2 -3
- package/coverage/lcov-report/react/lib/svg-definitions.svg.html +2 -3
- package/coverage/lcov-report/react/session/index.html +21 -22
- package/coverage/lcov-report/react/session/index.js.html +2 -3
- package/coverage/lcov-report/react/session/logout.js.html +75 -13
- package/coverage/lcov-report/react/session/refresh.js.html +2 -3
- package/coverage/lcov-report/react/session/ttl.js.html +2 -3
- package/coverage/lcov.info +298 -240
- package/dist/browser.js +1 -1
- package/dist/browser.js.LICENSE.txt +1 -1
- package/dist/browser.js.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.LICENSE.txt +1 -1
- package/dist/index.js.map +1 -1
- package/dist/react/index.js +1 -1
- package/dist/react/index.js.LICENSE.txt +10 -1
- package/dist/react/index.js.map +1 -1
- package/images/icons/svg/file-download.svg +1 -0
- package/package.json +2 -5
- package/styles/qppds/components/_button.scss +11 -2
- package/styles/qppds/components/_circular-loader.scss +47 -0
- package/styles/qppds/components/_dropdown-menu.scss +119 -0
- package/styles/qppds/components/_footer.scss +7 -0
- package/styles/qppds/components/index.scss +2 -0
- package/test-setup.js +0 -4
package/README.md
CHANGED
|
@@ -3,3 +3,40 @@
|
|
|
3
3
|
This directory contains react implementations of the components for QPP.
|
|
4
4
|
|
|
5
5
|
A storybook with examples is published at [https://cmsgov.github.io/qpp-style](https://cmsgov.github.io/qpp-style)
|
|
6
|
+
|
|
7
|
+
## Github Branch and Pull Request process
|
|
8
|
+
1. Create branch off main and create a Pull Request into main for the feature.
|
|
9
|
+
>Example Branch Name: feature/QPPXX-XXXX_make_icon_better
|
|
10
|
+
2. Once merged into main, create release branch from main.
|
|
11
|
+
3. Name the new branch release/x.xx.x
|
|
12
|
+
4. Run the version bump:
|
|
13
|
+
|
|
14
|
+
```bash
|
|
15
|
+
cd qpp-style/react
|
|
16
|
+
npm version --no-git-tag-version patch
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
Example Commit Message:
|
|
20
|
+
> x.xx.x release
|
|
21
|
+
|
|
22
|
+
5. Create a pull request against main with the PR Title: x.xx.x release [Example PR](https://github.com/CMSgov/qpp-style/pull/1065)
|
|
23
|
+
6. Enter the change in the description of the pull request i.e.:
|
|
24
|
+
> Added new svg for Icon Name
|
|
25
|
+
|
|
26
|
+
## Generate an NPM token with Publish permissions
|
|
27
|
+
1. If you do not already have an access token, sign in to npmjs.com and navigate to access tokens.
|
|
28
|
+
2. Click generate new token.
|
|
29
|
+
3. Select publish under type.
|
|
30
|
+
4. Copy the npm token and set its value as the environment variable: NPM_TOKEN
|
|
31
|
+
|
|
32
|
+
```bash
|
|
33
|
+
export NPM_TOKEN={npm_token}
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
## Publish the react qpp-style npm package (used by both react and angular)
|
|
37
|
+
```bash
|
|
38
|
+
cd qpp-style/react
|
|
39
|
+
npm i
|
|
40
|
+
npm publish
|
|
41
|
+
```
|
|
42
|
+
7. Once published successfully, merge into main.
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import SvgIcon from '@material-ui/core/SvgIcon';
|
|
3
|
+
import DropdownButton from './index';
|
|
4
|
+
import { withKnobs, boolean } from '@storybook/addon-knobs';
|
|
5
|
+
|
|
6
|
+
export default {
|
|
7
|
+
title: 'DropdownButton',
|
|
8
|
+
component: DropdownButton,
|
|
9
|
+
decorators: [withKnobs],
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
// mat-ui v4 doesn't include this "FileDownload" icon, but mat-ui v5 does
|
|
13
|
+
// whenever we update to v5, we could replace this svg with the one from npm
|
|
14
|
+
const DownloadIcon = (...props) => (
|
|
15
|
+
<SvgIcon {...props}>
|
|
16
|
+
<path d="M18,15v3H6v-3H4v3c0,1.1,0.9,2,2,2h12c1.1,0,2-0.9,2-2v-3H18z M17,11l-1.41-1.41L13,12.17V4h-2v8.17L8.41,9.59L7,11l5,5 L17,11z" />
|
|
17
|
+
</SvgIcon>
|
|
18
|
+
);
|
|
19
|
+
|
|
20
|
+
export const BasicExample = () => (
|
|
21
|
+
<div className="qpp-u-padding--48">
|
|
22
|
+
<DropdownButton
|
|
23
|
+
menuId="example-menu-1"
|
|
24
|
+
ariaLabel="aria label example"
|
|
25
|
+
buttonLabel="Test"
|
|
26
|
+
options={[
|
|
27
|
+
{
|
|
28
|
+
value: 'option 1',
|
|
29
|
+
},
|
|
30
|
+
{ value: 'option 2', name: 'Name of Option 2' },
|
|
31
|
+
]}
|
|
32
|
+
loading={boolean('loading', false)}
|
|
33
|
+
/>
|
|
34
|
+
</div>
|
|
35
|
+
);
|
|
36
|
+
|
|
37
|
+
/*
|
|
38
|
+
Dropdown menu headers were removed from designs for now. We may revisit this
|
|
39
|
+
in the future so we're leaving this here until we decide on design.
|
|
40
|
+
*/
|
|
41
|
+
// export const WithHeader = () => (
|
|
42
|
+
// <div className="qpp-u-padding--48">
|
|
43
|
+
// <DropdownButton
|
|
44
|
+
// menuId="example-menu-2"
|
|
45
|
+
// ariaLabel="aria label example"
|
|
46
|
+
// buttonLabel="Test"
|
|
47
|
+
// options={[
|
|
48
|
+
// {
|
|
49
|
+
// value: 'option 1',
|
|
50
|
+
// },
|
|
51
|
+
// { value: 'option 2', name: 'Name of Option 2' },
|
|
52
|
+
// ]}
|
|
53
|
+
// header="Header"
|
|
54
|
+
// />
|
|
55
|
+
// </div>
|
|
56
|
+
// );
|
|
57
|
+
|
|
58
|
+
export const Loading = () => (
|
|
59
|
+
<div className="qpp-u-padding--48">
|
|
60
|
+
<DropdownButton
|
|
61
|
+
menuId="example-menu-3"
|
|
62
|
+
ariaLabel="aria label example"
|
|
63
|
+
buttonLabel="Test"
|
|
64
|
+
options={[
|
|
65
|
+
{
|
|
66
|
+
value: 'option 1',
|
|
67
|
+
},
|
|
68
|
+
{ value: 'option 2', name: 'Name of Option 2' },
|
|
69
|
+
]}
|
|
70
|
+
loading
|
|
71
|
+
/>
|
|
72
|
+
</div>
|
|
73
|
+
);
|
|
74
|
+
|
|
75
|
+
export const MaxHeight = () => (
|
|
76
|
+
<div className="qpp-u-padding--48">
|
|
77
|
+
<DropdownButton
|
|
78
|
+
menuId="example-menu-3"
|
|
79
|
+
ariaLabel="aria label example"
|
|
80
|
+
buttonLabel="Test"
|
|
81
|
+
options={[
|
|
82
|
+
{ value: 'option 1' },
|
|
83
|
+
{ value: 'option 2' },
|
|
84
|
+
{ value: 'option 3' },
|
|
85
|
+
{ value: 'option 4' },
|
|
86
|
+
{ value: 'option 5' },
|
|
87
|
+
{ value: 'option 6' },
|
|
88
|
+
{ value: 'option 7' },
|
|
89
|
+
{ value: 'option 8' },
|
|
90
|
+
{ value: 'option 9' },
|
|
91
|
+
]}
|
|
92
|
+
loading={boolean('loading', false)}
|
|
93
|
+
/>
|
|
94
|
+
</div>
|
|
95
|
+
);
|
|
96
|
+
|
|
97
|
+
export const MaxWidth = () => (
|
|
98
|
+
<div className="qpp-u-padding--48">
|
|
99
|
+
<DropdownButton
|
|
100
|
+
menuId="example-menu-1"
|
|
101
|
+
ariaLabel="aria label example"
|
|
102
|
+
buttonLabel="Test"
|
|
103
|
+
options={[
|
|
104
|
+
{ value: 'option 1' },
|
|
105
|
+
{
|
|
106
|
+
value: 'option 2',
|
|
107
|
+
name: 'very long item text 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24',
|
|
108
|
+
},
|
|
109
|
+
]}
|
|
110
|
+
loading={boolean('loading', false)}
|
|
111
|
+
/>
|
|
112
|
+
</div>
|
|
113
|
+
);
|
|
114
|
+
|
|
115
|
+
export const ItemsWithIcons = () => (
|
|
116
|
+
<div className="qpp-u-padding--48">
|
|
117
|
+
<DropdownButton
|
|
118
|
+
menuId="example-menu-1"
|
|
119
|
+
ariaLabel="aria label example"
|
|
120
|
+
buttonLabel="Test"
|
|
121
|
+
options={[
|
|
122
|
+
{
|
|
123
|
+
value: 'option 1',
|
|
124
|
+
Icon: DownloadIcon,
|
|
125
|
+
'aria-roledescription': 'Download file',
|
|
126
|
+
},
|
|
127
|
+
{
|
|
128
|
+
value: 'option 2',
|
|
129
|
+
name: 'very long item text 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24',
|
|
130
|
+
Icon: DownloadIcon,
|
|
131
|
+
'aria-roledescription': 'Download file',
|
|
132
|
+
},
|
|
133
|
+
]}
|
|
134
|
+
loading={boolean('loading', false)}
|
|
135
|
+
/>
|
|
136
|
+
</div>
|
|
137
|
+
);
|
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
import React, { useState } from 'react';
|
|
2
|
+
import PropTypes from 'prop-types';
|
|
3
|
+
import MuiMenu from '@material-ui/core/Menu';
|
|
4
|
+
import MuiMenuItem from '@material-ui/core/MenuItem';
|
|
5
|
+
import MuiProgressCircle from '@material-ui/core/CircularProgress';
|
|
6
|
+
import ExpandMore from '@material-ui/icons/ExpandMore';
|
|
7
|
+
import ExpandLess from '@material-ui/icons/ExpandLess';
|
|
8
|
+
import Button, { TextButton } from '../Button';
|
|
9
|
+
|
|
10
|
+
const ITEM_HEIGHT = 48;
|
|
11
|
+
|
|
12
|
+
const DropdownButton = ({
|
|
13
|
+
text = false,
|
|
14
|
+
loading = false,
|
|
15
|
+
options = [],
|
|
16
|
+
menuId,
|
|
17
|
+
buttonLabel,
|
|
18
|
+
header,
|
|
19
|
+
children,
|
|
20
|
+
...buttonProps
|
|
21
|
+
}) => {
|
|
22
|
+
const Btn = text ? TextButton : Button;
|
|
23
|
+
const [anchorEl, setAnchorEl] = useState(null);
|
|
24
|
+
const open = Boolean(anchorEl);
|
|
25
|
+
const handleClick = (event) => {
|
|
26
|
+
setAnchorEl(event.currentTarget);
|
|
27
|
+
};
|
|
28
|
+
const handleClose = () => {
|
|
29
|
+
setAnchorEl(null);
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
return (
|
|
33
|
+
<>
|
|
34
|
+
<Btn
|
|
35
|
+
aria-haspopup="true"
|
|
36
|
+
aria-controls={menuId}
|
|
37
|
+
onClick={handleClick}
|
|
38
|
+
{...buttonProps}
|
|
39
|
+
>
|
|
40
|
+
{buttonLabel}{' '}
|
|
41
|
+
{!anchorEl && (
|
|
42
|
+
<ExpandMore classes={{ root: 'qpp-icon-mat qpp-icon-inline--lg' }} />
|
|
43
|
+
)}
|
|
44
|
+
{anchorEl && (
|
|
45
|
+
<ExpandLess classes={{ root: 'qpp-icon-mat qpp-icon-inline--lg' }} />
|
|
46
|
+
)}
|
|
47
|
+
</Btn>
|
|
48
|
+
<MuiMenu
|
|
49
|
+
id={menuId}
|
|
50
|
+
keepMounted
|
|
51
|
+
open={open}
|
|
52
|
+
anchorEl={anchorEl}
|
|
53
|
+
onClose={handleClose}
|
|
54
|
+
getContentAnchorEl={null}
|
|
55
|
+
anchorOrigin={{
|
|
56
|
+
vertical: 'bottom',
|
|
57
|
+
}}
|
|
58
|
+
className="qpp-c-dropdown-menu"
|
|
59
|
+
classes={{
|
|
60
|
+
paper: 'qpp-c-dropdown-menu__box',
|
|
61
|
+
list: 'qpp-c-dropdown-menu__list',
|
|
62
|
+
}}
|
|
63
|
+
MenuListProps={{
|
|
64
|
+
['aria-labelledby']: header ? `${menuId}-header` : null,
|
|
65
|
+
}}
|
|
66
|
+
PaperProps={{
|
|
67
|
+
style: {
|
|
68
|
+
maxHeight: ITEM_HEIGHT * 5.5,
|
|
69
|
+
maxWidth: '400px',
|
|
70
|
+
},
|
|
71
|
+
}}
|
|
72
|
+
>
|
|
73
|
+
{header && (
|
|
74
|
+
<MuiMenuItem
|
|
75
|
+
id={`${menuId}-header`}
|
|
76
|
+
onClick={(e) => {
|
|
77
|
+
e.preventDefault();
|
|
78
|
+
e.stopPropagation();
|
|
79
|
+
}}
|
|
80
|
+
classes={{
|
|
81
|
+
root: 'qpp-c-dropdown-menu__item qpp-c-dropdown-menu__item--header',
|
|
82
|
+
}}
|
|
83
|
+
disabled
|
|
84
|
+
aria-hidden
|
|
85
|
+
role="presentation"
|
|
86
|
+
disableRipple
|
|
87
|
+
>
|
|
88
|
+
{header}
|
|
89
|
+
</MuiMenuItem>
|
|
90
|
+
)}
|
|
91
|
+
{loading && (
|
|
92
|
+
<MuiMenuItem
|
|
93
|
+
onClick={(e) => {
|
|
94
|
+
e.preventDefault();
|
|
95
|
+
e.stopPropagation();
|
|
96
|
+
}}
|
|
97
|
+
classes={{
|
|
98
|
+
root: 'qpp-c-dropdown-menu__item qpp-c-dropdown-menu__item--loading',
|
|
99
|
+
}}
|
|
100
|
+
disableRipple
|
|
101
|
+
disabled
|
|
102
|
+
>
|
|
103
|
+
<MuiProgressCircle
|
|
104
|
+
size="1em"
|
|
105
|
+
color="inherit"
|
|
106
|
+
classes={{ root: 'qpp-c-dropdown-menu__spinner' }}
|
|
107
|
+
/>{' '}
|
|
108
|
+
<span role="status">Loading...</span>
|
|
109
|
+
</MuiMenuItem>
|
|
110
|
+
)}
|
|
111
|
+
{!loading &&
|
|
112
|
+
options.map(({ disabled, name, value, Icon, ...itemProps }) => (
|
|
113
|
+
<MuiMenuItem
|
|
114
|
+
disabled={disabled}
|
|
115
|
+
key={value}
|
|
116
|
+
value={value}
|
|
117
|
+
onClick={handleClose}
|
|
118
|
+
classes={{ root: 'qpp-c-dropdown-menu__item' }}
|
|
119
|
+
disableRipple
|
|
120
|
+
{...itemProps}
|
|
121
|
+
>
|
|
122
|
+
{Icon && (
|
|
123
|
+
<div className="qpp-c-dropdown-menu__icon">
|
|
124
|
+
<Icon classes={{ root: 'qpp-icon-mat' }} />
|
|
125
|
+
</div>
|
|
126
|
+
)}
|
|
127
|
+
<span>{name || value}</span>
|
|
128
|
+
</MuiMenuItem>
|
|
129
|
+
))}
|
|
130
|
+
</MuiMenu>
|
|
131
|
+
</>
|
|
132
|
+
);
|
|
133
|
+
};
|
|
134
|
+
|
|
135
|
+
DropdownButton.propTypes = {
|
|
136
|
+
menuId: PropTypes.string.isRequired,
|
|
137
|
+
text: PropTypes.bool,
|
|
138
|
+
buttonLabel: PropTypes.string,
|
|
139
|
+
loading: PropTypes.bool,
|
|
140
|
+
options: PropTypes.arrayOf(PropTypes.object),
|
|
141
|
+
header: PropTypes.string,
|
|
142
|
+
children: PropTypes.oneOfType([
|
|
143
|
+
PropTypes.node,
|
|
144
|
+
PropTypes.arrayOf(PropTypes.node),
|
|
145
|
+
]),
|
|
146
|
+
};
|
|
147
|
+
|
|
148
|
+
export default DropdownButton;
|
|
@@ -12,8 +12,8 @@ export const ExampleFooter = () => (
|
|
|
12
12
|
<Footer
|
|
13
13
|
isFullWidth={boolean('isFullWidth', false)}
|
|
14
14
|
buildVersion={text('buildVersion', 'BUILD VERSION')}
|
|
15
|
-
isNewFooter={boolean('isNewFooter',
|
|
16
|
-
showHcdResearch={boolean('showHcdResearch',
|
|
15
|
+
isNewFooter={boolean('isNewFooter', true)}
|
|
16
|
+
showHcdResearch={boolean('showHcdResearch', true)}
|
|
17
17
|
/>
|
|
18
18
|
);
|
|
19
19
|
|
|
@@ -1,62 +1,40 @@
|
|
|
1
|
-
import React
|
|
1
|
+
import React from 'react';
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
|
-
import
|
|
3
|
+
import OpenInNewIcon from '@material-ui/icons/OpenInNew';
|
|
4
4
|
|
|
5
5
|
import InfoTip from '../Infotip/Infotip';
|
|
6
6
|
import LegacyFooterUI from './LegacyFooterUI';
|
|
7
7
|
import Subscribe from './Subscribe';
|
|
8
8
|
import SocialLinks from './SocialLinks';
|
|
9
|
+
import useGetConfig from '../hooks/useGetConfig';
|
|
9
10
|
|
|
10
11
|
const infoTipLabel =
|
|
11
12
|
'When dialing 711, you will automatically be connected to a TRS Communications Assistant who will relay your conversation to the help desk agent with strict confidentiality.';
|
|
12
13
|
|
|
13
|
-
const FooterUI = (
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
14
|
+
const FooterUI = ({
|
|
15
|
+
isNewFooter,
|
|
16
|
+
isIESupportPage,
|
|
17
|
+
showHcdResearch,
|
|
18
|
+
buildVersion,
|
|
19
|
+
isFullWidth,
|
|
20
|
+
}) => {
|
|
21
|
+
const signUpNowLink = showHcdResearch
|
|
17
22
|
? '/about/hcd-research'
|
|
18
23
|
: 'mailto:QPPUserResearch@cms.hhs.gov?subject=Sign up for feedback sessions&body=Please let us know your role and how many Tax Identification Numbers (TINs) you represent. Don’t send us your actual TINs, that is confidential information that should not be shared with this email address. If you do not represent a practice, let us know what work you do in connection to QPP.';
|
|
19
|
-
|
|
24
|
+
|
|
25
|
+
const result = useGetConfig({
|
|
26
|
+
timeout: 5,
|
|
27
|
+
url: '/config/footer',
|
|
28
|
+
localStorageName: 'qpp_footer',
|
|
29
|
+
});
|
|
30
|
+
const content = (result?.content || [
|
|
31
|
+
{ listServ: false, showCcsqLink: false },
|
|
32
|
+
])[0];
|
|
20
33
|
|
|
21
34
|
const setLink = (link) => {
|
|
22
35
|
return isIESupportPage ? '/' : link;
|
|
23
36
|
};
|
|
24
37
|
|
|
25
|
-
// The footer content is populated with the following priority order:
|
|
26
|
-
// 1. Use the footer content in localStorage if it's there
|
|
27
|
-
// 2. If not, make a call to get it from the QPPFE endpoint. Hydrate the localStorage item with the response.
|
|
28
|
-
// 3. If the call fails, use the default value
|
|
29
|
-
useEffect(() => {
|
|
30
|
-
const storageContent = JSON.parse(
|
|
31
|
-
localStorage.getItem('qpp_footer_listServ')
|
|
32
|
-
);
|
|
33
|
-
if (
|
|
34
|
-
storageContent?.content &&
|
|
35
|
-
new Date().valueOf() < storageContent.expiration
|
|
36
|
-
) {
|
|
37
|
-
setListServ(storageContent.listServ);
|
|
38
|
-
} else {
|
|
39
|
-
const origin = window.location.origin;
|
|
40
|
-
axios
|
|
41
|
-
.get(
|
|
42
|
-
!origin.includes('localhost')
|
|
43
|
-
? `${origin}/config/footer`
|
|
44
|
-
: 'https://qpp.cms.gov/config/footer'
|
|
45
|
-
)
|
|
46
|
-
.then(({ data: { data = {} } }) => {
|
|
47
|
-
localStorage.setItem(
|
|
48
|
-
'qpp_footer_listServ',
|
|
49
|
-
JSON.stringify({
|
|
50
|
-
listServ: data.listServ,
|
|
51
|
-
})
|
|
52
|
-
);
|
|
53
|
-
setListServ(data.listServ);
|
|
54
|
-
})
|
|
55
|
-
.catch((e) => {
|
|
56
|
-
setListServ(false);
|
|
57
|
-
});
|
|
58
|
-
}
|
|
59
|
-
}, []);
|
|
60
38
|
if (isNewFooter) {
|
|
61
39
|
return (
|
|
62
40
|
<>
|
|
@@ -76,7 +54,7 @@ const FooterUI = (props) => {
|
|
|
76
54
|
)}
|
|
77
55
|
<footer className="global-footer">
|
|
78
56
|
<div className="build-version" id="build-version">
|
|
79
|
-
{
|
|
57
|
+
{buildVersion}
|
|
80
58
|
</div>
|
|
81
59
|
|
|
82
60
|
<div className="responsive-container">
|
|
@@ -145,7 +123,7 @@ const FooterUI = (props) => {
|
|
|
145
123
|
</div>
|
|
146
124
|
<div className="footer-contact-cms">
|
|
147
125
|
<p className="sub-title">Contact CMS</p>
|
|
148
|
-
<p className="contact-title">
|
|
126
|
+
<p className="contact-title">Phone:</p>
|
|
149
127
|
<p>Monday - Friday 8 a.m - 8 p.m ET</p>
|
|
150
128
|
<p>
|
|
151
129
|
1-866-288-8292 (TRS: 711)
|
|
@@ -154,7 +132,7 @@ const FooterUI = (props) => {
|
|
|
154
132
|
</span>
|
|
155
133
|
</p>
|
|
156
134
|
|
|
157
|
-
<p className="contact-title">
|
|
135
|
+
<p className="contact-title">Email:</p>
|
|
158
136
|
<p>
|
|
159
137
|
<a
|
|
160
138
|
aria-label="QPP@cms.hhs.gov"
|
|
@@ -164,12 +142,30 @@ const FooterUI = (props) => {
|
|
|
164
142
|
QPP@cms.hhs.gov
|
|
165
143
|
</a>
|
|
166
144
|
</p>
|
|
145
|
+
|
|
146
|
+
{content?.showCcsqLink && (
|
|
147
|
+
<>
|
|
148
|
+
<p className="contact-title">QPP Service Center:</p>
|
|
149
|
+
<a
|
|
150
|
+
href="https://cmsqualitysupport.servicenowservices.com/ccsq_support_central"
|
|
151
|
+
aria-label="CCSQ Support Central"
|
|
152
|
+
className="email-link"
|
|
153
|
+
target="__blank"
|
|
154
|
+
rel="noopener noreferrer"
|
|
155
|
+
>
|
|
156
|
+
<strong>
|
|
157
|
+
Create or Track a QPP Service Center Ticket
|
|
158
|
+
</strong>
|
|
159
|
+
<OpenInNewIcon classes={{ root: 'ccsq-link-icon' }} />
|
|
160
|
+
</a>
|
|
161
|
+
</>
|
|
162
|
+
)}
|
|
167
163
|
</div>
|
|
168
164
|
<div className="footer-social-newsletter">
|
|
169
165
|
<p className="sub-title">Stay Connected</p>
|
|
170
166
|
<SocialLinks />
|
|
171
167
|
<p className="sub-title">
|
|
172
|
-
{listServ
|
|
168
|
+
{content?.listServ
|
|
173
169
|
? 'Sign Up for the QPP Listserv'
|
|
174
170
|
: 'Sign Up for the QPP Newsletter'}
|
|
175
171
|
</p>
|
|
@@ -251,8 +247,8 @@ const FooterUI = (props) => {
|
|
|
251
247
|
}
|
|
252
248
|
return (
|
|
253
249
|
<LegacyFooterUI
|
|
254
|
-
buildVersion={
|
|
255
|
-
isFullWidth={
|
|
250
|
+
buildVersion={buildVersion}
|
|
251
|
+
isFullWidth={isFullWidth}
|
|
256
252
|
signUpNowLink={signUpNowLink}
|
|
257
253
|
/>
|
|
258
254
|
);
|