mirror of
https://github.com/YunoHost/tartiflette.git
synced 2024-09-03 20:06:08 +02:00
Add filter to show only app/results that needs attention
This commit is contained in:
parent
c1c8c5b927
commit
7cc91e6a0e
4 changed files with 12 additions and 42 deletions
|
@ -55,7 +55,7 @@ def appci_branch(branch):
|
|||
app_results = sort_test_results(branch.most_recent_tests_per_app())
|
||||
|
||||
tests = AppCI.tests.copy()
|
||||
if "Malformed path" in tests:
|
||||
if "Malfurmed path" in tests:
|
||||
tests.remove("Malformed path")
|
||||
|
||||
return render_template("appci_branch.html", tests=tests,
|
||||
|
|
|
@ -101,6 +101,10 @@ class AppCIResult(db.Model):
|
|||
def outdated(self):
|
||||
return (datetime.datetime.now() - self.date).days > 30
|
||||
|
||||
@property
|
||||
def needs_attention(self):
|
||||
return self.outdated or self.level is None or self.app.public_level == "?" or (int(self.app.public_level) > self.level)
|
||||
|
||||
|
||||
class AppCI():
|
||||
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
a { color:#007bff; }
|
||||
|
||||
.ci-app-table > thead, .ci-app-table > tbody { display: block; width: 100%;}
|
||||
.ci-app-table { margin: 0 auto; margin-top: 100px; max-width: 1200px; overflow-x: visible; }
|
||||
.ci-app-table { margin: 0 auto; margin-top: 120px; max-width: 1200px; overflow-x: visible; }
|
||||
.ci-app-table th, .ci-app-table td { display: block; border: none; padding; 0px;float: left; height:33px; width: 33px; margin: 5px; margin-top: -5px; }
|
||||
|
||||
th.ci-app-test-title
|
||||
|
|
|
@ -7,42 +7,7 @@
|
|||
<div class="row">
|
||||
<div class="mx-auto">
|
||||
<div style="text-align:center;">
|
||||
<label for="level-all">Level : </label>
|
||||
<div class="btn-group btn-group-toggle" data-toggle="buttons">
|
||||
<label class="btn btn-sm btn-light active">
|
||||
<input type="radio" name="options" level="all" id="filter_level-all" autocomplete="off" checked> All
|
||||
</label>
|
||||
<label class="btn btn-sm btn-light">
|
||||
<input type="radio" name="options" level="?" autocomplete="off"> ?
|
||||
</label>
|
||||
<label class="btn btn-sm btn-light">
|
||||
<input type="radio" name="options" level="0" autocomplete="off"> 0
|
||||
</label>
|
||||
<label class="btn btn-sm btn-light">
|
||||
<input type="radio" name="options" level="1" autocomplete="off"> 1
|
||||
</label>
|
||||
<label class="btn btn-sm btn-light">
|
||||
<input type="radio" name="options" level="2" autocomplete="off"> 2
|
||||
</label>
|
||||
<label class="btn btn-sm btn-light">
|
||||
<input type="radio" name="options" level="3" autocomplete="off"> 3
|
||||
</label>
|
||||
<label class="btn btn-sm btn-light">
|
||||
<input type="radio" name="options" level="4" autocomplete="off"> 4
|
||||
</label>
|
||||
<label class="btn btn-sm btn-light">
|
||||
<input type="radio" name="options" level="5" autocomplete="off"> 5
|
||||
</label>
|
||||
<label class="btn btn-sm btn-light">
|
||||
<input type="radio" name="options" level="6" autocomplete="off"> 6
|
||||
</label>
|
||||
<label class="btn btn-sm btn-light">
|
||||
<input type="radio" name="options" level="7" autocomplete="off"> 7
|
||||
</label>
|
||||
<label class="btn btn-sm btn-light">
|
||||
<input type="radio" name="options" level="8" autocomplete="off"> 8
|
||||
</label>
|
||||
</div>
|
||||
<button id="filter_onlyNeedAttention" type="button" class="btn btn-light btn-sm" href="javascript:void(0)" onclick="toggle(this)">Show only app that needs attention</button>
|
||||
</div>
|
||||
<div>
|
||||
<table class="table table-responsive ci-app-table">
|
||||
|
@ -59,7 +24,7 @@
|
|||
</thead>
|
||||
<tbody>
|
||||
{% for result in app_results %}
|
||||
<tr app="{{ result.app.name }}" class="resultline" level="{{ result.level if result.level >= 0 else "?" }}" {% if result.outdated %}style="opacity: 0.8; background-color: #ddd;"{% endif %} >
|
||||
<tr app="{{ result.app.name }}" class="resultline {% if result.needs_attention %}ci-needs-attention{% endif %}" {% if result.outdated %}style="opacity: 0.8; background-color: #ddd;"{% endif %} >
|
||||
<td class="ci-app-row-title">
|
||||
{% if result.app.long_term_good_quality %}
|
||||
<span class="oi oi-star" title="Long-term good quality" aria-hidden="true" style="color: goldenrod;"></span>
|
||||
|
@ -157,9 +122,10 @@ function toggle(e) {
|
|||
}
|
||||
|
||||
function update_filters() {
|
||||
var levelFilter = $("input[type='radio']:checked").attr("level");
|
||||
$(".resultline").show();
|
||||
if (levelFilter != "all") { $(".resultline[level!='"+levelFilter+"']").hide(); }
|
||||
var onlyNeedAttention = $("#filter_onlyNeedAttention").hasClass("btn-primary");
|
||||
$(".resultline").hide();
|
||||
$(".ci-needs-attention").show();
|
||||
if (!onlyNeedAttention) { $(".resultline").show(); }
|
||||
}
|
||||
|
||||
</script>
|
||||
|
|
Loading…
Reference in a new issue