diff --git a/dapp/bower.json b/dapp/bower.json index d215d442..8537da25 100644 --- a/dapp/bower.json +++ b/dapp/bower.json @@ -41,7 +41,6 @@ "abi-decoder": "1.0.8", "SpinKit": "spinkit#^1.2.5", "web3-provider-engine": "https://github.com/denisgranha/provider-engine.git#dce3f8d701eb1fcd794c86f2debb6af752aa44b3", - "eth-lightwallet": "https://github.com/ConsenSys/eth-lightwallet.git", "file-saver": "^1.3.3", "hooked-web3-provider": "https://github.com/ConsenSys/hooked-web3-provider.git", "entropy-collector": "https://github.com/vibornoff/entropy-collector.js.git", diff --git a/dapp/config.js b/dapp/config.js index beb0e93e..2dc630c1 100644 --- a/dapp/config.js +++ b/dapp/config.js @@ -3,13 +3,6 @@ var txDefaultOrig = gasLimit: 3141592, gasPrice: 18000000000, ethereumNode: "https://mainnet.infura.io:443", - alertNode: { - url : "https://alerts.gnosis.pm", - authCode: null, - name: "Mainnet", - managementPage: "https://alerts.gnosis.pm/api/alert/manage/?code={auth-code}", - managementRoute: "api/alert/manage" - }, connectionChecker:{ method : "OPTIONS", url : "https://www.google.com", @@ -131,22 +124,6 @@ var txDefault = { name: "Local node" } ], - alertNodes: { - 'mainnet': { - url: 'https://alerts.gnosis.pm', - authCode: null, - name: 'Mainnet', - networkId: 1, - managementPage: "https://alerts.gnosis.pm/api/alert/manage/?code={auth-code}" - }, - 'kovan': { - url: 'https://testalerts.gnosis.pm', - authCode: null, - name: 'Kovan', - networkId: 42, - managementPage: "https://testalerts.gnosis.pm/api/alert/manage/?code={auth-code}" - } - }, walletFactoryAddresses: { 'mainnet': { name: 'Mainnet', diff --git a/dapp/controllers/addNotificationsCtrl.js b/dapp/controllers/addNotificationsCtrl.js deleted file mode 100644 index 394b6f0c..00000000 --- a/dapp/controllers/addNotificationsCtrl.js +++ /dev/null @@ -1,142 +0,0 @@ -( - function () { - angular - .module("multiSigWeb") - .controller("addNotificationsCtrl", function ($rootScope, $scope, $uibModalInstance, wallet, EthAlerts, Utils, callback) { - - $scope.selectedEvents = {}; - $scope.params = {}; - - $scope.showLoadingSpinner = false; - $scope.showAlertData = false; - // When True, all events are selected. None otherwise. - var subscribeUnsubscribe = true; - $scope.subscribeUnsubscribeValue = 'Subscribe all'; - - $scope.events = abiJSON.multiSigDailyLimit.abi.filter(function (item) { - if (item.type == 'event') { - return item; - } - }); - - $scope.request = { - 'contract' : wallet.address, - 'abi' : JSON.stringify(abiJSON.multiSigDailyLimit.abi), - 'events' : {} - }; - - var getRequest = { - 'contract' : wallet.address - }; - - /** - * Retrieves the user/contract related Alert and its events - */ - function getAlert () { - var request = {'contract': $scope.request.contract}; - var data = {'params':request}; - EthAlerts.get(data).then( - function successCallback(response) { - for (key in response.data) { - $scope.selectedEvents[key] = true; - } - - if (Object.keys(response.data).length == $scope.events.length) { - subscribeUnsubscribe = false; - $scope.subscribeUnsubscribeValue = 'Unsubscribe all'; - } - - // Show Alert data - $scope.showAlertData = true; - }, - function errorCallback(response) { - $uibModalInstance.close(); - - if (response.status == 401) { - response.data = 'Wrong authentication code.'; - } - else if (response.status = -1) { - response.data = 'An error occurred. Please verify whether Gnosis Alert Node is setted correctly.'; - } - Utils.dangerAlert(response); - } - ); - } - - getAlert(); - - $scope.subscribeUnsubscribe = function () { - if (subscribeUnsubscribe) { - for (event in $scope.events) { - $scope.selectedEvents[$scope.events[event].name] = true; - } - - $scope.subscribeUnsubscribeValue = 'Unsubscribe all'; - } - else { - $scope.selectedEvents = {}; - $scope.subscribeUnsubscribeValue = 'Subscribe all'; - } - - subscribeUnsubscribe = !subscribeUnsubscribe; - - }; - - /** - * Updates the alert - */ - $scope.ok = function () { - Object.keys($scope.selectedEvents).map(function (item) { - if ($scope.selectedEvents[item]==true) { - $scope.request.events[item] = null; - - /*if (item in $scope.params) { - var paramsDict = {}; - Object.keys($scope.params[item]).map(function (param) { - paramsDict[param] = $scope.params[item][param]; - }); - $scope.request.events[item] = paramsDict; - }*/ - } - }); - - // Show loading spinner - $scope.showLoadingSpinner = true; - - EthAlerts.create($scope.request).then( - function successCallback(response) { - $uibModalInstance.close(); - callback(); - Utils.success("The alert was updated successfully."); - }, - function errorCallback(response) { - var errorMessage = ""; - - if (response.status == 401) { - errorMessage = 'Please select one or more events.'; - } - else if (response.status = -1) { - errorMessage = 'An error occurred. Please verify whether Gnosis Alert Node is setted correctly.'; - } - else { - Object.keys(response.data).map(function (error) { - errorMessage += "" + error + ": "; - errorMessage += response.data[error]; - errorMessage += "
"; - }); - } - Utils.dangerAlert(errorMessage); - } - ) - .finally(function () { - $scope.showLoadingSpinner = false; - }); - }; - - $scope.cancel = function () { - $uibModalInstance.dismiss(); - }; - - }); - } -)(); diff --git a/dapp/controllers/notificationsSignupConfirmationCtrl.js b/dapp/controllers/notificationsSignupConfirmationCtrl.js deleted file mode 100644 index 6eba139a..00000000 --- a/dapp/controllers/notificationsSignupConfirmationCtrl.js +++ /dev/null @@ -1,23 +0,0 @@ -( - function () { - angular - .module("multiSigWeb") - .controller("notificationsSignupConfirmationCtrl", function ($rootScope, $scope, $routeParams, $window) { - - function init() { - if ($routeParams['auth-code']) { - var config = Object.assign(txDefault, JSON.parse(localStorage.getItem("userConfig"))); - config.alertNode = config.alertNode || {}; - config.alertNode.authCode = $routeParams['auth-code']; - localStorage.setItem("userConfig", JSON.stringify(config)); - localStorage.setItem("show-signup-success", true); - loadConfiguration(); // config.js - $window.location.href = '/'; - } - } - - init(); - - }); - } -)(); diff --git a/dapp/controllers/notificationsSignupCtrl.js b/dapp/controllers/notificationsSignupCtrl.js deleted file mode 100644 index 3fc76f66..00000000 --- a/dapp/controllers/notificationsSignupCtrl.js +++ /dev/null @@ -1,54 +0,0 @@ -( - function () { - angular - .module("multiSigWeb") - .controller("notificationsSignupCtrl", function ($rootScope, $scope, $uibModalInstance, wallet, EthAlerts, Utils, callback) { - - $scope.request = { - 'email' : '', - 'name' : 'Multisig', - 'callback' : EthAlerts.signupCallback - }; - - $scope.showLoadingSpinner = false; - - $scope.ok = function () { - $scope.showLoadingSpinner = true; - - EthAlerts.signup($scope.request).then( - function successCallback(response) { - $uibModalInstance.close(); - callback(); - Utils.success( - "Signup succeeded. An email was sent to " + - $scope.request.email + - ". Check your inbox and follow the instructions." - ); - }, - function errorCallback(response) { - var errorMessage = ""; - if (response.status = -1) { - errorMessage = 'An error occurred. Please verify the Alert node settings.'; - } - else { - Object.keys(response.data).map(function (error) { - errorMessage += "" + error + ": "; - errorMessage += response.data[error]; - errorMessage += "
"; - }); - } - Utils.dangerAlert(errorMessage); - } - ) - .finally(function () { - $scope.showLoadingSpinner = false; - }); - }; - - $scope.cancel = function () { - $uibModalInstance.dismiss(); - }; - - }); - } -)(); diff --git a/dapp/controllers/settingsCtrl.js b/dapp/controllers/settingsCtrl.js index c22a1f64..b50132fe 100644 --- a/dapp/controllers/settingsCtrl.js +++ b/dapp/controllers/settingsCtrl.js @@ -6,27 +6,10 @@ // Don't save the following config values to localStorage var configBlacklist = [ - "alertNodes", "alertNodesList", "ethereumNodes", "selectedEthereumNode", + "ethereumNodes", "selectedEthereumNode", "walletFactoryAddresses", "selectedWalletFactoryAddress" ]; - /** - * Sets the complete url to the Alert (notifications) management page - */ - function alertNodeSetup () { - if ($scope.config.alertNode && $scope.config.alertNode.authCode) { - if (!$scope.config.alertNode.managementPage) { - if ($scope.config.alertNode.url.endsWith('/')) { - $scope.config.alertNode.managementPage = $scope.config.alertNode.url + txDefaultOrig.alertNode.managementRoute + '/?code={auth-code}'; - } - else { - $scope.config.alertNode.managementPage = $scope.config.alertNode.url + '/' + txDefaultOrig.alertNode.managementRoute + '/?code={auth-code}'; - } - } - $scope.alertManagementPage = $scope.config.alertNode.managementPage.replace('{auth-code}', $scope.config.alertNode.authCode); - } - }; - /** * Loads configuration */ @@ -48,38 +31,32 @@ } } - // Automatically get ETH chain and set the proper alert node + // Automatically get ETH chain Transaction.getEthereumChain().then( function (data) { var factoryAddress; - var alertNode; if (data.chain == 'kovan') { factoryAddress = $scope.config.walletFactoryAddresses['kovan']; - alertNode = $scope.config.alertNodes['kovan']; } else if (data.chain == 'ropsten') { factoryAddress = $scope.config.walletFactoryAddresses['ropsten']; - alertNode = $scope.config.alertNodes['ropsten']; } else if (data.chain == 'privatenet') { factoryAddress = $scope.config.walletFactoryAddresses['privatenet']; - alertNode = $scope.config.alertNodes['privatenet']; } else { factoryAddress = $scope.config.walletFactoryAddresses['mainnet']; - alertNode = $scope.config.alertNodes['mainnet']; } factoryAddress.name = 'Automatic'; - alertNode.name = 'Automatic'; - // Get the current wallet factory address object, + // Get the current wallet factory address object, // we have to search inside the walletFactoryAddresses object - var walletFactoryKeys = Object.keys($scope.config.walletFactoryAddresses); + var walletFactoryKeys = Object.keys($scope.config.walletFactoryAddresses); var currentWalletFactory; - - for (var x=0; x: "; - errorMessage += response.data[error]; - errorMessage += "
"; - }); - } - Utils.dangerAlert(errorMessage); - } - ) - .finally(function () { - $scope.showLoadingSpinner = false; - }); - }; - - $scope.cancel = function () { - $uibModalInstance.dismiss(); - }; - } - }) - .result - .then( - function () { - // Show success message - Utils.success("Authorization code was deleted successfully."); - // Remove authCode from configuration JSON - var config = Config.getUserConfiguration(); - delete config.alertNode.authCode; - delete txDefault.alertNode.authCode; - Config.setConfiguration("userConfig", JSON.stringify(config)); - loadConfig(); - - showHideAuthCodeBtn(); - } - ); - }; - }); } )(); diff --git a/dapp/index.html b/dapp/index.html index 62b0493d..e975b2ba 100644 --- a/dapp/index.html +++ b/dapp/index.html @@ -47,7 +47,7 @@ - - - diff --git a/dapp/main.js b/dapp/main.js index 281bd8df..f32b35e9 100644 --- a/dapp/main.js +++ b/dapp/main.js @@ -200,7 +200,9 @@ function createWindow () { })); // Open the DevTools. - mainWindow.webContents.openDevTools(); + if (process.env.NODE_ENV == 'development') { + mainWindow.webContents.openDevTools(); + } // Declare context menus const selectionMenu = Menu.buildFromTemplate([ diff --git a/dapp/package.json b/dapp/package.json index de0fbccc..5c30ecdf 100644 --- a/dapp/package.json +++ b/dapp/package.json @@ -1,6 +1,6 @@ { "name": "multisigweb", - "version": "1.0.0", + "version": "1.1.0", "eslintConfig": { "env": { "browser": true, @@ -18,7 +18,7 @@ "install-electron": "npm install && ./node_modules/.bin/electron-rebuild", "electron-rebuild": "electron-rebuild --force --module_dir . -w node-hid -e node_modules/electron && npm rebuild leveldown scrypt", "start": "http-server -a 0.0.0.0 -p 5000", - "start-electron": "electron .", + "start-electron": "NODE_ENV=development electron .", "package-linux-x64": "electron-packager . MultisigWallet --prune --ignore=tests/* --ignore=testrpc.sh --platform=linux --out=./dist --overwrite=true --asar=true", "package-osx": "electron-packager . MultisigWallet --prune --ignore=tests/* --ignore=testrpc.sh --platform=darwin --out=./dist --overwrite=true --asar=true", "package-win": "electron-packager . MultisigWallet --prune --ignore=tests/* --ignore=testrpc.sh --platform=win32 --out=./dist --overwrite=true --asar=true", @@ -59,6 +59,7 @@ "eth-sig-util": "^1.2.1", "ethereumjs-testrpc": "git+https://github.com/denisgranha/testrpc.git", "ethereumjs-wallet": "^0.6.0", + "eth-lightwallet": "^3.0.1", "express": "^4.15.2", "grunt": "^1.0.0", "grunt-angular-templates": "^1.1.0", diff --git a/dapp/partials/modals/addNotifications.html b/dapp/partials/modals/addNotifications.html deleted file mode 100644 index 1fd60736..00000000 --- a/dapp/partials/modals/addNotifications.html +++ /dev/null @@ -1,55 +0,0 @@ - - - - -
- - -
diff --git a/dapp/partials/modals/deleteDApp.html b/dapp/partials/modals/deleteDApp.html deleted file mode 100644 index 630c34d7..00000000 --- a/dapp/partials/modals/deleteDApp.html +++ /dev/null @@ -1,25 +0,0 @@ - -
- - -
diff --git a/dapp/partials/modals/notificationsSignup.html b/dapp/partials/modals/notificationsSignup.html deleted file mode 100644 index c1c8ffa1..00000000 --- a/dapp/partials/modals/notificationsSignup.html +++ /dev/null @@ -1,29 +0,0 @@ - -
- - -
diff --git a/dapp/partials/settings.html b/dapp/partials/settings.html index 5ea2a416..95fb1666 100644 --- a/dapp/partials/settings.html +++ b/dapp/partials/settings.html @@ -12,17 +12,15 @@

-
- -
@@ -36,36 +34,6 @@

-
-
- - - -
-
- - -
-
-
-
-
-
- - Manage notifications - - -
-
-
diff --git a/package.json b/package.json index 4a0f1cbf..a9331f69 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "multisig-wallet-gnosis", - "version": "1.0.0", + "version": "1.1.0", "description": "Main module, for installing all dependencies", "scripts": { "test-dapp": "cd dapp && npm test",