Merge lp:~sil2100/bileto/dashboard_add_qa_colors into lp:bileto

Proposed by Łukasz Zemczak
Status: Rejected
Rejected by: Robert Bruce Park
Proposed branch: lp:~sil2100/bileto/dashboard_add_qa_colors
Merge into: lp:bileto
Diff against target: 50 lines (+15/-5)
2 files modified
tickets/static/dashboard.html (+1/-1)
tickets/static/dashboard.js (+14/-4)
To merge this branch: bzr merge lp:~sil2100/bileto/dashboard_add_qa_colors
Reviewer Review Type Date Requested Status
CU2D maintainers Pending
Review via email: mp+266603@code.launchpad.net

Commit message

Make sure that the dashboard silo status color also changes basing on QA status, informing the trainguards of when a silo is rejected or signed-off.

Description of the change

Make sure that the dashboard silo status color also changes basing on QA status, informing the trainguards of when a silo is rejected or signed-off.

To post a comment you must log in.
Revision history for this message
Łukasz Zemczak (sil2100) wrote :

Still need to actually test it somewhere.

Revision history for this message
Robert Bruce Park (robru) wrote :

Oh haha, I didn't even see this. I fixed this already in a recent commit I did.

Also, "somewhere" is the staging area, branches can be configured the same way as for jenkins, as per the instructions:

https://wiki.canonical.com/UbuntuEngineering/CI/Playbook/StagingTrain

Unmerged revisions

201. By Łukasz Zemczak

Add QA status to have effect on silo colors in the dashboard.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'tickets/static/dashboard.html'
2--- tickets/static/dashboard.html 2015-07-10 22:06:58 +0000
3+++ tickets/static/dashboard.html 2015-07-31 17:28:43 +0000
4@@ -105,7 +105,7 @@
5 </ul>
6 </div>
7 </div>
8- <div class="status" style="color: {{getSiloColor(siloname)}};">
9+ <div class="status" style="color: {{getSiloColor(siloname, bileto.reqs[silos[siloname].requestid].qa_signoff)}};">
10 <div class="jenkins_status">
11 <p ng-repeat="status in silos[siloname].longStatus"
12 ng-bind-html="status"></p>
13
14=== modified file 'tickets/static/dashboard.js'
15--- tickets/static/dashboard.js 2015-07-10 22:00:45 +0000
16+++ tickets/static/dashboard.js 2015-07-31 17:28:43 +0000
17@@ -44,9 +44,18 @@
18 'silo dirty': 'olive',
19 };
20
21+QA_STATE_COLORS = {
22+ 'qa granted': 'blue',
23+ 'qa failed': 'red',
24+};
25+
26
27 function getStatusColor(status) {
28- return STATUS_COLORS[nWords(status, 2).toLowerCase()] || 'black';
29+ return STATUS_COLORS[nWords(status, 2).toLowerCase()];
30+};
31+
32+function getQAStateColor(qa_state) {
33+ return QA_STATE_COLORS[qa_state.toLowerCase()];
34 };
35
36 var app = angular.module('CITrainWeb', ['ngSanitize']);
37@@ -258,9 +267,10 @@
38 }
39 })
40
41- $scope.getSiloColor = function(siloname) {
42- var siloColor = ($scope.silos[siloname] || {}).statusColor || '';
43- return siloColor || 'black';
44+ $scope.getSiloColor = function(siloname, qa_state) {
45+ var qaColor = getQAStateColor(qa_state);
46+ var siloColor = ($scope.silos[siloname] || {}).statusColor;
47+ return siloColor || qaColor || 'black';
48 };
49
50 function getQuery() {

Subscribers

People subscribed via source and target branches