Skip to content

Commit d5ff1df

Browse files
Merge branch 'master' into kertal-pr-2020-09-28-fix-advanced-settings-array-input
2 parents 65c3d0e + 1ba706c commit d5ff1df

File tree

33 files changed

+363
-57
lines changed

33 files changed

+363
-57
lines changed

examples/bfetch_explorer/tsconfig.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
],
1414
"exclude": [],
1515
"references": [
16-
{ "path": "../../src/core/tsconfig.json" }
16+
{ "path": "../../src/core/tsconfig.json" },
17+
{ "path": "../../src/plugins/kibana_react/tsconfig.json" },
1718
]
1819
}

examples/embeddable_examples/tsconfig.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
],
1515
"exclude": [],
1616
"references": [
17-
{ "path": "../../src/core/tsconfig.json" }
17+
{ "path": "../../src/core/tsconfig.json" },
18+
{ "path": "../../src/plugins/kibana_react/tsconfig.json" },
1819
]
1920
}

examples/state_containers_examples/tsconfig.json

+3-1
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@
1414
],
1515
"exclude": [],
1616
"references": [
17-
{ "path": "../../src/core/tsconfig.json" }
17+
{ "path": "../../src/core/tsconfig.json" },
18+
{ "path": "../../src/plugins/kibana_utils/tsconfig.json" },
19+
{ "path": "../../src/plugins/kibana_react/tsconfig.json" },
1820
]
1921
}

examples/ui_action_examples/tsconfig.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
],
1414
"exclude": [],
1515
"references": [
16-
{ "path": "../../src/core/tsconfig.json" }
16+
{ "path": "../../src/core/tsconfig.json" },
17+
{ "path": "../../src/plugins/kibana_react/tsconfig.json" },
1718
]
1819
}

examples/ui_actions_explorer/tsconfig.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
],
1313
"exclude": [],
1414
"references": [
15-
{ "path": "../../src/core/tsconfig.json" }
15+
{ "path": "../../src/core/tsconfig.json" },
16+
{ "path": "../../src/plugins/kibana_react/tsconfig.json" },
1617
]
1718
}

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@
6565
"kbn:watch": "node scripts/kibana --dev --logging.json=false",
6666
"build:types": "rm -rf ./target/types && tsc --p tsconfig.types.json",
6767
"docs:acceptApiChanges": "node --max-old-space-size=6144 scripts/check_published_api_changes.js --accept",
68-
"kbn:bootstrap": "node scripts/build_ts_refs && node scripts/register_git_hook",
68+
"kbn:bootstrap": "node scripts/build_ts_refs --project tsconfig.refs.json && node scripts/register_git_hook",
6969
"spec_to_console": "node scripts/spec_to_console",
7070
"backport-skip-ci": "backport --prDescription \"[skip-ci]\"",
7171
"storybook": "node scripts/storybook",

src/dev/typescript/build_refs.ts

+23-6
Original file line numberDiff line numberDiff line change
@@ -18,20 +18,37 @@
1818
*/
1919

2020
import execa from 'execa';
21+
import Path from 'path';
2122
import { run, ToolingLog } from '@kbn/dev-utils';
2223

23-
export async function buildRefs(log: ToolingLog) {
24+
export async function buildAllRefs(log: ToolingLog) {
25+
await buildRefs(log, 'tsconfig.refs.json');
26+
await buildRefs(log, Path.join('x-pack', 'tsconfig.refs.json'));
27+
}
28+
29+
async function buildRefs(log: ToolingLog, projectPath: string) {
2430
try {
25-
log.info('Building TypeScript projects refs...');
26-
await execa(require.resolve('typescript/bin/tsc'), ['-b', 'tsconfig.refs.json']);
31+
log.debug(`Building TypeScript projects refs for ${projectPath}...`);
32+
await execa(require.resolve('typescript/bin/tsc'), ['-b', projectPath]);
2733
} catch (e) {
2834
log.error(e);
2935
process.exit(1);
3036
}
3137
}
3238

3339
export async function runBuildRefs() {
34-
run(async ({ log }) => {
35-
await buildRefs(log);
36-
});
40+
run(
41+
async ({ log, flags }) => {
42+
await buildRefs(log, flags.project as string);
43+
},
44+
{
45+
description: 'Build TypeScript projects',
46+
flags: {
47+
string: ['project'],
48+
help: `
49+
--project Required, path to the tsconfig.refs.file
50+
`,
51+
},
52+
}
53+
);
3754
}

src/dev/typescript/projects.ts

+8-2
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,11 @@ import { Project } from './project';
2424

2525
export const PROJECTS = [
2626
new Project(resolve(REPO_ROOT, 'tsconfig.json')),
27-
new Project(resolve(REPO_ROOT, 'src/test_utils/tsconfig.json')),
28-
new Project(resolve(REPO_ROOT, 'src/core/tsconfig.json')),
2927
new Project(resolve(REPO_ROOT, 'test/tsconfig.json'), { name: 'kibana/test' }),
3028
new Project(resolve(REPO_ROOT, 'x-pack/tsconfig.json')),
3129
new Project(resolve(REPO_ROOT, 'x-pack/test/tsconfig.json'), { name: 'x-pack/test' }),
30+
new Project(resolve(REPO_ROOT, 'src/test_utils/tsconfig.json')),
31+
new Project(resolve(REPO_ROOT, 'src/core/tsconfig.json')),
3232
new Project(resolve(REPO_ROOT, 'x-pack/plugins/security_solution/cypress/tsconfig.json'), {
3333
name: 'security_solution/cypress',
3434
}),
@@ -47,6 +47,12 @@ export const PROJECTS = [
4747
...glob
4848
.sync('packages/*/tsconfig.json', { cwd: REPO_ROOT })
4949
.map((path) => new Project(resolve(REPO_ROOT, path))),
50+
...glob
51+
.sync('src/plugins/*/tsconfig.json', { cwd: REPO_ROOT })
52+
.map((path) => new Project(resolve(REPO_ROOT, path))),
53+
...glob
54+
.sync('x-pack/plugins/*/tsconfig.json', { cwd: REPO_ROOT })
55+
.map((path) => new Project(resolve(REPO_ROOT, path))),
5056
...glob
5157
.sync('examples/*/tsconfig.json', { cwd: REPO_ROOT })
5258
.map((path) => new Project(resolve(REPO_ROOT, path))),

src/dev/typescript/run_type_check_cli.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ import getopts from 'getopts';
2424

2525
import { execInProjects } from './exec_in_projects';
2626
import { filterProjectsByFlag } from './projects';
27-
import { buildRefs } from './build_refs';
27+
import { buildAllRefs } from './build_refs';
2828

2929
export async function runTypeCheckCli() {
3030
const extraFlags: string[] = [];
@@ -80,7 +80,7 @@ export async function runTypeCheckCli() {
8080
process.exit();
8181
}
8282

83-
await buildRefs(log);
83+
await buildAllRefs(log);
8484

8585
const tscArgs = [
8686
// composite project cannot be used with --noEmit

src/plugins/data/public/ui/filter_bar/filter_editor/index.tsx

+6-1
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,11 @@ class FilterEditorUI extends Component<Props, State> {
106106
</EuiFlexItem>
107107
<EuiFlexItem grow={false} className="filterEditor__hiddenItem" />
108108
<EuiFlexItem grow={false}>
109-
<EuiButtonEmpty size="xs" onClick={this.toggleCustomEditor}>
109+
<EuiButtonEmpty
110+
size="xs"
111+
data-test-subj="editQueryDSL"
112+
onClick={this.toggleCustomEditor}
113+
>
110114
{this.state.isCustomEditorOpen ? (
111115
<FormattedMessage
112116
id="data.filter.filterEditor.editFilterValuesButtonLabel"
@@ -133,6 +137,7 @@ class FilterEditorUI extends Component<Props, State> {
133137

134138
<EuiSwitch
135139
id="filterEditorCustomLabelSwitch"
140+
data-test-subj="createCustomLabel"
136141
label={this.props.intl.formatMessage({
137142
id: 'data.filter.filterEditor.createCustomLabelSwitchLabel',
138143
defaultMessage: 'Create custom label?',

src/plugins/kibana_react/kibana.json

+1
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,6 @@
22
"id": "kibanaReact",
33
"version": "kibana",
44
"ui": true,
5+
"server": false,
56
"requiredBundles": ["kibanaUtils"]
67
}
+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
{
2+
"extends": "../../../tsconfig.base.json",
3+
"compilerOptions": {
4+
"composite": true,
5+
"outDir": "./target/types",
6+
"emitDeclarationOnly": true,
7+
"declaration": true,
8+
"declarationMap": true
9+
},
10+
"include": [
11+
"public/**/*",
12+
"../../../typings/**/*"
13+
],
14+
"references": [
15+
{ "path": "../kibana_utils/tsconfig.json" }
16+
]
17+
}

src/plugins/kibana_utils/kibana.json

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
"id": "kibanaUtils",
33
"version": "kibana",
44
"ui": true,
5+
"server": false,
56
"extraPublicDirs": [
67
"common",
78
"demos/state_containers/todomvc",
+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
{
2+
"extends": "../../../tsconfig.base.json",
3+
"compilerOptions": {
4+
"composite": true,
5+
"outDir": "./target/types",
6+
"emitDeclarationOnly": true,
7+
"declaration": true,
8+
"declarationMap": true
9+
},
10+
"include": [
11+
"common/**/*",
12+
"demos/**/*",
13+
"public/**/*",
14+
"server/**/*",
15+
"index.ts",
16+
"../../../typings/**/*"
17+
],
18+
"references": [
19+
{ "path": "../../test_utils/tsconfig.json" },
20+
{ "path": "../../core/tsconfig.json" }
21+
]
22+
}

test/accessibility/apps/discover.ts

+4
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,10 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
3939
await PageObjects.timePicker.setDefaultAbsoluteRange();
4040
});
4141

42+
after(async () => {
43+
await esArchiver.unload('logstash_functional');
44+
});
45+
4246
it('Discover main page', async () => {
4347
await a11y.testAppSnapshot();
4448
});
+95
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
/*
2+
* Licensed to Elasticsearch B.V. under one or more contributor
3+
* license agreements. See the NOTICE file distributed with
4+
* this work for additional information regarding copyright
5+
* ownership. Elasticsearch B.V. licenses this file to you under
6+
* the Apache License, Version 2.0 (the "License"); you may
7+
* not use this file except in compliance with the License.
8+
* You may obtain a copy of the License at
9+
*
10+
* http://www.apache.org/licenses/LICENSE-2.0
11+
*
12+
* Unless required by applicable law or agreed to in writing,
13+
* software distributed under the License is distributed on an
14+
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15+
* KIND, either express or implied. See the License for the
16+
* specific language governing permissions and limitations
17+
* under the License.
18+
*/
19+
20+
import { FtrProviderContext } from '../ftr_provider_context';
21+
22+
export default function ({ getService, getPageObjects }: FtrProviderContext) {
23+
const PageObjects = getPageObjects(['common', 'discover', 'home']);
24+
const a11y = getService('a11y');
25+
const filterBar = getService('filterBar');
26+
const testSubjects = getService('testSubjects');
27+
const browser = getService('browser');
28+
29+
describe('Filter panel', () => {
30+
before(async () => {
31+
await PageObjects.common.navigateToUrl('home', '/tutorial_directory/sampleData', {
32+
useActualUrl: true,
33+
});
34+
await PageObjects.home.addSampleDataSet('flights');
35+
await PageObjects.common.navigateToApp('discover');
36+
await PageObjects.discover.selectIndexPattern('kibana_sample_data_flights');
37+
});
38+
39+
it('a11y test on add filter panel', async () => {
40+
await PageObjects.discover.openAddFilterPanel();
41+
await a11y.testAppSnapshot();
42+
await filterBar.addFilter('OriginCityName', 'is', 'Rome');
43+
});
44+
45+
it('a11y test on filter panel with custom label', async () => {
46+
await filterBar.clickEditFilter('OriginCityName', 'Rome');
47+
await testSubjects.click('createCustomLabel');
48+
await a11y.testAppSnapshot();
49+
});
50+
51+
it('a11y test on Edit filter as Query DSL panel', async () => {
52+
await testSubjects.click('editQueryDSL');
53+
await a11y.testAppSnapshot();
54+
await browser.pressKeys(browser.keys.ESCAPE);
55+
});
56+
57+
// the following tests filter panel options which changes UI
58+
it('a11y test on filter panel options panel', async () => {
59+
await filterBar.addFilter('DestCountry', 'is', 'AU');
60+
await testSubjects.click('showFilterActions');
61+
await a11y.testAppSnapshot();
62+
});
63+
64+
it('a11y test on disable all filter options view', async () => {
65+
await testSubjects.click('disableAllFilters');
66+
await a11y.testAppSnapshot();
67+
});
68+
69+
it('a11y test on pin filters view', async () => {
70+
await testSubjects.click('showFilterActions');
71+
await testSubjects.click('enableAllFilters');
72+
await testSubjects.click('showFilterActions');
73+
await testSubjects.click('pinAllFilters');
74+
await a11y.testAppSnapshot();
75+
});
76+
77+
it('a11y test on unpin all filters view', async () => {
78+
await testSubjects.click('showFilterActions');
79+
await testSubjects.click('unpinAllFilters');
80+
await a11y.testAppSnapshot();
81+
});
82+
83+
it('a11y test on invert inclusion of all filters view', async () => {
84+
await testSubjects.click('showFilterActions');
85+
await testSubjects.click('invertInclusionAllFilters');
86+
await a11y.testAppSnapshot();
87+
});
88+
89+
it('a11y test on remove all filtes view', async () => {
90+
await testSubjects.click('showFilterActions');
91+
await testSubjects.click('removeAllFilters');
92+
await a11y.testAppSnapshot();
93+
});
94+
});
95+
}

test/accessibility/apps/management.ts

+4
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,10 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
3535
await PageObjects.settings.navigateTo();
3636
});
3737

38+
after(async () => {
39+
await esArchiver.unload('logstash_functional');
40+
});
41+
3842
it('main view', async () => {
3943
await a11y.testAppSnapshot();
4044
});

test/accessibility/config.ts

+1
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ export default async function ({ readConfigFile }: FtrConfigProviderContext) {
3535
require.resolve('./apps/management'),
3636
require.resolve('./apps/console'),
3737
require.resolve('./apps/home'),
38+
require.resolve('./apps/filter_panel'),
3839
],
3940
pageObjects,
4041
services,

test/tsconfig.json

+3-1
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@
1818
"interpreter_functional/plugins/**/*"
1919
],
2020
"references": [
21-
{ "path": "../src/core/tsconfig.json" }
21+
{ "path": "../src/core/tsconfig.json" },
22+
{ "path": "../src/plugins/kibana_utils/tsconfig.json" },
23+
{ "path": "../src/plugins/kibana_react/tsconfig.json" }
2224
]
2325
}

tsconfig.json

+6-2
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,9 @@
1212
"exclude": [
1313
"src/**/__fixtures__/**/*",
1414
"src/test_utils/**/*",
15-
"src/core/**/*"
15+
"src/core/**/*",
16+
"src/plugins/kibana_utils/**/*",
17+
"src/plugins/kibana_react/**/*"
1618
// In the build we actually exclude **/public/**/* from this config so that
1719
// we can run the TSC on both this and the .browser version of this config
1820
// file, but if we did it during development IDEs would not be able to find
@@ -21,6 +23,8 @@
2123
],
2224
"references": [
2325
{ "path": "./src/test_utils/tsconfig.json" },
24-
{ "path": "./src/core/tsconfig.json" }
26+
{ "path": "./src/core/tsconfig.json" },
27+
{ "path": "./src/plugins/kibana_utils/tsconfig.json" },
28+
{ "path": "./src/plugins/kibana_react/tsconfig.json" }
2529
]
2630
}

tsconfig.refs.json

+4-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
{
22
"include": [],
33
"references": [
4-
{ "path": "./src/test_utils" },
5-
{ "path": "./src/core" },
4+
{ "path": "./src/test_utils/tsconfig.json" },
5+
{ "path": "./src/core/tsconfig.json" },
6+
{ "path": "./src/plugins/kibana_utils/tsconfig.json" },
7+
{ "path": "./src/plugins/kibana_react/tsconfig.json" },
68
]
79
}

x-pack/examples/ui_actions_enhanced_examples/tsconfig.json

+3-1
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@
1313
],
1414
"exclude": [],
1515
"references": [
16-
{ "path": "../../../src/core/tsconfig.json" }
16+
{ "path": "../../../src/core/tsconfig.json" },
17+
{ "path": "../../../src/plugins/kibana_utils/tsconfig.json" },
18+
{ "path": "../../../src/plugins/kibana_react/tsconfig.json" },
1719
]
1820
}

0 commit comments

Comments
 (0)