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

chore: release issue grouping #27061

Open
wants to merge 18 commits into
base: master
Choose a base branch
from
Open
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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 0 additions & 1 deletion frontend/src/lib/constants.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,6 @@ export const FEATURE_FLAGS = {
PERSONLESS_EVENTS_NOT_SUPPORTED: 'personless-events-not-supported', // owner: @raquelmsmith
ALERTS: 'alerts', // owner: @anirudhpillai #team-product-analytics
ERROR_TRACKING: 'error-tracking', // owner: #team-error-tracking
ERROR_TRACKING_GROUP_ACTIONS: 'error-tracking-group-actions', // owner: #team-error-tracking
SETTINGS_BOUNCE_RATE_PAGE_VIEW_MODE: 'settings-bounce-rate-page-view-mode', // owner: @robbie-c
ONBOARDING_DASHBOARD_TEMPLATES: 'onboarding-dashboard-templates', // owner: @raquelmsmith
MULTIPLE_BREAKDOWNS: 'multiple-breakdowns', // owner: @skoob13 #team-product-analytics
Expand Down
8 changes: 4 additions & 4 deletions frontend/src/scenes/error-tracking/ErrorTrackingFilters.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,8 @@ const RecordingsUniversalFilterGroup = (): JSX.Element => {
)
}

export const Options = ({ isGroup = false }: { isGroup?: boolean }): JSX.Element => {
const { dateRange, assignee, hasGroupActions } = useValues(errorTrackingLogic)
export const Options = ({ isIssue = false }: { isIssue?: boolean }): JSX.Element => {
const { dateRange, assignee } = useValues(errorTrackingLogic)
const { setDateRange, setAssignee } = useActions(errorTrackingLogic)
const { orderBy } = useValues(errorTrackingSceneLogic)
const { setOrderBy } = useActions(errorTrackingSceneLogic)
Expand All @@ -106,7 +106,7 @@ export const Options = ({ isGroup = false }: { isGroup?: boolean }): JSX.Element
size="small"
/>
</div>
{!isGroup && (
{!isIssue && (
<div className="flex items-center gap-1">
<span>Sort by:</span>
<LemonSelect
Expand Down Expand Up @@ -141,7 +141,7 @@ export const Options = ({ isGroup = false }: { isGroup?: boolean }): JSX.Element
)}
</div>
<div className="flex items-center gap-1">
{hasGroupActions && !isGroup && (
{!isIssue && (
<>
<span>Assigned to:</span>
<MemberSelect
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ const STATUS_LABEL: Record<ErrorTrackingIssue['status'], string> = {
}

export function ErrorTrackingIssueScene(): JSX.Element {
const { issue, issueLoading, hasGroupActions } = useValues(errorTrackingIssueSceneLogic)
const { issue, issueLoading } = useValues(errorTrackingIssueSceneLogic)
const { updateIssue, loadIssue } = useActions(errorTrackingIssueSceneLogic)

useEffect(() => {
Expand All @@ -45,7 +45,7 @@ export function ErrorTrackingIssueScene(): JSX.Element {
<>
<PageHeader
buttons={
issue && hasGroupActions ? (
issue ? (
issue.status === 'active' ? (
<div className="flex divide-x gap-x-2">
<AssigneeSelect
Expand Down Expand Up @@ -83,7 +83,7 @@ export function ErrorTrackingIssueScene(): JSX.Element {
/>
<ErrorTrackingFilters.FilterGroup />
<LemonDivider className="mt-2" />
<ErrorTrackingFilters.Options isGroup />
<ErrorTrackingFilters.Options isIssue />
<OverviewTab />
<SymbolSetUploadModal />
</>
Expand Down
25 changes: 11 additions & 14 deletions frontend/src/scenes/error-tracking/ErrorTrackingScene.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,6 @@ const CustomVolumeColumnHeader: QueryContextColumnTitleComponent = ({ columnName
}

const CustomGroupTitleColumn: QueryContextColumnComponent = (props) => {
const { hasGroupActions } = useValues(errorTrackingLogic)
const { selectedIssueIds } = useValues(errorTrackingSceneLogic)
const { setSelectedIssueIds } = useActions(errorTrackingSceneLogic)

Expand All @@ -124,19 +123,17 @@ const CustomGroupTitleColumn: QueryContextColumnComponent = (props) => {

return (
<div className="flex items-start space-x-1.5 group">
{hasGroupActions && (
<LemonCheckbox
className={clsx('pt-1 group-hover:visible', !checked && 'invisible')}
checked={checked}
onChange={(newValue) => {
setSelectedIssueIds(
newValue
? [...new Set([...selectedIssueIds, record.id])]
: selectedIssueIds.filter((id) => id != record.id)
)
}}
/>
)}
<LemonCheckbox
className={clsx('pt-1 group-hover:visible', !checked && 'invisible')}
checked={checked}
onChange={(newValue) => {
setSelectedIssueIds(
newValue
? [...new Set([...selectedIssueIds, record.id])]
: selectedIssueIds.filter((id) => id != record.id)
)
}}
/>
<LemonTableLink
title={record.name || 'Unknown Type'}
description={
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ export const errorTrackingDataNodeLogic = kea<errorTrackingDataNodeLogicType>([
...values.response,
results: results
// remove merged issues
.filter(({ id }) => !ids.includes(id))
.filter(({ id }) => !mergingIds.includes(id))
.map((issue) =>
// replace primary issue
mergedIssue.id === issue.id ? mergedIssue : issue
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ export const errorTrackingIssueSceneLogic = kea<errorTrackingIssueSceneLogicType
key((props) => props.id),

connect({
values: [errorTrackingLogic, ['dateRange', 'filterTestAccounts', 'filterGroup', 'hasGroupActions']],
values: [errorTrackingLogic, ['dateRange', 'filterTestAccounts', 'filterGroup']],
}),

actions({
Expand Down
9 changes: 1 addition & 8 deletions frontend/src/scenes/error-tracking/errorTrackingLogic.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import type { LemonSegmentedButtonOption } from '@posthog/lemon-ui'
import { actions, connect, kea, listeners, path, reducers, selectors } from 'kea'
import { FEATURE_FLAGS } from 'lib/constants'
import { actions, connect, kea, listeners, path, reducers } from 'kea'
import { featureFlagLogic } from 'lib/logic/featureFlagLogic'

import { DateRange } from '~/queries/schema'
Expand Down Expand Up @@ -100,12 +99,6 @@ export const errorTrackingLogic = kea<errorTrackingLogicType>([
},
],
}),
selectors({
hasGroupActions: [
(s) => [s.featureFlags],
(featureFlags): boolean => !!featureFlags[FEATURE_FLAGS.ERROR_TRACKING_GROUP_ACTIONS],
],
}),
listeners(({ values, actions }) => ({
setDateRange: ({ dateRange: { date_from } }) => {
if (date_from) {
Expand Down
18 changes: 3 additions & 15 deletions frontend/src/scenes/error-tracking/errorTrackingSceneLogic.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,7 @@ export const errorTrackingSceneLogic = kea<errorTrackingSceneLogicType>([
connect({
values: [
errorTrackingLogic,
[
'dateRange',
'assignee',
'filterTestAccounts',
'filterGroup',
'sparklineSelectedPeriod',
'searchQuery',
'hasGroupActions',
],
['dateRange', 'assignee', 'filterTestAccounts', 'filterGroup', 'sparklineSelectedPeriod', 'searchQuery'],
],
actions: [
errorTrackingLogic,
Expand Down Expand Up @@ -68,7 +60,6 @@ export const errorTrackingSceneLogic = kea<errorTrackingSceneLogicType>([
s.filterGroup,
s.sparklineSelectedPeriod,
s.searchQuery,
s.hasGroupActions,
],
(
orderBy,
Expand All @@ -77,8 +68,7 @@ export const errorTrackingSceneLogic = kea<errorTrackingSceneLogicType>([
filterTestAccounts,
filterGroup,
sparklineSelectedPeriod,
searchQuery,
hasGroupActions
searchQuery
): DataTableNode =>
errorTrackingQuery({
orderBy,
Expand All @@ -88,9 +78,7 @@ export const errorTrackingSceneLogic = kea<errorTrackingSceneLogicType>([
filterGroup,
sparklineSelectedPeriod,
searchQuery,
columns: hasGroupActions
? ['error', 'occurrences', 'sessions', 'users', 'assignee']
: ['error', 'occurrences', 'sessions', 'users'],
columns: ['error', 'occurrences', 'sessions', 'users', 'assignee'],
}),
],
}),
Expand Down
12 changes: 6 additions & 6 deletions posthog/api/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -515,12 +515,12 @@ def register_grandfathered_environment_nested_viewset(
["team_id"],
)

# projects_router.register(
# r"error_tracking",
# error_tracking.ErrorTrackingGroupViewSet,
# "project_error_tracking",
# ["team_id"],
# )
projects_router.register(
r"error_tracking/issue",
error_tracking.ErrorTrackingIssueViewSet,
"project_error_tracking_issue",
["team_id"],
)

projects_router.register(
r"error_tracking/stack_frames",
Expand Down
2 changes: 1 addition & 1 deletion posthog/api/error_tracking.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ class Meta:
fields = ["assignee", "status"]


class ErrorTrackingGroupViewSet(TeamAndOrgViewSetMixin, ForbidDestroyModel, viewsets.ModelViewSet):
class ErrorTrackingIssueViewSet(TeamAndOrgViewSetMixin, ForbidDestroyModel, viewsets.ModelViewSet):
scope_object = "INTERNAL"
queryset = ErrorTrackingIssue.objects.all()
serializer_class = ErrorTrackingIssueSerializer
Expand Down
Loading