[Visualization] Fix: add vis title to state (#48867) (#49036)

* Add error when there is no histogram agg when using parent pipeline

* Update error message

* Update message

* Add vis title to state

* Revert unrelated changes

* Update vis title when vis is renamed

* Update title in url when renaming
This commit is contained in:
Maryia Lapata 2019-10-25 10:29:43 +03:00 committed by GitHub
parent bbb29c6416
commit ebbe4d85ca
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 10 additions and 3 deletions

View file

@ -38,7 +38,11 @@ export const visualization = () => ({
// special case in visualize, we need to render first (without executing the expression), for maps to work
if (visConfig) {
$rootScope.$apply(() => {
handlers.vis.setCurrentState({ type: visType, params: visConfig });
handlers.vis.setCurrentState({
type: visType,
params: visConfig,
title: handlers.vis.title,
});
});
}
} else {

View file

@ -599,6 +599,10 @@ function VisEditor(
} else if (savedVis.id === $route.current.params.id) {
docTitle.change(savedVis.lastSavedTitle);
chrome.breadcrumbs.set($injector.invoke(getEditBreadcrumbs));
savedVis.vis.title = savedVis.title;
savedVis.vis.description = savedVis.description;
// it's needed to save the state to update url string
$state.save();
} else {
kbnUrl.change(`${VisualizeConstants.EDIT_PATH}/{{id}}`, { id: savedVis.id });
}

View file

@ -24,8 +24,7 @@ export default function ({ getService, getPageObjects }) {
const retry = getService('retry');
const PageObjects = getPageObjects(['common', 'visualize']);
// https://github.com/elastic/kibana/issues/37130
describe.skip('data-shared-item', function indexPatternCreation() {
describe('data-shared-item', function indexPatternCreation() {
before(async function () {
log.debug('navigateToApp visualize');
await PageObjects.common.navigateToApp('visualize');