[ES|QL][Lens] Fixes import to other spaces (#183076)

## Summary

Removes it as it is not needed. Its presence also creates a small bug. 

1. Create a visualization with ES|QL
2. Export the dashboard
3. Import to a new space

It will ask for a dataview while it is not needed.
This commit is contained in:
Stratoula Kalafateli 2024-05-13 09:30:11 +02:00 committed by GitHub
parent 781b5eef8e
commit 07e3b4825a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 6 additions and 42 deletions

View file

@ -37,13 +37,7 @@ describe('getLensAttributesFromSuggestion', () => {
'index-pattern-with-timefield-id': {},
},
}),
references: [
{
id: 'index-pattern-with-timefield-id',
name: 'textBasedLanguages-datasource-layer-suggestion',
type: 'index-pattern',
},
],
references: [],
title: currentSuggestionMock.title,
visualizationType: 'lnsHeatmap',
});

View file

@ -50,13 +50,7 @@ export const getLensAttributesFromSuggestion = ({
i18n.translate('visualizationUtils.config.suggestion.title', {
defaultMessage: 'New suggestion',
}),
references: [
{
id: dataView?.id ?? '',
name: `textBasedLanguages-datasource-layer-suggestion`,
type: 'index-pattern',
},
],
references: [],
state: {
datasourceStates,
filters,

View file

@ -539,13 +539,7 @@ describe('LensVisService attributes', () => {
expect(lensVis.visContext).toMatchInlineSnapshot(`
Object {
"attributes": Object {
"references": Array [
Object {
"id": "index-pattern-with-timefield-id",
"name": "textBasedLanguages-datasource-layer-suggestion",
"type": "index-pattern",
},
],
"references": Array [],
"state": Object {
"datasourceStates": Object {
"textBased": Object {
@ -736,13 +730,7 @@ describe('LensVisService attributes', () => {
'index-pattern-with-timefield-id': {},
},
}),
references: [
{
id: 'index-pattern-with-timefield-id',
name: 'textBasedLanguages-datasource-layer-suggestion',
type: 'index-pattern',
},
],
references: [],
title: 'Heat map',
visualizationType: 'lnsHeatmap',
});

View file

@ -3,13 +3,7 @@
exports[`external_vis_context exportVisContext should work correctly 1`] = `
Object {
"attributes": Object {
"references": Array [
Object {
"id": "index-pattern-with-timefield-id",
"name": "textBasedLanguages-datasource-layer-suggestion",
"type": "index-pattern",
},
],
"references": Array [],
"state": Object {
"datasourceStates": Object {
"textBased": Object {
@ -192,13 +186,7 @@ Object {
exports[`external_vis_context exportVisContext should work correctly 2`] = `
Object {
"attributes": Object {
"references": Array [
Object {
"id": "index-pattern-with-timefield-id",
"name": "textBasedLanguages-datasource-layer-suggestion",
"type": "index-pattern",
},
],
"references": Array [],
"state": Object {
"datasourceStates": Object {
"textBased": Object {