@@ -4,7 +4,7 @@ import { action, computed } from 'mobx';
44import { observer , inject } from 'mobx-react' ;
55import * as portals from 'react-reverse-portal' ;
66
7- import { CollectedEvent , HtkResponse , HttpExchange } from '../../../types' ;
7+ import { CollectedEvent , HtkResponse , HttpExchange , HttpExchangeView } from '../../../types' ;
88import { styled } from '../../../styles' ;
99import { logError } from '../../../errors' ;
1010
@@ -21,6 +21,7 @@ import { tagsToErrorType } from '../../../model/http/error-types';
2121import { PaneScrollContainer } from '../view-details-pane' ;
2222import { StreamMessageListCard } from '../stream-message-list-card' ;
2323import { WebSocketCloseCard } from '../websocket-close-card' ;
24+ import { SelfSizedEditor } from '../../editor/base-editor' ;
2425
2526import { HttpBodyCard } from './http-body-card' ;
2627import { HttpApiCard , HttpApiPlaceholderCard } from './http-api-card' ;
@@ -30,7 +31,6 @@ import { HttpAbortedResponseCard } from './http-aborted-card';
3031import { HttpTrailersCard } from './http-trailers-card' ;
3132import { HttpPerformanceCard } from './http-performance-card' ;
3233import { HttpExportCard } from './http-export-card' ;
33- import { SelfSizedEditor } from '../../editor/base-editor' ;
3434import { HttpErrorHeader } from './http-error-header' ;
3535import { HttpDetailsFooter } from './http-details-footer' ;
3636import { HttpRequestBreakpointHeader , HttpResponseBreakpointHeader } from './http-breakpoint-header' ;
@@ -60,7 +60,7 @@ const makeFriendlyApiName = (rawName: string) => {
6060@inject ( 'rulesStore' )
6161@observer
6262export class HttpDetailsPane extends React . Component < {
63- exchange : HttpExchange ,
63+ exchange : HttpExchangeView ,
6464
6565 requestEditor : portals . HtmlPortalNode < typeof SelfSizedEditor > ,
6666 responseEditor : portals . HtmlPortalNode < typeof SelfSizedEditor > ,
@@ -69,8 +69,8 @@ export class HttpDetailsPane extends React.Component<{
6969 navigate : ( path : string ) => void ,
7070 onDelete : ( event : CollectedEvent ) => void ,
7171 onScrollToEvent : ( event : CollectedEvent ) => void ,
72- onBuildRuleFromExchange : ( exchange : HttpExchange ) => void ,
73- onPrepareToResendRequest ?: ( exchange : HttpExchange ) => void ,
72+ onBuildRuleFromExchange : ( exchange : HttpExchangeView ) => void ,
73+ onPrepareToResendRequest ?: ( exchange : HttpExchangeView ) => void ,
7474
7575 // Injected:
7676 uiStore ?: UiStore ,
@@ -96,7 +96,6 @@ export class HttpDetailsPane extends React.Component<{
9696
9797 const { isPaidUser } = accountStore ! ;
9898 const { expandedViewCard } = uiStore ! ;
99- const { requestBreakpoint, responseBreakpoint } = exchange ;
10099
101100 // The full API details - for paid APIs, and non-paid users, we don't show
102101 // the detailed API data in any of the cards, we just show the name (below)
@@ -121,8 +120,8 @@ export class HttpDetailsPane extends React.Component<{
121120 </ > ;
122121 }
123122
124- const cards = ( requestBreakpoint || responseBreakpoint )
125- ? this . renderBreakpointCards ( exchange , apiName , apiExchange )
123+ const cards = ( exchange . downstream . isBreakpointed )
124+ ? this . renderBreakpointCards ( exchange . downstream , apiName , apiExchange )
126125 : this . renderNormalCards ( exchange , apiName , apiExchange ) ;
127126
128127 return < >
@@ -142,15 +141,15 @@ export class HttpDetailsPane extends React.Component<{
142141 </ > ;
143142 }
144143
145- renderHeaderCard ( exchange : HttpExchange ) : JSX . Element | null {
144+ renderHeaderCard ( exchange : HttpExchangeView ) : JSX . Element | null {
146145 const { accountStore, navigate } = this . props ;
147146 const { isPaidUser, getPro } = accountStore ! ;
148147 const {
149148 requestBreakpoint,
150149 respondToBreakpointedRequest,
151150 responseBreakpoint,
152151 tags
153- } = exchange ;
152+ } = exchange . downstream ;
154153
155154 if ( requestBreakpoint ) {
156155 return < HttpRequestBreakpointHeader
@@ -212,15 +211,15 @@ export class HttpDetailsPane extends React.Component<{
212211
213212 private renderExpandedCard (
214213 expandedCard : ExpandableViewCardKey ,
215- exchange : HttpExchange ,
214+ exchange : HttpExchangeView ,
216215 apiExchange : ApiExchange | undefined
217216 ) {
218217 if ( expandedCard === 'requestBody' ) {
219218 return this . renderRequestBody ( exchange , apiExchange ) ;
220219 } else if (
221220 expandedCard === 'responseBody' && (
222221 exchange . isSuccessfulExchange ( ) ||
223- ! ! exchange . responseBreakpoint
222+ ! ! exchange . downstream . responseBreakpoint
224223 ) ) {
225224 return this . renderResponseBody ( exchange , apiExchange ) ;
226225 } else if (
@@ -282,7 +281,7 @@ export class HttpDetailsPane extends React.Component<{
282281 }
283282
284283 private renderNormalCards (
285- exchange : HttpExchange ,
284+ exchange : HttpExchangeView ,
286285 apiName : string | undefined ,
287286 apiExchange : ApiExchange | undefined
288287 ) {
@@ -378,8 +377,9 @@ export class HttpDetailsPane extends React.Component<{
378377 return cards ;
379378 }
380379
381- private renderRequestBody ( exchange : HttpExchange , apiExchange : ApiExchange | undefined ) {
382- const { request, requestBreakpoint } = exchange ;
380+ private renderRequestBody ( exchange : HttpExchangeView , apiExchange : ApiExchange | undefined ) {
381+ const { request } = exchange ;
382+ const { requestBreakpoint } = exchange . downstream ;
383383
384384 return requestBreakpoint
385385 ? < HttpBreakpointBodyCard
@@ -398,8 +398,9 @@ export class HttpDetailsPane extends React.Component<{
398398 /> ;
399399 }
400400
401- private renderResponseBody ( exchange : HttpExchange , apiExchange : ApiExchange | undefined ) {
402- const { response, responseBreakpoint } = exchange ;
401+ private renderResponseBody ( exchange : HttpExchangeView , apiExchange : ApiExchange | undefined ) {
402+ const { response } = exchange ;
403+ const { responseBreakpoint } = exchange . downstream ;
403404
404405 return responseBreakpoint
405406 ? < HttpBreakpointBodyCard
0 commit comments