Skip to content

Commit 7332a96

Browse files
authored
Merge pull request #4143 from appirio-tech/hotfix/post-release-2.12.2
[HOTFIX] [PROD] Patch release 2.12.2
2 parents 9c2d959 + 188a0ed commit 7332a96

File tree

3 files changed

+49
-20
lines changed

3 files changed

+49
-20
lines changed

src/components/MenuItem/MenuItem.jsx

Lines changed: 40 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -23,38 +23,54 @@ const MenuItem = ({
2323
match,
2424
wrapperClass,
2525
toolTipText,
26+
enforceA,
27+
openNewTab,
2628
}) => {
2729
const matchedPath = match && match.path
2830
const isChildActive = children && some(children, c => c.to === matchedPath)
2931

32+
const linkContent = (
33+
<span styleName="content">
34+
<span styleName="left">
35+
{!!Icon && (
36+
<Icon className={cn(styles.icon, styles[iconClassName])} />
37+
)}
38+
{label}
39+
</span>
40+
<span styleName="right">
41+
{!!count && <NotificationBadge count={count} text={toolTipText} />}
42+
</span>
43+
</span>
44+
)
45+
3046
return (
3147
<li className={
3248
cn(wrapperClass,
3349
styles.menuItem,
3450
{ [styles.open]: isAccordionOpen, [styles.withChildren]: children })}
3551
>
36-
{!children && (
52+
{!children && !enforceA && (
3753
<NavLink
3854
to={to}
3955
className={styles.navItem}
4056
activeClassName={styles.active}
4157
exact={exact}
4258
isActive={isActive}
4359
>
44-
<span styleName="content">
45-
<span styleName="left">
46-
{!!Icon && (
47-
<Icon className={cn(styles.icon, styles[iconClassName])} />
48-
)}
49-
{label}
50-
</span>
51-
<span styleName="right">
52-
{!!count && <NotificationBadge count={count} text={toolTipText} />}
53-
</span>
54-
</span>
60+
{linkContent}
5561
</NavLink>
5662
)}
5763

64+
{!children && enforceA && (
65+
<a
66+
href={to}
67+
className={styles.navItem}
68+
target={openNewTab ? '_blank' : ''}
69+
>
70+
{linkContent}
71+
</a>
72+
)}
73+
5874
{children && (
5975
<div>
6076
<div
@@ -91,7 +107,9 @@ const MenuItem = ({
91107
}
92108

93109
MenuItem.defaultProps = {
94-
exact: true
110+
exact: true,
111+
enforceA: false,
112+
openNewTab: false,
95113
}
96114

97115
MenuItem.propTypes = {
@@ -107,6 +125,15 @@ MenuItem.propTypes = {
107125
onAccordionToggle: PT.func,
108126
wrapperClass: PT.string,
109127
toolTipText: PT.string,
128+
/**
129+
* Render as regular link `<a>` instead of React Router `<NavLink>`
130+
*/
131+
enforceA: PT.bool,
132+
/**
133+
* Open link in the new tab.
134+
* Only works if `enforceA` is `true`.
135+
*/
136+
openNewTab: PT.bool,
110137
}
111138

112139
export default withRouter(MenuItem)

src/components/UserSidebar/UserSidebar.jsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,9 @@ const navLinks = [{
6565
iconClassName: 'fill',
6666
}, {
6767
label: 'GIVE APPLICATION FEEDBACK',
68-
to: '/',
68+
to: 'https://forms.gle/hwRWYB3cGQnKVpjk7',
69+
enforceA: true,
70+
openNewTab: true,
6971
Icon: FAQIcon,
7072
iconClassName: 'fill',
7173
}]

src/projects/detail/containers/ProjectInfoContainer.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ import {
1717
PROJECT_ROLE_MANAGER,
1818
DIRECT_PROJECT_URL,
1919
SALESFORCE_PROJECT_LEAD_LINK,
20-
WORK_MANAGER_APP,
2120
PROJECT_STATUS_CANCELLED,
2221
PROJECT_STATUS_ACTIVE,
2322
PROJECT_STATUS_COMPLETED,
@@ -26,7 +25,6 @@ import {
2625
PROJECT_ROLE_PROJECT_MANAGER,
2726
PROJECT_ROLE_PROGRAM_MANAGER,
2827
PROJECT_ROLE_SOLUTION_ARCHITECT,
29-
PROJECT_CATEGORY_TAAS,
3028
} from '../../../config/constants'
3129
import PERMISSIONS from '../../../config/permissions'
3230
import { hasPermission } from '../../../helpers/permissions'
@@ -436,7 +434,7 @@ class ProjectInfoContainer extends React.Component {
436434
? _.find(projectTemplates, pt => pt.id === projectTemplateId)
437435
: getProjectTemplateByKey(projectTemplates, projectTemplateKey)
438436

439-
const isTaaS = PROJECT_CATEGORY_TAAS === projectTemplate.category
437+
// const isTaaS = PROJECT_CATEGORY_TAAS === projectTemplate.category
440438
let directLinks = null
441439
// check if direct links need to be added
442440
const isMemberOrCopilot = _.indexOf([
@@ -448,8 +446,8 @@ class ProjectInfoContainer extends React.Component {
448446
], currentMemberRole) > -1
449447
if (isMemberOrCopilot || isSuperUser) {
450448
directLinks = []
451-
if(!isTaaS)
452-
directLinks.push({name: 'Launch Work Manager', href: `${WORK_MANAGER_APP}/${project.id}/challenges`})
449+
// if(!isTaaS)
450+
// directLinks.push({name: 'Launch Work Manager', href: `${WORK_MANAGER_APP}/${project.id}/challenges`})
453451
if (project.directProjectId) {
454452
directLinks.push({name: 'Project in Topcoder Direct', href: `${DIRECT_PROJECT_URL}${project.directProjectId}`})
455453
} else {
@@ -596,7 +594,9 @@ class ProjectInfoContainer extends React.Component {
596594
navLinks={[
597595
{
598596
label: 'GIVE APPLICATION FEEDBACK',
599-
to: '/',
597+
to: 'https://forms.gle/hwRWYB3cGQnKVpjk7',
598+
enforceA: true,
599+
openNewTab: true,
600600
Icon: FAQIcon,
601601
iconClassName: 'fill',
602602
}

0 commit comments

Comments
 (0)