satellite/{console, web}: show banner for bot accounts

Display a banner on the dashboard of all projects for bot accounts, with a prompt to submit a support ticket.

Issue:
https://github.com/storj/storj-private/issues/503

Change-Id: Id5f2aae0394b4fdca968a4de93bda19d6b0eb37a
This commit is contained in:
Vitalii 2023-11-30 13:51:25 +02:00 committed by Storj Robot
parent 591971b4dc
commit 0c913ab548
4 changed files with 30 additions and 0 deletions

View File

@ -625,6 +625,7 @@ func (a *Auth) GetAccount(w http.ResponseWriter, r *http.Request) {
MFAEnabled bool `json:"isMFAEnabled"`
MFARecoveryCodeCount int `json:"mfaRecoveryCodeCount"`
CreatedAt time.Time `json:"createdAt"`
PendingVerification bool `json:"pendingVerification"`
}
consoleUser, err := console.GetUser(ctx)
@ -653,6 +654,7 @@ func (a *Auth) GetAccount(w http.ResponseWriter, r *http.Request) {
user.MFAEnabled = consoleUser.MFAEnabled
user.MFARecoveryCodeCount = len(consoleUser.MFARecoveryCodes)
user.CreatedAt = consoleUser.CreatedAt
user.PendingVerification = consoleUser.Status == console.PendingBotVerification
w.Header().Set("Content-Type", "application/json")
err = json.NewEncoder(w).Encode(&user)

View File

@ -262,6 +262,7 @@ export class AuthHttpApi implements UsersApi {
userResponse.haveSalesContact,
userResponse.mfaRecoveryCodeCount,
userResponse.createdAt,
userResponse.pendingVerification,
);
}

View File

@ -108,6 +108,7 @@ export class User {
public haveSalesContact: boolean = false,
public mfaRecoveryCodeCount: number = 0,
public _createdAt: string | null = null,
public pendingVerification: boolean = false,
public signupPromoCode: string = '',
public freezeStatus: FreezeStatus = new FreezeStatus(),
) { }

View File

@ -3,6 +3,17 @@
<template>
<div class="all-dashboard-banners">
<v-banner
v-if="isPendingVerification && parentRef"
class="all-dashboard-banners__pending"
title="There was a problem setting up your account."
message="Please submit a support ticket."
severity="critical"
link-text="Submit"
:dashboard-ref="parentRef"
@link-click="submitSupportTicket"
/>
<UpgradeNotification
v-if="isPaidTierBannerShown"
class="all-dashboard-banners__upgrade"
@ -74,6 +85,13 @@ const props = defineProps<{
*/
const billingEnabled = computed<boolean>(() => configStore.state.config.billingFeaturesEnabled);
/**
* Indicates if account is in pending verification state.
*/
const isPendingVerification = computed((): boolean => {
return usersStore.state.user.pendingVerification;
});
/**
* Indicates if account was frozen due to billing issues.
*/
@ -111,6 +129,13 @@ function togglePMModal(): void {
appStore.updateActiveModal(MODALS.upgradeAccount);
}
/**
* Opens submit support ticket form.
*/
function submitSupportTicket(): void {
window.open(configStore.state.config.generalRequestURL, '_blank', 'noreferrer');
}
/**
* Redirects to Billing Page.
*/
@ -130,6 +155,7 @@ async function redirectToBillingOverview(): Promise<void> {
.all-dashboard-banners {
margin-bottom: 20px;
&__pending,
&__upgrade,
&__freeze,
&__warning,