Skip to content

Commit

Permalink
[Build] restore kibanaSavedObjectMeta
Browse files Browse the repository at this point in the history
Restoring the index from opensearchDashboardsSavedObjectMeta to
kibanaSavedObjectMeta and then updated the tests.

This is allowable because this is for functional purposes and for
clusters/plugins that will migrate to Dashboards. Their index will
not require re-indexing for 1.0.0 and should not require a full
migration.

Signed-off-by: Kawika Avilla <[email protected]>
  • Loading branch information
kavilla committed May 25, 2021
1 parent 234a703 commit 22ce5c8
Show file tree
Hide file tree
Showing 108 changed files with 387 additions and 433 deletions.
2 changes: 1 addition & 1 deletion src/core/public/http/_import_objects.ndjson
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"attributes":{"description":"","opensearchDashboardsSavedObjectMeta":{"searchSourceJSON":"{\"filter\":[],\"query\":{\"query\":\"\",\"language\":\"lucene\"},\"indexRefName\":\"opensearchDashboardsSavedObjectMeta.searchSourceJSON.index\"}"},"title":"Log Agents","uiStateJSON":"{}","visState":"{\"title\":\"Log Agents\",\"type\":\"area\",\"params\":{\"type\":\"area\",\"grid\":{\"categoryLines\":false,\"style\":{\"color\":\"#eee\"}},\"categoryAxes\":[{\"id\":\"CategoryAxis-1\",\"type\":\"category\",\"position\":\"bottom\",\"show\":true,\"style\":{},\"scale\":{\"type\":\"linear\"},\"labels\":{\"show\":true,\"truncate\":100},\"title\":{\"text\":\"agent.raw: Descending\"}}],\"valueAxes\":[{\"id\":\"ValueAxis-1\",\"name\":\"LeftAxis-1\",\"type\":\"value\",\"position\":\"left\",\"show\":true,\"style\":{},\"scale\":{\"type\":\"linear\",\"mode\":\"normal\"},\"labels\":{\"show\":true,\"rotate\":0,\"filter\":false,\"truncate\":100},\"title\":{\"text\":\"Count\"}}],\"seriesParams\":[{\"show\":\"true\",\"type\":\"area\",\"mode\":\"stacked\",\"data\":{\"label\":\"Count\",\"id\":\"1\"},\"drawLinesBetweenPoints\":true,\"showCircles\":true,\"interpolate\":\"linear\",\"valueAxis\":\"ValueAxis-1\"}],\"addTooltip\":true,\"addLegend\":true,\"legendPosition\":\"right\",\"times\":[],\"addTimeMarker\":false},\"aggs\":[{\"id\":\"1\",\"enabled\":true,\"type\":\"count\",\"schema\":\"metric\",\"params\":{}},{\"id\":\"2\",\"enabled\":true,\"type\":\"terms\",\"schema\":\"segment\",\"params\":{\"field\":\"agent.raw\",\"size\":5,\"order\":\"desc\",\"orderBy\":\"1\"}}]}"},"id":"082f1d60-a2e7-11e7-bb30-233be9be6a15","migrationVersion":{"visualization":"7.0.0"},"references":[{"id":"f1e4c910-a2e6-11e7-bb30-233be9be6a15","name":"opensearchDashboardsSavedObjectMeta.searchSourceJSON.index","type":"index-pattern"}],"type":"visualization","version":1}
{"attributes":{"description":"","kibanaSavedObjectMeta":{"searchSourceJSON":"{\"filter\":[],\"query\":{\"query\":\"\",\"language\":\"lucene\"},\"indexRefName\":\"kibanaSavedObjectMeta.searchSourceJSON.index\"}"},"title":"Log Agents","uiStateJSON":"{}","visState":"{\"title\":\"Log Agents\",\"type\":\"area\",\"params\":{\"type\":\"area\",\"grid\":{\"categoryLines\":false,\"style\":{\"color\":\"#eee\"}},\"categoryAxes\":[{\"id\":\"CategoryAxis-1\",\"type\":\"category\",\"position\":\"bottom\",\"show\":true,\"style\":{},\"scale\":{\"type\":\"linear\"},\"labels\":{\"show\":true,\"truncate\":100},\"title\":{\"text\":\"agent.raw: Descending\"}}],\"valueAxes\":[{\"id\":\"ValueAxis-1\",\"name\":\"LeftAxis-1\",\"type\":\"value\",\"position\":\"left\",\"show\":true,\"style\":{},\"scale\":{\"type\":\"linear\",\"mode\":\"normal\"},\"labels\":{\"show\":true,\"rotate\":0,\"filter\":false,\"truncate\":100},\"title\":{\"text\":\"Count\"}}],\"seriesParams\":[{\"show\":\"true\",\"type\":\"area\",\"mode\":\"stacked\",\"data\":{\"label\":\"Count\",\"id\":\"1\"},\"drawLinesBetweenPoints\":true,\"showCircles\":true,\"interpolate\":\"linear\",\"valueAxis\":\"ValueAxis-1\"}],\"addTooltip\":true,\"addLegend\":true,\"legendPosition\":\"right\",\"times\":[],\"addTimeMarker\":false},\"aggs\":[{\"id\":\"1\",\"enabled\":true,\"type\":\"count\",\"schema\":\"metric\",\"params\":{}},{\"id\":\"2\",\"enabled\":true,\"type\":\"terms\",\"schema\":\"segment\",\"params\":{\"field\":\"agent.raw\",\"size\":5,\"order\":\"desc\",\"orderBy\":\"1\"}}]}"},"id":"082f1d60-a2e7-11e7-bb30-233be9be6a15","migrationVersion":{"visualization":"7.0.0"},"references":[{"id":"f1e4c910-a2e6-11e7-bb30-233be9be6a15","name":"kibanaSavedObjectMeta.searchSourceJSON.index","type":"index-pattern"}],"type":"visualization","version":1}
2 changes: 1 addition & 1 deletion src/plugins/dashboard/common/bwc/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ import { SavedObjectReference } from 'opensearch-dashboards/public';
import { GridData } from '../';

interface SavedObjectAttributes {
opensearchDashboardsSavedObjectMeta: {
kibanaSavedObjectMeta: {
searchSourceJSON: string;
};
}
Expand Down
2 changes: 1 addition & 1 deletion src/plugins/dashboard/server/saved_objects/dashboard.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ export const dashboardSavedObjectType: SavedObjectsType = {
properties: {
description: { type: 'text' },
hits: { type: 'integer', index: false, doc_values: false },
opensearchDashboardsSavedObjectMeta: {
kibanaSavedObjectMeta: {
properties: { searchSourceJSON: { type: 'text', index: false } },
},
optionsJSON: { type: 'text', index: false },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ Object {
id: '1',
type: 'dashboard',
attributes: {
opensearchDashboardsSavedObjectMeta: {
kibanaSavedObjectMeta: {
searchSourceJSON: null,
},
panelsJSON:
Expand All @@ -64,7 +64,7 @@ Object {
expect(migratedDoc).toMatchInlineSnapshot(`
Object {
"attributes": Object {
"opensearchDashboardsSavedObjectMeta": Object {
"kibanaSavedObjectMeta": Object {
"searchSourceJSON": null,
},
"panelsJSON": "[{\\"foo\\":true,\\"panelRefName\\":\\"panel_0\\"},{\\"bar\\":true,\\"panelRefName\\":\\"panel_1\\"}]",
Expand Down Expand Up @@ -92,7 +92,7 @@ Object {
id: '1',
type: 'dashboard',
attributes: {
opensearchDashboardsSavedObjectMeta: {
kibanaSavedObjectMeta: {
searchSourceJSON: undefined,
},
panelsJSON:
Expand All @@ -103,7 +103,7 @@ Object {
expect(migratedDoc).toMatchInlineSnapshot(`
Object {
"attributes": Object {
"opensearchDashboardsSavedObjectMeta": Object {
"kibanaSavedObjectMeta": Object {
"searchSourceJSON": undefined,
},
"panelsJSON": "[{\\"foo\\":true,\\"panelRefName\\":\\"panel_0\\"},{\\"bar\\":true,\\"panelRefName\\":\\"panel_1\\"}]",
Expand Down Expand Up @@ -131,7 +131,7 @@ Object {
id: '1',
type: 'dashboard',
attributes: {
opensearchDashboardsSavedObjectMeta: {
kibanaSavedObjectMeta: {
searchSourceJSON: 123,
},
panelsJSON:
Expand All @@ -141,7 +141,7 @@ Object {
expect(migration(doc, contextMock)).toMatchInlineSnapshot(`
Object {
"attributes": Object {
"opensearchDashboardsSavedObjectMeta": Object {
"kibanaSavedObjectMeta": Object {
"searchSourceJSON": 123,
},
"panelsJSON": "[{\\"foo\\":true,\\"panelRefName\\":\\"panel_0\\"},{\\"bar\\":true,\\"panelRefName\\":\\"panel_1\\"}]",
Expand Down Expand Up @@ -169,7 +169,7 @@ Object {
id: '1',
type: 'dashboard',
attributes: {
opensearchDashboardsSavedObjectMeta: {
kibanaSavedObjectMeta: {
searchSourceJSON: '{abc123}',
},
panelsJSON:
Expand All @@ -179,7 +179,7 @@ Object {
expect(migration(doc, contextMock)).toMatchInlineSnapshot(`
Object {
"attributes": Object {
"opensearchDashboardsSavedObjectMeta": Object {
"kibanaSavedObjectMeta": Object {
"searchSourceJSON": "{abc123}",
},
"panelsJSON": "[{\\"foo\\":true,\\"panelRefName\\":\\"panel_0\\"},{\\"bar\\":true,\\"panelRefName\\":\\"panel_1\\"}]",
Expand Down Expand Up @@ -207,7 +207,7 @@ Object {
id: '1',
type: 'dashboard',
attributes: {
opensearchDashboardsSavedObjectMeta: {
kibanaSavedObjectMeta: {
searchSourceJSON: JSON.stringify({ bar: true }),
},
panelsJSON:
Expand All @@ -218,7 +218,7 @@ Object {
expect(migratedDoc).toMatchInlineSnapshot(`
Object {
"attributes": Object {
"opensearchDashboardsSavedObjectMeta": Object {
"kibanaSavedObjectMeta": Object {
"searchSourceJSON": "{\\"bar\\":true}",
},
"panelsJSON": "[{\\"foo\\":true,\\"panelRefName\\":\\"panel_0\\"},{\\"bar\\":true,\\"panelRefName\\":\\"panel_1\\"}]",
Expand Down Expand Up @@ -246,7 +246,7 @@ Object {
id: '1',
type: 'dashboard',
attributes: {
opensearchDashboardsSavedObjectMeta: {
kibanaSavedObjectMeta: {
searchSourceJSON: JSON.stringify({ bar: true, index: 'pattern*' }),
},
panelsJSON:
Expand All @@ -257,16 +257,16 @@ Object {
expect(migratedDoc).toMatchInlineSnapshot(`
Object {
"attributes": Object {
"opensearchDashboardsSavedObjectMeta": Object {
"searchSourceJSON": "{\\"bar\\":true,\\"indexRefName\\":\\"opensearchDashboardsSavedObjectMeta.searchSourceJSON.index\\"}",
"kibanaSavedObjectMeta": Object {
"searchSourceJSON": "{\\"bar\\":true,\\"indexRefName\\":\\"kibanaSavedObjectMeta.searchSourceJSON.index\\"}",
},
"panelsJSON": "[{\\"foo\\":true,\\"panelRefName\\":\\"panel_0\\"},{\\"bar\\":true,\\"panelRefName\\":\\"panel_1\\"}]",
},
"id": "1",
"references": Array [
Object {
"id": "pattern*",
"name": "opensearchDashboardsSavedObjectMeta.searchSourceJSON.index",
"name": "kibanaSavedObjectMeta.searchSourceJSON.index",
"type": "index-pattern",
},
Object {
Expand All @@ -290,7 +290,7 @@ Object {
id: '1',
type: 'dashboard',
attributes: {
opensearchDashboardsSavedObjectMeta: {
kibanaSavedObjectMeta: {
searchSourceJSON: JSON.stringify({
bar: true,
filter: [
Expand All @@ -312,16 +312,16 @@ Object {
expect(migratedDoc).toMatchInlineSnapshot(`
Object {
"attributes": Object {
"opensearchDashboardsSavedObjectMeta": Object {
"searchSourceJSON": "{\\"bar\\":true,\\"filter\\":[{\\"meta\\":{\\"foo\\":true,\\"indexRefName\\":\\"opensearchDashboardsSavedObjectMeta.searchSourceJSON.filter[0].meta.index\\"}}]}",
"kibanaSavedObjectMeta": Object {
"searchSourceJSON": "{\\"bar\\":true,\\"filter\\":[{\\"meta\\":{\\"foo\\":true,\\"indexRefName\\":\\"kibanaSavedObjectMeta.searchSourceJSON.filter[0].meta.index\\"}}]}",
},
"panelsJSON": "[{\\"foo\\":true,\\"panelRefName\\":\\"panel_0\\"},{\\"bar\\":true,\\"panelRefName\\":\\"panel_1\\"}]",
},
"id": "1",
"references": Array [
Object {
"id": "my-index",
"name": "opensearchDashboardsSavedObjectMeta.searchSourceJSON.filter[0].meta.index",
"name": "kibanaSavedObjectMeta.searchSourceJSON.filter[0].meta.index",
"type": "index-pattern",
},
Object {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,7 @@ import { migrateMatchAllQuery } from './migrate_match_all_query';
import { DashboardDoc700To720 } from '../../common';

function migrateIndexPattern(doc: DashboardDoc700To720) {
const searchSourceJSON = get(
doc,
'attributes.opensearchDashboardsSavedObjectMeta.searchSourceJSON'
);
const searchSourceJSON = get(doc, 'attributes.kibanaSavedObjectMeta.searchSourceJSON');
if (typeof searchSourceJSON !== 'string') {
return;
}
Expand All @@ -53,7 +50,7 @@ function migrateIndexPattern(doc: DashboardDoc700To720) {
return;
}
if (searchSource.index) {
searchSource.indexRefName = 'opensearchDashboardsSavedObjectMeta.searchSourceJSON.index';
searchSource.indexRefName = 'kibanaSavedObjectMeta.searchSourceJSON.index';
doc.references.push({
name: searchSource.indexRefName,
type: 'index-pattern',
Expand All @@ -66,7 +63,7 @@ function migrateIndexPattern(doc: DashboardDoc700To720) {
if (!filterRow.meta || !filterRow.meta.index) {
return;
}
filterRow.meta.indexRefName = `opensearchDashboardsSavedObjectMeta.searchSourceJSON.filter[${i}].meta.index`;
filterRow.meta.indexRefName = `kibanaSavedObjectMeta.searchSourceJSON.filter[${i}].meta.index`;
doc.references.push({
name: filterRow.meta.indexRefName,
type: 'index-pattern',
Expand All @@ -75,9 +72,7 @@ function migrateIndexPattern(doc: DashboardDoc700To720) {
delete filterRow.meta.index;
});
}
doc.attributes.opensearchDashboardsSavedObjectMeta.searchSourceJSON = JSON.stringify(
searchSource
);
doc.attributes.kibanaSavedObjectMeta.searchSourceJSON = JSON.stringify(searchSource);
}

const migrations700: SavedObjectMigrationFn<any, any> = (doc): DashboardDoc700To720 => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ describe('migrate match_all query', () => {
const migratedDoc = migrateMatchAllQuery(
{
attributes: {
opensearchDashboardsSavedObjectMeta: {
kibanaSavedObjectMeta: {
searchSourceJSON: JSON.stringify({
query: {
match_all: {},
Expand All @@ -52,7 +52,7 @@ describe('migrate match_all query', () => {
);

const migratedSearchSource = JSON.parse(
migratedDoc.attributes.opensearchDashboardsSavedObjectMeta.searchSourceJSON
migratedDoc.attributes.kibanaSavedObjectMeta.searchSourceJSON
);

expect(migratedSearchSource).toEqual({
Expand All @@ -67,15 +67,15 @@ describe('migrate match_all query', () => {
const migratedDoc = migrateMatchAllQuery(
{
attributes: {
opensearchDashboardsSavedObjectMeta: 'opensearchDashboardsSavedObjectMeta',
kibanaSavedObjectMeta: 'kibanaSavedObjectMeta',
},
} as Parameters<SavedObjectMigrationFn>[0],
savedObjectMigrationContext
);

expect(migratedDoc).toEqual({
attributes: {
opensearchDashboardsSavedObjectMeta: 'opensearchDashboardsSavedObjectMeta',
kibanaSavedObjectMeta: 'kibanaSavedObjectMeta',
},
});
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,7 @@ import { DEFAULT_QUERY_LANGUAGE } from '../../../data/common';
* This is only a problem when you import an object from 5.x into 6.x but to be sure that all saved objects migrated we should execute it twice in 6.7.2 and 7.9.3
*/
export const migrateMatchAllQuery: SavedObjectMigrationFn<any, any> = (doc) => {
const searchSourceJSON = get(
doc,
'attributes.opensearchDashboardsSavedObjectMeta.searchSourceJSON'
);
const searchSourceJSON = get(doc, 'attributes.kibanaSavedObjectMeta.searchSourceJSON');

if (searchSourceJSON) {
let searchSource: any;
Expand All @@ -61,7 +58,7 @@ export const migrateMatchAllQuery: SavedObjectMigrationFn<any, any> = (doc) => {
...doc,
attributes: {
...doc.attributes,
opensearchDashboardsSavedObjectMeta: {
kibanaSavedObjectMeta: {
searchSourceJSON: JSON.stringify({
...searchSource,
query: {
Expand Down
18 changes: 7 additions & 11 deletions src/plugins/dashboard/server/saved_objects/migrations_730.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ test('dashboard migration 7.3.0 migrates filters to query on search source', ()
uiStateJSON: '{}',
version: 1,
timeRestore: false,
opensearchDashboardsSavedObjectMeta: {
kibanaSavedObjectMeta: {
searchSourceJSON:
'{"filter":[{"query":{"query_string":{"query":"n: 6","analyze_wildcard":true}}}],"highlightAll":true,"version":true}',
},
Expand All @@ -64,7 +64,7 @@ test('dashboard migration 7.3.0 migrates filters to query on search source', ()
Object {
"attributes": Object {
"description": "",
"opensearchDashboardsSavedObjectMeta": Object {
"kibanaSavedObjectMeta": Object {
"searchSourceJSON": "{\\"filter\\":[],\\"highlightAll\\":true,\\"version\\":true,\\"query\\":{\\"query\\":\\"n: 6\\",\\"language\\":\\"lucene\\"}}",
},
"panelsJSON": "[{\\"id\\":\\"1\\",\\"type\\":\\"visualization\\",\\"foo\\":true},{\\"id\\":\\"2\\",\\"type\\":\\"visualization\\",\\"bar\\":true}]",
Expand Down Expand Up @@ -95,7 +95,7 @@ test('dashboard migration 7.3.0 migrates filters to query on search source when
'{"P-9":{"vis":{"params":{"sort":{"columnIndex":null,"direction":null}}}},"P-3":{"vis":{"defaultColors":{"0 - 88":"rgb(247,252,245)","88 - 175":"rgb(199,233,192)","175 - 263":"rgb(116,196,118)","263 - 350":"rgb(35,139,69)"}}},"P-10":{"vis":{"defaultColors":{"0 - 50":"rgb(0,104,55)","50 - 75":"rgb(255,255,190)","75 - 100":"rgb(165,0,38)"}}},"P-11":{"vis":{"defaultColors":{"0 - 100":"rgb(0,104,55)"}}},"P-12":{"vis":{"defaultColors":{"0 - 100":"rgb(0,104,55)"}}}}',
version: 1,
timeRestore: false,
opensearchDashboardsSavedObjectMeta: {
kibanaSavedObjectMeta: {
searchSourceJSON:
'{"filter":[{"query":{"match_all":{}}}],"highlightAll":true,"version":true}',
},
Expand All @@ -105,9 +105,7 @@ test('dashboard migration 7.3.0 migrates filters to query on search source when
const doc700 = migrations['7.0.0'](doc, mockContext);
const newDoc = migrations['7.3.0'](doc700, mockContext);

const parsedSearchSource = JSON.parse(
newDoc.attributes.opensearchDashboardsSavedObjectMeta.searchSourceJSON
);
const parsedSearchSource = JSON.parse(newDoc.attributes.kibanaSavedObjectMeta.searchSourceJSON);
expect(parsedSearchSource.filter.length).toBe(0);
expect(parsedSearchSource.query.query).toBe('');

Expand All @@ -129,7 +127,7 @@ test('dashboard migration works when panelsJSON is missing panelIndex', () => {
panelsJSON:
'[{"id":"funky-funky","type":"visualization","size_x":7,"size_y":5,"col":1,"row":1},{"id":"funky-funky2","type":"search","size_x":5,"size_y":5,"col":8,"row":1,"columns":["_source"],"sort":["@timestamp","desc"]}]',
optionsJSON: '{"darkTheme":false}',
opensearchDashboardsSavedObjectMeta: {
kibanaSavedObjectMeta: {
searchSourceJSON:
'{"filter":[{"query":{"query_string":{"query":"user:spiderman","analyze_wildcard":true}}}]}',
},
Expand All @@ -139,9 +137,7 @@ test('dashboard migration works when panelsJSON is missing panelIndex', () => {
const doc700 = migrations['7.0.0'](doc, mockContext);
const newDoc = migrations['7.3.0'](doc700, mockContext);

const parsedSearchSource = JSON.parse(
newDoc.attributes.opensearchDashboardsSavedObjectMeta.searchSourceJSON
);
const parsedSearchSource = JSON.parse(newDoc.attributes.kibanaSavedObjectMeta.searchSourceJSON);
expect(parsedSearchSource.filter.length).toBe(0);
expect(parsedSearchSource.query.query).toBe('user:spiderman');

Expand All @@ -160,7 +156,7 @@ test('dashboard migration 7.3.0 migrates panels', () => {
uiStateJSON: '{}',
version: 1,
timeRestore: false,
opensearchDashboardsSavedObjectMeta: {
kibanaSavedObjectMeta: {
searchSourceJSON: '{"filter":[],"highlightAll":true,"version":true}',
},
panelsJSON:
Expand Down
6 changes: 2 additions & 4 deletions src/plugins/dashboard/server/saved_objects/migrations_730.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,8 @@ export const migrations730 = (doc: DashboardDoc700To720, { log }: SavedObjectMig
}

try {
const searchSource = JSON.parse(
doc.attributes.opensearchDashboardsSavedObjectMeta.searchSourceJSON
);
doc.attributes.opensearchDashboardsSavedObjectMeta.searchSourceJSON = JSON.stringify(
const searchSource = JSON.parse(doc.attributes.kibanaSavedObjectMeta.searchSourceJSON);
doc.attributes.kibanaSavedObjectMeta.searchSourceJSON = JSON.stringify(
moveFiltersToQuery(searchSource)
);
} catch (e) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ export const extractReferences = (
const references: SavedObjectReference[] = [];
if (searchSourceFields.index) {
const indexId = searchSourceFields.index.id || ((searchSourceFields.index as any) as string);
const refName = 'opensearchDashboardsSavedObjectMeta.searchSourceJSON.index';
const refName = 'kibanaSavedObjectMeta.searchSourceJSON.index';
references.push({
name: refName,
type: 'index-pattern',
Expand All @@ -61,7 +61,7 @@ export const extractReferences = (
if (!filterRow.meta || !filterRow.meta.index) {
return filterRow;
}
const refName = `opensearchDashboardsSavedObjectMeta.searchSourceJSON.filter[${i}].meta.index`;
const refName = `kibanaSavedObjectMeta.searchSourceJSON.filter[${i}].meta.index`;
references.push({
name: refName,
type: 'index-pattern',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,11 @@ describe('injectSearchSourceReferences', () => {
query: 'play_name:"Henry IV"',
language: 'kuery',
},
indexRefName: 'opensearchDashboardsSavedObjectMeta.searchSourceJSON.index',
indexRefName: 'kibanaSavedObjectMeta.searchSourceJSON.index',
};
references = [
{
name: 'opensearchDashboardsSavedObjectMeta.searchSourceJSON.index',
name: 'kibanaSavedObjectMeta.searchSourceJSON.index',
type: 'index-pattern',
id: '033af690-fde7-11ea-91f3-fb9e73f9bbe9',
},
Expand Down Expand Up @@ -100,7 +100,7 @@ describe('injectSearchSourceReferences', () => {
test('handles filters', () => {
searchSourceJSON.filter = [
// @ts-expect-error
{ meta: { indexRefName: 'opensearchDashboardsSavedObjectMeta.searchSourceJSON.index' } },
{ meta: { indexRefName: 'kibanaSavedObjectMeta.searchSourceJSON.index' } },
];
const actual = injectReferences(searchSourceJSON, references);
expect(actual).toMatchInlineSnapshot(`
Expand Down
Loading

0 comments on commit 22ce5c8

Please sign in to comment.