stash
This commit is contained in:
parent
3299c97392
commit
de7d9426be
10 changed files with 259 additions and 99 deletions
|
|
@ -19,6 +19,13 @@
|
|||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card">
|
||||
<div class="card-header">Expanded</div>
|
||||
<div class="card-body">
|
||||
<router-link v-if="expandedRoute" :to="expandedRoute">{{ expandedRoute }}</router-link>
|
||||
<span v-else>No page exists for kind '{{ deserialized.kind }}'</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card">
|
||||
<div class="card-header">Examples</div>
|
||||
<table class="table table-striped mb-0">
|
||||
|
|
@ -56,14 +63,16 @@
|
|||
<script>
|
||||
import BaseLayout from '@/components/BaseLayout.vue';
|
||||
import {decodeShortId, deserializeShortId, encodeShortId, serializeShortId} from '@/short-id';
|
||||
import {expandedRoute as buildExpandedRoute} from '@/router';
|
||||
|
||||
const EXAMPLES = [
|
||||
{kind: 'item', owner_identity_id: 7, item_local_id: 42},
|
||||
{kind: 'group', group_id: 11},
|
||||
{kind: 'group_item', owner_group_id: 5, item_local_id: 42},
|
||||
{kind: 'file', file_id: 123},
|
||||
{kind: 'storage_location', owner_identity_id: 3, storage_location_id: 1000},
|
||||
{kind: 'category', category_id: 5},
|
||||
{kind: 'workflow', owner_identity_id: 2, workflow_id: 9},
|
||||
{kind: 'group', group_id: 11},
|
||||
{kind: 'file', file_id: 123},
|
||||
];
|
||||
|
||||
// Debug-only display helper, kept out of short-id.js's production library: mirrors its bit-packing
|
||||
|
|
@ -130,6 +139,9 @@ export default {
|
|||
const {kind, ...fields} = this.deserialized;
|
||||
return fields;
|
||||
},
|
||||
expandedRoute() {
|
||||
return buildExpandedRoute(this.deserialized);
|
||||
},
|
||||
examples() {
|
||||
return EXAMPLES.map(named => {
|
||||
const {kind, ...fields} = named;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue