satellite/{web,console}: remove upload modal flag

This change removes the config flag for the new upload modal.

Issue: #6515

Change-Id: I69612c6730f933d6320cb3c05995900eac98ac91
This commit is contained in:
Wilfred Asomani 2023-11-30 15:25:57 +00:00 committed by Storj Robot
parent e03091dd51
commit 8568e49578
7 changed files with 32 additions and 113 deletions

View File

@ -45,7 +45,6 @@ type FrontendConfig struct {
PasswordMaximumLength int `json:"passwordMaximumLength"`
ABTestingEnabled bool `json:"abTestingEnabled"`
PricingPackagesEnabled bool `json:"pricingPackagesEnabled"`
NewUploadModalEnabled bool `json:"newUploadModalEnabled"`
GalleryViewEnabled bool `json:"galleryViewEnabled"`
NeededTransactionConfirmations int `json:"neededTransactionConfirmations"`
ObjectBrowserPaginationEnabled bool `json:"objectBrowserPaginationEnabled"`

View File

@ -105,7 +105,6 @@ type Config struct {
HomepageURL string `help:"url link to storj.io homepage" default:"https://www.storj.io"`
NativeTokenPaymentsEnabled bool `help:"indicates if storj native token payments system is enabled" default:"false"`
PricingPackagesEnabled bool `help:"whether to allow purchasing pricing packages" default:"false" devDefault:"true"`
NewUploadModalEnabled bool `help:"whether to show new upload modal" default:"false"`
GalleryViewEnabled bool `help:"whether to show new gallery view" default:"true"`
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:""`
@ -749,7 +748,6 @@ func (server *Server) frontendConfigHandler(w http.ResponseWriter, r *http.Reque
PasswordMaximumLength: console.PasswordMaximumLength,
ABTestingEnabled: server.config.ABTesting.Enabled,
PricingPackagesEnabled: server.config.PricingPackagesEnabled,
NewUploadModalEnabled: server.config.NewUploadModalEnabled,
GalleryViewEnabled: server.config.GalleryViewEnabled,
NeededTransactionConfirmations: server.neededTokenPaymentConfirmations,
ObjectBrowserPaginationEnabled: server.config.ObjectBrowserPaginationEnabled,

View File

@ -334,9 +334,6 @@ compensation.withheld-percents: 75,75,75,50,50,50,25,25,25,0,0,0,0,0,0
# indicates if storj native token payments system is enabled
# console.native-token-payments-enabled: false
# whether to show new upload modal
# console.new-upload-modal-enabled: false
# how long oauth access tokens are issued for
# console.oauth-access-token-expiry: 24h0m0s

View File

@ -120,59 +120,6 @@
<file-browser-header />
</template>
<template #body>
<template v-if="!isNewUploadingModal">
<tr
v-for="(file, index) in formattedFilesUploading"
:key="index"
>
<!-- using <th> to comply with common Vtable.vue-->
<th class="hide-mobile icon" />
<th
class="align-left"
aria-roledescription="file-uploading"
>
<p class="file-name">
<file-icon />
<span>{{ filename(file) }}</span>
</p>
</th>
<th aria-roledescription="progress-bar">
<div class="progress">
<div
class="progress-bar"
role="progressbar"
:style="{
width: `${file.progress}%`
}"
>
{{ file.progress }}%
</div>
</div>
</th>
<th>
<v-button
width="60px"
font-size="14px"
label="Cancel"
is-deletion
:on-press="() => cancelUpload(file.Key)"
/>
</th>
<th class="hide-mobile" />
</tr>
<tr v-if="filesUploading.length" class="files-uploading-count">
<th class="hide-mobile files-uploading-count__content icon" />
<th class="align-left files-uploading-count__content" aria-roledescription="files-uploading-count">
{{ formattedFilesWaitingToBeUploaded }}
waiting to be uploaded...
</th>
<th class="hide-mobile files-uploading-count__content" />
<th class="hide-mobile files-uploading-count__content" />
<th class="files-uploading-count__content" />
</tr>
</template>
<up-entry v-if="path.length > 0" :on-back="onBack" />
<file-entry
@ -306,13 +253,6 @@ const isPaginationEnabled = computed((): boolean => {
return configStore.state.config.objectBrowserPaginationEnabled;
});
/**
* Indicates if new objects uploading flow should be working.
*/
const isNewUploadingModal = computed((): boolean => {
return configStore.state.config.newUploadModalEnabled;
});
/**
* Retrieve the current path from the store.
*/

View File

@ -179,11 +179,7 @@ export const useObjectBrowserStore = defineStore('objectBrowser', () => {
});
const uploadingLength = computed(() => {
if (config.state.config.newUploadModalEnabled) {
return state.uploading.filter(f => f.status === UploadingStatus.InProgress).length;
}
return state.uploading.length;
return state.uploading.filter(f => f.status === UploadingStatus.InProgress).length;
});
function setCursor(cursor: ObjectBrowserCursor): void {
@ -536,34 +532,32 @@ export const useObjectBrowserStore = defineStore('objectBrowser', () => {
Body: body,
};
if (config.state.config.newUploadModalEnabled) {
if (state.uploading.some(f => f.Key === key && f.status === UploadingStatus.InProgress)) {
notifyError(`${key} is already uploading`, AnalyticsErrorEventSource.OBJECT_UPLOAD_ERROR);
return;
}
if (state.uploading.some(f => f.Key === key && f.status === UploadingStatus.InProgress)) {
notifyError(`${key} is already uploading`, AnalyticsErrorEventSource.OBJECT_UPLOAD_ERROR);
return;
}
appStore.setUploadingModal(true);
appStore.setUploadingModal(true);
const index = state.uploading.findIndex(file => file.Key === key);
if (index !== -1) {
state.uploading.splice(index, 1);
}
const index = state.uploading.findIndex(file => file.Key === key);
if (index !== -1) {
state.uploading.splice(index, 1);
}
// If file size exceeds 30 GB, abort the upload attempt
if (body.size > (30 * 1024 * 1024 * 1024)) {
state.uploading.push({
...params,
progress: 0,
Size: 0,
LastModified: new Date(),
Body: body,
status: UploadingStatus.Failed,
failedMessage: FailedUploadMessage.TooBig,
type: 'file',
});
// If file size exceeds 30 GB, abort the upload attempt
if (body.size > (30 * 1024 * 1024 * 1024)) {
state.uploading.push({
...params,
progress: 0,
Size: 0,
LastModified: new Date(),
Body: body,
status: UploadingStatus.Failed,
failedMessage: FailedUploadMessage.TooBig,
type: 'file',
});
return;
}
return;
}
// If file size exceeds 5 GB, show warning notification
@ -642,25 +636,19 @@ export const useObjectBrowserStore = defineStore('objectBrowser', () => {
appStore.updateActiveModal(MODALS.objectDetails);
}
}
if (!config.state.config.newUploadModalEnabled) {
state.uploading = state.uploading.filter(file => file.Key !== key);
}
});
}
function handleUploadError(item: UploadingBrowserObject, error: Error): void {
if (error.name === 'AbortError' && item.status === UploadingStatus.Cancelled) return;
if (config.state.config.newUploadModalEnabled) {
item.status = UploadingStatus.Failed;
item.failedMessage = FailedUploadMessage.Failed;
item.status = UploadingStatus.Failed;
item.failedMessage = FailedUploadMessage.Failed;
// If file size exceeds 1 GB, show warning notification.
if (item.Size > (1024 * 1024 * 1024)) {
const appStore = useAppStore();
appStore.setLargeUploadWarningNotification(true);
}
// If file size exceeds 1 GB, show warning notification.
if (item.Size > (1024 * 1024 * 1024)) {
const appStore = useAppStore();
appStore.setLargeUploadWarningNotification(true);
}
const { notifyError } = useNotificationsStore();
@ -701,9 +689,7 @@ export const useObjectBrowserStore = defineStore('objectBrowser', () => {
Key: path + file.Key,
}));
if (config.state.config.newUploadModalEnabled) {
state.uploading = state.uploading.filter(f => f.Key !== file.Key);
}
state.uploading = state.uploading.filter(f => f.Key !== file.Key);
if (!isFolder) {
if (config.state.config.objectBrowserPaginationEnabled) {

View File

@ -13,7 +13,7 @@ export class FrontendConfig {
satelliteName: string;
satelliteNodeURL: string;
stripePublicKey: string;
partneredSatellites?: PartneredSatellite[];
partneredSatellites: PartneredSatellite[] | null;
defaultProjectLimit: number;
generalRequestURL: string;
projectLimitsIncreaseRequestURL: string;
@ -42,7 +42,6 @@ export class FrontendConfig {
passwordMaximumLength: number;
abTestingEnabled: boolean;
pricingPackagesEnabled: boolean;
newUploadModalEnabled: boolean;
galleryViewEnabled: boolean;
neededTransactionConfirmations: number;
objectBrowserPaginationEnabled: boolean;

View File

@ -152,7 +152,7 @@ const billingEnabled = computed<boolean>(() => configStore.state.config.billingF
* Indicates whether objects upload modal should be shown.
*/
const isObjectsUploadModal = computed((): boolean => {
return configStore.state.config.newUploadModalEnabled && appStore.state.isUploadingModal;
return appStore.state.isUploadingModal;
});
/**