Skip to content

Commit

Permalink
web/satellite: Disable limits area of dashboard
Browse files Browse the repository at this point in the history
Add a config flag (default false) to hide the new limit cards (e.g.
segment, storage, bandwidth limits) from the UI. We need to investigate
some queries the egress card is using before enabling these everywhere.

Change-Id: I762e7d9e6a0a4315f1520e688b2bad32b100e5a0
  • Loading branch information
mobyvb authored and andriikotko committed May 31, 2023
1 parent 3cd5e13 commit 966c35d
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 2 deletions.
1 change: 1 addition & 0 deletions satellite/console/consoleweb/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ type FrontendConfig struct {
PathwayOverviewEnabled bool `json:"pathwayOverviewEnabled"`
Captcha console.CaptchaConfig `json:"captcha"`
AllProjectsDashboard bool `json:"allProjectsDashboard"`
LimitsAreaEnabled bool `json:"limitsAreaEnabled"`
DefaultPaidStorageLimit memory.Size `json:"defaultPaidStorageLimit"`
DefaultPaidBandwidthLimit memory.Size `json:"defaultPaidBandwidthLimit"`
InactivityTimerEnabled bool `json:"inactivityTimerEnabled"`
Expand Down
4 changes: 3 additions & 1 deletion satellite/console/consoleweb/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,8 @@ type Config struct {
LinksharingURL string `help:"url link for linksharing requests within the application" default:"https://link.storjsatelliteshare.io" devDefault:"http://localhost:8001"`
PublicLinksharingURL string `help:"url link for linksharing requests for external sharing" default:"https://link.storjshare.io" devDefault:"http://localhost:8001"`
PathwayOverviewEnabled bool `help:"indicates if the overview onboarding step should render with pathways" default:"true"`
AllProjectsDashboard bool `help:"indicates if all projects dashboard should be used" default:"true"`
AllProjectsDashboard bool `help:"indicates if all projects dashboard should be used" default:"false"`
LimitsAreaEnabled bool `help:"indicates whether limit card section of the UI is enabled" default:"false"`
GeneratedAPIEnabled bool `help:"indicates if generated console api should be used" default:"false"`
OptionalSignupSuccessURL string `help:"optional url to external registration success page" default:""`
HomepageURL string `help:"url link to storj.io homepage" default:"https://www.storj.io"`
Expand Down Expand Up @@ -531,6 +532,7 @@ func (server *Server) frontendConfigHandler(w http.ResponseWriter, r *http.Reque
DefaultPaidBandwidthLimit: server.config.UsageLimits.Bandwidth.Paid,
Captcha: server.config.Captcha,
AllProjectsDashboard: server.config.AllProjectsDashboard,
LimitsAreaEnabled: server.config.LimitsAreaEnabled,
InactivityTimerEnabled: server.config.Session.InactivityTimerEnabled,
InactivityTimerDuration: server.config.Session.InactivityTimerDuration,
InactivityTimerViewerEnabled: server.config.Session.InactivityTimerViewerEnabled,
Expand Down
3 changes: 3 additions & 0 deletions scripts/testdata/satellite-config.yaml.lock
Original file line number Diff line number Diff line change
Expand Up @@ -274,6 +274,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

# indicates whether limit card section of the UI is enabled
# console.limits-area-enabled: false

# url link for linksharing requests within the application
# console.linksharing-url: https://link.storjsatelliteshare.io

Expand Down
1 change: 1 addition & 0 deletions web/satellite/src/api/v0.gen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import { MemorySize, Time, UUID } from '@/types/common';
export class APIKeyInfo {
id: UUID;
projectId: UUID;
projectPublicId: UUID;
userAgent: string;
name: string;
createdAt: Time;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@
</template>
</div>
</div>
<LimitsArea :is-loading="isDataFetching" />
<LimitsArea v-if="limitsAreaEnabled" :is-loading="isDataFetching" />
<div class="project-dashboard__info">
<InfoContainer
:icon="BucketsIcon"
Expand Down Expand Up @@ -247,6 +247,13 @@ const limits = computed((): ProjectLimits => {
return projectsStore.state.currentLimits;
});
/**
* Returns the whether the limits area is enabled.
*/
const limitsAreaEnabled = computed((): boolean => {
return configStore.state.config.limitsAreaEnabled;
});
/**
* Returns status string based on account status.
*/
Expand Down
2 changes: 2 additions & 0 deletions web/satellite/src/types/config.gen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,11 @@ export class FrontendConfig {
couponCodeSignupUIEnabled: boolean;
fileBrowserFlowDisabled: boolean;
linksharingURL: string;
publicLinksharingURL: string;
pathwayOverviewEnabled: boolean;
captcha: CaptchaConfig;
allProjectsDashboard: boolean;
limitsAreaEnabled: boolean;
defaultPaidStorageLimit: MemorySize;
defaultPaidBandwidthLimit: MemorySize;
inactivityTimerEnabled: boolean;
Expand Down

0 comments on commit 966c35d

Please sign in to comment.