Skip to content

Commit

Permalink
Fix url validation for context menu
Browse files Browse the repository at this point in the history
Signed-off-by: Joshua Li <joshuali925@gmail.com>
  • Loading branch information
joshuali925 committed Jul 28, 2021
1 parent efb5a90 commit 2395f54
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -71,11 +71,11 @@ export const contextMenuCreateReportDefinition = (baseURI) => {
const timeRanges = getTimeFieldsFromUrl();

// check report source
if (baseURI.includes('dashboard')) {
if (/^\/(_plugin\/kibana\/|_dashboards\/)?app\/dashboards/.test(baseURI)) {
reportSource = 'dashboard:';
} else if (baseURI.includes('visualize')) {
} else if (/^\/(_plugin\/kibana\/|_dashboards\/)?app\/visualize/.test(baseURI)) {
reportSource = 'visualize:';
} else if (baseURI.includes('discover')) {
} else if (/^\/(_plugin\/kibana\/|_dashboards\/)?app\/discover/.test(baseURI)) {
reportSource = 'discover:';
}
reportSource += reportSourceId.toString();
Expand Down

0 comments on commit 2395f54

Please sign in to comment.