Skip to content

Commit

Permalink
feat: added common doclinks util
Browse files Browse the repository at this point in the history
  • Loading branch information
SagarRajput-7 committed Jul 5, 2024
1 parent 48ad2c2 commit 015e11d
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 9 deletions.
8 changes: 3 additions & 5 deletions frontend/src/container/NoLogs/NoLogs.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import history from 'lib/history';
import { ArrowUpRight } from 'lucide-react';
import { DataSource } from 'types/common/queryBuilder';
import { isCloudUser } from 'utils/app';
import DOCLINKS from 'utils/docLinks';

export default function NoLogs({
dataSource,
Expand All @@ -26,12 +27,9 @@ export default function NoLogs({
: ROUTES.GET_STARTED_LOGS_MANAGEMENT,
);
} else if (dataSource === 'traces') {
window.open(
'https://signoz.io/docs/instrumentation/overview/?utm_source=product&utm_medium=traces-explorer-empty-state',
'_blank',
);
window.open(DOCLINKS.TRACES_EXPLORER_EMPTY_STATE, '_blank');
} else {
window.open(`https://signoz.io/docs/userguide/${dataSource}/`, '_blank');
window.open(`${DOCLINKS.USER_GUIDE}${dataSource}/`, '_blank');
}
};
return (
Expand Down
2 changes: 0 additions & 2 deletions frontend/src/container/TracesExplorer/TracesView/configs.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@ import { generatePath, Link } from 'react-router-dom';
import { ListItem } from 'types/api/widgets/getQuery';

export const PER_PAGE_OPTIONS: number[] = [10, ...DEFAULT_PER_PAGE_OPTIONS];
export const TRACES_DETAILS_LINK =
'https://signoz.io/docs/product-features/trace-explorer/?utm_source=product&utm_medium=traces-explorer-trace-tab#traces-view';

export const columns: ColumnsType<ListItem['data']> = [
{
Expand Down
5 changes: 3 additions & 2 deletions frontend/src/container/TracesExplorer/TracesView/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,11 @@ import { useSelector } from 'react-redux';
import { AppState } from 'store/reducers';
import { DataSource } from 'types/common/queryBuilder';
import { GlobalReducer } from 'types/reducer/globalTime';
import DOCLINKS from 'utils/docLinks';

import TraceExplorerControls from '../Controls';
import { TracesLoading } from '../TraceLoading/TraceLoading';
import { columns, PER_PAGE_OPTIONS, TRACES_DETAILS_LINK } from './configs';
import { columns, PER_PAGE_OPTIONS } from './configs';
import { ActionsContainer, Container } from './styles';

interface TracesViewProps {
Expand Down Expand Up @@ -77,7 +78,7 @@ function TracesView({ isFilterApplied }: TracesViewProps): JSX.Element {
<ActionsContainer>
<Typography>
This tab only shows Root Spans. More details
<Typography.Link href={TRACES_DETAILS_LINK} target="_blank">
<Typography.Link href={DOCLINKS.TRACES_DETAILS_LINK} target="_blank">
{' '}
here
</Typography.Link>
Expand Down
9 changes: 9 additions & 0 deletions frontend/src/utils/docLinks.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
const DOCLINKS = {
TRACES_EXPLORER_EMPTY_STATE:
'https://signoz.io/docs/instrumentation/overview/?utm_source=product&utm_medium=traces-explorer-empty-state',
USER_GUIDE: 'https://signoz.io/docs/userguide/',
TRACES_DETAILS_LINK:
'https://signoz.io/docs/product-features/trace-explorer/?utm_source=product&utm_medium=traces-explorer-trace-tab#traces-view',
};

export default DOCLINKS;

0 comments on commit 015e11d

Please sign in to comment.