Add scheduled and running state for the checks with icons
Change-Id: I7a1cdfd4810c76b521390041102d059feb99442d
diff --git a/gr-checks/gr-checks-all-statuses.js b/gr-checks/gr-checks-all-statuses.js
index 17a7bee..c4be5bc 100644
--- a/gr-checks/gr-checks-all-statuses.js
+++ b/gr-checks/gr-checks-all-statuses.js
@@ -17,6 +17,8 @@
SUCCESSFUL: 'SUCCESSFUL',
FAILED: 'FAILED',
NOT_RELEVANT: 'NOT_RELEVANT',
+
+ STATUS_UNKNOWN: 'UNKNOWN'
};
function isStatus(status, includedStatuses) {
@@ -27,6 +29,14 @@
return isStatus(status, [Statuses.NOT_STARTED, Statuses.NOT_RELEVANT]);
}
+ function isScheduled(status) {
+ return isStatus(status, [Statuses.SCHEDULED]);
+ }
+
+ function isRunning(status) {
+ return isStatus(status, [Statuses.RUNNING]);
+ }
+
function isInProgress(status) {
return isStatus(status, [Statuses.SCHEDULED, Statuses.RUNNING]);
}
@@ -57,6 +67,8 @@
window.Gerrit.Checks.Statuses = Statuses;
window.Gerrit.Checks.isUnevaluated = isUnevaluated;
+ window.Gerrit.Checks.isScheduled = isScheduled;
+ window.Gerrit.Checks.isRunning = isRunning;
window.Gerrit.Checks.isInProgress = isInProgress;
window.Gerrit.Checks.isSuccessful = isSuccessful;
window.Gerrit.Checks.isFailed = isFailed;
diff --git a/gr-checks/gr-checks-status.html b/gr-checks/gr-checks-status.html
index 591d228..0341a3f 100644
--- a/gr-checks/gr-checks-status.html
+++ b/gr-checks/gr-checks-status.html
@@ -33,7 +33,7 @@
</span>
</template>
</template>
- <template is="dom-if" if="[[_isInProgress(status)]]">
+ <template is="dom-if" if="[[_isScheduled(status)]]">
<svg width="18" height="18" xmlns="http://www.w3.org/2000/svg">
<g fill="none" fill-rule="evenodd">
<path d="M12.184 9.293c-.86 0-1.641-.39-2.15-.976L9.8 9.489l.82.78V13.2h-.78v-2.344l-.821-.781-.39 1.719-2.736-.547.157-.782 1.914.391.625-3.164-.703.273v1.328h-.782V7.457l2.032-.86c.117 0 .196-.039.313-.039.273 0 .508.157.664.391l.39.625c.313.547.939.938 1.68.938v.781zM10.034 4.8c.43 0 .782.352.782.782 0 .43-.352.781-.781.781a.783.783 0 0 1-.782-.781c0-.43.352-.782.782-.782zM9 2a7 7 0 1 0 .002 14.002A7 7 0 0 0 9 2z" fill="#9C27B0"/>
@@ -42,7 +42,20 @@
</svg>
<template is="dom-if" if="[[showText]]">
<span>
- In progress
+ Scheduled
+ </span>
+ </template>
+ </template>
+ <template is="dom-if" if="[[_isRunning(status)]]">
+ <svg width="18" height="18" xmlns="http://www.w3.org/2000/svg">
+ <g fill="none" fill-rule="evenodd">
+ <path d="M12.184 9.293c-.86 0-1.641-.39-2.15-.976L9.8 9.489l.82.78V13.2h-.78v-2.344l-.821-.781-.39 1.719-2.736-.547.157-.782 1.914.391.625-3.164-.703.273v1.328h-.782V7.457l2.032-.86c.117 0 .196-.039.313-.039.273 0 .508.157.664.391l.39.625c.313.547.939.938 1.68.938v.781zM10.034 4.8c.43 0 .782.352.782.782 0 .43-.352.781-.781.781a.783.783 0 0 1-.782-.781c0-.43.352-.782.782-.782zM9 2a7 7 0 1 0 .002 14.002A7 7 0 0 0 9 2z" fill="#9C27B0"/>
+ <path d="M0 0h18v18H0z"/>
+ </g>
+ </svg>
+ <template is="dom-if" if="[[showText]]">
+ <span>
+ Running
</span>
</template>
</template>
diff --git a/gr-checks/gr-checks-status.js b/gr-checks/gr-checks-status.js
index 0f18339..347969a 100644
--- a/gr-checks/gr-checks-status.js
+++ b/gr-checks/gr-checks-status.js
@@ -23,6 +23,14 @@
return window.Gerrit.Checks.isInProgress(status);
},
+ _isRunning(status) {
+ return window.Gerrit.Checks.isRunning(status);
+ },
+
+ _isScheduled(status) {
+ return window.Gerrit.Checks.isScheduled(status);
+ },
+
_isSuccessful(status) {
return window.Gerrit.Checks.isSuccessful(status);
},