From d345cc018c299ca50de80f2fd8319d5df149eb1d Mon Sep 17 00:00:00 2001 From: Rafael Taranto Date: Mon, 25 Feb 2019 10:52:05 -0300 Subject: [PATCH] Add contact card to admin --- lamassu-admin-elm/src/NavBar.elm | 3 +- lamassu-schema.json | 54 ++++++++++++++++++++++++++++++++ lib/routes.js | 8 ++++- public/elm.js | 12 +++++-- 4 files changed, 73 insertions(+), 4 deletions(-) diff --git a/lamassu-admin-elm/src/NavBar.elm b/lamassu-admin-elm/src/NavBar.elm index ba2f5792..29e7b6d9 100644 --- a/lamassu-admin-elm/src/NavBar.elm +++ b/lamassu-admin-elm/src/NavBar.elm @@ -156,7 +156,7 @@ determineConfigCategory : String -> Maybe Category determineConfigCategory configCode = if List.member configCode [ "definition", "setup", "cashOut", "commissions", "balanceAlerts" ] then Just MachineSettingsCat - else if List.member configCode [ "walletSettings", "notifications", "compliance", "coinAtmRadar", "terms" ] then + else if List.member configCode [ "walletSettings", "notifications", "compliance", "coinAtmRadar", "terms", "operatorInfo" ] then Just GlobalSettingsCat else Nothing @@ -252,6 +252,7 @@ view route invalidGroups = , configLink "compliance" "Compliance" , configLink "coinAtmRadar" "Coin ATM Radar" , configLink "terms" "Terms and Conditions" + , configLink "operatorInfo" "Operator Info" ] , ll ( "Third Party Services", AccountCat, AccountRoute "bitgo", True ) [ ( "BitGo", AccountRoute "bitgo", True ) diff --git a/lamassu-schema.json b/lamassu-schema.json index ddac5ee9..e0c30845 100644 --- a/lamassu-schema.json +++ b/lamassu-schema.json @@ -133,6 +133,18 @@ "termsAcceptButtonText", "termsCancelButtonText" ] + }, + { + "code": "operatorInfo", + "display": "Operator Info", + "cryptoScope": "global", + "machineScope": "global", + "fields": [ + "operatorInfoActive", + "operatorInfoEmail", + "operatorInfoName", + "operatorInfoPhone" + ] } ], "fields": [ @@ -921,6 +933,48 @@ "termsScreenActive" ], "fieldValidation": [] + }, + { + "code": "operatorInfoActive", + "displayBottom": "Info card enabled", + "fieldType": "onOff", + "fieldClass": null, + "fieldValidation": [], + "default": false + }, + { + "code": "operatorInfoName", + "displayBottom": "Name", + "displayTopCount": 0, + "fieldType": "string", + "fieldClass": null, + "default": "", + "enabledIfAny": [ + "operatorInfoActive" + ], + "fieldValidation": [] + }, + { + "code": "operatorInfoEmail", + "displayBottom": "Email", + "displayTopCount": 0, + "fieldType": "string", + "fieldClass": "email", + "enabledIfAny": [ + "operatorInfoActive" + ], + "fieldValidation": [] + }, + { + "code": "operatorInfoPhone", + "displayBottom": "Phone", + "displayTopCount": 0, + "fieldType": "string", + "fieldClass": null, + "enabledIfAny": [ + "operatorInfoActive" + ], + "fieldValidation": [] } ] } diff --git a/lib/routes.js b/lib/routes.js index 4bbd9dd2..be9836ee 100644 --- a/lib/routes.js +++ b/lib/routes.js @@ -90,7 +90,13 @@ function poll (req, res, next) { twoWayMode: config.cashOutEnabled, zeroConfLimit: config.zeroConfLimit, reboot, - hasLightning + hasLightning, + operatorInfo: { + active: config.operatorInfoActive, + name: config.operatorInfoName, + phone: config.operatorInfoPhone, + email: config.operatorInfoEmail + } } if (response.idVerificationEnabled) { diff --git a/public/elm.js b/public/elm.js index d044c4b4..a8444e50 100644 --- a/public/elm.js +++ b/public/elm.js @@ -37230,7 +37230,11 @@ var _user$project$NavBar$determineConfigCategory = function (configCode) { _1: { ctor: '::', _0: 'terms', - _1: {ctor: '[]'} + _1: { + ctor: '::', + _0: 'operatorInfo', + _1: {ctor: '[]'} + } } } } @@ -37679,7 +37683,11 @@ var _user$project$NavBar$view = F2( _1: { ctor: '::', _0: A2(configLink, 'terms', 'Terms and Conditions'), - _1: {ctor: '[]'} + _1: { + ctor: '::', + _0: A2(configLink, 'operatorInfo', 'Operator Info'), + _1: {ctor: '[]'} + } } } }