Skip to content

Commit 602be86

Browse files
author
vikasrohit
authored
Merge pull request #1331 from appirio-tech/feature/project-listing-updates
Feature/project listing updates
2 parents b56e8b9 + d417631 commit 602be86

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

58 files changed

+1722
-641
lines changed

npm-shrinkwrap.json

Lines changed: 208 additions & 111 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@
7777
"lodash": "^4.16.4",
7878
"moment": "^2.14.1",
7979
"query-string": "^4.3.4",
80+
"rc-slider": "^8.3.5",
8081
"react": "^15.6.1",
8182
"react-addons-css-transition-group": "^15.6.0",
8283
"react-addons-pure-render-mixin": "^15.6.0",
@@ -85,6 +86,7 @@
8586
"react-datetime": "2.7.1",
8687
"react-dom": "^15.6.1",
8788
"react-dotdotdot": "^1.0.4",
89+
"react-infinite-scroller": "^1.1.1",
8890
"react-layout-pane": "^0.1.16",
8991
"react-modal": "^1.9.7",
9092
"react-redux": "^4.4.5",

src/assets/images/ps-active.svg

100755100644
Lines changed: 7 additions & 42 deletions
Loading

src/components/AvatarGroup/AvatarGroup.scss

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,8 @@
22

33
.AvatarGroup {
44
display: flex;
5+
6+
.Avatar + .Avatar {
7+
margin-left: $base_unit;
8+
}
59
}

src/components/ProjectInfo/ProjectCardBody.jsx

Lines changed: 0 additions & 51 deletions
This file was deleted.

src/components/ProjectInfo/ProjectCardBody.scss

Lines changed: 0 additions & 39 deletions
This file was deleted.

src/components/ProjectInfo/ProjectInfo.jsx

Lines changed: 61 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,67 @@
1-
import React, { PropTypes as PT } from 'react'
2-
import ProjectCardHeader from './ProjectCardHeader'
3-
import ProjectCardBody from './ProjectCardBody'
1+
import React, { PropTypes as PT, Component } from 'react'
2+
import Panel from '../Panel/Panel'
3+
import DeleteProjectModal from './DeleteProjectModal'
4+
import ProjectCardHeader from '../../projects/list/components/Projects/ProjectCardHeader'
5+
import ProjectCardBody from '../../projects/list/components/Projects/ProjectCardBody'
6+
import ProjectDirectLinks from '../../projects/list/components/Projects/ProjectDirectLinks'
7+
48
import './ProjectInfo.scss'
59

6-
function ProjectInfo({ project, duration, currentMemberRole }) {
7-
if (!project) return null
8-
9-
return (
10-
<div className="project-info">
11-
<ProjectCardHeader
12-
project={project}
13-
/>
14-
<ProjectCardBody
15-
project={project}
16-
currentMemberRole={currentMemberRole}
17-
duration={duration}
18-
/>
19-
</div>
20-
)
21-
}
10+
class ProjectInfo extends Component {
11+
12+
constructor(props) {
13+
super(props)
14+
this.toggleProjectDelete = this.toggleProjectDelete.bind(this)
15+
this.onConfirmDelete = this.onConfirmDelete.bind(this)
16+
}
17+
18+
componentWillMount() {
19+
this.setState({ showDeleteConfirm: false })
20+
}
21+
22+
toggleProjectDelete() {
23+
this.setState({ showDeleteConfirm: !this.state.showDeleteConfirm })
24+
}
25+
26+
onConfirmDelete() {
27+
this.props.onDeleteProject()
28+
}
2229

23-
ProjectInfo.defaultTypes = {
30+
render() {
31+
const { project, currentMemberRole, duration, canDeleteProject, onChangeStatus, directLinks, isSuperUser } = this.props
32+
const { showDeleteConfirm } = this.state
33+
return (
34+
<div className="project-info">
35+
<div className="project-info-header">
36+
<ProjectCardHeader
37+
project={project}
38+
/>
39+
{canDeleteProject && !showDeleteConfirm &&
40+
<Panel.DeleteBtn onClick={this.toggleProjectDelete} />
41+
}
42+
</div>
43+
<Panel>
44+
{showDeleteConfirm &&
45+
<DeleteProjectModal
46+
onCancel={this.toggleProjectDelete}
47+
onConfirm={this.onConfirmDelete}
48+
/>
49+
}
50+
</Panel>
51+
<ProjectCardBody
52+
project={project}
53+
currentMemberRole={currentMemberRole}
54+
duration={duration}
55+
descLinesCount={4}
56+
onChangeStatus={onChangeStatus}
57+
isSuperUser={isSuperUser}
58+
/>
59+
<ProjectDirectLinks
60+
directLinks={directLinks}
61+
/>
62+
</div>
63+
)
64+
}
2465
}
2566

2667
ProjectInfo.propTypes = {

src/components/ProjectInfo/ProjectInfo.scss

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,28 @@
66
background-color: $tc-white;
77
border-top-left-radius: 6px;
88
border-top-right-radius: 6px;
9-
padding: 4 * $base_unit;
10-
@include tc-label-md;
9+
@include tc-label-md;
10+
11+
.project-card-body {
12+
padding-left: 4 * $base_unit;
13+
padding-right: 4 * $base_unit;
14+
.project-description {
15+
max-height: 120px;
16+
min-height: 10px;
17+
margin-bottom: 5 * $base_unit;
18+
}
19+
}
20+
21+
.project-info-header {
22+
display:flex;
23+
fill: $tc-gray-50;
24+
padding-left: 4 * $base_unit;
25+
padding-right: 4 * $base_unit;
26+
padding-top: 4 * $base_unit;
27+
}
28+
1129
}
30+
1231
.panel {
1332
box-shadow:none !important;
1433
}

0 commit comments

Comments
 (0)