From eb4fd2180be69bc8d2c4979ceb55f2aa0c394f2d Mon Sep 17 00:00:00 2001 From: Wilfred Asomani Date: Thu, 1 Jun 2023 10:53:10 +0000 Subject: [PATCH] satellite/{console,web}: prevent unneeded redirect to all projects dashboard This change prevents the redirect to all projects dashboard when no project is selected (if all projects dash is enabled). Since a previously selected project id is saved in local storage, it is used to store it's associated project in memory. This change also makes a small change to a test that ignores potential failures. Issue: https://github.com/storj/storj/issues/5920 Change-Id: Ie758893dfb655893520c642fb47b934cd59f177e --- satellite/console/service_test.go | 5 ++-- .../components/accessGrants/AccessGrants.vue | 7 ------ .../components/account/NewSettingsArea.vue | 18 -------------- .../account/billing/BillingArea.vue | 9 ------- .../src/components/objects/BucketsView.vue | 10 -------- .../onboardingTour/OnboardingTourArea.vue | 24 +------------------ .../project/dashboard/ProjectDashboard.vue | 4 ---- .../components/team/ProjectMembersArea.vue | 10 -------- web/satellite/src/views/DashboardArea.vue | 6 +++-- 9 files changed, 7 insertions(+), 86 deletions(-) diff --git a/satellite/console/service_test.go b/satellite/console/service_test.go index 37a750075..0d87cceb4 100644 --- a/satellite/console/service_test.go +++ b/satellite/console/service_test.go @@ -1599,9 +1599,8 @@ func TestPaymentsWalletPayments(t *testing.T) { LogIndex int } err = json.NewDecoder(bytes.NewReader(txn.Metadata)).Decode(&meta) - if err != nil { - continue - } + require.NoError(t, err) + expected = append(expected, console.PaymentInfo{ ID: fmt.Sprintf("%s#%d", meta.ReferenceID, meta.LogIndex), Type: txn.Source, diff --git a/web/satellite/src/components/accessGrants/AccessGrants.vue b/web/satellite/src/components/accessGrants/AccessGrants.vue index d07302618..804a4a09e 100644 --- a/web/satellite/src/components/accessGrants/AccessGrants.vue +++ b/web/satellite/src/components/accessGrants/AccessGrants.vue @@ -171,7 +171,6 @@ import { useAccessGrantsStore } from '@/store/modules/accessGrantsStore'; import { useProjectsStore } from '@/store/modules/projectsStore'; import { useAppStore } from '@/store/modules/appStore'; import { MODALS } from '@/utils/constants/appStatePopUps'; -import { useConfigStore } from '@/store/modules/configStore'; import AccessGrantsItem from '@/components/accessGrants/AccessGrantsItem.vue'; import VButton from '@/components/common/VButton.vue'; @@ -190,7 +189,6 @@ const analytics: AnalyticsHttpApi = new AnalyticsHttpApi(); const appStore = useAppStore(); const agStore = useAccessGrantsStore(); const projectsStore = useProjectsStore(); -const configStore = useConfigStore(); const notify = useNotify(); const router = useRouter(); @@ -335,11 +333,6 @@ function trackPageVisit(link: string): void { } onMounted(async () => { - if (configStore.state.config.allProjectsDashboard && !projectsStore.state.selectedProject.id) { - await router.push(RouteConfig.AllProjectsDashboard.path); - return; - } - try { await agStore.getAccessGrants(FIRST_PAGE, projectsStore.state.selectedProject.id); areGrantsFetching.value = false; diff --git a/web/satellite/src/components/account/NewSettingsArea.vue b/web/satellite/src/components/account/NewSettingsArea.vue index 17c100957..d11560a45 100644 --- a/web/satellite/src/components/account/NewSettingsArea.vue +++ b/web/satellite/src/components/account/NewSettingsArea.vue @@ -100,7 +100,6 @@ diff --git a/web/satellite/src/components/account/billing/BillingArea.vue b/web/satellite/src/components/account/billing/BillingArea.vue index fa99aca0f..517f3672d 100644 --- a/web/satellite/src/components/account/billing/BillingArea.vue +++ b/web/satellite/src/components/account/billing/BillingArea.vue @@ -51,13 +51,9 @@ import { NavigationLink } from '@/types/navigation'; import { useNotify } from '@/utils/hooks'; import { useBillingStore } from '@/store/modules/billingStore'; import { useAppStore } from '@/store/modules/appStore'; -import { useConfigStore } from '@/store/modules/configStore'; -import { useProjectsStore } from '@/store/modules/projectsStore'; const appStore = useAppStore(); const billingStore = useBillingStore(); -const configStore = useConfigStore(); -const projectsStore = useProjectsStore(); const notify = useNotify(); const router = useRouter(); const route = useRoute(); @@ -152,11 +148,6 @@ function routeToCoupons(): void { * Fetches account balance. */ onMounted(async (): Promise => { - if (!isOnAllDashboardSettings.value && !projectsStore.state.selectedProject.id) { - await router.push(RouteConfig.AllProjectsDashboard.path); - return; - } - try { await billingStore.getBalance(); } catch (error) { diff --git a/web/satellite/src/components/objects/BucketsView.vue b/web/satellite/src/components/objects/BucketsView.vue index e2561dd6c..a231c650d 100644 --- a/web/satellite/src/components/objects/BucketsView.vue +++ b/web/satellite/src/components/objects/BucketsView.vue @@ -20,7 +20,6 @@ +