-
Notifications
You must be signed in to change notification settings - Fork 8.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix importing dashboards created before ~6.1.0 (#94332)
- Loading branch information
Showing
5 changed files
with
198 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License | ||
* 2.0 and the Server Side Public License, v 1; you may not use this file except | ||
* in compliance with, at your election, the Elastic License 2.0 or the Server | ||
* Side Public License, v 1. | ||
*/ | ||
|
||
import path from 'path'; | ||
import { FtrProviderContext } from '../../ftr_provider_context'; | ||
|
||
export default function ({ getService, getPageObjects }: FtrProviderContext) { | ||
const PageObjects = getPageObjects(['dashboard', 'header', 'settings', 'savedObjects', 'common']); | ||
const dashboardExpect = getService('dashboardExpect'); | ||
|
||
describe('bwc import', function describeIndexTests() { | ||
before(async function () { | ||
await PageObjects.dashboard.initTests(); | ||
await PageObjects.settings.navigateTo(); | ||
await PageObjects.settings.clickKibanaSavedObjects(); | ||
await PageObjects.savedObjects.importFile( | ||
path.join(__dirname, 'exports', 'dashboard_6_0_1.json') | ||
); | ||
await PageObjects.settings.associateIndexPattern( | ||
'dd684000-8255-11eb-a5e7-93c302c8f329', | ||
'logstash-*' | ||
); | ||
await PageObjects.savedObjects.clickConfirmChanges(); | ||
await PageObjects.savedObjects.clickImportDone(); | ||
await PageObjects.common.navigateToApp('dashboard'); | ||
}); | ||
|
||
describe('6.0.1 dashboard', () => { | ||
it('loads an imported dashboard', async function () { | ||
await PageObjects.dashboard.gotoDashboardLandingPage(); | ||
await PageObjects.dashboard.loadSavedDashboard('My custom bwc dashboard'); | ||
await PageObjects.header.waitUntilLoadingHasFinished(); | ||
|
||
await dashboardExpect.metricValuesExist(['14,004']); | ||
}); | ||
}); | ||
}); | ||
} |
46 changes: 46 additions & 0 deletions
46
test/functional/apps/dashboard/exports/dashboard_6_0_1.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
[ | ||
{ | ||
"_id": "924ed3d0-8256-11eb-a5e7-93c302c8f329", | ||
"_type": "dashboard", | ||
"_source": { | ||
"title": "My custom bwc dashboard", | ||
"hits": 0, | ||
"description": "", | ||
"panelsJSON": "[{\"size_x\":6,\"size_y\":3,\"panelIndex\":1,\"type\":\"visualization\",\"id\":\"1bdf34a0-8266-11eb-a5e7-93c302c8f329\",\"col\":1,\"row\":1}]", | ||
"optionsJSON": "{\"darkTheme\":false}", | ||
"uiStateJSON": "{\"P-1\":{\"vis\":{\"defaultColors\":{\"0 - 100\":\"rgb(0,104,55)\"}}}}", | ||
"version": 1, | ||
"timeRestore": true, | ||
"timeTo": "Wed Apr 20 2016 23:59:59 GMT+0200", | ||
"timeFrom": "Thu Jan 01 2015 00:00:00 GMT+0100", | ||
"refreshInterval": { | ||
"display": "Off", | ||
"pause": false, | ||
"value": 0 | ||
}, | ||
"kibanaSavedObjectMeta": { | ||
"searchSourceJSON": "{\"query\":{\"language\":\"lucene\",\"query\":\"\"},\"filter\":[],\"highlightAll\":true,\"version\":true}" | ||
} | ||
}, | ||
"_meta": { | ||
"savedObjectVersion": 2 | ||
} | ||
}, | ||
{ | ||
"_id": "1bdf34a0-8266-11eb-a5e7-93c302c8f329", | ||
"_type": "visualization", | ||
"_source": { | ||
"title": "My custom bwc viz", | ||
"visState": "{\"title\":\"My custom bwc viz\",\"type\":\"metric\",\"params\":{\"addTooltip\":true,\"addLegend\":false,\"type\":\"gauge\",\"gauge\":{\"verticalSplit\":false,\"autoExtend\":false,\"percentageMode\":false,\"gaugeType\":\"Metric\",\"gaugeStyle\":\"Full\",\"backStyle\":\"Full\",\"orientation\":\"vertical\",\"colorSchema\":\"Green to Red\",\"gaugeColorMode\":\"None\",\"useRange\":false,\"colorsRange\":[{\"from\":0,\"to\":100}],\"invertColors\":false,\"labels\":{\"show\":true,\"color\":\"black\"},\"scale\":{\"show\":false,\"labels\":false,\"color\":\"#333\",\"width\":2},\"type\":\"simple\",\"style\":{\"fontSize\":60,\"bgColor\":false,\"labelColor\":false,\"subText\":\"\"}}},\"aggs\":[{\"id\":\"1\",\"enabled\":true,\"type\":\"count\",\"schema\":\"metric\",\"params\":{}}]}", | ||
"uiStateJSON": "{\"vis\":{\"defaultColors\":{\"0 - 100\":\"rgb(0,104,55)\"}}}", | ||
"description": "", | ||
"version": 1, | ||
"kibanaSavedObjectMeta": { | ||
"searchSourceJSON": "{\"index\":\"dd684000-8255-11eb-a5e7-93c302c8f329\",\"filter\":[],\"query\":{\"query\":\"\",\"language\":\"lucene\"}}" | ||
} | ||
}, | ||
"_meta": { | ||
"savedObjectVersion": 2 | ||
} | ||
} | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters