mirror of
https://github.com/InvoiceShelf/InvoiceShelf.git
synced 2026-04-15 09:14:08 +00:00
The module marketplace browser UI (ModuleIndexView, ModuleDetailView,
ModuleCard, the four-step installer store) was filed under
features/company/modules/ only by historical accident — it's authorized via
the manage modules ability (super-admin-only) and conceptually belongs in the
admin context, not the company context.
- Move features/company/modules/{store.ts, views/ModuleIndexView.vue,
views/ModuleDetailView.vue, components/ModuleCard.vue} to
features/admin/modules/.
- Update hardcoded /admin/modules/... paths in the moved files to
/admin/administration/modules/... so the breadcrumbs and ModuleCard
navigation target the new admin-context routes.
- Tighten the four-step installer's silent catch {} blocks in the moved
store.ts: errors were being swallowed, now they dispatch through the
global notification store instead.
- New features/admin/modules/routes.ts declares admin.modules.index +
admin.modules.view as children of /admin/administration with
meta.isSuperAdmin: true.
- features/admin/{index,routes}.ts re-export and mount the relocated routes.
- config/invoiceshelf.php gains a new AdminModules entry in admin_menu
pointing at /admin/administration/modules with super_admin_only: true.
- The dev-gated navigation.modules entry in main_menu is replaced (not
deleted) with a non-gated entry pointing at the new company-context
Active Modules index page that lands in the next commit. The
ability is set to manage modules so non-owners can't see it.
The new company-context Active Modules index, schema-driven settings page,
and dynamic sidebar group are introduced in subsequent commits.
35 lines
965 B
TypeScript
35 lines
965 B
TypeScript
import type { RouteRecordRaw } from 'vue-router'
|
|
|
|
const ModuleIndexView = () => import('./views/ModuleIndexView.vue')
|
|
const ModuleDetailView = () => import('./views/ModuleDetailView.vue')
|
|
|
|
/**
|
|
* Super-admin marketplace browser routes.
|
|
*
|
|
* These are mounted as children of `/admin/administration` in features/admin/routes.ts,
|
|
* meaning they require `meta.isSuperAdmin` and the admin-mode bootstrap.
|
|
*
|
|
* Company-context module routes (the read-only Active Modules index and the
|
|
* schema-rendered settings page) live in features/company/modules/routes.ts.
|
|
*/
|
|
export const adminModuleRoutes: RouteRecordRaw[] = [
|
|
{
|
|
path: 'modules',
|
|
name: 'admin.modules.index',
|
|
component: ModuleIndexView,
|
|
meta: {
|
|
isSuperAdmin: true,
|
|
title: 'modules.title',
|
|
},
|
|
},
|
|
{
|
|
path: 'modules/:slug',
|
|
name: 'admin.modules.view',
|
|
component: ModuleDetailView,
|
|
meta: {
|
|
isSuperAdmin: true,
|
|
title: 'modules.title',
|
|
},
|
|
},
|
|
]
|