Skip to content

Commit

Permalink
add new view fixes and changes
Browse files Browse the repository at this point in the history
  • Loading branch information
ettec committed Oct 31, 2020
1 parent 0b7974e commit 9d3d511
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ export default class ViewNameDialog extends React.Component<ViewNameDialogProps,
})

if( this.layout ) {
this.layout.addTabWithDragAndDrop("Add " + this.displayName + "<br>(Drag to location)", {
this.layout.addTabWithDragAndDropIndirect("Add " + this.displayName + "<br>(Drag to location)", {
component: this.component,
name: this.state.viewName
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ export default class InstrumentListingWatch extends Component<InstrumentListingW


let config: InstrumentWatchPersistentConfig = this.props.node.getConfig()
let initialColConfig = config.colState
let initialColConfig = config?.colState

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

let listingIds = config.listingIds
let listingIds = config?.listingIds
if (listingIds) {
listingIds.forEach(id => this.watchesView.addListing(id))
}
Expand Down Expand Up @@ -308,6 +308,7 @@ export default class InstrumentListingWatch extends Component<InstrumentListingW
getRowNodeId={(data: ListingWatchView) => { return data?.listingId?.toString() }}
onSelectionChanged={this.onSelectionChanged}
rowDragManaged={true}
suppressLoadingOverlay={true}

frameworkComponents={{
countryFlagRenderer: CountryFlagRenderer,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ export default class MarketDepth extends Component<MarketDepthProps, MarketDepth


let config: MarketDepthConfig = this.props.node.getConfig()
let initialColConfig = config.colState
let initialColConfig = config?.colState

if (initialColConfig) {
let colState: ApplyColumnStateParams = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -377,12 +377,14 @@ export default class ParentOrderBlotter extends React.Component<ParentOrderBlott

}

modifyOrder = (order: Order) => {
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)
}
}
}

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

getModifiableOrder(views: Array<OrderView>): 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)

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

0 comments on commit 9d3d511

Please sign in to comment.