Skip to content

Commit

Permalink
Merge 54a0469 into e51d964
Browse files Browse the repository at this point in the history
  • Loading branch information
rkzel committed Apr 11, 2019
2 parents e51d964 + 54a0469 commit c70db57
Show file tree
Hide file tree
Showing 10 changed files with 316 additions and 114 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 @@ -549,6 +565,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 @@ -390,7 +390,6 @@ const Detail = ({
createdAt,
expLevel,
deadline,
slots,
work,
workStatus,
onReviewApplication,
Expand Down Expand Up @@ -445,6 +444,7 @@ const Detail = ({
work={work}
workStatus={workStatus}
requestsData={requestsData}
onUpdateBounty={onUpdateBounty}
onAllocateSingleBounty={onAllocateSingleBounty}
onSubmitWork={onSubmitWork}
onRequestAssignment={onRequestAssignment}
Expand Down Expand Up @@ -509,7 +509,6 @@ const Detail = ({
</Content>
)
}

const DetailsCard = styled.div`
flex: 0 1 auto;
text-align: left;
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 @@ -65,6 +65,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 @@ -93,7 +97,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 @@ -413,6 +417,9 @@ class Issues extends React.PureComponent {
onAllocateSingleBounty={() => {
this.handleAllocateSingleBounty(currentIssueShaped)
}}
onUpdateBounty={() => {
this.handleUpdateBounty(currentIssueShaped)
}}
onReviewWork={() => {
this.handleReviewWork(currentIssueShaped)
}}
Expand Down Expand Up @@ -471,6 +478,9 @@ class Issues extends React.PureComponent {
onAllocateSingleBounty={() => {
this.handleAllocateSingleBounty(issue)
}}
onUpdateBounty={() => {
this.handleUpdateBounty(issue)
}}
onReviewWork={() => {
this.handleReviewWork(issue)
}}
Expand Down

0 comments on commit c70db57

Please sign in to comment.