Skip to content

Commit

Permalink
Fix reporting discover (#190) (#192)
Browse files Browse the repository at this point in the history
(cherry picked from commit 2d643cc)

Signed-off-by: Derek Ho <[email protected]>
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
  • Loading branch information
1 parent 4298d7f commit 82c6850
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions public/components/context_menu/context_menu.js
Original file line number Diff line number Diff line change
Expand Up @@ -336,6 +336,7 @@ window.onpopstate = history.onpushstate = () => {
};

const getApiPath = () => {
if (window.location.href.includes('/data-explorer/discover/')) return '../../../api'
if (window.location.href.includes('/data-explorer/discover')) return '../../api'
return '../api'
}
Expand Down
2 changes: 1 addition & 1 deletion public/components/context_menu/context_menu_helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export const contextMenuViewReports = () =>
export const getTimeFieldsFromUrl = () => {
const url = unhashUrl(window.location.href);

let [, fromDateString, toDateString] = url.match(timeRangeMatcher);
let [, fromDateString, toDateString] = url.match(timeRangeMatcher) ?? ["", "now-15m", "now"];
fromDateString = decodeURIComponent(fromDateString.replace(/[']+/g, ''));
// convert time range to from date format in case time range is relative
const fromDateFormat = dateMath.parse(fromDateString);
Expand Down

0 comments on commit 82c6850

Please sign in to comment.