:hedgehog: PostHog is the leading platform for building self-driving products. Our developer tools – AI observability, analytics, session replay, flags, experiments, error tracking, logs, and more – capture all the context agents need to diagnose problems, uncover opportunities, and ship fixes. Steer it all from Slack, web, desktop, or the MCP.
Python ab-testingai-analyticsanalyticscdpdata-warehouseexperimentsfeature-flagsjavascriptproduct-analyticspythonreactsession-replaysurveystypescriptweb-analytics
fix(conversations): show assignee names on the ticket list (#117438)
Phillaf59e7b8dbb4
diff --git a/products/conversations/frontend/scenes/tickets/supportTicketsSceneLogic.test.ts b/products/conversations/frontend/scenes/tickets/supportTicketsSceneLogic.test.tsindex 0ec047cec944..16d28ea0b4c5 100644--- a/products/conversations/frontend/scenes/tickets/supportTicketsSceneLogic.test.ts+++ b/products/conversations/frontend/scenes/tickets/supportTicketsSceneLogic.test.ts@@ -1,6 +1,9 @@+import { MOCK_DEFAULT_ORGANIZATION_MEMBER } from 'lib/api.mock'+import { router } from 'kea-router'import { expectLogic } from 'kea-test-utils'+import { membersLogic } from 'scenes/organization/membersLogic'import { Scene } from 'scenes/sceneTypes'import { urls } from 'scenes/urls'@@ -8,7 +11,7 @@ import { useMocks } from '~/mocks/jest'import { initKeaTests } from '~/test/init'import { AccessControlLevel } from '~/types'-import { MAX_ASSIGNEE_FILTER_ENTRIES } from '../../components/Assignee'+import { MAX_ASSIGNEE_FILTER_ENTRIES, assigneeSelectLogic } from '../../components/Assignee'import { normalizeAssigneeFilter, type SavedTicketView, type Ticket, type TicketViewFilters } from '../../types'import { supportTicketsSceneLogic } from './supportTicketsSceneLogic'@@ -339,6 +342,35 @@ describe('supportTicketsSceneLogic', () => {})})+ describe('assignee names', () => {+ let logic: ReturnType<typeof supportTicketsSceneLogic.build>++ afterEach(() => {+ logic?.unmount()+ })++ it('loads organization members on mount so a user assignee resolves to a name', async () => {+ useMocks({+ get: {+ '/api/projects/:team_id/conversations/tickets/': () => [200, { count: 0, results: [] }],+ },+ })+ initKeaTests()+ router.actions.push(urls.supportTickets())+ logic = supportTicketsSceneLogic()+ logic.mount()++ await expectLogic(membersLogic).toDispatchActions(['loadAllMembersSuccess'])++ expect(+ assigneeSelectLogic.values.resolveAssignee({+ type: 'user',+ id: MOCK_DEFAULT_ORGANIZATION_MEMBER.user.id,+ })+ ).toMatchObject({ type: 'user', id: MOCK_DEFAULT_ORGANIZATION_MEMBER.user.id })+ })+ })+describe('breadcrumbs', () => {let logic: ReturnType<typeof supportTicketsSceneLogic.build>diff --git a/products/conversations/frontend/scenes/tickets/supportTicketsSceneLogic.ts b/products/conversations/frontend/scenes/tickets/supportTicketsSceneLogic.tsindex 0c6e70f28bc1..7e9160392ba5 100644--- a/products/conversations/frontend/scenes/tickets/supportTicketsSceneLogic.ts+++ b/products/conversations/frontend/scenes/tickets/supportTicketsSceneLogic.ts@@ -2,6 +2,7 @@ import {MakeLogicType,actions,afterMount,+ connect,isBreakpoint,kea,key,@@ -24,6 +25,7 @@ import { teamLogic } from 'scenes/teamLogic'import { AccessControlLevel, AccessControlResourceType, Breadcrumb, TeamType } from '~/types'+import { assigneeSelectLogic } from '../../components/Assignee'import { conversationsTicketsBulkUpdateStatusCreate, conversationsViewsRetrieve } from '../../generated/api'import type { AiTriageResultEnumApi } from '../../generated/api.schemas'import { normalizeAssigneeFilter } from '../../types'@@ -233,6 +235,9 @@ export interface supportTicketsSceneLogicValues {// Generated by kea-typegen. Update if you're an agent, ignore if you're human.export interface supportTicketsSceneLogicActions {+ ensureAssigneeTypesLoaded: () => {+ value: true+ } // assigneeSelectLogicapplyUrlFilters: (filters: TicketViewFilters) => {filters: TicketViewFilters}@@ -388,6 +393,9 @@ export const supportTicketsSceneLogic = kea<supportTicketsSceneLogicType>([path(['products', 'conversations', 'frontend', 'scenes', 'tickets', 'supportTicketsSceneLogic']),props({} as SupportTicketsSceneLogicProps),key((props: SupportTicketsSceneLogicProps) => props?.key || 'SupportTicketsScene'),+ connect(() => ({+ actions: [assigneeSelectLogic, ['ensureAssigneeTypesLoaded']],+ })),actions({setStatusFilter: (statuses: TicketStatus[]) => ({ statuses }),setChannelFilter: (channel: TicketChannel | 'all') => ({ channel }),@@ -1004,6 +1012,9 @@ export const supportTicketsSceneLogic = kea<supportTicketsSceneLogicType>([},})),afterMount(({ actions, values, props }) => {+ // The assignee column and the filter pills turn a user id into a name with the+ // organization member list, and nothing else on this page loads it.+ actions.ensureAssigneeTypesLoaded()const embedded = !!props.distinctIds?.lengthconst { searchParams } = router.valuesif (!embedded && searchParams.view) {