some of jake's feedback

This commit is contained in:
Kevin Darby committed 2018-11-19 12:02:02 -05:00
1 parent 256b296521
commit 51ed3a4c2c
3 files changed
+19 -4

No files matched your search

@@ -64,6 +64,8 @@ void UserServiceServer::authenticate_login(const api::user::AuthenticateLoginReq
for (const auto& user : admin_data.result()->users()) {
if (user.name() == req.login() && user.password() == req.password() && user.is_present()) {
resp.set_is_valid(user.is_active());
if(!resp.is_valid())
resp.set_reason("User login privledges restricted, please contact your risk manager");
resp.set_user_id(user.id());
resp.mutable_token()->CopyFrom(api::auth::generate_token(user));
+8
View File
@@ -11,6 +11,14 @@ type IsDisabled =
let isDisabled = function
| Disabled -> true
| Enabled -> false
type IsHidden =
| Hidden
| Visible
let isHidden = function
| Hidden -> true
| Visible -> false
let boolToDisabledConverter d =
match d with
+9 -4
View File
@@ -54,7 +54,8 @@ let generalTabView (model:Model) (dispatch:Msg->Unit) (readonly: bool)=
|> List.map (fun a -> a.id.ToString(), a.name)
|> Map.ofList
let can_create = model.can_create || model.this_username = Access.superuser
let can_create = model.can_create || (model.this_username = Access.superuser)
let can_login_disabled = readonly || (model.this_username = model.scratchUser.name)
let modal = Modal.showCreate
"Create User"
(div [][
@@ -75,7 +76,7 @@ let generalTabView (model:Model) (dispatch:Msg->Unit) (readonly: bool)=
Fields.password "Password" model.scratchUser.password [Disabled readonly] (Password >> UpdateField >> dispatch)
Fields.text "Full Name" model.scratchUser.fullName [Disabled readonly] (FullName >> UpdateField >> dispatch)
Fields.text "Company" model.scratchUser.company [Disabled readonly] (Company >> UpdateField >> dispatch)
Fields.checkbox "Can Login and Trade?" "Unchecking this stops the user from logging into Spark and entering orders" model.scratchUser.isActive [Disabled readonly] (IsActive >> UpdateField >> dispatch)
Fields.checkbox "Can Login and Trade?" "Unchecking this stops the user from logging into Spark and entering orders" model.scratchUser.isActive [Disabled can_login_disabled] (IsActive >> UpdateField >> dispatch)
Fields.checkbox "Can Create?" "Checking this allows the user to create other users and accounts" model.scratchUser.canCreate [Disabled (readonly || not can_create)] (CanCreate >> UpdateField >> dispatch)
(if (State.isNewUser model.scratchUser) then modal else span[][])
]
@@ -182,7 +183,8 @@ let MarketDataTabView (model:Model) (dispatch:Msg->Unit) (readonly:bool) =
div [Style [Padding " .5em 1em"]] micList
h3 [Class "is-size-4"] [ str "Designations" ]
Fields.enumSelect "Pro / Non-Pro" (toHuman false ProfessionalDesignation.values cmeData.proNonpro) (allToHuman false ProfessionalDesignation.values) [Disabled readonly] (fromHuman ProfessionalDesignation.values>>UserField.CMEProNonPro>>send)
//Pico recommends we hide this for the ICE
//Fields.enumSelect "Pro / Non-Pro" (toHuman false ProfessionalDesignation.values cmeData.proNonpro) (allToHuman false ProfessionalDesignation.values) [Disabled readonly] (fromHuman ProfessionalDesignation.values>>UserField.CMEProNonPro>>send)
Fields.enumSelect "Display / Non-Display" (toHuman false DisplayDesignation.values cmeData.displayNondisplay) (allToHuman false DisplayDesignation.values) [Disabled readonly] (fromHuman DisplayDesignation.values>>UserField.CMEDisplayNonDisplay>>send)
]
@@ -358,7 +360,10 @@ let NavRoot (usersList:BTSUser list) (currentUser:BTSUser) model (dispatch:Msg->
[ p [ Class "menu-label" ] [
span [Class "is-size-4"] [str "Users"]
span [ Class "is-pulled-right circle-icon" ]
[ Button.fabutton "Add User" "plus-circle" "" Button.Enabled (fun _ -> dispatch AddUser) ]
[ Button.fabutton "Add User" "plus-circle" ""
( if currentUser.canCreate then Button.Enabled else Button.Disabled)
(fun _ -> dispatch AddUser)
]
]
ul [ Class "menu-list" ]