|
@@ -14,9 +14,11 @@ import {TabsContext} from 'sentry/components/tabs';
|
|
|
import {t} from 'sentry/locale';
|
|
|
import type {InjectedRouter} from 'sentry/types/legacyReactRouter';
|
|
|
import {defined} from 'sentry/utils';
|
|
|
+import {trackAnalytics} from 'sentry/utils/analytics';
|
|
|
import normalizeUrl from 'sentry/utils/url/normalizeUrl';
|
|
|
import {useLocation} from 'sentry/utils/useLocation';
|
|
|
import {useNavigate} from 'sentry/utils/useNavigate';
|
|
|
+import useOrganization from 'sentry/utils/useOrganization';
|
|
|
import {DraggableTabMenuButton} from 'sentry/views/issueList/groupSearchViewTabs/draggableTabMenuButton';
|
|
|
import EditableTabTitle from 'sentry/views/issueList/groupSearchViewTabs/editableTabTitle';
|
|
|
import {IssueSortOptions} from 'sentry/views/issueList/utils';
|
|
@@ -108,6 +110,7 @@ export function DraggableTabBar({
|
|
|
// TODO: Extract this to a separate component encompassing Tab.Item in the future
|
|
|
const [editingTabKey, setEditingTabKey] = useState<string | null>(null);
|
|
|
|
|
|
+ const organization = useOrganization();
|
|
|
const navigate = useNavigate();
|
|
|
const location = useLocation();
|
|
|
|
|
@@ -126,6 +129,9 @@ export function DraggableTabBar({
|
|
|
.filter(defined);
|
|
|
setTabs(newTabs);
|
|
|
onReorder?.(newTabs);
|
|
|
+ trackAnalytics('issue_views.reordered_views', {
|
|
|
+ organization,
|
|
|
+ });
|
|
|
};
|
|
|
|
|
|
const handleOnSaveChanges = () => {
|
|
@@ -143,6 +149,9 @@ export function DraggableTabBar({
|
|
|
});
|
|
|
setTabs(newTabs);
|
|
|
onSave?.(newTabs);
|
|
|
+ trackAnalytics('issue_views.saved_changes', {
|
|
|
+ organization,
|
|
|
+ });
|
|
|
}
|
|
|
};
|
|
|
|
|
@@ -166,6 +175,9 @@ export function DraggableTabBar({
|
|
|
},
|
|
|
});
|
|
|
onDiscard?.();
|
|
|
+ trackAnalytics('issue_views.discarded_changes', {
|
|
|
+ organization,
|
|
|
+ });
|
|
|
}
|
|
|
};
|
|
|
|
|
@@ -177,6 +189,9 @@ export function DraggableTabBar({
|
|
|
);
|
|
|
setTabs(newTabs);
|
|
|
onTabRenamed?.(newTabs, newLabel);
|
|
|
+ trackAnalytics('issue_views.renamed_view', {
|
|
|
+ organization,
|
|
|
+ });
|
|
|
}
|
|
|
};
|
|
|
|
|
@@ -205,6 +220,9 @@ export function DraggableTabBar({
|
|
|
setTabs(newTabs);
|
|
|
tabListState?.setSelectedKey(tempId);
|
|
|
onDuplicate?.(newTabs);
|
|
|
+ trackAnalytics('issue_views.duplicated_view', {
|
|
|
+ organization,
|
|
|
+ });
|
|
|
}
|
|
|
};
|
|
|
|
|
@@ -214,6 +232,9 @@ export function DraggableTabBar({
|
|
|
setTabs(newTabs);
|
|
|
tabListState?.setSelectedKey(newTabs[0].key);
|
|
|
onDelete?.(newTabs);
|
|
|
+ trackAnalytics('issue_views.deleted_view', {
|
|
|
+ organization,
|
|
|
+ });
|
|
|
}
|
|
|
};
|
|
|
|
|
@@ -232,6 +253,9 @@ export function DraggableTabBar({
|
|
|
setTempTab(undefined);
|
|
|
tabListState?.setSelectedKey(tempId);
|
|
|
onSaveTempView?.(newTabs);
|
|
|
+ trackAnalytics('issue_views.temp_view_saved', {
|
|
|
+ organization,
|
|
|
+ });
|
|
|
}
|
|
|
};
|
|
|
|
|
@@ -239,6 +263,9 @@ export function DraggableTabBar({
|
|
|
tabListState?.setSelectedKey(tabs[0].key);
|
|
|
setTempTab(undefined);
|
|
|
onDiscardTempView?.();
|
|
|
+ trackAnalytics('issue_views.temp_view_discarded', {
|
|
|
+ organization,
|
|
|
+ });
|
|
|
};
|
|
|
|
|
|
const handleCreateNewView = () => {
|
|
@@ -267,6 +294,9 @@ export function DraggableTabBar({
|
|
|
});
|
|
|
setTabs(newTabs);
|
|
|
tabListState?.setSelectedKey(tempId);
|
|
|
+ trackAnalytics('issue_views.add_view.clicked', {
|
|
|
+ organization,
|
|
|
+ });
|
|
|
}
|
|
|
};
|
|
|
|