Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add general not found page #11737

Merged
merged 4 commits into from
Oct 9, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions changelog/unreleased/enhancement-add-not-found-page
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
Enhancement: Add not found page

We've added a not found page to communicate to users when they've navigated to a page that doesn't exist.

https://github.com/owncloud/web/pull/11737
https://github.com/owncloud/web/issues/5804
14 changes: 14 additions & 0 deletions packages/web-runtime/src/pages/notFound.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<template>
<div class="oc-flex oc-flex-center oc-flex-middle oc-flex-column page-not-found">
<oc-icon name="emotion-normal" fill-type="line" size="xxlarge" />
<h1 class="oc-text-muted">404</h1>
<p
class="oc-text-xlarge oc-m-rm oc-text-muted"
v-text="$gettext('The requested page you are looking for does not exist.')"
AlexAndBear marked this conversation as resolved.
Show resolved Hide resolved
/>
</div>
</template>

<script setup lang="ts">
import { $gettext } from '@ownclouders/web-pkg/src/router/utils'
AlexAndBear marked this conversation as resolved.
Show resolved Hide resolved
</script>
7 changes: 7 additions & 0 deletions packages/web-runtime/src/router/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import AccessDeniedPage from '../pages/accessDenied.vue'
import Account from '../pages/account.vue'
import LoginPage from '../pages/login.vue'
import LogoutPage from '../pages/logout.vue'
import NotFoundPage from '../pages/notFound.vue'
import OidcCallbackPage from '../pages/oidcCallback.vue'
import ResolvePublicLinkPage from '../pages/resolvePublicLink.vue'
import ResolvePrivateLinkPage from '../pages/resolvePrivateLink.vue'
Expand Down Expand Up @@ -86,6 +87,12 @@ const routes = [
name: 'account',
component: Account,
meta: { title: $gettext('Account'), authContext: 'hybrid' }
},
{
path: '/:pathMatch(.*)*',
name: 'notFound',
component: NotFoundPage,
meta: { title: $gettext('Not found'), authContext: 'hybrid' }
}
]
export const router = patchRouter(
Expand Down