From bb580c14ca6b9aacaa579d0a7ec4adc76f3bc0d1 Mon Sep 17 00:00:00 2001 From: cristianpela Date: Sat, 19 Dec 2020 13:15:15 +0200 Subject: [PATCH 1/2] #253 Contributor stripe dashboard opens in a new tab. - also added one puzzle for wallet activation and one for contracts table optimization. --- src/main/resources/public/js/getAndAddContracts.js | 3 +++ src/main/resources/public/js/wallets.js | 3 ++- src/main/resources/templates/contributor.html | 4 +++- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/main/resources/public/js/getAndAddContracts.js b/src/main/resources/public/js/getAndAddContracts.js index 2ed059dc..b0db14d2 100644 --- a/src/main/resources/public/js/getAndAddContracts.js +++ b/src/main/resources/public/js/getAndAddContracts.js @@ -11,6 +11,9 @@ * but this a good practice since "$" is not "reserved" to jQuery. * Now "$" is just a function argument name and not the jQuery * alias anymore. It could named "foo" fo ex, thus making a call like foo("#contracts") valid. +* @todo #253:60min On frontend, in Contracts tab, after adding a new contract, we should add the new +* contract to contract table, instead of updating table by re-fetching all contracts again. +* Same logic should be applied to "markContractForRemove" and "restoreContract". */ (function getAndAddContracts($, contractsService, usersService, confirmDialog){ diff --git a/src/main/resources/public/js/wallets.js b/src/main/resources/public/js/wallets.js index 50a09201..e1536547 100644 --- a/src/main/resources/public/js/wallets.js +++ b/src/main/resources/public/js/wallets.js @@ -139,7 +139,8 @@ function getProjectWallets() { * @param owner Owner of the repo/project. * @param name Name of the repo. * @param type Type of the wallet (fake or stripe). - * @todo #195#60min On frontend, enable wallet activation. Right now `activateWallet()` function is not used. + * @todo #253:30min On frontend, enable wallet activation. + * Right now `activateWallet()` function is not used ('activate' button doesn't work). */ function activateWallet(owner, name, type) { if(type == 'stripe') { diff --git a/src/main/resources/templates/contributor.html b/src/main/resources/templates/contributor.html index 914be60b..5acb3c40 100644 --- a/src/main/resources/templates/contributor.html +++ b/src/main/resources/templates/contributor.html @@ -384,7 +384,9 @@

Account ID:

data: form.serialize(), success: function (payoutMethod) { console.log("Opening SCA Dashboard page: " + payoutMethod.stripeLoginLink) - window.location.replace(payoutMethod.stripeLoginLink); + $("")[0].click(); + $("#stripeDashboardButton").removeClass("disabled"); + $("#loadingStripeDashboardForm").hide(); }, error: function(jqXHR, error, errorThrown) { $("#stripeDashboardButton").removeClass("disabled"); From bd9bdd44767433b08ba878b7dc5f24ebe73826cf Mon Sep 17 00:00:00 2001 From: cristianpela Date: Sun, 20 Dec 2020 11:40:12 +0200 Subject: [PATCH 2/2] #253 Contributor stripe dashboard opens in a new tab. - also added puzzle for contracts table optimization. --- src/main/resources/public/js/wallets.js | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/main/resources/public/js/wallets.js b/src/main/resources/public/js/wallets.js index e1536547..c584ddce 100644 --- a/src/main/resources/public/js/wallets.js +++ b/src/main/resources/public/js/wallets.js @@ -139,8 +139,6 @@ function getProjectWallets() { * @param owner Owner of the repo/project. * @param name Name of the repo. * @param type Type of the wallet (fake or stripe). - * @todo #253:30min On frontend, enable wallet activation. - * Right now `activateWallet()` function is not used ('activate' button doesn't work). */ function activateWallet(owner, name, type) { if(type == 'stripe') {