Skip to content

Commit 3b269d1

Browse files
authored
Merge pull request #584 from appirio-tech/feature/sticky_dashboard_feeds
Github issue #568, Dashboard: status update thread is too "sticky"
2 parents cb7c0ac + f20de04 commit 3b269d1

File tree

3 files changed

+27
-4
lines changed

3 files changed

+27
-4
lines changed

src/projects/detail/Dashboard.jsx

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
import React from 'react'
2+
import { connect } from 'react-redux'
23
import ProjectInfoContainer from './containers/ProjectInfoContainer'
34
import FeedContainer from './containers/FeedContainer'
45
import Sticky from 'react-stickynode'
6+
import spinnerWhileLoading from '../../components/LoadingSpinner'
57

68
require('./Dashboard.scss')
79

8-
const Dashboard = ({project, currentMemberRole, route}) => (
10+
const DashboardView = ({project, currentMemberRole, route}) => (
911
<div>
1012
<div className="dashboard-container">
1113
<div className="left-area">
@@ -22,4 +24,23 @@ const Dashboard = ({project, currentMemberRole, route}) => (
2224
</div>
2325
)
2426

25-
export default Dashboard
27+
const enhance = spinnerWhileLoading(props => !props.isLoading)
28+
const EnhancedDashboardView = enhance(DashboardView)
29+
30+
class Dashboard extends React.Component {
31+
constructor(props) {
32+
super(props)
33+
}
34+
35+
render() {
36+
return <EnhancedDashboardView {...this.props} />
37+
}
38+
}
39+
40+
const mapStateToProps = ({ projectState }) => {
41+
return {
42+
isLoading : projectState.isLoading
43+
}
44+
}
45+
46+
export default connect(mapStateToProps)(Dashboard)

src/projects/detail/containers/ProjectInfoContainer.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ class ProjectInfoContainer extends React.Component {
135135
currentMemberRole={currentMemberRole}
136136
description={project.description}
137137
type={project.type}
138-
devices={project.details.devices || []}
138+
devices={ _.get(project, 'details.devices', []) }
139139
status={project.status} onChangeStatus={this.onChangeStatus}
140140
duration={duration}
141141
budget={budget}

src/projects/reducers/project.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@ import {
99
REMOVE_PROJECT_ATTACHMENT_PENDING, REMOVE_PROJECT_ATTACHMENT_SUCCESS, REMOVE_PROJECT_ATTACHMENT_FAILURE,
1010
ADD_PROJECT_MEMBER_PENDING, ADD_PROJECT_MEMBER_SUCCESS, ADD_PROJECT_MEMBER_FAILURE,
1111
UPDATE_PROJECT_MEMBER_PENDING, UPDATE_PROJECT_MEMBER_SUCCESS, UPDATE_PROJECT_MEMBER_FAILURE,
12-
REMOVE_PROJECT_MEMBER_PENDING, REMOVE_PROJECT_MEMBER_SUCCESS, REMOVE_PROJECT_MEMBER_FAILURE
12+
REMOVE_PROJECT_MEMBER_PENDING, REMOVE_PROJECT_MEMBER_SUCCESS, REMOVE_PROJECT_MEMBER_FAILURE,
13+
GET_PROJECTS_SUCCESS
1314
} from '../../config/constants'
1415
import _ from 'lodash'
1516
import update from 'react-addons-update'
@@ -50,6 +51,7 @@ export const projectState = function (state=initialState, action) {
5051
})
5152

5253
case CLEAR_LOADED_PROJECT:
54+
case GET_PROJECTS_SUCCESS:
5355
return Object.assign({}, state, {
5456
project: {}
5557
})

0 commit comments

Comments
 (0)