Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
2d821c8
Github issue#802, can add more screen
Mar 20, 2017
f89c2fb
Github issue#9, Add favicon.ico
Mar 30, 2017
56c98de
Merge pull request #872 from appirio-tech/feature/favicon_fix
Mar 30, 2017
03a1815
Github issue#405, White spaces are recognized as valid input for NOTES
Apr 5, 2017
dff9936
Merge pull request #878 from appirio-tech/feature/white-space-in-notes
Apr 5, 2017
d25d9c2
Merge pull request #877 from appirio-tech/hotfix/project-list-sort-be…
parthshah Apr 5, 2017
922b805
moving best match to the top of the sort list
Apr 5, 2017
e21205e
Github issue#682, Permalink for status post and discussions message
Apr 6, 2017
e5f4251
Github issue#880, Features changes are not reflected in side panel wi…
Apr 6, 2017
4ef06aa
Fixed lint errors
Apr 7, 2017
3cc6607
Merge branch 'dev' into feature/number_of_screens_valiation_802
Apr 7, 2017
5efbe9e
Merge branch 'hotfix/no_permissions_immediately_after_joining_project…
Apr 14, 2017
999d128
Github issue#682, Permalink for status post and discussions message
Apr 25, 2017
ca03722
Merge branch 'dev' into feature/permalink_for_feeds_messages
Apr 25, 2017
3fa0e39
Github issue#682, Permalink for status post and discussions message
Apr 25, 2017
5e395fd
trying deploying feature branch
Apr 25, 2017
715de01
Github issue#682, Permalink for status post and discussions message
Apr 25, 2017
380ba68
Merge branch 'dev' into feature/number_of_screens_valiation_802
May 2, 2017
c84b030
Merge pull request #863 from appirio-tech/feature/number_of_screens_v…
May 2, 2017
95236fa
Merge branch 'dev' into feature/features_change_no_reflected_without_…
May 2, 2017
f0cad50
Github issue#880, Features changes are not reflected in side panel wi…
May 3, 2017
b837273
Merge pull request #883 from appirio-tech/feature/features_change_no_…
May 3, 2017
cead9f6
Merge branch 'dev' into feature/permalink_for_feeds_messages
May 11, 2017
2a0e71a
Removed feature branch from deployable branches.
May 25, 2017
5259da5
Merge pull request #882 from appirio-tech/feature/permalink_for_feeds…
May 25, 2017
538487c
MESSAGING UPDATES
liuliquan Jun 24, 2017
1d3815d
Remove challenge related files
gondzo Jun 30, 2017
1a60fe4
Merge branch 'liuliquan-feature/messageEditDelete' into feature/messa…
gondzo Jun 30, 2017
859b52d
Fixes for #938,939,940,942,944
gondzo Jul 10, 2017
419aae4
Fix lint errors
gondzo Jul 10, 2017
3c32360
Fix null state error
gondzo Jul 10, 2017
1c84640
Fix z index in discussions
gondzo Jul 10, 2017
ad26f70
Fix word wrap in posts
gondzo Jul 10, 2017
5106ed4
Fix styles
gondzo Jul 11, 2017
aadf310
Fix styles for message delete dialog
gondzo Jul 11, 2017
f1dd4ca
Merge branch 'master' into feature/messageEditDelete
gondzo Jul 13, 2017
96af853
remove unused import
gondzo Jul 13, 2017
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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@ bower_components
build
dist
npm-debug.log
.history
4 changes: 4 additions & 0 deletions docs/dependency-notes.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@

This document outlines the dependency concerns faced during the development of the application.

1. We have overridden the version to 1.1.2 of to-ico library which is used indirectly by "favicon-webpack-plugin" which in turn is used for generating the favicons for different devices and browser combinations. This was required because with versions above 1.1.2 to-ico library is using some features from node v5.10+.
5 changes: 4 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@
"deep-freeze-node": "^1.1.2",
"eslint": "^2.2.0",
"eslint-plugin-react": "^4.1.0",
"favicons-webpack-plugin": "0.0.7",
"to-ico": "1.1.2",
"ignore-styles": "^1.2.0",
"mocha": "^2.4.5",
"mocha-jsdom": "^1.1.0",
Expand All @@ -34,8 +36,9 @@
"axios": "^0.13.1",
"classnames": "^2.2.3",
"draft-js": "^0.7.0",
"draft-js-export-html": "^0.4.0",
"draft-js-export-html": "^0.5.0",
"draft-js-export-markdown": "^0.2.1",
"draft-js-import-html": "^0.3.2",
"fbemitter": "^2.1.1",
"filepicker-js": "^2.4.17",
"filesize": "^3.3.0",
Expand Down
49 changes: 43 additions & 6 deletions src/api/messages.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import _ from 'lodash'
import { axiosInstance as axios } from './requestInterceptor'
import { TC_API_URL } from '../config/constants'
import { CONNECT_MESSAGE_API_URL } from '../config/constants'

const timeout = 1.5 * 60 * 1000

export function getTopics(criteria) {
const params = {}
Expand All @@ -12,7 +14,7 @@ export function getTopics(criteria) {
params.filter = filterStr.join('&')
}

return axios.get(`${TC_API_URL}/v4/topics/`, { params })
return axios.get(`${CONNECT_MESSAGE_API_URL}/v4/topics/`, { params })
.then( resp => {
return {
totalCount: _.get(resp.data, 'result.metadata.totalCount', 0),
Expand All @@ -22,7 +24,7 @@ export function getTopics(criteria) {
}

export function getTopic(topicId) {
return axios.get(`${TC_API_URL}/v4/topics/${topicId}`)
return axios.get(`${CONNECT_MESSAGE_API_URL}/v4/topics/${topicId}`)
.then( resp => {
return {
totalCount: _.get(resp.data, 'result.metadata.totalCount', 0),
Expand All @@ -34,7 +36,7 @@ export function getTopic(topicId) {

export function getTopicPosts(topicId, postIds) {
const params = { postIds : postIds.join(',') }
return axios.get(`${TC_API_URL}/v4/topics/${topicId}/posts`, { params })
return axios.get(`${CONNECT_MESSAGE_API_URL}/v4/topics/${topicId}/posts`, { params })
.then( resp => {
return {
totalCount: _.get(resp.data, 'result.metadata.totalCount', 0),
Expand All @@ -45,16 +47,32 @@ export function getTopicPosts(topicId, postIds) {
}

export function createTopic(topicProps) {
return axios.post(`${TC_API_URL}/v4/topics/`, topicProps, { timeout: 1.5 * 60 * 1000 })
return axios.post(`${CONNECT_MESSAGE_API_URL}/v4/topics/`, topicProps, { timeout })
.then( resp => {
return _.get(resp.data, 'result.content', {})
})
}

export function saveTopic(topicId, topicProps) {
return axios.post(`${CONNECT_MESSAGE_API_URL}/v4/topics/${topicId}/edit`, topicProps, { timeout })
.then( resp => {
return _.get(resp.data, 'result.content', {})
})
}

export function deleteTopic(topicId) {
return axios.delete(`${CONNECT_MESSAGE_API_URL}/v4/topics/${topicId}`, null, { timeout } )
.then( resp => {
return {
result : _.get(resp.data, 'result.content', {})
}
})
}

// ignore resp
/*eslint-disable no-unused-vars */
export function addTopicPost(topicId, post) {
return axios.post(`${TC_API_URL}/v4/topics/${topicId}/posts`, { post: post.content }, { timeout: 1.5 * 60 * 1000 } )
return axios.post(`${CONNECT_MESSAGE_API_URL}/v4/topics/${topicId}/posts`, { post: post.content }, { timeout } )
.then( resp => {
return {
topicId,
Expand All @@ -63,3 +81,22 @@ export function addTopicPost(topicId, post) {
})
}
/*eslint-enable*/

export function saveTopicPost(topicId, post) {
return axios.post(`${CONNECT_MESSAGE_API_URL}/v4/topics/${topicId}/posts/${post.id}/edit`, { post: post.content }, { timeout } )
.then( resp => {
return {
topicId,
comment : _.get(resp.data, 'result.content', {})
}
})
}

export function deleteTopicPost(topicId, postId) {
return axios.delete(`${CONNECT_MESSAGE_API_URL}/v4/topics/${topicId}/posts/${postId}`, null, { timeout } )
.then( resp => {
return {
result : _.get(resp.data, 'result.content', {})
}
})
}
16 changes: 16 additions & 0 deletions src/assets/images/arrows-16px-3_small-down.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
17 changes: 17 additions & 0 deletions src/assets/images/ui-16px-1_edit-73.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
101 changes: 87 additions & 14 deletions src/components/ActionCard/ActionCard.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ import React, {PropTypes} from 'react'
import './ActionCard.scss'
import Panel from '../Panel/Panel'
import cn from 'classnames'
import CommentEditToggle from './CommentEditToggle'
import RichTextArea from '../RichTextArea/RichTextArea'

const ActionCard = ({children, className}) => (
<Panel className={cn('action-card', className)}>
Expand All @@ -14,25 +16,96 @@ ActionCard.propTypes = {
className: PropTypes.string
}

const Header = ({children, title}) => (
<div className="panel-body">
<div className="portrait">
&nbsp;
</div>
<div className="object">
<div className="card-header">
<div className="card-title">
{title}
class Header extends React.Component{
constructor(props) {
super(props)
this.state = {editTopicMode: false}
this.onEditTopic = this.onEditTopic.bind(this)
this.cancelEditTopic = this.cancelEditTopic.bind(this)
this.onTopicChange = this.onTopicChange.bind(this)
this.onSaveTopic = this.onSaveTopic.bind(this)
}

componentWillReceiveProps(nextProps) {
this.setState({editTopicMode: nextProps.editTopicMode})
}

onEditTopic() {
this.setState({editTopicMode: true})
this.props.onTopicChange(this.props.topicMessage.id, null, null, true)
}
cancelEditTopic() {
this.setState({editTopicMode: false})
this.props.onTopicChange(this.props.topicMessage.id, null, null, false)
}
onTopicChange(title, content) {
this.props.onTopicChange(this.props.topicMessage.id, title, content, true)
}
onSaveTopic({title, content}) {
this.props.onSaveTopic(this.props.topicMessage.id, title, content)
}

render() {
if (this.state.editTopicMode) {
const { topicMessage } = this.props
const title = this.props.newTitle === null || this.props.newTitle === undefined ? this.props.title : this.props.newTitle
const content = topicMessage.newContent === null || topicMessage.newContent === undefined ? topicMessage.content : topicMessage.newContent
return (
<RichTextArea
editMode
title={title}
content={content}
oldTitle={this.props.title}
oldContent={topicMessage.content}
onPost={this.onSaveTopic}
onPostChange={this.onTopicChange}
isCreating={this.props.isSavingTopic}
hasError={this.props.error}
avatarUrl={this.props.avatarUrl}
authorName={this.props.authorName}
cancelEdit={this.cancelEditTopic}
/>
)
}

return (
<div className="panel-body">
<div className="portrait">
&nbsp;
</div>
<div className="object">
<div className="card-header">
<div className="card-title">
<div>{this.props.title}</div>
{this.props.self && (
<CommentEditToggle
forTopic
hideDelete={this.props.hideDelete}
onEdit={this.onEditTopic}
onDelete={this.props.onDeleteTopic}
/>
)}
</div>
</div>
{this.props.children}
</div>
</div>
{children}
</div>
</div>
)
)
}
}

Header.propTypes = {
children: PropTypes.any.isRequired,
title: PropTypes.string.isRequired
title: PropTypes.string.isRequired,
authorName: PropTypes.string.isRequired,
avatarUrl: PropTypes.string,
onTopicChange: PropTypes.func.isRequired,
onSaveTopic: PropTypes.func.isRequired,
onDeleteTopic: PropTypes.func.isRequired,
hideDelete: PropTypes.bool,
self: PropTypes.bool,
isSavingTopic: PropTypes.bool,
error: PropTypes.bool
}

ActionCard.Header = Header
Expand Down
Loading