fix: remove redirect from /admin to /admin/general as some users may not have permission to the general settings

This commit is contained in:
Abhinav Raut
2025-03-22 00:30:04 +05:30
parent eaa2b1ddcf
commit 860b216e2b
3 changed files with 12 additions and 4 deletions
+4 -2
View File
@@ -16,7 +16,9 @@
</SidebarMenuItem>
<SidebarMenuItem v-if="userStore.hasAdminTabPermissions">
<SidebarMenuButton asChild :isActive="route.path.startsWith('/admin')">
<router-link :to="{ name: 'admin' }">
<router-link
:to="{ name: userStore.can('general_settings:manage') ? 'general' : 'admin' }"
>
<Shield />
</router-link>
</SidebarMenuButton>
@@ -46,7 +48,7 @@
@create-view="openCreateViewForm = true"
@edit-view="editView"
@delete-view="deleteView"
@create-conversation="() => openCreateConversationDialog = true"
@create-conversation="() => (openCreateConversationDialog = true)"
>
<div class="flex flex-col h-screen">
<!-- Show app update only in admin routes -->
+7 -1
View File
@@ -1,7 +1,13 @@
<template>
<div class="overflow-y-auto h-screen">
<div class="p-6 sm:p-8 min-h-full flex flex-col">
<div
class="flex flex-col items-center justify-center flex-grow"
v-if="$route.path === '/admin'"
>
<div>Select a section from the sidebar</div>
</div>
<router-view class="flex-grow" />
</div>
</div>
</template>
</template>
+1 -1
View File
@@ -155,12 +155,12 @@ const routes = [
{
path: '/admin',
name: 'admin',
redirect: '/admin/general',
component: AdminLayout,
meta: { title: 'Admin' },
children: [
{
path: 'general',
name: 'general',
component: () => import('@/views/admin/general/General.vue'),
meta: { title: 'General' }
},