= 0 || linkToDelete >= 0)}, '')}>
diff --git a/src/components/AssetsLibrary/SubFolder.jsx b/src/components/AssetsLibrary/SubFolder.jsx
index 61f95e92f..e8680cbe4 100644
--- a/src/components/AssetsLibrary/SubFolder.jsx
+++ b/src/components/AssetsLibrary/SubFolder.jsx
@@ -54,7 +54,7 @@ class SubFolder extends React.Component {
}
render() {
- const { link, renderLink, goBack, formatModifyDate } = this.props
+ const { link, renderLink, goBack, formatModifyDate, isLinkSubFolder } = this.props
const { linkToDelete } = this.state
return (
= 0)}, '')}>
@@ -88,7 +88,7 @@ class SubFolder extends React.Component {
}
let iconPath
try {
- if (this.isURLValid(childLink.title)) {
+ if (isLinkSubFolder) {
//Link Icon here
iconPath = require('../../assets/icons/link-12.svg')
} else {
diff --git a/src/components/TopicCard/TopicCard.jsx b/src/components/TopicCard/TopicCard.jsx
index a0a1ad261..aa531cb10 100644
--- a/src/components/TopicCard/TopicCard.jsx
+++ b/src/components/TopicCard/TopicCard.jsx
@@ -7,12 +7,24 @@ import cn from 'classnames'
import UserTooltip from '../User/UserTooltip'
import NotificationBellAvatar from './NotificationBellAvatar'
+import {
+ CODER_BOT_USER_FNAME,
+ CODER_BOT_USER_LNAME,
+} from '../../config/constants'
+import { isSystemUser } from '../../helpers/tcHelpers'
+
import FileIcon from '../../assets/icons/file-12.svg'
import LinkIcon from '../../assets/icons/link-12.svg'
import InvisibleIcon from '../../assets/icons/invisible-12.svg'
import styles from './TopicCard.scss'
+const SYSTEM_USER = {
+ firstName: CODER_BOT_USER_FNAME,
+ lastName: CODER_BOT_USER_LNAME,
+ photoURL: require('../../assets/images/avatar-coder.svg')
+}
+
/**
* The topic card that shows the topic title, number of links, files, etc
*/
@@ -32,13 +44,15 @@ const TopicCard = ({
const pluralize = (name, num) => `${name}${num > 1 ? 's' : ''}`
const lastMessageUserId = last(posts).userId
- const lastMessageAuthor = get(allMembers, lastMessageUserId)
+ const lastMessageAuthor = isSystemUser(lastMessageUserId) ? SYSTEM_USER : get(allMembers, lastMessageUserId)
const lastMessageDate = formatDate(lastActivityAt)
const numNewMessages = get(notifications, 'length')
const newMessagesFromDate = formatDate(get(notifications, '0.date'))
const numFiles = sumBy(posts, p => get(p, 'attachments.length', 0))
const numLinks = sumBy(posts, p => get(p, 'links.length', 0))
+ const authorUser = isSystemUser(get(author, 'userId')) ? SYSTEM_USER : author
+
return (
@@ -47,7 +61,7 @@ const TopicCard = ({
{numNewMessages && }
{!numNewMessages && author && (
{
// TODO: Replace hardcoded values with real data
@@ -19,9 +12,6 @@ const UserSummary = ({user}) => {
drafts: 7,
delivered: 5
} */
- const powerUserRoles = [ROLE_CONNECT_COPILOT, ROLE_CONNECT_MANAGER, ROLE_ADMINISTRATOR, ROLE_CONNECT_ADMIN]
- const isCustomer = _.intersection(user.roles, powerUserRoles).length === 0
- const role = isCustomer ? 'Customer' : 'Member'
const userName = (user.firstName && user.lastName) && `${user.firstName} ${user.lastName}`
const memberSince = moment(user.createdAt).format('MMM YYYY')
return (
@@ -38,7 +28,7 @@ const UserSummary = ({user}) => {
@{user.handle}
- {role} since {memberSince}
+ User since {memberSince}