Bug 1353066 - Make jsyaml available as a service (#2314)

This fixes exceptions when using the "add new jobs" feature.
This commit is contained in:
Brian Stack 2017-04-07 06:53:32 -07:00 коммит произвёл Ed Morley
Родитель ae74d14c51
Коммит b22616a461
4 изменённых файлов: 11 добавлений и 5 удалений

Просмотреть файл

@ -72,6 +72,7 @@ module.exports = neutrino => {
'no-spaced-func': 'error',
'no-trailing-spaces': 'error',
'no-undef-init': 'error',
'no-undef': 'error',
'no-unexpected-multiline': 'error',
'no-unused-expressions': 'error',
'no-useless-call': 'error',
@ -81,7 +82,7 @@ module.exports = neutrino => {
'strict': ['error', 'global'],
'yoda': 'error'
},
globals: ['angular', '$', '_', 'treeherder', 'jsyaml', 'perf',
globals: ['angular', '$', '_', 'treeherder', 'perf',
'treeherderApp', 'failureViewerApp', 'logViewerApp',
'userguideApp', 'admin', 'Mousetrap', 'jQuery', 'React',
'hawk', 'jsonSchemaDefaults'

Просмотреть файл

@ -2,10 +2,10 @@
treeherder.factory('ThResultSetModel', ['$rootScope', '$http', '$location',
'$q', '$interpolate', 'thUrl', 'thResultStatusObject', 'thEvents',
'thServiceDomain', 'ThLog', 'thNotify', 'ThJobModel', 'thTaskcluster',
'thServiceDomain', 'ThLog', 'thNotify', 'ThJobModel', 'thTaskcluster', 'jsyaml',
function ($rootScope, $http, $location, $q, $interpolate, thUrl,
thResultStatusObject, thEvents, thServiceDomain, ThLog, thNotify,
ThJobModel, thTaskcluster) {
ThJobModel, thTaskcluster, jsyaml) {
var $log = new ThLog("ThResultSetModel");

Просмотреть файл

@ -180,6 +180,11 @@ treeherder.factory('thPlatformName', [
};
}]);
treeherder.factory('jsyaml', [
function() {
return require('js-yaml');
}]);
treeherder.factory('thExtendProperties', [
/* Version of _.extend that works with property descriptors */
function() {

Просмотреть файл

@ -8,7 +8,7 @@ treeherder.controller('PluginCtrl', [
'ThResultSetModel', 'ThLog', '$q', 'thPinboard',
'ThJobDetailModel', 'thBuildApi', 'thNotify', 'ThJobLogUrlModel', 'ThModelErrors', 'ThTaskclusterErrors',
'thTabs', '$timeout', 'thReftestStatus', 'ThResultSetStore',
'PhSeries', 'thServiceDomain', 'thTaskcluster',
'PhSeries', 'thServiceDomain', 'thTaskcluster', 'jsyaml',
function PluginCtrl(
$scope, $rootScope, $location, $http, $interpolate, $uibModal,
thUrl, ThJobClassificationModel,
@ -17,7 +17,7 @@ treeherder.controller('PluginCtrl', [
ThResultSetModel, ThLog, $q, thPinboard,
ThJobDetailModel, thBuildApi, thNotify, ThJobLogUrlModel, ThModelErrors, ThTaskclusterErrors, thTabs,
$timeout, thReftestStatus, ThResultSetStore, PhSeries,
thServiceDomain, thTaskcluster) {
thServiceDomain, thTaskcluster, jsyaml) {
var $log = new ThLog("PluginCtrl");