From 40e43826a98805972dadeaf72e80b183195b441e Mon Sep 17 00:00:00 2001 From: Vitalii Date: Fri, 20 Oct 2023 15:00:06 +0300 Subject: [PATCH] web/satellite: extend low token balance banner use-case Updated condition on when this banner should be shown. Also, added this banner to project dashboard and billing pages. Issue: https://github.com/storj/storj/issues/6356 https://github.com/storj/storj/issues/6368 Change-Id: I2f8f587a3c75508df0a9a6e84e1684b3c3904aa7 --- satellite/console/consoleweb/config.go | 1 + satellite/console/consoleweb/server.go | 1 + .../account/billing/BillingArea.vue | 276 ++++++------------ .../upgradeAccountFlow/AddTokensStep.vue | 13 +- .../upgradeAccountFlow/PricingPlanStep.vue | 2 - .../upgradeAccountFlow/UpgradeOptionsStep.vue | 14 +- .../project/dashboard/ProjectDashboard.vue | 39 ++- .../src/composables/useLowTokenBalance.ts | 26 ++ web/satellite/src/types/config.gen.ts | 1 + web/satellite/src/utils/strings.ts | 8 + .../AllProjectsDashboardBanners.vue | 14 +- .../all-dashboard/components/MyProjects.vue | 1 - 12 files changed, 186 insertions(+), 210 deletions(-) create mode 100644 web/satellite/src/composables/useLowTokenBalance.ts diff --git a/satellite/console/consoleweb/config.go b/satellite/console/consoleweb/config.go index 6a75ccf17..686885c20 100644 --- a/satellite/console/consoleweb/config.go +++ b/satellite/console/consoleweb/config.go @@ -53,6 +53,7 @@ type FrontendConfig struct { BillingFeaturesEnabled bool `json:"billingFeaturesEnabled"` UnregisteredInviteEmailsEnabled bool `json:"unregisteredInviteEmailsEnabled"` FreeTierInvitesEnabled bool `json:"freeTierInvitesEnabled"` + UserBalanceForUpgrade int64 `json:"userBalanceForUpgrade"` } // Satellites is a configuration value that contains a list of satellite names and addresses. diff --git a/satellite/console/consoleweb/server.go b/satellite/console/consoleweb/server.go index d37218d71..5fcb84c4d 100644 --- a/satellite/console/consoleweb/server.go +++ b/satellite/console/consoleweb/server.go @@ -753,6 +753,7 @@ func (server *Server) frontendConfigHandler(w http.ResponseWriter, r *http.Reque BillingFeaturesEnabled: server.config.BillingFeaturesEnabled, UnregisteredInviteEmailsEnabled: server.config.UnregisteredInviteEmailsEnabled, FreeTierInvitesEnabled: server.config.FreeTierInvitesEnabled, + UserBalanceForUpgrade: server.config.UserBalanceForUpgrade, } err := json.NewEncoder(w).Encode(&cfg) diff --git a/web/satellite/src/components/account/billing/BillingArea.vue b/web/satellite/src/components/account/billing/BillingArea.vue index 51d5477a3..6f6258aeb 100644 --- a/web/satellite/src/components/account/billing/BillingArea.vue +++ b/web/satellite/src/components/account/billing/BillingArea.vue @@ -2,60 +2,80 @@ // See LICENSE for copying information. diff --git a/web/satellite/src/components/modals/upgradeAccountFlow/AddTokensStep.vue b/web/satellite/src/components/modals/upgradeAccountFlow/AddTokensStep.vue index 39e5caa9b..484a9ab4b 100644 --- a/web/satellite/src/components/modals/upgradeAccountFlow/AddTokensStep.vue +++ b/web/satellite/src/components/modals/upgradeAccountFlow/AddTokensStep.vue @@ -6,9 +6,9 @@