added search to legacy redirect URL
This commit is contained in:
parent
f188688c73
commit
8b66056672
|
@ -23,9 +23,8 @@ export const DashboardNoMatch = ({ history }: { history: RouteComponentProps['hi
|
|||
|
||||
useEffect(() => {
|
||||
services.restorePreviousUrl();
|
||||
|
||||
const { navigated } = services.urlForwarding.navigateToLegacyKibanaUrl(
|
||||
history.location.pathname
|
||||
history.location.pathname + history.location.search
|
||||
);
|
||||
|
||||
if (!navigated) {
|
||||
|
|
|
@ -24,7 +24,7 @@ export const VisualizeNoMatch = () => {
|
|||
services.restorePreviousUrl();
|
||||
|
||||
const { navigated } = services.urlForwarding.navigateToLegacyKibanaUrl(
|
||||
services.history.location.pathname
|
||||
services.history.location.pathname + services.history.location.search
|
||||
);
|
||||
|
||||
if (!navigated) {
|
||||
|
|
|
@ -86,6 +86,8 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
|||
});
|
||||
|
||||
describe('6.0 urls', () => {
|
||||
let savedDashboardId: string;
|
||||
|
||||
it('loads an unsaved dashboard', async function () {
|
||||
const url = `${kibanaLegacyBaseUrl}#/dashboard?${urlQuery}`;
|
||||
log.debug(`Navigating to ${url}`);
|
||||
|
@ -106,8 +108,8 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
|||
storeTimeWithDashboard: true,
|
||||
});
|
||||
|
||||
const id = await PageObjects.dashboard.getDashboardIdFromCurrentUrl();
|
||||
const url = `${kibanaLegacyBaseUrl}#/dashboard/${id}`;
|
||||
savedDashboardId = await PageObjects.dashboard.getDashboardIdFromCurrentUrl();
|
||||
const url = `${kibanaLegacyBaseUrl}#/dashboard/${savedDashboardId}`;
|
||||
log.debug(`Navigating to ${url}`);
|
||||
await browser.get(url, true);
|
||||
await PageObjects.header.waitUntilLoadingHasFinished();
|
||||
|
@ -121,6 +123,22 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
|||
await dashboardExpect.selectedLegendColorCount('#F9D9F9', 5);
|
||||
});
|
||||
|
||||
it('loads a saved dashboard with query via dashboard_no_match', async function () {
|
||||
await PageObjects.dashboard.gotoDashboardLandingPage();
|
||||
const currentUrl = await browser.getCurrentUrl();
|
||||
const dashboardBaseUrl = currentUrl.substring(0, currentUrl.indexOf('/app/dashboards'));
|
||||
const url = `${dashboardBaseUrl}/app/dashboards#/dashboard/${savedDashboardId}?_a=(query:(language:kuery,query:'boop'))`;
|
||||
log.debug(`Navigating to ${url}`);
|
||||
await browser.get(url);
|
||||
await PageObjects.header.waitUntilLoadingHasFinished();
|
||||
|
||||
const query = await queryBar.getQueryString();
|
||||
expect(query).to.equal('boop');
|
||||
|
||||
await dashboardExpect.panelCount(2);
|
||||
await PageObjects.dashboard.waitForRenderComplete();
|
||||
});
|
||||
|
||||
it('uiState in url takes precedence over saved dashboard state', async function () {
|
||||
const id = await PageObjects.dashboard.getDashboardIdFromCurrentUrl();
|
||||
const updatedQuery = urlQuery.replace(/F9D9F9/g, '000000');
|
||||
|
|
Loading…
Reference in a new issue