qpp-style 9.8.6 → 9.9.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/components/Breadcrumb/Breadcrumb.stories.js +18 -0
- package/components/Breadcrumb/index.js +4 -4
- package/components/Header/HeaderUI.jsx +2 -0
- package/components/Header/ImpersonatorBanner.jsx +55 -0
- package/components/SideNav/Content/LevelOneContent.jsx +9 -3
- package/components/SideNav/UI/default-content.json +4 -0
- package/dist/browser.js +1 -1
- package/dist/browser.js.LICENSE.txt +17 -0
- package/dist/browser.js.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.LICENSE.txt +17 -0
- 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 +6 -6
- package/session/logout.js +11 -2
- package/styles/qppds/components/_breadcrumbs.scss +16 -5
- package/styles/qppds/components/sidebar/_sidebar.scss +2 -1
|
@@ -32,6 +32,24 @@ export const ExampleLightBreadcrumb = () => (
|
|
|
32
32
|
|
|
33
33
|
ExampleLightBreadcrumb.storyName = 'Light';
|
|
34
34
|
|
|
35
|
+
export const ExampleScreenreaderOnlyBreadcrumb = () => (
|
|
36
|
+
<div className="qppds qpp-u-padding--16 qpp-u-fill--blue-80">
|
|
37
|
+
<Breadcrumb
|
|
38
|
+
newBreadcrumb={boolean('newBreadcrumb', true)}
|
|
39
|
+
crumbs={[
|
|
40
|
+
{
|
|
41
|
+
url: '/',
|
|
42
|
+
category: 'MainContent',
|
|
43
|
+
label: 'Home',
|
|
44
|
+
title: 'Home',
|
|
45
|
+
},
|
|
46
|
+
'Mips Overview',
|
|
47
|
+
]}
|
|
48
|
+
/>
|
|
49
|
+
</div>
|
|
50
|
+
);
|
|
51
|
+
ExampleScreenreaderOnlyBreadcrumb.storyName = 'SR Only Breadcrumb';
|
|
52
|
+
|
|
35
53
|
export const ExampleDarkBreadcrumb = () => (
|
|
36
54
|
<div className="qppds qpp-u-padding--16">
|
|
37
55
|
<Breadcrumb
|
|
@@ -50,12 +50,12 @@ const Breadcrumb = ({
|
|
|
50
50
|
return (
|
|
51
51
|
<li
|
|
52
52
|
key={crumb}
|
|
53
|
-
className=
|
|
53
|
+
className={`${
|
|
54
|
+
i === crumbs.length - 1 ? 'sr-only' : ''
|
|
55
|
+
} qpp-c-breadcrumbs__list-itemqpp-c-breadcrumbs__list-item--current`}
|
|
54
56
|
aria-current="page"
|
|
55
57
|
>
|
|
56
|
-
<span
|
|
57
|
-
{crumb}
|
|
58
|
-
</span>
|
|
58
|
+
<span>{crumb}</span>
|
|
59
59
|
</li>
|
|
60
60
|
);
|
|
61
61
|
}
|
|
@@ -6,6 +6,7 @@ import HeaderCancel from './HeaderCancel.jsx';
|
|
|
6
6
|
import HeaderContainer from './HeaderContainer';
|
|
7
7
|
import HeaderMenuItem from './HeaderMenuItem';
|
|
8
8
|
import HeaderMobileButton from './HeaderMobileButton';
|
|
9
|
+
import ImpersonatorBanner from './ImpersonatorBanner';
|
|
9
10
|
import HelpIcon from './HelpIcon';
|
|
10
11
|
import defaultHeaderContent from './default-content.json';
|
|
11
12
|
import { HeaderStateProvider } from './hooks';
|
|
@@ -126,6 +127,7 @@ const HeaderUI = ({
|
|
|
126
127
|
</ul>
|
|
127
128
|
</nav>
|
|
128
129
|
</HeaderContainer>
|
|
130
|
+
<ImpersonatorBanner />
|
|
129
131
|
</HeaderStateProvider>
|
|
130
132
|
);
|
|
131
133
|
};
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import cookie from 'cookie';
|
|
3
|
+
import axios from 'axios';
|
|
4
|
+
import CloseIcon from '@material-ui/icons/Close';
|
|
5
|
+
|
|
6
|
+
import { TextButton } from '../Button';
|
|
7
|
+
import { deleteImpersonatedUser } from '../../session/logout';
|
|
8
|
+
|
|
9
|
+
const ImpersonatorBanner = () => {
|
|
10
|
+
const { qpp_auth_token: token = null, qpp_impersonated_user: user = null } =
|
|
11
|
+
cookie.parse(document.cookie);
|
|
12
|
+
|
|
13
|
+
const className = [
|
|
14
|
+
'qpp-u-display--flex',
|
|
15
|
+
'qpp-u-justify-content--between',
|
|
16
|
+
'qpp-u-fill--gold-20',
|
|
17
|
+
'qpp-u-padding-x--40',
|
|
18
|
+
'qpp-u-padding-y--24',
|
|
19
|
+
'qpp-u-font-size--14',
|
|
20
|
+
'qpp-u-color--gray-80',
|
|
21
|
+
].join(' ');
|
|
22
|
+
|
|
23
|
+
const onClick = () => {
|
|
24
|
+
const fn = () => {
|
|
25
|
+
deleteImpersonatedUser({ qpp_impersonated_user: user });
|
|
26
|
+
window.location.reload();
|
|
27
|
+
};
|
|
28
|
+
return axios
|
|
29
|
+
.delete('/api/auth/users/impersonate', {
|
|
30
|
+
headers: {
|
|
31
|
+
Accept: 'application/vnd.qpp.cms.gov.v1+json',
|
|
32
|
+
Authorization: `Bearer ${token}`,
|
|
33
|
+
},
|
|
34
|
+
})
|
|
35
|
+
.then(fn, fn);
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
return (
|
|
39
|
+
token &&
|
|
40
|
+
user && (
|
|
41
|
+
<div className={className}>
|
|
42
|
+
<div>
|
|
43
|
+
VIEW ONLY | You are currently impersonating HARP user:{' '}
|
|
44
|
+
<strong>{user}</strong>
|
|
45
|
+
</div>
|
|
46
|
+
<TextButton onClick={onClick} className="qpp-u-color--gray-80">
|
|
47
|
+
Exit Impersonation Mode
|
|
48
|
+
<CloseIcon />
|
|
49
|
+
</TextButton>
|
|
50
|
+
</div>
|
|
51
|
+
)
|
|
52
|
+
);
|
|
53
|
+
};
|
|
54
|
+
|
|
55
|
+
export default ImpersonatorBanner;
|
|
@@ -59,6 +59,7 @@ const LevelOneContent = ({
|
|
|
59
59
|
qpp_ehr_authorized,
|
|
60
60
|
qpp_has_non_registry_authorizations,
|
|
61
61
|
qpp_auth_token,
|
|
62
|
+
qpp_can_impersonate,
|
|
62
63
|
} = cookie.parse(document.cookie);
|
|
63
64
|
|
|
64
65
|
let name = '';
|
|
@@ -67,6 +68,7 @@ const LevelOneContent = ({
|
|
|
67
68
|
name = `${firstName} ${lastName}`;
|
|
68
69
|
}
|
|
69
70
|
|
|
71
|
+
const canImpersonate = qpp_can_impersonate === 'true';
|
|
70
72
|
const hasAuthorizations = qpp_has_authorizations === 'true';
|
|
71
73
|
const hasApmPayments = user_has_apm_payments === 'true';
|
|
72
74
|
const isDevPre = qpp_is_dev_pre === 'true';
|
|
@@ -85,6 +87,7 @@ const LevelOneContent = ({
|
|
|
85
87
|
[physicianCompareUrl]: hasNonRegistryAuthorizations,
|
|
86
88
|
[reportsPortalUrl]: hasAuthorizations,
|
|
87
89
|
[facilityBasedPreviewBaseUrl]: hasAuthorizations,
|
|
90
|
+
'/user/impersonate': canImpersonate,
|
|
88
91
|
|
|
89
92
|
// dev pre
|
|
90
93
|
'/user/applications': ehrAuthorized,
|
|
@@ -109,10 +112,13 @@ const LevelOneContent = ({
|
|
|
109
112
|
};
|
|
110
113
|
|
|
111
114
|
const { pathname, hash } = window.location;
|
|
115
|
+
const filteredListOfLinks = (listOfLinks || []).filter((sublink) => {
|
|
116
|
+
return !(sublink.url in urlConditionMap && !urlConditionMap[sublink.url]);
|
|
117
|
+
});
|
|
112
118
|
if (
|
|
113
|
-
|
|
119
|
+
filteredListOfLinks?.length > 0 &&
|
|
114
120
|
(pathname === url ||
|
|
115
|
-
|
|
121
|
+
filteredListOfLinks.some(
|
|
116
122
|
(sublink) =>
|
|
117
123
|
pathname === sublink.url || `${pathname}${hash}` === sublink.url
|
|
118
124
|
))
|
|
@@ -121,7 +127,7 @@ const LevelOneContent = ({
|
|
|
121
127
|
<NavLinkDrawer
|
|
122
128
|
key={`nav-drawer-${url}-${label}`}
|
|
123
129
|
leftIcon={Icon}
|
|
124
|
-
listOfLinks={
|
|
130
|
+
listOfLinks={filteredListOfLinks}
|
|
125
131
|
isExpanded={isExpanded}
|
|
126
132
|
staticDrawer={false}
|
|
127
133
|
openByDefault
|
|
@@ -42,6 +42,10 @@
|
|
|
42
42
|
"url": "/user/manage-access",
|
|
43
43
|
"label": "Manage Access",
|
|
44
44
|
"listOfLinks": [
|
|
45
|
+
{
|
|
46
|
+
"url": "/user/impersonate",
|
|
47
|
+
"label": "QPP User Impersonation"
|
|
48
|
+
},
|
|
45
49
|
{
|
|
46
50
|
"url": "/user/self-nomination/#/landing",
|
|
47
51
|
"label": "Registry/QCDR Self-Nomination",
|