chore: track from which page user visited to support page (#5168)

* chore: track from which page user visited to support page

* chore: add safety check

* fix: remove the merged_queries label from histogram

---------

Co-authored-by: Vikrant Gupta <vikrant.thomso@gmail.com>
This commit is contained in:
Yunus M 2024-06-07 14:49:34 +05:30 committed by GitHub
parent a17928df88
commit cf54b5f9ec
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 20 additions and 3 deletions

View File

@ -209,7 +209,9 @@ function SideNav({
if (event && isCtrlMetaKey(event)) {
openInNewTab(`${key}?${queryString.join('&')}`);
} else {
history.push(`${key}?${queryString.join('&')}`);
history.push(`${key}?${queryString.join('&')}`, {
from: pathname,
});
}
}
},

View File

@ -75,7 +75,7 @@ const getHistogramSeries = ({
const legend = newLegend || lgd || '';
const label = isMergedSeries
? 'merged_series'
? ''
: getLabelName(metric, queryName || '', legend);
const color = generateColor(label, themeColors.chartcolors);

View File

@ -70,7 +70,7 @@ const generateTooltipContent = (
const value = data[index][idx];
const dataIngested = quantity[idx];
const label = isMergedSeries
? 'merged_series'
? ''
: getLabelName(metric, queryName || '', legend || '');
let color = generateColor(label, themeColors.chartcolors);

View File

@ -10,6 +10,8 @@ import {
MessageSquare,
Slack,
} from 'lucide-react';
import { useEffect } from 'react';
import { useHistory } from 'react-router-dom';
const { Title, Text } = Typography;
@ -84,11 +86,24 @@ const supportChannels = [
export default function Support(): JSX.Element {
const { trackEvent } = useAnalytics();
const history = useHistory();
const handleChannelWithRedirects = (url: string): void => {
window.open(url, '_blank');
};
useEffect(() => {
if (history?.location?.state) {
const histroyState = history?.location?.state as any;
if (histroyState && histroyState?.from) {
trackEvent(`Support : From URL : ${histroyState.from}`);
}
}
// eslint-disable-next-line react-hooks/exhaustive-deps
}, []);
const handleSlackConnectRequest = (): void => {
const recipient = 'support@signoz.io';
const subject = 'Slack Connect Request';