Skip to content

Commit

Permalink
Update the saved object id matcher regex to match custom id (opensear…
Browse files Browse the repository at this point in the history
…ch-project#295)

Signed-off-by: Zhongnan Su <szhongna@amazon.com>
  • Loading branch information
zhongnansu authored Mar 4, 2022
1 parent 5edfd48 commit 85f736e
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions public/components/context_menu/context_menu.js
Original file line number Diff line number Diff line change
Expand Up @@ -125,10 +125,11 @@ const generateInContextReport = async (
});
};

// try to match uuid followed by '?' in URL, which would be the saved search id for discover URL
// try to match uuid and user entered custom-id followed by '?' in URL, which would be the saved search id for discover URL
// custom id example: v1s-f00-b4r1-01
const getUuidFromUrl = () =>
window.location.href.match(
/(\b[0-9a-f]{8}\b-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-\b[0-9a-f]{12}\b)\?/
/([0-9a-z]+-[0-9a-z]+)+\?/
);
const isDiscover = () => window.location.href.includes('discover');

Expand Down

0 comments on commit 85f736e

Please sign in to comment.