Skip to content

Commit

Permalink
Merge a7f22b4 into 22b95ab
Browse files Browse the repository at this point in the history
  • Loading branch information
rkzel committed Apr 5, 2019
2 parents 22b95ab + a7f22b4 commit 5a7cd18
Show file tree
Hide file tree
Showing 10 changed files with 327 additions and 108 deletions.
21 changes: 19 additions & 2 deletions apps/projects/app/components/App/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -296,11 +296,27 @@ class App extends React.PureComponent {
this.setState((_prevState, _prevProps) => ({
panel: PANELS.FundIssues,
panelProps: {
issues: issues,
issues,
mode: 'new',
onSubmit: this.onSubmitBountyAllocation,
bountySettings: this.props.bountySettings,
closePanel: this.closePanel,
tokens: this.props.tokens !== undefined ? this.props.tokens : [],
},
}))
}

updateBounty = issues => {
this.setState((_prevState, _prevProps) => ({
panel: PANELS.FundIssues,
panelProps: {
title: 'Update Funding',
issues,
mode: 'update',
onSubmit: this.onSubmitBountyAllocation,
bountySettings: this.props.bountySettings,
tokens: this.props.tokens ? this.props.tokens : [],
closePanel: this.cancelBounties,
tokens: this.props.tokens !== undefined ? this.props.tokens : [],
},
}))
}
Expand Down Expand Up @@ -538,6 +554,7 @@ class App extends React.PureComponent {
onNewIssue={this.newIssue}
onCurateIssues={this.curateIssues}
onAllocateBounties={this.newBountyAllocation}
onUpdateBounty={this.updateBounty}
onSubmitWork={this.submitWork}
onRequestAssignment={this.requestAssignment}
activeIndex={activeIndex}
Expand Down
1 change: 1 addition & 0 deletions apps/projects/app/components/App/AppContent.js
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ AppContent.propTypes = {
bountySettings: PropTypes.object.isRequired,
onNewProject: PropTypes.func.isRequired,
onNewIssue: PropTypes.func.isRequired,
onUpdateBounty: PropTypes.func.isRequired,
activeIndex: PropTypes.object.isRequired,
changeActiveIndex: PropTypes.func.isRequired,
status: PropTypes.string.isRequired,
Expand Down
3 changes: 2 additions & 1 deletion apps/projects/app/components/Card/Issue.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ const Issue = ({
onRequestAssignment,
onReviewApplication,
onAllocateSingleBounty,
onUpdateBounty,
onReviewWork,
balance,
symbol,
Expand Down Expand Up @@ -104,11 +105,11 @@ const Issue = ({
onRequestAssignment={onRequestAssignment}
onReviewApplication={onReviewApplication}
onReviewWork={onReviewWork}
onUpdateBounty={onUpdateBounty}
/>
</ContextMenu>
)}
</div>

<IssueTitleDetailsBalance>
<IssueTitleDetails>
<IssueTitle>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export default class IssueDetail extends React.Component {
}

render() {
const { onClose, issue, onReviewApplication, onRequestAssignment, onSubmitWork, onAllocateSingleBounty, onReviewWork } = this.props
const { onClose, issue, onReviewApplication, onRequestAssignment, onSubmitWork, onAllocateSingleBounty, onReviewWork, onUpdateBounty } = this.props

return createPortal(
<div style={issueDetailStyle}>
Expand All @@ -40,6 +40,7 @@ export default class IssueDetail extends React.Component {
onSubmitWork={onSubmitWork}
onAllocateSingleBounty={onAllocateSingleBounty}
onReviewWork={onReviewWork}
onUpdateBounty={onUpdateBounty}
/>
</div>,
this.el
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -391,6 +391,7 @@ const Detail = ({
onRequestAssignment,
onSubmitWork,
onAllocateSingleBounty,
onUpdateBounty,
workSubmissions,
}) => {

Expand Down Expand Up @@ -442,6 +443,7 @@ const Detail = ({
onRequestAssignment={onRequestAssignment}
onReviewApplication={onReviewApplication}
onReviewWork={onReviewWork}
onUpdateBounty={onUpdateBounty}
/>
</ContextMenu>
{ balance > 0 &&
Expand Down
12 changes: 11 additions & 1 deletion apps/projects/app/components/Content/Issues.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,10 @@ class Issues extends React.PureComponent {
this.props.onAllocateBounties([issue])
}

handleUpdateBounty = issue => {
this.props.onUpdateBounty([issue])
}

handleAllocateBounties = () => {
console.log('handleAllocationBounties:', this.state.selectedIssues)
this.props.onAllocateBounties(this.state.selectedIssues)
Expand Down Expand Up @@ -94,7 +98,7 @@ class Issues extends React.PureComponent {
if (this.state.allSelected) {
this.setState({ allSelected: false, selectedIssues: [] })
} else {
this.setState({ allSelected: true, selectedIssues: issuesFiltered })
this.setState({ allSelected: true, selectedIssues: this.shapeIssues(issuesFiltered) })
}
}

Expand Down Expand Up @@ -414,6 +418,9 @@ class Issues extends React.PureComponent {
onAllocateSingleBounty={() => {
this.handleAllocateSingleBounty(currentIssueShaped)
}}
onUpdateBounty={() => {
this.handleUpdateBounty(currentIssueShaped)
}}
onReviewWork={() => {
this.handleReviewWork(currentIssueShaped)
}}
Expand Down Expand Up @@ -472,6 +479,9 @@ class Issues extends React.PureComponent {
onAllocateSingleBounty={() => {
this.handleAllocateSingleBounty(issue)
}}
onUpdateBounty={() => {
this.handleUpdateBounty(issue)
}}
onReviewWork={() => {
this.handleReviewWork(issue)
}}
Expand Down

0 comments on commit 5a7cd18

Please sign in to comment.