From bb317461fa1ad9a108fc762c7991a86003c1d2ed Mon Sep 17 00:00:00 2001 From: maxceem Date: Wed, 30 Sep 2020 12:29:21 +0300 Subject: [PATCH 1/2] feat: remove "Work Manager" link --- src/projects/detail/containers/ProjectInfoContainer.js | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/projects/detail/containers/ProjectInfoContainer.js b/src/projects/detail/containers/ProjectInfoContainer.js index 3e5a2461d..02175db93 100644 --- a/src/projects/detail/containers/ProjectInfoContainer.js +++ b/src/projects/detail/containers/ProjectInfoContainer.js @@ -17,7 +17,6 @@ import { PROJECT_ROLE_MANAGER, DIRECT_PROJECT_URL, SALESFORCE_PROJECT_LEAD_LINK, - WORK_MANAGER_APP, PROJECT_STATUS_CANCELLED, PROJECT_STATUS_ACTIVE, PROJECT_STATUS_COMPLETED, @@ -26,7 +25,6 @@ import { PROJECT_ROLE_PROJECT_MANAGER, PROJECT_ROLE_PROGRAM_MANAGER, PROJECT_ROLE_SOLUTION_ARCHITECT, - PROJECT_CATEGORY_TAAS, } from '../../../config/constants' import PERMISSIONS from '../../../config/permissions' import { hasPermission } from '../../../helpers/permissions' @@ -436,7 +434,7 @@ class ProjectInfoContainer extends React.Component { ? _.find(projectTemplates, pt => pt.id === projectTemplateId) : getProjectTemplateByKey(projectTemplates, projectTemplateKey) - const isTaaS = PROJECT_CATEGORY_TAAS === projectTemplate.category + // const isTaaS = PROJECT_CATEGORY_TAAS === projectTemplate.category let directLinks = null // check if direct links need to be added const isMemberOrCopilot = _.indexOf([ @@ -448,8 +446,8 @@ class ProjectInfoContainer extends React.Component { ], currentMemberRole) > -1 if (isMemberOrCopilot || isSuperUser) { directLinks = [] - if(!isTaaS) - directLinks.push({name: 'Launch Work Manager', href: `${WORK_MANAGER_APP}/${project.id}/challenges`}) + // if(!isTaaS) + // directLinks.push({name: 'Launch Work Manager', href: `${WORK_MANAGER_APP}/${project.id}/challenges`}) if (project.directProjectId) { directLinks.push({name: 'Project in Topcoder Direct', href: `${DIRECT_PROJECT_URL}${project.directProjectId}`}) } else { From 188a0edf8551716f0831c55e06374b2b1843199c Mon Sep 17 00:00:00 2001 From: maxceem Date: Wed, 30 Sep 2020 12:46:17 +0300 Subject: [PATCH 2/2] feat: open "Application Feedback" as regular link --- src/components/MenuItem/MenuItem.jsx | 53 ++++++++++++++----- src/components/UserSidebar/UserSidebar.jsx | 4 +- .../detail/containers/ProjectInfoContainer.js | 4 +- 3 files changed, 46 insertions(+), 15 deletions(-) diff --git a/src/components/MenuItem/MenuItem.jsx b/src/components/MenuItem/MenuItem.jsx index d32703c66..e11e11192 100644 --- a/src/components/MenuItem/MenuItem.jsx +++ b/src/components/MenuItem/MenuItem.jsx @@ -23,17 +23,33 @@ const MenuItem = ({ match, wrapperClass, toolTipText, + enforceA, + openNewTab, }) => { const matchedPath = match && match.path const isChildActive = children && some(children, c => c.to === matchedPath) + const linkContent = ( + + + {!!Icon && ( + + )} + {label} + + + {!!count && } + + + ) + return (
  • - {!children && ( + {!children && !enforceA && ( - - - {!!Icon && ( - - )} - {label} - - - {!!count && } - - + {linkContent} )} + {!children && enforceA && ( + + {linkContent} + + )} + {children && (
    ` instead of React Router `` + */ + enforceA: PT.bool, + /** + * Open link in the new tab. + * Only works if `enforceA` is `true`. + */ + openNewTab: PT.bool, } export default withRouter(MenuItem) diff --git a/src/components/UserSidebar/UserSidebar.jsx b/src/components/UserSidebar/UserSidebar.jsx index 900272212..387d2bc97 100644 --- a/src/components/UserSidebar/UserSidebar.jsx +++ b/src/components/UserSidebar/UserSidebar.jsx @@ -65,7 +65,9 @@ const navLinks = [{ iconClassName: 'fill', }, { label: 'GIVE APPLICATION FEEDBACK', - to: '/', + to: 'https://forms.gle/hwRWYB3cGQnKVpjk7', + enforceA: true, + openNewTab: true, Icon: FAQIcon, iconClassName: 'fill', }] diff --git a/src/projects/detail/containers/ProjectInfoContainer.js b/src/projects/detail/containers/ProjectInfoContainer.js index 02175db93..1cfb6898f 100644 --- a/src/projects/detail/containers/ProjectInfoContainer.js +++ b/src/projects/detail/containers/ProjectInfoContainer.js @@ -594,7 +594,9 @@ class ProjectInfoContainer extends React.Component { navLinks={[ { label: 'GIVE APPLICATION FEEDBACK', - to: '/', + to: 'https://forms.gle/hwRWYB3cGQnKVpjk7', + enforceA: true, + openNewTab: true, Icon: FAQIcon, iconClassName: 'fill', }