Skip to content
Merged

Cf16 #2964

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
56 commits
Select commit Hold shift + click to select a range
737b25c
fixes issue 2856
sumitdaga Apr 11, 2019
f773d8b
fixes issue 2903
sumitdaga Apr 11, 2019
a5452e7
use attachment id instead of attachment index
mfikria Apr 11, 2019
0744bc8
Fix for issue #2933
codeMinter Apr 11, 2019
d769005
issue2935 fix
rashmi73 Apr 11, 2019
8584b2d
issue 2900 fix
PrakashDurlabhji Apr 11, 2019
da866f9
issue 2710 fix
Gauravseta Apr 11, 2019
08d7e3c
Update project.js
rashmi73 Apr 11, 2019
8339d74
issue 2575
sumitdaga Apr 12, 2019
4f476ab
updated url
sumitdaga Apr 12, 2019
c03ab63
open upload attachment directly
mfikria Apr 12, 2019
fcfbec4
fix for issue #2927
codeMinter Apr 12, 2019
47cb72a
proptypes and default value
sumitdaga Apr 13, 2019
eedc73d
issue 2916 fix
rashmi73 Apr 13, 2019
dec0f0c
issue 2791 fixed
Gauravseta Apr 13, 2019
05dab4f
Merge pull request #2948 from sumitdaga/issue-2575
maxceem Apr 15, 2019
5f1a632
Merge pull request #2940 from sumitdaga/issue-2856
maxceem Apr 15, 2019
34415e3
handles unbalanced closing parenthesis
sumitdaga Apr 15, 2019
ff15262
Merge pull request #2941 from sumitdaga/issue-2903
maxceem Apr 15, 2019
4691058
Merge pull request #2942 from mfikria/cf16-2938
maxceem Apr 15, 2019
de56402
Merge pull request #2945 from PrakashDurlabhji/issue_2900
maxceem Apr 15, 2019
9f06d86
incorporate review comments for issue #2933
codeMinter Apr 15, 2019
635cc25
Merge branch 'cf16' into cf16-2897
mfikria Apr 15, 2019
83696a5
fix lint issues for issue #2933
codeMinter Apr 15, 2019
6b3a344
Merge pull request #2943 from gurmeetb/issue_2933
maxceem Apr 15, 2019
3689009
Merge pull request #2950 from mfikria/cf16-2897
maxceem Apr 15, 2019
22acbab
fix for issue #2934
codeMinter Apr 15, 2019
b523867
issue 2935 minor changes
rashmi73 Apr 15, 2019
030a6fa
issue 2899 invites array check
rashmi73 Apr 15, 2019
364e798
issue 2710 patch
Gauravseta Apr 15, 2019
93987b9
Merge pull request #2946 from Gauravseta/issue_2710
maxceem Apr 16, 2019
6314bc4
Merge pull request #2944 from rashmi73/issue_2935
maxceem Apr 16, 2019
9667e92
Merge pull request #2947 from rashmi73/issue_2899
maxceem Apr 16, 2019
bba801e
fix for issue #2927
codeMinter Apr 16, 2019
2a83461
Merge pull request #2951 from gurmeetb/issue_2927
maxceem Apr 16, 2019
b61abb4
Merge pull request #2954 from Gauravseta/issue_2791
maxceem Apr 16, 2019
3df2c91
fix for issue 2180
sumitdaga Apr 16, 2019
10b0c69
move load earlier posts down for issue #2934
codeMinter Apr 16, 2019
692ec61
issue 2916 patch
rashmi73 Apr 16, 2019
ca990dd
lint fix
rashmi73 Apr 16, 2019
07446aa
Merge pull request #5 from appirio-tech/cf16
PrakashDurlabhji Apr 16, 2019
4e6aaa5
issue 2896 fix
PrakashDurlabhji Apr 16, 2019
e295b3b
Merge pull request #2956 from gurmeetb/issue_2934
maxceem Apr 17, 2019
d069026
issue 2916 fix
rashmi73 Apr 17, 2019
54418fd
private background-color, filter feeds
sumitdaga Apr 17, 2019
dc2e8fb
comment fix
sumitdaga Apr 17, 2019
67121fe
background when creating private post
sumitdaga Apr 17, 2019
5c6c75a
Merge pull request #2953 from rashmi73/issue_2916
maxceem Apr 17, 2019
0908983
Merge pull request #2957 from sumitdaga/issue-2180
maxceem Apr 17, 2019
504f885
Merge branch 'cf16' of https://github.com/appirio-tech/connect-app in…
PrakashDurlabhji Apr 17, 2019
cb89811
issue 2896 with attachment id
PrakashDurlabhji Apr 17, 2019
0277743
fix allFeedCount, load private posts only for users with permissions,…
maxceem Apr 18, 2019
6f3178f
issue 2896 patch
PrakashDurlabhji Apr 18, 2019
d0e92b3
Merge branch 'cf16' of https://github.com/appirio-tech/connect-app in…
PrakashDurlabhji Apr 18, 2019
877b830
Merge pull request #2959 from PrakashDurlabhji/issue_2896_1
maxceem Apr 19, 2019
fa9b817
fix file uploading after removing
maxceem Apr 19, 2019
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
10,350 changes: 5,173 additions & 5,177 deletions package-lock.json

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions src/assets/icons/lock.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
12 changes: 10 additions & 2 deletions src/components/ActionCard/Comment.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,8 @@ class Comment extends React.Component {
}

render() {
const {message, author, date, edited, children, noInfo, self, isSaving, hasError, readonly, allMembers, canDelete, projectMembers} = this.props
const messageAnchor = `comment-${message.id}`
const {message, author, date, edited, children, noInfo, self, isSaving, hasError, readonly, allMembers, canDelete, projectMembers, commentAnchorPrefix} = this.props
const messageAnchor = commentAnchorPrefix + message.id
const messageLink = window.location.pathname.substr(0, window.location.pathname.indexOf('#')) + `#${messageAnchor}`
const authorName = author ? (author.firstName + ' ' + author.lastName) : 'Connect user'
const avatarUrl = _.get(author, 'photoURL', null)
Expand Down Expand Up @@ -141,6 +141,10 @@ class Comment extends React.Component {
}
}

Comment.defaultProps = {
commentAnchorPrefix: 'comment-',
}

Comment.propTypes = {
/**
* The author (user object)
Expand Down Expand Up @@ -204,6 +208,10 @@ Comment.propTypes = {
* The can delete flag
*/
canDelete: PropTypes.bool,
/**
* The prefix for comment anchor
*/
commentAnchorPrefix: PropTypes.string,
}

export default Comment
10 changes: 7 additions & 3 deletions src/components/Feed/Feed.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,11 @@ import CommentEditToggle from '../ActionCard/CommentEditToggle'
import RichTextArea from '../RichTextArea/RichTextArea'
import NotificationsReader from '../../components/NotificationsReader'

import { EVENT_TYPE } from '../../config/constants'
import { EVENT_TYPE, PROJECT_FEED_TYPE_MESSAGES } from '../../config/constants'

import XMarkIcon from '../../assets/icons/x-mark.svg'
import FullscreenIcon from '../../assets/icons/ui-fullscreen.svg'
import LockIcon from '../../assets/icons/lock.svg'

import './Feed.scss'

Expand Down Expand Up @@ -86,7 +87,7 @@ class Feed extends React.Component {
id, user, currentUser, topicMessage, totalComments, hasMoreComments, onLoadMoreComments, isLoadingComments,
allowComments, comments, children, onNewCommentChange, onAddNewComment, isAddingComment, onSaveMessageChange,
onEditMessage, onSaveMessage, isSavingTopic, onDeleteMessage, onDeleteTopic, isDeletingTopic, error, allMembers,
onEnterFullscreenClick, onExitFullscreenClick, isFullScreen, commentId, projectMembers
onEnterFullscreenClick, onExitFullscreenClick, isFullScreen, commentId, projectMembers, commentAnchorPrefix, tag
} = this.props
const { editTopicMode, headerHeight } = this.state
let authorName = user ? user.firstName : 'Unknown'
Expand All @@ -101,7 +102,7 @@ class Feed extends React.Component {
const content = topicMessage.newContent === null || topicMessage.newContent === undefined ? topicMessage.rawContent : topicMessage.newContent

topicHeader = (
<header styleName="feed-header" ref="header">
<header styleName={'feed-header' + (tag === PROJECT_FEED_TYPE_MESSAGES ? ' is-private' : '' )} ref="header">
<NotificationsReader
id={`topic-${id}`}
criteria={{ eventType: EVENT_TYPE.TOPIC.CREATED, contents: { topicId: id } }}
Expand All @@ -127,6 +128,7 @@ class Feed extends React.Component {
) : (
<div styleName="header-view">
<div styleName="header-view-inner">
{tag === PROJECT_FEED_TYPE_MESSAGES && <div styleName="lock-icon"><LockIcon /></div>}
<div styleName="header-info">
<div styleName="title">{title}</div>
<div styleName="header-details">
Expand Down Expand Up @@ -182,6 +184,7 @@ class Feed extends React.Component {
headerHeight={headerHeight}
commentId={commentId}
error={error}
commentAnchorPrefix={commentAnchorPrefix}
/>
{children}
{isDeletingTopic &&
Expand Down Expand Up @@ -223,6 +226,7 @@ Feed.propTypes = {
isSavingTopic: PropTypes.bool,
onEnterFullscreenClick: PropTypes.func,
isFullScreen: PropTypes.bool,
commentAnchorPrefix: PropTypes.string,
}

export default Feed
8 changes: 8 additions & 0 deletions src/components/Feed/Feed.scss
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@
background-color: $tc-gray-neutral-light;
border-radius: $card-border-radius $card-border-radius 0 0;

&.is-private {
background-color: $tc-orange-10;
}

.is-fullscreen & {
border-radius: 0;
position: fixed;
Expand Down Expand Up @@ -75,6 +79,10 @@
justify-content: space-between;
}

.lock-icon {
margin: $base-unit / 2 4 * $base-unit 0 0;
}

.title {
@include roboto;
color: $tc-black;
Expand Down
15 changes: 10 additions & 5 deletions src/components/Feed/FeedComments.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -177,10 +177,13 @@ class FeedComments extends React.Component {

render() {
const {
comments, currentUser, onLoadMoreComments, isLoadingComments, hasMoreComments, onAddNewComment,
currentUser, onLoadMoreComments, isLoadingComments, hasMoreComments, onAddNewComment,
onNewCommentChange, error, avatarUrl, isAddingComment, allowComments, onSaveMessage, onDeleteMessage, allMembers,
totalComments, isFullScreen, headerHeight, projectMembers
totalComments, isFullScreen, headerHeight, projectMembers, commentAnchorPrefix
} = this.props
let { comments } = this.props
comments = _.sortBy(comments, 'createdBy')
comments = comments.reverse()
const { isNewCommentMobileOpen, stickyRowNext, stickyRowPrev } = this.state
let authorName = currentUser.firstName
if (authorName && currentUser.lastName) {
Expand Down Expand Up @@ -322,6 +325,7 @@ class FeedComments extends React.Component {
projectMembers={projectMembers}
noInfo={item.noInfo}
canDelete={idx !== 0}
commentAnchorPrefix={commentAnchorPrefix}
>
<div dangerouslySetInnerHTML={{__html: markdownToHTML(itemContent)}} />
</Comment>
Expand Down Expand Up @@ -370,14 +374,14 @@ class FeedComments extends React.Component {
{(matches) => (matches ? (
<div>
<div styleName="comments">
{commentRows}
{hasMoreComments &&
<div styleName="load-more" key="load-more">
<a href="javascript:" onClick={ handleLoadMoreClick } styleName="load-btn">
{isLoadingComments ? 'Loading...' : 'load earlier posts'}
</a>
</div>
}
{commentRows}
</div>
{allowComments &&
<div styleName="add-comment" key="add-comment">
Expand Down Expand Up @@ -435,10 +439,11 @@ class FeedComments extends React.Component {
}
}
FeedComments.defaultProps = {
comments: []
comments: [],
}
FeedComments.propTypes = {
comments: PropTypes.array
comments: PropTypes.array,
commentAnchorPrefix: PropTypes.string,
}

export default FeedComments
6 changes: 4 additions & 2 deletions src/components/Feed/NewPost.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ class NewPost extends React.Component {
}

render() {
const {currentUser, allMembers, titlePlaceholder, contentPlaceholder, isCreating, hasError, expandedTitlePlaceholder, projectMembers} = this.props
const {currentUser, allMembers, titlePlaceholder, contentPlaceholder, isCreating, hasError, expandedTitlePlaceholder, projectMembers, canAccessPrivatePosts} = this.props
let authorName = currentUser.firstName
if (authorName && currentUser.lastName) {
authorName += ' ' + currentUser.lastName
Expand All @@ -39,6 +39,7 @@ class NewPost extends React.Component {
authorName={authorName}
allMembers={allMembers}
projectMembers={projectMembers}
hasPrivateSwitch={canAccessPrivatePosts}
/>
)
}
Expand All @@ -53,7 +54,8 @@ NewPost.propTypes = {
onPost: PropTypes.func.isRequired,
onNewPostChange: PropTypes.func.isRequired,
hasError: PropTypes.bool,
isCreating: PropTypes.bool
isCreating: PropTypes.bool,
canAccessPrivatePosts: PropTypes.bool,
}

export default NewPost
22 changes: 17 additions & 5 deletions src/components/Feed/NewPostMobile.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import React from 'react'
import PropTypes from 'prop-types'
import MobilePage from '../MobilePage/MobilePage'

import SwitchButton from 'appirio-tech-react-components/components/SwitchButton/SwitchButton'
import XMartIcon from '../../assets/icons/x-mark.svg'
import './NewPostMobile.scss'

Expand All @@ -32,7 +33,8 @@ class NewPostMobile extends React.Component {
step: props.step,
statusValue: '',
commentValue: '',
browserActualViewportHeigth: document.documentElement.clientHeight
browserActualViewportHeigth: document.documentElement.clientHeight,
isPrivate: false
}

this.setStep = this.setStep.bind(this)
Expand Down Expand Up @@ -80,9 +82,9 @@ class NewPostMobile extends React.Component {
render() {
const {
statusTitle, commentTitle, commentPlaceholder, submitText, onPost, onClose,
isCreating, nextStepText, statusPlaceholder
isCreating, nextStepText, statusPlaceholder, canAccessPrivatePosts
} = this.props
const { step, statusValue, commentValue, browserActualViewportHeigth } = this.state
const { step, statusValue, commentValue, browserActualViewportHeigth, isPrivate } = this.state

let value
let title
Expand All @@ -104,15 +106,24 @@ class NewPostMobile extends React.Component {
placeholder = commentPlaceholder
onBtnClick = () => onPost({
title: statusValue,
content: commentValue
content: commentValue,
isPrivate
})
btnText = submitText
}

return (
<MobilePage>
<div styleName="header">
<div styleName="plug" />
{canAccessPrivatePosts ?
<SwitchButton
name="private-post"
onChange={(evt) => this.setState({isPrivate: evt.target.checked})}
checked={isPrivate}
label="Private"
/> :
<div styleName="plug" />
}
<div styleName="title">{title}</div>
<div styleName="close-wrapper"><XMartIcon onClick={onClose} /></div>
</div>
Expand Down Expand Up @@ -153,6 +164,7 @@ NewPostMobile.propTypes = {
onClose: PropTypes.func.isRequired,
isCreating: PropTypes.bool,
hasError: PropTypes.bool,
canAccessPrivatePosts: PropTypes.bool,
}

export default NewPostMobile
15 changes: 14 additions & 1 deletion src/components/Feed/NewPostMobile.scss
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,18 @@
justify-content: space-between;
height: 50px;
padding: 0 $base-unit * 3;

:global {

.SwitchButton label {
margin: 0;

.label {
padding: 0 0 0 10px;
order: 1;
}
}
}
}

.title {
Expand All @@ -21,13 +33,14 @@
align-items: center;
display: flex;
justify-content: flex-end;
margin-left: 59px;
> svg {
fill: $tc-gray-neutral-light;
}
}

.plug {
width: 16px; /* same width as close button to align center title */
width: 83px; /* same width as close button to align center title */
}

.body {
Expand Down
30 changes: 30 additions & 0 deletions src/components/LinksMenu/DeleteFileLinkModal.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
import React from 'react'
import PropTypes from 'prop-types'

const DeleteFileLinkModal = ({ onCancel, onConfirm}) => {
return (
<div className="modal delete-link-modal">
<div className="modal-title danger">
You're about to delete a File
</div>
<div className="modal-body">
<p className="message">
Your team might need this link, are you sure you want to delete it? This action can't be undone.
</p>

<div className="button-area flex center">
<button className="tc-btn tc-btn-default tc-btn-sm btn-cancel" onClick={onCancel}>Cancel</button>
<button className="tc-btn tc-btn-warning tc-btn-sm" onClick={onConfirm}>Delete file</button>
</div>
</div>
</div>
)
}

DeleteFileLinkModal.propTypes = {
onCancel: PropTypes.func.isRequired,
onConfirm: PropTypes.func.isRequired
// link: PropTypes.object.isRequired
}

export default DeleteFileLinkModal
Loading