Skip to content

Commit

Permalink
fix: misc fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
niieani committed Jun 4, 2024
1 parent c058f78 commit 916bff6
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 15 deletions.
29 changes: 14 additions & 15 deletions src/stories/mockComponents/TicketView.tsx
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
import React, { useEffect } from 'react'
import styled from 'styled-components'
import { Timeline } from '@zendeskgarden/react-accordions'
import { Avatar } from '@zendeskgarden/react-avatars'
import { Skeleton } from '@zendeskgarden/react-loaders'
import { Well } from '@zendeskgarden/react-notifications'
import { Paragraph, Span, XXL } from '@zendeskgarden/react-typography'
import { Timeline } from '@zendeskgarden/react-accordions'
import styled from 'styled-components'
import { mockTickets } from './mockTickets'
import { DEFAULT_THEME, PALETTE } from '@zendeskgarden/react-theming'
import { Avatar } from '@zendeskgarden/react-avatars'
import { Paragraph, Span, XXL } from '@zendeskgarden/react-typography'
import { ReactComponent as UserIcon } from '@zendeskgarden/svg-icons/src/16/user-solo-stroke.svg'
import { VISIBLE_STATE } from '../../main'
import { TimingComponent } from '../../v2/element'
import { useCaptureRenderBeaconTask } from '../../v2/hooks'
import { mockTickets } from './mockTickets'
import { operationManager } from './operationManager'
import { TimingComponent } from '../../v2/element'

export const StyledSpan = styled(Span).attrs({ isBold: true, hue: 'blue' })`
margin-left: ${DEFAULT_THEME.space.base * 2}px;
Expand All @@ -33,21 +34,19 @@ export const TicketView: React.FC<TicketViewProps> = ({
cached = false,
onLoaded,
}) => {
useCaptureRenderBeaconTask(
{
componentName: 'TicketView',
metadata: { ticketId, loading: !cached },
state: cached ? 'complete' : 'loading',
operationManager,
},
[ticketId],
)
useCaptureRenderBeaconTask({
componentName: 'TicketView',
metadata: { ticketId, loading: !cached },
visibleState: cached ? VISIBLE_STATE.COMPLETE : VISIBLE_STATE.LOADING,
operationManager,
})

const ticket = mockTickets.find((ticket) => ticket.id === ticketId)

useEffect(() => {
const timer = setTimeout(() => {
onLoaded?.()
// eslint-disable-next-line no-magic-numbers
}, 1_500)
return () => void clearTimeout(timer)
}, [ticketId])
Expand Down
1 change: 1 addition & 0 deletions src/v2/sanitizeUrlForTracing.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ export function sanitizeUrlForTracing(url: string): {
let sanitizedUrl = commonUrl.replace(/\/\d+/g, '/$id')
// replace UUIDs as well:
sanitizedUrl = sanitizedUrl.replace(
// eslint-disable-next-line unicorn/better-regex
/[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}/g,
'$uuid',
)
Expand Down

0 comments on commit 916bff6

Please sign in to comment.