Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Time to Visualize] Disable Visualize URL Tracker When Linked to OriginatingApp #92917

Merged
merged 5 commits into from
Mar 2, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 1 addition & 4 deletions src/plugins/visualize/public/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -116,10 +116,7 @@ export class VisualizePlugin
],
getHistory: () => this.currentHistory!,
onBeforeNavLinkSaved: (urlToSave: string) => {
if (
!urlToSave.includes(`${VisualizeConstants.EDIT_PATH}/`) &&
this.isLinkedToOriginatingApp?.()
) {
if (this.isLinkedToOriginatingApp?.()) {
return core.http.basePath.prepend(VisualizeConstants.VISUALIZE_BASE_PATH);
}
return urlToSave;
Expand Down
4 changes: 2 additions & 2 deletions test/functional/apps/dashboard/create_and_add_embeddables.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,10 +69,10 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
await PageObjects.dashboard.waitForRenderComplete();
});

it('saves the saved visualization url to the app link', async () => {
it('saves the listing page instead of the visualization to the app link', async () => {
await PageObjects.header.clickVisualize(true);
const currentUrl = await browser.getCurrentUrl();
expect(currentUrl).to.contain(VisualizeConstants.EDIT_PATH);
expect(currentUrl).not.to.contain(VisualizeConstants.EDIT_PATH);
});

after(async () => {
Expand Down
18 changes: 18 additions & 0 deletions test/functional/apps/dashboard/edit_visualizations.js
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,24 @@ export default function ({ getService, getPageObjects }) {
expect(await testSubjects.exists('visualizationLandingPage')).to.be(true);
});

it('visualize app menu navigates to the visualize listing page if the last opened visualization was linked to dashboard', async () => {
await PageObjects.common.navigateToApp('dashboard');
await PageObjects.dashboard.gotoDashboardLandingPage();
await PageObjects.dashboard.clickNewDashboard();

// Create markdown by reference.
await createMarkdownVis('by reference');

// Edit then save and return
await editMarkdownVis();
await PageObjects.visualize.saveVisualizationAndReturn();

await PageObjects.header.waitUntilLoadingHasFinished();
await appsMenu.clickLink('Visualize Library');
await PageObjects.common.clickConfirmOnModal();
expect(await testSubjects.exists('visualizationLandingPage')).to.be(true);
});

describe('by value', () => {
it('save and return button returns to dashboard after editing visualization with changes saved', async () => {
await PageObjects.common.navigateToApp('dashboard');
Expand Down