mirror of
https://github.com/elastic/kibana.git
synced 2025-04-23 17:28:26 -04:00
* Fix visualization migration when savedSearchId is empty string * Apply PR feedback * Apply PR feedback pt2
This commit is contained in:
parent
45d0d41958
commit
ca1fe491b1
2 changed files with 27 additions and 1 deletions
|
@ -199,8 +199,8 @@ export const migrations = {
|
|||
id: savedSearchId,
|
||||
});
|
||||
doc.attributes.savedSearchRefName = 'search_0';
|
||||
delete doc.attributes.savedSearchId;
|
||||
}
|
||||
delete doc.attributes.savedSearchId;
|
||||
|
||||
// Migrate controls
|
||||
const visStateJSON = get(doc, 'attributes.visState');
|
||||
|
|
|
@ -572,6 +572,32 @@ Object {
|
|||
`);
|
||||
});
|
||||
|
||||
it('delete savedSearchId when empty string in doc', () => {
|
||||
const doc = {
|
||||
id: '1',
|
||||
attributes: {
|
||||
visState: '{}',
|
||||
kibanaSavedObjectMeta: {
|
||||
searchSourceJSON: '{}',
|
||||
},
|
||||
savedSearchId: '',
|
||||
},
|
||||
};
|
||||
const migratedDoc = migrate(doc);
|
||||
expect(migratedDoc).toMatchInlineSnapshot(`
|
||||
Object {
|
||||
"attributes": Object {
|
||||
"kibanaSavedObjectMeta": Object {
|
||||
"searchSourceJSON": "{}",
|
||||
},
|
||||
"visState": "{}",
|
||||
},
|
||||
"id": "1",
|
||||
"references": Array [],
|
||||
}
|
||||
`);
|
||||
});
|
||||
|
||||
it('should return a new object if vis is table and has multiple split aggs', () => {
|
||||
const aggs = [
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue