Skip to content

Commit 5051a47

Browse files
author
Vikas Agarwal
committed
Enabling Messages tab again for old projects
1 parent 647497e commit 5051a47

File tree

1 file changed

+10
-7
lines changed

1 file changed

+10
-7
lines changed

src/helpers/projectHelper.js

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -337,23 +337,26 @@ export function getNewProjectLink(orgConfigs) {
337337
* @param {string} projectId - The project id
338338
*/
339339
export function getProjectNavLinks(project, projectId) {
340+
let messagesTab = null
341+
// `Discussions` items can be added as soon as project is loaded
342+
// if discussions are not hidden for it
343+
if (project.details && !project.details.hideDiscussions) {
344+
messagesTab = { label: 'Discussions', to: `/projects/${projectId}/discussions`, Icon: InvisibleIcon, iconClassName: 'fill' }
345+
} else {
346+
messagesTab = { label: 'Messages', to: `/projects/${projectId}/messages`, Icon: MessagesIcon, iconClassName: 'stroke', exact: false }
347+
}
340348
// choose set of menu links based on the project version
341349
const navLinks = project.version === 'v3' ? [
342350
{ label: 'Dashboard', to: `/projects/${projectId}`, Icon: DashboardIcon, iconClassName: 'stroke' },
343-
{ label: 'Messages', to: `/projects/${projectId}/messages`, Icon: MessagesIcon, iconClassName: 'stroke', exact: false },
351+
messagesTab,
344352
{ label: 'Scope', to: `/projects/${projectId}/scope`, Icon: ScopeIcon, iconClassName: 'fill' },
345353
// { label: 'Reports', to: '#', Icon: ReportsIcon },
346354
{ label: 'Assets Library', to: `/projects/${projectId}/assets`, Icon: AssetsLibraryIcon, iconClassName: 'stroke' },
347355
] : [
348356
{ label: 'Dashboard', to: `/projects/${projectId}`, Icon: DashboardIcon, iconClassName: 'stroke' },
357+
messagesTab,
349358
{ label: 'Specification', to: `/projects/${projectId}/specification`, Icon: ScopeIcon, iconClassName: 'fill' },
350359
]
351360

352-
// `Discussions` items can be added as soon as project is loaded
353-
// if discussions are not hidden for it
354-
if (project.details && !project.details.hideDiscussions) {
355-
navLinks.push({ label: 'Discussions', to: `/projects/${projectId}/discussions`, Icon: InvisibleIcon, iconClassName: 'fill' })
356-
}
357-
358361
return navLinks
359362
}

0 commit comments

Comments
 (0)