зеркало из https://github.com/mozilla/treeherder.git
Bug 1441617 - Always import angular explicitly
...rather than relying on `window.angular`. And also switch to ES6 imports.
This commit is contained in:
Родитель
a8e09c5786
Коммит
800b31b719
|
@ -240,7 +240,6 @@ module.exports = neutrino => {
|
|||
return options;
|
||||
});
|
||||
|
||||
// Now provide a few globals (providing angular here does not seem to work, though)
|
||||
neutrino.config
|
||||
.plugin('provide')
|
||||
.use(webpack.ProvidePlugin, {
|
||||
|
|
|
@ -82,7 +82,6 @@ module.exports = neutrino => {
|
|||
globals: [
|
||||
'$',
|
||||
'_',
|
||||
'angular',
|
||||
'jQuery',
|
||||
'Mousetrap',
|
||||
'React',
|
||||
|
|
|
@ -1,14 +1,16 @@
|
|||
// Karma/webpack entry for tests
|
||||
|
||||
// Manually import angular since angular-mocks doesn't do so itself
|
||||
import 'angular';
|
||||
import 'angular-mocks';
|
||||
|
||||
// Global variables are set here instead of with webpack.ProvidePlugin
|
||||
// because neutrino removes plugin definitions for karma runs
|
||||
window.$ = require('jquery');
|
||||
window.jQuery = require('jquery');
|
||||
window._ = require('lodash');
|
||||
window.angular = require('angular');
|
||||
window.React = require('react');
|
||||
require('jasmine-jquery');
|
||||
require('angular-mocks');
|
||||
require('mousetrap');
|
||||
|
||||
const Adapter = require('enzyme-adapter-react-16');
|
||||
|
|
|
@ -16,7 +16,6 @@ require('./css/treeherder-bugfiler.css');
|
|||
require('./css/treeherder-loading-overlay.css');
|
||||
|
||||
// Vendor JS
|
||||
require('angular');
|
||||
require('bootstrap/dist/js/bootstrap');
|
||||
require('mousetrap');
|
||||
require('jquery.scrollto');
|
||||
|
|
|
@ -8,7 +8,6 @@ require('./css/treeherder-global.css');
|
|||
require('./css/logviewer.css');
|
||||
|
||||
// Vendor JS
|
||||
require('angular');
|
||||
require('bootstrap/dist/js/bootstrap');
|
||||
|
||||
// Bootstrap the Angular modules against which everything will be registered
|
||||
|
|
|
@ -11,7 +11,6 @@ require('./css/treeherder-loading-overlay.css');
|
|||
require('metrics-graphics/dist/metricsgraphics.css');
|
||||
|
||||
// Vendor JS
|
||||
require('angular');
|
||||
require('mousetrap');
|
||||
require('bootstrap/dist/js/bootstrap');
|
||||
// The official 'flot' NPM package is out of date, so we're using 'jquery.flot'
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
import angular from 'angular';
|
||||
|
||||
import perf from '../../perf';
|
||||
|
||||
perf.controller('GraphsCtrl', [
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
import angular from 'angular';
|
||||
import numeral from 'numeral';
|
||||
|
||||
import treeherder from './treeherder';
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
import angular from 'angular';
|
||||
|
||||
import treeherderModule from './treeherder';
|
||||
|
||||
const logViewerApp = angular.module('logviewer', [treeherderModule.name]);
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
import angular from 'angular';
|
||||
|
||||
import treeherder from '../treeherder';
|
||||
|
||||
treeherder.factory('ThBugJobMapModel', [
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
import angular from 'angular';
|
||||
|
||||
import treeherder from '../treeherder';
|
||||
|
||||
treeherder.factory('ThBuildPlatformModel', [
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
import angular from 'angular';
|
||||
|
||||
import treeherder from '../treeherder';
|
||||
|
||||
treeherder.factory('ThJobClassificationModel', [
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
import angular from 'angular';
|
||||
|
||||
import treeherder from '../treeherder';
|
||||
|
||||
treeherder.factory('ThFailureLinesModel', [
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
import angular from 'angular';
|
||||
|
||||
import treeherder from '../treeherder';
|
||||
|
||||
treeherder.factory('ThJobModel', [
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
import angular from 'angular';
|
||||
|
||||
import treeherder from '../treeherder';
|
||||
|
||||
treeherder.factory('ThJobGroupModel', [
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
import angular from 'angular';
|
||||
|
||||
import treeherder from '../treeherder';
|
||||
|
||||
treeherder.factory('ThJobLogUrlModel', [
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
import angular from 'angular';
|
||||
|
||||
import treeherder from '../treeherder';
|
||||
|
||||
treeherder.factory('ThJobTypeModel', [
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
import angular from 'angular';
|
||||
|
||||
import treeherder from '../treeherder';
|
||||
|
||||
treeherder.factory('ThMatcherModel', [
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
import angular from 'angular';
|
||||
import jsyaml from 'js-yaml';
|
||||
import { Queue, slugid } from 'taskcluster-client-web';
|
||||
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
import angular from 'angular';
|
||||
|
||||
import treeherder from '../treeherder';
|
||||
|
||||
treeherder.factory('ThRunnableJobModel', [
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
import angular from 'angular';
|
||||
|
||||
import treeherder from '../treeherder';
|
||||
|
||||
treeherder.factory('ThTextLogErrorsModel', [
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
import angular from 'angular';
|
||||
|
||||
import treeherder from '../treeherder';
|
||||
|
||||
treeherder.factory('ThUserModel', [
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
import angular from 'angular';
|
||||
import angularClipboardModule from 'angular-clipboard';
|
||||
import uiBootstrap from 'angular1-ui-bootstrap4';
|
||||
import uiRouter from 'angular-ui-router';
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
import angular from 'angular';
|
||||
import ngResource from 'angular-resource';
|
||||
import ngSanitize from 'angular-sanitize';
|
||||
import LocalStorageModule from 'angular-local-storage';
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
import angular from 'angular';
|
||||
import angularToArrayfilter from 'angular-toarrayfilter';
|
||||
import hcMarked from 'angular-marked';
|
||||
import ngReactModule from 'ngreact';
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
import angular from 'angular';
|
||||
|
||||
const userguideApp = angular.module('userguide', []);
|
||||
|
||||
userguideApp.config(['$compileProvider', function ($compileProvider) {
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
import angular from 'angular';
|
||||
|
||||
import treeherder from '../../js/treeherder';
|
||||
|
||||
treeherder.controller('BugsPluginCtrl', [
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
import angular from 'angular';
|
||||
|
||||
import treeherder from '../../js/treeherder';
|
||||
import { getBtnClass, getStatus } from "../../helpers/jobHelper";
|
||||
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
import angular from 'angular';
|
||||
|
||||
import treeherder from '../js/treeherder';
|
||||
|
||||
treeherder.factory('thTabs', [
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
import angular from 'angular';
|
||||
|
||||
/* From: http://stackoverflow.com/a/22253161/295132 (author: Mario Campa) */
|
||||
angular.module('mc.resizer', []).directive('resizer', ['$document', function($document) {
|
||||
return function($scope, $element, $attrs) {
|
||||
|
|
Загрузка…
Ссылка в новой задаче