Skip to content

Commit 9d3d511

Browse files
committed
add new view fixes and changes
1 parent 0b7974e commit 9d3d511

File tree

4 files changed

+22
-15
lines changed

4 files changed

+22
-15
lines changed

react/opentp-client/src/components/Container/ViewNameDialog.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ export default class ViewNameDialog extends React.Component<ViewNameDialogProps,
118118
})
119119

120120
if( this.layout ) {
121-
this.layout.addTabWithDragAndDrop("Add " + this.displayName + "<br>(Drag to location)", {
121+
this.layout.addTabWithDragAndDropIndirect("Add " + this.displayName + "<br>(Drag to location)", {
122122
component: this.component,
123123
name: this.state.viewName
124124
});

react/opentp-client/src/components/InstrumentWatch/InstrumentListingWatch.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,7 @@ export default class InstrumentListingWatch extends Component<InstrumentListingW
219219

220220

221221
let config: InstrumentWatchPersistentConfig = this.props.node.getConfig()
222-
let initialColConfig = config.colState
222+
let initialColConfig = config?.colState
223223

224224
if (initialColConfig) {
225225
let colState: ApplyColumnStateParams = {
@@ -229,7 +229,7 @@ export default class InstrumentListingWatch extends Component<InstrumentListingW
229229
this.gridColumnApi.applyColumnState(colState)
230230
}
231231

232-
let listingIds = config.listingIds
232+
let listingIds = config?.listingIds
233233
if (listingIds) {
234234
listingIds.forEach(id => this.watchesView.addListing(id))
235235
}
@@ -308,6 +308,7 @@ export default class InstrumentListingWatch extends Component<InstrumentListingW
308308
getRowNodeId={(data: ListingWatchView) => { return data?.listingId?.toString() }}
309309
onSelectionChanged={this.onSelectionChanged}
310310
rowDragManaged={true}
311+
suppressLoadingOverlay={true}
311312

312313
frameworkComponents={{
313314
countryFlagRenderer: CountryFlagRenderer,

react/opentp-client/src/components/MarketDepth/MarketDepth.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ export default class MarketDepth extends Component<MarketDepthProps, MarketDepth
160160

161161

162162
let config: MarketDepthConfig = this.props.node.getConfig()
163-
let initialColConfig = config.colState
163+
let initialColConfig = config?.colState
164164

165165
if (initialColConfig) {
166166
let colState: ApplyColumnStateParams = {

react/opentp-client/src/components/OrderBlotter/ParentOrderBlotter.tsx

Lines changed: 17 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -377,12 +377,14 @@ export default class ParentOrderBlotter extends React.Component<ParentOrderBlott
377377

378378
}
379379

380-
modifyOrder = (order: Order) => {
380+
modifyOrder = (order: Order | undefined) => {
381381

382-
let listing = this.listingService.GetListingImmediate(order.getListingid())
382+
if (order) {
383+
let listing = this.listingService.GetListingImmediate(order.getListingid())
383384

384-
if (listing) {
385-
this.ticketController.openModifyOrderTicket(order, listing)
385+
if (listing) {
386+
this.ticketController.openModifyOrderTicket(order, listing)
387+
}
386388
}
387389
}
388390

@@ -449,22 +451,26 @@ export default class ParentOrderBlotter extends React.Component<ParentOrderBlott
449451

450452
getModifiableOrder(views: Array<OrderView>): Order | undefined {
451453

452-
if( views.length === 1 ) {
453-
let view = views[0]
454-
if( view.getOrder().getDestination() === view?.getListing()?.getMarket()?.getMic() &&
455-
view.getOrder().getDestination() !== Destinations.SMARTROUTER ) {
454+
if (views.length === 1) {
455+
let view = views[0]
456+
if (view.getOrder().getDestination() === view?.getListing()?.getMarket()?.getMic() &&
457+
view.getOrder().getDestination() !== Destinations.SMARTROUTER) {
458+
459+
if (view.getOrder().getStatus() === OrderStatus.LIVE) {
456460
return view.getOrder()
457461
}
462+
463+
}
458464
}
459465

460-
return undefined
466+
return undefined
461467
}
462468

463469

464470

465471
public render() {
466472

467-
let selectedOrders = this.state.selectedOrderViews.map(v=>v.getOrder())
473+
let selectedOrders = this.state.selectedOrderViews.map(v => v.getOrder())
468474
let cancelleableOrders = this.getCancellableOrders(this.state.selectedOrderViews)
469475
let modifiableOrder = this.getModifiableOrder(this.state.selectedOrderViews)
470476

@@ -474,7 +480,7 @@ export default class ParentOrderBlotter extends React.Component<ParentOrderBlott
474480
<div className="bp3-dark" style={{ display: 'flex', flexDirection: 'row', paddingTop: 0, alignItems: "left" }}>
475481
<div style={{ flexGrow: 1 }}>
476482
<Button minimal={true} icon="delete" text="Cancel Orders" onClick={() => this.cancelOrder(cancelleableOrders)} disabled={cancelleableOrders.length === 0} />
477-
<Button minimal={true} icon="edit" text="Modify Order" onClick={() => this.modifyOrder(cancelleableOrders[0])} disabled={!modifiableOrder} />
483+
<Button minimal={true} icon="edit" text="Modify Order" onClick={() => this.modifyOrder(modifiableOrder)} disabled={!modifiableOrder} />
478484
<Button minimal={true} icon="fork" text="Child Orders" onClick={() => this.showChildOrders(selectedOrders.values())} disabled={selectedOrders.length !== 1} />
479485
<Button minimal={true} icon="bring-data" text="Order History" onClick={() => this.showOrderHistory(selectedOrders.values())} disabled={selectedOrders.length !== 1} />
480486
<Button minimal={true} icon="tick" text="Executions" onClick={() => this.showExecutions(selectedOrders.values())} disabled={selectedOrders.length !== 1} />

0 commit comments

Comments
 (0)