Skip to content

Commit 28d10ac

Browse files
fix: create report from context menu
1 parent 7790110 commit 28d10ac

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

public/components/context_menu/context_menu_helpers.js

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -49,17 +49,16 @@ export const contextMenuCreateReportDefinition = (baseURI) => {
4949
const timeRanges = getTimeFieldsFromUrl();
5050

5151
// check report source
52-
if (/\/app\/dashboards/.test(baseURI)) {
52+
if (/\/app\/data-explorer\/dashboards/.test(baseURI)) {
5353
reportSource = 'dashboard:';
54-
} else if (/\/app\/visualize/.test(baseURI)) {
54+
} else if (/\/app\/data-explorer\/visualize/.test(baseURI)) {
5555
reportSource = 'visualize:';
56-
} else if (/\/app\/discover/.test(baseURI)) {
56+
} else if (/\/app\/data-explorer\/discover/.test(baseURI)) {
5757
reportSource = 'discover:';
5858
}
5959
reportSource += reportSourceId.toString();
60-
window.location.assign(
61-
`reports-dashboards#/create?previous=${reportSource}?timeFrom=${timeRanges.time_from.toISOString()}?timeTo=${timeRanges.time_to.toISOString()}`
62-
);
60+
applicationService.getApplication().navigateToApp(PLUGIN_ID, { path: `#/create?previous=${reportSource}?timeFrom=${timeRanges.time_from.toISOString()}?timeTo=${timeRanges.time_to.toISOString()}`});
61+
6362
};
6463

6564
export const displayLoadingModal = () => {
@@ -163,4 +162,4 @@ export const positionReportPopover = (triggerElementId = 'downloadReport') => {
163162
arrow.setAttribute('style', `left: ${arrowOffset}px; top: 0px;`);
164163
}
165164
}
166-
};
165+
};

0 commit comments

Comments
 (0)