diff --git a/tests/ui/unit/filters.tests.js b/tests/ui/unit/filters.tests.js index f16c572ea..25b8b3540 100755 --- a/tests/ui/unit/filters.tests.js +++ b/tests/ui/unit/filters.tests.js @@ -45,19 +45,6 @@ describe('stripHtml filter', function() { }); }); -describe('encodeURIComponent filter', function() { - var $filter; - beforeEach(angular.mock.module('treeherder')); - beforeEach(inject(function(_$filter_) { - $filter = _$filter_; - })); - - it('encodes uri components', function() { - var encodeURIComponent = $filter('encodeURIComponent'); - expect(encodeURIComponent('this/is.a?URI#Component')).toEqual('this%2Fis.a%3FURI%23Component'); - }); -}); - describe('displayNumber filter', function() { var $filter; beforeEach(angular.mock.module('treeherder')); diff --git a/ui/details-panel/JobDetailsTab.jsx b/ui/details-panel/JobDetailsTab.jsx new file mode 100644 index 000000000..d580070c3 --- /dev/null +++ b/ui/details-panel/JobDetailsTab.jsx @@ -0,0 +1,68 @@ +import React from 'react'; +import PropTypes from 'prop-types'; +import { react2angular } from 'react2angular/index.es2015'; + +import treeherder from '../js/treeherder'; +import { getPerfAnalysisUrl, getWptUrl } from "../helpers/urlHelper"; + +export default class JobDetailsTab extends React.PureComponent { + render() { + const { jobDetails, buildernameIndex } = this.props; + const sortedDetails = jobDetails ? jobDetails.slice() : []; + + sortedDetails.sort((a, b) => a.title.localeCompare(b.title)); + + return ( +
+ +
+ ); + } +} + +JobDetailsTab.propTypes = { + jobDetails: PropTypes.array, + buildernameIndex: PropTypes.number, +}; + +JobDetailsTab.defaultProps = { + jobDetails: [], + buildernameIndex: null, +}; + +treeherder.component('jobDetailsTab', react2angular(JobDetailsTab)); diff --git a/ui/entry-index.js b/ui/entry-index.js index 7935bb1a2..b47fda2e1 100644 --- a/ui/entry-index.js +++ b/ui/entry-index.js @@ -69,6 +69,7 @@ import './plugins/tabs'; import './plugins/controller'; import './plugins/pinboard'; import './details-panel/JobDetailsPane'; +import './details-panel/JobDetailsTab'; import './details-panel/FailureSummaryTab'; import './details-panel/AutoclassifyTab'; import './details-panel/AnnotationsTab'; diff --git a/ui/helpers/urlHelper.js b/ui/helpers/urlHelper.js index 2c8eb606c..8ad35c838 100644 --- a/ui/helpers/urlHelper.js +++ b/ui/helpers/urlHelper.js @@ -51,6 +51,14 @@ export const getLogViewerUrl = function getLogViewerUrl(job_id, repoName, line_n return line_number ? `${rv}&lineNumber=${line_number}` : rv; }; +export const getWptUrl = function getWptUrl(url, value) { + return `https://mozilla.github.io/wptview/#/?urls=${encodeURIComponent(url)},${encodeURIComponent(value)}`; +}; + +export const getPerfAnalysisUrl = function getPerfAnalysisUrl(url) { + return `https://perf-html.io/from-url/${encodeURIComponent(url)}`; +}; + // Take the repoName, if passed in. If not, then try to find it on the // URL. If not there, then try m-i and hope for the best. The caller may // not actually need a repo if they're trying to get a job by ``id``. diff --git a/ui/js/filters.js b/ui/js/filters.js index 1587bf465..a17acd85e 100755 --- a/ui/js/filters.js +++ b/ui/js/filters.js @@ -50,11 +50,6 @@ treeherder.filter('getRevisionUrl', function () { }; }); -//http://stackoverflow.com/questions/16630471/how-can-i-invoke-encodeuricomponent-from-angularjs-template -treeherder.filter('encodeURIComponent', function () { - return window.encodeURIComponent; -}); - treeherder.filter('displayNumber', ['$filter', function ($filter) { return function (input) { if (isNaN(input)) { diff --git a/ui/plugins/job_details/main.html b/ui/plugins/job_details/main.html index 1745fc183..6f8463af4 100755 --- a/ui/plugins/job_details/main.html +++ b/ui/plugins/job_details/main.html @@ -1,17 +1,4 @@ -
- -
+