Skip to content

Commit

Permalink
satellite/console,web/satellite: remove browser card view config
Browse files Browse the repository at this point in the history
By default the table view is selected, and there is a disclaimer when
toggling the card view on. Removing this flag is fine.

Change-Id: I3496ec45d93b3957bf156ed93469340b15f8d0bc
  • Loading branch information
mobyvb committed Dec 13, 2023
1 parent 7f6bb99 commit 955c933
Show file tree
Hide file tree
Showing 6 changed files with 43 additions and 57 deletions.
4 changes: 2 additions & 2 deletions satellite/console/config.go
Expand Up @@ -38,8 +38,8 @@ type Config struct {

// CaptchaConfig contains configurations for login/registration captcha system.
type CaptchaConfig struct {
FlagBotsEnabled bool `help:"indicates if flagging bot accounts is enabled" default:"false"`
ScoreCutoffThreshold float64 `help:"bad captcha score threshold which is used to prevent bot user activity" default:"0.8"`
FlagBotsEnabled bool `help:"indicates if flagging bot accounts is enabled" default:"false" json:"-"`
ScoreCutoffThreshold float64 `help:"bad captcha score threshold which is used to prevent bot user activity" default:"0.8" json:"-"`
Login MultiCaptchaConfig `json:"login"`
Registration MultiCaptchaConfig `json:"registration"`
}
Expand Down
1 change: 0 additions & 1 deletion satellite/console/consoleweb/config.go
Expand Up @@ -48,7 +48,6 @@ type FrontendConfig struct {
GalleryViewEnabled bool `json:"galleryViewEnabled"`
NeededTransactionConfirmations int `json:"neededTransactionConfirmations"`
ObjectBrowserPaginationEnabled bool `json:"objectBrowserPaginationEnabled"`
ObjectBrowserCardViewEnabled bool `json:"objectBrowserCardViewEnabled"`
BillingFeaturesEnabled bool `json:"billingFeaturesEnabled"`
StripePaymentElementEnabled bool `json:"stripePaymentElementEnabled"`
UnregisteredInviteEmailsEnabled bool `json:"unregisteredInviteEmailsEnabled"`
Expand Down
2 changes: 0 additions & 2 deletions satellite/console/consoleweb/server.go
Expand Up @@ -107,7 +107,6 @@ type Config struct {
UseVuetifyProject bool `help:"whether to use vuetify POC project" default:"false"`
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"`
Expand Down Expand Up @@ -781,7 +780,6 @@ func (server *Server) frontendConfigHandler(w http.ResponseWriter, r *http.Reque
GalleryViewEnabled: server.config.GalleryViewEnabled,
NeededTransactionConfirmations: server.neededTokenPaymentConfirmations,
ObjectBrowserPaginationEnabled: server.config.ObjectBrowserPaginationEnabled,
ObjectBrowserCardViewEnabled: server.config.ObjectBrowserCardViewEnabled,
BillingFeaturesEnabled: server.config.BillingFeaturesEnabled,
StripePaymentElementEnabled: server.config.StripePaymentElementEnabled,
UnregisteredInviteEmailsEnabled: server.config.UnregisteredInviteEmailsEnabled,
Expand Down
3 changes: 0 additions & 3 deletions scripts/testdata/satellite-config.yaml.lock
Expand Up @@ -361,9 +361,6 @@ compensation.withheld-percents: 75,75,75,50,50,50,25,25,25,0,0,0,0,0,0
# how long oauth refresh tokens are issued for
# console.oauth-refresh-token-expiry: 720h0m0s

# whether to use object browser card view
# console.object-browser-card-view-enabled: false

# whether to use object browser pagination
# console.object-browser-pagination-enabled: false

Expand Down
1 change: 0 additions & 1 deletion web/satellite/src/types/config.gen.ts
Expand Up @@ -45,7 +45,6 @@ export class FrontendConfig {
galleryViewEnabled: boolean;
neededTransactionConfirmations: number;
objectBrowserPaginationEnabled: boolean;
objectBrowserCardViewEnabled: boolean;
billingFeaturesEnabled: boolean;
stripePaymentElementEnabled: boolean;
unregisteredInviteEmailsEnabled: boolean;
Expand Down
89 changes: 41 additions & 48 deletions web/satellite/vuetify-poc/src/views/Bucket.vue
Expand Up @@ -76,48 +76,46 @@
New Folder
</v-btn>

<template v-if="isCardViewEnabled">
<v-spacer v-if="smAndUp" />

<v-col class="pa-0" :class="{ 'pt-2': !smAndUp }" cols="auto">
<v-btn-toggle
mandatory
border
inset
density="comfortable"
class="pa-1"
<v-spacer v-if="smAndUp" />

<v-col class="pa-0" :class="{ 'pt-2': !smAndUp }" cols="auto">
<v-btn-toggle
mandatory
border
inset
density="comfortable"
class="pa-1"
>
<v-tooltip location="top">
<template #activator="{ props }">
<v-btn
size="small"
rounded="xl"
active-class="active"
:active="isCardView"
aria-label="Toggle Cards View"
v-bind="props"
@click="isCardView = true"
>
<icon-card-view />
Cards
</v-btn>
</template>
Card view shows image previews using download bandwidth.
</v-tooltip>
<v-btn
size="small"
rounded="xl"
active-class="active"
:active="!isCardView"
aria-label="Toggle Table View"
@click="isCardView = false"
>
<v-tooltip location="top">
<template #activator="{ props }">
<v-btn
size="small"
rounded="xl"
active-class="active"
:active="isCardView"
aria-label="Toggle Cards View"
v-bind="props"
@click="isCardView = true"
>
<icon-card-view />
Cards
</v-btn>
</template>
Card view shows image previews using download bandwidth.
</v-tooltip>
<v-btn
size="small"
rounded="xl"
active-class="active"
:active="!isCardView"
aria-label="Toggle Table View"
@click="isCardView = false"
>
<icon-table-view />
Table
</v-btn>
</v-btn-toggle>
</v-col>
</template>
<icon-table-view />
Table
</v-btn>
</v-btn-toggle>
</v-col>
</v-row>
</v-col>

Expand Down Expand Up @@ -213,16 +211,11 @@ const projectId = computed<string>(() => projectsStore.state.selectedProject.id)
*/
const isPromptForPassphrase = computed<boolean>(() => bucketsStore.state.promptForPassphrase);
/**
* Returns total object count from store.
*/
const isCardViewEnabled = computed<boolean>(() => config.state.config.objectBrowserCardViewEnabled);
/**
* Returns whether to use the card view.
*/
const isCardView = computed<boolean>({
get: () => isCardViewEnabled.value && appStore.state.isBrowserCardViewEnabled,
get: () => appStore.state.isBrowserCardViewEnabled,
set: value => appStore.toggleBrowserCardViewEnabled(value),
});
Expand Down Expand Up @@ -352,4 +345,4 @@ onMounted(async () => {
.bucket-view {
height: 100%;
}
</style>
</style>

0 comments on commit 955c933

Please sign in to comment.