Skip to content

Commit a803061

Browse files
committed
Merge remote-tracking branch 'upstream/master' into kbn-50511-migrate-csp-usage-collector
2 parents 0eaae43 + 77a434b commit a803061

87 files changed

Lines changed: 1176 additions & 1520 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

docs/visualize/vega.asciidoc

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
[[vega-graph]]
22
== Vega
33

4-
experimental[]
5-
64
Build custom visualizations using Vega and Vega-Lite, backed by one or more
75
data sources including {es}, Elastic Map Service, URL,
86
or static data. Use the {kib} extensions to Vega to embed Vega into
@@ -1259,7 +1257,7 @@ Override it by providing a different `stroke`, `fill`, or `color` (Vega-Lite) va
12591257
[[vega-queries]]
12601258
==== Writing {es} queries in Vega
12611259

1262-
experimental[] {kib} extends the Vega https://vega.github.io/vega/docs/data/[data] elements
1260+
{kib} extends the Vega https://vega.github.io/vega/docs/data/[data] elements
12631261
with support for direct {es} queries specified as a `url`.
12641262

12651263
Because of this, {kib} is **unable to support dynamically loaded data**,
@@ -1414,7 +1412,7 @@ try to get about 10-15 data points (buckets).
14141412
[[vega-esmfiles]]
14151413
=== Access Elastic Map Service files
14161414

1417-
experimental[] Access the Elastic Map Service files via the same mechanism:
1415+
Access the Elastic Map Service files via the same mechanism:
14181416

14191417
[source,yaml]
14201418
----
@@ -1619,7 +1617,7 @@ kibanaSetTimeFilter(start, end)
16191617
[[vega-useful-links]]
16201618
=== Resources and examples
16211619

1622-
experimental[] To learn more about Vega and Vega-Lite, refer to the resources and examples.
1620+
To learn more about Vega and Vega-Lite, refer to the resources and examples.
16231621

16241622
==== Vega editor
16251623
The https://vega.github.io/editor/[Vega Editor] includes examples for Vega & Vega-Lite, but does not support any

src/plugins/vis_type_vega/public/vega_type.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,6 @@ export const createVegaTypeDefinition = (dependencies: VegaVisualizationDependen
5858
getSupportedTriggers: () => {
5959
return [VIS_EVENT_TO_TRIGGER.applyFilter];
6060
},
61-
stage: 'experimental',
6261
inspectorAdapters: createInspectorAdapters,
6362
};
6463
};

src/plugins/visualize/config.ts

Lines changed: 0 additions & 26 deletions
This file was deleted.

src/plugins/visualize/kibana.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
"savedObjects",
1111
"visualizations",
1212
"embeddable",
13+
"dashboard",
1314
"uiActions"
1415
],
1516
"optionalPlugins": ["home", "share"],

src/plugins/visualize/public/application/types.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ import { SharePluginStart } from 'src/plugins/share/public';
4444
import { SavedObjectsStart, SavedObject } from 'src/plugins/saved_objects/public';
4545
import { EmbeddableStart } from 'src/plugins/embeddable/public';
4646
import { KibanaLegacyStart } from 'src/plugins/kibana_legacy/public';
47-
import { ConfigSchema } from '../../config';
47+
import { DashboardStart } from '../../../dashboard/public';
4848

4949
export type PureVisState = SavedVisState;
5050

@@ -111,7 +111,7 @@ export interface VisualizeServices extends CoreStart {
111111
createVisEmbeddableFromObject: VisualizationsStart['__LEGACY']['createVisEmbeddableFromObject'];
112112
restorePreviousUrl: () => void;
113113
scopedHistory: ScopedHistory;
114-
featureFlagConfig: ConfigSchema;
114+
dashboard: DashboardStart;
115115
}
116116

117117
export interface SavedVisInstance {

src/plugins/visualize/public/application/utils/get_top_nav_config.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ export const getTopNavConfig = (
7575
toastNotifications,
7676
visualizeCapabilities,
7777
i18n: { Context: I18nContext },
78-
featureFlagConfig,
78+
dashboard,
7979
}: VisualizeServices
8080
) => {
8181
const { vis, embeddableHandler } = visInstance;
@@ -212,7 +212,7 @@ export const getTopNavConfig = (
212212
};
213213
if (
214214
originatingApp === 'dashboards' &&
215-
featureFlagConfig.showNewVisualizeFlow &&
215+
dashboard.dashboardFeatureFlagConfig.allowByValueEmbeddables &&
216216
!savedVis
217217
) {
218218
return createVisReference();
@@ -292,7 +292,7 @@ export const getTopNavConfig = (
292292
const isSaveAsButton = anchorElement.classList.contains('saveAsButton');
293293
if (
294294
originatingApp === 'dashboards' &&
295-
featureFlagConfig.showNewVisualizeFlow &&
295+
dashboard.dashboardFeatureFlagConfig.allowByValueEmbeddables &&
296296
!isSaveAsButton
297297
) {
298298
createVisReference();

src/plugins/visualize/public/plugin.ts

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ import { VisualizeServices } from './application/types';
4848
import { DEFAULT_APP_CATEGORIES } from '../../../core/public';
4949
import { SavedObjectsStart } from '../../saved_objects/public';
5050
import { EmbeddableStart } from '../../embeddable/public';
51+
import { DashboardStart } from '../../dashboard/public';
5152
import { UiActionsStart, VISUALIZE_FIELD_TRIGGER } from '../../ui_actions/public';
5253
import {
5354
setUISettings,
@@ -67,6 +68,7 @@ export interface VisualizePluginStartDependencies {
6768
embeddable: EmbeddableStart;
6869
kibanaLegacy: KibanaLegacyStart;
6970
savedObjects: SavedObjectsStart;
71+
dashboard: DashboardStart;
7072
uiActions: UiActionsStart;
7173
}
7274

@@ -77,10 +79,6 @@ export interface VisualizePluginSetupDependencies {
7779
share?: SharePluginSetup;
7880
}
7981

80-
export interface FeatureFlagConfig {
81-
showNewVisualizeFlow: boolean;
82-
}
83-
8482
export class VisualizePlugin
8583
implements
8684
Plugin<void, void, VisualizePluginSetupDependencies, VisualizePluginStartDependencies> {
@@ -171,7 +169,6 @@ export class VisualizePlugin
171169
* this should be replaced to use only scoped history after moving legacy apps to browser routing
172170
*/
173171
const history = createHashHistory();
174-
175172
const services: VisualizeServices = {
176173
...coreStart,
177174
history,
@@ -198,7 +195,7 @@ export class VisualizePlugin
198195
savedObjectsPublic: pluginsStart.savedObjects,
199196
scopedHistory: params.history,
200197
restorePreviousUrl,
201-
featureFlagConfig: this.initializerContext.config.get<FeatureFlagConfig>(),
198+
dashboard: pluginsStart.dashboard,
202199
};
203200

204201
params.element.classList.add('visAppWrapper');

src/plugins/visualize/server/index.ts

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -17,17 +17,8 @@
1717
* under the License.
1818
*/
1919

20-
import { PluginInitializerContext, PluginConfigDescriptor } from 'kibana/server';
20+
import { PluginInitializerContext } from 'kibana/server';
2121
import { VisualizeServerPlugin } from './plugin';
2222

23-
import { ConfigSchema, configSchema } from '../config';
24-
25-
export const config: PluginConfigDescriptor<ConfigSchema> = {
26-
exposeToBrowser: {
27-
showNewVisualizeFlow: true,
28-
},
29-
schema: configSchema,
30-
};
31-
3223
export const plugin = (initContext: PluginInitializerContext) =>
3324
new VisualizeServerPlugin(initContext);

test/functional/page_objects/vega_chart_page.ts

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@ export function VegaChartPageProvider({
3333
const find = getService('find');
3434
const testSubjects = getService('testSubjects');
3535
const browser = getService('browser');
36-
const { common } = getPageObjects(['common']);
3736
const retry = getService('retry');
3837

3938
class VegaChartPage {
@@ -49,6 +48,15 @@ export function VegaChartPageProvider({
4948
return find.byCssSelector('div.vgaVis__controls');
5049
}
5150

51+
public getYAxisContainer() {
52+
return find.byCssSelector('[aria-label^="Y-axis"]');
53+
}
54+
55+
public async getAceGutterContainer() {
56+
const editor = await this.getEditor();
57+
return editor.findByClassName('ace_gutter');
58+
}
59+
5260
public async getRawSpec() {
5361
// Adapted from console_page.js:getVisibleTextFromAceEditor(). Is there a common utilities file?
5462
const editor = await this.getEditor();
@@ -83,20 +91,16 @@ export function VegaChartPageProvider({
8391
}
8492

8593
public async typeInSpec(text: string) {
86-
await this.focusEditor();
94+
const aceGutter = await this.getAceGutterContainer();
8795

88-
let repeats = 20;
89-
while (--repeats > 0) {
90-
await browser.pressKeys(Key.ARROW_UP);
91-
await common.sleep(50);
92-
}
93-
await browser.pressKeys(Key.ARROW_RIGHT);
96+
await aceGutter.doubleClick();
97+
await browser.pressKeys(Key.LEFT);
98+
await browser.pressKeys(Key.RIGHT);
9499
await browser.pressKeys(text);
95100
}
96101

97102
public async cleanSpec() {
98-
const editor = await this.getEditor();
99-
const aceGutter = await editor.findByClassName('ace_gutter');
103+
const aceGutter = await this.getAceGutterContainer();
100104

101105
await retry.try(async () => {
102106
await aceGutter.doubleClick();
@@ -107,11 +111,11 @@ export function VegaChartPageProvider({
107111
}
108112

109113
public async getYAxisLabels() {
110-
const chart = await testSubjects.find('visualizationLoader');
111-
const yAxis = await chart.findByCssSelector('[aria-label^="Y-axis"]');
114+
const yAxis = await this.getYAxisContainer();
112115
const tickGroup = await yAxis.findByClassName('role-axis-label');
113116
const labels = await tickGroup.findAllByCssSelector('text');
114117
const labelTexts: string[] = [];
118+
115119
for (const label of labels) {
116120
labelTexts.push(await label.getVisibleText());
117121
}

test/new_visualize_flow/config.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@ export default async function ({ readConfigFile }) {
3737
...commonConfig.get('kbnTestServer.serverArgs'),
3838
'--oss',
3939
'--telemetry.optIn=false',
40-
'--visualize.showNewVisualizeFlow=true',
4140
],
4241
},
4342

0 commit comments

Comments
 (0)