Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 38 additions & 0 deletions app/templates/bounty_detail.html
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,44 @@ <h1>{{ bounty.title }}</h1>
</p>
{% endif %}

{% if bounty.pending_payout_proposals or bounty.pending_close_proposal %}
<section class="acceptance-card" aria-labelledby="pending-proposals-heading">
<p class="eyebrow">Pending treasury proposals</p>
<h2 id="pending-proposals-heading">Capacity already in review</h2>
{% if bounty.pending_payout_proposals %}
<ul>
{% for proposal in bounty.pending_payout_proposals %}
<li>
<a href="/api/v1/treasury/proposals/{{ proposal.proposal_id }}">Proposal #{{ proposal.proposal_id }}</a>
would pay {{ proposal.to_account or "an account" }} for
{% set submission_url = safe_public_url(proposal.submission_url) %}
{% if submission_url %}
<a href="{{ submission_url }}" rel="nofollow noopener">submitted work</a>
{% else %}
submitted work
{% endif %}
after {{ proposal.executes_after }}.
</li>
{% endfor %}
</ul>
{% endif %}
{% if bounty.pending_close_proposal %}
<p>
<a href="/api/v1/treasury/proposals/{{ bounty.pending_close_proposal.proposal_id }}">Proposal #{{ bounty.pending_close_proposal.proposal_id }}</a>
would close this bounty after {{ bounty.pending_close_proposal.executes_after }}.
{% if bounty.pending_close_proposal.reference %}
{% set close_reference_url = safe_public_url(bounty.pending_close_proposal.reference) %}
{% if close_reference_url %}
Reference: <a href="{{ close_reference_url }}" rel="nofollow noopener">{{ bounty.pending_close_proposal.reference | replace("https://github.com/", "") }}</a>.
{% else %}
Reference: <code>{{ bounty.pending_close_proposal.reference }}</code>.
{% endif %}
{% endif %}
</p>
{% endif %}
</section>
{% endif %}

<section class="acceptance-card" aria-labelledby="acceptance-heading">
<p class="eyebrow">Acceptance</p>
<h2 id="acceptance-heading">What has to be true</h2>
Expand Down
25 changes: 23 additions & 2 deletions tests/test_bounty_pages.py
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ def test_bounties_page_shows_effective_capacity_after_pending_payout(
acceptance="Public pages should show effective capacity after pending payouts.",
)
bounty_id = bounty.id
propose_treasury_action(
proposal = propose_treasury_action(
session,
action="pay_bounty",
payload={
Expand All @@ -173,6 +173,7 @@ def test_bounties_page_shows_effective_capacity_after_pending_payout(
},
proposed_by="maintainer",
)
proposal_id = proposal.id

client = TestClient(create_app(database_url=sqlite_url, webhook_secret="secret"))

Expand All @@ -189,6 +190,16 @@ def test_bounties_page_shows_effective_capacity_after_pending_payout(
assert "<span>Effective remaining</span>" in detail.text
assert "<span>Effective available</span>" in detail.text
assert "Visible capacity before pending proposals: 2 awards, 50 MRWK." in detail.text
assert "Pending treasury proposals" in detail.text
assert "Capacity already in review" in detail.text
assert f'href="/api/v1/treasury/proposals/{proposal_id}">Proposal #{proposal_id}</a>' in (
detail.text
)
assert "would pay github:alice for" in detail.text
assert (
'href="https://github.com/ramimbo/mergework/pull/67" rel="nofollow noopener">'
"submitted work</a>"
) in detail.text
assert "1 award still open for distinct accepted work after pending treasury proposals." in (
detail.text
)
Expand All @@ -211,7 +222,7 @@ def test_bounties_page_shows_effective_capacity_after_pending_close(
acceptance="Public pages should show no effective capacity after pending close.",
)
bounty_id = bounty.id
propose_treasury_action(
proposal = propose_treasury_action(
session,
action="close_bounty",
payload={
Expand All @@ -221,6 +232,7 @@ def test_bounties_page_shows_effective_capacity_after_pending_close(
},
proposed_by="maintainer",
)
proposal_id = proposal.id

client = TestClient(create_app(database_url=sqlite_url, webhook_secret="secret"))

Expand All @@ -233,6 +245,15 @@ def test_bounties_page_shows_effective_capacity_after_pending_close(
assert "A pending close proposal would make this bounty unavailable if executed." in page.text
assert detail.status_code == 200
assert "Visible capacity before pending proposals: 3 awards, 90 MRWK." in detail.text
assert "Pending treasury proposals" in detail.text
assert f'href="/api/v1/treasury/proposals/{proposal_id}">Proposal #{proposal_id}</a>' in (
detail.text
)
assert "would close this bounty after" in detail.text
assert (
'Reference: <a href="https://github.com/ramimbo/mergework/issues/68#close" '
'rel="nofollow noopener">ramimbo/mergework/issues/68#close</a>.'
) in detail.text
assert (
"No awards remain after pending treasury proposals; treat new work as unpaid unless "
"maintainers reopen or free capacity."
Expand Down
Loading