Skip to content

Commit

Permalink
Merge pull request #32 from FedeMadoery/master
Browse files Browse the repository at this point in the history
This closes #27, closes #29, closes #12
  • Loading branch information
otech47 authored Jan 9, 2019
2 parents 50a2f4a + 6bb5f5b commit b68403b
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 5 deletions.
2 changes: 1 addition & 1 deletion web/components/CommitBlock.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ class CommitBlock extends React.Component {
// this.props.updateSetBlock(setBlock)
} else if (setBlock.blockFraction !== 0) {
// Create a new one if have blockFraction != 0
this.props.createSetBlock({ teamMemberId: currentTeamMember.id, date: day, ...setBlock })
this.props.createSetBlock({ teamMemberId: currentTeamMember.id, date: day, ...setBlock, issueUrl: (setBlock.issueUrl || '') })
}
})

Expand Down
5 changes: 4 additions & 1 deletion web/components/SchedulePage.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,12 @@ class SchedulePage extends React.Component {
}

componentDidUpdate (nextProps) {
const { currentTeamMember, editModeSchedule, selectedDay } = this.props;
const { currentTeamMember, editModeSchedule, selectedDay, history } = this.props;
// This is to make a different array for editing purpose, completed with empty set blocks
// This only take effect if change the currentTeamMember
if (nextProps.currentTeamMember && nextProps.currentTeamMember.id === 'error') {
history.push('/team'); // If the teamMemberId is invalid should go to /team
}
if ((editModeSchedule && currentTeamMember !== nextProps.currentTeamMember) || selectedDay !== nextProps.selectedDay) {
this.makeSetBlocksForEdit(nextProps.currentWeeklySetblocks);
this.setState({ enableSubmit: false })
Expand Down
2 changes: 1 addition & 1 deletion web/components/SetBlock.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ class SetBlock extends React.Component {
{
React.createElement(Edit3, {
size: 24,
color: 'black',
color: data.description || data.issueUrl ? 'blue' : 'black',
onClick: onToggle
})
}
Expand Down
9 changes: 7 additions & 2 deletions web/reducers/environment.js
Original file line number Diff line number Diff line change
Expand Up @@ -100,11 +100,13 @@ export function fetchAllTeamMembers(params) {
// Handle payload
// Dispatch additional actions
dispatch(receiveTeamMembers(payload.teamMembers))
dispatch(setFetchingData(false))
})
.catch(err => {
// Handle error
})
.finally(() => {
dispatch(setFetchingData(false))
})
}
}

Expand All @@ -130,10 +132,13 @@ export function fetchCurrentTeamMemberById(params) {
// Handle payload
// Dispatch additional actions
dispatch(receiveTeamMember(payload.teamMemberById))
dispatch(setFetchingData(false))
})
.catch(err => {
// Handle error
dispatch(receiveTeamMember({ id: 'error' }))
})
.finally(() => {
dispatch(setFetchingData(false))
})
}
}
Expand Down

0 comments on commit b68403b

Please sign in to comment.