Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ngSanitize] add explicit dependencies to all uses of ngSanitize angular module #64546

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@
// these are necessary to bootstrap the local angular.
// They can stay even after NP cutover
import angular from 'angular';
// required for `ngSanitize` angular module
import 'angular-sanitize';
import { EuiIcon } from '@elastic/eui';
import { i18nDirective, i18nFilter, I18nProvider } from '@kbn/i18n/angular';
import { CoreStart, LegacyCoreStart } from 'kibana/public';
Expand Down
2 changes: 2 additions & 0 deletions src/legacy/core_plugins/timelion/public/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@
*/

import _ from 'lodash';
// required for `ngSanitize` angular module
import 'angular-sanitize';

import { i18n } from '@kbn/i18n';

Expand Down
1 change: 1 addition & 0 deletions src/legacy/ui/public/angular_ui_select.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@

import 'jquery';
import 'angular';
// required for `ngSanitize` angular module
import 'angular-sanitize';
import 'ui-select/dist/select';

Expand Down
1 change: 1 addition & 0 deletions src/legacy/ui/public/i18n/index.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import { render } from 'enzyme';
import PropTypes from 'prop-types';
import React from 'react';

jest.mock('angular-sanitize', () => {});
jest.mock('ui/new_platform', () => ({
npStart: {
core: {
Expand Down
2 changes: 2 additions & 0 deletions src/legacy/ui/public/i18n/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@
*/

import React from 'react';
// required for `ngSanitize` angular module
import 'angular-sanitize';

import { i18nDirective, i18nFilter, I18nProvider } from '@kbn/i18n/angular';
// @ts-ignore
Expand Down
2 changes: 2 additions & 0 deletions src/plugins/dashboard/public/application/application.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ import './index.scss';

import { EuiIcon } from '@elastic/eui';
import angular, { IModule } from 'angular';
// required for `ngSanitize` angular module
import 'angular-sanitize';
import { i18nDirective, i18nFilter, I18nProvider } from '@kbn/i18n/angular';
import {
AppMountContext,
Expand Down
2 changes: 2 additions & 0 deletions src/plugins/vis_type_table/public/get_inner_angular.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@
// these are necessary to bootstrap the local angular.
// They can stay even after NP cutover
import angular from 'angular';
// required for `ngSanitize` angular module
import 'angular-sanitize';
import 'angular-recursion';
import { i18nDirective, i18nFilter, I18nProvider } from '@kbn/i18n/angular';
import { CoreStart, IUiSettingsClient, PluginInitializerContext } from 'kibana/public';
Expand Down
2 changes: 2 additions & 0 deletions src/plugins/visualize/public/application/application.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@
import './index.scss';

import angular, { IModule } from 'angular';
// required for `ngSanitize` angular module
import 'angular-sanitize';
import { i18nDirective, i18nFilter, I18nProvider } from '@kbn/i18n/angular';

import { AppMountContext } from 'kibana/public';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
*/

import angular, { IWindowService } from 'angular';
// required for `ngSanitize` angular module
import 'angular-sanitize';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I actually already have this in my NP pr here Maybe this can be removed then? (to avoid merge conflicts). I can just add the comment so it follows the same pattern. wdyt?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think this will cause merge conflicts if the change is the same, and we probably shouldn't add a dependency on that PR to make this PR "complete"

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's the same, but I moved everything outside the legacy directory (and the file name is also different) thus github won't track it as same (and won't do its "auto-merge" magic).

Just thought I should bring it up, so you're not confused with the deleted modules.ts file when trying to merge and resolve conflicts (if my PR goes into master first that is)

import { i18nDirective, i18nFilter, I18nProvider } from '@kbn/i18n/angular';

import { AppMountContext } from 'kibana/public';
Expand Down
2 changes: 1 addition & 1 deletion x-pack/plugins/graph/public/application.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
import angular from 'angular';
import { i18nDirective, i18nFilter, I18nProvider } from '@kbn/i18n/angular';
import '../../../../webpackShims/ace';
// required for i18nIdDirective
// required for i18nIdDirective and `ngSanitize` angular module
import 'angular-sanitize';
// required for ngRoute
import 'angular-route';
Expand Down