API tokens: any user mints named, optionally-expiring tokens (shopdb_pat_..., sha256-stored, secret shown once) at Settings > API Tokens; a before-request shim swaps a valid PAT for a request-scoped JWT of its owner, so the entire existing auth/authz/import-mode stack works unchanged and revoked/expired tokens 401 cleanly. Built for long-running scripts - the legacy import no longer dies when a login JWT expires. Migration 7d21_apitokens; create/revoke audit-logged. Audited integration gaps fixed: Asset.to_dict serializes measuring tools (typedata + pluginid - relationship links to tools resolve); map subtype filter/colors and MapEditor include them; dashboard totals count them; warranty links use a new by-asset route; the measuringtools ADR-010 hooks are real (corrected presentation token, implemented map-overlay endpoint); the login avatar resolves through the employee-photo helper. 737 tests pass; naming green; frontend builds; both features verified live end-to-end. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
55 lines
1.9 KiB
JavaScript
55 lines
1.9 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/measuringtools/MeasuringToolsList.vue'),
|
|
meta: { plugin: 'measuringtools' }
|
|
},
|
|
{
|
|
path: 'measuringtools/new',
|
|
name: 'measuringtool-new',
|
|
component: () => import('../../views/measuringtools/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/measuringtools/MeasuringToolDetail.vue'),
|
|
meta: { plugin: 'measuringtools' }
|
|
},
|
|
{
|
|
path: 'measuringtools/:id',
|
|
name: 'measuringtool-detail',
|
|
component: () => import('../../views/measuringtools/MeasuringToolDetail.vue'),
|
|
meta: { plugin: 'measuringtools' }
|
|
},
|
|
{
|
|
path: 'measuringtools/:id/edit',
|
|
name: 'measuringtool-edit',
|
|
component: () => import('../../views/measuringtools/MeasuringToolForm.vue'),
|
|
meta: { requiresAuth: true, plugin: 'measuringtools' }
|
|
},
|
|
{
|
|
path: 'reports/calibration',
|
|
name: 'calibration-report',
|
|
component: () => import('../../views/reports/CalibrationReport.vue'),
|
|
meta: { plugin: 'measuringtools' }
|
|
},
|
|
{
|
|
path: 'settings/measuringtooltypes',
|
|
name: 'measuringtooltypes',
|
|
component: () => import('../../views/settings/MeasuringToolTypesList.vue'),
|
|
meta: { requiresAuth: true, requiresAdmin: true, plugin: 'measuringtools' }
|
|
}
|
|
]
|