From 9d3d5113661a81055e5829963e3c7943ed3ae93b Mon Sep 17 00:00:00 2001 From: matthewpendrey Date: Sat, 31 Oct 2020 19:05:22 +0000 Subject: [PATCH] add new view fixes and changes --- .../components/Container/ViewNameDialog.tsx | 2 +- .../InstrumentListingWatch.tsx | 5 ++-- .../components/MarketDepth/MarketDepth.tsx | 2 +- .../OrderBlotter/ParentOrderBlotter.tsx | 28 +++++++++++-------- 4 files changed, 22 insertions(+), 15 deletions(-) diff --git a/react/opentp-client/src/components/Container/ViewNameDialog.tsx b/react/opentp-client/src/components/Container/ViewNameDialog.tsx index 8d1b54f1..dfa78448 100644 --- a/react/opentp-client/src/components/Container/ViewNameDialog.tsx +++ b/react/opentp-client/src/components/Container/ViewNameDialog.tsx @@ -118,7 +118,7 @@ export default class ViewNameDialog extends React.Component(Drag to location)", { + this.layout.addTabWithDragAndDropIndirect("Add " + this.displayName + "
(Drag to location)", { component: this.component, name: this.state.viewName }); diff --git a/react/opentp-client/src/components/InstrumentWatch/InstrumentListingWatch.tsx b/react/opentp-client/src/components/InstrumentWatch/InstrumentListingWatch.tsx index 1c74798f..7b550cbe 100644 --- a/react/opentp-client/src/components/InstrumentWatch/InstrumentListingWatch.tsx +++ b/react/opentp-client/src/components/InstrumentWatch/InstrumentListingWatch.tsx @@ -219,7 +219,7 @@ export default class InstrumentListingWatch extends Component this.watchesView.addListing(id)) } @@ -308,6 +308,7 @@ export default class InstrumentListingWatch extends Component { return data?.listingId?.toString() }} onSelectionChanged={this.onSelectionChanged} rowDragManaged={true} + suppressLoadingOverlay={true} frameworkComponents={{ countryFlagRenderer: CountryFlagRenderer, diff --git a/react/opentp-client/src/components/MarketDepth/MarketDepth.tsx b/react/opentp-client/src/components/MarketDepth/MarketDepth.tsx index 8b8940c8..38d01e68 100644 --- a/react/opentp-client/src/components/MarketDepth/MarketDepth.tsx +++ b/react/opentp-client/src/components/MarketDepth/MarketDepth.tsx @@ -160,7 +160,7 @@ export default class MarketDepth extends Component { + modifyOrder = (order: Order | undefined) => { - let listing = this.listingService.GetListingImmediate(order.getListingid()) + if (order) { + let listing = this.listingService.GetListingImmediate(order.getListingid()) - if (listing) { - this.ticketController.openModifyOrderTicket(order, listing) + if (listing) { + this.ticketController.openModifyOrderTicket(order, listing) + } } } @@ -449,22 +451,26 @@ export default class ParentOrderBlotter extends React.Component): Order | undefined { - if( views.length === 1 ) { - let view = views[0] - if( view.getOrder().getDestination() === view?.getListing()?.getMarket()?.getMic() && - view.getOrder().getDestination() !== Destinations.SMARTROUTER ) { + if (views.length === 1) { + let view = views[0] + if (view.getOrder().getDestination() === view?.getListing()?.getMarket()?.getMic() && + view.getOrder().getDestination() !== Destinations.SMARTROUTER) { + + if (view.getOrder().getStatus() === OrderStatus.LIVE) { return view.getOrder() } + + } } - return undefined + return undefined } public render() { - let selectedOrders = this.state.selectedOrderViews.map(v=>v.getOrder()) + let selectedOrders = this.state.selectedOrderViews.map(v => v.getOrder()) let cancelleableOrders = this.getCancellableOrders(this.state.selectedOrderViews) let modifiableOrder = this.getModifiableOrder(this.state.selectedOrderViews) @@ -474,7 +480,7 @@ export default class ParentOrderBlotter extends React.Component