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

Remove angular-translate #13066

Merged
merged 3 commits into from
Jan 12, 2018
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
186 changes: 0 additions & 186 deletions docs/development/plugin/development-internationalization.asciidoc

This file was deleted.

2 changes: 0 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,6 @@
"angular-route": "1.4.7",
"angular-sanitize": "1.5.7",
"angular-sortable-view": "0.0.15",
"angular-translate": "2.13.1",
"autoprefixer": "6.5.4",
"babel-core": "6.21.0",
"babel-jest": "21.0.0",
Expand Down Expand Up @@ -241,7 +240,6 @@
"faker": "1.1.0",
"getopts": "2.0.0",
"grunt": "1.0.1",
"grunt-angular-translate": "0.3.0",
"grunt-aws-s3": "0.14.5",
"grunt-babel": "6.0.0",
"grunt-cli": "0.1.13",
Expand Down
3 changes: 0 additions & 3 deletions src/ui/public/debounce/__tests__/debounce.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,6 @@ function init() {

debounce = $injector.get('debounce');
debounceFromProvider = Private(DebounceProvider);

// ensure there is a clean slate before testing deferred tasks
$timeout.flush();
Copy link
Contributor

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 needs to be removed?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It does need to be removed. I'll be honestly, I'm not sure why exactly, but something angular-translate was doing required this. Prior to removing this, the tests failed with an error related to there being nothing to flush, and since this line was added in the original PR and tests now pass without it, it seemed unnecessary. If this was not a test file, I would have dug into it more to understand what's going on, but it just didn't feel worth digging deep into since my goal here is essentially to undo that original PR anyway.

});
}

Expand Down
11 changes: 2 additions & 9 deletions tasks/build/verify_translations.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,7 @@ import { collectUiExports } from '../../src/ui';
import { I18n } from '../../src/ui/ui_i18n/i18n';

export default function (grunt) {

grunt.registerTask('_build:verifyTranslations', [
'i18nextract',
'_build:check'
]);

grunt.registerTask('_build:check', async function () {
grunt.registerTask('_build:verifyTranslations', async function () {
const done = this.async();

try {
Expand All @@ -36,8 +30,7 @@ export default function (grunt) {
}

async function verifyTranslations(uiExports) {
const angularTranslations = require(fromRoot('build/i18n_extract/en.json'));
const keysUsedInViews = Object.keys(angularTranslations);
const keysUsedInViews = [];

// Search files for used translation keys
const translationPatterns = [
Expand Down
9 changes: 0 additions & 9 deletions tasks/config/i18nextract.js

This file was deleted.

3 changes: 1 addition & 2 deletions webpackShims/angular.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
require('jquery');
require('../node_modules/angular/angular');
require('../node_modules/angular-translate');
module.exports = window.angular;

require('../node_modules/angular-elastic/elastic');

require('ui/modules').get('kibana', ['monospaced.elastic', 'pascalprecht.translate']);
require('ui/modules').get('kibana', ['monospaced.elastic']);
12 changes: 2 additions & 10 deletions webpackShims/ui-bootstrap.js
Original file line number Diff line number Diff line change
@@ -1,17 +1,9 @@
require('angular');
require('ui/angular-bootstrap');
var uiModules = require('ui/modules').uiModules;
var chrome = require('ui/chrome');

var kibana = uiModules.get('kibana', ['ui.bootstrap', 'pascalprecht.translate']);
var kibana = uiModules.get('kibana', ['ui.bootstrap']);

module.exports = kibana.config(function ($tooltipProvider) {
$tooltipProvider.setTriggers({ 'mouseenter': 'mouseleave click' });
})
.config(function ($translateProvider) {
$translateProvider.translations('default', chrome.getTranslations());
$translateProvider.preferredLanguage('default');
// Enable escaping of HTML
// issue in https://angular-translate.github.io/docs/#/guide/19_security
$translateProvider.useSanitizeValueStrategy('escape');
});
});
26 changes: 3 additions & 23 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -306,13 +306,7 @@ [email protected]:
version "0.0.15"
resolved "https://registry.yarnpkg.com/angular-sortable-view/-/angular-sortable-view-0.0.15.tgz#e8463df909db83d641b028f0773a10d50292874f"

[email protected]:
version "2.13.1"
resolved "https://registry.yarnpkg.com/angular-translate/-/angular-translate-2.13.1.tgz#05673eb371986fc11edc151f590299d7e0c46228"
dependencies:
angular ">=1.2.26 <=1.6"

[email protected], angular@>=1.0.6, "angular@>=1.2.26 <=1.6":
[email protected], angular@>=1.0.6:
version "1.6.5"
resolved "https://registry.yarnpkg.com/angular/-/angular-1.6.5.tgz#37f788eebec5ce2e3fa02b17bbcb2a231576a0d6"

Expand Down Expand Up @@ -4157,12 +4151,6 @@ flat-cache@^1.2.1:
graceful-fs "^4.1.2"
write "^0.2.1"

flat@^1.2.0:
version "1.6.1"
resolved "https://registry.yarnpkg.com/flat/-/flat-1.6.1.tgz#476b9dbb70d5e9340dbbc038bde084a20945921c"
dependencies:
is-buffer "~1.1.2"

flatten@^1.0.2:
version "1.0.2"
resolved "https://registry.yarnpkg.com/flatten/-/flatten-1.0.2.tgz#dae46a9d78fbe25292258cc1e780a41d95c03782"
Expand Down Expand Up @@ -4698,14 +4686,6 @@ growly@^1.3.0:
version "1.3.0"
resolved "https://registry.yarnpkg.com/growly/-/growly-1.3.0.tgz#f10748cbe76af964b7c96c93c6bcc28af120c081"

[email protected]:
version "0.3.0"
resolved "https://registry.yarnpkg.com/grunt-angular-translate/-/grunt-angular-translate-0.3.0.tgz#bd0118afa24d8f570231fd8d52d829d808c511b3"
dependencies:
flat "^1.2.0"
json-stable-stringify "^1.0.0"
lodash "~2.4.1"

[email protected]:
version "0.14.5"
resolved "https://registry.yarnpkg.com/grunt-aws-s3/-/grunt-aws-s3-0.14.5.tgz#f55019acfbeb05b89b245a51ccf1a81dbf868df4"
Expand Down Expand Up @@ -5588,7 +5568,7 @@ is-binary-path@^1.0.0:
dependencies:
binary-extensions "^1.0.0"

is-buffer@^1.0.2, is-buffer@^1.1.4, is-buffer@^1.1.5, is-buffer@~1.1.2:
is-buffer@^1.0.2, is-buffer@^1.1.4, is-buffer@^1.1.5:
version "1.1.6"
resolved "https://registry.yarnpkg.com/is-buffer/-/is-buffer-1.1.6.tgz#efaa2ea9daa0d7ab2ea13a97b2b8ad51fefbe8be"

Expand Down Expand Up @@ -6482,7 +6462,7 @@ json-stable-stringify-without-jsonify@^1.0.1:
version "1.0.1"
resolved "https://registry.yarnpkg.com/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz#9db7b59496ad3f3cfef30a75142d2d930ad72651"

json-stable-stringify@^1.0.0, json-stable-stringify@^1.0.1:
json-stable-stringify@^1.0.1:
version "1.0.1"
resolved "https://registry.yarnpkg.com/json-stable-stringify/-/json-stable-stringify-1.0.1.tgz#9a759d39c5f2ff503fd5300646ed445f88c4f9af"
dependencies:
Expand Down