Skip to content

Commit

Permalink
fix: wrong type in verb request defaults
Browse files Browse the repository at this point in the history
  • Loading branch information
wesbillman committed Jan 17, 2025
1 parent e11c8cd commit 3146934
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ export const VerbPage = ({ moduleName, declName }: { moduleName: string; declNam
<div className='flex flex-col h-full'>
<div className='flex h-full'>
<ResizablePanels
mainContent={<VerbRequestForm module={module} verb={verb} />}
mainContent={<VerbRequestForm key={`${module.name}-${verb.verb?.name}`} module={module} verb={verb} />}
rightPanelHeader={header}
rightPanelPanels={verbPanels(verb, callers)}
bottomPanelContent={<TraceRequestList module={module.name} verb={verb.verb?.name} />}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ export const defaultRequest = (verb?: Verb): string => {

if (!verb.jsonRequestSchema) {
const defaultValue = verb.verb?.request ? defaultForType(verb.verb.request) : null
return defaultValue ? JSON.stringify(defaultValue, null, 2) : '{}'
return defaultValue !== null ? JSON.stringify(defaultValue, null, 2) : '{}'
}

const schema = simpleJsonSchema(verb)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,12 @@ export const TimelineCallDetails = ({ event }: { event: Event }) => {
</div>

<div className='text-sm pt-2'>Request</div>
<CodeBlock code={JSON.stringify(JSON.parse(call.request), null, 2)} language='json' />
<CodeBlock code={call.request ? JSON.stringify(JSON.parse(call.request || '{}'), null, 2) : ''} language='json' />

{call.response !== 'null' && (
<>
<div className='text-sm pt-2'>Response</div>
<CodeBlock code={JSON.stringify(JSON.parse(call.response), null, 2)} language='json' />
<CodeBlock code={JSON.stringify(JSON.parse(call.response || '{}'), null, 2)} language='json' />
</>
)}

Expand Down
1 change: 0 additions & 1 deletion frontend/console/src/features/traces/TraceGraph.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,6 @@ export const TraceGraph = ({ requestKey, selectedEventId }: { requestKey?: strin
const startTime = requestStartTime(events)
const totalEventDuration = totalDurationForRequest(events)

console.log(events)
return (
<div className='flex flex-col'>
{events.map((c, index) => (
Expand Down

0 comments on commit 3146934

Please sign in to comment.