Files
cproudlock 27f76ee964 frontend: declare the empty toplevel export the codegen reads
routes.gen.js spreads `.toplevel` for every plugin uniformly, but only a
few own full-screen routes, so Rollup warned on eleven of them every
build. The `|| []` guard was always doing its job - the warning was noise,
and noise in a build log is where a real warning goes to hide.
2026-08-12 11:43:57 -04:00

60 lines
2.0 KiB
JavaScript

/**
* Measuring-tools plugin routes.
*
* Every route carries meta.plugin = 'measuringtools' so the ADR-009 router
* guard redirects to the dashboard when the backend plugin is disabled. List
* and detail are public (no requiresAuth, matching the other asset types); the
* form requires auth; the settings subtype page requires admin.
*/
export default [
{
path: 'measuringtools',
name: 'measuringtools',
component: () => import('./views/MeasuringToolsList.vue'),
meta: { plugin: 'measuringtools' }
},
{
path: 'measuringtools/new',
name: 'measuringtool-new',
component: () => import('./views/MeasuringToolForm.vue'),
meta: { requiresAuth: true, plugin: 'measuringtools' }
},
{
// Resolve a tool from its core asset id (search rows / cross-links carry
// assetid, not the extension id). Shares the detail component.
path: 'measuringtools/by-asset/:assetid',
name: 'measuringtool-by-asset',
component: () => import('./views/MeasuringToolDetail.vue'),
meta: { plugin: 'measuringtools' }
},
{
path: 'measuringtools/:id',
name: 'measuringtool-detail',
component: () => import('./views/MeasuringToolDetail.vue'),
meta: { plugin: 'measuringtools' }
},
{
path: 'measuringtools/:id/edit',
name: 'measuringtool-edit',
component: () => import('./views/MeasuringToolForm.vue'),
meta: { requiresAuth: true, plugin: 'measuringtools' }
},
{
path: 'reports/calibration',
name: 'calibration-report',
component: () => import('./views/CalibrationReport.vue'),
meta: { plugin: 'measuringtools' }
},
{
path: 'settings/measuringtooltypes',
name: 'measuringtooltypes',
component: () => import('./views/MeasuringToolTypesList.vue'),
meta: { requiresAuth: true, requiresAdmin: true, plugin: 'measuringtools' }
}
]
// No full-screen routes: every view in this plugin renders inside
// AppLayout. Declared so routes.gen.js can read `.toplevel` off the module
// without Rollup warning about a missing export.
export const toplevel = []