Fixed a number of bugs; added a few fields.
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
<script>
|
||||
import {Meteor} from "meteor/meteor";
|
||||
import {onMount} from "svelte";
|
||||
import {writable} from "svelte/store";
|
||||
import {writable, derived} from "svelte/store";
|
||||
import TextField from '@smui/textfield';
|
||||
import HelperText from '@smui/textfield/helper-text';
|
||||
import Select, { Option } from '@smui/select';
|
||||
@@ -16,8 +16,13 @@
|
||||
Meteor.subscribe('assets');
|
||||
});
|
||||
let assetTypes;
|
||||
$: assetTypes = AssetTypes.find({});
|
||||
|
||||
$: assetTypes = AssetTypes.find({}, {sort: {year: -1}});
|
||||
$: assetTypeNameMap = derived(assetTypes, $assetTypes => $assetTypes.reduce((map, obj) => {
|
||||
map[obj._id] = obj.name;
|
||||
return map;
|
||||
}, {}));
|
||||
|
||||
|
||||
// Asset Table //
|
||||
|
||||
const assetColumns = [
|
||||
@@ -35,6 +40,17 @@
|
||||
minWidth: 100,
|
||||
weight: 1,
|
||||
cls: "serial",
|
||||
}, {
|
||||
key: "asset",
|
||||
title: "Asset Type",
|
||||
value: v => {
|
||||
$: {
|
||||
return v.assetTypeId ? $assetTypeNameMap[v.assetTypeId] : "-"
|
||||
}
|
||||
},
|
||||
minWidth: 100,
|
||||
weight: 1,
|
||||
cls: "serial",
|
||||
},
|
||||
];
|
||||
const assetActions = {
|
||||
|
||||
Reference in New Issue
Block a user