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

[i18n][system upgrade] Upgrade Intl Packages from v2 to v6 #179506

Merged
merged 91 commits into from
Jun 2, 2024
Merged
Show file tree
Hide file tree
Changes from 59 commits
Commits
Show all changes
91 commits
Select commit Hold shift + click to select a range
0791354
upgrade packages
Bamieh Mar 27, 2024
57b3392
progress so far
Bamieh Apr 8, 2024
f0af2c1
fix kbn-i18n test cases
Bamieh Apr 8, 2024
37d2665
merge main
Bamieh Apr 8, 2024
ef3f2b6
more i18n fixes
Bamieh Apr 8, 2024
f269303
mock Provider to init i18n at jest level
Bamieh Apr 8, 2024
f51d59c
remove init
Bamieh Apr 11, 2024
196ce7d
code review changes
Bamieh Apr 11, 2024
81baedb
merge main, run linter, PR ready
Bamieh Apr 24, 2024
6657bdd
codereview updates
Bamieh May 6, 2024
c773321
merge main
Bamieh May 7, 2024
f75b609
revert observability_solution linter changes
Bamieh May 7, 2024
5fbd063
revert observability_solution linter changes
Bamieh May 7, 2024
706a652
i18n fixes to reverted files
Bamieh May 7, 2024
1f6d244
fix maps plugin escaping situation
Bamieh May 7, 2024
03ef603
revert obs solution linter changes
Bamieh May 7, 2024
cd59f2d
Merge branch 'main' of github.com:elastic/kibana into intl_pack_upgrade
Bamieh May 7, 2024
931ff5d
run i18n_check
Bamieh May 7, 2024
5a1bc70
remove yarn.lock duplicates
Bamieh May 7, 2024
910e32f
update codeowners and run linter
Bamieh May 8, 2024
17eb85f
update codeowners and run linter
Bamieh May 8, 2024
408c833
Merge branch 'main' of github.com:elastic/kibana into intl_pack_upgrade
Bamieh May 8, 2024
2f468a7
fix linter type bug
Bamieh May 8, 2024
027f61d
fix checker
Bamieh May 8, 2024
d0e9be8
fix jest enzyme
Bamieh May 14, 2024
515c5c9
merge main
Bamieh May 14, 2024
e446c0a
[CI] Auto-commit changed files from 'node scripts/lint_ts_projects --…
kibanamachine May 14, 2024
3f380f5
fix types and module resolution
Bamieh May 15, 2024
89a9b8b
Merge branch 'intl_pack_upgrade' of github.com:Bamieh/kibana into int…
Bamieh May 15, 2024
aa3c57f
fix enzyme helpers
Bamieh May 16, 2024
db4c286
update ml snapshots and messages
Bamieh May 16, 2024
e461d08
merge main
Bamieh May 16, 2024
33dd416
update src/plugins snapshots
Bamieh May 16, 2024
94f1f6d
[CI] Auto-commit changed files from 'node scripts/lint_ts_projects --…
kibanamachine May 16, 2024
ff66bbb
fix tests
Bamieh May 18, 2024
f1df11d
Merge branch 'intl_pack_upgrade' of github.com:Bamieh/kibana into int…
Bamieh May 18, 2024
f3eeda8
[CI] Auto-commit changed files from 'node scripts/lint_ts_projects --…
kibanamachine May 18, 2024
433d9dd
more test fixes
Bamieh May 18, 2024
1aa48aa
Merge branch 'intl_pack_upgrade' of github.com:Bamieh/kibana into int…
Bamieh May 18, 2024
737d9bc
[CI] Auto-commit changed files from 'node scripts/lint_ts_projects --…
kibanamachine May 18, 2024
429263a
fix all tests
Bamieh May 18, 2024
d9c32c8
Merge branch 'intl_pack_upgrade' of github.com:Bamieh/kibana into int…
Bamieh May 18, 2024
33a944b
ftr test fix
Bamieh May 18, 2024
5226361
merge main
Bamieh May 18, 2024
09637a9
more snapshot updates
Bamieh May 19, 2024
ffb71ab
update alerting rules
Bamieh May 19, 2024
954a48a
[CI] Auto-commit changed files from 'node scripts/lint_ts_projects --…
kibanamachine May 19, 2024
d68c470
fix ftr i18n tests
Bamieh May 19, 2024
8152385
Merge branch 'intl_pack_upgrade' of github.com:Bamieh/kibana into int…
Bamieh May 19, 2024
46b6105
more snapshot tests fixes
Bamieh May 19, 2024
a12c634
fix jest tests
Bamieh May 19, 2024
ca78e6e
[CI] Auto-commit changed files from 'node scripts/lint_ts_projects --…
kibanamachine May 19, 2024
0fb5792
Merge branch 'main' of github.com:elastic/kibana into intl_pack_upgrade
Bamieh May 22, 2024
df69a99
Merge branch 'intl_pack_upgrade' of github.com:Bamieh/kibana into int…
Bamieh May 22, 2024
370ee39
2nd ftr fix
Bamieh May 22, 2024
84ea023
fix web worker issue
Bamieh May 22, 2024
08092ff
more ftr fixes
Bamieh May 22, 2024
27e32b1
all resolved???
Bamieh May 22, 2024
3ade053
wrap with joblist with <I18nProvider>
Bamieh May 22, 2024
37022cd
final ftr failing
Bamieh May 23, 2024
5bebdd4
Merge branch 'main' of github.com:elastic/kibana into intl_pack_upgrade
Bamieh May 23, 2024
c76ed04
try to revert dev docs unnecessary change
Bamieh May 23, 2024
5c806f3
Merge branch 'main' of github.com:elastic/kibana into intl_pack_upgrade
Bamieh May 23, 2024
a87bd92
ignore tags
Bamieh May 24, 2024
0c67424
Merge branch 'main' of github.com:elastic/kibana into intl_pack_upgrade
Bamieh May 24, 2024
f7ee537
fix jest tests
Bamieh May 25, 2024
056a7db
Merge branch 'main' of github.com:elastic/kibana into intl_pack_upgrade
Bamieh May 25, 2024
a3516db
fix more tests
Bamieh May 25, 2024
56b6707
Merge branch 'main' of github.com:elastic/kibana into intl_pack_upgrade
Bamieh May 25, 2024
cc484bc
fix jest test
Bamieh May 25, 2024
229363c
return empty object instead of undefiend
Bamieh May 25, 2024
f670781
revert last commit apm change
Bamieh May 26, 2024
9cc6ad7
Merge branch 'main' of github.com:elastic/kibana into intl_pack_upgrade
Bamieh May 27, 2024
5473ed6
fix newly failed jest test
Bamieh May 27, 2024
a72df75
[CI] Auto-commit changed files from 'node scripts/lint_ts_projects --…
kibanamachine May 27, 2024
53219e7
Merge branch 'main' of github.com:elastic/kibana into intl_pack_upgrade
Bamieh May 27, 2024
806c0ef
Merge branch 'intl_pack_upgrade' of github.com:Bamieh/kibana into int…
Bamieh May 27, 2024
cffa876
Merge branch 'main' into intl_pack_upgrade
kibanamachine May 27, 2024
bef49c6
Merge branch 'main' into intl_pack_upgrade
kibanamachine May 27, 2024
e6602f7
fix(NA): yarn lock file
mistic May 27, 2024
27e0121
Merge branch 'main' into intl_pack_upgrade
kibanamachine May 27, 2024
85bb769
Merge branch 'main' of github.com:elastic/kibana into intl_pack_upgrade
Bamieh May 27, 2024
18ae5ac
Merge branch 'intl_pack_upgrade' of github.com:Bamieh/kibana into int…
Bamieh May 27, 2024
57897c6
Merge branch 'main' into intl_pack_upgrade
kibanamachine May 28, 2024
46284e5
Merge branch 'main' into intl_pack_upgrade
kibanamachine May 28, 2024
3c59599
Merge branch 'main' into intl_pack_upgrade
kibanamachine May 28, 2024
fede365
merge main and fix snapshot
Bamieh Jun 2, 2024
71507f1
fix test missing i18n provider
Bamieh Jun 2, 2024
562eb1d
add formatter test for nospace and fix 0ms not 155ms
Bamieh Jun 2, 2024
1473b8b
skip failing journeys on main
Bamieh Jun 2, 2024
b080cf2
2 more journeys
Bamieh Jun 2, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
17 changes: 16 additions & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,22 @@ module.exports = {
'jsx-a11y/click-events-have-key-events': 'off',
},
},

/**
* FormatJS linter for i18n code.
* https://formatjs.io/docs/tooling/linter
*/
{
files: [
'src/**/*.{js,mjs,ts,tsx}',
'x-pack/**/*.{js,mjs,ts,tsx}',
'packages/**/*.{js,mjs,ts,tsx}',
],
plugins: ['formatjs'],
rules: {
'formatjs/enforce-default-message': ['error', 'anything'],
'formatjs/enforce-description': 'off',
},
},
/**
* Files that require dual-license headers, settings
* are overridden below for files that require Elastic
Expand Down
1 change: 1 addition & 0 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -1245,6 +1245,7 @@ x-pack/test/observability_ai_assistant_functional @elastic/obs-ai-assistant
/config/ @elastic/kibana-core
/typings/ @elastic/kibana-core
/test/analytics @elastic/kibana-core
/packages/kbn-test/src/jest/setup/mocks.kbn_i18n_react.js @elastic/kibana-core
/x-pack/test/saved_objects_field_count/ @elastic/kibana-core
/x-pack/test_serverless/**/test_suites/common/saved_objects_management/ @elastic/kibana-core
/x-pack/test_serverless/api_integration/test_suites/common/core/ @elastic/kibana-core
Expand Down
3 changes: 3 additions & 0 deletions dev_docs/tutorials/advanced_settings.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,9 @@ export class ChartsServerPlugin implements Plugin<object, object> {
description: i18n.translate('charts.advancedSettings.visualization.colorMappingText', {
defaultMessage:
'Maps values to specific colors in charts using the <strong>Compatibility</strong> palette.',
values: {
strong: (chunks) => `<strong>${chunks}</strong>`,
},
}),
deprecation: {
message: i18n.translate(
Expand Down
20 changes: 11 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@
"**/globule/minimatch": "^3.1.2",
"**/hoist-non-react-statics": "^3.3.2",
"**/isomorphic-fetch/node-fetch": "^2.6.7",
"**/react-intl/**/@types/react": "^17.0.45",
"**/remark-parse/trim": "1.0.1",
"**/sharp": "0.32.6",
"**/typescript": "4.9.5",
Expand Down Expand Up @@ -124,6 +125,11 @@
"@emotion/server": "^11.11.0",
"@emotion/styled": "^11.11.0",
"@faker-js/faker": "^8.3.1",
"@formatjs/icu-messageformat-parser": "^2.7.6",
"@formatjs/intl": "^2.10.2",
"@formatjs/intl-pluralrules": "^5.2.12",
"@formatjs/intl-relativetimeformat": "^11.2.12",
"@formatjs/intl-utils": "^3.8.4",
"@grpc/grpc-js": "^1.6.8",
"@hapi/accept": "^5.0.2",
"@hapi/boom": "^9.1.4",
Expand Down Expand Up @@ -1028,11 +1034,6 @@
"icalendar": "0.7.1",
"immer": "^9.0.21",
"inquirer": "^7.3.3",
"intl": "^1.2.5",
"intl-format-cache": "^2.1.0",
"intl-messageformat": "^2.2.0",
"intl-messageformat-parser": "^1.4.0",
"intl-relativeformat": "^2.1.0",
"io-ts": "^2.0.5",
"ipaddr.js": "2.0.0",
"isbinaryfile": "4.0.2",
Expand Down Expand Up @@ -1108,7 +1109,7 @@
"react-fast-compare": "^2.0.4",
"react-grid-layout": "^1.3.4",
"react-hook-form": "^7.44.2",
"react-intl": "^2.8.0",
"react-intl": "6.6.6",
"react-is": "^17.0.2",
"react-markdown": "^6.0.3",
"react-monaco-editor": "^0.54.0",
Expand Down Expand Up @@ -1219,6 +1220,8 @@
"@elastic/synthetics": "^1.5.0",
"@emotion/babel-preset-css-prop": "^11.11.0",
"@emotion/jest": "^11.11.0",
"@formatjs/cli": "^6.2.8",
"@formatjs/cli-lib": "^6.3.8",
"@frsource/cypress-plugin-visual-regression-diff": "^3.3.10",
"@istanbuljs/nyc-config-typescript": "^1.0.2",
"@istanbuljs/schema": "^0.1.2",
Expand Down Expand Up @@ -1452,7 +1455,6 @@
"@types/hjson": "^2.4.2",
"@types/http-proxy": "^1.17.4",
"@types/inquirer": "^7.3.1",
"@types/intl-relativeformat": "^2.1.0",
"@types/jest": "^29.5.3",
"@types/jquery": "^3.3.31",
"@types/js-levenshtein": "^1.1.0",
Expand Down Expand Up @@ -1503,7 +1505,6 @@
"@types/react": "^17.0.45",
"@types/react-dom": "^17.0.17",
"@types/react-grid-layout": "^1.3.2",
"@types/react-intl": "^2.3.15",
"@types/react-is": "^17.0.3",
"@types/react-recompose": "^0.33.4",
"@types/react-router": "^5.1.20",
Expand Down Expand Up @@ -1590,11 +1591,12 @@
"ejs": "^3.1.10",
"enzyme": "^3.11.0",
"enzyme-to-json": "^3.6.2",
"eslint": "^8.46.0",
"eslint": "^8.57.0",
"eslint-config-prettier": "^9.0.0",
"eslint-plugin-ban": "^1.6.0",
"eslint-plugin-cypress": "^2.15.1",
"eslint-plugin-eslint-comments": "^3.2.0",
"eslint-plugin-formatjs": "^4.12.2",
"eslint-plugin-import": "^2.28.0",
"eslint-plugin-jest": "^27.2.3",
"eslint-plugin-jsx-a11y": "^6.7.1",
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
*/

import React from 'react';
import { mount } from 'enzyme';
import { mountWithIntl } from '@kbn/test-jest-helpers';
import { ServerStatus } from './server_status';
import { StatusState } from '../lib';

Expand All @@ -22,7 +22,7 @@ const getStatus = (parts: Partial<StatusState> = {}): StatusState => ({
describe('ServerStatus', () => {
it('renders correctly for green state', () => {
const status = getStatus();
const component = mount(<ServerStatus serverState={status} name="My Computer" />);
const component = mountWithIntl(<ServerStatus serverState={status} name="My Computer" />);
expect(component.find('EuiTitle').text()).toMatchInlineSnapshot(`"Kibana status is Green"`);
expect(component.find('EuiBadge').render()).toMatchSnapshot();
});
Expand All @@ -32,7 +32,7 @@ describe('ServerStatus', () => {
id: 'degraded',
title: 'Yellow',
});
const component = mount(<ServerStatus serverState={status} name="My Computer" />);
const component = mountWithIntl(<ServerStatus serverState={status} name="My Computer" />);
expect(component.find('EuiTitle').text()).toMatchInlineSnapshot(`"Kibana status is Yellow"`);
expect(component.find('EuiBadge').render()).toMatchSnapshot();
});
Expand All @@ -42,16 +42,16 @@ describe('ServerStatus', () => {
id: 'unavailable',
title: 'Red',
});
const component = mount(<ServerStatus serverState={status} name="My Computer" />);
const component = mountWithIntl(<ServerStatus serverState={status} name="My Computer" />);
expect(component.find('EuiTitle').text()).toMatchInlineSnapshot(`"Kibana status is Red"`);
expect(component.find('EuiBadge').render()).toMatchSnapshot();
});

it('displays the correct `name`', () => {
let component = mount(<ServerStatus serverState={getStatus()} name="Localhost" />);
let component = mountWithIntl(<ServerStatus serverState={getStatus()} name="Localhost" />);
expect(component.find('EuiText').text()).toMatchInlineSnapshot(`"Localhost"`);

component = mount(<ServerStatus serverState={getStatus()} name="Kibana" />);
component = mountWithIntl(<ServerStatus serverState={getStatus()} name="Kibana" />);
expect(component.find('EuiText').text()).toMatchInlineSnapshot(`"Kibana"`);
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -560,19 +560,17 @@ describe('breadcrumbs', () => {
<EuiContextMenuItem
icon="gear"
>
<FormattedMessage
<Memo(MemoizedFormattedMessage)
defaultMessage="Manage project"
id="core.ui.primaryNav.cloud.linkToProject"
values={Object {}}
/>
</EuiContextMenuItem>,
<EuiContextMenuItem
icon="grid"
>
<FormattedMessage
<Memo(MemoizedFormattedMessage)
defaultMessage="View all projects"
id="core.ui.primaryNav.cloud.linkToAllProjects"
values={Object {}}
/>
</EuiContextMenuItem>,
]
Expand Down Expand Up @@ -625,19 +623,17 @@ describe('breadcrumbs', () => {
<EuiContextMenuItem
icon="gear"
>
<FormattedMessage
<Memo(MemoizedFormattedMessage)
defaultMessage="Manage project"
id="core.ui.primaryNav.cloud.linkToProject"
values={Object {}}
/>
</EuiContextMenuItem>,
<EuiContextMenuItem
icon="grid"
>
<FormattedMessage
<Memo(MemoizedFormattedMessage)
defaultMessage="View all projects"
id="core.ui.primaryNav.cloud.linkToAllProjects"
values={Object {}}
/>
</EuiContextMenuItem>,
]
Expand Down Expand Up @@ -684,19 +680,17 @@ describe('breadcrumbs', () => {
<EuiContextMenuItem
icon="gear"
>
<FormattedMessage
<Memo(MemoizedFormattedMessage)
defaultMessage="Manage project"
id="core.ui.primaryNav.cloud.linkToProject"
values={Object {}}
/>
</EuiContextMenuItem>,
<EuiContextMenuItem
icon="grid"
>
<FormattedMessage
<Memo(MemoizedFormattedMessage)
defaultMessage="View all projects"
id="core.ui.primaryNav.cloud.linkToAllProjects"
values={Object {}}
/>
</EuiContextMenuItem>,
]
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading