qpp-style 9.11.1 → 9.12.1
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 +4 -2
- package/components/Link/Link.stories.js +81 -0
- package/components/Link/index.js +61 -0
- package/components/SideNav/Content/LevelOneContent.jsx +3 -2
- package/components/SideNav/UI/default-content.json +2 -2
- package/components/index.js +2 -0
- 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/images/icons/svg/search.svg +7 -0
- package/package.json +1 -1
- package/session/logout.js +16 -1
|
@@ -4,7 +4,7 @@ import axios from 'axios';
|
|
|
4
4
|
import CloseIcon from '@material-ui/icons/Close';
|
|
5
5
|
|
|
6
6
|
import { TextButton } from '../Button';
|
|
7
|
-
import { deleteImpersonatedUser } from '../../session/logout';
|
|
7
|
+
import { deleteImpersonatedUser, revertQppHasAuthsCookie } from '../../session/logout';
|
|
8
8
|
|
|
9
9
|
const ImpersonatorBanner = () => {
|
|
10
10
|
const { qpp_auth_token: token = null, qpp_impersonated_user: user = null } =
|
|
@@ -21,8 +21,10 @@ const ImpersonatorBanner = () => {
|
|
|
21
21
|
].join(' ');
|
|
22
22
|
|
|
23
23
|
const onClick = () => {
|
|
24
|
-
const fn = () => {
|
|
24
|
+
const fn = () => {
|
|
25
25
|
deleteImpersonatedUser({ qpp_impersonated_user: user });
|
|
26
|
+
// Set qpp_has_authorizations cookie back to impersonator's value
|
|
27
|
+
revertQppHasAuthsCookie();
|
|
26
28
|
window.location.reload();
|
|
27
29
|
};
|
|
28
30
|
return axios
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import DSLink from './index';
|
|
3
|
+
import { withKnobs } from '@storybook/addon-knobs';
|
|
4
|
+
import OpenInNewIcon from '@material-ui/icons/OpenInNew';
|
|
5
|
+
|
|
6
|
+
export default {
|
|
7
|
+
title: 'Link',
|
|
8
|
+
component: DSLink,
|
|
9
|
+
decorators: [withKnobs],
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
export const LinkLabel = () => <DSLink href="#">Link Label</DSLink>;
|
|
13
|
+
|
|
14
|
+
export const LinkColorVariants = () => (
|
|
15
|
+
<>
|
|
16
|
+
<div className=" qpp-dark-background qpp-u-padding--16">
|
|
17
|
+
<DSLink href="#" variant="white">
|
|
18
|
+
Link Label
|
|
19
|
+
</DSLink>
|
|
20
|
+
</div>
|
|
21
|
+
<p>
|
|
22
|
+
<DSLink href="#" variant="gray">
|
|
23
|
+
Link Label
|
|
24
|
+
</DSLink>
|
|
25
|
+
</p>
|
|
26
|
+
</>
|
|
27
|
+
);
|
|
28
|
+
|
|
29
|
+
export const inlineLinks = () => (
|
|
30
|
+
<div className="qpp-u-padding--16">
|
|
31
|
+
<p className="qpp-u-width--60">
|
|
32
|
+
Aenean lacinia <DSLink href="#">inline link</DSLink> nulla sed{' '}
|
|
33
|
+
<DSLink href="#">inline link</DSLink>. Integer posuere erat a ante
|
|
34
|
+
venenatis dapibus posuere velit aliquet. Integer posuere erat a ante
|
|
35
|
+
venenatis <DSLink href="#">inline link</DSLink> dapibus posuere velit
|
|
36
|
+
aliquet.
|
|
37
|
+
</p>
|
|
38
|
+
</div>
|
|
39
|
+
);
|
|
40
|
+
|
|
41
|
+
export const inlineLinksDarkBackground = () => (
|
|
42
|
+
<div className="qpp-dark-background qpp-u-padding--16">
|
|
43
|
+
Aenean lacinia{' '}
|
|
44
|
+
<DSLink href="#" variant="white">
|
|
45
|
+
inline link
|
|
46
|
+
</DSLink>{' '}
|
|
47
|
+
nulla sed{' '}
|
|
48
|
+
<DSLink href="#" variant="white">
|
|
49
|
+
inline link
|
|
50
|
+
</DSLink>
|
|
51
|
+
. Integer posuere erat a ante venenatis dapibus posuere velit aliquet.
|
|
52
|
+
Integer posuere erat a ante venenatis{' '}
|
|
53
|
+
<DSLink href="#" variant="white">
|
|
54
|
+
inline link
|
|
55
|
+
</DSLink>{' '}
|
|
56
|
+
dapibus posuere velit aliquet.
|
|
57
|
+
</div>
|
|
58
|
+
);
|
|
59
|
+
|
|
60
|
+
export const linkWithIcon = () => {
|
|
61
|
+
const icon = <OpenInNewIcon classes={{ root: 'qpp-icon-mat' }} />;
|
|
62
|
+
return (
|
|
63
|
+
<div className="qpp-u-padding--16">
|
|
64
|
+
<DSLink href="#">
|
|
65
|
+
Standalone Link With Icon
|
|
66
|
+
{icon}
|
|
67
|
+
</DSLink>{' '}
|
|
68
|
+
<p className=" qpp-u-width--60">
|
|
69
|
+
Aenean lacinia{' '}
|
|
70
|
+
<DSLink href="#">
|
|
71
|
+
inline link
|
|
72
|
+
{icon}
|
|
73
|
+
</DSLink>{' '}
|
|
74
|
+
nulla sed <DSLink href="#">inline link {icon}</DSLink>. Integer posuere
|
|
75
|
+
erat a ante venenatis dapibus posuere velit aliquet. Integer posuere
|
|
76
|
+
erat a ante venenatis <DSLink href="#">inline link {icon}</DSLink>{' '}
|
|
77
|
+
dapibus posuere velit aliquet.
|
|
78
|
+
</p>
|
|
79
|
+
</div>
|
|
80
|
+
);
|
|
81
|
+
};
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import PropTypes from 'prop-types';
|
|
3
|
+
|
|
4
|
+
const VARIANTS = ['white', 'gray'];
|
|
5
|
+
|
|
6
|
+
const DSLink = ({
|
|
7
|
+
className,
|
|
8
|
+
href,
|
|
9
|
+
download,
|
|
10
|
+
ariaLabel,
|
|
11
|
+
onClick,
|
|
12
|
+
children,
|
|
13
|
+
variant,
|
|
14
|
+
...rest
|
|
15
|
+
}) => {
|
|
16
|
+
let linkClass = 'qpp-c-link';
|
|
17
|
+
if (VARIANTS.includes(variant)) {
|
|
18
|
+
variant === 'gray'
|
|
19
|
+
? (linkClass = linkClass.concat(' ', 'qpp-u-color--gray-60'))
|
|
20
|
+
: (linkClass = linkClass.concat(' ', `qpp-u-color--${variant}`));
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
if (className) {
|
|
24
|
+
linkClass = linkClass.concat(' ', className);
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
return (
|
|
28
|
+
<a
|
|
29
|
+
aria-label={ariaLabel}
|
|
30
|
+
className={linkClass || ''}
|
|
31
|
+
href={href}
|
|
32
|
+
download={download}
|
|
33
|
+
onClick={onClick}
|
|
34
|
+
{...rest}
|
|
35
|
+
>
|
|
36
|
+
{children}
|
|
37
|
+
</a>
|
|
38
|
+
);
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
DSLink.propTypes = {
|
|
42
|
+
children: PropTypes.node,
|
|
43
|
+
className: PropTypes.string,
|
|
44
|
+
href: PropTypes.string,
|
|
45
|
+
ariaLabel: PropTypes.string,
|
|
46
|
+
onClick: PropTypes.func,
|
|
47
|
+
download: PropTypes.bool,
|
|
48
|
+
variant: PropTypes.oneOf(VARIANTS),
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
DSLink.defaultProps = {
|
|
52
|
+
children: null,
|
|
53
|
+
className: '',
|
|
54
|
+
href: '',
|
|
55
|
+
ariaLabel: null,
|
|
56
|
+
onClick: () => null,
|
|
57
|
+
download: false,
|
|
58
|
+
variant: null,
|
|
59
|
+
};
|
|
60
|
+
|
|
61
|
+
export default DSLink;
|
|
@@ -48,9 +48,10 @@ const getIcon = (url) =>
|
|
|
48
48
|
'/user/targeted-review/#/landing': TargetIcon,
|
|
49
49
|
'/user/test-data': MyTestDataIcon,
|
|
50
50
|
'/user/self-nomination/#/landing': IndividualReporting,
|
|
51
|
+
'/user/reviewers': DashboardIcon,
|
|
51
52
|
'/reviewer/exception': HardshipIcon,
|
|
52
53
|
'/reviewer/targeted-review': TargetIcon,
|
|
53
|
-
'/
|
|
54
|
+
'/self-nomination': IndividualReporting,
|
|
54
55
|
}[url] || null);
|
|
55
56
|
|
|
56
57
|
const LevelOneContent = ({
|
|
@@ -115,7 +116,7 @@ const LevelOneContent = ({
|
|
|
115
116
|
'/reviewer/targeted-review': (internalReviewerNames || []).includes(
|
|
116
117
|
'QPP Targeted Review & Exceptions'
|
|
117
118
|
),
|
|
118
|
-
'/
|
|
119
|
+
'/self-nomination': (internalReviewerNames || []).includes(
|
|
119
120
|
'QPP Self-Nomination'
|
|
120
121
|
),
|
|
121
122
|
|
|
@@ -78,7 +78,7 @@
|
|
|
78
78
|
],
|
|
79
79
|
"internalReviewers": [
|
|
80
80
|
{
|
|
81
|
-
"url": "/user/
|
|
81
|
+
"url": "/user/reviewers",
|
|
82
82
|
"label": "Dashboard Home"
|
|
83
83
|
},
|
|
84
84
|
{
|
|
@@ -91,7 +91,7 @@
|
|
|
91
91
|
"label": "Targeted Review"
|
|
92
92
|
},
|
|
93
93
|
{
|
|
94
|
-
"url": "/
|
|
94
|
+
"url": "/self-nomination",
|
|
95
95
|
"label": "Self Nomination"
|
|
96
96
|
}
|
|
97
97
|
],
|
package/components/index.js
CHANGED
|
@@ -17,6 +17,7 @@ import Infotip from './Infotip';
|
|
|
17
17
|
import Search from './Search';
|
|
18
18
|
import TextInput from './TextInput';
|
|
19
19
|
import Dropdown from './Dropdown';
|
|
20
|
+
import DSLink from './Link';
|
|
20
21
|
import {
|
|
21
22
|
MyApplicationsIcon,
|
|
22
23
|
UserSignInIcon,
|
|
@@ -121,4 +122,5 @@ export {
|
|
|
121
122
|
TextInput,
|
|
122
123
|
Dropdown,
|
|
123
124
|
Tooltip,
|
|
125
|
+
DSLink,
|
|
124
126
|
};
|