Clear security dropdown

This commit is contained in:
Michael Harding committed 2019-08-29 13:22:53 -04:00
1 parent f59f6a54ce
commit 9fc4b369bf
2 files changed
+18 -11

No files matched your search

+13 -6
View File
@@ -362,6 +362,13 @@ let clearValidNewFills model =
let clearManualFill model =
{model with ManualFillData = {model.ManualFillData with newFills = clearValidNewFills model; updatedFills = []; deletedFills = {manualFill = Array.empty}}}
let validateManualFillQty value =
let nv = System.Int32.TryParse value
match value.Length, fst nv, snd nv with
| 0, _, _ -> true
| _, true, v when v > 0 -> true
| _, _, _ -> false
let update msg (model:Model) : Model * Cmd<Msg> =
match msg with
| UpdateAdminData data ->
@@ -611,12 +618,12 @@ let update msg (model:Model) : Model * Cmd<Msg> =
| Some f -> f
let updatedFill = match place with
| "qty" -> { fill with qty = input}
| "qty" -> if (validateManualFillQty input) then { fill with qty = input} else fill
| "price" -> { fill with price = input}
| "side" -> { fill with side = input}
| "user" -> { fill with user = input}
| "venue" -> { fill with venue = input}
| "symbol" -> { fill with symbol = input}
| "venue" -> { fill with venue = input; symbol = ""; SecurityId = "0" }
| "symbol" -> { fill with symbol = input; SecurityId = "0" }
| "expiration" -> { fill with expiration = input}
| "SecurityId" -> { fill with SecurityId = input}
| _ -> fill
@@ -632,12 +639,12 @@ let update msg (model:Model) : Model * Cmd<Msg> =
| Some f -> f
let updatedFill = match place with
| "qty" -> { fill with qty = input}
| "qty" -> if (validateManualFillQty input) then { fill with qty = input} else fill
| "price" -> { fill with price = input}
| "side" -> { fill with side = input}
| "user" -> { fill with user = input}
| "venue" -> { fill with venue = input}
| "symbol" -> { fill with symbol = input}
| "venue" -> { fill with venue = input; symbol = ""; SecurityId = "0" }
| "symbol" -> { fill with symbol = input; SecurityId = "0" }
| "expiration" -> { fill with expiration = input}
| "SecurityId" -> { fill with SecurityId = input}
| _ -> fill
+5 -5
View File
@@ -901,10 +901,8 @@ let DayPositionView model dispatch =
[
TableControl.Cell (Button.deleteButton Button.IsDisabled.Enabled (fun _ -> ((ulimit.id |> int), false)|> RemoveManualFill |> dispatch))
// TableControl.Cell (span [Style [Color "green"]][str (sprintf "%i" ulimit.id)])
TableControl.Cell (str (venueToString securityMap.[limit.securityKey].venue))
TableControl.Cell (str securityMap.[limit.securityKey].symbol)
// TableControl.Cell (Fields.simpleSelect "" venueList (ulimit.venue) (fun v -> (ulimit.id, v, "venue", false) |> UpdateManualFill |> dispatch))
// TableControl.Cell (Fields.simpleSelect "" (getSymbolList model ulimit.venue) (ulimit.symbol) (fun v -> (ulimit.id, v, "symbol", false) |> UpdateManualFill |> dispatch))
TableControl.Cell (Fields.simpleSelect "" venueList (ulimit.venue) (fun v -> (ulimit.id, v, "venue", false) |> UpdateManualFill |> dispatch))
TableControl.Cell (Fields.simpleSelect "" (getSymbolList model ulimit.venue) (ulimit.symbol) (fun v -> (ulimit.id, v, "symbol", false) |> UpdateManualFill |> dispatch))
TableControl.Cell (Fields.tupleMapSelect
""
(getPositionSecMap
@@ -912,7 +910,9 @@ let DayPositionView model dispatch =
(ulimit.venue)
(ulimit.symbol)
)
(Some securityMap.[uint32 ulimit.SecurityId].securityName)
(match ulimit.SecurityId with
| "0" -> None
| _ -> Some securityMap.[uint32 ulimit.SecurityId].securityName)
(Some ulimit.SecurityId)
(fun v -> (ulimit.id, v, "SecurityId", false) |> UpdateManualFill |> dispatch)
None