Skip to content

Commit

Permalink
fix re-direct links for visualizaitons in notebooks, metrics (opensea…
Browse files Browse the repository at this point in the history
…rch-project#372)

Signed-off-by: Shenoy Pratik <[email protected]>
  • Loading branch information
ps48 authored and joshuali925 committed Apr 18, 2023
1 parent d3f610f commit 42e6013
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
6 changes: 4 additions & 2 deletions public/components/metrics/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ import { MetricsGrid } from './view/metrics_grid';
import { metricsLayoutSelector, selectedMetricsSelector } from './redux/slices/metrics_slice';
import { resolutionOptions } from '../../../common/constants/metrics';
import SavedObjects from '../../services/saved_objects/event_analytics/saved_objects';
import { observabilityLogsID } from '../../../common/constants/shared';

interface MetricsProps {
http: CoreStart['http'];
Expand Down Expand Up @@ -82,7 +83,8 @@ export const Home = ({
setToasts([...toasts, { id: new Date().toISOString(), title, text, color } as Toast]);
};

const onRefreshFilters = (startTime: ShortDate, endTime: ShortDate) => { // eslint-disable-line
const onRefreshFilters = (startTime: ShortDate, endTime: ShortDate) => {
// eslint-disable-line
if (spanValue < 1) {
setToast('Please add a valid span interval', 'danger');
return;
Expand All @@ -103,7 +105,7 @@ export const Home = ({
};

const onEditClick = (savedVisualizationId: string) => {
window.location.assign(`#/${savedVisualizationId}`);
window.location.assign(`${observabilityLogsID}#/explorer/${savedVisualizationId}`);
};

const onSideBarClick = () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ import { Input, Prompt } from '@nteract/presentational-components';
import { uiSettingsService } from '../../../../../common/utils';
import React, { useState } from 'react';
import { ParaType } from '../../../../../common/types/notebooks';
import { observabilityLogsID } from '../../../../../common/constants/shared';

/*
* "ParaInput" component is used by notebook to populate paragraph inputs for an open notebook.
Expand Down Expand Up @@ -118,7 +119,7 @@ export const ParaInput = (props: {
const renderOption = (option: EuiComboBoxOptionOption, searchValue: string) => {
let visURL = `visualize#/edit/${option.key}?_g=(filters:!(),refreshInterval:(pause:!t,value:0),time:(from:'${props.startTime}',to:'${props.endTime}'))`;
if (option.className === 'OBSERVABILITY_VISUALIZATION') {
visURL = `#/event_analytics/explorer/${option.key}`;
visURL = `${observabilityLogsID}#/explorer/${option.key}`;
}
return (
<EuiLink href={visURL} target="_blank">
Expand Down

0 comments on commit 42e6013

Please sign in to comment.