From 149b59069f6df3a322d346f99aa45f6917065e0f Mon Sep 17 00:00:00 2001 From: Vitalii Date: Thu, 20 Oct 2022 16:26:28 +0300 Subject: [PATCH] satellite/{web, console}: removed old object flow Removed old flow along with a feature flag Issue: https://github.com/storj/storj/issues/5166 Change-Id: I85cfabbf94e910c9d5efb01ef850f6b888a13f71 --- satellite/console/consoleweb/server.go | 3 - scripts/testdata/satellite-config.yaml.lock | 3 - testsuite/ui/uitest/run.go | 1 - web/satellite/index.html | 1 - web/satellite/src/App.vue | 5 - .../src/components/browser/FileBrowser.vue | 10 +- .../components/common/GeneratePassphrase.vue | 408 ------------------ .../navigation/MobileNavigation.vue | 2 +- .../navigation/ProjectSelection.vue | 2 +- .../src/components/objects/BucketDetails.vue | 11 +- .../src/components/objects/BucketsView.vue | 93 +--- .../src/components/objects/EncryptData.vue | 317 -------------- web/satellite/src/router/index.ts | 7 - web/satellite/src/store/modules/appState.ts | 7 - web/satellite/src/store/mutationConstants.ts | 1 - .../src/utils/constants/actionNames.ts | 1 - .../unit/common/GeneratePassphrase.spec.ts | 30 -- .../GeneratePassphrase.spec.ts.snap | 41 -- 18 files changed, 8 insertions(+), 935 deletions(-) delete mode 100644 web/satellite/src/components/common/GeneratePassphrase.vue delete mode 100644 web/satellite/src/components/objects/EncryptData.vue delete mode 100644 web/satellite/tests/unit/common/GeneratePassphrase.spec.ts delete mode 100644 web/satellite/tests/unit/common/__snapshots__/GeneratePassphrase.spec.ts.snap diff --git a/satellite/console/consoleweb/server.go b/satellite/console/consoleweb/server.go index 60f5c0a8a..563301b42 100644 --- a/satellite/console/consoleweb/server.go +++ b/satellite/console/consoleweb/server.go @@ -92,7 +92,6 @@ type Config struct { LinksharingURL string `help:"url link for linksharing requests" default:"https://link.storjshare.io" devDefault:"http://localhost:8001"` PathwayOverviewEnabled bool `help:"indicates if the overview onboarding step should render with pathways" default:"true"` NewProjectDashboard bool `help:"indicates if new project dashboard should be used" default:"true"` - NewObjectsFlow bool `help:"indicates if new objects flow should be used" default:"true"` NewAccessGrantFlow bool `help:"indicates if new access grant flow should be used" default:"true"` NewBillingScreen bool `help:"indicates if new billing screens should be used" default:"false"` GeneratedAPIEnabled bool `help:"indicates if generated console api should be used" default:"false"` @@ -454,7 +453,6 @@ func (server *Server) appHandler(w http.ResponseWriter, r *http.Request) { NewProjectDashboard bool DefaultPaidStorageLimit memory.Size DefaultPaidBandwidthLimit memory.Size - NewObjectsFlow bool NewAccessGrantFlow bool NewBillingScreen bool InactivityTimerEnabled bool @@ -499,7 +497,6 @@ func (server *Server) appHandler(w http.ResponseWriter, r *http.Request) { data.LoginHcaptchaEnabled = server.config.Captcha.Login.Hcaptcha.Enabled data.LoginHcaptchaSiteKey = server.config.Captcha.Login.Hcaptcha.SiteKey data.NewProjectDashboard = server.config.NewProjectDashboard - data.NewObjectsFlow = server.config.NewObjectsFlow data.NewAccessGrantFlow = server.config.NewAccessGrantFlow data.NewBillingScreen = server.config.NewBillingScreen data.InactivityTimerEnabled = server.config.Session.InactivityTimerEnabled diff --git a/scripts/testdata/satellite-config.yaml.lock b/scripts/testdata/satellite-config.yaml.lock index b7298775e..3694e9a1a 100755 --- a/scripts/testdata/satellite-config.yaml.lock +++ b/scripts/testdata/satellite-config.yaml.lock @@ -208,9 +208,6 @@ compensation.withheld-percents: 75,75,75,50,50,50,25,25,25,0,0,0,0,0,0 # indicates if new billing screens should be used # console.new-billing-screen: false -# indicates if new objects flow should be used -# console.new-objects-flow: true - # indicates if new project dashboard should be used # console.new-project-dashboard: true diff --git a/testsuite/ui/uitest/run.go b/testsuite/ui/uitest/run.go index 8366bea12..cc0ef28cd 100644 --- a/testsuite/ui/uitest/run.go +++ b/testsuite/ui/uitest/run.go @@ -34,7 +34,6 @@ func configureSatellite(log *zap.Logger, index int, config *satellite.Config) { if dir := os.Getenv("STORJ_TEST_SATELLITE_WEB"); dir != "" { config.Console.StaticDir = dir } - config.Console.NewObjectsFlow = true config.Console.NewAccessGrantFlow = true config.Console.NewProjectDashboard = true config.Console.CouponCodeBillingUIEnabled = true diff --git a/web/satellite/index.html b/web/satellite/index.html index 0ab9af1e3..4d731c723 100644 --- a/web/satellite/index.html +++ b/web/satellite/index.html @@ -34,7 +34,6 @@ - diff --git a/web/satellite/src/App.vue b/web/satellite/src/App.vue index 692be1a94..c9ee4b726 100644 --- a/web/satellite/src/App.vue +++ b/web/satellite/src/App.vue @@ -40,7 +40,6 @@ export default class App extends Vue { const couponCodeBillingUIEnabled = MetaUtils.getMetaContent('coupon-code-billing-ui-enabled'); const couponCodeSignupUIEnabled = MetaUtils.getMetaContent('coupon-code-signup-ui-enabled'); const isNewProjectDashboard = MetaUtils.getMetaContent('new-project-dashboard'); - const isNewObjectsFlow = MetaUtils.getMetaContent('new-objects-flow'); if (satelliteName) { this.$store.dispatch(APP_STATE_ACTIONS.SET_SATELLITE_NAME, satelliteName); @@ -72,10 +71,6 @@ export default class App extends Vue { if (isNewProjectDashboard) { this.$store.dispatch(APP_STATE_ACTIONS.SET_PROJECT_DASHBOARD_STATUS, isNewProjectDashboard === 'true'); } - - if (isNewObjectsFlow) { - this.$store.dispatch(APP_STATE_ACTIONS.SET_OBJECTS_FLOW_STATUS, isNewObjectsFlow === 'true'); - } } } diff --git a/web/satellite/src/components/browser/FileBrowser.vue b/web/satellite/src/components/browser/FileBrowser.vue index 93d77f08b..8d44c541d 100644 --- a/web/satellite/src/components/browser/FileBrowser.vue +++ b/web/satellite/src/components/browser/FileBrowser.vue @@ -357,13 +357,6 @@ export default class FileBrowser extends Vue { return this.$store.state.objectsModule.fileComponentBucketName; } - /** - * Returns objects flow status from store. - */ - private get isNewObjectsFlow(): string { - return this.$store.state.appStateModule.isNewObjectsFlow; - } - /** * Return a boolean signifying whether the upload display is allowed to be shown. */ @@ -391,8 +384,7 @@ export default class FileBrowser extends Vue { */ public async created(): Promise { if (!this.bucket) { - const path = this.isNewObjectsFlow ? RouteConfig.Buckets.with(RouteConfig.BucketsManagement).path : - RouteConfig.Buckets.with(RouteConfig.EncryptData).path; + const path = RouteConfig.Buckets.with(RouteConfig.BucketsManagement).path; this.analytics.pageVisit(path); await this.$router.push(path); diff --git a/web/satellite/src/components/common/GeneratePassphrase.vue b/web/satellite/src/components/common/GeneratePassphrase.vue deleted file mode 100644 index a0708606e..000000000 --- a/web/satellite/src/components/common/GeneratePassphrase.vue +++ /dev/null @@ -1,408 +0,0 @@ -// Copyright (C) 2021 Storj Labs, Inc. -// See LICENSE for copying information. - - - - - - diff --git a/web/satellite/src/components/navigation/MobileNavigation.vue b/web/satellite/src/components/navigation/MobileNavigation.vue index 14e63e996..22d1cbe8e 100644 --- a/web/satellite/src/components/navigation/MobileNavigation.vue +++ b/web/satellite/src/components/navigation/MobileNavigation.vue @@ -348,7 +348,7 @@ export default class MobileNavigation extends Vue { private get isBucketsView(): boolean { const currentRoute = this.$route.path; - return currentRoute.includes(RouteConfig.BucketsManagement.path) || currentRoute.includes(RouteConfig.EncryptData.path); + return currentRoute.includes(RouteConfig.BucketsManagement.path); } /** diff --git a/web/satellite/src/components/navigation/ProjectSelection.vue b/web/satellite/src/components/navigation/ProjectSelection.vue index b2fd8dd2e..508f4e213 100644 --- a/web/satellite/src/components/navigation/ProjectSelection.vue +++ b/web/satellite/src/components/navigation/ProjectSelection.vue @@ -285,7 +285,7 @@ export default class ProjectSelection extends Vue { private get isBucketsView(): boolean { const currentRoute = this.$route.path; - return currentRoute.includes(RouteConfig.BucketsManagement.path) || currentRoute.includes(RouteConfig.EncryptData.path); + return currentRoute.includes(RouteConfig.BucketsManagement.path); } } diff --git a/web/satellite/src/components/objects/BucketDetails.vue b/web/satellite/src/components/objects/BucketDetails.vue index 465449cf7..576a817d3 100644 --- a/web/satellite/src/components/objects/BucketDetails.vue +++ b/web/satellite/src/components/objects/BucketDetails.vue @@ -87,9 +87,7 @@ export default class BucketDetails extends Vue { this.$store.dispatch(OBJECTS_ACTIONS.SET_FILE_COMPONENT_BUCKET_NAME, this.bucket?.name); if (this.$route.params.backRoute === RouteConfig.BucketsManagement.name) { - this.isNewObjectsFlow - ? this.$store.commit(APP_STATE_MUTATIONS.TOGGLE_OPEN_BUCKET_MODAL_SHOWN) - : this.$router.push(RouteConfig.Buckets.with(RouteConfig.EncryptData).path); + this.$store.commit(APP_STATE_MUTATIONS.TOGGLE_OPEN_BUCKET_MODAL_SHOWN); return; } @@ -97,13 +95,6 @@ export default class BucketDetails extends Vue { this.analytics.pageVisit(RouteConfig.Buckets.with(RouteConfig.UploadFile).path); this.$router.push(RouteConfig.Buckets.with(RouteConfig.UploadFile).path); } - - /** - * Returns objects flow status from store. - */ - private get isNewObjectsFlow(): string { - return this.$store.state.appStateModule.isNewObjectsFlow; - } } diff --git a/web/satellite/src/components/objects/BucketsView.vue b/web/satellite/src/components/objects/BucketsView.vue index 3cd8edfd8..6725c74ee 100644 --- a/web/satellite/src/components/objects/BucketsView.vue +++ b/web/satellite/src/components/objects/BucketsView.vue @@ -60,17 +60,6 @@ - { - if (this.isRequestProcessing) return; - - if (!this.isBucketNameValid(this.createBucketName)) return; - - this.isRequestProcessing = true; - - try { - if (!this.edgeCredentials.accessKeyId) { - await this.setAccess(); - } - await this.$store.dispatch(OBJECTS_ACTIONS.CREATE_BUCKET, this.createBucketName); - await this.fetchBuckets(); - this.createBucketName = ''; - this.hideCreateBucketPopup(); - } catch (error) { - const BUCKET_ALREADY_EXISTS_ERROR = 'BucketAlreadyExists'; - - if (error.name === BUCKET_ALREADY_EXISTS_ERROR) { - await this.$notify.error('Bucket with provided name already exists.'); - } else { - await this.$notify.error(error.message); - } - } finally { - this.isRequestProcessing = false; - } + this.$router.push(RouteConfig.Buckets.with(RouteConfig.BucketCreation).path); } /** @@ -404,30 +353,6 @@ export default class BucketsView extends Vue { this.deleteBucketName = name; } - /** - * Makes create bucket popup visible. - */ - public showCreateBucketPopup(): void { - this.createBucketName = ''; - this.isCreatePopupVisible = true; - } - - /** - * Hides create bucket popup. - */ - public hideCreateBucketPopup(): void { - this.errorMessage = ''; - this.isCreatePopupVisible = false; - } - - /** - * Set create bucket name form input. - */ - public setCreateBucketName(name: string): void { - this.errorMessage = ''; - this.createBucketName = name; - } - /** * Hides server-side encryption banner. */ @@ -441,10 +366,7 @@ export default class BucketsView extends Vue { */ public openBucket(bucketName: string): void { this.$store.dispatch(OBJECTS_ACTIONS.SET_FILE_COMPONENT_BUCKET_NAME, bucketName); - this.analytics.pageVisit(RouteConfig.Buckets.with(RouteConfig.EncryptData).path); - this.isNewObjectsFlow - ? this.$store.commit(APP_STATE_MUTATIONS.TOGGLE_OPEN_BUCKET_MODAL_SHOWN) - : this.$router.push(RouteConfig.Buckets.with(RouteConfig.EncryptData).path); + this.$store.commit(APP_STATE_MUTATIONS.TOGGLE_OPEN_BUCKET_MODAL_SHOWN); } /** @@ -454,13 +376,6 @@ export default class BucketsView extends Vue { return this.$store.state.bucketUsageModule.page; } - /** - * Returns objects flow status from store. - */ - private get isNewObjectsFlow(): string { - return this.$store.state.appStateModule.isNewObjectsFlow; - } - /** * Returns selected project id from store. */ diff --git a/web/satellite/src/components/objects/EncryptData.vue b/web/satellite/src/components/objects/EncryptData.vue deleted file mode 100644 index 55a997bb3..000000000 --- a/web/satellite/src/components/objects/EncryptData.vue +++ /dev/null @@ -1,317 +0,0 @@ -// Copyright (C) 2021 Storj Labs, Inc. -// See LICENSE for copying information. - - - - - - diff --git a/web/satellite/src/router/index.ts b/web/satellite/src/router/index.ts index 29cc3c0de..0443fece2 100644 --- a/web/satellite/src/router/index.ts +++ b/web/satellite/src/router/index.ts @@ -29,7 +29,6 @@ import CreditsHistory from '@/components/account/billing/coupons/CouponArea.vue' import SettingsArea from '@/components/account/SettingsArea.vue'; import Page404 from '@/components/errors/Page404.vue'; import BucketsView from '@/components/objects/BucketsView.vue'; -import EncryptData from '@/components/objects/EncryptData.vue'; import ObjectsArea from '@/components/objects/ObjectsArea.vue'; import UploadFile from '@/components/objects/UploadFile.vue'; import OnboardingTourArea from '@/components/onboardingTour/OnboardingTourArea.vue'; @@ -129,7 +128,6 @@ export abstract class RouteConfig { public static SuccessScreen = new NavigationLink('success', 'Onboarding Success Screen'); // objects child paths. - public static EncryptData = new NavigationLink('encrypt-data', 'Objects Encrypt Data'); public static BucketsManagement = new NavigationLink('management', 'Buckets Management'); public static BucketsDetails = new NavigationLink('details', 'Bucket Details'); public static UploadFile = new NavigationLink('upload/', 'Objects Upload'); @@ -439,11 +437,6 @@ export const router = new Router({ name: RouteConfig.Buckets.name, component: ObjectsArea, children: [ - { - path: RouteConfig.EncryptData.path, - name: RouteConfig.EncryptData.name, - component: EncryptData, - }, { path: RouteConfig.BucketsManagement.path, name: RouteConfig.BucketsManagement.name, diff --git a/web/satellite/src/store/modules/appState.ts b/web/satellite/src/store/modules/appState.ts index ad029b507..8979e5722 100644 --- a/web/satellite/src/store/modules/appState.ts +++ b/web/satellite/src/store/modules/appState.ts @@ -61,7 +61,6 @@ class State { public couponCodeBillingUIEnabled = false, public couponCodeSignupUIEnabled = false, public isNewProjectDashboard = false, - public isNewObjectsFlow = false, ){} } @@ -215,9 +214,6 @@ export const appStateModule = { [APP_STATE_MUTATIONS.SET_ONB_CLEAN_API_KEY](state: State, apiKey: string): void { state.appState.onbCleanApiKey = apiKey; }, - [APP_STATE_MUTATIONS.SET_OBJECTS_FLOW_STATUS](state: State, isNewObjectsFlow: boolean): void { - state.isNewObjectsFlow = isNewObjectsFlow; - }, [APP_STATE_MUTATIONS.SET_COUPON_CODE_BILLING_UI_STATUS](state: State, couponCodeBillingUIEnabled: boolean): void { state.couponCodeBillingUIEnabled = couponCodeBillingUIEnabled; }, @@ -369,9 +365,6 @@ export const appStateModule = { [APP_STATE_ACTIONS.SET_PROJECT_DASHBOARD_STATUS]: function ({ commit }: AppContext, isNewProjectDashboard: boolean): void { commit(APP_STATE_MUTATIONS.SET_PROJECT_DASHBOARD_STATUS, isNewProjectDashboard); }, - [APP_STATE_ACTIONS.SET_OBJECTS_FLOW_STATUS]: function ({ commit }: AppContext, isNewObjectsFlow: boolean): void { - commit(APP_STATE_MUTATIONS.SET_OBJECTS_FLOW_STATUS, isNewObjectsFlow); - }, [APP_STATE_ACTIONS.SET_COUPON_CODE_BILLING_UI_STATUS]: function ({ commit }: AppContext, couponCodeBillingUIEnabled: boolean): void { commit(APP_STATE_MUTATIONS.SET_COUPON_CODE_BILLING_UI_STATUS, couponCodeBillingUIEnabled); }, diff --git a/web/satellite/src/store/mutationConstants.ts b/web/satellite/src/store/mutationConstants.ts index 21572c224..5ecb1a3cf 100644 --- a/web/satellite/src/store/mutationConstants.ts +++ b/web/satellite/src/store/mutationConstants.ts @@ -56,6 +56,5 @@ export const APP_STATE_MUTATIONS = { SET_ONB_API_KEY_STEP_BACK_ROUTE: 'SET_ONB_API_KEY_STEP_BACK_ROUTE', SET_ONB_API_KEY: 'SET_ONB_API_KEY', SET_ONB_CLEAN_API_KEY: 'SET_ONB_CLEAN_API_KEY', - SET_OBJECTS_FLOW_STATUS: 'SET_OBJECTS_FLOW_STATUS', SET_ONB_OS: 'SET_ONB_OS', }; diff --git a/web/satellite/src/utils/constants/actionNames.ts b/web/satellite/src/utils/constants/actionNames.ts index b295ae8cb..8a19ddca5 100644 --- a/web/satellite/src/utils/constants/actionNames.ts +++ b/web/satellite/src/utils/constants/actionNames.ts @@ -31,7 +31,6 @@ export const APP_STATE_ACTIONS = { SET_COUPON_CODE_BILLING_UI_STATUS: 'SET_COUPON_CODE_BILLING_UI_STATUS', SET_COUPON_CODE_SIGNUP_UI_STATUS: 'SET_COUPON_CODE_SIGNUP_UI_STATUS', SET_PROJECT_DASHBOARD_STATUS: 'SET_PROJECT_DASHBOARD_STATUS', - SET_OBJECTS_FLOW_STATUS: 'SET_OBJECTS_FLOW_STATUS', }; export const NOTIFICATION_ACTIONS = { diff --git a/web/satellite/tests/unit/common/GeneratePassphrase.spec.ts b/web/satellite/tests/unit/common/GeneratePassphrase.spec.ts deleted file mode 100644 index 8403b8305..000000000 --- a/web/satellite/tests/unit/common/GeneratePassphrase.spec.ts +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright (C) 2019 Storj Labs, Inc. -// See LICENSE for copying information. - -import { createLocalVue, shallowMount } from '@vue/test-utils'; -import Vuex from 'vuex'; - -import { router } from '@/router'; -import { appStateModule } from '@/store/modules/appState'; - -import GeneratePassphrase from '@/components/common/GeneratePassphrase.vue'; - -const localVue = createLocalVue(); -localVue.use(Vuex); - -const store = new Vuex.Store({ modules: { - appStateModule, -} }); - -describe('GeneratePassphrase.vue', () => { - it('renders correctly with default props', () => { - const wrapper = shallowMount(GeneratePassphrase, { - localVue, - router, - store, - }); - - expect(wrapper.vm.passphrase).toBeTruthy(); - expect(wrapper).toMatchSnapshot(); - }); -}); diff --git a/web/satellite/tests/unit/common/__snapshots__/GeneratePassphrase.spec.ts.snap b/web/satellite/tests/unit/common/__snapshots__/GeneratePassphrase.spec.ts.snap deleted file mode 100644 index 91b51c024..000000000 --- a/web/satellite/tests/unit/common/__snapshots__/GeneratePassphrase.spec.ts.snap +++ /dev/null @@ -1,41 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`GeneratePassphrase.vue renders correctly with default props 1`] = ` -
- -

Encryption passphrase

-

- The encryption passphrase is used to encrypt and access the data that you upload to Storj. -

-
-
-

- Generate a new passphrase -

-
-

- Enter your own passphrase -

- -
-
-
-

- -
-

- Save your encryption passphrase -

-

- Please note that Storj does not know or store your encryption passphrase. If you lose it, you will not - be able to recover your files. -

-

Download as a text file

- -
-
- - -
-
-`;