[FIX] runbot_merge: also show banners on PR pages

It's likely that the PR pages are seen more commonly than the
dashboard by most users, so add alerts there in case users wonder
what's happening.

Fixes #580
This commit is contained in:
Xavier Morel 2022-06-30 14:33:18 +02:00
parent 2a268d777c
commit 64eeb6142e
4 changed files with 27 additions and 19 deletions

View File

@ -1,5 +1,5 @@
<odoo> <odoo>
<template id="dashboard" inherit_id="runbot_merge.dashboard"> <template id="alerts" inherit_id="runbot_merge.alerts">
<xpath expr="//div[@id='alerts']"> <xpath expr="//div[@id='alerts']">
<t t-set="fpcron" t-value="env(user=1).ref('forwardport.port_forward')"/> <t t-set="fpcron" t-value="env(user=1).ref('forwardport.port_forward')"/>
<div t-if="not fpcron.active" class="alert alert-warning col-12" role="alert"> <div t-if="not fpcron.active" class="alert alert-warning col-12" role="alert">

View File

@ -0,0 +1 @@
IMP: show current alerts (disabled crons) on the PR pages

View File

@ -4,3 +4,5 @@ IMP: various UI items
- fix "outstanding forward ports" count - fix "outstanding forward ports" count
- add date of staging last modification (= success / failure instant) - add date of staging last modification (= success / failure instant)
- correctly retrieve and include fast-forward and unstaging reasons - correctly retrieve and include fast-forward and unstaging reasons
- show the warnings banner (e.g. staging disabled) on the PR pages, as not all
users routinely visit the main dashboard

View File

@ -57,9 +57,7 @@
</div> </div>
</template> </template>
<template id="dashboard" name="mergebot dashboard"> <template id="alerts">
<t t-call="website.layout">
<div id="wrap"><div class="container-fluid">
<div id="alerts" class="row text-center"> <div id="alerts" class="row text-center">
<div class="alert alert-light col-md-12 h6 mb-0"> <div class="alert alert-light col-md-12 h6 mb-0">
<a href="/runbot_merge/changelog">Changelog</a> <a href="/runbot_merge/changelog">Changelog</a>
@ -73,6 +71,12 @@
Merging is disabled, stagings will not be disabled. Merging is disabled, stagings will not be disabled.
</div> </div>
</div> </div>
</template>
<template id="dashboard" name="mergebot dashboard">
<t t-call="website.layout">
<div id="wrap"><div class="container-fluid">
<t t-call="runbot_merge.alerts"/>
<section t-foreach="projects.with_context(active_test=False)" t-as="project" class="row"> <section t-foreach="projects.with_context(active_test=False)" t-as="project" class="row">
<h1 class="col-md-12"><t t-esc="project.name"/></h1> <h1 class="col-md-12"><t t-esc="project.name"/></h1>
<div class="col-md-12"> <div class="col-md-12">
@ -385,6 +389,7 @@
<template id="view_pull_request"> <template id="view_pull_request">
<t t-call="website.layout"> <t t-call="website.layout">
<div id="wrap"><div class="container-fluid"> <div id="wrap"><div class="container-fluid">
<t t-call="runbot_merge.alerts"/>
<h1> <h1>
<a t-att-href="pr.github_url" t-field="pr.display_name"> <a t-att-href="pr.github_url" t-field="pr.display_name">
</a> </a>