Skip to content

Commit ad0d14b

Browse files
committed
Corrected logic for attaching callback for PRIMARY topics.
1 parent 200f292 commit ad0d14b

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

src/projects/detail/containers/ProjectInfoContainer.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ class ProjectInfoContainer extends React.Component {
122122
const { duration } = this.state
123123
const { project, currentMemberRole, isSuperUser, phases, feeds,
124124
hideInfo, hideLinks, hideMembers, onChannelClick, activeChannelId, productsTimelines,
125-
isManageUser, phasesTopics } = this.props
125+
isManageUser, phasesTopics, isProjectPlan } = this.props
126126
let directLinks = null
127127
// check if direct links need to be added
128128
const isMemberOrCopilot = _.indexOf([PROJECT_ROLE_COPILOT, PROJECT_ROLE_MANAGER], currentMemberRole) > -1
@@ -191,7 +191,8 @@ class ProjectInfoContainer extends React.Component {
191191
title: `${feed.title}`,
192192
address: feed.tag === PROJECT_FEED_TYPE_PRIMARY ? `/projects/${project.id}#feed-${feed.id}` : `/projects/${project.id}/plan#phase-${feed.phaseId}-posts`,
193193
noNewPage: true,
194-
onClick: feed.tag !== PROJECT_FEED_TYPE_PRIMARY && onChannelClick ? () => onChannelClick(feed) : null,
194+
//if PRIMARY discussion is to be loaded for project-plan page we won't attach the callback, for smoother transition to dashboard page
195+
onClick: !(isProjectPlan && feed.tag === PROJECT_FEED_TYPE_PRIMARY) && onChannelClick ? () => onChannelClick(feed) : null,
195196
allowDefaultOnClick: true,
196197
isActive: feed.id === activeChannelId,
197198
}))
@@ -261,6 +262,7 @@ ProjectInfoContainer.PropTypes = {
261262
isSuperUser: PropTypes.bool,
262263
isManageUser: PropTypes.bool,
263264
productsTimelines : PropTypes.object.isRequired,
265+
isProjectPlan: PropTypes.bool,
264266
}
265267

266268
const mapDispatchToProps = { updateProject, deleteProject, addProjectAttachment, loadDashboardFeeds, loadPhaseFeed }

src/projects/detail/containers/ProjectPlanContainer.jsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,7 @@ class ProjectPlanContainer extends React.Component {
8888
))
8989

9090
const isProjectLive = project.status !== PROJECT_STATUS_COMPLETED && project.status !== PROJECT_STATUS_CANCELLED
91+
const isProjectPlan = true
9192

9293
const leftArea = (
9394
<ProjectInfoContainer
@@ -101,6 +102,7 @@ class ProjectPlanContainer extends React.Component {
101102
productsTimelines={productsTimelines}
102103
phasesTopics={phasesTopics}
103104
onChannelClick={this.onChannelClick}
105+
isProjectPlan={isProjectPlan}
104106
/>
105107
)
106108

0 commit comments

Comments
 (0)