Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
a51ea9b
Github issue #566, Connect Login/Logout redirect not working correctl…
Dec 7, 2016
9fc4a7a
Merge pull request #567 from appirio-tech/feature/wrong-login-page-sa…
Dec 7, 2016
396cd01
Github #166, Messaging: unposted content alert
Dec 8, 2016
6b3974b
Github #166, Messaging: unposted content alert
Dec 8, 2016
d4d59a6
Merge pull request #569 from appirio-tech/feature/discussions_unposte…
Dec 8, 2016
6808429
Github issue #566, Connect Login/Logout redirect not working correctl…
Dec 8, 2016
5046816
Merge pull request #570 from appirio-tech/feature/wrong-login-page-sa…
Dec 8, 2016
94ee808
Github issue #360, Even though user clear the username from the textb…
Dec 8, 2016
4205fe0
Merge pull request #571 from appirio-tech/feature/add_team_member_cle…
Dec 8, 2016
2d470f7
Updating footer Help link
fnisen Dec 9, 2016
b07025e
Updating footer Help link
fnisen Dec 9, 2016
d75f06d
Merge pull request #576 from appirio-tech/fnisen-patch-2
Dec 9, 2016
731348e
Merge pull request #575 from appirio-tech/fnisen-patch-1
Dec 9, 2016
623903b
Switch the Beta logo with the original Connect logo
Dec 9, 2016
c457546
Merge pull request #578 from appirio-tech/beta-tag-removed
Dec 10, 2016
4dc883c
Github issue #579, General: allow "admin" role to have same rights as…
Dec 12, 2016
8d0d742
Github #166, Messaging: unposted content alert
Dec 12, 2016
d96e8e9
Merge pull request #580 from appirio-tech/feature/discussions_unposte…
Dec 12, 2016
2004ab6
Github issue #574, Discussions: no footer on Discussion tab
Dec 12, 2016
a09a0e2
Merge pull request #581 from appirio-tech/feature/missing_footer_disc…
Dec 12, 2016
f8f3ae9
Github issue #574, Discussions: no footer on Discussion tab
Dec 13, 2016
cb4094e
Merge pull request #583 from appirio-tech/feature/missing_footer_disc…
Dec 13, 2016
96a3b87
Github issue #568, Dashboard: status update thread is too "sticky"
Dec 13, 2016
f20de04
Fixed lint error
Dec 13, 2016
dd08081
Github issue #572, Messaging: Owner response post missing from status…
Dec 14, 2016
4114f3a
Github issue #572, Messaging: Owner response post missing from status…
Dec 14, 2016
cb7c0ac
Merge pull request #586 from appirio-tech/feature/comments_remove_res…
Dec 14, 2016
3b269d1
Merge pull request #584 from appirio-tech/feature/sticky_dashboard_feeds
parthshah Dec 14, 2016
7fd8e93
Merge pull request #582 from appirio-tech/feature/admin_as_connect_ma…
parthshah Dec 14, 2016
0e488ab
Merge branch 'master' into dev
Dec 14, 2016
7ac4a0a
Github issue #574, Discussions: no footer on Discussion tab
Dec 15, 2016
d68e817
Github issue#561, General: Redirect connectv2.topcoder.com to connect…
Dec 15, 2016
101fee6
Merge pull request #588 from appirio-tech/feature/missing_footer_disc…
Dec 15, 2016
fb3b049
Merge pull request #589 from appirio-tech/feature/connectv2_redirect_…
Dec 15, 2016
0c6fc6e
Github issue#587, Comments Sort order within a topic is incorrect
Dec 15, 2016
b861468
Github issue#585, Ignore 'user-joined' type posts in Topic comments
Dec 15, 2016
42246a0
Merge pull request #591 from appirio-tech/feature/ignore_empty_system…
Dec 15, 2016
61b0518
Merge pull request #590 from appirio-tech/feature/comments_sorting
Dec 15, 2016
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
4 changes: 2 additions & 2 deletions src/components/Feed/Feed.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ const Feed = (props) => {
<div className="card-body draftjs-post" dangerouslySetInnerHTML={{__html: html}} />
</div>
</Panel.Body>
{allowComments &&
<FeedComments
allowComments={ allowComments }
totalComments={totalComments}
hasMoreComments={hasMoreComments}
onLoadMoreComments={onLoadMoreComments}
Expand All @@ -49,7 +49,7 @@ const Feed = (props) => {
avatarUrl={currentUser.photoURL}
comments={comments}
isAddingComment={ isAddingComment }
/>}
/>
{children}
</ActionCard>
)
Expand Down
5 changes: 3 additions & 2 deletions src/components/Feed/FeedComments.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ class FeedComments extends React.Component {
render() {
const {
comments, currentUser, totalComments, onLoadMoreComments, isLoadingComments, hasMoreComments, onAdd,
onChange, content, avatarUrl, isAddingComment
onChange, content, avatarUrl, isAddingComment, allowComments
} = this.props
let authorName = currentUser.firstName
if (authorName && currentUser.lastName) {
Expand Down Expand Up @@ -77,6 +77,7 @@ class FeedComments extends React.Component {
<div dangerouslySetInnerHTML={{__html: item.content}} />
</Comment>
)}
{allowComments &&
<AddComment
placeholder="Create a new comment..."
onAdd={onAdd}
Expand All @@ -85,7 +86,7 @@ class FeedComments extends React.Component {
avatarUrl={avatarUrl}
authorName={ authorName }
isAdding={ isAddingComment }
/>
/>}
</div>
)
}
Expand Down
29 changes: 22 additions & 7 deletions src/components/Feed/NewPost.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,13 @@ class NewPost extends React.Component {
constructor(props) {
super(props)
this.state = {editorState: EditorState.createEmpty(), expandedEditor: false, canSubmit: false}
this.onTitleChange = this.onTitleChange.bind(this)
this.onEditorChange = this.onEditorChange.bind(this)
this.handleKeyCommand = this.handleKeyCommand.bind(this)
this.toggleBlockType = this.toggleBlockType.bind(this)
this.toggleInlineStyle = this.toggleInlineStyle.bind(this)
this.onClickOutside = this.onClickOutside.bind(this)
this.onNewPostChange = this.onNewPostChange.bind(this)
this.validateSubmitState = this.validateSubmitState.bind(this)
}

componentDidMount() {
Expand All @@ -59,11 +60,11 @@ class NewPost extends React.Component {
}

componentWillReceiveProps(nextProps) {
if (!(nextProps.isCreating || nextProps.hasError && !nextProps.isCreating)) {
if (nextProps.isCreating !== this.props.isCreating && !nextProps.isCreating && !nextProps.hasError) {
this.setState({editorState: EditorState.createEmpty()})
this.refs.title.value = ''
}
this.onNewPostChange()
this.validateSubmitState()
}

onClickOutside(evt) {
Expand Down Expand Up @@ -125,15 +126,29 @@ class NewPost extends React.Component {

onEditorChange(editorState) {
this.setState({editorState})
this.onNewPostChange()
this.validateSubmitState()
if (this.props.onNewPostChange) {
// NOTE: uses getPlainText method to avoid newline character for empty content
this.props.onNewPostChange(this.refs.title.value, editorState.getCurrentContent().getPlainText())
}
}

onNewPostChange() {
validateSubmitState() {
const { editorState } = this.state
this.setState({
canSubmit: this.refs.title && !!this.refs.title.value.trim().length && this.state.editorState.getCurrentContent().hasText()
canSubmit: this.refs.title && !!this.refs.title.value.trim().length && editorState.getCurrentContent().hasText()
})
}

onTitleChange() {
const { editorState } = this.state
this.validateSubmitState()
if (this.props.onNewPostChange) {
// NOTE: uses getPlainText method to avoid newline character for empty content
this.props.onNewPostChange(this.refs.title.value, editorState.getCurrentContent().getPlainText())
}
}

render() {
const {currentUser, titlePlaceholder, isCreating} = this.props
const {editorState, canSubmit} = this.state
Expand Down Expand Up @@ -191,7 +206,7 @@ class NewPost extends React.Component {
ref="title"
className="new-post-title"
type="text"
onChange={this.onNewPostChange}
onChange={this.onTitleChange}
placeholder={ titlePlaceholder || 'Title of the post'}
/>
<div className="draftjs-editor tc-textarea">
Expand Down
2 changes: 1 addition & 1 deletion src/components/Footer/Footer.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ const Footer = () => {
const otherNavigationItems = [
{img: '', text: 'About', link: 'https://www.topcoder.com/about-topcoder/', target: '_blank'},
{img: '', text: 'Contact', link: 'https://www.topcoder.com/about-topcoder/contact/', target: '_blank'},
{img: '', text: 'Help', link: 'https://help.topcoder.com/hc/en-us', target: '_blank'},
{img: '', text: 'Help', link: 'https://help.topcoder.com/hc/en-us/articles/225540188-Topcoder-Connect-FAQs', target: '_blank'},
{img: '', text: 'Privacy', link: 'https://www.topcoder.com/community/how-it-works/privacy-policy/', target: '_blank'},
{img: '', text: 'Terms', link: 'https://connect.topcoder.com/terms'}
]
Expand Down
2 changes: 1 addition & 1 deletion src/components/FooterV2/FooterV2.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ const FooterV2 = () => (
<ul className="footer-links">
<li><a href="https://www.topcoder.com/about-topcoder/" target="_blank">About</a></li>
<li><a href="https://www.topcoder.com/about-topcoder/contact/" target="_blank">Contact</a></li>
<li><a href="https://help.topcoder.com/hc/en-us" target="_blank">Help</a></li>
<li><a href="https://help.topcoder.com/hc/en-us/articles/225540188-Topcoder-Connect-FAQs" target="_blank">Help</a></li>
<li><a href="https://www.topcoder.com/community/how-it-works/privacy-policy/" target="_blank">Privacy</a></li>
<li><a href="https://connect.topcoder.com/terms">Terms</a></li>
</ul>
Expand Down
5 changes: 3 additions & 2 deletions src/components/MessageList/MessageList.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,9 @@ class MessageList extends Component {
componentDidMount() {
const { scrollPosition } = this.props
const panelMessages = this.refs.panelMessages
// 145 = 60 for topbar + 45 for panel title + 20px for margin between topbar and left panel + 10px padding
panelMessages.style.height = (window.innerHeight - 145) + 'px'
// 215 = 60 for topbar + 45 for panel title + 20px for margin between topbar and left panel + 10px padding
// + 60px footer + 10px margin bw footer and left panel
panelMessages.style.height = (window.innerHeight - 215) + 'px'
if (scrollPosition) {
// We use requestAnimationFrame because this function may be executed before
// the DOM elements are actually drawn.
Expand Down
4 changes: 4 additions & 0 deletions src/components/TeamManagement/TeamManagement.scss
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,10 @@ $tc-body-extra-small : 12px;
}
}

input::-ms-clear {
display: none;
}

.modal-inline-form{
display: flex;
margin-bottom: $base-unit*2;
Expand Down
4 changes: 2 additions & 2 deletions src/components/TopBar/TopBar.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import cn from 'classnames'
import _ from 'lodash'
import { UserDropdown, Icons } from 'appirio-tech-react-components'

const { ConnectLogoBeta } = Icons
const { ConnectLogo } = Icons
import { SearchBar } from 'appirio-tech-react-components'
import Filters from './Filters'
import ProjectToolBar from './ProjectToolBar'
Expand Down Expand Up @@ -67,7 +67,7 @@ class TopBar extends Component {
]
const logo = (
<div className="logo-wrapper">
<Link className="logo" to={logoTargetUrl} target="_self"><ConnectLogoBeta /></Link>
<Link className="logo" to={logoTargetUrl} target="_self"><ConnectLogo /></Link>
</div>
)
const avatar = (
Expand Down
27 changes: 24 additions & 3 deletions src/projects/detail/Dashboard.jsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
import React from 'react'
import { connect } from 'react-redux'
import ProjectInfoContainer from './containers/ProjectInfoContainer'
import FeedContainer from './containers/FeedContainer'
import Sticky from 'react-stickynode'
import spinnerWhileLoading from '../../components/LoadingSpinner'

require('./Dashboard.scss')

const Dashboard = ({project, currentMemberRole}) => (
const DashboardView = ({project, currentMemberRole, route}) => (
<div>
<div className="dashboard-container">
<div className="left-area">
Expand All @@ -16,10 +18,29 @@ const Dashboard = ({project, currentMemberRole}) => (
</Sticky>
</div>
<div className="right-area">
<FeedContainer currentMemberRole={currentMemberRole} project={project} />
<FeedContainer currentMemberRole={currentMemberRole} project={project} route={route} />
</div>
</div>
</div>
)

export default Dashboard
const enhance = spinnerWhileLoading(props => !props.isLoading)
const EnhancedDashboardView = enhance(DashboardView)

class Dashboard extends React.Component {
constructor(props) {
super(props)
}

render() {
return <EnhancedDashboardView {...this.props} />
}
}

const mapStateToProps = ({ projectState }) => {
return {
isLoading : projectState.isLoading
}
}

export default connect(mapStateToProps)(Dashboard)
9 changes: 7 additions & 2 deletions src/projects/detail/Messages.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,12 @@ import MessagesContainer from './containers/MessagesContainer'

require('./Messages.scss')

const Messages = ({ location, project, currentMemberRole }) => (
<MessagesContainer location={ location } project={ project } currentMemberRole={ currentMemberRole } />
const Messages = ({ location, project, currentMemberRole, route }) => (
<MessagesContainer
location={ location }
project={ project }
currentMemberRole={ currentMemberRole }
route={ route }
/>
)
export default Messages
3 changes: 2 additions & 1 deletion src/projects/detail/Messages.scss
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,13 @@
@include flexBox;
max-width: 1110px;
margin: 20px auto;
height: calc(100% - 20px);// 20px is for bottom margin
height: calc(100% - 80px);// 20px is for bottom margin, 60px for footer

.left-area {
@include flexWidth(1);
max-width: 360px;
z-index: 14;/* Don't know the exact reason, but it needs explicit z-index to get behind the topbar*/
transform: translate3d(0px, 0px, 0px);
}
.right-area {
@include flexWidth(2);
Expand Down
55 changes: 50 additions & 5 deletions src/projects/detail/containers/FeedContainer.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import React, { PropTypes } from 'react'
import { withRouter } from 'react-router'
import _ from 'lodash'
import {
THREAD_MESSAGES_PAGE_SIZE,
Expand Down Expand Up @@ -36,7 +37,16 @@ class FeedView extends React.Component {
this.onNewCommentChange = this.onNewCommentChange.bind(this)
this.onShowAllComments = this.onShowAllComments.bind(this)
this.onAddNewComment = this.onAddNewComment.bind(this)
this.state = { feeds : [], showAll: [] }
this.onLeave = this.onLeave.bind(this)
this.isChanged = this.isChanged.bind(this)
this.onNewPostChange = this.onNewPostChange.bind(this)
this.state = { feeds : [], showAll: [], newPost: {} }
}

componentDidMount() {
const routeLeaveHook = this.props.router.setRouteLeaveHook(this.props.route, this.onLeave)
window.addEventListener('beforeunload', this.onLeave)
this.setState({ routeLeaveHook })
}

componentWillMount() {
Expand All @@ -47,7 +57,28 @@ class FeedView extends React.Component {
this.init(nextProps)
}

mapFeed(feed, showAll = false) {
componentWillUnmount() {
if (this.state.routeLeaveHook) {
this.state.routeLeaveHook()
}
window.removeEventListener('beforeunload', this.onLeave)
}

// Notify user if they navigate away while the form is modified.
onLeave(e) {
if (this.isChanged()) {
return e.returnValue = 'You have uposted content. Are you sure you want to leave?'
}
}

isChanged() {
const { newPost } = this.state
const hasComment = !_.isUndefined(_.find(this.state.feeds, (feed) => feed.newComment && feed.newComment.length))
const hasThread = (newPost.title && !!newPost.title.trim().length) || ( newPost.content && !!newPost.content.trim().length)
return hasThread || hasComment
}

mapFeed(feed, showAll = false, resetNewComment = false) {
const { allMembers } = this.props
const item = _.pick(feed, ['id', 'date', 'read', 'tag', 'title', 'totalPosts', 'userId', 'reference', 'referenceId', 'postIds', 'isAddingComment', 'isLoadingComments', 'error'])
if (isSystemUser(item.userId)) {
Expand All @@ -72,20 +103,27 @@ class FeedView extends React.Component {
author: isSystemUser(p.userId) ? SYSTEM_USER : allMembers[p.userId]
}
}
const validPost = (post) => {
return post.type === 'post' && (post.body && post.body.trim().length || !isSystemUser(post.userId))
}
if (showAll) {
// if we are showing all comments, just iterate through the entire array
_.forEach(_.slice(feed.posts, 1), p => {
p.type === 'post' ? item.comments.push(_toComment(p)) : item.totalComments--
validPost(p) ? item.comments.push(_toComment(p)) : item.totalComments--
})
} else {
// otherwise iterate from right and add to the beginning of the array
_.forEachRight(_.slice(feed.posts, 1), (p) => {
p.type === 'post' ? item.comments.unshift(_toComment(p)) : item.totalComments--
validPost(p) ? item.comments.unshift(_toComment(p)) : item.totalComments--
if (!feed.showAll && item.comments.length === THREAD_MESSAGES_PAGE_SIZE)
return false
})
}
item.newComment = ''
if (!resetNewComment) {
const feedFromState = _.find(this.state.feeds, f => feed.id === f.id)
item.newComment = feedFromState ? feedFromState.newComment : ''
}
item.hasMoreComments = item.comments.length !== item.totalComments
return item
}
Expand All @@ -99,6 +137,12 @@ class FeedView extends React.Component {
})
}

onNewPostChange(title, content) {
this.setState({
newPost: {title, content}
})
}

onNewPost({title, content}) {
const { project } = this.props
const newFeed = {
Expand Down Expand Up @@ -194,6 +238,7 @@ class FeedView extends React.Component {
isCreating={ isCreatingFeed }
hasError={ error }
heading="NEW STATUS POST"
onNewPostChange={this.onNewPostChange}
titlePlaceholder="Share the latest project updates with the team"
/>
}
Expand All @@ -203,7 +248,7 @@ class FeedView extends React.Component {
}
}
const enhance = spinnerWhileLoading(props => !props.isLoading)
const EnhancedFeedView = enhance(FeedView)
const EnhancedFeedView = withRouter(enhance(FeedView))


class FeedContainer extends React.Component {
Expand Down
Loading