qpp-style 9.12.2 → 9.13.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/Header/ImpersonatorBanner.jsx +26 -9
- package/components/SideNav/UI/default-content.json +2 -2
- 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 +13 -7
|
@@ -4,11 +4,26 @@ import axios from 'axios';
|
|
|
4
4
|
import CloseIcon from '@material-ui/icons/Close';
|
|
5
5
|
|
|
6
6
|
import { TextButton } from '../Button';
|
|
7
|
-
import {
|
|
7
|
+
import {
|
|
8
|
+
deleteImpersonatedUser,
|
|
9
|
+
revertQppHasAuthsCookie,
|
|
10
|
+
} from '../../session/logout';
|
|
11
|
+
|
|
12
|
+
const getViewType = (viewType) => ({
|
|
13
|
+
username: 'HARP ID',
|
|
14
|
+
npi: 'NPI',
|
|
15
|
+
tin: 'TIN',
|
|
16
|
+
apm_id: 'APM Entity',
|
|
17
|
+
cms_id: 'Registry',
|
|
18
|
+
vg_id: 'Virtual Group',
|
|
19
|
+
}[viewType]);
|
|
8
20
|
|
|
9
21
|
const ImpersonatorBanner = () => {
|
|
10
|
-
const {
|
|
11
|
-
|
|
22
|
+
const {
|
|
23
|
+
qpp_auth_token: token = null,
|
|
24
|
+
qpp_impersonated_user: user = null,
|
|
25
|
+
qpp_impersonated_type: viewType = null,
|
|
26
|
+
} = cookie.parse(document.cookie);
|
|
12
27
|
|
|
13
28
|
const className = [
|
|
14
29
|
'qpp-u-display--flex',
|
|
@@ -21,14 +36,17 @@ const ImpersonatorBanner = () => {
|
|
|
21
36
|
].join(' ');
|
|
22
37
|
|
|
23
38
|
const onClick = () => {
|
|
24
|
-
const fn = () => {
|
|
25
|
-
deleteImpersonatedUser({
|
|
39
|
+
const fn = () => {
|
|
40
|
+
deleteImpersonatedUser({
|
|
41
|
+
qpp_impersonated_user: user,
|
|
42
|
+
qpp_impersonated_type: viewType,
|
|
43
|
+
});
|
|
26
44
|
// Set qpp_has_authorizations cookie back to impersonator's value
|
|
27
45
|
revertQppHasAuthsCookie();
|
|
28
46
|
window.location.reload();
|
|
29
47
|
};
|
|
30
48
|
return axios
|
|
31
|
-
.delete('/api/auth/
|
|
49
|
+
.delete('/api/auth/helpdesk/view', {
|
|
32
50
|
headers: {
|
|
33
51
|
Accept: 'application/vnd.qpp.cms.gov.v1+json',
|
|
34
52
|
Authorization: `Bearer ${token}`,
|
|
@@ -42,11 +60,10 @@ const ImpersonatorBanner = () => {
|
|
|
42
60
|
user && (
|
|
43
61
|
<div className={className}>
|
|
44
62
|
<div>
|
|
45
|
-
VIEW ONLY | You are currently
|
|
46
|
-
<strong>{user}</strong>
|
|
63
|
+
VIEW ONLY | You are currently viewing {getViewType(viewType)}: <strong>{user}</strong>
|
|
47
64
|
</div>
|
|
48
65
|
<TextButton onClick={onClick} className="qpp-u-color--gray-80">
|
|
49
|
-
Exit
|
|
66
|
+
Exit View Mode
|
|
50
67
|
<CloseIcon />
|
|
51
68
|
</TextButton>
|
|
52
69
|
</div>
|