diff --git a/components/analysis/AnalysesTable.vue b/components/analysis/AnalysesTable.vue index 2da6b48..15945fb 100644 --- a/components/analysis/AnalysesTable.vue +++ b/components/analysis/AnalysesTable.vue @@ -3,6 +3,7 @@ import { getAnalyses } from "~/composables/useAPIFetch"; import { formatDataRow } from "~/utils/format-data-row"; import TableRowMetadata from "~/components/TableRowMetadata.vue"; import ExpandRowButtons from "~/components/table/ExpandRowButtons.vue"; +import { showConnectionErrorToast } from "~/composables/connectionErrorToast"; const analyses = ref(); const expandedRows = ref(); @@ -19,12 +20,19 @@ const expandRowEntries = [ onMounted(() => { nextTick(async () => { - const { data: response } = await getAnalyses(); - analyses.value = formatDataRow( - response.value!.data as unknown as Map[], - ["created_at", "updated_at"], - expandRowEntries, - ); + const { data: response, status, error } = await getAnalyses(); + if (status.value === "success") { + analyses.value = formatDataRow( + response.value!.data as unknown as Map< + string, + string | number | null + >[], + ["created_at", "updated_at"], + expandRowEntries, + ); + } else if (error.value?.statusCode === 500) { + showConnectionErrorToast(); + } loading.value = false; }); }); diff --git a/components/data-stores/DataStoreListLayout.vue b/components/data-stores/DataStoreListTabs.vue similarity index 75% rename from components/data-stores/DataStoreListLayout.vue rename to components/data-stores/DataStoreListTabs.vue index c193d19..18bf784 100644 --- a/components/data-stores/DataStoreListLayout.vue +++ b/components/data-stores/DataStoreListTabs.vue @@ -14,6 +14,7 @@ import type { } from "~/services/Api"; import DetailedDataStoreTable from "~/components/data-stores/tables/DetailedDataStoreTable.vue"; import DetailedAnalysisTable from "~/components/data-stores/tables/DetailedAnalysisTable.vue"; +import { showConnectionErrorToast } from "~/composables/connectionErrorToast"; const dataStores = ref(); const consumers = ref(); @@ -38,27 +39,31 @@ onBeforeMount(() => { }); async function loadDetailedDataStoreTable() { - const { data: response } = await getDataStores(true); + const { data: response, status, error } = await getDataStores(true); - let formattedDataStores = formatDataRow( - response.value!.data, - dataRowUnixCols, - expandRowEntries, - ) as DetailedService[]; + if (status.value === "success") { + let formattedDataStores = formatDataRow( + response.value!.data, + dataRowUnixCols, + expandRowEntries, + ) as DetailedService[]; - formattedDataStores.forEach((store: DetailedService) => { - if (store.routes!.length) { - store.routes = formatDataRow( - store.routes, - dataRowUnixCols, - expandRowEntries, - ); - store.routes?.forEach((proj: Route) => { - proj["projectId"] = extractProjectIdFromPath(proj.paths! as string[]); - }); - } - }); - dataStores.value = formattedDataStores; + formattedDataStores.forEach((store: DetailedService) => { + if (store.routes!.length) { + store.routes = formatDataRow( + store.routes, + dataRowUnixCols, + expandRowEntries, + ); + store.routes?.forEach((proj: Route) => { + proj["projectId"] = extractProjectIdFromPath(proj.paths! as string[]); + }); + } + }); + dataStores.value = formattedDataStores; + } else if (error.value?.statusCode === 500) { + showConnectionErrorToast(); + } } async function fetchDataFromHub(route: string) { diff --git a/components/data-stores/ResourceManagerLayout.vue b/components/data-stores/ResourceManagerTabs.vue similarity index 100% rename from components/data-stores/ResourceManagerLayout.vue rename to components/data-stores/ResourceManagerTabs.vue diff --git a/components/projects/ApproveRejectButtons.vue b/components/projects/ApproveRejectButtons.vue index 5d3b0a0..990de02 100644 --- a/components/projects/ApproveRejectButtons.vue +++ b/components/projects/ApproveRejectButtons.vue @@ -1,11 +1,12 @@