Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix re-direct links for visualizations in notebooks, metrics #372

Merged
merged 1 commit into from
Apr 17, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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