Skip to content

Commit

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

Signed-off-by: Derek Ho <dxho@amazon.com>
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 baafdf1 commit 629d88b
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 629d88b

Please sign in to comment.