From b1507da5676846c2e2394d92f30ffb17b3081736 Mon Sep 17 00:00:00 2001 From: Chris Anderson Date: Thu, 19 Oct 2023 18:29:11 -0500 Subject: [PATCH] Minor journey UI tweaks (#300) --- apps/platform/src/users/UserController.ts | 10 ++++++++++ apps/ui/src/views/journey/JourneyEditor.tsx | 6 +++--- apps/ui/src/views/journey/Journeys.tsx | 2 +- 3 files changed, 14 insertions(+), 4 deletions(-) diff --git a/apps/platform/src/users/UserController.ts b/apps/platform/src/users/UserController.ts index 535b40bd..4240ef77 100644 --- a/apps/platform/src/users/UserController.ts +++ b/apps/platform/src/users/UserController.ts @@ -158,6 +158,16 @@ router.get('/:userId', async ctx => { ctx.body = ctx.state.user }) +router.delete('/:userId', projectRoleMiddleware('editor'), async ctx => { + await App.main.queue.enqueue(UserDeleteJob.from({ + project_id: ctx.state.project.id, + external_id: ctx.state.user!.external_id, + })) + + ctx.status = 204 + ctx.body = '' +}) + router.get('/:userId/lists', async ctx => { const params = extractQueryParams(ctx.query, searchParamsSchema) ctx.body = await getUserLists(ctx.state.user!.id, params, ctx.state.project.id) diff --git a/apps/ui/src/views/journey/JourneyEditor.tsx b/apps/ui/src/views/journey/JourneyEditor.tsx index 54946109..772dd0ce 100644 --- a/apps/ui/src/views/journey/JourneyEditor.tsx +++ b/apps/ui/src/views/journey/JourneyEditor.tsx @@ -186,13 +186,13 @@ function JourneyStepNode({

{name || type.name}

- {stats.completed ?? 0} + {(stats.completed ?? 0).toLocaleString()} {statIcons.completed} { (typeName === 'delay' || !!stats.delay) && ( - {stats.delay ?? 0} + {(stats.delay ?? 0).toLocaleString()} {statIcons.delay} ) @@ -200,7 +200,7 @@ function JourneyStepNode({ { (typeName === 'action' || !!stats.action) && ( - {stats.action ?? 0} + {(stats.action ?? 0).toLocaleString()} {statIcons.action} ) diff --git a/apps/ui/src/views/journey/Journeys.tsx b/apps/ui/src/views/journey/Journeys.tsx index a29e4f4a..31b4c8e6 100644 --- a/apps/ui/src/views/journey/Journeys.tsx +++ b/apps/ui/src/views/journey/Journeys.tsx @@ -40,7 +40,7 @@ export default function Journeys() { }, { key: 'usage', - cell: ({ item }) => item.stats?.entrance, + cell: ({ item }) => item.stats?.entrance.toLocaleString(), }, { key: 'created_at',