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
This commit is contained in:
Moby von Briesen 2023-11-09 15:33:59 -05:00 committed by Storj Robot
parent 147076a696
commit cdcd3b2687
6 changed files with 32 additions and 1 deletions

View File

@ -54,6 +54,7 @@ type FrontendConfig struct {
UnregisteredInviteEmailsEnabled bool `json:"unregisteredInviteEmailsEnabled"` UnregisteredInviteEmailsEnabled bool `json:"unregisteredInviteEmailsEnabled"`
FreeTierInvitesEnabled bool `json:"freeTierInvitesEnabled"` FreeTierInvitesEnabled bool `json:"freeTierInvitesEnabled"`
UserBalanceForUpgrade int64 `json:"userBalanceForUpgrade"` UserBalanceForUpgrade int64 `json:"userBalanceForUpgrade"`
LimitIncreaseRequestEnabled bool `json:"limitIncreaseRequestEnabled"`
} }
// Satellites is a configuration value that contains a list of satellite names and addresses. // Satellites is a configuration value that contains a list of satellite names and addresses.

View File

@ -111,6 +111,7 @@ type Config struct {
VuetifyHost string `help:"the subdomain the vuetify POC project should be hosted on" default:""` 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"` ObjectBrowserPaginationEnabled bool `help:"whether to use object browser pagination" default:"false"`
ObjectBrowserCardViewEnabled bool `help:"whether to use object browser card view" 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"` 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"` 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, UnregisteredInviteEmailsEnabled: server.config.UnregisteredInviteEmailsEnabled,
FreeTierInvitesEnabled: server.config.FreeTierInvitesEnabled, FreeTierInvitesEnabled: server.config.FreeTierInvitesEnabled,
UserBalanceForUpgrade: server.config.UserBalanceForUpgrade, UserBalanceForUpgrade: server.config.UserBalanceForUpgrade,
LimitIncreaseRequestEnabled: server.config.LimitIncreaseRequestEnabled,
} }
err := json.NewEncoder(w).Encode(&cfg) err := json.NewEncoder(w).Encode(&cfg)

View File

@ -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 # url link to let us know page
# console.let-us-know-url: https://storjlabs.atlassian.net/servicedesk/customer/portals # 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 # indicates whether limit card section of the UI is enabled
# console.limits-area-enabled: true # console.limits-area-enabled: true

View File

@ -77,12 +77,22 @@
<p class="modal__info"> <p class="modal__info">
If you need more storage, If you need more storage,
<span <span
v-if="isLimitIncreaseRequestEnabled"
class="modal__info__link" class="modal__info__link"
rel="noopener noreferrer" rel="noopener noreferrer"
@click="openRequestLimitModal" @click="openRequestLimitModal"
> >
request limit increase. request limit increase.
</span> </span>
<a
v-else
class="modal__info__link"
href="https://supportdcs.storj.io/hc/en-us/requests/new?ticket_form_id=360000683212"
target="_blank"
rel="noopener noreferrer"
>
request limit increase.
</a>
</p> </p>
<div class="modal__buttons"> <div class="modal__buttons">
<VButton <VButton
@ -187,6 +197,11 @@ const isBandwidthUpdating = computed((): boolean => {
return activeLimit.value === LimitToChange.Bandwidth; return activeLimit.value === LimitToChange.Bandwidth;
}); });
/**
* Indicates if limit increase requests can be sent directly from the UI.
*/
const isLimitIncreaseRequestEnabled = computed<boolean>(() => configStore.state.config.limitIncreaseRequestEnabled);
function openRequestLimitModal(): void { function openRequestLimitModal(): void {
appStore.updateActiveModal(MODALS.requestProjectLimitIncrease); appStore.updateActiveModal(MODALS.requestProjectLimitIncrease);
} }

View File

@ -51,6 +51,7 @@ export class FrontendConfig {
unregisteredInviteEmailsEnabled: boolean; unregisteredInviteEmailsEnabled: boolean;
freeTierInvitesEnabled: boolean; freeTierInvitesEnabled: boolean;
userBalanceForUpgrade: number; userBalanceForUpgrade: number;
limitIncreaseRequestEnabled: boolean;
} }
export class MultiCaptchaConfig { export class MultiCaptchaConfig {

View File

@ -227,6 +227,11 @@ const descriptionRules: ValidationRule<string>[] = [
*/ */
const billingEnabled = computed<boolean>(() => configStore.state.config.billingFeaturesEnabled); const billingEnabled = computed<boolean>(() => configStore.state.config.billingFeaturesEnabled);
/**
* Indicates if limit increase requests can be sent directly from the UI.
*/
const isLimitIncreaseRequestEnabled = computed<boolean>(() => configStore.state.config.limitIncreaseRequestEnabled);
/** /**
* Handles primary button click. * Handles primary button click.
*/ */
@ -248,7 +253,11 @@ async function onPrimaryClick(): Promise<void> {
notify.success('Project created.'); notify.success('Project created.');
}); });
} else if (usersStore.state.user.paidTier) { } else if (usersStore.state.user.paidTier) {
if (showLimitIncreaseDialog.value) { if (!isLimitIncreaseRequestEnabled.value) {
model.value = false;
window.open('https://supportdcs.storj.io/hc/en-us/requests/new?ticket_form_id=360000683212', '_blank', 'noopener');
return;
} else if (showLimitIncreaseDialog.value) {
if (!formValid.value) return; if (!formValid.value) return;
await withLoading(async () => { await withLoading(async () => {
try { try {