Skip to content

Commit

Permalink
update regex to match custom saved object id
Browse files Browse the repository at this point in the history
Signed-off-by: Zhongnan Su <szhongna@amazon.com>
  • Loading branch information
zhongnansu committed Mar 8, 2022
1 parent 075f5ac commit 9c9843a
Showing 1 changed file with 2 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@

/* eslint-disable no-restricted-globals */
import $ from 'jquery';
import dateMath from '@elastic/datemath';
import { i18n } from '@osd/i18n';
import { readStreamToFile } from '../main/main_utils';
import {
Expand All @@ -21,9 +20,7 @@ import {
popoverMenuDiscover,
getMenuItem,
} from './context_menu_ui';
import { timeRangeMatcher } from '../utils/utils';
import { parse } from 'url';
import { unhashUrl } from '../../../../../src/plugins/opensearch_dashboards_utils/public';
import { uiSettingsService } from '../utils/settings_service';

const generateInContextReport = async (
Expand Down Expand Up @@ -126,11 +123,8 @@ const generateInContextReport = async (
};

// 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(
/([0-9a-z]+-[0-9a-z]+)+\?/
);
// custom id example: v1s-f00-b4r1-01, Filebeat-Apache-Dashboard-ecs,
const getUuidFromUrl = () => window.location.href.match(/[0-9a-zA-Z-]+\?/);
const isDiscover = () => window.location.href.includes('discover');

// open Download drop-down
Expand Down

0 comments on commit 9c9843a

Please sign in to comment.