stash
This commit is contained in:
parent
2bb6624d50
commit
7276750c66
15 changed files with 552 additions and 169 deletions
|
|
@ -49,8 +49,13 @@ export function decodeHandleFromUrl(segment) {
|
|||
return segment.replace(/\+/g, "#");
|
||||
}
|
||||
|
||||
// See docs/implementation.md#owner-filtered-overview-routes-use-path-segments-not-query-strings.
|
||||
export function ownerOverviewRoute(item) {
|
||||
return item.owner_group ? `/groups/${encodeHandleForUrl(item.owner_group)}` : '/inventory';
|
||||
return item.owner_group ? `/inventory/${encodeHandleForUrl(item.owner_group)}` : '/inventory';
|
||||
}
|
||||
|
||||
export function ownerLocationOverviewRoute(location) {
|
||||
return location.owner_group ? `/storage-location/${encodeHandleForUrl(location.owner_group)}` : '/storage-location';
|
||||
}
|
||||
|
||||
const EXPANDED_ROUTE_BUILDERS = {
|
||||
|
|
@ -121,9 +126,11 @@ export async function domainQualifiedRoute(domain, ints) {
|
|||
}
|
||||
|
||||
const routes = [{path: '/', component: Dashboard, meta: {requiresAuth: true}}, {
|
||||
path: '/inventory',
|
||||
// See docs/implementation.md#owner-filtered-overview-routes-use-path-segments-not-query-strings.
|
||||
path: '/inventory/:owner?',
|
||||
component: Inventory,
|
||||
meta: {requiresAuth: true}
|
||||
meta: {requiresAuth: true},
|
||||
props: true
|
||||
}, {
|
||||
path: '/inventory/:handle/:id',
|
||||
component: InventoryDetail,
|
||||
|
|
@ -150,7 +157,13 @@ const routes = [{path: '/', component: Dashboard, meta: {requiresAuth: true}}, {
|
|||
}
|
||||
return expandedRoute(deserializeShortId(decodeShortId(to.params.short_id)));
|
||||
}
|
||||
}, {path: '/inventory/new', component: InventoryNew, meta: {requiresAuth: true}}, {
|
||||
}, {
|
||||
// See docs/implementation.md#owner-filtered-overview-routes-use-path-segments-not-query-strings.
|
||||
path: '/inventory/new/:group?',
|
||||
component: InventoryNew,
|
||||
meta: {requiresAuth: true},
|
||||
props: true
|
||||
}, {
|
||||
path: '/friends',
|
||||
component: Friends,
|
||||
meta: {requiresAuth: true}
|
||||
|
|
@ -223,9 +236,11 @@ const routes = [{path: '/', component: Dashboard, meta: {requiresAuth: true}}, {
|
|||
path: 'preferences/', name: 'preferences', component: Preferences, meta: {requiresAuth: true}
|
||||
}]
|
||||
}, {
|
||||
path: '/storage-location',
|
||||
// See docs/implementation.md#owner-filtered-overview-routes-use-path-segments-not-query-strings.
|
||||
path: '/storage-location/:owner?',
|
||||
component: StorageLocation,
|
||||
meta: {requiresAuth: true}
|
||||
meta: {requiresAuth: true},
|
||||
props: true
|
||||
}, {
|
||||
path: '/storage-locations/:handle/:id',
|
||||
component: StorageLocationDetail,
|
||||
|
|
@ -237,9 +252,11 @@ const routes = [{path: '/', component: Dashboard, meta: {requiresAuth: true}}, {
|
|||
meta: {requiresAuth: true},
|
||||
props: true
|
||||
}, {
|
||||
path: '/storage-locations/new',
|
||||
// See docs/implementation.md#owner-filtered-overview-routes-use-path-segments-not-query-strings.
|
||||
path: '/storage-locations/new/:group?',
|
||||
component: StorageLocationNew,
|
||||
meta: {requiresAuth: true}
|
||||
meta: {requiresAuth: true},
|
||||
props: true
|
||||
}, {path: '/:pathMatch(.*)*', redirect: '/'}]
|
||||
|
||||
const router = createRouter({
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue