* changed url tracker for visualize to not save when linked to originating app
This commit is contained in:
parent
dfb217bf2e
commit
870a529d34
|
@ -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;
|
||||
|
|
|
@ -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 () => {
|
||||
|
|
|
@ -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');
|
||||
|
|
Loading…
Reference in a new issue