Skip to content

Commit 08ea8e3

Browse files
authored
Merge pull request #505 from devforth/feature/AdminForth/1323/show-beautiful-404-error-when-
fix: update error for wrong resource id
2 parents b9b7ce3 + fe1bd3d commit 08ea8e3

File tree

2 files changed

+9
-6
lines changed

2 files changed

+9
-6
lines changed

adminforth/spa/src/components/BreadcrumbsWithButtons.vue

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,17 +6,16 @@
66
<slot></slot>
77
</div>
88
</div>
9-
<div class="flex items-center justify-between mb-3 flex-wrap gap-y-2 gap-2" v-if="coreStore.resourceColumnsError">
10-
<div class="p-4 mb-4 text-sm text-red-800 rounded-lg bg-red-50 dark:bg-gray-800 dark:text-red-400" role="alert">
11-
<span class="font-medium">{{ $t('Error!')}}</span> {{ coreStore.resourceColumnsError }}
12-
</div>
9+
<div v-if="coreStore.resourceColumnsError" >
10+
<PageNotFound :errorMessage="coreStore.resourceColumnsError" />
1311
</div>
1412
</div>
1513

1614
</template>
1715

1816
<script setup>
19-
import Breadcrumbs from '@/components/Breadcrumbs.vue';
17+
import Breadcrumbs from '@/components/Breadcrumbs.vue';
18+
import PageNotFound from '@/views/PageNotFound.vue';
2019
2120
import { useCoreStore } from '@/stores/core';
2221

adminforth/spa/src/views/PageNotFound.vue

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<div class="mx-auto max-w-screen-sm text-center">
55
<h1 class="mb-4 text-7xl tracking-tight font-extrabold lg:text-9xl text-lightPrimary dark:text-darkPrimary">404</h1>
66
<p class="mb-4 text-3xl tracking-tight font-bold text-gray-900 md:text-4xl dark:text-white">{{ $t("Something's missing.") }}</p>
7-
<p class="mb-4 text-lg font-light text-gray-500 dark:text-gray-400">{{ $t("Sorry, we can't find that page. You'll find lots to explore on the home page.") }} </p>
7+
<p class="mb-4 text-lg font-light text-gray-500 dark:text-gray-400">{{ props.errorMessage ? $t(props.errorMessage) : $t("Sorry, we can't find that page. You'll find lots to explore on the home page.") }} </p>
88
<div class="flex justify-center">
99
<LinkButton to="/">{{ $t('Go back home') }}</LinkButton>
1010
</div>
@@ -17,4 +17,8 @@
1717
1818
import { LinkButton } from '@/afcl';
1919
20+
const props = defineProps<{
21+
errorMessage?: string
22+
}>();
23+
2024
</script>

0 commit comments

Comments
 (0)