stash
This commit is contained in:
parent
395a9b156a
commit
7d9f67a77a
1 changed files with 15 additions and 1 deletions
|
|
@ -40,6 +40,9 @@
|
||||||
<a :href="`/inventory/${item.id}/delete`" @click.prevent="deleteInventoryItem(item)">
|
<a :href="`/inventory/${item.id}/delete`" @click.prevent="deleteInventoryItem(item)">
|
||||||
<b-icon-trash></b-icon-trash>
|
<b-icon-trash></b-icon-trash>
|
||||||
</a>
|
</a>
|
||||||
|
<router-link :to="shortIdLink(item)">
|
||||||
|
<b-icon-link></b-icon-link>
|
||||||
|
</router-link>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
</tbody>
|
</tbody>
|
||||||
|
|
@ -65,11 +68,14 @@
|
||||||
</div>
|
</div>
|
||||||
<div class="btn-group">
|
<div class="btn-group">
|
||||||
<button class="btn btn-danger btn-sm"
|
<button class="btn btn-danger btn-sm"
|
||||||
@click="deleteInventoryItem(item.id)">Delete
|
@click="deleteInventoryItem(item)">Delete
|
||||||
</button>
|
</button>
|
||||||
<router-link :to="`/inventory/${item.id}/edit`"
|
<router-link :to="`/inventory/${item.id}/edit`"
|
||||||
class="btn btn-primary btn-sm">Edit
|
class="btn btn-primary btn-sm">Edit
|
||||||
</router-link>
|
</router-link>
|
||||||
|
<router-link :to="shortIdLink(item)" class="btn btn-secondary btn-sm">
|
||||||
|
<b-icon-link></b-icon-link>
|
||||||
|
</router-link>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -94,6 +100,7 @@ import {mapActions, mapGetters, mapMutations, mapState} from "vuex";
|
||||||
import * as BIcons from "bootstrap-icons-vue";
|
import * as BIcons from "bootstrap-icons-vue";
|
||||||
import BaseLayout from "@/components/BaseLayout.vue";
|
import BaseLayout from "@/components/BaseLayout.vue";
|
||||||
import AuthenticatedImage from "../components/AuthenticatedImage.vue";
|
import AuthenticatedImage from "../components/AuthenticatedImage.vue";
|
||||||
|
import {encodeShortId, serializeShortId} from "@/short-id";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "Inventory",
|
name: "Inventory",
|
||||||
|
|
@ -120,6 +127,13 @@ export default {
|
||||||
const loc = this.storage_locations.find(loc => loc.id === item.storage_location)
|
const loc = this.storage_locations.find(loc => loc.id === item.storage_location)
|
||||||
return loc ? loc.path : null
|
return loc ? loc.path : null
|
||||||
},
|
},
|
||||||
|
shortIdLink(item) {
|
||||||
|
// owner_identity_id is a placeholder until the backend exposes a KnownIdentity pk
|
||||||
|
// per item (see docs/handles-and-shortids.md) - it doesn't decode to a
|
||||||
|
// meaningful owner yet.
|
||||||
|
const ints = serializeShortId({kind: 'item', owner_identity_id: 0, item_local_id: item.id});
|
||||||
|
return '/' + encodeShortId(ints);
|
||||||
|
},
|
||||||
},
|
},
|
||||||
async mounted() {
|
async mounted() {
|
||||||
await this.fetchInventoryItems()
|
await this.fetchInventoryItems()
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue