qpp-style 9.26.1 → 9.28.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.
- package/README.md +15 -0
- package/components/NotificationBanner/ExpandedView.js +1 -1
- package/components/SanitizedContent/index.jsx +12 -1
- package/components/SideNav/Content/LevelOneContent.jsx +9 -159
- package/components/SideNav/Content/SelectRole/index.js +1 -0
- package/components/SideNav/Content/index.js +1 -2
- package/components/SideNav/Links/NavLinkInline.jsx +2 -4
- package/components/SideNav/UI/SideNavUI.jsx +49 -78
- package/components/SideNav/UI/utils.js +0 -0
- package/components/SideNav/helpers.js +39 -0
- package/components/SideNav/index.js +0 -2
- package/coverage/clover.xml +196 -211
- package/coverage/coverage-final.json +70 -72
- package/coverage/lcov-report/Tooltip.jsx.html +232 -0
- package/coverage/lcov-report/components/Accordion/index.html +21 -21
- package/coverage/lcov-report/components/Accordion/index.jsx.html +39 -39
- package/coverage/lcov-report/components/Button/index.html +1 -1
- package/coverage/lcov-report/components/Button/index.js.html +1 -1
- package/coverage/lcov-report/components/Error/Collapsible.jsx.html +1 -1
- package/coverage/lcov-report/components/Error/ErrorUI.jsx.html +1 -1
- package/coverage/lcov-report/components/Error/index.html +1 -1
- package/coverage/lcov-report/components/Footer/FooterUI.jsx.html +17 -32
- package/coverage/lcov-report/components/Footer/SocialLinks.jsx.html +1 -1
- package/coverage/lcov-report/components/Footer/Subscribe.jsx.html +1 -1
- package/coverage/lcov-report/components/Footer/index.html +1 -1
- package/coverage/lcov-report/components/GovBanner/index.html +1 -1
- package/coverage/lcov-report/components/GovBanner/index.js.html +1 -1
- package/coverage/lcov-report/components/Header/HeaderAccountMenu.jsx.html +1 -1
- package/coverage/lcov-report/components/Header/HeaderCancel.jsx.html +1 -1
- package/coverage/lcov-report/components/Header/HeaderContainer.jsx.html +59 -32
- package/coverage/lcov-report/components/Header/HeaderLogo.jsx.html +1 -1
- package/coverage/lcov-report/components/Header/HeaderMenuButton.js.html +1 -1
- package/coverage/lcov-report/components/Header/HeaderMenuItem.jsx.html +1 -1
- package/coverage/lcov-report/components/Header/HeaderMenuLink.js.html +1 -1
- package/coverage/lcov-report/components/Header/HeaderMenuSignOutButton.js.html +1 -1
- package/coverage/lcov-report/components/Header/HeaderMobileButton.js.html +1 -1
- package/coverage/lcov-report/components/Header/HeaderUI.jsx.html +40 -16
- package/coverage/lcov-report/components/Header/HelpIcon.jsx.html +1 -1
- package/coverage/lcov-report/components/Header/ImpersonatorBanner.jsx.html +3 -6
- package/coverage/lcov-report/components/Header/NavigationButtonIcon.jsx.html +1 -1
- package/coverage/lcov-report/components/Header/hooks.js.html +4 -4
- package/coverage/lcov-report/components/Header/index.html +25 -25
- package/coverage/lcov-report/components/Header/utag-helpers.js.html +1 -1
- package/coverage/lcov-report/components/Infotip/Infotip.jsx.html +4 -4
- package/coverage/lcov-report/components/Infotip/InfotipIcon.jsx.html +1 -1
- package/coverage/lcov-report/components/Infotip/index.html +1 -1
- package/coverage/lcov-report/components/Infotip/index.js.html +1 -1
- package/coverage/lcov-report/components/Modal/LegacyModal.jsx.html +3 -3
- package/coverage/lcov-report/components/Modal/Modal.jsx.html +40 -40
- package/coverage/lcov-report/components/Modal/index.html +32 -32
- package/coverage/lcov-report/components/Modal/index.jsx.html +19 -19
- package/coverage/lcov-report/components/NotificationBanner/CollapsedView.js.html +1 -1
- package/coverage/lcov-report/components/NotificationBanner/ExpandedView.js.html +1 -1
- package/coverage/lcov-report/components/NotificationBanner/index.html +1 -1
- package/coverage/lcov-report/components/NotificationBanner/index.js.html +1 -1
- package/coverage/lcov-report/components/SanitizedContent/index.html +1 -1
- package/coverage/lcov-report/components/SanitizedContent/index.jsx.html +5 -5
- package/coverage/lcov-report/components/SessionDialogUI.jsx.html +114 -114
- package/coverage/lcov-report/components/SideNav/Content/SelectRole/index.html +1 -1
- package/coverage/lcov-report/components/SideNav/Content/SelectRole/utils.js.html +1 -1
- package/coverage/lcov-report/components/SideNav/helpers.js.html +1 -1
- package/coverage/lcov-report/components/SideNav/index.html +1 -1
- package/coverage/lcov-report/components/Tooltip/Tooltip.jsx.html +2 -2
- package/coverage/lcov-report/components/Tooltip/index.html +1 -1
- package/coverage/lcov-report/components/Tooltip/index.js.html +1 -1
- package/coverage/lcov-report/components/Tooltip/position.js.html +1 -1
- package/coverage/lcov-report/components/hooks/index.html +1 -1
- package/coverage/lcov-report/components/hooks/useGetConfig.js.html +1 -1
- package/coverage/lcov-report/components/index.html +21 -21
- package/coverage/lcov-report/index.html +22 -37
- package/coverage/lcov-report/index.js.html +94 -0
- package/coverage/lcov-report/lib/Chevron.jsx.html +4 -4
- package/coverage/lcov-report/lib/SvgComponents.jsx.html +418 -58
- package/coverage/lcov-report/lib/index.html +19 -19
- package/coverage/lcov-report/position.js.html +289 -0
- package/coverage/lcov-report/react/components/Accordion/index.html +1 -1
- package/coverage/lcov-report/react/components/Accordion/index.jsx.html +1 -1
- package/coverage/lcov-report/react/components/Button/index.html +1 -1
- package/coverage/lcov-report/react/components/Button/index.js.html +1 -1
- package/coverage/lcov-report/react/components/Dropdown/index.html +1 -1
- package/coverage/lcov-report/react/components/Dropdown/index.js.html +1 -1
- package/coverage/lcov-report/react/components/Error/Collapsible.jsx.html +1 -1
- package/coverage/lcov-report/react/components/Error/ErrorUI.jsx.html +1 -1
- package/coverage/lcov-report/react/components/Error/error.js.html +1 -1
- package/coverage/lcov-report/react/components/Error/index.html +1 -1
- package/coverage/lcov-report/react/components/Footer/FooterUI.jsx.html +4 -7
- package/coverage/lcov-report/react/components/Footer/SocialLinks.jsx.html +1 -1
- package/coverage/lcov-report/react/components/Footer/Subscribe.jsx.html +1 -1
- package/coverage/lcov-report/react/components/Footer/footer.js.html +1 -1
- package/coverage/lcov-report/react/components/Footer/index.html +1 -1
- package/coverage/lcov-report/react/components/GovBanner/index.html +1 -1
- package/coverage/lcov-report/react/components/GovBanner/index.js.html +1 -1
- package/coverage/lcov-report/react/components/Header/HeaderAccountMenu.jsx.html +1 -1
- package/coverage/lcov-report/react/components/Header/HeaderCancel.jsx.html +1 -1
- package/coverage/lcov-report/react/components/Header/HeaderContainer.jsx.html +1 -1
- package/coverage/lcov-report/react/components/Header/HeaderLogo.jsx.html +1 -1
- package/coverage/lcov-report/react/components/Header/HeaderMenuButton.js.html +1 -1
- package/coverage/lcov-report/react/components/Header/HeaderMenuItem.jsx.html +1 -1
- package/coverage/lcov-report/react/components/Header/HeaderMenuLink.js.html +1 -1
- package/coverage/lcov-report/react/components/Header/HeaderMenuSignOutButton.js.html +1 -1
- package/coverage/lcov-report/react/components/Header/HeaderMobileButton.js.html +1 -1
- package/coverage/lcov-report/react/components/Header/HeaderUI.jsx.html +1 -1
- package/coverage/lcov-report/react/components/Header/HelpIcon.jsx.html +1 -1
- package/coverage/lcov-report/react/components/Header/ImpersonatorBanner.jsx.html +3 -6
- package/coverage/lcov-report/react/components/Header/NavigationButtonIcon.jsx.html +1 -1
- package/coverage/lcov-report/react/components/Header/header.js.html +1 -1
- package/coverage/lcov-report/react/components/Header/hooks.js.html +1 -1
- package/coverage/lcov-report/react/components/Header/index.html +1 -1
- package/coverage/lcov-report/react/components/Header/utag-helpers.js.html +1 -1
- package/coverage/lcov-report/react/components/Infotip/Infotip.jsx.html +5 -17
- package/coverage/lcov-report/react/components/Infotip/InfotipContent.jsx.html +1 -1
- package/coverage/lcov-report/react/components/Infotip/InfotipIcon.jsx.html +1 -1
- package/coverage/lcov-report/react/components/Infotip/index.html +19 -4
- package/coverage/lcov-report/react/components/Infotip/index.js.html +1 -1
- package/coverage/lcov-report/react/components/Modal/LegacyModal.jsx.html +1 -1
- package/coverage/lcov-report/react/components/Modal/Modal.jsx.html +1 -1
- package/coverage/lcov-report/react/components/Modal/index.html +1 -1
- package/coverage/lcov-report/react/components/Modal/index.jsx.html +1 -1
- package/coverage/lcov-report/react/components/NotificationBanner/CollapsedView.js.html +1 -1
- package/coverage/lcov-report/react/components/NotificationBanner/ExpandedView.js.html +1 -1
- package/coverage/lcov-report/react/components/NotificationBanner/index.html +1 -1
- package/coverage/lcov-report/react/components/NotificationBanner/index.js.html +1 -1
- package/coverage/lcov-report/react/components/SanitizedContent/index.html +1 -1
- package/coverage/lcov-report/react/components/SanitizedContent/index.jsx.html +1 -1
- package/coverage/lcov-report/react/components/SessionDialog/index.html +1 -1
- package/coverage/lcov-report/react/components/SessionDialog/sessionDialog.js.html +1 -1
- package/coverage/lcov-report/react/components/SessionDialogUI.jsx.html +1 -1
- package/coverage/lcov-report/react/components/SideNav/AnimationGroup/AnimationGroup.jsx.html +1 -1
- package/coverage/lcov-report/react/components/SideNav/AnimationGroup/index.html +1 -1
- package/coverage/lcov-report/react/components/SideNav/Chart/ScoreChart.jsx.html +13 -19
- package/coverage/lcov-report/react/components/SideNav/Chart/index.html +1 -1
- package/coverage/lcov-report/react/components/SideNav/Chart/index.js.html +1 -1
- package/coverage/lcov-report/react/components/SideNav/Content/LevelOneContent.jsx.html +1 -1
- package/coverage/lcov-report/react/components/SideNav/Content/LevelTwoContent.jsx.html +1 -1
- package/coverage/lcov-report/react/components/SideNav/Content/SelectRole/index.html +1 -1
- package/coverage/lcov-report/react/components/SideNav/Content/SelectRole/index.js.html +1 -1
- package/coverage/lcov-report/react/components/SideNav/Content/SelectRole/utils.js.html +1 -1
- package/coverage/lcov-report/react/components/SideNav/Content/index.html +1 -1
- package/coverage/lcov-report/react/components/SideNav/Content/index.js.html +1 -1
- package/coverage/lcov-report/react/components/SideNav/Details/IndividualDetails.jsx.html +1 -1
- package/coverage/lcov-report/react/components/SideNav/Details/PracticeDetails.jsx.html +1 -1
- package/coverage/lcov-report/react/components/SideNav/Details/index.html +1 -1
- package/coverage/lcov-report/react/components/SideNav/Details/index.js.html +1 -1
- package/coverage/lcov-report/react/components/SideNav/Links/CmsSwitchLink.jsx.html +1 -1
- package/coverage/lcov-report/react/components/SideNav/Links/NavItemInline.jsx.html +1 -1
- package/coverage/lcov-report/react/components/SideNav/Links/NavLinkContainer.jsx.html +1 -1
- package/coverage/lcov-report/react/components/SideNav/Links/NavLinkDrawer.jsx.html +1 -1
- package/coverage/lcov-report/react/components/SideNav/Links/NavLinkInline.jsx.html +1 -1
- package/coverage/lcov-report/react/components/SideNav/Links/NavLinkToggle.jsx.html +1 -1
- package/coverage/lcov-report/react/components/SideNav/Links/index.html +1 -1
- package/coverage/lcov-report/react/components/SideNav/Links/index.js.html +1 -1
- package/coverage/lcov-report/react/components/SideNav/UI/SideNavUI.jsx.html +1 -1
- package/coverage/lcov-report/react/components/SideNav/UI/index.html +1 -1
- package/coverage/lcov-report/react/components/SideNav/UI/index.js.html +1 -1
- package/coverage/lcov-report/react/components/SideNav/helpers.js.html +1 -1
- package/coverage/lcov-report/react/components/SideNav/index.html +1 -1
- package/coverage/lcov-report/react/components/SideNav/index.js.html +1 -1
- package/coverage/lcov-report/react/components/Tooltip/Tooltip.jsx.html +42 -159
- package/coverage/lcov-report/react/components/Tooltip/index.html +9 -9
- package/coverage/lcov-report/react/components/Tooltip/index.js.html +1 -1
- package/coverage/lcov-report/react/components/Tooltip/position.js.html +20 -20
- package/coverage/lcov-report/react/components/hooks/index.html +1 -1
- package/coverage/lcov-report/react/components/hooks/useGetConfig.js.html +1 -1
- package/coverage/lcov-report/react/components/index.html +1 -1
- package/coverage/lcov-report/react/index.html +1 -1
- package/coverage/lcov-report/react/index.js.html +1 -1
- package/coverage/lcov-report/react/lib/Chevron.jsx.html +1 -1
- package/coverage/lcov-report/react/lib/SvgComponents.jsx.html +415 -55
- package/coverage/lcov-report/react/lib/index.html +19 -19
- package/coverage/lcov-report/react/lib/svg-definitions.svg.html +1 -1
- package/coverage/lcov-report/react/session/index.html +1 -1
- package/coverage/lcov-report/react/session/index.js.html +1 -1
- package/coverage/lcov-report/react/session/logout.js.html +1 -1
- package/coverage/lcov-report/react/session/refresh.js.html +1 -1
- package/coverage/lcov-report/react/session/ttl.js.html +1 -1
- package/coverage/lcov-report/session/index.html +43 -43
- package/coverage/lcov-report/session/index.js.html +1 -1
- package/coverage/lcov-report/session/logout.js.html +41 -41
- package/coverage/lcov-report/session/refresh.js.html +34 -34
- package/coverage/lcov-report/session/ttl.js.html +29 -29
- package/coverage/lcov.info +174 -211
- package/dist/browser.js +1 -1
- package/dist/browser.js.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/react/index.js +1 -1
- package/dist/react/index.js.map +1 -1
- package/package.json +1 -1
- package/session/logout.js +3 -0
- package/storybook-static/229.630347465201d1822126.manager.bundle.js +1 -0
- package/storybook-static/295.aa3c5122636a27ad7c7b.manager.bundle.js +1 -0
- package/storybook-static/468.d976c69e47003b4dcfa3.manager.bundle.js +2 -0
- package/storybook-static/468.d976c69e47003b4dcfa3.manager.bundle.js.LICENSE.txt +94 -0
- package/storybook-static/51.fc4b02f2a75c894ae64e.manager.bundle.js +2 -0
- package/storybook-static/51.fc4b02f2a75c894ae64e.manager.bundle.js.LICENSE.txt +8 -0
- package/storybook-static/551.45aead073703cc6fb12b.manager.bundle.js +1 -0
- package/storybook-static/807.1a7f4dcf15e4696572ca.manager.bundle.js +2 -0
- package/storybook-static/807.1a7f4dcf15e4696572ca.manager.bundle.js.LICENSE.txt +31 -0
- package/storybook-static/897.9b5fee8cc7074607c812.manager.bundle.js +2 -0
- package/storybook-static/897.9b5fee8cc7074607c812.manager.bundle.js.LICENSE.txt +12 -0
- package/storybook-static/935.532759f0652585685af7.manager.bundle.js +1 -0
- package/storybook-static/favicon.ico +0 -0
- package/storybook-static/index.html +59 -0
- package/storybook-static/main.ad4edcd27d527a119d7a.manager.bundle.js +1 -0
- package/storybook-static/project.json +1 -0
- package/storybook-static/runtime~main.b165398bf7ef3e30d431.manager.bundle.js +1 -0
- package/styles/components/_notification-banner.scss +151 -150
- package/test/components/HeaderUI.test.js +4 -14
- package/components/SideNav/Content/LevelTwoContent.jsx +0 -216
- package/coverage/lcov-report/components/SideNav/Chart/ScoreChart.jsx.html +0 -889
- package/coverage/lcov-report/components/SideNav/Chart/index.html +0 -116
- package/coverage/lcov-report/react/components/Footer/LegacyFooterUI.jsx.html +0 -667
package/README.md
CHANGED
|
@@ -43,3 +43,18 @@ npm publish
|
|
|
43
43
|
```
|
|
44
44
|
|
|
45
45
|
7. Once published successfully, merge into main.
|
|
46
|
+
|
|
47
|
+
The Side Nav contains multiple item array types: divider, container, linkBack, linkHome, practiceDetails, individualDetails, linkDrawer, custom, chart, and switchLink.
|
|
48
|
+
|
|
49
|
+
| Item Array Type | Description |
|
|
50
|
+
|-------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
|
|
51
|
+
| divider | <hr> element that is located above and below the practice container. |
|
|
52
|
+
| container | gets Dynamic Content of multiple items and contains the linkDrawer item. Level One and Level Two content are located in this container. |
|
|
53
|
+
| linkBack | <button> that links the user back to a URL. This uses a chevron Left icon. |
|
|
54
|
+
| linkHome | <a> tag element which sends the user back to the “Account Home” page /user/submissions. This uses the home icon SVG and is located at the top of the side nav. |
|
|
55
|
+
| practiceDetails | <div> element with the class name practice-container. Inside this container is the <h2> element which includes the Practice Name and the <p> element which is the Practice Tin. The Practice Tin shows either the CPC+ ID, PCF ID, APM Entity ID, VG ID, or Practice Tin. |
|
|
56
|
+
| individualDetails | <div> element with the class name “individual-container”. This parent element contains two other elements which are the <h3> Individual Name and the <p> Individual NPI. |
|
|
57
|
+
| linkDrawer | This is the most complex item type. This item displays the Level One and Level Two <button> elements which contain navigation links depending on each page as well as specific SVG icons. Depending on the page there can be multiple links to the user can access quickly using the side nav. |
|
|
58
|
+
| custom | This option is for sanitized HTML content. This custom HTML will be cleaned of any potentially harmful elements that could compromise the security of the web app. |
|
|
59
|
+
| chart | This option uses the ScoreChart component to display Chart Data on the Side Nav. This data includes categories from Quality Measures, Advancing Care Info, Promoting Interoperability, Improvement Activities, and Cost. |
|
|
60
|
+
| switchLink | This is an implementation of the “Switch Practice” button for the Side Nav. Clicking 'Switch Practice' will take the user back to the TIN list for the part of the application they are viewing. |
|
|
@@ -13,7 +13,7 @@ const ExpandedView = ({
|
|
|
13
13
|
return (
|
|
14
14
|
<div className={`notification-banner-wrapper expanded-view`}>
|
|
15
15
|
<div className="notification-banner-label">{label}</div>
|
|
16
|
-
<div className="notification-banner-content">
|
|
16
|
+
<div className="notification-banner-content qppds">
|
|
17
17
|
<SanitizedContent
|
|
18
18
|
html={expanded ? content : '<p>No notifications to display</p>'}
|
|
19
19
|
/>
|
|
@@ -86,6 +86,9 @@ const defaultAllowedTags = [
|
|
|
86
86
|
'circle',
|
|
87
87
|
'g',
|
|
88
88
|
'path',
|
|
89
|
+
'rect',
|
|
90
|
+
'polygon',
|
|
91
|
+
'line',
|
|
89
92
|
];
|
|
90
93
|
|
|
91
94
|
// Override the default allowed HTML attributes for all tags
|
|
@@ -152,8 +155,10 @@ const defaultAllowedAttributes = {
|
|
|
152
155
|
'width',
|
|
153
156
|
'wrap',
|
|
154
157
|
'fill',
|
|
158
|
+
'fill-rule',
|
|
159
|
+
'transform',
|
|
155
160
|
'stroke',
|
|
156
|
-
'
|
|
161
|
+
'stroke-width',
|
|
157
162
|
'd',
|
|
158
163
|
'points',
|
|
159
164
|
'viewbox',
|
|
@@ -168,6 +173,12 @@ const defaultAllowedAttributes = {
|
|
|
168
173
|
'version',
|
|
169
174
|
'preserveaspectratio',
|
|
170
175
|
'enable-background',
|
|
176
|
+
'points',
|
|
177
|
+
'stroke-linecap',
|
|
178
|
+
'x1',
|
|
179
|
+
'x2',
|
|
180
|
+
'y1',
|
|
181
|
+
'y2',
|
|
171
182
|
],
|
|
172
183
|
};
|
|
173
184
|
|
|
@@ -2,27 +2,13 @@ import React, { useState } from 'react';
|
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
3
|
import cookie from 'cookie';
|
|
4
4
|
import jwtDecode from 'jwt-decode';
|
|
5
|
-
import
|
|
6
|
-
import { NavLinkContainer, NavLinkInline, NavLinkDrawer } from '../Links';
|
|
5
|
+
import SanitizedContent from '../../SanitizedContent';
|
|
7
6
|
import AnimationGroup from '../AnimationGroup/AnimationGroup';
|
|
8
|
-
import
|
|
9
|
-
import {
|
|
10
|
-
loadUserPermissions,
|
|
11
|
-
getUrlConditionMap,
|
|
12
|
-
isMultiRoleUser,
|
|
13
|
-
getIcon,
|
|
14
|
-
isImpersonating,
|
|
15
|
-
isImpersonationLink,
|
|
16
|
-
loadSideNavContent,
|
|
17
|
-
} from '../helpers';
|
|
7
|
+
import { isMultiRoleUser } from '../helpers';
|
|
18
8
|
import SelectRole from './SelectRole';
|
|
19
9
|
|
|
20
|
-
const LevelOneContent = ({
|
|
21
|
-
|
|
22
|
-
config: { linkCallback, useTooltips } = {},
|
|
23
|
-
levelOneContent,
|
|
24
|
-
}) => {
|
|
25
|
-
let { qpp_is_dev_pre, qpp_auth_token } = cookie.parse(document.cookie);
|
|
10
|
+
const LevelOneContent = ({ isExpanded, levelOneContent }) => {
|
|
11
|
+
let { qpp_auth_token } = cookie.parse(document.cookie);
|
|
26
12
|
|
|
27
13
|
const [selectedRole, setSelectedRole] = useState('');
|
|
28
14
|
|
|
@@ -31,140 +17,10 @@ const LevelOneContent = ({
|
|
|
31
17
|
const { firstName, lastName } = jwtDecode(qpp_auth_token);
|
|
32
18
|
name = `${firstName} ${lastName}`;
|
|
33
19
|
}
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
const permissions = loadUserPermissions(document.cookie, selectedRole);
|
|
38
|
-
const { internalReviewerNames } = permissions;
|
|
20
|
+
const path = window.location.pathname;
|
|
21
|
+
document.cookie = `current_path=${path}; Path=/;`;
|
|
39
22
|
|
|
40
23
|
const hasMultipleRoles = isMultiRoleUser(document.cookie);
|
|
41
|
-
const isDevPre = qpp_is_dev_pre === 'true';
|
|
42
|
-
let content;
|
|
43
|
-
|
|
44
|
-
if (isDevPre) {
|
|
45
|
-
content = levelOneContent?.devPre || defaultContent.devPre;
|
|
46
|
-
} else {
|
|
47
|
-
if (!hasMultipleRoles) {
|
|
48
|
-
// internalReviewerNames has 1 value b/c !hasMultipleRoles
|
|
49
|
-
const reviewerRoleName = internalReviewerNames[0];
|
|
50
|
-
content = loadSideNavContent(reviewerRoleName, {
|
|
51
|
-
levelOneContent,
|
|
52
|
-
defaultContent,
|
|
53
|
-
});
|
|
54
|
-
} else {
|
|
55
|
-
content = loadSideNavContent(
|
|
56
|
-
selectedRole,
|
|
57
|
-
{ levelOneContent, defaultContent },
|
|
58
|
-
true
|
|
59
|
-
);
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
// Mapping side nav link urls to the conditions that determine their inclusion in the side nav
|
|
64
|
-
const urlConditionMap = getUrlConditionMap(permissions);
|
|
65
|
-
|
|
66
|
-
const navLinks = content
|
|
67
|
-
.filter((link) => {
|
|
68
|
-
// Filter out Exception & Targeted Review links for Helpdesk Viewer when not impersonating
|
|
69
|
-
const isHelpdeskRoleNotImpersonating =
|
|
70
|
-
selectedRole === 'Helpdesk Viewer' && !isImpersonating(document.cookie);
|
|
71
|
-
if (isHelpdeskRoleNotImpersonating) {
|
|
72
|
-
return (
|
|
73
|
-
link.url !== '/user/exception/#/landing' &&
|
|
74
|
-
link.url !== '/user/targeted-review/#/landing'
|
|
75
|
-
);
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
// Filter Content Manager links
|
|
79
|
-
// Check if user has content mgmt. admin || frontend author roles
|
|
80
|
-
const contentMgrCanManageDocs = internalReviewerNames.some((name) =>
|
|
81
|
-
name.includes('QPP Content Management')
|
|
82
|
-
);
|
|
83
|
-
const contentMgrFrontendAuthor = internalReviewerNames.includes(
|
|
84
|
-
'QPP Front-end - Author'
|
|
85
|
-
);
|
|
86
|
-
|
|
87
|
-
if (!contentMgrCanManageDocs) {
|
|
88
|
-
return link.label !== 'Manage Documents';
|
|
89
|
-
}
|
|
90
|
-
if (!contentMgrFrontendAuthor) {
|
|
91
|
-
return link.label !== 'Author Content';
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
return link;
|
|
95
|
-
})
|
|
96
|
-
.reduce((acc, link) => {
|
|
97
|
-
const { url, label, className, listOfLinks, ...rest } = link;
|
|
98
|
-
|
|
99
|
-
// Any links failing the corresponding condition in the urlConditionMap are skipped
|
|
100
|
-
if (url in urlConditionMap && !urlConditionMap[url]) {
|
|
101
|
-
return acc;
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
const isContentMgrLink =
|
|
105
|
-
label === 'Manage Documents' || label === 'Author Content';
|
|
106
|
-
const IconComponent = isContentMgrLink
|
|
107
|
-
? getIcon(null, label)
|
|
108
|
-
: getIcon(url);
|
|
109
|
-
const Icon = IconComponent ? <IconComponent /> : null;
|
|
110
|
-
const sharedProps = {
|
|
111
|
-
url,
|
|
112
|
-
label,
|
|
113
|
-
linkCallback,
|
|
114
|
-
className: className ? `${linkClass} ${className}` : linkClass,
|
|
115
|
-
};
|
|
116
|
-
|
|
117
|
-
if (isImpersonating(document.cookie)) {
|
|
118
|
-
sharedProps.className = `${sharedProps.className} includes-read-only`;
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
const { pathname, hash } = window.location;
|
|
122
|
-
const filteredListOfLinks = (listOfLinks || []).filter((sublink) => {
|
|
123
|
-
return !(
|
|
124
|
-
sublink.url in urlConditionMap && !urlConditionMap[sublink.url]
|
|
125
|
-
);
|
|
126
|
-
});
|
|
127
|
-
if (
|
|
128
|
-
filteredListOfLinks?.length > 0 &&
|
|
129
|
-
(pathname === url ||
|
|
130
|
-
filteredListOfLinks.some(
|
|
131
|
-
(sublink) =>
|
|
132
|
-
pathname === sublink.url || `${pathname}${hash}` === sublink.url
|
|
133
|
-
))
|
|
134
|
-
) {
|
|
135
|
-
acc.push(
|
|
136
|
-
<NavLinkDrawer
|
|
137
|
-
key={`nav-drawer-${url}-${label}`}
|
|
138
|
-
leftIcon={Icon}
|
|
139
|
-
listOfLinks={filteredListOfLinks}
|
|
140
|
-
isExpanded={isExpanded}
|
|
141
|
-
staticDrawer={false}
|
|
142
|
-
openByDefault
|
|
143
|
-
isAlwaysOpen
|
|
144
|
-
{...sharedProps}
|
|
145
|
-
{...rest}
|
|
146
|
-
/>
|
|
147
|
-
);
|
|
148
|
-
} else {
|
|
149
|
-
// Check if link is associated with the impersonated user not the Helpdesk Viewer user
|
|
150
|
-
const impersonationLink = isImpersonationLink(document.cookie, label);
|
|
151
|
-
acc.push(
|
|
152
|
-
<NavLinkInline
|
|
153
|
-
key={`nav-link-${url}-${label}`}
|
|
154
|
-
icon={Icon}
|
|
155
|
-
className={impersonationLink ? 'read-only-link' : ''}
|
|
156
|
-
{...(impersonationLink
|
|
157
|
-
? { rightIcon: <EyeIcon classes="read-only-icon" /> }
|
|
158
|
-
: null)}
|
|
159
|
-
useTooltips={useTooltips}
|
|
160
|
-
showLabel={isExpanded}
|
|
161
|
-
{...sharedProps}
|
|
162
|
-
{...rest}
|
|
163
|
-
/>
|
|
164
|
-
);
|
|
165
|
-
}
|
|
166
|
-
return acc;
|
|
167
|
-
}, []);
|
|
168
24
|
|
|
169
25
|
return (
|
|
170
26
|
<div className="sidebar-content">
|
|
@@ -178,7 +34,8 @@ const LevelOneContent = ({
|
|
|
178
34
|
setSelectedRole={setSelectedRole}
|
|
179
35
|
/>
|
|
180
36
|
)}
|
|
181
|
-
|
|
37
|
+
|
|
38
|
+
<SanitizedContent html={levelOneContent} />
|
|
182
39
|
</div>
|
|
183
40
|
</div>
|
|
184
41
|
);
|
|
@@ -186,14 +43,7 @@ const LevelOneContent = ({
|
|
|
186
43
|
|
|
187
44
|
LevelOneContent.propTypes = {
|
|
188
45
|
isExpanded: PropTypes.bool,
|
|
189
|
-
|
|
190
|
-
levelOneContent: PropTypes.shape({
|
|
191
|
-
default: PropTypes.arrayOf(PropTypes.object),
|
|
192
|
-
devPre: PropTypes.arrayOf(PropTypes.object),
|
|
193
|
-
viewer: PropTypes.arrayOf(PropTypes.object),
|
|
194
|
-
internalReviewers: PropTypes.arrayOf(PropTypes.object),
|
|
195
|
-
contentManager: PropTypes.arrayOf(PropTypes.object),
|
|
196
|
-
}),
|
|
46
|
+
levelOneContent: PropTypes.object,
|
|
197
47
|
};
|
|
198
48
|
|
|
199
49
|
export default LevelOneContent;
|
|
@@ -46,6 +46,7 @@ const SelectRole = ({ selectedRole, setSelectedRole }) => {
|
|
|
46
46
|
|
|
47
47
|
// Update state
|
|
48
48
|
setSelectedRole(roleValue);
|
|
49
|
+
document.cookie = `selected_role=${roleValue}; Path=/;`;
|
|
49
50
|
|
|
50
51
|
//Redirect to role default page IF localStorage was not set (indicates initial login)
|
|
51
52
|
if (!selectedUserRole) {
|
|
@@ -14,7 +14,6 @@ const NavLinkInline = ({
|
|
|
14
14
|
showLabel,
|
|
15
15
|
linkCallback,
|
|
16
16
|
disabled,
|
|
17
|
-
useTooltips,
|
|
18
17
|
target,
|
|
19
18
|
}) => {
|
|
20
19
|
const localUrl = urlExpressionToMatch || url;
|
|
@@ -26,12 +25,12 @@ const NavLinkInline = ({
|
|
|
26
25
|
const tooltipRef = React.useRef();
|
|
27
26
|
|
|
28
27
|
React.useEffect(() => {
|
|
29
|
-
if (!showLabel &&
|
|
28
|
+
if (!showLabel && svgRef.current) {
|
|
30
29
|
const existingMouseenter = svgRef.current.onmouseover;
|
|
31
30
|
const existingMouseout = svgRef.current.onmouseout;
|
|
32
31
|
|
|
33
32
|
svgRef.current.onmouseover = () => {
|
|
34
|
-
if (tooltipRef.current
|
|
33
|
+
if (tooltipRef.current) {
|
|
35
34
|
const svgOffset = svgRef.current.getBoundingClientRect();
|
|
36
35
|
tooltipRef.current.style.top = `${svgOffset.top - 5}px`;
|
|
37
36
|
tooltipRef.current.style.display = 'block';
|
|
@@ -105,7 +104,6 @@ NavLinkInline.propTypes = {
|
|
|
105
104
|
showLabel: PropTypes.bool,
|
|
106
105
|
linkCallback: PropTypes.func,
|
|
107
106
|
disabled: PropTypes.bool,
|
|
108
|
-
useTooltips: PropTypes.bool,
|
|
109
107
|
target: PropTypes.string,
|
|
110
108
|
};
|
|
111
109
|
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import React, { useState,
|
|
1
|
+
import React, { useState, useRef, useEffect } from 'react';
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
3
|
|
|
4
|
-
import {
|
|
5
|
-
import { LevelOneContent
|
|
4
|
+
import { sideNavExpandedStorage } from '../helpers';
|
|
5
|
+
import { LevelOneContent } from '../Content';
|
|
6
6
|
import {
|
|
7
7
|
NavLinkContainer,
|
|
8
8
|
NavLinkInline,
|
|
@@ -16,27 +16,26 @@ import SanitizedContent from '../../SanitizedContent';
|
|
|
16
16
|
import * as SvgComponents from '../../../lib/SvgComponents.jsx';
|
|
17
17
|
import CmsSwitchLink from '../Links/CmsSwitchLink';
|
|
18
18
|
import defaultContent from './default-content';
|
|
19
|
+
import axios from 'axios';
|
|
19
20
|
|
|
20
21
|
const SideNavUI = ({
|
|
21
|
-
chartData,
|
|
22
22
|
config,
|
|
23
|
-
currentLevel,
|
|
24
23
|
isAltStyle,
|
|
25
|
-
isExpanded,
|
|
26
24
|
items,
|
|
27
25
|
onCollapsed,
|
|
28
26
|
onExpanded,
|
|
29
27
|
performanceYear,
|
|
30
|
-
showReportingLinks,
|
|
31
|
-
result,
|
|
32
28
|
}) => {
|
|
33
|
-
|
|
34
|
-
const [
|
|
35
|
-
|
|
29
|
+
// Use localStorage value to set init state, default to true
|
|
30
|
+
const [isExpandedState, setIsExpandedState] = useState(
|
|
31
|
+
sideNavExpandedStorage.setDefault()
|
|
32
|
+
);
|
|
33
|
+
const [sideNavContent, setSideNavContent] = useState({});
|
|
36
34
|
|
|
37
35
|
const collapseRef = useRef(null);
|
|
38
36
|
|
|
39
37
|
const expand = () => {
|
|
38
|
+
sideNavExpandedStorage.toggle();
|
|
40
39
|
setIsExpandedState(true);
|
|
41
40
|
if (onExpanded) {
|
|
42
41
|
onExpanded();
|
|
@@ -44,6 +43,7 @@ const SideNavUI = ({
|
|
|
44
43
|
};
|
|
45
44
|
|
|
46
45
|
const collapse = () => {
|
|
46
|
+
sideNavExpandedStorage.toggle();
|
|
47
47
|
setIsExpandedState(false);
|
|
48
48
|
if (onCollapsed) {
|
|
49
49
|
onCollapsed();
|
|
@@ -54,30 +54,30 @@ const SideNavUI = ({
|
|
|
54
54
|
isExpandedState ? collapse() : expand();
|
|
55
55
|
};
|
|
56
56
|
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
57
|
+
useEffect(() => {
|
|
58
|
+
let cancelRequest = false;
|
|
59
|
+
const { origin } = window.location;
|
|
60
|
+
let sideNavMenuItems;
|
|
61
|
+
|
|
62
|
+
async function getSideNavConfig() {
|
|
63
|
+
try {
|
|
64
|
+
const { data } = await axios.get(`${origin}/config/side-navigation`);
|
|
65
|
+
sideNavMenuItems = data.markup;
|
|
66
|
+
} catch (error) {
|
|
67
|
+
sideNavMenuItems = { content: defaultContent };
|
|
68
|
+
}
|
|
69
|
+
if (!cancelRequest) {
|
|
70
|
+
setSideNavContent(sideNavMenuItems);
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
getSideNavConfig();
|
|
74
|
+
return () => {
|
|
75
|
+
cancelRequest = true;
|
|
76
|
+
};
|
|
77
|
+
}, []);
|
|
77
78
|
|
|
78
79
|
const getDynamicContent = (contentItems, className, recursionId) => {
|
|
79
|
-
const { openDrawersByDefault, linkActiveFunc, linkCallback
|
|
80
|
-
config;
|
|
80
|
+
const { openDrawersByDefault, linkActiveFunc, linkCallback } = config;
|
|
81
81
|
let linkClass = isExpandedState ? 'link-inline' : 'link-collapsed';
|
|
82
82
|
const containerRecursionId = recursionId || 0;
|
|
83
83
|
|
|
@@ -117,7 +117,6 @@ const SideNavUI = ({
|
|
|
117
117
|
label={item.label}
|
|
118
118
|
linkCallback={linkCallback}
|
|
119
119
|
showLabel={true}
|
|
120
|
-
useTooltips={useTooltips}
|
|
121
120
|
/>
|
|
122
121
|
</AnimationGroup>
|
|
123
122
|
),
|
|
@@ -130,7 +129,6 @@ const SideNavUI = ({
|
|
|
130
129
|
label={item.label}
|
|
131
130
|
linkCallback={linkCallback}
|
|
132
131
|
showLabel={true}
|
|
133
|
-
useTooltips={useTooltips}
|
|
134
132
|
/>
|
|
135
133
|
</AnimationGroup>
|
|
136
134
|
),
|
|
@@ -220,7 +218,6 @@ const SideNavUI = ({
|
|
|
220
218
|
linkCallback={linkCallback}
|
|
221
219
|
showLabel={isExpandedState}
|
|
222
220
|
disabled={item.disabled}
|
|
223
|
-
useTooltips={useTooltips}
|
|
224
221
|
target={item.target}
|
|
225
222
|
/>
|
|
226
223
|
)
|
|
@@ -244,24 +241,23 @@ const SideNavUI = ({
|
|
|
244
241
|
}
|
|
245
242
|
};
|
|
246
243
|
|
|
247
|
-
|
|
248
|
-
? getDynamicContent(
|
|
249
|
-
itemsState,
|
|
250
|
-
'sidebar-content' + (isAltStyle ? ' alt-style' : '')
|
|
251
|
-
)
|
|
252
|
-
: getLevelContent();
|
|
253
|
-
|
|
254
|
-
useEffect(() => {
|
|
255
|
-
setIsExpandedState(isExpanded);
|
|
256
|
-
}, [isExpanded]);
|
|
257
|
-
|
|
244
|
+
// Set side nav expanded state in localStorage on initial render
|
|
258
245
|
useEffect(() => {
|
|
259
|
-
|
|
260
|
-
}, [
|
|
246
|
+
sideNavExpandedStorage.init();
|
|
247
|
+
}, []);
|
|
261
248
|
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
249
|
+
const content = !items?.length ? (
|
|
250
|
+
<LevelOneContent
|
|
251
|
+
levelOneContent={sideNavContent}
|
|
252
|
+
isExpanded={isExpandedState}
|
|
253
|
+
config={config}
|
|
254
|
+
/>
|
|
255
|
+
) : (
|
|
256
|
+
getDynamicContent(
|
|
257
|
+
items,
|
|
258
|
+
'sidebar-content' + (isAltStyle ? ' alt-style' : '')
|
|
259
|
+
)
|
|
260
|
+
);
|
|
265
261
|
|
|
266
262
|
return (
|
|
267
263
|
<aside
|
|
@@ -284,7 +280,6 @@ const SideNavUI = ({
|
|
|
284
280
|
|
|
285
281
|
SideNavUI.propTypes = {
|
|
286
282
|
currentLevel: PropTypes.number,
|
|
287
|
-
isExpanded: PropTypes.bool,
|
|
288
283
|
onExpanded: PropTypes.func,
|
|
289
284
|
onCollapsed: PropTypes.func,
|
|
290
285
|
chartData: PropTypes.object,
|
|
@@ -293,20 +288,10 @@ SideNavUI.propTypes = {
|
|
|
293
288
|
isAltStyle: PropTypes.bool,
|
|
294
289
|
showReportingLinks: PropTypes.bool,
|
|
295
290
|
performanceYear: PropTypes.string,
|
|
296
|
-
result: PropTypes.shape({
|
|
297
|
-
content: PropTypes.shape({
|
|
298
|
-
default: PropTypes.arrayOf(PropTypes.object),
|
|
299
|
-
devPre: PropTypes.arrayOf(PropTypes.object),
|
|
300
|
-
internalReviewers: PropTypes.arrayOf(PropTypes.object),
|
|
301
|
-
viewer: PropTypes.arrayOf(PropTypes.object),
|
|
302
|
-
contentManager: PropTypes.arrayOf(PropTypes.object),
|
|
303
|
-
}),
|
|
304
|
-
}),
|
|
305
291
|
};
|
|
306
292
|
|
|
307
293
|
SideNavUI.defaultProps = {
|
|
308
294
|
currentLevel: 1,
|
|
309
|
-
isExpanded: true,
|
|
310
295
|
onExpanded: () => {},
|
|
311
296
|
onCollapsed: () => {},
|
|
312
297
|
chartData: {},
|
|
@@ -315,20 +300,6 @@ SideNavUI.defaultProps = {
|
|
|
315
300
|
isAltStyle: false,
|
|
316
301
|
showReportingLinks: false,
|
|
317
302
|
performanceYear: '2017',
|
|
318
|
-
result: {
|
|
319
|
-
content: {
|
|
320
|
-
default: [],
|
|
321
|
-
devPre: [],
|
|
322
|
-
internalReviewers: [],
|
|
323
|
-
viewer: [],
|
|
324
|
-
contentManager: [],
|
|
325
|
-
},
|
|
326
|
-
},
|
|
327
303
|
};
|
|
328
304
|
|
|
329
|
-
export default
|
|
330
|
-
timeout: 5,
|
|
331
|
-
url: '/config/side-navigation',
|
|
332
|
-
localStorageName: 'qpp_side_navigation',
|
|
333
|
-
defaultContent,
|
|
334
|
-
});
|
|
305
|
+
export default SideNavUI;
|
|
File without changes
|
|
@@ -328,6 +328,44 @@ const isImpersonationLink = (docCookie, linkLabel) => {
|
|
|
328
328
|
return !helpdeskLinks.includes(linkLabel);
|
|
329
329
|
};
|
|
330
330
|
|
|
331
|
+
/**
|
|
332
|
+
* Set SideNav expanded state as qpp_side_nav_expanded in localStorage
|
|
333
|
+
*/
|
|
334
|
+
const sideNavExpandedStorage = {
|
|
335
|
+
isNullOrUndefined: function () {
|
|
336
|
+
const sideNavExpandedValue = localStorage.getItem('qpp_side_nav_expanded');
|
|
337
|
+
return sideNavExpandedValue === null || sideNavExpandedValue === undefined;
|
|
338
|
+
},
|
|
339
|
+
init: function () {
|
|
340
|
+
if (this.isNullOrUndefined()) {
|
|
341
|
+
localStorage.setItem('qpp_side_nav_expanded', true);
|
|
342
|
+
}
|
|
343
|
+
},
|
|
344
|
+
toggle: function () {
|
|
345
|
+
const isSideNavExpanded = JSON.parse(
|
|
346
|
+
localStorage.getItem('qpp_side_nav_expanded')
|
|
347
|
+
);
|
|
348
|
+
if (!isSideNavExpanded) {
|
|
349
|
+
localStorage.setItem('qpp_side_nav_expanded', true);
|
|
350
|
+
} else {
|
|
351
|
+
localStorage.setItem('qpp_side_nav_expanded', false);
|
|
352
|
+
}
|
|
353
|
+
},
|
|
354
|
+
get: function () {
|
|
355
|
+
return JSON.parse(localStorage.getItem('qpp_side_nav_expanded'));
|
|
356
|
+
},
|
|
357
|
+
remove: function () {
|
|
358
|
+
localStorage.removeItem('qpp_side_nav_expanded');
|
|
359
|
+
},
|
|
360
|
+
setDefault: function () {
|
|
361
|
+
let defaultValue = true;
|
|
362
|
+
if (!this.isNullOrUndefined()) {
|
|
363
|
+
defaultValue = this.get();
|
|
364
|
+
}
|
|
365
|
+
return defaultValue;
|
|
366
|
+
},
|
|
367
|
+
};
|
|
368
|
+
|
|
331
369
|
module.exports = {
|
|
332
370
|
submissionsUrl,
|
|
333
371
|
dashboardUrl,
|
|
@@ -348,4 +386,5 @@ module.exports = {
|
|
|
348
386
|
isImpersonating,
|
|
349
387
|
isImpersonationLink,
|
|
350
388
|
loadSideNavContent,
|
|
389
|
+
sideNavExpandedStorage,
|
|
351
390
|
};
|
|
@@ -5,7 +5,6 @@ import { SideNavUI } from './UI';
|
|
|
5
5
|
const SideNav = (options = {}) => {
|
|
6
6
|
const {
|
|
7
7
|
rootElement,
|
|
8
|
-
isExpanded,
|
|
9
8
|
onExpanded,
|
|
10
9
|
onCollapsed,
|
|
11
10
|
chartData,
|
|
@@ -26,7 +25,6 @@ const SideNav = (options = {}) => {
|
|
|
26
25
|
|
|
27
26
|
const { expand, collapse } = render(
|
|
28
27
|
<SideNavUI
|
|
29
|
-
isExpanded={isExpanded}
|
|
30
28
|
onExpanded={onExpanded}
|
|
31
29
|
onCollapsed={onCollapsed}
|
|
32
30
|
chartData={chartData}
|