diff --git a/frontend/src/components/SkeletonBlock.vue b/frontend/src/components/SkeletonBlock.vue deleted file mode 100644 index 89ab8d7c04..0000000000 --- a/frontend/src/components/SkeletonBlock.vue +++ /dev/null @@ -1,29 +0,0 @@ - - - - - diff --git a/frontend/src/composables/useActiveApplication.ts b/frontend/src/composables/useActiveApplication.ts new file mode 100644 index 0000000000..1f7cad7209 --- /dev/null +++ b/frontend/src/composables/useActiveApplication.ts @@ -0,0 +1,27 @@ +import { useRouter } from 'vue-router' + +import { useDataFarmApplicationsStore } from '@/stores/data-farm-applications' +import type { ApplicationSummary } from '@/types' + +export function useActiveApplication () { + const router = useRouter() + const applicationsStore = useDataFarmApplicationsStore() + + async function loadActiveApplication (id: string): Promise { + if (!id) return null + try { + return await applicationsStore.loadActiveApplication(id) + } catch { + const current = router.currentRoute.value + router.push({ + name: 'page-not-found', + params: { pathMatch: current.path.substring(1).split('/') }, + query: current.query, + hash: current.hash + }) + return null + } + } + + return { loadActiveApplication } +} diff --git a/frontend/src/layouts/Page.vue b/frontend/src/layouts/Page.vue index 6c9b758218..4baa4c85f0 100644 --- a/frontend/src/layouts/Page.vue +++ b/frontend/src/layouts/Page.vue @@ -1,11 +1,18 @@ - - diff --git a/frontend/src/pages/team/Applications/index.vue b/frontend/src/pages/team/Applications/index.vue index 12e0cdcc09..e7c758b19a 100644 --- a/frontend/src/pages/team/Applications/index.vue +++ b/frontend/src/pages/team/Applications/index.vue @@ -33,9 +33,7 @@
- - -