mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 17:59:23 -04:00
Do not use angular debug mode unless in development (#8891)
Backports PR #7929 **Commit 1:** fix #7125 - disable angular debug info * Original sha:b3957a968f
* Authored by ppisljar <peter.pisljar@gmail.com> on 2016-08-04T08:25:47Z **Commit 2:** fix #7125 - disable angular debug info * Original sha:39728089d1
* Authored by ppisljar <peter.pisljar@gmail.com> on 2016-08-04T08:26:09Z **Commit 3:** updating to disable debug info when environment name is set to production * Original sha:268fdb5cbe
* Authored by ppisljar <peter.pisljar@gmail.com> on 2016-08-04T10:02:00Z **Commit 4:** using --dev flag * Original sha:d1c6ce47ad
* Authored by ppisljar <peter.pisljar@gmail.com> on 2016-08-11T16:26:12Z **Commit 5:** updating tests to not depend on angular.scope() * Original sha:4f83b21a85
* Authored by ppisljar <peter.pisljar@gmail.com> on 2016-10-03T09:39:29Z
This commit is contained in:
parent
8e22a9e039
commit
ad43652e4a
5 changed files with 10 additions and 48 deletions
|
@ -69,6 +69,7 @@ export default async (kbnServer, server, config) => {
|
|||
buildSha: config.get('pkg.buildSha'),
|
||||
basePath: config.get('server.basePath'),
|
||||
serverName: config.get('server.name'),
|
||||
devMode: config.get('env.dev'),
|
||||
uiSettings: {
|
||||
defaults: await server.uiSettings().getDefaults(),
|
||||
user: {}
|
||||
|
|
|
@ -10,7 +10,9 @@ describe('Chrome API :: Angular', () => {
|
|||
getInjected: noop,
|
||||
addBasePath: noop
|
||||
};
|
||||
kbnAngular(chrome, {});
|
||||
kbnAngular(chrome, {
|
||||
devMode: true
|
||||
});
|
||||
});
|
||||
it('should return breadcrumbs based on the url', () => {
|
||||
});
|
||||
|
|
6
src/ui/public/chrome/api/angular.js
vendored
6
src/ui/public/chrome/api/angular.js
vendored
|
@ -8,7 +8,6 @@ import { UrlOverflowServiceProvider } from '../../error_url_overflow';
|
|||
const URL_LIMIT_WARN_WITHIN = 1000;
|
||||
|
||||
module.exports = function (chrome, internals) {
|
||||
|
||||
chrome.getFirstPathSegment = _.noop;
|
||||
chrome.getBreadcrumbs = _.noop;
|
||||
|
||||
|
@ -33,6 +32,11 @@ module.exports = function (chrome, internals) {
|
|||
return a.href;
|
||||
}()))
|
||||
.config(chrome.$setupXsrfRequestInterceptor)
|
||||
.config(['$compileProvider', function ($compileProvider) {
|
||||
if (!internals.devMode) {
|
||||
$compileProvider.debugInfoEnabled(false);
|
||||
}
|
||||
}])
|
||||
.run(($location, $rootScope, Private) => {
|
||||
chrome.getFirstPathSegment = () => {
|
||||
return $location.path().split('/')[1];
|
||||
|
|
|
@ -24,6 +24,7 @@ const internals = _.defaults(
|
|||
rootTemplate: null,
|
||||
showAppsLink: null,
|
||||
xsrfToken: null,
|
||||
devMode: true,
|
||||
brand: null,
|
||||
nav: [],
|
||||
applicationClasses: []
|
||||
|
|
|
@ -109,21 +109,6 @@ export default class Common {
|
|||
self.debug('returned from get, calling refresh');
|
||||
return self.remote.refresh();
|
||||
})
|
||||
.then(function () {
|
||||
self.debug('check testStatusPage');
|
||||
if (testStatusPage !== false) {
|
||||
self.debug('self.checkForKibanaApp()');
|
||||
return self.checkForKibanaApp()
|
||||
.then(function (kibanaLoaded) {
|
||||
self.debug('kibanaLoaded = ' + kibanaLoaded);
|
||||
if (!kibanaLoaded) {
|
||||
var msg = 'Kibana is not loaded, retrying';
|
||||
self.debug(msg);
|
||||
throw new Error(msg);
|
||||
}
|
||||
});
|
||||
}
|
||||
})
|
||||
.then(function () {
|
||||
return self.remote.getCurrentUrl();
|
||||
})
|
||||
|
@ -215,37 +200,6 @@ export default class Common {
|
|||
});
|
||||
}
|
||||
|
||||
getApp() {
|
||||
var self = this;
|
||||
|
||||
return self.remote.setFindTimeout(defaultFindTimeout)
|
||||
.findByCssSelector('.app-wrapper .application')
|
||||
.then(function () {
|
||||
return self.runScript(function () {
|
||||
var $ = window.$;
|
||||
var $scope = $('.app-wrapper .application').scope();
|
||||
return $scope ? $scope.chrome.getApp() : {};
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
checkForKibanaApp() {
|
||||
var self = this;
|
||||
|
||||
return self.getApp()
|
||||
.then(function (app) {
|
||||
var appId = app.id;
|
||||
self.debug('current application: ' + appId);
|
||||
return appId === 'kibana';
|
||||
})
|
||||
.catch(function (err) {
|
||||
self.debug('kibana check failed');
|
||||
self.debug(err);
|
||||
// not on the kibana app...
|
||||
return false;
|
||||
});
|
||||
}
|
||||
|
||||
tryForTime(timeout, block) {
|
||||
return Try.tryForTime(timeout, block);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue