From cdcd3b26871899f21caa30cce5411275ec2996d8 Mon Sep 17 00:00:00 2001 From: Moby von Briesen Date: Thu, 9 Nov 2023 15:33:59 -0500 Subject: [PATCH] satellite/console,web/satellite: add feature flag for limit increase req This change adds a feature flag (default disabled) to enable the ability to submit a project limit increase request directly from the UI. When this feature is disabled, the user will be directed to a page to file a support ticket. Resolves https://github.com/storj/storj/issues/6480 Change-Id: I5f355dcb1a40e5b694f9623f05fe706ed4d6a528 --- satellite/console/consoleweb/config.go | 1 + satellite/console/consoleweb/server.go | 2 ++ scripts/testdata/satellite-config.yaml.lock | 3 +++ .../components/modals/ChangeProjectLimitModal.vue | 15 +++++++++++++++ web/satellite/src/types/config.gen.ts | 1 + .../components/dialogs/CreateProjectDialog.vue | 11 ++++++++++- 6 files changed, 32 insertions(+), 1 deletion(-) diff --git a/satellite/console/consoleweb/config.go b/satellite/console/consoleweb/config.go index 7038d8949..d274b4873 100644 --- a/satellite/console/consoleweb/config.go +++ b/satellite/console/consoleweb/config.go @@ -54,6 +54,7 @@ type FrontendConfig struct { UnregisteredInviteEmailsEnabled bool `json:"unregisteredInviteEmailsEnabled"` FreeTierInvitesEnabled bool `json:"freeTierInvitesEnabled"` UserBalanceForUpgrade int64 `json:"userBalanceForUpgrade"` + LimitIncreaseRequestEnabled bool `json:"limitIncreaseRequestEnabled"` } // 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 d6564e2fd..a1e8106ed 100644 --- a/satellite/console/consoleweb/server.go +++ b/satellite/console/consoleweb/server.go @@ -111,6 +111,7 @@ type Config struct { VuetifyHost string `help:"the subdomain the vuetify POC project should be hosted on" default:""` ObjectBrowserPaginationEnabled bool `help:"whether to use object browser pagination" default:"false"` ObjectBrowserCardViewEnabled bool `help:"whether to use object browser card view" default:"false"` + LimitIncreaseRequestEnabled bool `help:"whether to allow request limit increases directly from the UI" default:"false"` OauthCodeExpiry time.Duration `help:"how long oauth authorization codes are issued for" default:"10m"` OauthAccessTokenExpiry time.Duration `help:"how long oauth access tokens are issued for" default:"24h"` @@ -755,6 +756,7 @@ func (server *Server) frontendConfigHandler(w http.ResponseWriter, r *http.Reque UnregisteredInviteEmailsEnabled: server.config.UnregisteredInviteEmailsEnabled, FreeTierInvitesEnabled: server.config.FreeTierInvitesEnabled, UserBalanceForUpgrade: server.config.UserBalanceForUpgrade, + LimitIncreaseRequestEnabled: server.config.LimitIncreaseRequestEnabled, } err := json.NewEncoder(w).Encode(&cfg) diff --git a/scripts/testdata/satellite-config.yaml.lock b/scripts/testdata/satellite-config.yaml.lock index 9db5f50a2..7041da96f 100755 --- a/scripts/testdata/satellite-config.yaml.lock +++ b/scripts/testdata/satellite-config.yaml.lock @@ -307,6 +307,9 @@ compensation.withheld-percents: 75,75,75,50,50,50,25,25,25,0,0,0,0,0,0 # url link to let us know page # console.let-us-know-url: https://storjlabs.atlassian.net/servicedesk/customer/portals +# whether to allow request limit increases directly from the UI +# console.limit-increase-request-enabled: false + # indicates whether limit card section of the UI is enabled # console.limits-area-enabled: true diff --git a/web/satellite/src/components/modals/ChangeProjectLimitModal.vue b/web/satellite/src/components/modals/ChangeProjectLimitModal.vue index 700d2fefe..3a04babff 100644 --- a/web/satellite/src/components/modals/ChangeProjectLimitModal.vue +++ b/web/satellite/src/components/modals/ChangeProjectLimitModal.vue @@ -77,12 +77,22 @@