From 5fede0ce95f5e4d75c31b76bcde8d4d5b5e04bcb Mon Sep 17 00:00:00 2001 From: Wilfred Asomani Date: Fri, 12 May 2023 15:17:09 +0000 Subject: [PATCH] web/satellite: fix no project id provided error This change fixes an error when all projects dashboard is enabled where there will be no project selected and an error "projectid not provided" will be thrown. It navigates back to the all projects dashoard so the user can select a project. Issue: https://github.com/storj/storj/issues/5875 Change-Id: I144c4bbd3782dcdf40b2ed2be445c7f100c36b32 --- .../components/accessGrants/AccessGrants.vue | 7 ++++++ .../components/account/NewSettingsArea.vue | 22 +++++++++++++++++-- .../account/billing/BillingArea.vue | 9 ++++++++ .../src/components/objects/BucketsView.vue | 11 +++++++++- .../onboardingTour/OnboardingTourArea.vue | 21 +++++++++++++++++- .../components/team/ProjectMembersArea.vue | 11 +++++++++- 6 files changed, 76 insertions(+), 5 deletions(-) diff --git a/web/satellite/src/components/accessGrants/AccessGrants.vue b/web/satellite/src/components/accessGrants/AccessGrants.vue index 503475a14..560bd4df1 100644 --- a/web/satellite/src/components/accessGrants/AccessGrants.vue +++ b/web/satellite/src/components/accessGrants/AccessGrants.vue @@ -170,6 +170,7 @@ 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'; @@ -188,6 +189,7 @@ const analytics: AnalyticsHttpApi = new AnalyticsHttpApi(); const appStore = useAppStore(); const agStore = useAccessGrantsStore(); const projectsStore = useProjectsStore(); +const configStore = useConfigStore(); const notify = useNotify(); const router = useRouter(); @@ -332,6 +334,11 @@ 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 34b863e0a..6e05bb058 100644 --- a/web/satellite/src/components/account/NewSettingsArea.vue +++ b/web/satellite/src/components/account/NewSettingsArea.vue @@ -1,4 +1,4 @@ -// Copyright (C) 2019 Storj Labs, Inc. +// Copyright (C) 2023 Storj Labs, Inc. // See LICENSE for copying information. - +