Every detail page read "West Jefferson ShopDB - Machine". Two tabs on two different machines were indistinguishable, a bookmark said nothing about what it pointed at, and a link shared into Teams previewed as the section rather than the thing. The router cannot fix this alone: afterEach runs before the view has fetched anything, so it only ever knows the KIND of page. So a detail view names its record once the record arrives, and both writers go through composables/pageTitle.js. THE ORDERING IS THE WHOLE PROBLEM. The router awaits the site settings to build the "<facility> ShopDB" prefix, so on a cold load it finishes AFTER a view that fetched quickly and would overwrite the good title with the generic one. The route's fullPath is claimed before that await, and the generic write stands down when a record title already belongs to the route being landed on. The reverse case is handled too: a view that names its record BEFORE the facility name arrives composed against the placeholder prefix, so the late resolve rewrites it rather than leaving "ShopDB - CSF16" on a site called West Jefferson. Both are pinned by tests, because both fail only under timing. Covers machines, PCs, printers, network devices, subnets, measuring tools, USB devices, printed parts, applications, employees, knowledge base articles and guides. Printers reuse the page's own displayTitle, which already discards the literal name "NONE" a discovered queue can carry, so the tab and the heading agree. A record with no usable name, or one that failed to load, keeps the section name: "Machine" beats "Machine 4192" for somebody scanning a row of tabs. Long names are cut at a word boundary - knowledge base articles are named with a whole sentence of description, which a browser otherwise truncates mid-word. Reports gained meta.title, which the router already supported and nothing used. That also fixes "Pc Relationships", which the name-derived spelling produced.
29 lines
827 B
JavaScript
29 lines
827 B
JavaScript
/**
|
|
* Warranty plugin routes
|
|
*/
|
|
export default [
|
|
{
|
|
path: 'settings/dellwarranty',
|
|
name: 'dell-warranty-settings',
|
|
component: () => import('./views/DellWarrantySettings.vue'),
|
|
meta: { requiresAuth: true, requiresAdmin: true, plugin: 'warranty' }
|
|
},
|
|
{
|
|
path: 'warranties',
|
|
name: 'warranties',
|
|
component: () => import('./views/WarrantiesList.vue'),
|
|
meta: { plugin: 'warranty' }
|
|
},
|
|
{
|
|
path: 'reports/warranty',
|
|
name: 'warranty-report',
|
|
component: () => import('./views/WarrantyReport.vue'),
|
|
meta: { plugin: 'warranty', title: 'Warranty Report' }
|
|
}
|
|
]
|
|
|
|
// 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 = []
|