+2015-06-16 Ryosuke Niwa <rniwa@webkit.org>
+
+ v2 UI should have buttons to breakdown a test
+ https://bugs.webkit.org/show_bug.cgi?id=146010
+
+ Reviewed by Chris Dumez.
+
+ Added buttons beneath each chart pane to add "alternative panes". By default, it shows every platform
+ as well as "Breakdown" to add all subtests' metrics.
+
+ Also removed the metric submenu from tests that had exactly one metric. When a test only measures Time
+ for example, we make the test itself clickable instead of showing a submenu that only contains one item.
+
+ * public/v2/app.js:
+ (App.ChartsController.addAlternativePanes): Added.
+ (App.TestProxyForPopup.children): Calls _updateChildren and returns this._children.
+ (App.TestProxyForPopup.actionName): Added.
+ (App.TestProxyForPopup.actionArgument): Added.
+ (App.TestProxyForPopup._updateChildren): Extracted from children. Now also sets _actionName and
+ _actionArgument in the case there was exactly one metric so that showing submenu is unnecessary.
+ (App.PaneController.alternativePanes): Added. Returns the list of alternative panes. The platform list
+ excludes ones that don't have this metric (e.g. iOS doesn't have desktop PLT results) as well as ones
+ that are already present in the list of panes.
+ * public/v2/chart-pane.css: Added CSS rules for alternative pane buttons beneath the chart panes.
+ * public/v2/index.html:
+ * public/v2/manifest.js:
+ (App.Metric.childMetrics): Added.
+
2015-06-15 Ryosuke Niwa <rniwa@webkit.org>
Build fix after r185574.
showingDetails: false
}));
},
+ addAlternativePanes: function (pane, platform, metrics)
+ {
+ var panes = this.panes;
+ var store = this.store;
+ var startingIndex = panes.indexOf(pane) + 1;
+ metrics.forEach(function (metric, index) {
+ panes.insertAt(startingIndex + index, App.Pane.create({
+ store: store,
+ platformId: platform.get('id'),
+ metricId: metric.get('id'),
+ showingDetails: false
+ }));
+ })
+ }
},
init: function ()
platform: null,
children: function ()
{
+ this._updateChildren();
+ return this._children;
+ }.property('childTests', 'metrics'),
+ actionName: function ()
+ {
+ this._updateChildren();
+ return this._actionName;
+ }.property('childTests', 'metrics'),
+ actionArgument: function ()
+ {
+ this._updateChildren();
+ return this._actionArgument;
+ }.property('childTests', 'metrics'),
+ _updateChildren: function ()
+ {
var platform = this.get('platform');
var action = this.get('action');
var position = this.get('position');
if (childTests.length && metrics.length)
metrics.push({isSeparator: true});
+ else if (metrics.length == 1) {
+ this._actionName = action;
+ this._actionArgument = metrics[0].actionArgument;
+ return;
+ }
- return metrics.concat(childTests);
- }.property('childTests', 'metrics'),
+ this._actionName = null;
+ this._actionArgument = null;
+ this._children = metrics.concat(childTests);
+ },
});
App.domainsAreEqual = function (domain1, domain2) {
alert('Failed to update the status:' + error);
});
}.observes('selectedItemIsMarkedOutlier'),
+ alternativePanes: function ()
+ {
+ var pane = this.get('model');
+ var metric = pane.get('metric');
+ var currentPlatform = pane.get('platform');
+ var platforms = App.Manifest.get('platforms');
+ if (!platforms || !metric)
+ return;
+
+ var exitingPlatforms = {};
+ this.get('parentController').get('panes').forEach(function (pane) {
+ if (pane.get('metricId') == metric.get('id'))
+ exitingPlatforms[pane.get('platformId')] = true;
+ });
+
+ var alternativePanes = platforms.filter(function (platform) {
+ return !exitingPlatforms[platform.get('id')] && platform.containsMetric(metric);
+ }).map(function (platform) {
+ return {
+ pane: pane,
+ platform: platform,
+ metrics: [metric],
+ label: platform.get('label')
+ };
+ });
+
+ var childMetrics = metric.get('childMetrics');
+ if (childMetrics && childMetrics.length) {
+ alternativePanes.push({
+ pane: pane,
+ platform: currentPlatform,
+ metrics: childMetrics,
+ label: 'Breakdown',
+ });
+ }
+
+ return alternativePanes;
+ }.property('model.metric', 'model.platform', 'App.Manifest.platforms',
+ 'parentController.panes.@each.platformId', 'parentController.panes.@each.metricId'),
});
App.AnalysisRoute = Ember.Route.extend({