mirror of
https://github.com/odoo/runbot.git
synced 2025-03-27 13:25:47 +07:00
[IMP] runbot_merge: extract dashboard pr linking
Extract the creation of a PR link (to github) as a dedicated template for easier updates, and to use `display_name` everywhere (instead of reimplementing it by name). Also implement support for repo-level groups setting for information hiding. Fixes #590
This commit is contained in:
parent
66c2bdc25b
commit
a5fae548fe
@ -10,6 +10,18 @@
|
|||||||
</xpath>
|
</xpath>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
<template id="link-pr" name="create a link to `pr`">
|
||||||
|
<t t-set="title">
|
||||||
|
<t t-if="pr.repository.group_id <= env.user.groups_id">
|
||||||
|
<t t-esc="pr.message.split('\n')[0]"/>
|
||||||
|
</t>
|
||||||
|
</t>
|
||||||
|
<a t-attf-href="https://github.com/{{ pr.repository.name }}/pull/{{ pr.number }}"
|
||||||
|
t-att-title="pr.blocked or title.strip()"
|
||||||
|
t-att-target="target or None"
|
||||||
|
><t t-esc="pr.display_name"/></a>
|
||||||
|
</template>
|
||||||
|
|
||||||
<template id="dashboard" name="mergebot dashboard">
|
<template id="dashboard" name="mergebot dashboard">
|
||||||
<t t-call="website.layout">
|
<t t-call="website.layout">
|
||||||
<div id="wrap"><div class="container-fluid">
|
<div id="wrap"><div class="container-fluid">
|
||||||
@ -63,10 +75,7 @@
|
|||||||
<li t-foreach="splits" t-as="split">
|
<li t-foreach="splits" t-as="split">
|
||||||
<ul class="pr-listing list-inline list-unstyled mb0">
|
<ul class="pr-listing list-inline list-unstyled mb0">
|
||||||
<li t-foreach="split.mapped('batch_ids.prs')" t-as="pr">
|
<li t-foreach="split.mapped('batch_ids.prs')" t-as="pr">
|
||||||
<a t-attf-href="https://github.com/{{ pr.repository.name }}/pull/{{ pr.number }}"
|
<t t-call="runbot_merge.link-pr"/>
|
||||||
t-att-title="pr.message.split('\n')[0]">
|
|
||||||
<t t-esc="pr.repository.name"/>#<t t-esc="pr.number"/>
|
|
||||||
</a>
|
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
</li>
|
</li>
|
||||||
@ -76,10 +85,7 @@
|
|||||||
<h5>Awaiting</h5>
|
<h5>Awaiting</h5>
|
||||||
<ul class="list-inline">
|
<ul class="list-inline">
|
||||||
<li t-foreach="ready" t-as="pr">
|
<li t-foreach="ready" t-as="pr">
|
||||||
<a t-attf-href="https://github.com/{{ pr.repository.name }}/pull/{{ pr.number }}"
|
<t t-call="runbot_merge.link-pr"/>
|
||||||
t-att-title="pr.message.split('\n')[0]">
|
|
||||||
<t t-esc="pr.repository.name"/>#<t t-esc="pr.number"/>
|
|
||||||
</a>
|
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
@ -87,10 +93,7 @@
|
|||||||
<h5>Blocked</h5>
|
<h5>Blocked</h5>
|
||||||
<ul class="list-inline">
|
<ul class="list-inline">
|
||||||
<li t-foreach="blocked" t-as="pr">
|
<li t-foreach="blocked" t-as="pr">
|
||||||
<a t-attf-href="https://github.com/{{ pr.repository.name }}/pull/{{ pr.number }}"
|
<t t-call="runbot_merge.link-pr"/>
|
||||||
t-att-title="pr.blocked">
|
|
||||||
<t t-esc="pr.repository.name"/>#<t t-esc="pr.number"/>
|
|
||||||
</a>
|
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
@ -105,10 +108,7 @@
|
|||||||
<h5>Failed</h5>
|
<h5>Failed</h5>
|
||||||
<ul class="list-inline">
|
<ul class="list-inline">
|
||||||
<li t-foreach="failed" t-as="pr">
|
<li t-foreach="failed" t-as="pr">
|
||||||
<a t-attf-href="https://github.com/{{ pr.repository.name }}/pull/{{ pr.number }}"
|
<t t-call="runbot_merge.link-pr"/>
|
||||||
t-att-title="pr.message.split('\n')[0]">
|
|
||||||
<t t-esc="pr.repository.name"/>#<t t-esc="pr.number"/>
|
|
||||||
</a>
|
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
@ -147,8 +147,7 @@
|
|||||||
<li t-foreach="staging.batch_ids" t-as="batch" class="batch">
|
<li t-foreach="staging.batch_ids" t-as="batch" class="batch">
|
||||||
<t t-esc="batch.prs[:1].label"/>
|
<t t-esc="batch.prs[:1].label"/>
|
||||||
<t t-foreach="batch.prs" t-as="pr">
|
<t t-foreach="batch.prs" t-as="pr">
|
||||||
<a t-attf-href="https://github.com/{{ pr.repository.name }}/pull/{{ pr.number }}"
|
<t t-call="runbot_merge.link-pr"/>
|
||||||
t-att-title="pr.message.split('\n')[0]"><t t-esc="pr.repository.name"/>#<t t-esc="pr.number"/></a>
|
|
||||||
</t>
|
</t>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
@ -274,21 +273,15 @@
|
|||||||
data-toggle="dropdown"
|
data-toggle="dropdown"
|
||||||
aria-haspopup="true"
|
aria-haspopup="true"
|
||||||
aria-expanded="true"
|
aria-expanded="true"
|
||||||
t-att-title="first_pr.message.split('\n')[0]"
|
|
||||||
>
|
>
|
||||||
<t t-esc="first_pr.label"/>
|
<t t-esc="first_pr.label"/>
|
||||||
<span class="caret"></span>
|
<span class="caret"></span>
|
||||||
</button>
|
</button>
|
||||||
<ul class="dropdown-menu">
|
<ul class="dropdown-menu">
|
||||||
<li t-foreach="batch.prs"
|
<li t-foreach="batch.prs" t-as="pr">
|
||||||
t-as="pr">
|
<t t-call="runbot_merge.link-pr">
|
||||||
<a t-attf-href="https://github.com/{{ pr.repository.name }}/pull/{{ pr.number }}"
|
<t t-set="target">new</t>
|
||||||
t-att-title="pr.message.split('\n')[0]"
|
</t>
|
||||||
target="new">
|
|
||||||
<t t-esc="pr.repository.name"/>
|
|
||||||
#
|
|
||||||
<t t-esc="pr.number"/>
|
|
||||||
</a>
|
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
</li>
|
</li>
|
||||||
|
Loading…
Reference in New Issue
Block a user