Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/helpers/markdownToState.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import {convertFromRaw} from 'draft-js'
import _ from 'lodash'
const Remarkable = require('remarkable')

// Block level items, key is Remarkable's key for them, value returned is
Expand Down Expand Up @@ -294,7 +295,7 @@ function markdownToState(markdown, options = {}) {

return convertFromRaw({
entityMap,
blocks
blocks: _.filter(blocks, b => b.text)
})
}

Expand Down
17 changes: 10 additions & 7 deletions src/helpers/projectHelper.js
Original file line number Diff line number Diff line change
Expand Up @@ -337,23 +337,26 @@ export function getNewProjectLink(orgConfigs) {
* @param {string} projectId - The project id
*/
export function getProjectNavLinks(project, projectId) {
let messagesTab = null
// `Discussions` items can be added as soon as project is loaded
// if discussions are not hidden for it
if (project.details && !project.details.hideDiscussions) {
messagesTab = { label: 'Discussions', to: `/projects/${projectId}/discussions`, Icon: InvisibleIcon, iconClassName: 'fill' }
} else {
messagesTab = { label: 'Messages', to: `/projects/${projectId}/messages`, Icon: MessagesIcon, iconClassName: 'stroke', exact: false }
}
// choose set of menu links based on the project version
const navLinks = project.version === 'v3' ? [
{ label: 'Dashboard', to: `/projects/${projectId}`, Icon: DashboardIcon, iconClassName: 'stroke' },
{ label: 'Messages', to: `/projects/${projectId}/messages`, Icon: MessagesIcon, iconClassName: 'stroke', exact: false },
messagesTab,
{ label: 'Scope', to: `/projects/${projectId}/scope`, Icon: ScopeIcon, iconClassName: 'fill' },
// { label: 'Reports', to: '#', Icon: ReportsIcon },
{ label: 'Assets Library', to: `/projects/${projectId}/assets`, Icon: AssetsLibraryIcon, iconClassName: 'stroke' },
] : [
{ label: 'Dashboard', to: `/projects/${projectId}`, Icon: DashboardIcon, iconClassName: 'stroke' },
messagesTab,
{ label: 'Specification', to: `/projects/${projectId}/specification`, Icon: ScopeIcon, iconClassName: 'fill' },
]

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

return navLinks
}