Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(222)

Unified Diff: dashboard/dashboard/elements/alerts-table.html

Issue 2537053003: Changing group reports to use an id for multiple keys. (Closed)
Patch Set: added test Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « dashboard/dashboard/alerts.py ('k') | dashboard/dashboard/elements/group-report-page.html » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: dashboard/dashboard/elements/alerts-table.html
diff --git a/dashboard/dashboard/elements/alerts-table.html b/dashboard/dashboard/elements/alerts-table.html
index 84a8ee0bc8a37b50ea0cb065ff8b0ea3650030f6..5531fb4a9a998b01585b3eb032f3c7df555dc311 100644
--- a/dashboard/dashboard/elements/alerts-table.html
+++ b/dashboard/dashboard/elements/alerts-table.html
@@ -13,6 +13,7 @@ found in the LICENSE file.
<link rel="import" href="/dashboard/elements/bug-info-span.html">
<link rel="import" href="/dashboard/elements/revision-range.html">
<link rel="import" href="/dashboard/elements/triage-dialog.html">
+<link rel="import" href="/dashboard/static/simple_xhr.html">
<link rel="import" href="/dashboard/static/uri.html">
<link rel="import" href="/tracing/base/unit.html">
@@ -292,7 +293,15 @@ found in the LICENSE file.
margin-top: 30px;
z-index: 1000;
}
+
+ .error {
+ color: #dd4b39;
+ font-weight: bold;
+ }
</style>
+ <template is="dom-if" if="{{error}}">
+ <div class="error">{{error}}</div>
+ </template>
<div>
<triage-dialog id="triage" on-triaged="onTriaged" xsrf-token="{{xsrfToken}}">
</triage-dialog>
@@ -390,19 +399,6 @@ found in the LICENSE file.
(function() {
/**
- * Constructs a URI for the report page for this group of alerts.
- * @param {Array.<Object>} group The group of alerts to graph.
- * @return {string} The URI of the graph.
- */
- function getGraphUri(alerts) {
- var keys = [];
- for (var i = 0; i < alerts.length; i++) {
- keys.push(alerts[i]['key']);
- }
- return '/group_report?keys=' + keys.join(',');
- }
-
- /**
* Returns the intersection of the two ranges.
*
* @param {Object} range1 An range in the form:
@@ -446,6 +442,11 @@ found in the LICENSE file.
value: () => []
},
+ selectedKeys: {
+ type: Array,
+ value: () => []
+ },
+
xsrfToken: {
type: String
},
@@ -692,14 +693,14 @@ found in the LICENSE file.
* @param {array} alerts The array of alerts to modify.
*/
selectAlertsInKeysParameter: function(alerts) {
- var keys = uri.getParameter('keys');
- if (!keys)
+ if (!this.selectedKeys)
return;
+ var keys = this.selectedKeys;
var keySet = {};
- keys.split(',').forEach(function(k) {
+ for (var k of keys) {
keySet[k] = true;
- });
+ }
for (var i = 0; i < alerts.length; i++) {
var alert = alerts[i];
if (keySet[alerts[i].key]) {
@@ -1078,11 +1079,22 @@ found in the LICENSE file.
},
/**
- * Opens a new window on the /report page for the currently checked
- * alerts.
+ * Opens a new tab to be populated. Then sends a POST request
+ * to /short_uri with the keys. The reply is a hash of
+ * the keys, which we redirect the new tab to.
*/
showGraphs: function() {
- window.open(getGraphUri(this.checkedAlerts));
+ var newTab = window.open('about:blank');
+
+ simple_xhr.send('/short_uri',
+ {'page_state': JSON.stringify(this.checkedAlerts.map(
+ alert => alert.key))},
+ response => {
+ newTab.location.replace('/group_report?sid=' + response.sid);
+ },
+ msg => {
+ this.error = msg;
+ });
},
/**
« no previous file with comments | « dashboard/dashboard/alerts.py ('k') | dashboard/dashboard/elements/group-report-page.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698